#defines are EVIL (part II)

June 29, 2010

In a previous post I discussed some aspects of the C preprocessor (hereafter the CPP) that are evil. Turns out that this week, I had another problem related to a bad usage of the CPP. It didn’t take long to fix, but I can understand why it could be long to figure out.

And while the bug was caused by a careless use of the CPP, I think there’s a couple of simple things we can do to help avoid these.

Read the rest of this entry »

Upgrading to Lucid Lynx

June 23, 2010

Every once in a while, if you’re not using a rolling release distro like, say, Arch Linux, you have to dist-upgrade your machines. Dist-upgrading consist in upgrading pretty much everything on your computer to the new version sets that correspond to the next distro. I just upgraded from Koala to Lynx.

And, well, …

Read the rest of this entry »

Save the Planet: Kill Flash!

June 21, 2010

The browser-embedded Flash player (or a derivative) is the preferred small (and low quality) video delivery mechanism on the web-based Internet. While I completely understand the usefulness of such a player (or at least the amusement it procures), I can’t fathom why the hell it’s so resource hungry. That damn thing sucks an inordinate amount of CPU to play tiny videos! What’s wrong with this thing?

Read the rest of this entry »

Wallpaper: Douceur retrouvée

June 20, 2010

Douceur retrouvée (1920×1200)

The CFM-00

June 15, 2010

Parallel computing is the next paradigm shift, everybody knows this, but not everyone is taking the proper action to face it adequately. One thing to do is to read on the subject and force oneself to code using threads and various degrees of parallelism; and that’s pretty easy now that a quad core machine doesn’t cost all that much. But the next step, distributed computing, necessitates, well, more than one machine, and if you have different levels of memories and communication channels, all the better.

So out of a bunch of old x86 PCs, I’ve decided to build my own portable mini-cluster with 8 nodes. Nothing all that impressive, but still plenty of fun to build.

Read the rest of this entry »

Is Python Slow? (Part II)

June 8, 2010

In a previous post I expressed my worries about Python being excruciatingly slow and I used a toy problem to compare the speed of Python to programs in other several languages, including C.

Of course, all kind of people complained that I couldn’t compare a dynamic, interpreted language with static, compiled languages. First, let met tell you that I sure can. First, the goal was to measure speed, and not the effects of type system of the language (although logically correlated) nor the programming paradigm: the amount of CPU used to solve a given problem was the primary (if not only) point in interest.

But to be fair to Python, I extended the tests to other interpreted, dynamic languages, such as Lua, Perl, PHP and JavaScript. I also added Pascal and Haskell in the compiled languages groups.

Read the rest of this entry »

Suggested Reading: Mrs. Perkins’s Electric Quilt

June 5, 2010

Paul J. Nahin — Mrs. Perkins’s Electric Quilt: And Other Intriguing Stories of Mathematical Physics — Princeton University Press, 2009, 391 pp. ISBN 978-0-691-13540-3

(Buy at Amazon.com)

In this book, you will discover the topic of mathematical physics—or physics mathematics, depending on how you look at it—through a series of counter-intuitive results (counter-intuitive for the non-physicist, that is). The author shows that with logic and (quite) a bit of mathematics, you can obtain surprising but correct results. A good part of the book rotates around the topic of gravity (boom, tss.) but also presents other topics such as air drag, partitionning squares into squares optimally, infinite resistor networks, and random walks. The narrative style is clear and simple; and while the mathematics in the book may seems scary at first, you still get the point; someone with just a little background in mathematics will still get the essential; someone with a better background in mathematics will get the best of it.

Another worthwhile note is that the typography of mathematical equations is simply exquisite; it is very well typeset. Something that is getting rare these days for a grand public book.