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
gunzip -c googlebooks-eng-all-1gram-*-[a-z].gz | pv | grep -P `cat reddit_words.csv | perl -e "while(<>) { s/\'s//g; chomp; push @words, split ','; } printf '^(%s)\\t', join '|', @words;"` > collision_stats.tsv |
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
//This event appears to ping xkcd's servers when various things happen | |
//Probably for serverside logging/analytics/debugging/statistics | |
function ping_event(evt_name) { | |
(new Image).src = "http://xkcd.com/events/" + evt_name | |
} | |
//This function ouputs debug info into the javascript console if the URL has a "#verbose" anchor appended | |
function log() { | |
location.hash == "#verbose" && console.log.apply(console, arguments) | |
} | |
//A list of event streams to choose from at random, for load balancing |
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
def rotl(num, bits): | |
bit = num & (1 << (bits-1)) | |
num <<= 1 | |
if(bit): | |
num |= 1 | |
num &= (2**bits-1) | |
return num | |
def rotr(num, bits): |
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
/alias logsb lastlog -file ~/irclogs/${tag}/${C}.${F}_${Z}.scrollback.log |
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 XMonad | |
import XMonad.Actions.CopyWindow | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.EwmhDesktops | |
--import XMonad.Hooks.ICCCMFocus | |
import XMonad.Hooks.SetWMName | |
import XMonad.Layout.NoBorders | |
import XMonad.Layout.Spiral | |
import XMonad.Util.Run(spawnPipe) |
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
(function(){ | |
GEvent.clearListeners(gmap, "click"); | |
document.getElementsByTagName('input')[0].insertAdjacentHTML('afterend','Drive Times: <input id="minutes" style="width:5em" type="text" value="5 15"/> (in minutes, separate multiple times with spaces)'); | |
GEvent.addListener(gmap, "click", function(marker, point) { | |
if(!marker){ | |
mapExtension.removeFromMap(gOverlays); | |
var frslayer = new esri.arcgis.gmaps.FeatureSet(); | |
var feature = new esri.arcgis.gmaps.Feature(); | |
feature.geometry = point; |
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/perl | |
use Data::Dumper; | |
use strict; | |
my $len; | |
my %tree; | |
while(<>) { | |
chomp; | |
if(/^[A-Za-z]+$/) { | |
$tree{length($_)}{$_} = []; |
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
library(ggplot2) | |
library(scales) | |
library(grid) | |
nicer_still = T | |
hotelstuff = read.csv('hotelstuff.tsv',sep="\t") | |
if(nicer_still) { | |
#Order by revenue change | |
hotelstuff = hotelstuff[with(hotelstuff,order(-Revenue.Change)),] |
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
8-Track | 1980 | 14.3 | |
---|---|---|---|
8-Track | 1981 | 7.9 | |
8-Track | 1982 | 1.0 | |
8-Track | 1983 | 0.0 | |
8-Track | 1984 | 0.0 | |
8-Track | 1985 | 0.0 | |
8-Track | 1986 | 0.0 | |
8-Track | 1987 | 0.0 | |
8-Track | 1988 | 0.0 | |
8-Track | 1989 | 0.0 |