You can find a more detailed index below the simple index.
Sep 01, 2007 - null program is Alive
Sep 02, 2007 - Mandelbrot with GNU Octave
Sep 05, 2007 - YouTube with Free Software
Sep 08, 2007 - PNG Archiver - Share Files Within Images
Sep 14, 2007 - Memory Allocation Pool
Sep 17, 2007 - BCCD Clusters
Sep 19, 2007 - Proposal for a Free Musical
Sep 23, 2007 - Converting MediaWiki Markup to LaTeX
Sep 25, 2007 - Walk Text Adventure Game (Perl and MATLAB)
Oct 01, 2007 - Mandelbrot Set on a Cluster
Oct 08, 2007 - Java Animated Maze Generator and Solver
Oct 16, 2007 - Robot Version 1
Oct 24, 2007 - Chess AI Idea
Oct 30, 2007 - Polynomial Interpolation
Nov 06, 2007 - Iterated Prisoner's Dilemma
Nov 13, 2007 - Neural Network Blackjack Game
Nov 20, 2007 - Noise Fractals and Clouds
Nov 30, 2007 - Traveling Salesman Problem by Genetic Algorithm
Dec 05, 2007 - South Park Downloader
Dec 11, 2007 - Movie DNA
Dec 14, 2007 - Simple Hash Table in C
Dec 19, 2007 - Unsharp Masking
Dec 26, 2007 - A Faster Montage
Dec 30, 2007 - Movie Montage Poster
Jan 08, 2008 - Some News
Jan 20, 2008 - Optimizing, Multi-threading Brainfuck to C Converter
Jan 29, 2008 - The 3n + 1 Conjecture
Feb 04, 2008 - My Team Won the Robot Competition
Feb 13, 2008 - The New Index
Feb 22, 2008 - Linear Spatial Filters with GNU Octave
Feb 24, 2008 - Simple Hash Table Correction
Mar 14, 2008 - Rumors of My Death Have Been Greatly Exaggerated
Mar 15, 2008 - Lisp Number Representations
Mar 25, 2008 - Memoization
Apr 03, 2008 - For a Good Time
Jun 26, 2008 - Up is Down
Jul 08, 2008 - One-Time Pads
Jul 11, 2008 - One-Time Pads and Plausible Deniability
Jul 15, 2008 - A One-Time Pad Mistake
Jul 18, 2008 - Variable Declarations and the C Call Stack
Jul 20, 2008 - Sudoku Solver
Jul 25, 2008 - Two-Man Double Blind Coke vs. Pepsi Taste Test
Aug 09, 2008 - The Arcfour Stream Cipher
Aug 29, 2008 - A GNU Octave Feature
Sep 17, 2008 - Play NetHack
Sep 01, 2007 - null program is Alive
Welcome to null program. This is my new home as
my student location will
no longer exist in a few months. Here is where I will share my
projects and ideas, even if no one is looking, reading, or caring.
The name for this website comes from a phrase spoken in several places
in my favorite book, The Moon is a Harsh Mistress. If you have
not read this book, you are missing out. I recommend you go to the
[...]
Sep 02, 2007 - Mandelbrot with GNU Octave
In preparation for another project idea I have (to be posted in the
future), I wrote a Mandelbrot fractal generator
in Octave. Octave is great for
just trying things out and prototyping your algorithms. It is very
slow, however. Here is the code,
function mandel_img = mandel ()
## Parameters
w = [-2.5 1.5]; # Domain
h = [-1.5 1.5]; # Range
[...]
Sep 05, 2007 - YouTube with Free Software
In the future I will be posting some YouTube videos I have created. I
will probably reference this post when making these video posts. If
this is why you are here then I just want to say, "Hello visitors from
the future!"
As I have stated previously, I love free
software and I try to use free software exclusively whenever I can
(it is very difficult to find employment in computer engineering where
[...]
Sep 08, 2007 - PNG Archiver - Share Files Within Images
This is one of my projects. The original idea for this project came
from Sean Howard's Gameplay Mechanic's
#012. The basic idea here is that image files are the second
easiest type of data to share on the Internet (the first being
text). Sharing anything other than images may be difficult, so Why not
store files within an image as the image data? This is not [...]
Sep 14, 2007 - Memory Allocation Pool
I wrote this code and writeup some time ago and have used it in
several projects for building parse trees quickly. Using the pool is
faster than making a system call with malloc each time
you add a new node. In fact, one of my programs ran 25% faster when I
dropped in the this memory allocation pool. This code is very solid
and reliable.
Download the code (GPL
[...]
Sep 17, 2007 - BCCD Clusters
I have recently really gotten into clustering with excitement to write
something that can really take advantage of one. The first thing I had
to do was figure out how to cluster my computers. The second was to
write something that could really use my personal cluster to its full
potential. This post is about the first step.
A live CD was the obvious choice (and still is) to begin clustering:
[...]
Sep 19, 2007 - Proposal for a Free Musical
An idea I had some time ago would be for a free (as in speech) musical
(or play). It could be licensed under the GPL or something like it
(the GNU Free Musical License, GFML, perhaps?). For example, think of
the scripts and music scores as the "source code" for the musical,
where these documents must be provided to ticket-holders upon request
in digital form, such as on a CD, or printed. Just like free software, we are
[...]
Sep 23, 2007 - Converting MediaWiki Markup to LaTeX
Today I had a large document written in
MediaWiki markup. The document
was a simple one consisting only of paragraphs, all possible heading
levels, and flat lists. There were no mathematical expressions or
images -- nothing fancy whatsoever. I wanted this document available
in LaTeX markup so that I
could have a nice, professional looking printout.
[...]
Sep 25, 2007 - Walk Text Adventure Game (Perl and MATLAB)
I wrote this thing back in September 2005 when I had to learn MATLAB
for work. This writeup was done about year later.
Download the code (GPL
licensed)
at
download/walk.tar.gz (33.72KB). There are
both Perl an MATLAB versions.
This was a text-adventure engine I wrote when I was starting to learn
MATLAB programming, which means the MATLAB code here is pretty
[...]
Oct 01, 2007 - Mandelbrot Set on a Cluster
This the the second part of my post about clusters. Finally, here are
some more pretty pictures and video to look at! It is an
extremely parallel Mandelbrot set generator written in C.
This image was generated by my program on a cluster at my university,
and my favorite image generated so far. It is part of the sequence in
the videos below.
[...]
Oct 08, 2007 - Java Animated Maze Generator and Solver
Download Source (GPL):
maze.tar.gz (3.76KB)
Compiled:
RunMaze.jar (5.46KB)
In preparation for showing off the maze-navigating robot I made last
week, I give you this program I wrote last year.
When I started to learn Java, I wrote this little program for
practice. It features a GUI and multi-threading. It generates a maze
and then slowly solves the maze so you can watch it go. I wrote this
[...]
Oct 16, 2007 - Robot Version 1
Here is what my team has been working on for the last couple
weeks. The end goal for this robot is to escape a maze, collect
blocks, and find a repository in which to drop those blocks. Someone
suggested we call it Pac-man. Here it is (without batteries),
And here it is being worked on. We added a third level to make more
[...]
Oct 24, 2007 - Chess AI Idea
So, I had this idea using a genetic algorithm to optimize the
parameters of a program that plays chess. Now, the genetic algorithm
wouldn't be used at all during a game, but rather to optimize the
board evaluation parameters beforehand. I don't know much about
writing board game AI programs, as I have only written a few of them
for fun (tic-tac-toe, connect 4, Pente). For this chess program, I am
[...]
Oct 30, 2007 - Polynomial Interpolation
This is something I learned the other day that I thought was
interesting.
So you have some data from experimentation or from a function that is
difficult to solve.
Suppose you want to estimate a polynomial curve to that fits the
data. Then you could interpolate values between the data points. Let
p(x) be the polynomial. The equation for the polynomial we will fit to
[...]
Nov 06, 2007 - Iterated Prisoner's Dilemma
I was reading about
the prisoner's
dilemma game the other day and was inspired to simulate it
myself. It would also be a good project to start learning common
lisp. All of the common lisp code is available in its original source
file
here:
prison.lisp. I have only tried this code in my favorite common
lisp implementation, CLISP, as
well CMUCL.
[...]
Nov 13, 2007 - Neural Network Blackjack Game
I have a really nice post coming up soon (it is mostly written up
too!), but I want to spend more time on it to make good. Since I need
something to post this week, and I still have material to move here, I
have dug this up from my old website.
Get the source
code (C++):
neural.tar.gz (16.27KB) (GPL)
This is a neural network I wrote for an artificial intelligence class
[...]
Nov 20, 2007 - Noise Fractals and Clouds
I was reading about fractal terrains and wanted to give it a shot. As
usual, I like to try things out
in GNU Octave first
by writing up a quick prototype, and, if it is still interesting
enough, I will move to another language for better performance (Octave
can be frustratingly slow sometimes). Additionally, when it comes to
matrix manipulation, the Matlab language tends to be the most concise
[...]
Nov 30, 2007 - Traveling Salesman Problem by Genetic Algorithm
Download Source:
genetic.tar.gz (6.19KB)
Here is another project for my artificial intelligence class. I wrote
a generic
genetic algorithm class in C++ and then applied that class to the
traveling salesman problem. A genetic algorithm more tuned to the
traveling salesman problem would work better.
This particular implementation can use up to 16 points defined in the
[...]
Dec 05, 2007 - South Park Downloader
Notice: This software is not affiliated with the South Park Zone nor
South Park. In fact, this bypasses all of the South Park Zone's
advertising, so they may not like it. I have do not have anyone's
approval, nor do I know about any of the legal implications of this
tool. Use at your own risk.
Get the
program: spd.pl
(3.8KB) GPLv3 Requires Perl
[...]
Dec 11, 2007 - Movie DNA
Brendan Dawes has this interesting idea he
calls Cinema
Redux. A entire film is distilled down to a single image. You take
one frame from each second of the movie, shrink that frame down to 8x6
pixels, then line them up in a montage with 60 frames per row. Each
row then represents one minute of film. There are 8 examples on his
website.
I was interested in trying this for myself, but I couldn't find any of
[...]
Dec 14, 2007 - Simple Hash Table in C
Download:
hashtab.tar.gz (3.9KB)
I needed a hash table written in C for a project I was working on and
I didn't like any the free hash table code that was out there. Plus, I
have NIH
syndrome and I really wanted to write my own for fun. My goal was
to make it extremely generic, so that it would work with any data of
any size. A small front end could be placed on top to make it work
[...]
Dec 19, 2007 - Unsharp Masking
Original image courtesy NASA.
While studying for my digital image processing final exam yesterday, I
came back across unsharp masking. When I first saw this, I
thought it was really neat. This time around, I took the hands-on
approach and tried it myself in Octave. It has been used by the
publishing and printing industry for years.
[...]
Dec 26, 2007 - A Faster Montage
I had written a previous post
called
Movie DNA where I described a simple way of distilling an entire
movie down to a single frame. It involved the use of two tools, with
no intermediate code or software in the middle to glue things
together.
The first tool, mplayer was
used to dump all of the frames we needed. This took about the running
length of the movie to do, which wasn't so bad. There may be a way to
[...]
Dec 30, 2007 - Movie Montage Poster
I wanted to try making one of those movie montage things
I wrote
about earlier into a nice poster that could be hung on a
wall. Now, I prefer a Spartan environment whenever possible,
so I really did not want to have my own poster. No decorations
for me, please. I just wanted to make one. My solution? Make one for
my sister, who has lots of junk and would enjoy having one. Her
[...]
Jan 08, 2008 - Some News
Sorry for the lack of new material. I was apartment hunting with my
fiancee (the most beautiful and wonderful girl in the world) this past
weekend in the Baltimore area. I found a nice place in
Columbia. Tomorrow morning I am getting some oral surgery done and
will be hospitalized for awhile. So nothing new here for possibly a
couple of weeks.
[...]
Jan 20, 2008 - Optimizing, Multi-threading Brainfuck to C Converter
wbf2c converts an
esoteric programming language
called brainfuck
into C code which can be machine compiled. Several optimizations are
done to make the resulting program extremely fast an efficient. The
converter supports both a static (standard 30,000 cells) array or a
dynamically-sized array. It also supports many different cell types,
from the standard char to multi-precision cells
[...]
Jan 29, 2008 - The 3n + 1 Conjecture
The 3n + 1 conjecture, also known as
the Collatz
conjecture, is based around this recursive function,
The conjecture is this,
This process will eventually reach the number 1, regardless of which
positive integer is chosen initially.
The way I am defining this may not be entirely accurate, as I took a
shortcut to make it a bit simpler. I am not a mathematician (IANAM) --
[...]
Feb 04, 2008 - My Team Won the Robot Competition
Introduction: This "news" is over two months old, simply because
I had other more interesting things to write about first. Not that I
am out of ideas: I have at least three more ideas lined up at the
moment on top of several half-written entries that may never see the
light of day. I just want to get it out of the way.
In December we held the robot competition, pitting against each other
[...]
Feb 13, 2008 - The New Index
You may have noticed the new index available on the left of the
page. It really needs one, because looking at older posts required
paging through the archives. Even more so because I have yet to add
search functionality. There were
Blosxom plug-ins available to do these things, but they are long
gone now. I looked into getting a Google search box dropped in there,
[...]
Feb 22, 2008 - Linear Spatial Filters with GNU Octave
I have gotten several e-mails lately about using GNU Octave. One
specifically was about blurring images in Octave. In response, I am
writing this in-depth post to cover spatial filters, and how to use
them in GNU Octave (a free implementation of the Matlab programming
language). This should be the sort of information you would find near
[...]
Feb 24, 2008 - Simple Hash Table Correction
In December I made
a post
about a simple hash table I had written in C. I got an e-mail
from Benoit
Rouits (
http://brouits.free.fr/) pointing out a memory leak
in ht_destroy() that he found
with Valgrind. I had failed to free
the main array in the hashtable when it was being destroyed,
free (hashtable->arr);
I added the fix and updated my e-mail address in the source tarball,
[...]
Mar 14, 2008 - Rumors of My Death Have Been Greatly Exaggerated
It has been a few weeks since I made my last post. I just started my
new job at Johns Hopkins University Applied Physics Laboratory, which
has reminded my just how exhausting starting a new job can be. There
is so much to learn and balance all at once, and when I get home from
work I don't feel like doing anything constructive. This is why I
haven't posted anything recently.
[...]
Mar 15, 2008 - Lisp Number Representations
This exercise partly comes from a couple different chapters in the
book The
Little Schemer. The book is an introduction to the Scheme
programming language, a dialect of Lisp. The purpose to to teach basic
programming concepts in a way that anyone can follow along just as
well as someone with a degree in, say, computer science. It is still
very useful for us programmer types because there are some good
[...]
Mar 25, 2008 - Memoization
I had written
in a
previous post about a neat feature of Lua. I found out later that
this is simply a form
of Memoization. The
idea is that you trade memory for speed by only doing calculations
once and keeping track of previously calculated values. I had even
complained about Perl hashes not being flexible enough (not true,
thanks
to Tie::Hash). Perl
[...]
Apr 03, 2008 - For a Good Time
At work I am currently maintaining/adding features to a rather large
piece of software. It takes over two hours just to build (but this is
mostly because C++ takes a long time to compile, being the ugly mess
C++ is). I wondered if there would be any, let's say "interesting",
comments in there. With all that code there had to be something! I ran
this to find out,
[...]
Jun 26, 2008 - Up is Down
I was in an elevator the other day and I noticed something about the
digital numbers. I was on the 7th floor going down. Inside the
elevator was the standard 7-bar number display indicating the current floor,
However, from the angle I was standing, the top right bar was not
visible. Like this,
[...]
Jul 08, 2008 - One-Time Pads
Example code:
otp.c,
Makefile
(this Makefile may be useful)
The one-time
pad (OTP) is an encryption algorithm that provides perfect
secrecy, provided it is implemented properly. The pad, which is
essentially a key that is the same length as the message, must be used
only once (hence the name), kept secret, and, the hard part, generated
using some truly random
[...]
Jul 11, 2008 - One-Time Pads and Plausible Deniability
In a
previous post I discussed one-time pads. The information for this
post comes from Bruce
Schneier's
Applied Cryptography (section 10.8).
One-time pads are great for something
called
plausible deniability. With plausible deniability, when a person
holding encrypted data is coerced into decrypting their data, the
interrogator will not be able to tell if the person is complying with
[...]
Jul 15, 2008 - A One-Time Pad Mistake
In a
previous post I discussed one-time pads. Note: this is about a
cryptosystem, not some kind of menstruation disaster. The information
for this post comes
from
a little gem I saw on the xkcd
forums. I generally don't lurk around there because it suffers
from the same disease most non-self-moderating forums suffer from:
anal retentive, power-abusing, whiny moderators. I lucked out this
[...]
Jul 18, 2008 - Variable Declarations and the C Call Stack
A co-worker asked me a question today about C/C++ pointers,
If a pointer is declared inside a function with no explicit
initialization, can I assume that the pointer is initialized
to NULL?
We were down in the lab and, therefore, he had no Internet access to
look it up himself, which is why he asked. When I code C, it is just a
[...]
Jul 20, 2008 - Sudoku Solver
I was at my fiancee's parent's house over Fourth of July weekend. Her
family likes to leave plenty of reading material right by the toilet,
which is something fairly new to me. They take their time on the john
quite seriously.
While I was in there I saw a large book
of Sudoku
puzzles. Since the toilet is a good spot to think (I like to call it
[...]
Jul 25, 2008 - Two-Man Double Blind Coke vs. Pepsi Taste Test
My fiancee, Kelsey, claimed that she could tell the difference between
Coke and Pepsi. I wanted to put this to the test. Since there were
only two of us, arranging the test wasn't a simple matter of asking
someone else to pour some cups. I also wanted to do this right:
testing must
be
double-blind. I devised a little scheme that allowed us to perform
[...]
Aug 09, 2008 - The Arcfour Stream Cipher
Stream
ciphers are one of the two types
of
symmetric key algorithms, which is when the same key is used for
encryption and decryption. They follow this simple concept: take a
good pseudo-random number generator and combine, usually by XOR, its
output with your plaintext stream. This is very similiar to
the
one-time pad, but the random pad is pseudo-random rather than
[...]
Aug 29, 2008 - A GNU Octave Feature
At work they recently moved me to a new project. It is a Matlab-based
data analysis thing. I haven't really touched Matlab in over a year
(the last time I used Matlab at work), and, instead, use GNU Octave at
home when the language is appropriate. I got so used to Octave that I
found a pretty critical feature missing from Matlab's implementation:
[...]
Sep 17, 2008 - Play NetHack
Patience. NetHack is all about patience. Never be too hasty, as the
game is extremely unforgiving. If you let your guard down for just a
few turns, you can easily lose everything. Death is permanent
(with
some exceptions), so dying means starting it all over with a new
character.
I got into NetHack a couple of
years ago. I play is in cycles, playing heavily for a couple of months
[...]