python random_connected_graph.py -p -g names.gml names.txt
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 sim(word1, word2, lch_threshold=2.15, verbose=False): | |
"""Determine if two (already lemmatized) words are similar or not. | |
Call with verbose=True to print the WordNet senses from each word | |
that are considered similar. | |
The documentation for the NLTK WordNet Interface is available here: | |
http://nltk.googlecode.com/svn/trunk/doc/howto/wordnet.html | |
""" | |
from nltk.corpus import wordnet as wn |
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
# Copyright (C) 2013 Wesley Baugh | |
"""Tools for text classification. | |
Extracted from the [infer](https://github.com/bwbaugh/infer) library. | |
""" | |
from __future__ import division | |
import math | |
from collections import defaultdict, namedtuple, Counter | |
from fractions import Fraction |
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
lower = [chr(x) for x in range(ord('a'), ord('z') + 1)] | |
# >>> lower | |
# ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', | |
# 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] | |
digits = [str(x) for x in range(10)] | |
# >>> digits | |
# ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] | |
characters = lower + digits + ['_'] |
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 __future__ import division | |
import itertools | |
import json | |
import tweepy | |
# Configuration. | |
USERNAME_LENGTH = 3 | |
SAVE_FNAME = 'twitter_usernames.txt' |
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
user www-data; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
sendfile on; |
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
# Original blog post: <https://mnx.io/blog/a-proper-server-naming-scheme/> | |
# Original word list: <http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt> | |
# Sample usage: `curl <gist> | tail --lines +4 | shuf | head --lines 1` | |
acrobat | |
africa | |
alaska | |
albert | |
albino | |
album | |
alcohol |
-
Check version of Ubuntu:
lsb_release --all
-
Use version to follow instructions on https://www.torproject.org/docs/debian.html.en
-
Install polipo:
sudo aptitude install polipo
-
Add the following lines to
/etc/polipo/config
:
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
class InterruptableRegion(object): | |
def __init__(self, signum_list=None): | |
if signum_list is None: | |
signum_list = [signal.SIGINT] | |
self.signum_list = signum_list | |
self.reset() | |
def __enter__(self): | |
self.reset() |
OlderNewer