Suggested Reading: Beginning Portable Shell Scripting

February 28, 2009

Peter Seebach — Beginning Portable Shell Scripting — Apress, 2008, 352 pp. ISBN 978-1-4302-1043-6

(buy at

(buy at

This book, like Bash Cookbook: Solutions and Examples for Bash Users isn’t overly technical. It focuses on one particular aspect of shell scripting, portability. While no one really expects a bash script to be excuted using a different shell, such as zsh, for example, Seebach shows us that there are ways to ensure that the scripts behave reasonnably well when executed in different environments and by different shells. Seebach presents various shell constructs and discusses their portability, giving numerous examples.

Read the rest of this entry »

Suggested Reading: The Design Of Everyday Things

February 28, 2009

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

(buy at

(buy at

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.

Music to Code to

February 27, 2009

If you’re anything like me, you like to create a musical bubble to isolate you from your surroundings and being able to concentrate on what you actually have to do. To do so, I have amassed a rather long list of dub, trance, techno mixes. Some are 90 minutes long, and are very well crafted. People who think that techno is always the same (boom-tss-boom-tss) are clearly missing something.

I have bought numerous CDs over the years, but it turns out that there are a lot of (legal, DRM-free) free podcasts out there, and while they’re not all easy to find, they’re easy to share. Here are the few I d/l recently:

The Zoolook Project has several podcasts of ambient, trance, hard techno, etc., mixes. Amongst which I like:

There’s also the T.O.U.C.H. Samadhi website that offers both streaming and pod casts. A bit wierder, maybe. I like:

Other personnal favorites include the DJ LNG mixes found at DJ LNG (aka Romalong)‘s page. Especially Random Regularity.

Happy hacking, then!

Blinking Lights

February 24, 2009

I’m sure that if you’re more than twenty, you’ve seen one of those really bad Sci-Fi movies with computers with lights everywhere. As the computer worked, computing at incredible speeds of course, the lights would flash like crazy, often accompanied by weird beeps and bops. When the computer completed its computation, like some kind of bizarre oven, the computer would make a loud ding! The answer would then be printed on a teletype with a characteristic loud buzzing noise.

The IBM 370

The IBM 370 (from Simon Fraser University Network Services. Click on image to follow original link.)

Read the rest of this entry »

Ad Hoc Compression Methods: Digram Coding

February 17, 2009

Ad hoc compression algorithms always sound somewhat flimsy, but they still have their usefulness whenever the data you have to compress exhibits very special properties or is extremely short. Universal compression algorithms need a somewhat lengthy input to adapt sufficiently to yield good compression. Moreover, you may not have the computing power (CPU speed, RAM and program space) to implement full-blown compressors. In this case also, an ad hoc algorithm may be useful.

Digram (bigram, digraph, bigraph) coding is one of those ad hoc algorithms. Digram coding will compress text (or any source, really) by finding pairs of symbols that appear often and assigning them codes corresponding to used symbols, if any.


Let us see in detail what digram compression is, and how effective it really is.

Read the rest of this entry »

To Boil the Oceans

February 10, 2009

I was reading ZFS‘s specs, and it struck me how Sun deliberately over-engineered the filesystem. To make sure that ZFS would be able to deal with just any storage device (or pool), they made ZFS a 128 bits filesystem. Now, 2128 blocks (2137 bytes) is a truly enormous quantity of data. In fact, it is so enormous that Jeff Bonwick explains how populating such a capacious device it would require more energy than is needed to boil all of Earth‘s oceans, give or take a few cubic miles.

The quote, which I find thoroughly amusing, is reproduced here:

Although we’d all like Moore’s Law to continue forever, quantum mechanics imposes some fundamental limits on the computation rate and information capacity of any physical device. In particular, it has been shown that 1 kilogram of matter confined to 1 litre of space can perform at most 1051 operations per second on at most 1031 bits of information. A fully populated 128-bit storage pool would contain 2128 blocks = 2137 bytes = 2140 bits; therefore the minimum mass required to hold the bits would be (2140 bits) / (1031 bits/kg) = 136 billion kg. […] To operate at the 1031 bits/kg limit, however, the entire mass of the computer must be in the form of pure energy. By E=mc2, the rest energy of 136 billion kg is 1.2×1028 J. The mass of the oceans is about 1.4×1021 kg. It takes about 4,000 J to raise the temperature of 1 kg of water by 1 degree Celsius, and thus about 400,000 J to heat 1 kg of water from freezing to boiling. The latent heat of vaporization adds another 2 million J/kg. Thus the energy required to boil the oceans is about 2.4×106 J/kg * 1.4×1021 kg = 3.4×1027 J. Thus, fully populating a 128-bit storage pool would, literally, require more energy than boiling the oceans. [ref]

Even though this quote reeks of hubris—although I’m not expecting vengeful bolts of lightning striking Bonwick any time soon—it got me thinking about the fundamental limits of computation, and how he could derive such a result.

Read the rest of this entry »

Suggested Reading: Counterknowledge

February 7, 2009

Damian Thompson — Counterknowledge: How we surrendered to conspiracy theories, quack medecine, bogus science, and fake history — Viking Canada, 2008, 162 pp. ISBN 978-0-670-06865-4

Counterknowledge<br>(Buy at

(buy at

Reminding me of the Petit cours d’autodéfense intellectuelle,
Counterknowledge deals with various pseudoscience and the strategies employed by their supporters to spread the “counterknowledge”. Everything goes: quack medecine (chakra-aligned neuromagnetic cristals), pseudohistory (apparently the Chinese circumnavigated the globe in 1421), and, my favorite, Creationism.

As you may have guessed, Thompson demolishes the quack theories, but must importantly, he shows how the most basic critical thinking will tear the pseudosciences down.

Do not read if you’re a conspiracy theorist.

Pedlars of counterknowledge often insist that their ideas should be taken seriously because ‘no one has been able to come up with a better explanation’ for whatever mystery they have lighted upon. But this argument only betrays their muddled thinking. The fact that a subject is genuinely puzzling, that there are vast gaps in our understanding of it, does not lower the standard of evidence we require in order to fill the gaps

Read the Blog