Skip to content

Instantly share code, notes, and snippets.

View raihanba13's full-sized avatar

raihanba13

View GitHub Profile
phi = np.linspace(0, 1 / 2 * np.pi, 16)
fiber_bundle_trj = 200 * np.array([np.cos(phi), np.sin(phi), 0 * phi]).T
population = fastpli.model.sandbox.seeds.triangular_circle(20, 5)
fiber_radii = np.random.uniform(2.0, 10.0, population.shape[0])
fiber_bundle = fastpli.model.sandbox.build.bundle(fiber_bundle_trj, population, fiber_radii)
t = np.linspace(0, 4 * np.pi, 50, True)
traj = np.array((42 * np.cos(t), 42 * np.sin(t), 10 * t)).T
# Snake shape trajectory equation
n = 15
A = randi([0 1], n,n)
while 1
spy(A)
% here is the logic of dead or alive
% we will check full row first, then we will move to next column
for i=2:n-1
"""This code sample demonstrates an implementation of the Lex Code Hook Interface
in order to serve a bot which manages dentist appointments.
Bot, Intent, and Slot models which are compatible with this sample can be found in the Lex Console
as part of the 'MakeAppointment' template.
For instructions on how to set up and test this bot, as well as additional samples,
visit the Lex Getting Started documentation http://docs.aws.amazon.com/lex/latest/dg/getting-started.html.
"""
import json
import json
import dateutil.parser
import datetime
import time
import os
import math
import random
import logging
logger = logging.getLogger()
"""This code sample demonstrates an implementation of the Lex Code Hook Interface
in order to serve a bot which manages dentist appointments.
Bot, Intent, and Slot models which are compatible with this sample can be found in the Lex Console
as part of the 'MakeAppointment' template.
For instructions on how to set up and test this bot, as well as additional samples,
visit the Lex Getting Started documentation http://docs.aws.amazon.com/lex/latest/dg/getting-started.html.
"""
import json
"""This code sample demonstrates an implementation of the Lex Code Hook Interface
in order to serve a bot which manages dentist appointments.
Bot, Intent, and Slot models which are compatible with this sample can be found in the Lex Console
as part of the 'MakeAppointment' template.
For instructions on how to set up and test this bot, as well as additional samples,
visit the Lex Getting Started documentation http://docs.aws.amazon.com/lex/latest/dg/getting-started.html.
"""
import json
@raihanba13
raihanba13 / SimpleBoxExtrudeAPIdemo.py
Created October 14, 2020 03:01
Script to demonstrate basic use of Autodesk Fusion 360 API
import adsk.core, adsk.fusion, adsk.cam, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
# we create a blank new document
doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
odd = lambda x : bool(x % 2)
numbers = [n for n in range(10)]
numbers[:] = [n for n in numbers if not odd(n)] # ahh, the beauty of it all
numbers
# output [0, 2, 4, 6, 8]
@raihanba13
raihanba13 / timezone_in_python.py
Created November 30, 2019 13:28
timezone_in_python.py
import datetime
import pytz
my_date = datetime.datetime.now(pytz.timezone('US/Pacific'))
print(my_date)
'''
for tz in pytz.all_timezones:
print tz
var data = JSON.stringify({
"method": "Authenticate",
"params": {
"database": "database",
"userName": "[email protected]",
"password": "password"
}
});
var xhr = new XMLHttpRequest();