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
var catcher = function() { | |
var fns = Array.prototype.slice.call(arguments); | |
var onerror = fns[0]; | |
fns.splice(0, 1); | |
return function() { | |
var res = []; | |
var errors = []; | |
for (var i=0; i < fns.length; i++) { | |
try { | |
res.push(fns[i].apply(this, arguments)); |
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
This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. This tweet is too long. |
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 Image | |
import random | |
target = Image.open('target.png').convert('RGB') | |
target_distance = 10 | |
def make_image(): | |
return Image.new('RGB', target.size) |
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
class Multi(object): | |
def __init__(self, callback): | |
self.callback = callback | |
self.counter = 0 | |
self.fired = False | |
self.started = False | |
def enter(self): | |
assert not self.started |
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
from contextlib import contextmanager | |
@contextmanager | |
def binding(**pairs): | |
g = globals() | |
prev = dict((k, g[k]) for k in pairs.iterkeys() if k in g) | |
g.update(pairs) | |
try: | |
yield | |
finally: |
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 memory_info(): | |
res = {} | |
for row in open('/proc/meminfo', 'r'): | |
k, v = row.split(':') | |
k = k.strip() | |
v = v.split() | |
if len(v) == 1: | |
v = int(v[0]) | |
elif v[1] == 'kB': | |
v = int(v[0]) * 1024 |
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
(defn parse-row | |
[^String row] | |
(let [[k v] (.split row \tab) | |
[k1 k2] (map (partial string/join " ") (json/read-str k))] | |
[k1 k2 (Long/parseLong (.trim v))])) | |
(defn co-occurrence | |
[dir] | |
(let [source (hfs-textline dir)] | |
(<- [?k1 ?k2 ?count] |
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
http://0-www.sciencedirect.com.www.consuls.org/science?_ob=QuickSearchURL&_method=submitForm&_acct=C000050221&md5=0c4b6db32507e4a332b2aa6dd47a65f4&qs_all={searchTerms}&qs_author=&qs_title=&qs_vol=&qs_issue=&qs_pages=&x=34&y=15 | |
http://0-dictionary.oed.com.library.utulsa.edu/cgi/findword?query_type=word&queryword={searchTerms} | |
http://100.daum.net/search/search.do?query={searchTerms} | |
http://1000corks.com/search?st={searchTerms}&src=myc | |
http://11870.com/konsulto/{searchTerms} | |
http://1000memories.com/search?q={searchTerms} | |
http://130.219.35.129/search?q={searchTerms}&btnG=Google+Search&entqr=0&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&client=default_frontend&ud=1&oe=UTF-8&ie=UTF-8&proxystylesheet=default_frontend&site=default_collection | |
http://1337x.org/search/{searchTerms}/0/ | |
http://11888.ote.gr/web/guest/white-pages/search?who={searchTerms}&where= | |
http://140.111.34.46/cgi-bin/newDict/dict.sh?idx=dict.idx&cond={searchTerms}&pieceLen=50&fld=1&cat=&imgFont=1 |
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
static PyObject *__pyx_pf_4test_fib(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) { | |
PyObject *__pyx_v_SZ = NULL; | |
PyObject *__pyx_v_i = NULL; | |
PyObject *__pyx_v_a = NULL; | |
PyObject *__pyx_v_b = NULL; | |
PyObject *__pyx_v_t = NULL; | |
PyObject *__pyx_r = NULL; | |
__Pyx_RefNannyDeclarations | |
PyObject *__pyx_t_1 = NULL; |