Initializing Arrays

March 29, 2011

Initializing large arrays of data before use is always cumbersome but it seems to be unavoidable.

The first types of solutions fill the array with a value that denotes an empty entry. While this sounds straightforward, the choice of that value is not always easy. For floating points numbers, zero may or may not be a good candidate. If convenient (as a zero floating point value is encoded as binary zeroes filling the variable) it may be difficult in some contexts to use because zero may be valid. Fortunately, there’s always the possibility to initialize the array with NaNs, which can be tested and used correctly (but you need the POSIX functions to do that).

Read the rest of this entry »


March 27, 2011

Two weeks ago, I went back to the Université de Montréal to pay a visit to my Ph. D. Adviser. As we toured his laboratories, I noticed that a drawing I scotch-taped to a wall ( as a Masters’ student) was still there after all those years.

…So it’s been there since 1994. Damn, I’m old!

Compressing Voxel Worlds

March 22, 2011

A friend of mine, Arthur, is developing a voxel-based game and found himself having to deal with large volumes of data. Unlike 2½D games where the map is essentially a 2D expanse with occasional relief, his game allows the definition of things in full (discrete) 3D.

To avoid loading the entire map in memory, he made the wise design decision of making his world tile-based, so that it can, simultaneously, reduce the working set as well as having an essentially open map, by loading only a small set of visible world blocks at all time. So together we took a look at compressing these world blocks, and it turned out that we can do a lot with fairly simple algorithms and VLCs.

Read the rest of this entry »

Wallpaper: Autumn

March 18, 2011

(Autumn, 1920×1200)


March 18, 2011

(A photographic experiment involving a kaleidoscope and some code)

Suggested Reading: Beautiful Evidence & The Visual Display of Quantitative Information

March 17, 2011

Edward R. Tufte — The Visual Display of Quantitative Information —2nd ed., Graphic Press, 2001, 197p. ISBN 978-0-9613921-4-7

Edward R. Tufte — Beautiful Evidence —2nd ed., Graphic Press, 2006, 213p. ISBN 978-0-9613921-7-8

(Buy at

(Buy at

Tufte is known for his work on visual presentation of information and all his know-how can be found in his two books: we discover his sober, well documented, to-the-point style, and the careful analysis of each graphs and display technique. His style is such that he conveys without ambiguity why he think something “works” or doesn’t.

Read the rest of this entry »

Suggested Reading: Now You See It

March 17, 2011

Stephen Few — Now You See It: Simple Visualization Techniques
for Quantitative Analysis
 — Analytic Press, 2009, 330p.
ISBN 978-0-9706019-8-8

(Buy at

Having to review papers (and other manuscripts) quite often, I can say that one of the greatest weaknesses (after dismal engrish and bad overall structure) is the display of quantitative information. In this book (which is somewhat redundant with Show Me the Numbers: Designing Tables and Graphs to Enlighten), Few presents us, under a definite business angle, information representation techniques. While Tufte is deeply concerned with the æstheticism of the graphics, Few is oriented toward its communicative power.

This book is « grand public » is contains no math, and discuss little about data analysis, despite being a trend curve here, a variance there, there again a box-plot; the level of the text remains accessible.