Reason #947 why C++ is dangerous – and certainly not type-safe

24. Apr 2008 Comments 10 comments

Here’s the statement in question:

Vec3 v = (2,3,0)  

After running it, v is set to (0,0,0) – can you spot why?

In case you couldn’t, here’s what happens. C++ encounters (0,3,0) and evaluates to 0 – because comma-separated expressions evaluate left-to-right and return the rightmost expression. That’s strike one right there – the comma operator is a [...]

HOWTO: Building Mapnik on OSX Leopard

23. Apr 2008 Comments 1 comment

I recently decided to get involved in Aaron Swartz’s latest project, watchdog.net. And since one of the most interesting jobs to me was investigating an alternative to Google Maps, I took the plunge and tried to look at Mapnik.

First challenge – just getting it to build on OSX. It seems like a trivial task, especially [...]

My personal history

20. Apr 2008 Comments 0 comments

Bowing to the shell history meme:

history|awk ‘{a[$2]++} END{for(i in a){printf “%5d\t%s \n”,a[i],i}}’|sort -rn|head

55 sudo 45 ls 42 git 32 cd 25 gem 23 vi 21 ruby 15 man 13 echo 7 /bin/rm

Heh. Turns out most of my work on the command line involves [...]

The sad state of DVCS for Windows

19. Apr 2008 Comments 2 comments

I have recently started exploring DVCS – distributed version control systems.

The power they offer you as a developer is amazing, especially if you use them with a patch management solution like quilt. The ability to juggle branches and patches with almost zero cost is extremely empowering. (At the same time, it’s also dangerous. It’s a [...]

You’ve got to be kidding me

15. Apr 2008 Comments 0 comments

During my work adventures, I have the ‘fortune‘ of working with Windows threads. One thing that’s nice to have is a name for each thread so you can actually tell them apart. Turns out, there is no easy call to set a thread name.

However, there is an officially approved way to set a thread name:

// // [...]

Ruby, OSX, and OpenGL

14. Apr 2008 Comments 0 comments

This is one of the wonderful detours programming takes me on from time to time. What I really wanted to do is work a little bit more on my neural network code. Next up was a back-propagation algorithm for learning. There are plenty of examples of it, but few that give a decent explanation of [...]

Git on OSX

12. Apr 2008 Comments 0 comments

Part of my ‘learning plan’ for this year are distributed version control systems. First up, git. I was getting all ready to write a lengthy tutorial on how to compile and install it on OSX, but it turns out somebody else did all the hard work already: Leopard Installer for git

Excellent – more time to [...]

Neural Networks in Ruby

10. Apr 2008 Comments 1 comment

After my recent playdate with Ruby, I decide to explore a little bit more. And I’ve been wanting to work on Neural Networks for quite some while, so that’s the pet project of the day. To guide me around, I used an introduction to neural networks

And before you tell me how Ruby is too slow, [...]

SyncServices and Ruby

09. Apr 2008 Comments 3 comments

I’ve spent quite a bit of my spare time on iCalFix – a tool that spends its time fixing some misbehaviors of iCal.

At its core, this is an InputManager. And not only are those getting deprecated by Apple, it also turns out that a single bad InputManager can affect others – I’ve spent weeks chasing [...]