This file contains 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
# Filtering utilities | |
import numpy as np | |
from numpy import pi | |
from numpy import fft | |
from scipy import signal | |
import scipy.signal as sig | |
import pylab as plt | |
#### Functions ################# |
This file contains 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
In [40]: A = randLILMatrix(10,10); A.set_type(FF(2)) | |
In [45]: A | |
Out[45]: | |
⎡1 mod 2 0 mod 2 0 mod 2 0 mod 2 0 mod 2 1 mod 2 0 mod 2 1 mod 2 0 mod 2 1 mod 2⎤ | |
⎢ ⎥ | |
⎢0 mod 2 1 mod 2 1 mod 2 1 mod 2 0 mod 2 0 mod 2 1 mod 2 0 mod 2 1 mod 2 1 mod 2⎥ | |
⎢ ⎥ | |
⎢1 mod 2 0 mod 2 0 mod 2 0 mod 2 0 mod 2 1 mod 2 1 mod 2 1 mod 2 1 mod 2 0 mod 2⎥ | |
⎢ ⎥ |
This file contains 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
# GPLv2+, by fcicq | |
# from http://www.hpl.hp.com/techreports/98/HPL-98-135.pdf | |
IRRED_COEFF = [ | |
4,3,1,5,3,1,4,3,1,7,3,2,5,4,3,5,3,2,7,4,2,4,3,1,10,9,3,9,4,2,7,6,2,10,9, | |
6,4,3,1,5,4,3,4,3,1,7,2,1,5,3,2,7,4,2,6,3,2,5,3,2,15,3,2,11,3,2,9,8,7,7, | |
2,1,5,3,2,9,3,1,7,3,1,9,8,3,9,4,2,8,5,3,15,14,10,10,5,2,9,6,2,9,3,2,9,5, | |
2,11,10,1,7,3,2,11,2,1,9,7,4,4,3,1,8,3,1,7,4,1,7,2,1,13,11,6,5,3,2,7,3,2, | |
8,7,5,12,3,2,13,10,6,5,3,2,5,3,2,9,5,2,9,7,2,13,4,3,4,3,1,11,6,4,18,9,6, | |
19,18,13,11,3,2,15,9,6,4,3,1,16,5,2,15,14,6,8,5,2,15,11,2,11,6,2,7,5,3,8, | |
3,1,19,16,9,11,9,6,15,7,6,13,4,3,14,13,3,13,6,3,9,5,2,19,13,6,19,10,3,11, |
This file contains 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 twython; | |
twitter = twython.Twython(twitter_token='CONSUMER_KEY', twitter_secret='CONSUMER_SECRET', oauth_token='ACCESS_TOKEN', oauth_token_secret='ACCESS_TOKEN_SECRET'); | |
twitter.updateStatus(status='MESSAGE'); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 requests | |
from requests_oauthlib import OAuth1 | |
import json | |
auth = OAuth1(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET) | |
client = requests.Session() | |
client.auth = auth | |
client.stream = True | |
response = client.post('https://stream.twitter.com/1.1/statuses/filter.json', data={'track': '@mikehelmick'}) |
This file contains 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 urllib | |
import json | |
response = urllib.urlopen("http://search.twitter.com/search.json?q=smu") | |
d = json.load(response) | |
print len(d.keys()) | |
print d.keys() | |
print type(d["results"]) | |
print len(d["results"]) |
This file contains 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
# Ipython session | |
# curl 'http://search.twitter.com/search.json?q=json&rpp=5&include_entities=true' | jq | |
import json | |
data = !curl 'http://search.twitter.com/search.json?q=json&rpp=5&include_entities=true' | |
js = json.loads(data[-1]) | |
js.keys() | |
[u'next_page', | |
u'completed_in', |
This file contains 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 urllib | |
import json | |
response = urllib.urlopen("http://search.twitter.com/search.json?q=EuroVision") | |
pyresponse = json.load(response) | |
results = pyresponse["results"] | |
for i in range(len(results)): | |
print str(i) |