Skip to content

Instantly share code, notes, and snippets.

@fruitl00p
fruitl00p / bench.php
Created October 13, 2016 08:58
gzdeflate / gzcompress / gzencode
<?php
// GLOBALS available: $db, $currentImplementation, $currentUser, $currentSite, $currentPage
// PARAMS available: $sqlArray (array), $request (Web_request)
//
// GLOBALS available: $db, $currentImplementation, $currentUser, $currentSite, $currentPage
// PARAMS available: $sqlArray (array), $request (Web_request)
//
$string = 'thisismystringthisismystringthisismystringthisismystringthisis'
. 'mystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthis'
. 'ismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringthisismystringth'
@stucchio
stucchio / compass.py
Created January 8, 2016 10:44
Bayesian compass calibration script
from pylab import *
from scipy.stats import norm, uniform
theta_grid = arange(0,2*pi,1.0/1024.0)
true_b = pi/2
b_belief = ones(shape=theta_grid.shape, dtype=float)
b_belief /= b_belief.sum()