I'm migrating my site to ikiwiki. This page is deprecated in favor of the new code feed.
(You can see some of my experiment-specific code.)
Please email me with any question, advice, bugs,... or just to let me know you're using my software.
Stem and leaf plotter
Clean, compact histograms in ASCII. stem_leaf.c
Search PDF files
Grep on PDF files. grep_pdf
Sort by date
Where did I put that file I was working on yesterday? Your
ls has lots of nice sorts built in.
find ~ | ls -lt
Setup passwordless SSH logins
Bundle the activity for publishing a Git repository to a remote HTTP
server into a single script. The easier it is to publish, the more
likely I will be to do it ;). You'll need Git installed on the remote
machine as well for
git --bare update-server-info.
git-publish ~/src/repo username@publichost:./public_html/code/git/git-publish
Monitor a directory for new datafiles. When a new file is written,
generate a png from the data, and do something with it (e.g. display,
scp to web server, ...). Useful for watching the data come in while
remotely logged into the experiment computer, and a simple example of
inotifywait in action. monfold
I've tweaked Shane Hathaway's daemon.py example for cleaner logging. I added rotating logfiles. I also added a nice piece of work by Peter Parente at Jambu which also shunts errors printed to stderr into the logging system. daemon.py
Plot click locations
It is very convenient to define python functions that take the
tutorial for an explanation of the syntax and
for an example of why it is useful). However, if your chain
**kwargs functions branches (e.g.
c()) you need some way of
kwargs into a dict for each child function.
This module is how I do it.
easy_install -f http://www.physics.drexel.edu/~wking/code/python/ splittable_kwargs
git clone http://www.physics.drexel.edu/~wking/code/git/splittable_kwargs.git splittable_kwargs
Calculate convex hulls of points in two dimensions and determine if new points are inside the hull or not. Derived from the LiteratePrograms version.
easy_install -f http://www.physics.drexel.edu/~wking/code/python/ quickhull2d
git clone http://www.physics.drexel.edu/~wking/code/git/quickhull2d.git quickhull2d
Show all the columns in the spreadsheet
Physics101Grades. Log in using
ggrade.py -u jdoe -s 'PHYSICS 101 Grades' -w 'Physics101Grades' -L
Show grades for all students on the assignment
ggrade.py -u jdoe -s 'PHYSICS 101 Grades' -w 'Physics101Grades' Week1
Enter some Week1 grades
echo -e "Jack Sprat\\t0\\nMiss Muffin\\t1\\nMother Hubbard\\t1\\n" > grades ggrade.py -u jdoe -s 'PHYSICS 101 Grades' -w 'Physics101Grades' Week1,grades
Ubuntu claims to package python-gdata, but it was broken for me, so I had to install the 1.30 source on my own (which is not difficult, see here).
Access and edit grades in an Open Office compatible spreadsheet from the command line. The interface is almost identical to that for GGrade, so however your professor/department wishes to keep track of grades, you don't have to leave the command line ;). I'm still trying to find a way to do this without needing and X-server running...
My wife is resistent to mounting our home fileserver over NFS, but she wants to be able to browse through my picture directory. This script generates simple HTML gallery pages with thumbnails to replace Apache's default list o' files.
$ tree . |-- some_directory | |-- a_picture.jpg | |-- another_picture.jpg | |-- ... |-- another_directory | |-- a_picture.jpg | |-- captioned_picture.jpg | |-- captioned_picture.jpg.txt |-- ... $ gallery.py some_directory another_directory ... $ tree . |-- some_directory | |-- a_picture.jpg | |-- another_picture.jpg | |-- ... | |-- <GALLERY> | |-- <THUMBDIR> | | |-- a_picture.png | | |-- another_picture.png | | |-- ... | |-- <PAGEDIR> | | |-- a_picture.html | | |-- another_picture.html | | |-- ... |-- ...
Image click locations
Simple page format package
Assorted useful macros
Problem set writing package
Simple sticfigure class. Currently just waves arms in sync. No knees, elbows, etc. All the sizes and ratios are easy to change.
import stickfigure; StickFigure s = StickFigure(standsOn=(1cm,2cm)); s.armAngle = 20; s.draw();
Useful functions for drawing Physics 101 figures.
Useful functions for drawing Physics 102 figures.
Useful functions for drawing circuit diagrams.