Coding

Over the past few years, I have produced a variety of pieces of code that are of varying utility to others. I intend to place anything that may be of use to others on this page or at least anything that is interesting.

DES

cli.c des.c des.h

This is an implementation of the Digital Encryption Standard algorithm and several of the standard block modes (ECB, CBC, CFB, OFB, and CTR). This was made as part of a cryptography course. This implementation makes heavy use of bit permuting as opposed to more efficient algorithms that use bit-block rotation to implement several key stages of the algorithm. As such, this implementation is not likely to be as efficient as an implementation such as the one available in glibc.

Quadrature

quadrature.tar.bz2

This is an implementation of the game Quadrature by Mark Steere. This was created for the use in the Artificial Intelligence course at Rose-Hulman as a game with which the students could create adversarial players to compete. The game lends itself to basic AI techniques but presents similar challenges as in Chess but with much simpler gameplay. This game can be played by a human player as well as against AIs and any combination thereof. The student’s sumbission are not included, however the benchmark AIs wrote by myself are included.

MiniJava Compiler in Python

minijava.tar.bz2antlraux.tar.bz2

This is a compiler for a variation on the MiniJava language wrote in Python. The front-end lexer and parser are implemented via ANTLR with some help of antlraux (ported to Python). This compiler was created as a project for the Compilers course at Rose-Hulman. Probably the most useful snippet for others is the port of antlraux.util to Python. Also of interest to ANTLR users in Python is the MiniJavaTokens module which reads the TokenTypes.txt from ANTLR. And finally, the SmartVisitor module provides a robust way to walk an AST generated by ANTLR.

MiniKanren

minikanren.rbminikanren_extras.rb

I may be cheating future generations of graduate students at Indiana University by placing this into public knowledge, but I give here my implementation of MiniKanren, a tiny embedded logic language, in Ruby: minikanren.rb. I’ve taken the liberty to rename their “run” to “infer” and “conde” to “any” (to parallel a now explicit “all”). I’ve also converted a chunk of the functions provided in The Reasoned Schemer.

freevz

freevz

Freevz is a tool (written in Python) to parse the User Beancounters in a OpenVZ/Virtuozzo virtual private server. In some cases, the standard “free” utilty will report the host machines values or will provide no values at all. This tool will recreate the output of “free” using the counters as realistically as possible.