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 sys,math | |
s = sys.argv[1] + ' ' | |
def sfx(text): | |
for i in range(len(text)): | |
yield text[i:] | |
def sa(ary , l): | |
for suffix in ary: |
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/python | |
from math import log,ceil | |
log2 = lambda x: log(x,2) | |
def binary(x,l=1): | |
fmt = '{0:0%db}' % l |
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
__author__ = 'weigla' | |
__date__ = '2012-12-12' | |
class LinkCutTree(object): | |
def __init__(self): | |
self.paths = PathSet() | |
self.successor = dict() | |
def maketree(self, id): | |
p = self.paths.makepath(id) |
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/python | |
import numpy as np | |
np.set_printoptions(precision=3, suppress = True) | |
def mprint(n,v): | |
print "%s = \n\t" %n , str(v).replace("\n", "\n\t") | |
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 math import log | |
log2 = lambda x: log(x,2) | |
def entropy(poss): | |
a = lambda p: p * log2( 1/p ) | |
return sum(map(a,poss)) | |
a = (1./6, 1./3, 1./3) |
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
;;; st-mode.el --- A mode for StructuredText after IEC61131-3 | |
;;; | |
;;; | |
;;; Commentary: | |
;; | |
;;; Code: |
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 export(list): | |
def __call__(self, obj): | |
name = getattr(obj, '__name__', None) or \ | |
getattr(obj, '__name', None) or \ | |
getattr(obj, 'name', None) | |
self.append(name) | |
return obj | |
__all__ = export() |
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
# GPLv3, 2015-01-03, Alexander Weigl, Version 0.1 | |
repo_layout_version: 1 | |
msml_version: 1 | |
packages: |
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
.bg-kit-blue { background: rgb(70,100,170) } | |
.bg-kit-blue-100 { background: rgb(70,100,170) } | |
.bg-kit-blue-70 { background: rgb(125,146,195) } | |
.bg-kit-blue-50 { background: rgb(162,177,212) } | |
.bg-kit-blue-30 { background: rgb(199,208,229) } | |
.bg-kit-blue-15 { background: rgb(227,231,242) } | |
.fg-kit-blue { color: rgb(70,100,170) } | |
.fg-kit-blue-100 { color: rgb(70,100,170) } | |
.fg-kit-blue-70 { color: rgb(125,146,195) } | |
.fg-kit-blue-50 { color: rgb(162,177,212) } |
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/python | |
from PIL import Image, ImageDraw | |
from math import cos, sin, pi,log | |
class BarycentricImage(object): | |
def __init__(self, n=3, size=(400,400)): | |
self.dims = n | |
self.size = size |
OlderNewer