Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Kinect;
using Coding4Fun.Kinect.Wpf;
class KinectGesturePlayer
{
/// <summary>
/// This is a Gesture module that will detect Gestures, users register callbacks
@doboy
doboy / Programming Languages data
Created April 4, 2012 21:30
CI Scores of Programming Languages
# Language, Favorite Languages, Most Dislike Languages
# http://news.ycombinator.com/item?id=3748961
# http://news.ycombinator.com/item?id=3746692
Actionscript 93 185
Ada 24 20
Assembly 98 46
C 965 58
C++ 529 564
C# 828 116
Clojure 458 24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
starttime = 1335912676604;
endtime = 1335912676604 - 24 * 60 * 60 * 1000;
query = "apply nansum(axis=1) < paste < window(first, field='minute', increment=15) < units to data in (" + starttime + ", " + endtime + ") streamlimit 10000 where Metadata/Extra/System = 'electric' and ((Properties/UnitofMeasure = 'kW' or Properties/UnitofMeasure = 'Watts') or Properties/UnitofMeasure = 'W') and Metadata/Location/Building like 'Etcheverry Hall%' and not Metadata/Extra/Operator like 'sum%' and not Path like '%demand'";
$.ajax({
async: true,
type: 'POST',
query = "apply nansum(axis=1) < paste < window(first, field='minute', increment=15) < units to data in (" + starttime + ", " + endtime + ") streamlimit 10000 where Metadata/Extra/System = 'electric' and ((Properties/UnitofMeasure = 'kW' or Properties/UnitofMeasure = 'Watts') or Properties/UnitofMeasure = 'W') and Metadata/Location/Building like 'Etcheverry Hall%' and not Metadata/Extra/Operator like 'sum%' and not Path like '%demand'";
$.ajax({
async: true,
type: 'POST',
url: '/ARDgetData/api/query?',
data: querystring,
success: function(response) {
console.log(response);
"apply nansum(axis=1) < paste < window(first, field='minute', increment=15) < units to data in (1335917466213, 1335312666213) streamlimit 1000 where Metadata/Extra/System = 'electric' and ((Properties/UnitofMeasure = 'kW' or Properties/UnitofMeasure = 'Watts') or Properties/UnitofMeasure = 'W') and Metadata/Location/Building like 'Soda Hall%' and not Metadata/Extra/Operator like 'sum%' and not Path like '%demand'"
class Tag:
def __init__(self, tag):
self.tag = tag
def __enter__(self):
print '<%s>' % self.tag
def __exit__(self, *_):
print '</%s>' % self.tag
words = []
for line in open('usr/share/dict/words'):
words.append(line.split())
from flask import Flask, send_from_directory, render_template
app = Flask(__name__)
app.debug = True
@app.route("/")
def hello():
return render_template('index.html')
@app.route("/art/<path:filename>")
def arts(filename):
from random import choice
# index by zero like a real computer scientist
dice = range(6)
def Yahtzee(roll):
for i xrange(len(roll)):
if roll[i] != roll[i-1]:
return False
return True