Home |

Previous Work

A lot of the code here, is work from my university days. But some of them I reference quite often.

My First piece of code

I wrote this program back in 1998, when VB was starting to get hot, and C programming was almost synonymous with Borland compilers. It was one of my first exposures to programming and I loved it. Later I got interested in VB. In my naive-ness, this contains all kinds of messy constructs like "labels", but it still works beautifully. Given any number, it guides you (by graphics mimicked by ASCII chars) how to convert it into binary. One of the most cherished pieces of code I have:

Number to Binary in C


CSIDC 2006 Ecocatch

In the year that CSDIC took place the last time, me and a bunch of seniors competed for CSIDC (arguably the most-prestigious under-graduate CS competition at that time). The problem we chose to resolve is faced by the marine eco-system because of excessive fishing. The fact is that out of every 4 fish caught by ocean-going fishermen, by conservative measures, at least 1 is always by-catch (fish catch which would be thrown away since its of no use). The idea we wanted to develop was simple, but effective: we wanted fishermen to deploy a device on their nets which wards off by-catch. As funny as it seems, every specie of fish hears at a certain different frequency. So by generating noises in the frequency range (ranges were pre-programmed in the device) audible to by-catch, a fisherman might be able to get a more economically relevant catch. Moreover the sounds generated were adaptive (since over-time fish get used to a certain sound) by checking which ones affected by-catch the most. This technique is extremely effective on mammals like whales and turtles because of their acute sense of hearing.

We went pretty far with the project! We developed an embedded system based on an 8051 micro-controller, which used a rudimentary under-water speaker to emit sounds. We tested our system with local river fish, getting some hopeful results. Unfortunately I'm unable to find the final report we submitted to CSIDC, but do drop me an email if you're interested :). I'm still looking for it and should be uploading it soon.


FS Meta-Tagging

This idea comes from the theme that the user shouldn't care about where the files actually lie on the FS internals. As far as the user is concerned, the files should be contained in any of the labels the system has. So labels act as just meta-data for files, a feature that allows us to deal with files and label directories just like Gmail deals with emails and labels. Something like implementing a small chunk of the functionality of WinFS using Visual C++ .NET and ADO.NET.

Code and DB

Design Doc | Requirements Doc | Testing Doc


Vision based Foveation Points

This research built on Giorgio Pioppo work which built a fast technique to encode foveation points in a video in order to save space while storing these videos. We researched on Computer Vision techniques to identify regions where foveation in videos can be advantageous while encoding. This can be really effective if these regions can be correctly identified according to where a viewer would look.

If you want to learn more about the project head to my Vision Research page.

There was some pretty useful code I wrote for this project which I can freely distribute. One of them was a (multiple) video player, where you could compare the bit-streams of videos. This was my first experience in tinkering with a video codec, namely the yuv. Although pretty trivial, I really enjoyed writing its decoder. The source code is in Java and uses the JMF library for media playback (you'll need to install the library to use the code). Plus to register the yuv codecs, open the JMF Registry Editor. Select the Packages tab and add " foeation.yuv" in the Protocol Prefix List, and then Commit the changes:

Java simultaneous Video Profiler code (ver. 1.07.01)


Computing N-th root on Hardware (FPGA)

One of the projects that I enjoyed the most. The idea came out by thinking how does a machine compute an under-root. Hmmm....even harder how does it compute any arbitrary root. Its much easier to do it on software, but making this on FPGA involved continuously juggling between a limited number of registers. Learned a lot of code optimization through this exercise, but also learned a lesson: optimized code becomes unbearably hard to understand:

Unoptimized Verilog code | Optimized code | Doc


MPI / OpenMP code

our High Performance Computing course

Whenever you realize that your current code, with little effort, can be run much faster by parallelizing it over multiple machines, you feel like thief who just learned a dirty trick. And then you start getting crazy ideas of computing mersene primes over your university's cluster. Well I didn't get to do all kinds of jazzy stuff, but I still got to compute integrals with the power of multiple machines. Interesting C code you could try with MPI/OpenMP:

Matrix multiplication through OpenMP | Definite Integral computation using OpenMP | Transposing matrices through MPI | Integer Search with static block distribution (MPI) | Integer Search through Master/Slave mechanism (MPI) | Integer Search through collective communication (MPI)

Helper files: Make large rand. no. Matrices | Make files with rand. no. s


Signal Processing of DTMF

Everyone has heard the cryptic tones when you dial a number. Its not hard to figure out that each number has its own tone (to be technically correct, two tones). Its easy to say that something differentiates between these different tones, but how is another story. The standard behind it DTMF is ingenious, cause it works in all sorts of conditions. Check the Matlab code out on the test files:

Matlab Code | Test DTMF Files | Doc


Comparing your Scheduling Options (OS)

Our Operating Systems group ended up doing a project, which seemed pretty interesting when we were naive (our sophomore year). Me, Moutaz Haq (the Cefarix guy) and Yahya Cheema, designed a platform mimicing an OS churning intstructions, which could be plugged-in with different scheduling algorithms to see how they performed. Unfortunately most of the code was lost in the great fire, or smth :), but still managed to salvage the different scheduling algorithms we implemented. The crumbs from the fiesta (Java):


Networking snippets

Simple FTP-like Client | Server programs supporting 'list', 'get', and 'cd' commands

FTP-like Client | Server code supporting 'list', 'get', 'put'. Different from the above that a protocol was developed on the Application layer to deal with a (naughty) proxy server dropping, re-ordering, corrupting, delaying and duplicating packets (including acks) arbitrarily.


Fight between Containers

What happens when you pit AVL trees against sorted linked-lists and Hash tables (contains code for AVL Trees and Hash Tables both with AVL Trees and Sorted Linked-lists):

Code | Results


APT Card-pile games

This is for APT students from LUMS, coming here, looking to steal code :). Well! I wouldn't be able to lend out code for a good reason, but I might offer you something that helped me a lot in Project 3 a.k.a. Card-pile games. Its a cheat-sheet for what inheritance hierarchy you should follow and how cards should flow between classes. Having said that, I would recommend, that you think over it, cause self-designing your code will surely take you long-way in the project:

Cheat Sheet CS-292 Project 3


mail: | skype: ahmad.humayun | voice: +92 321 4457315