This file contains 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
function drawEllipse(ctx, x,y, w, h) { | |
varkappa = .5522848, | |
ox = (w /2)*kappa, // controlpointoffset horizontal | |
oy = (h /2)*kappa, // controlpointoffsetvertical | |
xe = x + w, // x-end | |
ye = y + h, //y-end | |
xm = x + w /2, // x-middle | |
ym = y + h /2; //y-middle | |
ctx.beginPath(); | |
ctx.moveTo(x,ym); |
This file contains 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 timeOut = 7; | |
varangleInc = 360/ (timeOut*100); | |
varangle = 0; | |
var lastTime = 0; |
This file contains 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
//draw colormap->palettevalues toscreen | |
vardraw = function() | |
{ | |
// render theimagedatatotheoffscreen buffer... | |
bufferContext.putImageData(imageData,0,0); | |
// ...then draw it toscaletotheonscreen canvas | |
// Imagedebaseen bas ! | |
var timeStamp = new Date().getTime(); | |
angle += angleInc*((lastTime- timeStamp) /100); | |
angle = angle % 360; |
This file contains 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 color = 'red'; | |
this.init = function(colorToApply,dim) | |
{ | |
if (colorToApply){ | |
color = colorToApply; | |
} | |
context = this.canvas.getContext('2d'); | |
width = Math.round(this.canvas.width / scale); | |
height = Math.round(this.canvas.height / scale); | |
if (dim){ |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 qui écoute les événements provenant du sdk | |
class DataCollector : public myo::DeviceListener { | |
public: | |
... | |
// Appelé pour donner les données sur l'orientation, | |
void onOrientationData(myo::Myo* myo, uint64_t timestamp, const myo::Quaternion<float>& quat) | |
{ | |
using std::atan2; | |
using std::asin; | |
using std::sqrt; |
This file contains 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
{ | |
"author": "jefBinomed", | |
"name": "MyoEV3", | |
"version": "1.0.0", | |
"dependencies": {}, | |
"devDependencies": { | |
"bluetooth-serial-port": "1.1.4", // Utilisé pour la communication bluetooth | |
"express" : "3.x" // Utilisé pour la partie serveur | |
} | |
} |
This file contains 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 app = express() | |
.use(express.static('public')) | |
.use(function(req, res){ | |
... | |
}); | |
http.createServer(app).listen(8090); | |
console.log('-------------------------------'); | |
console.log('Start Http server on port : '+8090); |
This file contains 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
<link rel="import" | |
href="/components/polymer/polymer.html"> | |
<polymer-element name="ready-element"> | |
<template> | |
This element has a ready() method. | |
<span id="el">Not ready...</span> | |
</template> | |
<script> | |
Polymer({ | |
owner: "Daniel", |
This file contains 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
components.directive('leapMouseMove', ['$rootScope' | |
,function ($rootScope) { | |
var directiveDefinitionObject = { | |
restrict: 'A', | |
scope: false, | |
link: function postLink($scope, iElement, iAttrs) { | |
var element = iElement[0]; | |
var boundingRect = element.getBoundingClientRect(); | |
console.log('Id : '+element.id); | |
console.log(boundingRect); |