Coding Projects

SwingCapture

src

Fall 2009.

Written hastily in a week for my fraternity's quarterly party. This app is a realization of a photo booth idea for the party. The idea: a guest, or more, in their drunken stupor comes in to the designated photo booth room. They start the capture sequence, pose, and have their picture taken. The app will then not only timestamps and saves the photo, but also automatically upload it to Flickr in real time.

It is written in Java, leveraging the Java Media Framework for its device capture API, and Swing for the GUI. The result.

Engineered - A Webcomic

webcomic

Summer 2009.

No, I did not actually start a webcomic (I can't draw anyway). A friend of mine has been drawing semi-regular webcomic lately. And he has been posting his updates as Facebook notes. I suggested that he hosts them on an actual webcomic website and I decided to draw him a prototype.

I have actually been interested in Django back when it started to gather a lot of buzz but, through lack of ideas and/or time, I haven't had a chance to get my fingers wet with it yet. This time I decided to actually do it, since I have been playing with Python a lot more lately anyway. My first impression with it so far has been really good. The admin interface and its decoupling-oriented DRY principle feels really clean and solid. Developing with it has been a joy. I will probably want to compare it with Google App Engine (Python) for my next web idea (maybe these entries). Google's Datastore API is definitely going to be interesting to look at.

Google Code Jam 2009

src

Summer 2009.

So I found out that the qualifier round for Google Code Jam has been in full swing, five hours before the round was closing. Since I have been using and enjoying Python at work, I decided to give it a shot with it. I attempted the third problem first, since for some reason I understood it faster after a single read. I quickly identified it as a dynamic programming problem. Did a quick brute-force solution for the short input and passed. Then refactored to include memoization for the long input and passed. Easy. Then I re-read the first problem and hacked a quick regex-calling script to solve both short and long inputs gracefully (hooray for Python battery!). At this point I did not have time to even start on the second problem, but I did identify it as solveable using DFS. So I wrote a solution for it anyway (after the deadline) and double checked for correctness using practice input and, voila, my solution.

PS: Incidentally, getting a quick script up and running for this sort of task is a real joy in Python! That, and the REPL, really helped a lot.

The Hundred Hour Wood: MiniJava-to-MIPS Compiler

doc webapp

Spring 2009.

This class (compiler construction) offers a challenging programming project that walks you through the typical steps in compiling a language (MiniJava, a small subset of Java) to assembly (MIPS).

From method flattening to canonizing, to register allocation and setting activation record. Seeing each step bringing the compiler closer to construction, and the wonder in using the Visitor pattern in Java, has been fun and educational for me.

I also took the project as an exercise in literate programming, since the resulting source code is bound to be quite large, and its architectural design valuable to be revisited in the future. Javadoc is a great tool to do that, and a great incentive to program literately in general. I cannot post the source code, for obvious reason, but I can post the resulting Javadoc documentation.

Note: After poking around with GWT and Google App Engine, I decided to give them a try by building an AJAX web interface for the compiler engine. The core engine is embedded in the App Engine server as a Remote Service servlet, and the GWT application interacts with it via RPC.


Pipeline Scripting

trac

Winter 2009.

I worked as part of a team for a Software Engineering course. We were to assist in implementing a script generation library to be used in LONI's Pipeline software project. See documentation in the trac for details.


Simple Ray Tracer

screenshot

Winter 2009.

I built a simple ray tracer with Phong shading as part of an introductory computer graphics class. The ray tracer that we built is really simple, designed mainly to understand the concept of the procedure. Currently, only spheres (with arbitrary scaling and translation) with recursive reflection rays are supported. Refraction is not (I plan to expand this later). Written in C++. Debugging was hard mainly because of the volume of data handled by the ray tracing algorithm. Especially tricky: getting the calculation of surface normals right. Even a simple algorithm (as the Phong shading algorithm certainly is), when implemented to deal with massive volume of data, can be really tricky to debug!


"Hello, OpenGL!": Reddit Alien in 3D

screenshot animated

Winter 2009.

As part of an open ended homework for an introductory computer graphics class, I decided to try to model and animate -- crudely, mind -- the famous reddit alien. It is an exercise of my first exposure to 3D computer graphics and OpenGL. I actually quite enjoyed doing the project. (Had I the time, I was actually planning on a digg vs reddit aliens showdown).


Maze Search

applet src

Fall 2008.

I wrote this in a couple of days to visualize informed search algorithms when they are applied to, well, a maze. Currently supported algorithms are DFS (Depth-First Search), BFS (Breadth-First Search), and A*.

Note: It is interesting to see a visual “proof” that DFS trades off optimality for space, BFS trades off space for optimality, and A* combines both approaches to be best in time and optimality, as well as being better in space allocation than BFS.


Tetris

applet src pytetris

Summer 2008.

Every aspiring programmer would at one point try his hands on a Tetris clone. Inspired by an IBM primer.


Molecular Disc

screenshot src

Fall 2006.

A simulation of collisions between N molecular discs, in an elastic fashion. Mainly an exercise in event-driven design using event queue instead of leap-frogging and checking objects for interlap and collision. Attribution of project idea goes to Princeton.



© 2009 Santoso Wijaya.