Posted on July 29, 2008 in Other Projects by John No Comments »

Frequently when I’m writing code I want to quickly find all references to a particular function/method/class/variable within the entire code base. Many IDEs provide this feature, but most of those programs are too bulky for me, I typically program in Vim or Gedit. So I wrote this bash script which greps all the files in the current directory for a specific term and pretty prints the output with filename and line numbers. It lets you limit your search to files with a specific extension with the -e option, or a different directory with the -d option. Anyway, this is all very simple, what I want to talk about is running this straight from Gedit with a single key press and getting sexy output, like this:

Running tool: GrepAll
 
./Connecter.py:
352:            self.encoder.add_neighbor(self.id, AESKey(key, iv))
356:            self.encoder.add_neighbor(self.id, self.tmp_aes)
 
./Encoder.py:
154:    def add_neighbor(self, nid, aeskey):

Right there in the bottom pane.
(more…)

Posted on May 18, 2008 in Other Projects by John 3 Comments »

Here’s an 8×8 LED matrix display that I built and programmed to play out randomly generated boards of Conway’s Game of Life:

While I was waiting for the parts to arrive I wrote a little python version that should run on just about any computer assuming python and pygame are installed. The program will display a square 40×40 toroidal game of life board by default, but it can take a command line argument to make it NxN (ex: python conway.py 8). There are plenty of other very nice game of life implementations out there, much faster and more featureful than this one, which I highly recommend if you’re interested in learning about this cellular automata.

Now, about the hardware version.
The source is available, and if you’re interested in building one there are tons of circuit diagrams online for driving an 8×8 LED Matrix (like this one). It’s a fun project and definitely easy enough for beginners (I have virtually no electronics experience, and this is also the first time I’ve ever programmed a PIC).