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
numbers= [] | |
def loopy(i): | |
while i<6: | |
print "at the top of i is %d" %i | |
numbers.append(i) | |
i = i+1 | |
print "Numbers now", numbers | |
print "at the bottom of i is %d" %i |
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 sys import exit | |
def goldroom(): | |
print "this room is full of gold. How much do you take?" | |
next= raw_input(">") | |
if "0" in next or "1" in next: #need to find easier way to be selective. range? | |
how_much= int(next) | |
else: |
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 sys import exit | |
from random import randint | |
class Scene (object): #common things that all the scenes will do | |
def enter (self): | |
print "This scene ain't configured yet. Subclass it and implement enter()" | |
exit (1) #exit when there's problems implementing | |
class Engine (object): |
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
#Happy Numbers Project | |
def happynum(num): | |
b=0 | |
while b!=1: | |
b= sum(int (i)**2 for i in str(num)) | |
if b==1: | |
count= 1 | |
else: | |
count=0 |
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
#include <math.h> | |
int Voice = A0; // select the input pin for the potentiometer | |
int sensorValue=0; | |
void setup() { | |
Serial.begin(115200); | |
pinMode(Voice, 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
import xively | |
import datetime | |
import sys | |
import time | |
import xml.etree.ElementTree as etree | |
import numpy | |
XIVELY_API_KEY= "OXrsK9MwFkcLIJvMRlAouni0TBSYPbT2ZU3tuPpP2uqTZfxi" | |
XIVELY_FEED_ID= 146826075 |
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
def plotSomething(): | |
if epoc.newRecord == False or epoc.fftcheck == True or epoc.plot_check == False or epoc.stop==True: | |
return | |
xs = numpy.arange(0, 511) | |
c.setData(xs, epoc.ys) | |
uiplot.qwtPlot.replot() | |
update= epoc.ys[508] | |
up2= numpy.int32(update) |
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
curl http://127.0.0.1:8000/snippets/ | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<meta name="robots" content="NONE,NOARCHIVE"> | |
<title>SyntaxError at /snippets/</title> | |
<style type="text/css"> | |
html * { padding:0; margin:0; } |
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
def savecsv(self): | |
self.O1save.append(self.ys[508]) | |
self.O1save.append(self.ys[509]) | |
self.O1save.append(self.ys[510]) | |
self.O1save.append(self.ys[511]) | |
self.O2save.append(self.ys2[508]) | |
self.O2save.append(self.ys2[509]) | |
self.O2save.append(self.ys2[510]) | |
self.O2save.append(self.ys2[511]) | |
self.ffto1.append(self.pwr) |
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
def mongoupdate(self): | |
client= MongoClient('localhost') | |
# client= MongoClient('128.199.248.15',27017) | |
db=client.emosis | |
for i in xrange(0,len(self.O1save)): | |
post= {"date": self.date[i/4], | |
"O1": self.O1save[i], | |
"O2": self.O2save[i], | |
"fftO1":self.ffto1[i/4], |
OlderNewer