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
@app.route('/retrieve', methods= ['GET']) | |
def retriever(): | |
# can be made even more condensed (sure of it) | |
a= [] | |
b=[] | |
run=[] | |
tim=[] | |
a2= [] | |
b2=[] |
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
@app.route('/insert', methods=['POST', 'GET']) | |
def dumper(): | |
if request.method == 'POST': | |
# var= request.data | |
var= request.args.get('data') | |
var2= request.data | |
result= {"O1":var} | |
print result | |
print var2 | |
posts.insert(result) |
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, render_template | |
from pymongo import MongoClient | |
#setting up the flask app | |
app=Flask(__name__) | |
#connecting to mongoDB | |
client=MongoClient('localhost', 27017) | |
db=client.emosis |
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
@app.route('/update', methods=['POST']) | |
def mongoupdate(): | |
<pymongo code here> | |
@app.route('/retrieve', methods=['GET']) | |
def mongosend(): | |
<pymongo code here> | |
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], |
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
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 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
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
#include <math.h> | |
int Voice = A0; // select the input pin for the potentiometer | |
int sensorValue=0; | |
void setup() { | |
Serial.begin(115200); | |
pinMode(Voice, INPUT); | |
} |