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
# Context manager to generate batches in the background via a process pool | |
# Usage: | |
# | |
# def batch(seed): | |
# .... # generate minibatch | |
# return minibatch | |
# | |
# with BatchGenCM(batch) as bg: | |
# minibatch = next(bg) | |
# .... # do something with minibatch |
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
function run(generator) { | |
// Pass in resume for no-wrap function calls | |
var iterator = generator(resume); | |
var data = null, yielded = false; | |
next(); | |
check(); | |
function next(item) { | |
var cont = iterator.next(item).value; |
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
# Benchmark to compare the times for storing numpy arrays in a key-value. | |
# The main point is to compare numpy serialization vs a bcolz approach. | |
from __future__ import print_function | |
import sys | |
import os | |
import os.path | |
import subprocess | |
import getopt |
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
start on runlevel [2345] | |
stop on runlevel [016] | |
respawn | |
setuid <user> | |
chdir /home/<user>/ipython_notebooks | |
exec ipython notebook --pylab --profile=nbserver --ipython-dir=/home/<user>/.ipython --log-level=DEBUG |
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
<script> | |
var namespace = 'onswipe'; | |
var message = JSON.stringify({ | |
view_url: '%%VIEW_URL_UNESC%%', | |
click_url: '%%CLICK_URL_UNESC%%%%DEST_URL%%', | |
cachebuster: '%%CACHEBUSTER%%', | |
glossy_id: 'my_id', | |
type: 'glossy', | |
pixels: [] | |
}); |
NewerOlder