Category Archives: Programming

Dennis Ritchie, RIP

Dennis Ritchie, co-creator of UNIX, has passed away. The work he has done was tremendous: devising a powerful operating system that was still understandable to single humans. The Unices of today have nothing in common with that. Those monsters have … Continue reading

Posted in Programming | 756 Comments

How to really obfuscate your JavaScript code with more magic and annoy a poor succeeding programmer

Working on bad legacy code damages your brain. Encountering too many global variables without any use made me think about how an evil person (not me, of course) could make the life of his fellow programmers into hell. I think … Continue reading

Posted in Programming | 725 Comments

A JavaScript Operator Precedence Cheat Sheet

Somehow, I couldn’t find a decent JS op-pred cheat sheet for printing out and pinning to the wall. Therefore, I made one pro bono. Without further ado, here it is: JavaScript operator precedence cheat sheet [PDF, 18 KiB].

Posted in Programming | 835 Comments

A useful JavaScript idiom for histograms and binning

I once hated JavaScript. I do so no longer. It is actually a quite decent language, a combination of Scheme and Self. But this heritage is buried, and not easily visible at first. But once you get the hang of … Continue reading

Posted in Programming | 775 Comments

Regex madness

Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems. – Jamie Zawinski If you have an idle moment to spare, read this post by Frank van Puffelen and the ensuing … Continue reading

Posted in Programming | 730 Comments

Celebrate 1234567890 seconds since Epoch

// I guess this will be a busy February, lots of dates to celebrate. // Darwin’s 200th birthday on Feb 12, Carnival starts on Feb 19, and now this: #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { … Continue reading

Posted in Programming | 628 Comments

Building a random bettor

For the next season of Fußball-Bundesliga, we’ll use kicktipp for betting on the results, as we have in the previous seasons. This time, we want to introduce additional dummies, ‘Heimsieg’ (home victory) and ‘Zufall’ (randomness), as yardsticks of predictive performance … Continue reading

Posted in Programming, Randomness, Soccer | 858 Comments

Automatic type coercion sucks!

By trying to make your life simpler, JavaScript makes your life really hard. This snippet meant one hour of debugging: var w = canvas.getAttribute(‘width’); var neighb = [ -1, 1, w, -w ]; Looks innocent enough, n’est-ce pas? Unfortunately, canvas.getAttribute() … Continue reading

Posted in Programming, Randomness | 629 Comments