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 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 |
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
# 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 |
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 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; |
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
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', |
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
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); |
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
"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'" |
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 Tag: | |
def __init__(self, tag): | |
self.tag = tag | |
def __enter__(self): | |
print '<%s>' % self.tag | |
def __exit__(self, *_): | |
print '</%s>' % self.tag |
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
words = [] | |
for line in open('usr/share/dict/words'): | |
words.append(line.split()) |
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
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): |
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
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 |
OlderNewer