This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import dateutil.parser | |
import datetime | |
import time | |
import os | |
import math | |
import random | |
import logging | |
logger = logging.getLogger() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import pytz | |
my_date = datetime.datetime.now(pytz.timezone('US/Pacific')) | |
print(my_date) | |
''' | |
for tz in pytz.all_timezones: | |
print tz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = JSON.stringify({ | |
"method": "Authenticate", | |
"params": { | |
"database": "database", | |
"userName": "[email protected]", | |
"password": "password" | |
} | |
}); | |
var xhr = new XMLHttpRequest(); |
NewerOlder