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 re | |
from collections import defaultdict | |
import nltk | |
from nltk.corpus import cmudict | |
def clean_pron(pron): | |
"""Remove stress from pronunciations.""" | |
return re.sub(r"\d", "", pron) |
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 collections import Counter | |
import nltk | |
TOP_PERCENT = .01 | |
def prob_mass_top(counts, n): | |
return sum(count for word, count in counts.most_common(n)) / float(sum(count.values())) | |
count = Counter(word.lower() for word in nltk.corpus.brown.words()) |
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
find . -name "*.txt" | sort | xargs -n 1 enscript -G |
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
GIT_PS1_SHOWDIRTYSTATE=1 | |
PS1='[\[\e[1;32m\]\u@\h \[\e[1;36m\]\w\[\e[1;35m\]$(__git_ps1 " (%s)")\[\e[0m\]]\$ ' |
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 bash | |
column -t -s $'\t' $1 | less -S |
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
\documentclass{article} | |
\begin{document} | |
This is a test \cite{foo2012}. | |
\bibliographystyle{plain} | |
\bibliography{tworef} | |
\end{document} |
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
/* Turn off features that will not work on Windows. | |
*/ | |
#define NGETRUSAGE | |
#define NALLSIGNALS |
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
git ls-files -oi --exclude-standard |
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 | |
"""Randomly sample items from a list of items with their frequencies.""" | |
import sys | |
import random | |
from operator import itemgetter | |
def parse_countword_line(line): |
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
1. Check out OpenBlas from https://github.com/xianyi/OpenBLAS and check out the master branch. | |
2. Build and install to /opt: | |
a.) Multi-threaded: | |
make NO_AFFINITY=1 | |
b.) Single-threaded: | |
sudo make PREFIX=/opt install | |
3. Configure it as your BLAS of choice: | |
sudo update-alternatives --install /usr/lib/libblas.so.3gf libblas.so.3gf /opt/lib/libopenblas.so.0 50 | |
4. Check the configuration to make sure it's selected | |
update-alternatives --config libblas.so.3gf |
OlderNewer