Skip to content

Instantly share code, notes, and snippets.

View tripped's full-sized avatar

Trip Volpe tripped

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tripped on github.
  • I am tripped (https://keybase.io/tripped) on keybase.
  • I have a public key whose fingerprint is 4B98 1AD8 E3A5 F178 957C C78C E3DD 764F 193C 5008

To claim this, I am signing this object:

Y = lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda arg: f(f)(arg)))
parse_19_02 = lambda s: \
(lambda (str,terminator) = (lambda x = \
Y(lambda f: lambda src: \
(lambda c = next(src): \
[c] if (c == 1 or c == 2) else [c] + f(src))())(s):
((Types.String, x[:len(x)-1]), x[len(x)-1]))():
('19 02', [str], 'load "#a"') if terminator == 2 else
('19 02', [str, long(s)], 'load "#a" -> $#bbbbbb'))()
#include <set>
#include <utility>
#include <iostream>
#include <initializer_list>
#include <algorithm>
#include <math.h>
std::set<int> divisors(int n)
{
std::set<int> divs;
from itertools import product, ifilter
from operator import add
from math import sqrt
def divisors(n):
return [1] + reduce(add, ([i, n//i] for i in range(2, int(sqrt(n)) + 1) if n % i == 0), [])
def is_amicable((a, b)):
return sum(divisors(a)) == b and sum(divisors(b)) == a
libevent
bison
flex
libjansson-dev
libevent-dev
libxml2-dev
libpcre3-dev
libpq-dev
class Foo(object):
@staticmethod
def pies():
print "Hello"
Foo.pies()
@tripped
tripped / gist:4249499
Created December 10, 2012 09:02
Kivy log output; instantiating Widget prevents Image segfault
)$ python crash.py
[INFO ] Kivy v1.4.1
[INFO ] [Logger ] Record log in /home/tvolpe/.kivy/debug/kivy_12-12-10_3.txt
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=60s
[INFO ] [Factory ] 123 symbols loaded
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones
[INFO ] [Window ] using <pygame> as window provider
@tripped
tripped / gist:4249428
Created December 10, 2012 08:55
Kivy log output; segfault when loading Image
$ python crash.py
[INFO ] Kivy v1.4.1
[INFO ] [Logger ] Record log in /home/tvolpe/.kivy/debug/kivy_12-12-10_1.txt
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60s
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=Nones
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=60s
[INFO ] [Factory ] 123 symbols loaded
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=Nones
[DEBUG ] [ImagePygame ] Load <foo.png>
@tripped
tripped / gist:4185952
Created December 1, 2012 23:37
The sane way to parse [19 02] control code arguments
def parse_19_02(source):
str = []
cur = next(source)
while cur != 1 and cur != 2:
str.append(cur)
cur = next(source)
str = ('String', str)
if cur == 2:
return ('19 02', [str], 'load "#a"')
else:
@tripped
tripped / cthulhu.py
Created December 1, 2012 01:38
The horror, the horror
lambda s: \
(lambda (str,terminator) = (lambda x =
(lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda arg: f(f)(arg))))
(lambda f: lambda src:
(lambda c = next(src):
[c] if (c == 1 or c == 2) else [c] + f(src))())(s):
(('String', x[:len(x)-1]), x[len(x)-1]))():
('19 02', [str], 'load "#a"') if terminator == 2 else
('19 02', [str, parse_long(s)], 'load "#a" -> $#bbbbbb'))()