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 psycopg2, re, gzip | |
# NB. Data to fill in on lines 16-19 and 30 | |
# Outputs two tab separated files (possibly gzip'd) where the first 3 | |
# fields of each line are: | |
# | |
# 1. id of the item (base 36) | |
# 2. the date (UTC time) | |
# 3. total votes |
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
hist(waiting, breaks=min(waiting) + 0:20*(max(waiting) - min(waiting))/20) |
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<stdio.h> | |
#include<stdlib.h> | |
#include<pthread.h> | |
// debugging | |
#define HERE() printf("%s:%s:%d\n", __FILE__, __func__, __LINE__) | |
#define LENGTH 100000000 | |
#define NUM_THREADS 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
javascript:function%20convert(inText){var%20outText='',t;for(i=0;i<inText.length;i++){t=inText.charCodeAt(i);if((t>64&&t<78)||(t>96&&t<110))t%20+=%2013;else%20if((t>77&&t<91)||(t>109&&t<123))t%20-=%2013;outText%20+=%20String.fromCharCode(t);}return%20outText;}var%20sel=window.getSelection().getRangeAt(0);if(sel==''){var%20act=document.activeElement;if(act.type=="textarea"){var%20start=act.selectionStart,end=act.selectionEnd;if(start!=end){var%20prefix=act.value.substring(0,start);var%20middle=convert(act.value.substring(start,end));var%20suffix=act.value.substring(end);act.value=prefix;act.value%20+=%20middle;void(act.value%20+=%20suffix);}}else{void(inText=prompt('Phrase...',''));if(inText)alert(convert(inText));}}else{out=convert(sel.toString());sel.deleteContents();var%20span=document.createElement("span");span.innerHTML=out;sel.insertNode(span);} |
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 python3 | |
import sys, random | |
incrs = 10000 | |
try: | |
processes = int(sys.argv[1]) | |
counters = int(sys.argv[2]) | |
except: | |
counters = 100 |
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 sys, argparse | |
p = argparse.ArgumentParser() | |
p.add_argument('levels', type=int, help='height of tree') | |
p.add_argument('--procs', type=int, default=4,help='num processors') | |
p.add_argument('-d', type=float, default=0.999999,help='damper') | |
p.add_argument('--deg', type=int,default=2,help='degree of tree') |
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
javascript:function convert(e){var t="",n;for(var r=0;r<e.length;r++){n=e[r].toUpperCase();if(dic.hasOwnProperty(n)&&dic[n].length>0){var i=dic[n];t+="[["+i[Math.floor(Math.random()*i.length)]+"]]"}else t+=n}return t}var dic={" ":["156142887792515"],A:["I.have.letter.A","107015582669715"],B:["146468602064836","116067591741123","515425308486884","123610221018617"],C:["53872404042","imagineifyoucouldntc"],D:["322391688648","112542438763744"],E:["91766446175","115430438474268","283780138400963","123538490993811"],F:[],G:["Google","111532845537326","234343043309512"],H:["111356865552629"],I:["124741367672248"],J:["40324932642"],K:["221460146083","56926372437"],L:[],M:["theletterM.mcr"],N:["TheLetterN"],O:["307606749307431"],P:[],Q:["333248933364176","theletterqcafe"],R:["106699962703083"],S:["19thletter"],T:["440658102627745"],U:["156366047808011"],V:["77189649729"],W:["302663476724"],X:["124482324249542"],Y:["112991612048936"],Z:["165724910215"],"?":["466839490011958","173756546013139"],"!":["IWubLiterature"]};v |
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
use T = core::io; | |
fn main() { | |
T::println("test"); | |
} |
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<stdio.h> | |
int main() { | |
puts("to terminal 1"); | |
fflush(stdout); | |
int fd = dup(fileno(stdout)); | |
freopen("out-file.txt", "w", stdout); | |
puts("to file"); |
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
fn borrow(s: &'a str) -> &'a str { | |
s | |
} | |
fn make_str() -> ~str { ~"foo" } | |
fn main() { | |
let x = borrow(make_str()); | |
/* Current solution: | |
let temp = make_str(); |
OlderNewer