A quick primer on Graphviz


One of the tools I use to make figures for papers and books—if I need to make a graph, of course—is Graphviz. Graphviz is flexible, powerful, but also a rather finicky beast that will repeatedly bite your fingers. Today, I’ll share some of my tricks with you.


Read the rest of this entry »

Asking the Right Question


There are many reasons why you’d like to know if your user liked something or not. It can be used later for recommendation, for example, or to assess whether or not the users want the new feature you’ve just added. And it seems to me that not only the question but also the choices of answers offered matters a lot.

So, let’s say you add an (optional) survey to your application to collect feedback. You can ask a yes/no question like “do you like the new feature?”. The obvious yes/no answer isn’t so obvious. If the users select yes, it means yes, but what if they click no?

Read the rest of this entry »

Rethinking Graphical User Interfaces


For Christmas last year, I offered myself an iPod, and I found that the interface, made for big fingers on a small screen, is surprisingly friendly and intuitive. OK, granted, some things are harder to find than other (like how to kill or group apps), but the overall experience is agreeable. You don’t feel the thing as a new device that breaks your work-flow, because you can’t have a work-flow on this thing.

Ubuntu 11.04 came out in April and it offered—well, kind of imposed, actually—their Unity desktop environment, and it does break your work-flow. Not because it is clunky (because it is), but because it does not offer ways of doing what you’re used to on a workstation, it tries to replace what you’ve always done by something “revolutionary.”

Read the rest of this entry »

Compressing Voxel Worlds


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 »



There are plenty of web sites and museums dedicated to the computers of yore. While most of them now seems quaint, and delightfully obsolete, there are probably a lot of lessons we could re-learn and apply today, with our modern computers.

If you followed my blog for some time, you know that I am concerned with efficient computation and representation of just about everything, applied to workstation, servers, and embedded systems. I do think that retro-computing (computing using old computers or the techniques of old computer) has a lot to teach us, and not only from an historical perspective.

Read the rest of this entry »

Cargo Cult Programming (part 1)


Programmers aren’t always the very rational beings they please themselves to believe. Very often, we close our eyes and take decisions based on what we think we know, and based on what have been told by more or less reliable sources. Such as, for example, taking red-black trees rather than AVL trees because they are faster, while not being able to quite justify in the details why it must be so. Programming using this kind of decision I call cargo cult programming.


Originally, I wanted to talk about red-black vs. AVL trees and how they compare, but I’ll rather talk about the STL std::map that is implemented using red-black trees with G++ 4.2, and std::unordered_map, a hash-table based container introduced in TR1.

Read the rest of this entry »

Suggested Reading:The LATEX Companion


Frank Mittelbach, Michel Goossens, Johannes Braams, David Carlisle, Chris Rowley — The LATEX Companion — 2nd ed, Addison Wesley, 2006, 1090 pp. ISBN 0-201-36299-6

(Buy at Amazon.com)

(Buy at Amazon)

I should have told you about this book a long time ago. The LaTeX Companion is the definitive guide to LaTeX, ideal for anyone using it on a daily basis (or almost, as I do) or anyone wanting to learn LaTex. LaTeX is a complex and sophisticated mark-up language aimed at producing better typography for mathematics and scientific work—in which it totally succeeds. As for Linux, LaTeX (and TeX) comes in many distributions, some more geared toward the humanities, other for science, and still other for exquisite “art” typesetting.

A must read for graduate students.

* *

On the web:

Powers of Ten (so to speak)


I am not sure if you are old enough to remember the 1977 IBM movie Powers of Ten (trippy version, without narration) [also at the IMDB and wikipedia], but that’s a movie that sure put things in perspective. Thinking in terms of powers of ten helps me sort things out when I am considering a design problem. Thinking of the scale of a problem in terms of physical scale is a good way to assess its true importance for a project. Sometimes the problem is the one to solve, sometimes, it is not. It’s not because a problem is fun, enticing, or challenging, that it has to be solved optimally right away because, in the correct context, considering its true scale, it may not be as important as first thought.


Maybe comparing problems’ scales to powers of ten in the physical realm helps understanding where to put your efforts. So here are the different scales and what I think they should contain:

Read the rest of this entry »

Suggested Reading: The Design Of Everyday Things


Donald A. Norman — The Design Of Everyday Things — Basic Books, 2002, 257 pp. ISBN 0-465-06710-7

(buy at Amazon.com)

(buy at Amazon.com)

In the same lineage than Machine Beauty, this books explores the fundamental rules of good design. Built around the following seven precepts, Norman lays out the problems (and solutions) to good design:

  • Use both knowledge in the world and knowledge in the head
  • Simplify the structure of tasks
  • Make things visible: offer feedbacks for actions
  • Get the mappings right
  • Exploit the contraints, both natural and artificial
  • Design for error
  • When all else fail, standardize

The book is filled with examples of each principle. Fully annotated and with numerous references, this book (although a bit aged) will serve as a good introduction to the subject, especially for people interested in the design of user interfaces (while, however, the books is not very concerned about computers as the original edition was written in the late 80s).

To read with Machine Beauty, User Interface Design for Programmers, and The Inmates are Running the Asylum.