This file contains hidden or 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 numpy as np | |
import sys | |
# abuse saved to store read lines. | |
def get_cw_pair(fh, saved=[]): | |
c = fh.readline().rstrip() if len(saved) == 0 else saved.pop() | |
if not c: return c, c | |
c = c.split(' ') | |
if c[1] != 'C': | |
w = c[:] |
This file contains hidden or 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 sys | |
sys.stdout = sys.stderr | |
from cgi import parse_qsl | |
import os | |
os.environ[ 'HOME' ] = '/tmp/' | |
import matplotlib | |
matplotlib.interactive(0) | |
matplotlib.rcParams['path.simplify'] = True |
This file contains hidden or 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 CONFIG RELIES ON 2 SCRIPTS, CPUSPEED AND CPUTEMP | |
# YOUR SYSTEM MAY NOT REQUIRE THEM, REPLACE AS DESIRED | |
# maintain spacing between certain elements | |
use_spacer yes | |
# set to yes if you want conky to be forked in the background | |
background yes | |
use_xft yes |
This file contains hidden or 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
# mostly from:http://haxe.org/doc/build/haxe_ubuntu_build | |
sudo apt-get install ocaml camlp5 cvs zlib1g-dev | |
wget http://haxe.org/file/install.ml | |
sudo ocaml install.ml | |
# clean old install | |
sudo rm -rf /usr/local/haxe | |
sudo rm -rf /usr/local/bin/haxe* | |
# install haxe in /usr/local | |
sudo mkdir /usr/local/haxe |
This file contains hidden or 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
// build with: haxe swf9 fex.swf -main FlashExample | |
import flash.display.Sprite; | |
import flash.events.MouseEvent; | |
class FlashExample extends Sprite { | |
static function main(){ | |
flash.Lib.current.addChild(new FlashExample()); | |
} | |
This file contains hidden or 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 Image extends Sprite { | |
public var path:String; | |
public var bitmap:Bitmap; | |
public var onLoaded:Bitmap->Void; | |
private var _loader:Loader; | |
/* take a path and a callback to be called when the image is loaded: | |
var i = new Image('/some/image.png', function(b:Bitmap){ | |
// do something with b or b.bitmapData... | |
trace('image is loaded'); |
This file contains hidden or 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
#!/bin/sh | |
BREAK_CHARS="(){}[],^%$#@\"\";:''|\\" | |
CLOJURE_DIR=/usr/local/src/clojure/ | |
CLOJURE_JAR=$CLOJURE_DIR/clojure.jar | |
CLOJURE_CONTRIB_JAR=$CLOJURE_DIR/clojure-contrib/clojure-contrib.jar | |
CP=$PWD:$CLOJURE_JAR:$CLOJURE_CONTRIB_JAR | |
# directory to vimclojure checkout |
This file contains hidden or 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
cimport stdlib | |
ctypedef struct foo: | |
int a | |
float b | |
cdef foo* make_foo(int a, float b): | |
cdef foo* f = <foo *>stdlib.malloc(sizeof(foo)) | |
f.a = a | |
f.b = b |
This file contains hidden or 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 sys import stdin | |
from collections import defaultdict | |
def gen_freq(seq, frame, frequences): | |
ns = len(seq) + 1 - frame | |
frequences.clear() | |
for ii in xrange(ns): | |
nucleo = seq[ii:ii + frame] | |
frequences[nucleo] += 1 | |
return ns, frequences |
This file contains hidden or 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 array | |
cimport array | |
cdef extern from 'vec.h': | |
ctypedef struct vec_int "std::vector<int>": | |
void (* push_back)(int i) | |
int (* at)(int i) | |
vec_int new_vec_int "std::vector<int>"() | |
vec_int new_vec_int_length "std::vector<int>"(unsigned int length) |