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 | |
def nextbus(where = 'guess', nbus = 5, walking_time = 3): | |
""" | |
tells you when the next bus is from home or to uni | |
where: 'h'/'u'/'guess': home, uni, or try to guess based on wifi connection name | |
walking_time: don't show buses less than n mins from now | |
nbus: show next n buses |
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 | |
def nextbus(where = 'u', walking_time = 3, nbus = 5): | |
"""tells you when the next bus is from home or to uni | |
where: 'h'/'u' | |
walking_time: don't show buses less than n mins from now | |
nbus: show next n buses | |
""" | |
walking_time = int(walking_time) |
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
LET us go then, you and I, | |
When the evening is spread out against the sky | |
Like a patient etherized upon a table; | |
Let us go, through certain half-deserted streets, | |
The muttering retreats 5 | |
Of restless nights in one-night cheap hotels | |
And sawdust restaurants with oyster-shells: | |
Streets that follow like a tedious argument | |
Of insidious intent | |
To lead you to an overwhelming question…. 10 |
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
import pickle | |
import os | |
bnc = pickle.load(open('bnc.p', 'rb')) | |
lst = ['clinic', 'hospital', 'patient'] | |
for w in lst: | |
print '%s: %d occurrences' % ( w, bnc[w]) |
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
% gobble allows you to indent in your tex file | |
% rerun code only if it changes | |
\usepackage[gobble=auto,rerun=modified]{pythontex} | |
% a figure showing code and the image it produces | |
\begin{figure}[htb!] | |
% make a text box | |
\begin{mdframed}[backgroundcolor=gray!4] \footnotesize \singlespacing |
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
from setuptools import setup, find_packages | |
from setuptools.command.install import install | |
class install_with_nltk_extras(install): | |
"""Customized setuptools install command - prints a friendly greeting.""" | |
def run(self): | |
install.run(self) | |
import nltk | |
nltk.download('punkt') | |
nltk.download('wordnet') |
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
# keyword calculation for a particular word | |
# our aim is to use log likelihood to calculate the 'keyness' of a word. common practice. | |
# a normal application would be to loop through wordlists and gives every word a keyness score. | |
# here, we'll just get 'apple', as an example | |
# reference_corpus = a dictionary of words and their frequencies in a large dataset | |
# target_corpus = a dictionary of words and their frequencies in a smaller dataset | |
# our example word |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>txt</string> | |
</array> | |
<key>name</key> | |
<string>Plain Text</string> |
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
Weeding-Out Urged In Foreign Service: U.S. URGED TO SIFT FOREIGN ... | |
By E.W. KENWORTHY Special to The New York Times | |
New York Times (1923-Current file); Dec 29, 1963; | |
ProQuest Historical Newspapers: The New York Times (1851-2010) | |
pg.1 | |
Weeding-Out Urged |
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
2005 | |
-5 -4 -3 -2 -1 0 1 2 3 4 5 Total | |
NN 52 37 43 32 29 88 47 57 40 36 34 495 | |
JJ 23 27 25 11 36 12 30 20 24 30 24 262 | |
NNS 20 23 19 18 15 50 19 26 25 20 26 261 | |
NNP 25 30 35 27 9 2 16 22 17 31 36 250 | |
risk 6 1 1 0 0 177 0 0 1 1 7 194 |