Niek Sanders' Travels

{ Home }

{ Photos }

{ Schedule }

{ Biography }

{ Education }

{ Litterbox }

{ Coding }

{ Links }

{ Sex }

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.

      Enigma Simulator Screenshot

  • 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.

    • Inplace Matrix Multiplication
      Performs an inplace multplication for two 4x4 matrices, computing B=AB.

    • Julian Day Conversion Routines
      A pair of simple routines to convert between Gregorian calendar dates and Julian Day.

    • 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.

    • Playing with STL Algorithms
      A demonstration of using the STL.

    • 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.

    • Run Time Type Indentification
      A demonstration of how to use the built-in RTTI system of C++.

    • 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
  • Miscellaneous