Fun Projects

Kindle Clippings Processor

The online service that I used to use for processing kindle clippings,, released a new version this week. And lo and behold, everything useful is behind a paywall.

I only needed it for processing My Clippings.txt to export it into Evernote, and it’s just file processing of standard format txt, so I thought I’d just whip up a simple version for my own use.

Initially I had planned to write a script for it, like the ruby one I did for cleaning up the mess of record files in kindle, after you delete books. But on second thought, it would be nice if other non-technical people can use it easily too. So, here it is:

On upload of a clippings file, it will have your highlights grouped by book title and sorted by location and timestamp.

Fun Projects, Performance

Huffman Coding Explained

Due to patent issues with newer schemes [1], Huffman Coding remains to be the go-to compression algorithm of the day, being applied in ZIP, JPEG, PNG… and much more.

The core idea of Huffman Coding, is to use shorter codes to represent more frequent characters. As for why we always see a mysterious tree of zeros and ones, well, that’s essentially how computers store anything: with binary codes. Essentially the goal of constructing the Huffman binary tree is: to assign the most frequent characters to the shortest zero/one path, walking from tree root to end of a branch.

How to create such a tree?

Continue reading