Category Archives: Programming

Hadoop example for Exim logs with Python.

The following is an example of parsing an exim_mainlog using Hadoop streaming. I’ve implemented both the mapper and the reducer in Python. The mapper and reducer don’t handle all of Exim’s log formats yet but this can be easily extended in the mapper and reducer if you actually end up using the output (this is [...]
Posted in Programming | Tagged , , , | Comments closed

Sorting methods in Java.

I made this during school and have used it many a times while preparing for an interview or checking my new work in new languages. The class has static methods for all of the classic sorting methods like selection sort, bubble sort, insertion sort, heap sort, merge sort and quick sort. public class Sorts { [...]
Posted in Programming | Tagged , , | Leave a comment

Heap sort in Python.

Here is an example of heapsort in Python. This sorting method happens to be my favorite of the bunch – I like to think that this is the most elegant sorting method, but I’m sure you could argue against me. Edit: I renamed percolateDown to percolateUp because I realized its really more of a “move [...]
Posted in Programming | Tagged , , | Leave a comment