Last updated: 19-December-2007 at 01:52 AM
For many years, I used to work as a software engineer. After a long day writing other people's code, I didn't tend to write much additional code in my off-work hours. However, what little I did write, I like to share with anyone who might be interested. I feel as though I owe a debt of gratitude to all the programmers who made their own source code freely available to me, when I was learning how to program. So, it seems only fair for me to try to return the favour in some small way.
This page describes a few of the programs I've made publicly available, and includes links to source code. If you have any questions, feel free to send me e-mail, my address is:
I cannot make any promises regarding support of the software you find here, but I will try to answer whatever questions I can.
| Name/Links | Description |
|---|---|
| altopt.py Download [ 29K, 27-Aug-2003] |
This Python module implements a simple form of command-line option processing, similar in spirit (though not identical) to the style of options supported by the AFS command line tools. |
| ASIN.py Download [ 17K, 14-Nov-2007] |
When my wife and I set out to catalogue our books, we thought it would make things easier to be able to look up information about each volume online via its ISBN. Unfortunately, sources like the Books-in-Print database cost money -- not a good match for a small-scale home project like ours. Fortunately, the folks at Amazon have a publically accessible database that has just the information we need -- authors, titles, and publication information, plus some other useful tidbits like size and shipping weight. The only down side is that to get this information in a machine-readable format, you have to sign up and agree to all kinds of silly restrictions -- and then you have to hack your way through a tangled mess of SOAP queries to make it go. I wanted something free and simple. Thus, this little Python module was born. In short, it sends an ISBN query to Amazon's ordinary customer web interface, and extracts the appropriate information from the response page via some fairly simple screen-scraping techniques. The results are massaged a bit to put them into a standard form, and returned as a dictionary. For example, >>> from pprint import pprint
>>> import ASIN
>>> info = ASIN.lookup('0-8442-3776-0')
>>> pprint(info)
{'author': ['Boyd Robertson', 'Iain Taylor'],
'date': 'January 11, 1995',
'depth': '13.0',
'edition': '1',
'format': 'paperback',
'height': '19.8',
'isbn': '0844237760',
'isbn_13': '978-0844237763',
'language': 'English',
'pages': 352,
'publisher': 'McGraw-Hill',
'title': u'Teach Yourself Gaelic Complete Course',
'weight': '0.81',
'width': '2.3'}
If you find this little tool to be useful, help yourself! The quality of Amazon's HTML is pretty dreadful, but having tested it on nearly 1100 titles so far, I've found it works pretty well. Sad to say, some of the data are pretty poor too -- they listed one book as being a cube twenty inches on a side. But for the basics, the data are usually okay. This module relies upon Leonard Richardson's BeautifulSoup module to turn their ugly HTML into something you'd be willing to feed at a soup kitchen. |
| baywatch Download all [230K, 17-Mar-2007] Download just code (no docs) [ 16K, 17-Mar-2007] Documentation [137K, 29-Oct-2005] Paper [167K, 14-Nov-2005] |
Baywatch is an implementation of a simple Bayesian e-mail filter, based on the ideas described in Paul Graham's article, “A Plan for Spam.” The paper just formalizes the mathematics behind the algorithm used in the program. Version 1 of Baywatch was written in Perl, and you can still get a copy of that version here, along with its manual. Version 2 of Baywatch is now written in Python, and is a fair bit easier to use than the previous version. You can use Baywatch in combination with procmail to filter the unsolicited commercial e-mail (or "spam") out of your mailbox. Example procmail recipes are included in the Baywatch manual. You will need to provide a training corpus for the script, before it will do much good. However, there is no harm in running it without one -- it will just ignore everything and pass it along. |
| calmaker.pl Download [4.5K, 27-Aug-2003] Documentation |
This simple Perl script generates an HTML table containing a calendar for the specified month. You can hand it a file with additional information that should be put into the cells of the table on the appropriate days. This program uses the Unix cal program to generate the appropriate calendars, so calmaker won't work on a system which doesn't have that. |
| CFGTools Download [ 72K, 24-Oct-2007] |
A collection of Python modules for manipulating context-free grammars (CFGs). Includes classes to support the construction of lexical analyzers and parsers, and to read grammars written in a flexible EBNF style of text input. The parsing modules can generate Earley parsers, table-driven LL(1) parsers, and canonical LR(1) parsers. The construction of the LR(1) action and lookahead sets is pretty slow at present; I will probably implement a better algorithm when I have more time. |
| chmap Download [9.4K, 13-Aug-2003] Documentation |
Chmap is a simple program that generates guitar fret-board diagrams. I used to have a version of this in C, which would generate them in text; I just re-wrote the thing in Perl, and now it generates encapsulated PostScript output instead. I may go back and add text output again, but for the moment, it doesn't do that anymore. Here are a few samples, rasterized for your viewing pleasure:
These were generated by the following input strings:
Gm7: 6s3f 5s5f 1-4s3f
Major: :movable 1,4.root 1-2s1f1 3s2f2 4s3f3 5-6.x
E: 5s3f 4s3f 3s2f
|
| csha Download [ 19K, 30-Nov-2002] |
CSHA is a standalone ANSI C implementation of the Secure Hash Algorithm, from FIPS Publication 180-1. The distribution includes a little test driver program, but it's mainly intended for use as a library. I wrote this mainly for my own amusement, so although it passes the test vectors from the FIPS document, you probably want to find a different version if you need to be sure you've got the genuine article. |
| dnd Download [ 29K, 09-Nov-2007] |
A Python library for interacting with Dartmouth Name Directory servers. This protocol is not widely used around the network, but this library should be useful for script writers at those few sites that do have such a server. (Note that the information on the DND site is pretty old, but not much should have changed). There are also some command-line tools provided, including a tool for viewing and editing permission groups (groupedit), a tool for organizing lists of names and e-mail addresses (makelist), a tool for making simple queries (dndquery), and a tool for editing DND records (dndedit). In order to use this library, you will also need to have the PyCrypto library installed. You may also find the PyBlitz library useful. |
| dprintf Download [2.9K, 02-Apr-2006] |
A version of the C library's printf() function which can be used for generating debugging output. Basically, this is a very simple wrapper around the ANSI C library's vfprintf() function, that adds a parameter to specify the debug level. If the current global debug level is at least as high as the debug level specified in the dprintf() call, the output is generated; otherwise it is skipped.
The library also provides a dfprintf() routine that is analogous to dprintf() as fprintf() is to the printf() routine. If the preprocessor symbol NDEBUG is defined at compile time, no output is written at all. Basic documentation is provided in source comments (parseable by Doxygen and other such documentation extraction software). |
| edit.py Download [8.6K, 14-May-2006] |
Code to find a minimal sequence of "point mutations" that will convert one string into another. Uses a straightforward dynamic programming algorithm with O(n2) time and space complexity, where n is the length of the longer of the two input strings. The edit operations allowed are insertion of a character, deletion of a character, and changing an existing character to a different one. Code is also provided for compressing edit sequences, and applying an edit sequence to a source string. An example, editing the string "Simon" into "Friday":
|
| encode Download [ 14K, 26-Apr-2004] |
This is a set of short ANSI C programs that demonstrate a series of simple encoding and compression techniques. Currently implemented are run-length coding, move-to-front coding, an ad hoc common prefix sharing compression for lexicographically ordered data such as a spell-checker's dictionary, and the Burrows-Wheeler transform. |
| englishNum.js Download [5.0K, 06-Jan-2007] |
Defines a Javascript function natToEnglish(v) that converts a natural number into English text. Also provided is an intToEnglish(v) that works for signed integers, and a currencyToEnglish(v) that makes a reasonable try at reading out an amount of decimalized currency. The results are returned as strings suitable for further manipulations. Examples (Javascript required): Since the naming of larger groupings is the subject of some contention between the U.K. and the rest of the English speaking world, natToEnglish() refers to a variable enUnits to determine how it should name its groupings. The default is enUnitsUS which uses the term "billion" for 109, "trillion" for 1012, and "quadrillion" for 1015; while enUnitsUK uses "milliard", "billion", and "thousand billion" for the same. |
| eyepopper.py Download [ 19K, 26-Sep-2008] |
A local-access read-only POP3 server, that serves e-mail messages stored in one or more plain text files. This may be used to import messages into a POP client that does not understand the Unix mailbox format, or to test a POP client implementation. By default, eyepopper.py starts a server at port 1110, instead of 110, so that it will not require root access. The full POP3 protocol is supported, except deletion of messages. The server ordinarily does not care what username and password you give; if you want it to care, use the --user option or the POP_USERS environment variable to specify a name:password combination. Basic usage examples:
The server accepts two nonstandard commands, SHUTDOWN (which causes the server to close down immediately) and ADDBOX, which adds an additional mailbox to the set of boxes known by the server. These turn out to be helpful for testing purposes. |
| fscheme.py Download [3.9K, 21-Feb-2006] |
So, you want to include some Scheme code in your LaTeX document. So you want that code to be formatted nicely in verbatim mode. But alas! The verbatim environment does not work inside the arguments of certain commands, such as those defined in the ifthen package. You could format the code using a tabbing environment, but that is tedious to do by hand. So, don't do it by hand! This very simple Python script reads in blocks of Lisp code, figures out the tab stops, and generates a nicely-formatted LaTeX tabbing environment with your code in it. Note that this is not a Scheme or Lisp pretty-printer; it just reads leading whitespace in a very simpleminded way, and uses it to figure out where tab-stops should go to make everything line up nicely. Still, as simple solutions go, I thought this one was kind of neat (even if I do say so myself). As an example of usage, here is the original Scheme code, saved in a file named test.scm:
Now, here is the result as rendered by fscheme.py:
|
| getlinks Download [ 10K, 30-Oct-2007] |
This Python command-line tool fetches an HTML document from the specified URL (if possible), and generates a table of hyperlinks found in the document. The result is dumped either to standard output or to a file named on the command line. You may specify either plain text or HTML as the output format. I wrote this as an example program to demonstrate some of the features of the Python programming language. |
| hex.ps, hexnw.ps, graph.ps Download hex.ps Download hexnw.ps Download graph.ps PDF variety pack [388K] |
One of the hobbies I've had since I was about 7 years old is playing role-playing games (of the Dungeons & Dragons™ variety). For various reasons, gamers often like to use "hex" paper instead of quadrille-ruled graph paper for drawing outdoor maps. One can obtain hex paper from a hobby supply store, but it's rather expensive for what you get, and you can't easily control the size of the hexes. So, I wrote this PostScript program to generate a page of interlocking hexagons. Here's a sample of the results, when rasterized:
hex.ps is the program, with lots of comments so you can see what I did. hexnw.ps is the same thing, but with the comments and extraneous whitespace all taken out. To change the size of the hexes, edit the currenthexsize definition near the top of the file. It will figure out how many to put on the page automagically. The "PDF variety pack" is a collection of hex pages at different sizes, packed together in a PDF file. It includes 0.5cm hexes, 1cm hexes, 1.5cm hexes, 2cm hexes, and 4cm hexes. graph.ps is a similar program for producing quad-ruled graph paper, in case you want it. As with the hex paper, you can set how big you want the squares to be. |
| IMath Download [879K, 04-Aug-2008] Home Page |
IMath is another arbitrary-precision integer math library, written in ANSI C. It began as a project to clean up the code for MPI, my first arbitrary precision integer arithmetic library. IMath has a cleaner code base, is more portable, is better tested, and now supports arbitrary precision rational arithmetic in addition to integer arithmetic. The code is free for any purpose. |
| input.c Download [1.2K, 16-May-2005] |
This is a very simple program that permits a shell script to read input from the user, with a timeout. When invoked with no arguments, the program waits up to ten seconds for a line to be available at standard input, and if none arrives, prints the string "nothing" to standard output. You can customize the delay time and the default output by providing them on the command line:
input <timeout> <message>
The timeout is specified in seconds, the message is just a string of text (be sure to quote it if it contains spaces). |
| ISBN.py Download [6.3K, 15-Aug-2007] |
A Python module for the handling of International Standard Book Numbers (ISBNs). This module can compute and verify checksums, figure out correct hyphenation, and convert between 10-digit and 13-digit ISBN formats. |
| KMeans Download [3.6K, 07-Jun-2007] |
A simple Python implementation of J. B. MacQueen's 1967 K-means algorithm for finding clusters within a set of data points. The user adds data points to a collection and either specifies starting centroids, or allows the program to choose centroids randomly from among the data in the collection; the centroids are then iteratively updated until the points converge sufficiently toward a particular configuration. This implementation handles empty categories by leaving any centroid whose neighbor set is empty where it is. |
| knotws.ps Download |
Another of my hobbies is drawing Celtic knotwork designs. The method I first learned is due to Iain Bain, who uses a grid with diagonal layout lines to keep track of where the curves are supposed to go. This PostScript file is basically a page of graph paper with light layout lines, suitable for use in drawing freehand sketches of Celtic knotwork patterns. With practise, you will find you don't need the guidelines (in fact, I've even drawn a pattern on my friend Amy's back, in pen, freehand). However, when you're trying to work out a new pattern, or copy something you've seen, I find this a useful worksheet. |
| kore.py Download [3.5K, 14-Nov-2007] |
A simple Python library to encode and decode the so-called "Koremutake" syllables used by shorl.com for encoding their shortened URLs. Basically, the scheme consists of a table of 128 simple CV and CCV syllables used to encode an integer value as a sequence of radix-128 digits. |
| MacOSXPath Download [ 10K, 27-Apr-2005] |
This is a Python extension module written with C and Pyrex, which allows you to obtain the Launch Services item information flags for a pathname on a MacOS X system. These flags can be used to identify alias files, packages, and applications, which are otherwise not easily distinguished from plain files or directories via the Unix API's or existing Python Macintosh library modules. You can also use this to tell whether a file is marked as "invisible" in the Finder, and whether its filename extension is displayed. This code has only been tested using a framework build of Python 2.4, so if you discover any problems with installing it, please let me know. A distutils setup script is provided, but it may require tweaking to work on other systems. |
| mksched.pl Download [ 17K, 04-Aug-2003] |
This is a Perl script which automates the generation of a nice looking HTML table containing a weekly schedule. You hand it an text file containing brief summaries of the events in your week, when they occur, etc., and it generates an HTML document with a grid layout of the week's schedule, with those events filled in. The only documentation is the source code. |
| mazegen Download [ 16K, 21-Apr-2006] |
Mazegen is a C program that randomly generates simple two-dimensional mazes. It can output in plain text, PNG, or PostScript format. You can specify a random seed, and generate the maze either with or without a solution path marked in. Here is how the following examples were generated:
Or, as plain text: mazegen -d 7x14 -r 1102656033
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| | | |
+ +---+---+ +---+ + +---+ + +---+ + +---+
| | | | | | | | | |
+ +---+ + +---+---+ + + + + +---+ +---+
| | | | | | |
+ +---+---+---+---+ +---+---+---+ + + + + +
| | | | | | | | |
+---+---+ +---+---+---+ +---+ +---+---+ + + +
| | | | | | | |
+ +---+ + +---+ + + +---+---+---+ +---+---+
| | | | | |
+ + +---+ +---+---+ + + + +---+ +---+ +
| | | | | | | |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
One note, however: The output may vary on different platforms, due to variations in how the random number generator is implemented from one library to another. |
| mcs Download [ 51K, 16-Nov-2002] |
MCS is short for "Michael's CipherSaber", an implementation of Arnold Reinhold's nifty CipherSaber specification. It is designed to work as a Unix command line tool, and it includes some simple code for generating random numbers, encrypting, decrypting, etc. Here is a Test message encrypted using MCS: You can use sixbit to decode the Base64. Note: Both CS-1 and CS-2 are implemented, but no fix has been developed for the attack on RC4 described by Fluhrer, Mantin, and Shamir, so I have not addressed that issue as yet. |
| MPI Home page |
MPI is a free, highly portable arbitrary precision integer arithmetic library written in ANSI C. Check out the home page for more information. MPI is no longer under active development. If you are interested in what MPI provides, I recommend you look at IMath instead, which has improved performance over MPI, and which I still maintain. |
| nntpmail Download [5.2K, 08-Oct-2004] |
nntpmail is a simple NNTP to e-mail gateway program written in Python. It automatically polls a user-specified set of newsgroups and converts any new messages into an e-mail digest (as a series of plain text MIME attachments), which is sent via e-mail to one or more specified addresses. Documentation is included with the tar file. |
| opfunc.pl Download [9.5K, 27-Aug-2003] Documentation |
This Perl script takes an operator grammar as input, and generates a pair of operator precedence functions (if it is possible to do so) using the algorithm from the Dragon Book. |
| passthru Download [1.9K, 22-Apr-2006] |
This script makes it easy to use a machine running MacOS X to share a dial-up connexion among multiple computers on a home network. I wrote this so that my girlfriend and I could both be online at the same time from home. The setup is pretty simple -- use an Ethernet crossover cable, or plug your machines into a hub, including the MacOS X machine you want to dial in from. Establish the dial-up connexion, and then run: sudo passthru start This will set up network address translation and use the BSD ipfw program to make sure packets are redirected in a suitable way. You may need to edit a few of the settings at the top of the passthru script, depending on how your net is set up. By default, I'm using 10.0.0.1 as the master machine. Assign addresses manually to other machines on the inside network, and use 10.0.0.1 as the gateway for each of them. To shut down, run sudo passthru stop and then bring down the dial-up link normally. |
| Permutation.py Download [ 11K, 19-Oct-2007] |
A library of Python code for working with permutations. Includes a class that allows basic "arithmetic" with permutations (composition and indexing), as well as conversion to and from a representation as the product of disjoint cycles, inversion, and so forth. There are also a couple of different ways to generate all permutations of a sequence, and tools for manipulating integers in a factoradic representation. |
| prime.py Download [4.4K, 14-Nov-2004] |
Defines a nifty Python class Primes which lets you easily work with the set of prime integers. You can index the set by position, factor (by trial division), test for primality (again, by trial division), and quickly iterate over all or any portion of the prime space. Uses the Sieve of Eratosthenes to generate as much of the space as is needed, and caches its computation to trade memory for time. |
| PyBlitz Download [ 82K, 31-May-2007] |
A Python implementation of the vast majority of the BlitzMail protocol. It is intended for use as a library, so this is not a full-featured e-mail client -- but you could certainly use this code as the basis for such a program, if you were so inclined. Requires dnd.py, which in turn has its own requirements. The current release includes support for vacation messages, sending messages, mailing-list handling, reading and writing of server-side preferences, server messages ("warnings"), and of course, handling message summaries and contents. It does not support Kerberos authentication, at present, but it does include a module for communicating with the BlitzMail "bulletin" server, where available, and also support for the notification protocol. The procnotify.py script can be used to notify users of incoming e-mail to accounts outside the BlitzMail system, using procmail. The distribution includes a command line tool called listedit, which permits you to view, create, edit, and delete private and group mailing lists, within the limits of your access rights. It also includes a command line tool called blitz2mbox, which allows you to easily download the contents of BlitzMail folders to Unix "mbox" format files on your local disk. Such files can be easily imported into other mail clients, such as Apple Mail, Entourage, Eudora, etc. |
| rsig Download [ 11K, 10-Oct-2008] |
This Python script generates an e-mail signature file containing a randomly-selected quotation. There have got to be about ten thousand of these out there in the world, but I had to have my own, so this is it. You create a file in your home directory called .rsigbase, that contains the basic signature stuff, and a file called .rsigquotes that contains your quotations. The script does the rest. Read the source for more information. |
| rtfparse Download [4.8K, 05-Dec-2004] |
This is a simple parser written in Python for documents stored in Rich Text Format (RTF). It is a work in progress, but it currently parses the basic structure of the documents in a fairly reasonable way, and mostly conforms to the RTF 1.7 specification. Much more testing is needed, and I would like to add the ability to output RTF as well as read it. Also, the parser currently does not validate the structure of the document, it merely parses out command words, command symbols, punctuation, and text, and nested groups. It allows command words to be written in mixed case, which is contrary to the standard, but which many older RTF documents contain. |
| self.c Download [1.3K, 12-Jul-2002] |
This is an ANSI C quine, a program whose output is its own source code. Actually, to be completely accurate, if you compile this program and run it, it will spit out the source code for a program that outputs the same source code -- this version contains comments that aren't in the output. I wrote this after I took Theory of Computation as an undergraduate, and learned about the Recursion Theorem. It's a fairly straightforward application of the theorem's construction to the C language. It does not attempt to be minimal, but it is ANSI compliant (which many shorter C quines are not), and its structure is pretty easy to follow, if you can ignore all the backslashes. |
| sixbit Download [ 12K, 16-Nov-2002] |
A simple library implementing MIME-style Base64 encoding and decoding, written in ANSI C. The distribution includes some simple command line tools, too. |
| SortLab Try it Download [ 81K, 15-May-2006] |
I wrote this little Java applet to help students visualize the behaviour of various sorting algorithms. This program was inspired by an old piece of courseware written at Dartmouth College in the late 1980's, called "The Sorter". Unfortunately, "The Sorter" was written in an antique dialect of Pascal and was never ported anywhere but the Macintosh. As much as I love the Mac, it is difficult to use a program that will only run under the "Classic" environment. So, I wrote this replacement in Java, which I hope will be a bit more portable. |
| spawn Download [1.8K, 04-Apr-2005] |
A C implementation of a function spawn() for POSIX systems that behaves like the ANSI C library function system(), but which does not wait for the subprocess to complete before returning. The result is a process ID, and the caller must call wait() or waitpid() to recover the exit status from the subprocess. |
| spider.py Download [ 20K, 23-Aug-2007] |
A very simplistic web spider written in Python. This will crawl through designated areas of a web site, following hyperlinks stored in HTML anchor tags, to build a link graph. The results are written in a text format that can be parsed by other tools. There is documentation in the form of comments and docstrings in the source file; you can also use this as a module rather than a command-line tool, if you want to implement a more sophisticated searching algorithm or output format. |
| sudoku.py Download [ 14K, 01-Aug-2007] |
A square Sudoku generator and solver written in Python. Solves puzzles using a randomized brute-force algorithm that should be able to handle even very difficult puzzles without too much effort. The generator does not insert blanks (yet), but will make a random starting grid. |
| tab.ps Download |
I play and write songs on my guitar, and sometimes I find it useful to write things down in tablature. tab.ps is a little PostScript file that prints out a sheet of tablature paper suitable for use with guitar music (6 strings). In traditional Western musical notation, you write down what notes are to be played, indicate their rhythms and dynamics, and leave the question of how to play those notes up to the individual musician. In tablature, by contrast, you note specifically what fingers should be placed on which strings. Rhythm is typically conveyed only generally, and it is assumed that the player has heard the music already, and is merely trying to learn how to manipulate the instrument to reproduce it. This is a popular notation among the Internet guitar community. |
| text-png.c Download [6.0K, 04-Mar-2006] |
These days, including your e-mail address on a web page in machine readable format is practically an invitation to the hordes of annoying spammers who have taken over the Internet like a plague of locusts. One way of getting around this problem is to include your address as a graphic. The foul imbeciles who send out spam usually let web-crawler programs do the work of collecting your address. While it is easy for a human to read your address out of a graphic and type it in, the bar is much higher for a piece of software. Since spammers are just about the lowest form of life on the planet, they're not likely to waste any of their already limited brain power or compute cycles recovering addresses protected in this way. text-png.c is a little command line tool that uses the GD library to convert a simple string into a small, web-friendly PNG file. It builds just fine on any Linux system with GD and FreeType libraries installed. Here's an example of its output:
To build it, this ought to work for GCC under Linux:
gcc -Wall -O2 -o text-png text-png.c -lgd
|
| treewalk.py Download [5.1K, 13-Apr-2005] |
This Python module implements a generator function named walk() that allows you to iterate over a subtree of the filesystem. This functionality is also provided by the os.path.walk() function, but this version has a few useful advantages:
The defaults are depth-first traversal without following symbolic links. You can use it simply as follows:
A more interesting example -- find empty files:
|
| tt2rom Download (ZIP) Download (tar.gz) [234K, 12-Jul-2002] |
tt2rom is a simple command line tool that converts algorithmic state machines (ASM charts) into Intel HEX format files that can be fed to various commonly-available EEPROM programmers. You specify your ASM chart as a truth table. There is documentation in the distribution file, in POD format (those of you with Perl installed can use the helpful pod2man tool to convert this to a manual page). |
| uuextract Download [5.9K, 28-Jun-2005] |
uuextract is a Python script that unpacks uuencoded compressed tar files from a Unix mailbox file, into a series of separate directories. I wrote this for use in one of the courses I teach, but it seemed like it might be a useful enough idea that I figured I'd post it. This script works with Python 2.2 and higher, although the tarfile.py module it relies upon does not seem to have been released until 2.3. Fortunately, you can snitch the source file from a 2.3 installation and use it just fine with 2.2. |
| weather Download [3.3K, 30-Oct-2007] Library [ 13K, 30-Oct-2007] |
Back before you could get National Weather Service reports off the web, one way you could get them was to telnet into an arcane command-line menu system in order to lookup weather reports for your area. I wrote the original version of weather in Perl to automate this process. The basic idea: You run weather XYZ, where XYZ is the three-letter code for your nearest weather station (usually the code for your nearest airport, as far as I can tell). The script will connect to the command-line host and retrieve the latest forecast, and write the results to standard output. Now, the output from this interface is somewhat ugly by default, so I wrote some code to help clean it up and improve its legibility. There are two pieces of this program: weather, which is the main driver program, and wformat.py, which is a library of subroutines implementing all the hard stuff. If you install these together in your path, it should work as expected, as long as you have a new enough version of Python. There are probably still some stations whose reports might break the output formatting code, unfortunately; if this occurs, please let me know. The older Perl version is still around, if you are interested. |
| wordcount Download [ 34K, 12-Jul-2002] |
I wrote wordcount to help a friend of mine who is learning Gàidhlig (Scottish Gaelic) build up a database of common vocabulary from the Gàidhlig language mailing lists he subscribes to. However, I thought it was probably worth making it general enough to generate word frequency statistics for other texts too. This is written in Perl, and is more configurable than it has any right to be, but it's not very carefully documented. |
| xcal Download [100K, 17-Jun-2004] History |
XCaliber II is a new implementation of an archaic conferencing program called "XCaliber", which was originally a citizen of the old Dartmouth College Time Sharing (DCTS) system. XCaliber was designed in the late 1970's, and its interface is meant to be usable from even the dumbest of dumb serial terminals that were available at that time. To the modern eye, the interface is very primitive, although those of us who hacked around on XCaliber in the late 80's and early 90's still have a peculiar nostalgia for it. Whereas the original XCaliber was written in a nasty assembly-type language called GMAP, this new version is in C. I wrote this as a present for a good friend of mine, who missed it after the last DCTS system went offline in the late 90's. However, in the narrow event you remember this old war horse, feel free to re-live your undergraduate days. The code is a bit messy, but ought to be portable, with minimal changes, to most Unix-like systems. |