This is all code I have written. Some is public domain, other stuff is under
the BSD license, knickknacks are left wonderfully unspecified.
Java
ISODATA Clustering Algorithm
An implementation of the ISODATA clustering algorithm. It currently
doesn't handle cluster splitting.
An Enigma simulator in Java
A simulator for a World War II Enigma encryption machine; the project was
made together with Christina from my History of Computing class. The GUI is
all her doing, the underlying enigma-logic is mine.
Maple
QR Decomposition [html]
An example of computing the QR Decomposition, both step-by-step and
through a single Maple call. Currently uses Maple's Gram-Schmidt, but
will eventually show Householder reflections as well.
LU Decomposition [html]
Demonstrates how to compute the LU decomposition, both with native Maple
commands and step-by-step. There is also a demonstration of Gaussian
Elimination with Partial Pivoting.
Singular Value Decomposition [html]
An example of how to compute the SVD. It shows both a step-by-step
method, and using a single Maple function.
Cubic Splines [html]
A Maple program that computes and graphs cubic splines for a user
supplied set of knots and end-coordinates.
Computing Determinants in Polynomial Time [html]
The cofactor expansion from linear algebra class is factorial in its
asymptotic complexity. The polynomial time method of computation
involves the LU decomposition, demonstrated here.
Affine Transformation Matrices in R3 [html]
This demonstrates the creation of an affine transform matrix in a
homogenous coordinates to 3-space. It illustrates potential
optimization for graphics code that generates affine matrices by
multiplying together individual transforms. Instead, we can use the
symbolic solution of the composed matrices, cutting five 4x4 matrix
multiplies down to small handful of scalar multiplies, six trig calls,
and three scalar divides.
Tolerances and Units [html]
Here I play around with units and tolerances in Maple. I wish I had
this available when I took University Physics; it would have made lab
assignments a hell of a lot quicker.
C++
Boyer-Moore String Search Algorithm
An implementation of one of the fastest searching algorithms around. It
can actually exhibit sublinear performance. The longer the search
pattern, the better it typically works.
Simple Stack Machine
A super simple stack machine which supports four operations (+,*,/,-).
Hacked together quickly, but it works.
Herd Immunity Demonstration
A demonstration of herd immunity concept using a simple grid model.
Uses ANSI C++ with QT for GUI output.
Bit Manipulation Functions
A collection of templated functions which manipulate bits in an unsigned
char. Unlike the STL bitset and vector<bool> unsigned char is
guaranteed to use exactly eight bits.
Chemical Elements Quiz Program
A quickly-hacked program that quizzes on the names of some common
chemical element names and their symbols.
Provisional Means Algorithm
A demonstration of the Provisional Means Algorithm, which provides a
single pass, numerically stable method of computing variance (and mean).
The naive algorithm, also implemented, requires two full traverses of
the data set.
Linear Time Majority Vote Algorithm
An implementation of Moore's majority vote algorithm. Determines if
there is a complete majority of a single element in a list using a
single pass. It tracks using a single counter and a single reference to
the current winner. Downside is that the algorithm does not in fact
indicate if there was a majority in the first place.
Object Factory Creating Pooled Objects
My first experiment with using TR1's shared_ptr and weak_ptr. The code
is ugly, but implements a factory backed by an object pool.
String Tokenizer
Demonstrates a compact tokenization using STL stream iterators. Also
illustrates Scott Meyers' "Most Vexing Parse".
Php
How to connect to Oracle 9i with php
After a bit of headache getting php and Oracle to play nice together, I
decided to toss together a sample script to save others the effort.
Miscellaneous
Start iTunes from Mac OS X command line
This is a tiny script which launches iTunes from the command line. By
invoking "sleep [sec]; start-itunes" I use my laptop as an alarm clock.