latest entries

09 Oct 2012, 09 Oct 2012
upstart script section exits prematurely
Remember that Upstart runs every script section using /bin/sh e.

04 Feb 2012, 04 Feb 2012
finding the most repeated value in an array
An array of length n has k distinct elements, $k < n$. Find the most repeated value in the array…

01 Jan 2012, 01 Jan 2012
lower bound on finding the ksmallest elements in sorted order
Any comparison based algorithm solves the problem of finding the ksmallest elements in sorted order in $\Omega(k\lg{n})$ time for an nlength array…

17 Dec 2011, 17 Dec 2011
refresh browser when html or css changes
If you work regularly with web pages you know how tedious it is to go back and forth between your editor and browser and hitting refresh to see the changes…

10 Dec 2011, 10 Dec 2011
solving the selection problem given the im/n smallest element
Given a blackbox capable of finding the $\left \lfloor \frac{in}{m} \right \rfloor$ smallest element in an array of length $n$, where $1 \leq i < m$ are constant, find the $k$th smallest element in a given array using the blackbox in linear time…

08 Dec 2011, 08 Dec 2011
kth smallest element in union of sorted arrays
Given two sorted arrays A and B of length n, find the kth smallest element in the union of the two arrays (imagine the two arrays are merged into one sorted array of length 2n). Do so in $ \Theta (\lg n) $…

04 Jun 2011, 04 Jun 2011
subsecond precision is not enough
Turns out relying on st_mtime having subsecond precision is not reliable enough, as this small test demonstrates…

04 Jun 2011, 04 Jun 2011
the filecache decorator
The past week or so I’ve been working on a new decorator that tracks files under the .hg/ directory for changes…

04 Jun 2011, 04 Jun 2011
first poc of the command server
Yesterday I sent out an early version of the command server to the mailing list…