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 | |
# | |
# A Twitter stream sucker. Writes one file per hour, containing all the tweets from the | |
# sample stream (aka "gardenhose"). | |
# | |
# Use Ctrl-C to stop collecting. | |
# | |
# Note: This is not intended to be a robust tool for collecting Twitter data. Use at your | |
# own risk, and play nice: http://dev.twitter.com/pages/streaming_api_concepts |
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
# the following two lines give a two-line status, with the current window highlighted | |
#hardstatus alwayslastline "%= %3n %t%? [%h]%? %=" | |
#caption always "%= %-w%L>%{= BW}%n*%t%{-}%52<%+w %L=" | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
defscrollback 3000 |
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 | |
''' | |
A command-line calculator over streams of numbers. | |
Requires numpy for 'hist' and 'median'. | |
For example: | |
# create a file with 100 random numbers, 1 per line | |
$ jot -r 100 > /tmp/random |
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
''' | |
Functions to build full dependence model queries for Indri http://lemurproject.org/indri. | |
See "A Markov Random Field Model for Term Dependencies" by Metzler & Croft | |
http://ciir.cs.umass.edu/pubfiles/ir-387.pdf | |
''' | |
import re | |
nonword_chars = re.compile(r'\W+') | |
def powerset(l): |
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 | |
# This script takes the predictions and input vectors | |
# (eg. set1.test.txt) and produces a file suitable for | |
# submission to the Yahoo LETOR Challenge web interface. | |
# | |
# The PREDICTIONS_FILE should just be a list of scores, | |
# one per line, corresponding to the lines in INPUT_FILE | |
from itertools import izip, groupby |
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 is a drop-in replacement for \begin{enumerate}...\end{enumerate} in LaTeX. Just include it in | |
% your preamble and use \begin{packed_enum} instead. | |
\newenvironment{packed_enum}{ | |
\begin{enumerate} | |
\setlength{\itemsep}{2.5pt} | |
\setlength{\parskip}{0pt} | |
\setlength{\parsep}{0pt} | |
}{\end{enumerate}} |