Skip to content

Instantly share code, notes, and snippets.

View antiface's full-sized avatar

A.G. antiface

View GitHub Profile
@amarvutha
amarvutha / signalFilter.py
Created August 31, 2013 17:28
Signal filtering utility
# 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 #################
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⎥
⎢ ⎥
@antiface
antiface / gf2.py
Created July 7, 2013 13:34 — forked from fcicq/gf2.py
# 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,
@cheeplusplus
cheeplusplus / twython_test.py
Created June 11, 2013 23:23
Sample OAuth post with Twython
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.
@fperez
fperez / TwitterGraphs.ipynb
Last active October 25, 2021 22:21
Exploring graph properties of the Twitter stream with twython, networkx and IPython
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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'})
@SingaporeClouds
SingaporeClouds / fetch_json_from_twitter.py
Created May 28, 2013 06:27
Fetching JSON from Twitter using python
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"])
@safetydank
safetydank / gist:5617553
Created May 21, 2013 04:55
Python JSON filtering
# 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',
@sorrentmutie
sorrentmutie / QueryTweets.py
Created May 14, 2013 16:26
Python code to query Tweeter
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)