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 glob | |
from os.path import basename, splitext | |
ls = [l.strip() for l in open('_winnie.txt').read().splitlines() if l.strip()] | |
my_f = set(l[2:] for l in ls if l[0] != '#' and l[0] == '>') | |
my_f.remove('_winnie') | |
print 'digraph {' |
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
set autoindent | |
set smartindent | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set softtabstop=4 | |
set showmatch |
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
/** | |
* Fast computations of cumulative sums. | |
* D. Lemire, July 2012 | |
* | |
* Best results with: | |
* | |
$ g++-4.7 -funroll-loops -O3 -o cumulsum cumulsum.cpp | |
$ ./unrolldeltas |
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 | |
import pylab as pl | |
import numpy as np | |
import random | |
import sys | |
stat = {} |
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
#include <iostream> | |
#include <fstream> | |
#include <stdio.h> | |
const int N = 1000*1000*10; | |
void f1() { | |
std::ofstream out("out.txt", std::ios::binary); | |
for (int i = 0; i < N; ++i) { |
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
# ulam spiral, rotate 45 degree | |
# http://users.livejournal.com/_winnie/392996.html | |
import Image | |
def is_prime(n): | |
if n <= 2: | |
return 1 | |
k = 2 |
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
print "hello, world" |
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
#include <iostream> | |
#include <string> | |
#include <stdexcept> | |
#include <stdlib.h> | |
void g(int i) { | |
if (i % 4 == 0 && i % 6 == 0) | |
throw std::logic_error("FATALITY"); | |
if (i % 3 == 0) |
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
# usage: | |
# LC_ALL=C grep "$(python fuzzy_search.py "HELLO")" input.file.utf8.txt | |
import sys | |
s = sys.argv[1] | |
su = s.decode('utf-8') | |
utf8_any = '[^\x80-\xbf][\x80-\xbf]*' |
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 -u ~/tmp/grep-2.14/src/dfa.c.prev ~/tmp/grep-2.14/src/dfa.c | |
--- /home/dobrokot/tmp/grep-2.14/src/dfa.c.prev 2013-08-05 16:53:47.824514544 +0400 | |
+++ /home/dobrokot/tmp/grep-2.14/src/dfa.c 2013-08-05 16:50:41.435058597 +0400 | |
@@ -1978,6 +1978,52 @@ | |
m->elems[m->nelem++] = s2->elems[j++]; | |
} | |
+static void | |
+merge_inplace (position_set const *src, position_set *dst) | |
+{ |