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
def align_shapes(self, index=True, axis=0, location=1, to_canvas=False): | |
"""Aligns selected shapes either in horizontal or vertical axis to | |
the left, center, right, or top, center, bottom. If to_canvas is True | |
then it aligns to the canvas. | |
Parameters | |
---------- | |
index : bool, list, int | |
index of objects to be selected. Where True corresponds to all | |
objects, a list of integers to a list of objects, and a single | |
integer to that particular object. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 gym | |
from gym import wrappers | |
env = gym.make('CartPole-v0') | |
env = wrappers.Monitor(env, './tmp/cartpole-experiment-1') | |
for i_episode in range(20): | |
observation = env.reset() | |
for t in range(100): | |
env.render() | |
action = env.action_space.sample() | |
observation, reward, done, info = env.step(action) |
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
console.log('Hello LabJack') | |
var ljn = require('labjack-nodejs'); | |
var NanoTimer = require('nanotimer') | |
var fs = require('fs') | |
var now = require('performance-now') | |
var path = require('path') | |
var mkdirp = require('mkdirp').mkdirp |
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 now = require('performance-now') | |
//Require LabJack-nodejs | |
var ljn = require('labjack-nodejs'); | |
//Device object (to control a LabJack device)c | |
var createDeviceObject = ljn.getDevice(); | |
//Device object (to control a LabJack device) | |
var device = new createDeviceObject(); |
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 Mouse = require('node-mouse') | |
var m0 = new Mouse(0) | |
m0.on('mousemove', function (event) { | |
console.log('Mouse 0: [' + event.xDelta + ', ' + event.yDelta + ']') | |
}) | |
var m1 = new Mouse(1) | |
m1.on('mousemove', function (event) { | |
console.log('Mouse 1: [' + event.xDelta + ', ' + event.yDelta + ']') |
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
console.log('Hello Pi') | |
var raspi = require('raspi') | |
var gpio = require('raspi-gpio') | |
var NanoTimer = require('nanotimer') | |
var fs = require('fs') | |
var now = require('performance-now') | |
var path = require('path') | |
var timer = new NanoTimer() |
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
console.log('Hello Pi') | |
var raspi = require('raspi') | |
var gpio = require('raspi-gpio') | |
var NanoTimer = require('nanotimer') | |
var timer = new NanoTimer() | |
raspi.init(function() { | |
console.log('Board-ready') |
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
console.log('Hello Pi') | |
var raspi = require('raspi') | |
var gpio = require('raspi-gpio') | |
raspi.init(function() { | |
console.log('Board-ready') | |
var input = new gpio.DigitalInput(2) | |
var output = new gpio.DigitalOutput(0) |
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 raspi = require('raspi-io') | |
var five = require('johnny-five') | |
var board = new five.Board({ | |
io: new raspi() | |
}) | |
board.on('ready', function() { | |
var led = new five.Led(0) | |
var spdt = new five.Switch(2) |