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/env python | |
import sys, itertools | |
def wordchecker(dictfile,*lets): | |
""" Find the longest words made up of lets that are contained in dictfile """ | |
dictionary = set( w.rstrip() for w in open(dictfile,'r')) #SpellChecker(['ospd.txt']) | |
def allwords(lets): | |
""" Return a generator of the longest words """ | |
breakout = False |
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/env python | |
""" Email Me. | |
Usage: | |
emailme <message> | |
emailme [-s] <message> | |
emailme [-s] <subject> <message> | |
emailme <toaddr> <subject> <message> | |
emailme <toaddr> <fromaddr> <subject> <message> | |
emailme -h | --help |
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 math | |
class Welford(object): | |
""" Implements Welford's algorithm for computing a running mean | |
and standard deviation as described at: | |
http://www.johndcook.com/standard_deviation.html | |
can take single values or iterables | |
Properties: | |
mean - returns the mean |
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
.PHONY: clean all cleanall | |
# Make sure this has all of the right dependencies | |
DEPENDS=tex/*.tex *.sty *.bib *.tex | |
TARGET=aexam | |
all: $(TARGET).pdf | |
%.pdf: %.tex $(DEPENDS) |
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
BinaryPlot[nums_, K_: 0, opts : OptionsPattern[BinaryPlot]] := | |
MatrixPlot[ | |
Table[BitGet[nums[[j]], i], {j, 1, Length[nums]}, {i, 0, | |
If[K > 0, K, nums // Log2 // Floor // Max]}], | |
Evaluate@FilterRules[{opts, { DataReversed -> {False, True}, | |
Mesh -> True, FrameTicks -> None, Frame -> False }}, | |
Options@MatrixPlot]] | |
BinaryPlot::usage = | |
"BinaryPlot[list] Creates and array showing the binary \ | |
representation of a list of numbers. Takes the same options as \ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.