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 os | |
import time | |
import json | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web |
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 os | |
import time | |
import json | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web |
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
#!/usr/bin/env python | |
# -*- encoding: utf-8 | |
#from IPython.external | |
import sys | |
import argparse | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
paa = parser.add_argument |
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
def send_apply_message(self, socket, f, args=None, kwargs=None, subheader=None, track=False, | |
ident=None): | |
"""construct and send an apply message via a socket""" | |
assert not self._closed, "cannot use me anymore, I'm closed!" | |
# defaults: | |
args = args if args is not None else [] | |
kwargs = kwargs if kwargs is not None else {} | |
subheader = subheader if subheader is not None else {} | |
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
diff --git a/setup.py b/setup.py | |
index f6c7e99..75bd22f 100755 | |
--- a/setup.py | |
+++ b/setup.py | |
@@ -189,7 +189,6 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): | |
packages = find_packages() | |
package_data = find_package_data() | |
-scripts = find_scripts() | |
data_files = find_data_files() |
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 socket | |
def flush(s, buf=1024): | |
"""recv the most recent message, ignoring queued values""" | |
# save timeout | |
to = s.gettimeout() | |
# recv first message in blocking manner | |
msg = s.recv(buf) | |
s.settimeout(0) | |
while True: |
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
# override ioloop.IOLoop with zmq's IOLoop | |
import sys | |
import tornado.ioloop | |
from zmq.eventloop import ioloop | |
tornado.ioloop.IOLoop = ioloop.IOLoop | |
import trombi | |
loop = ioloop.IOLoop.instance() | |
# check that tornado's ioloop instance is actually zmq's |
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
kv_pattern = re.compile(r'\w+\.[\w\.]+\w\=.+') | |
macro_pattern = re.compile(r'\-\-\w[\w\-]+') | |
class KeyValueConfigLoader(CommandLineConfigLoader): | |
"""A config loader that loads key value pairs from the command line. | |
This allows command line options to be gives in the following form:: | |
ipython Global.profile="foo" InteractiveShell.autocall=False | |
""" |
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
#!/usr/bin/env ruby | |
# a script for graphing first non-italic non-parenthetical link paths on wikipedia | |
# per http://www.xkcd.com/903 | |
# | |
require 'rubygems' | |
require 'mechanize' | |
require 'rgl/adjacency' | |
require 'rgl/dot' | |
require 'rgl/traversal' |
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 re | |
from string import uppercase | |
import numpy as np | |
from matplotlib import pyplot as plt | |
dt = [('name', 'a32'), ('gender', 'a1'), ('count', int), ('freq', float), ('year', int)] | |
def fetch_names(dest='names.zip'): |