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 handPos = { handId: '', normX: 0, normY: 0, normZ: 0, posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0, set: false }; | |
Leap.loop(function (frame) { | |
var handIds = {}; | |
if (frame.hands === undefined) { | |
var handsLength = 0 | |
} else { | |
var handsLength = frame.hands.length; | |
} |
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
using System.Net; | |
using System.Net.Sockets; | |
string hostName = "192.168.1.1"; | |
int port = 5000; | |
string msg = "Hello"; | |
UdpClient udpClient = new UdpClient(hostName, port); | |
Byte[] sendBytes = Encoding.ASCII.GetBytes(msg); |
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
using System; | |
using UnityEngine; | |
using UnityEngine.UI; //required for Input.compass | |
public float compassSmooth = 0.5f; | |
private float m_lastMagneticHeading = 0f; | |
public class CompassController : MonoBehaviour { | |
// Use this for initialization | |
void Start () { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Trail</title> | |
</head> | |
<body> | |
<div class="parent"> | |
<div class="container"> | |
<canvas id="trailCanvas" width="800" height="600" style="margin:0;padding:0;z-index:500; border: 1px solid #000;"></canvas> |
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 x = document.getElementById("demo"); | |
var watchID = null; | |
var counter = 0; | |
function geo_success(position) { | |
counter += 1; | |
x.innerHTML = "Latitude: " + position.coords.latitude + ", Longitude: " + position.coords.longitude + ", Count: " + counter; | |
} | |
function geo_error() { | |
x.innerHTML = "Sorry, no position available."; |
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
window.onload = function () { | |
var video = document.getElementById('video'); | |
var canvas = document.getElementById('canvas'); | |
var context = canvas.getContext('2d'); | |
var tracker = new tracking.ObjectTracker('face'); | |
try{ | |
tracker.setInitialScale(4); | |
tracker.setStepSize(2); | |
tracker.setEdgesDensity(0.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
var piComms = function (userName, setGlobal, pingInterval) { | |
'use strict'; | |
var user = userName; | |
var pingTimerId; | |
var pingTimerInterval = (pingInterval != undefined) ? pingInterval : 5000; | |
setGlobal = (setGlobal != undefined && setGlobal == false); | |
var pub = { | |
setUserName: function (userName) { |
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
//npm install csv | |
//npm install mongodb | |
var csv = require('csv'); | |
var fs = require('fs'); | |
var start = Date.now(); | |
// Retrieve | |
var mongoclient = require('mongodb').MongoClient; |
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 localizeReader = exports; | |
(function (localizeReader) { | |
localizeReader.get = function(obj, culture){ | |
var c = (!culture) ? 'default': culture; | |
if(obj[c] !== undefined) return obj[c]; | |
c = c.split('-')[0]; | |
if(obj[c] !== undefined) return obj[c]; | |
for (var prop in obj) { | |
return obj[prop]; | |
} |