Skip to content

Instantly share code, notes, and snippets.

View README.rst

@glassask

Operation

A glass user sends a question with an optional location (sent if their question starts with "where") and option picture. @glassask multiplexes many glass users and this is invisible to annotators (not necessarily true that the same glass user is posting the tweets). When a reply is made from twitter it is parsed (see Tweet parsing below) and sent to the originating user's glass (i.e., whoever asked the question).

Tweets

View picarus_takeout_windows.txt
Include paths
C:\Users\Administrator\Desktop\picarus-deps\pthreads\include;C:\Users\Administrator\Desktop\picarus-deps\fftw3;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\videostab;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\world\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\video\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\ts\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\superres\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\stitching\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\python\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\ocl\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\nonfree\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\legacy\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\java\include;C:\Users\Administrator\Desktop\picarus-deps\opencv\modules\photo\include;C:\Users\Administrat
View sklearn_kernel.py
import sklearn.svm
import random
import numpy as np
if 0:
import kernels
kernel = kernels.histogram_intersection
else:
kernel = lambda x, y: np.dot(x, y.T)
View generator_closures.py
# Closures + Generators: Check yourself before you wreck yourself
def outer():
for x in range(10):
a = x
def inner():
print(a)
yield inner
# Sequential call, can't tell anything is wrong
@bwhite
bwhite / data_sources.py
Created Nov 12, 2012
Standardized data source interface
View data_sources.py
import os
import re
import urllib
def data_source_from_uri(data_source_path):
try:
data_source_path, query_string = data_source_path.split('?', 1)
except ValueError:
columns = {}
@bwhite
bwhite / wc.py
Created Sep 23, 2012
Hadoopy Workcount
View wc.py
import hadoopy
def mapper(key, value):
# Split line into words
for word in value.split():
yield word, 1
def reducer(key, values):
yield key, sum(values)
@bwhite
bwhite / crawl.py
Created Sep 23, 2012
Gevent Crawler Demo
View crawl.py
from gevent import monkey, spawn, joinall
monkey.patch_all() # Magic!
import re, requests, random
URLS = set(['http://umd.edu', 'http://nytimes.com'])
def crawl(urls):
try:
while True:
url = random.choice(list(urls))
URLS.add(url)
print(url)
@bwhite
bwhite / demo.sh
Created Sep 23, 2012
ZMQ Pub/Sub Example
View demo.sh
python zmq_client_sub.py &
python zmq_client_sub.py &
python zmq_server_pub.py
@bwhite
bwhite / hbase_bench.txt
Created Sep 22, 2012
Machine benchmark
View hbase_bench.txt
http://wiki.apache.org/hadoop/Hbase/PerformanceEvaluation