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 random | |
import string | |
import cherrypy | |
class StringGenerator(object): | |
@cherrypy.expose | |
def index(self): | |
return """<html> |
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 StringIO | |
import cPickle | |
small = [{i: i} for i in xrange(9)] | |
medium = [{i: i} for i in xrange(999)] | |
large = [{i: i} for i in xrange(999999)] | |
def dumps(obj): | |
return cPickle.dumps(obj) |
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
(flycheck-define-checker javascript-flow | |
"A JavaScript syntax and style checker using Flow. | |
See URL `http://flowtype.org/'." | |
:command ("flow" source-original) | |
:error-patterns | |
((error line-start | |
(file-name) | |
":" | |
line |
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
(flycheck-define-checker erlang-dialyzer | |
"Erlang syntax checker based on dialyzer." | |
:command ("dialyzer" source-original) | |
:error-patterns | |
((error line-start | |
(file-name) | |
":" | |
line | |
":" | |
(message) |
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
" Vim compiler file for Python | |
" Compiler: Style checking tool for Python | |
" Maintainer: Oleksandr Tymoshenko <gonzo@univ.kiev.ua> | |
" Last Change: 2011 Aug 25 | |
" Version: 0.5 | |
" Contributors: | |
" Artur Wroblewski | |
" Menno | |
" Lorenzo Bolla | |
" |
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
-- There and Back Again | |
-- http://www.brics.dk/RS/02/12/BRICS-RS-02-12.pdf | |
-- Fold a function over a sequence and the reverse of another sequence, in | |
-- just one passage. | |
taba :: ((t1, t2) -> t -> t) -> t -> [t1] -> [t2] -> t | |
taba f b xs ys = | |
let (r, _) = foldr (\x (r, y:ys) -> (f (x,y) r, ys)) | |
(b, ys) | |
xs |
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
module Main where | |
import Data.List (nubBy, concat, findIndices) | |
import Control.Monad (liftM2, forM, join, guard) | |
import Data.Maybe (catMaybes, fromMaybe) | |
import Debug.Trace | |
type Board = String | |
-- Some boards |
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
GHC=ghc --make -O2 #-threaded | |
GHC_PROF=${GHC} -prof -auto-all | |
warp: warp.hs | |
${GHC} warp.hs | |
warp-prof: warp.hs | |
${GHC_PROF} warp.hs | |
yesod: yesod.hs |
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
all: go.so | |
go.o: go.c | |
gcc -std=c99 -c -fPIC go.c -o go.o | |
go.so: go.o | |
gcc -shared -Wl,-soname,libgo.so -o libgo.so go.o |
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 threading import Thread | |
def busy_sleep(n): | |
while n > 0: | |
n -= 1 | |
N = 99999999 | |
t1 = Thread(target=busy_sleep, args=(N, )) |
OlderNewer