How to deal with spaghetti legacy code

At least three times in my career as a programmer, I had to work on huge, complicated code written by other people. In one case I was specifically hired to replace the original maintainer who -as I later learned- left the company from a burnout caused by the frustration of having to maintain his own code. Inheriting legacy code is common, and few people enjoy it. Here I put down a few ideas that I think might help to deal with the situation....

2014 April 7

ARM assembly for iOS with XCode

This week-end I spent a lot of time trying to optimize the code of my incoming video game. The game engine features a fluid simulation algorithm based on this excellent paper by Jos Stam. The algorithm is CPU intensive, and so I tried my best to make the code as fast as possible, which eventually means having to write the code in assembly. Since I couldn’t find much information about how to write assembly code for iOS on XCode, here is a small tutorial I wrote about it....

2014 March 31

Procedural rendering test 1

For my incoming video game project I wrote a small procedural rendering engine. So now I can do all kind of creepy animations. Here is an example, compiled to javascript using emscripten.

2014 March 17

Vocabulary learning wallpaper with python and gnome

Here is a simple way to customize your gnome desktop to show random text taken from a file. I use it to learn Chinese, but it can be easily modified for any other kind of textual information. This is how I did it: Using inkscape, I made a template SVG file for the background. I started from the default gnome 3 wallpaper, and I added three text elements: one for the Chinese characters, one for the pinyin, and one for the English translation....

2014 March 9

Bash script to compress pdf files

Since I work as a freelance, I have to deal with a lot of pdf files I receive from clients. Some of them contain uncompressed images that make the files bigger than they need to be. On this stackexchange question, a user named Marco gives us a nice way to use ghostscript to compress any pdf file. There is a loss of quality in the compression, but most of the time it is acceptable....

2014 March 3

My personal calendar using Remind

I made a cool “getting things done” script on my computer: any time I type the ‘rem1’ command, I see a nicely formatted calendar of the current and following three weeks. It also prints out the most urgent things I need to do. It looks like that: In the past I tried several different note tracking tools, most notably the great org-mode. I like the concept of keeping all my personal notes locally into plain text files....

2014 February 24

Image color wheel generator

Here is a little side project I did, that allows to quickly get an idea of the color distribution of an image in the Hue / Luminosity color wheel. This can be used by designer to check if an image follows some specific color scheme, like using only complementary colors. I wrote the code in C, and compiled it in JavaScript with emscripten. I am planning to write a following post to show how I intend to use this tool for a new video game project I am working on....

2014 February 16

Linus subsurface funny commits

Linus Torvald is mostly famous for being the creator of the Linux Kernel and git. He is also the author of a diving application: subsurface. What I like about subsurface is that we can see how Linus works on a small scale project, similar to the kind of things most developers like me work on. I really recommend reading the git logs of Linus: not only are they perfectly written and formatted (check how he separates sentences with two spaces), but they also sometime contain funny parts....

2014 January 13

My new blog

This is the first post on my new blog. I decided to stop using blogspot (here is a link to my previous blog) for a few reasons: Blogspot does not allow to write the posts in a markup language like markdown or reStructuredText. Instead you have to use either the “user friendly” interface that seems to never render things the way you want to, or directly type the post in html....

2014 January 11