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
| // Basic Usage: | |
| // | |
| // var main = new Canvas({ elem: "canvas" }, function(options) { | |
| // // Instantiate anything specific here... | |
| // // Main draw loop | |
| // this.draw = function() { | |
| // | |
| // }; | |
| // }); | |
| // |
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 esprima = require('esprima'); | |
| function instrument(code) { | |
| var LOOP_CHECK = 'if (window.CP.shouldStopExecution(%d)){break;}'; | |
| var LOOP_EXIT = "\nwindow.CP.exitedLoop(%d);\n"; | |
| var loopId = 1; | |
| var patches = []; | |
| esprima.parse(code, { |
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
| #!/usr/bin/env node | |
| var nodecast = require('nodecast); | |
| var stream = nodecast.find(); | |
| stream.on('device', function(device) { | |
| console.log('Found', device.name);//, device.info); | |
| if (typeof device.apps === 'function') { | |
| device.apps(function(err, apps){ | |
| console.log('Applications for', device.name, apps); |
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 macros, ../src/arraymancer | |
| # Transforms | |
| dumpTree: | |
| network model_name: | |
| context: ctx | |
| input_shape: [1, 28, 28] # Real shape [N, 1, 28, 28] | |
| layers: |
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
| class P5Controls { | |
| constructor(config) { | |
| this.config = config; | |
| this.controls = {}; | |
| } | |
| add(control) {} | |
| setup() { | |
| this.config.forEach((control, i) => { | |
| switch (control.type) { | |
| case "slider": |