Software

The C and C++ programs should compile all right on a UNIX system. I used gcc 3.3.1 or later on GNU/Linux with fairly strict warnings in most cases.

The Python programs should all work with version 2.4 or later.


		
#include <math.h>
#include <stdlib.h>
#include <stdio.h>

int    stride;
float* matrix;
void   ooooooo(int,int,int);

main(int argc,char** argv)
{
    FILE* fp;

    if(argc!=4) return;
    matrix=(float*)malloc((stride=strtoul(argv[3],0,10))*stride*sizeof(float));
    fread(matrix,stride*stride,sizeof(float),fp=fopen(argv[1],"rb")); fclose(fp);
    ooooooo(stride,0,0);
    fwrite(matrix,stride*stride,sizeof(float),fp=fopen(argv[2],"wb")); fclose(fp);
    free(matrix);
}

#define _(_,__)                  (matrix[((_)*stride+(__))])
#define __                       (_(I,J))
#define ___                      (__-float(I,J,I))

typedef int                      o;
typedef float                    oo;
typedef void                     ooo;
#define float                    oooo
#define typedef                  ooooo
#define int                      oooooo
#define void                     ooooooo

#define C                        (I+int/2)
#define H                        (J+int/2)
#define O(_,__)                  typedef(int/2,_,__);
#define L(_,__)                  void(int/2,_,__);
#define E(_)                     if(1==int){__=_;return;}
#define S(_,__)                  ooo _(o int,o I,o J){__}
#define K(_,__)                  oo _(o I,o J,o o){__}
#define Y(_)                     if(!I) return _;

K(float,
    Y(0)         
                                 return _(I-1,J)*_(I-1,o)+float(I-1,J,o);)
S(typedef,
    E(___/_(I,I))                O(I,J)    O(I,H)
                                 O(C,J)    O(C,H))
S(void,
    E(sqrt(___))                 L(I,J)    O(I,H)
                                           L(C,H))
		

This is an obfuscated C program. See if you can guess what it does.


Anagram.tar.gz
Finds anagrams of words or bits of words. Great for cheating a bit on crosswords.

Argon.tar.gz
OpenGL/GLUT 3D renderer (needed by beachball and boxes).

Array.tar.gz
Simple array class in some ways similar to stl vector. Used for historical reasons.

HTrans.tar.gz
3D Homogenous coordinates library used by beachball etc.

Plotter.tar.gz
Library for plotting graphs using Render. Used by wavplot.

Render.tar.gz
Library for rendering bmp images. Used by wavplot.

beachball.tar.gz
Simple OpenGL deformable body demo.

boxes.tar.gz
Simple OpenGL bouncing boxes demo. Quite peaceful.

checkUnclosed.py.gz
Locates validly unclosed HTML 4 elements using sgrep

dupes.pl.gz
Perl utility for scanning a directory tree finding duplicate files. Can output the list of pairs; a unique set (one member of each pair plus unique members); a bash script for updating copies from members of the unique set; or a bash script for deleting the duplicates. Does the duplicate detection with qx{cksum}.

e-prime.pl.gz
'E Prime' is supposed to be a version of English in which you don't use the verb 'to be'. If you speak only E Prime and forget English, it's supposed to be good for your health for various reasons. This handy perl utility can help you identify where you may have slipped up.

find_symbols.tar.gz
Finds symbols in object files, perfect for hunting down those dreaded linker errors. Only tested with GNU tools (it works by invoking nm and filtering the output).

frequency.tar.gz
Python script using for counting the number of Kanji in Japanese text.

fullrange.tar.gz
Audio utility for amplifying digital samples so they use their full range. Most well-recorded audio samples are full-range anyway, but across their total original length. This is useful when you've made an audio clip of something.

gomoku.tar.gz
One of my very first C programs. Plays a fairly good game using heuristics.

graphcode.tar.gz
Python program for printing call graph and dead-code information from disassemblies made with GNU objdump.

graphobj.tar.gz
Takes a symbol and a bunch of object files, and tells you which ones you'll need to link against to have that symbol defined, and any others you pick up along the way.

griddler.tar.gz
Solves griddler (also known as nonogram) puzzles.

hexameter.tar.gz
Scans Latin hexameters (roughly).

janalyze.tar.gz
Finds all the possible Japanese words in a piece of text and looks them up in EDICT Japanese/English dictionary. Can handle EUC-JP or SJIS encodings, and outputs a list in text or html. Is very useful for reading Japanese websites. Requires EDICT.

jencode.pl.gz
Perl utility for converting files between different Japanese and Chinese encodings.

logo.tar.gz
Logo interpreter written in Scheme. Current package compiles with chicken.

mapref.py.gz
Python module for manipulating 6-figure OS map references.

matchtrees.pl.gz
Makes one directory tree exactly the same as another by removing, making or touching directories or files. Doesn't copy the data, just matches the trees. Doing this before making a recursive diff which you intend to patch with the patch utility can make things a bit easier to deal with.

newclass.pl.gz
Makes very simple skeleton C and C++ source and header files and simple makefiles.

permutations.tar.gz
Python package for enumerating permuations and combinations.

poker.tar.gz
Utility for advising on 5-card draw poker hands. Useful for improving your game, particularly if used in conjunction with KPoker.

prime.pl.gz
Some perl golf... Someone showed me this.

quaternion.tar.gz
Python package for a small subset of orientation quaternion operations. Used by some of the raytracing scripts (but not needed by the package itself).

quote.tar.gz
Python utility for quoting emails in a funny style you see occasionally.

raytracer.tar.gz
Python package for raytracing. Can draw cylinders, cones, spheres and convex polytopes. Light sources are uniform plane waves, projections of images loaded from .xpm files, or can be associated with geometries. Makes lovely pictures with as much supersampling as you want, and outputs to .bmp or .xpm files. Requires Numeric Python.

raytracing.tar.gz
Series of scripts to generate various images using the raytracer package.

sim.tar.gz
Simple interactive MIPS simulator, useful for reverse-engineering MIPS code.

splitmail.tar.gz
Python utility for splitting up mbox mailboxes into separate files for each email message.

totalize.tar.gz
Processes stdin or files and adds up the first thing it finds in each line that resembles a number. Can also do averages. Useful for totting things up, and probably an adequate replacement for a spreadsheet in many circumstances.

track_headers.tar.gz
Python utility for tracing where source code is getting its header files from. Useful for figuring out what's going on or going wrong in unfamiliar or badly organized code.

vector.tar.gz
Python package implementing a few vector operations e.g. cross product. Used by the raytracer package.

wavbuffer.tar.gz
Buffer for reading and writing wav files, needed by some of the audio utilities.

wavparse.tar.gz
Utility for reading information in wav file headers.

wavplot.tar.gz
Utility for plotting graphs of the audio data in wav files.

win_postexport.pl.gz
If you want to do the unthinkable, and do cvs checkins and checkouts on a GNU/Linux machine, but edit the files you checked out on a Windows machine, you can run this over all the files after checking them out.

win_preimport.pl.gz
See win_postexport.pl. You run this before checking anything back in.

x11_tetris.tar.gz
Very playable X11 port of the greatest computer game of all time. No fancy gimmicks, just a proper scoring and timing system and plenty of falling bricks.

xtalk.tar.gz
Utility for adding crosstalk to wav files. Particularly useful for improving early stereo recordings with too much separation for listening to on headphones.

zenpoche.tar.gz
3D Visualization package. Also required by boxes and beachball demos.