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 __future__ import division | |
import numpy as np | |
import scipy.stats as stats | |
from matplotlib import pyplot as plt | |
def plot(data,cdf=stats.norm.cdf): | |
plt.figure() | |
plt.plot(np.cumsum(1./len(data) * np.ones(data.shape)),cdf(np.sort(data)),'bx') | |
plt.plot((0,1),(0,1),'r-') |
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
#!/bin/bash | |
usage() | |
{ | |
echo "usage: ${0##*/} source-path exported-archive-name.tgz" | |
} | |
if [ $# -ne 2 ] | |
then | |
usage |
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
#!/bin/bash -e | |
USERNAME=mitmatt | |
NODE=seattle | |
INTERFACE=AirPort | |
LOCAL_PORT=1080 | |
CONTROL_SOCKET=~/.ssh/control-tunnelr | |
CONNECT_COMMAND=connect | |
DISCONNECT_COMMAND=disconnect |
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
#!/bin/bash | |
usage() | |
{ | |
echo "usage: ${0##*/} [--reuse]" | |
} | |
if [ $# -gt 1 -o "$1" = "--help" ] | |
then | |
usage |
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
#!/bin/bash -ev | |
hash git 2>&- || { echo >&2 "You must install git first."; exit 1; } | |
cd | |
git clone https://github.com/mattjj/dotfiles.git ./.dotfiles | |
bash .dotfiles/links.sh | |
cd | |
git clone https://github.com/mattjj/config-vim.git ./.vim |
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 __future__ import division | |
from matplotlib import pyplot as plt | |
import numpy as np | |
na = np.newaxis | |
# I got ADP historical data from the "Historical Data" link here: | |
# http://www.adpemploymentreport.com/ | |
# I got BLS data here: | |
# http://data.bls.gov/timeseries/CES0000000001?output_view=net_1mth | |
# I munged the two into text files for the same dates by hand (copy/paste into vim) |
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 numpy as np | |
cimport numpy as np | |
ctypedef np.float64_t float64_t | |
def inner(np.ndarray[float64_t] x, np.ndarray[float64_t] y): | |
cdef Py_ssize_t i, n = len(x) | |
cdef float64_t result = 0 | |
for i in range(n): | |
result += x[i] * y[i] | |
return 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
#!/usr/bin/env python | |
from __future__ import division | |
import sys, dateutil | |
from matplotlib import pyplot as plt | |
def main(sep='\t'): | |
dates, vals = [], [] | |
for line in sys.stdin: | |
try: | |
datestring, valstring = line.strip().split(sep) |
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
var socket = io.connect(window.location.host); | |
var received; | |
socket.on('data', function (data) { | |
received = JSON.parse(data); | |
}); |
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
#!/bin/bash -e | |
baseurl='http://search.twitter.com/search.json?q=sandy&rpp=100&since=2012-10-27&until=2012-10-30&callback=?' | |
touch allresults.json | |
curl -s $baseurl | jq '.results | .[]' >> allresults.json | |
maxid=$(<allresults.json jq '.id' | tail -1) | |
while [ $maxid -gt 0 ] | |
do |
OlderNewer