lunes, 18 de octubre de 2010

Courier new WTF (or, monospaced is not enough)

Via reddit , I found this pearl:

From wikipedia:
Courier New is used extensively in programming. For example, online forums, such as phpBB, SMF, and vBulletin, will use Courier New for <code> blocks; on Microsoft Windows it is a default monospaced font for a variety of applications, such as Notepad, Visual Studio (although the Consolas font family is provided as an alternative

Seriously, if you have to write code, go and get a font that doesn't suck. Monospaced is not enough.

viernes, 15 de octubre de 2010

ubigraph: an interactive 3D graph creator

A few days ago I read a funny post on HN. A guy was presenting some clojure code that used ubigraphto produce 3d navigable graphs.

To make ubigraph portable and interoperable with many languages, they present the app as an independent window (embedable, I hope) with its own process that acts as a XML-RPC server, so if you don't have an specific API for your language, you can use plain XML-RPC calls.

I've written a simple fibonacci function with a callback that draws the flow of the calculations.
Here's the code, and a (static) image of the graph.

To See how memoizing works, I've modified the code a bit using Memoize and a normalizer function and now we see how the number of steps is O(n).