Skip to content

Instantly share code, notes, and snippets.

@mrocklin
mrocklin / http-mesos-tornado.py
Last active September 14, 2016 21:46 — forked from anonymous/log
from collections import deque
import json
from tornado.ioloop import IOLoop
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from tornado import gen
bytes_buffer = deque()
messages = []
@mrocklin
mrocklin / trace.py
Created July 11, 2016 21:03 — forked from jcrist/trace.py
Dask Execution Tracer
import os
from dask.callbacks import Callback
from dask.dot import dot_graph
class Track(Callback):
def __init__(self, path='dasks'):
self.path = path
self.n = 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mrocklin
mrocklin / func_plot.py
Created December 26, 2012 19:58 — forked from anonymous/func_plot.py
A quick example of plotting real valued functions. This example highlights the use of functions as first class objects and higher order functions.
from numpy import linspace, sin
from pylab import plot, figure, show
def plotFunction(f):
""" Plot a function on the domain x in (-10, 10) """
xs = linspace(-10, 10, 100)
ys = map(f, xs)
plot(xs, ys)
def derivative(f, dx=.00001):