Algorithms

Earlier this week I was fairly pleased with myself for writing a reasonably elegant piece of code that takes a bunch of variously-sized chunks of data and works out how to efficiently and predictably squeeze them into the spare bandwidth of another data stream.

The next day, I think while walking to the grocery store, it occurred to me that I could do the same thing with a mapping trick and some modular arithmetic.

I was prematurely pleased with myself. That version took two lines of code.

About this Entry

This page contains a single entry by Milligan published on December 7, 2007 11:27 AM.

Felis Domesticus* was the previous entry in this blog.

Observing with Knobs and Gears is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.31-en