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 numpy as np | |
from scipy import stats | |
np.random.seed(1) | |
F_true = 1000 # random range | |
N = 50 # number of measurements | |
F = stats.poisson(F_true).rvs(N) | |
e = np.sqrt(F) # errors on Poisson counts estimated via square root | |
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
require 'linalg' | |
include Linalg | |
# Linear equation to solve: | |
# a * x = b | |
# | |
# Example | |
# a = DMatrix[[1,0,0],[0,2,0],[0,0,1]] | |
# b = DMatrix[[1,1],[2,2],[3,3]] | |
# |
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 pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pylab | |
plt.rcParams['font.size'] = 8.0 | |
plt.rcParams['figure.figsize'] = 6.0, 4.0 | |
df = pd.DataFrame.from_csv('/Users/gsc//Dropbox/datasets/pseudo_facebook.tsv', sep='\t') |
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 pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pylab | |
import datetime as dt | |
## | |
# Response time analysis | |
df_tbi = pd.DataFrame(np.arange(1,8)) | |
df_tbi['response_cal_time'] = np.array([850,4345,19000,5827,3904,2756,8550]) |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.node { | |
font: 10px sans-serif; | |
} | |
.link { | |
stroke: steelblue; |
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
# Run with PATH=/Applications/Julia.app/Contents/Resources/julia/bin:/usr/bin:/bin:/usr/sbin:/sbin FONTCONFIG_PATH=/Applications/Julia.app/Contents/Resources/julia/etc/fonts PKG_CONFIG_PATH=/Applications/Julia.app/Contents/Resources/julia/lib/pkgconfig GIT_EXEC_PATH=/Applications/Julia.app/Contents/Resources/julia/libexec/git-core GIT_TEMPLATE_DIR=/Applications/Julia.app/Contents/Resources/julia/share/git-core /Applications/Julia.app/Contents/Resources/julia/bin/julia -p 2 | |
# Typically n > 2000000000 | |
@everywhere function pbench(n) | |
it = time() | |
nheads = @parallel (+) for i=1:n | |
int(randbool()) | |
end | |
ft = time()-it | |
end |
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
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<title>SUJ Geo walks</title> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script> | |
<script type="text/javascript"> | |
var path = []; |
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<link type="text/css" rel="stylesheet" href="flare-style.css"/> | |
<style type="text/css"> | |
path.arc { | |
cursor: move; | |
fill: #fff; | |
} |
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 tornado.httpserver | |
import tornado.websocket | |
import tornado.ioloop | |
import tornado.web | |
import time | |
import random | |
# Preload data | |
# ... use from previous gists | |
#import numpy as np |
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
## | |
# Call with: | |
# curl -i -H "Accept: application/json" "http://localhost:4567/?foo=1" | |
# or post with: | |
# curl -X POST -H "Accept: application/json" "http://localhost:4567/?foo=1" --data "foo=2" | |
## | |
require 'rubygems' | |
require 'sinatra' | |
require 'json' | |
OlderNewer