Meanwhile on planet Sony

Playstation Logo

So there was another update to the Playstation 3 firmware. This was kind of expected as Sony is preparing the launch of another version of the PS3, slimmer than the slim model I have.
In the world of technology, hardware tends to evolve fast, and buying, six years later, the same hardware is generally impossible, yet this is what Sony is about to sell: a device with mostly the same technical specifications as the original Playstation 3; there are basically two differences besides the size between the model that will launch and the one from six years ago: the size of hard-drive and the lack of the emotion engine, which offered Playstation 2 compatibility in the. That compatibility system disappeared with the slim model.

This is all fine, while the PS3 is certainly not a speed demon by today’s standards, it still has usable hardware, basically similar horsepower to a newer iPhone, so it should be capable of doing the same class of stuff as an iPhone or a tablet: games – of course – but also light web-browsing, e-mail reading. For this one simply needs a web browser (a local e-mail client would be nice, but let us not push it). This spring Sony did something surprisingly reasonable, it replaced the integrated web-browser with a webkit one, sufficiently advanced to pass the Acid3 test, and even some HTML5 features like the canvas tag.

This was update 4.11, the update for October was 4.30, and guess what it improved? The trophy UI is now compatible with the Playstation Vita. I have a computer which Sony thinks is still good enough to sell, is powerful enough to compute protein folding, Sony removes the protein folding client and improves the trophy showcase. Besides this, nothing was improved or even fixed, Facebook photos are still broken in the gallery, there was not the slightest improvement to the web browser, no new utility program, nothing, nada, just trinket compatibility with a gaming console nobody is buying.

To put things into perspective, Sony sold 2.2 millions Playstation Vita between its launch in december 2011 and end of June 2012. Apple sold more than twice this number of iPhone 5 units in a week-end. In fact if you look at the technical specs, the devices are really close (I have added the new Nexus 4 for comparison).

iPhone 5 Playstation Vita Nexus 4
CPU 2 × custom ARM7 (A6)
1.3 Ghz
4 × ARM7 (Cortex-A9)
0.8 – 2 Ghz
4 × ARM7 (Snapdragon)
1.5  Ghz
GPU 3 × PowerVR 325MHz 4 × PowerVR 200MHz Adreno 320
Screen 1136 × 640 960 × 544 1280 × 768
Memory 1 GB 512 MB + 128 MB (VRAM) 2 GB

The iPhone is much more expensive, and has no gaming buttons, on the other hand, it is much smaller and can do useful stuff: make phone calls for starters, web-browsing, light e-mail reading, plus it has a lot of apps – iOS also has much larger user-base: there are around 250 millions iOS5 devices. This in turn is dwarfed by huge volume of android devices: 400 millions.

Two single purpose devices built by Sony – portable gaming consoles and point and shoot cameras – are being replaced by phones that are more versatile, and it takes no genius to realise that single purpose devices in the living room are bound to have the same fate, yet Sony’s strategy seems to be doing nothing…

Of greedy algorithms


One of the main things you learn in theoretical computer science, is that some problems are hard: it is impossible to find the best solution for them in a reasonable time using the types of computers we currently have access to, and reasonable time means something shorter than the age of the universe.

One example of such a problem is the traveling salesman: finding the shortest path that visits all cities of a country, say France. France has 440 cities (places with more than 20’000 people), this approximates to 5.63 × 10973 possible itineraries, the generally admitted age of the universe is 4.3 × 1017 seconds. So even if we had a trillion processors 1012 , capable each of evaluating a trillion itineraries per seconds (say running at a terahertz frequency), running since the beginning of the universe, we would only have computed around 4.3 × 1041 itineraries, a tiny fraction of total set (less than 1 / 10900). So this can really not be solved in a reasonable time.

While it is very hard to find the best solution, life goes on with acceptable solutions: it is possible to visit all cities of France, just not in the perfect sequence. One approach to solve the problems in practice are called greedy algorithms, they are called like this because they typically solve the problem one step at the time, consuming always the easiest available next step. For instance for the traveling salesman problem, that would be, after visiting each city, look for the closest unvisited city and go there.

Such an approach is not optimal and can be trapped by its own greed: the traveler might end up drifting to one corner of France only to realise that the next un-visited city is on the other side of the country, that he needs to traverse a large territory of visited cities to find his next step. This is called a local minima, getting trapped there is bad and a greedy algorithm might get stuck there, unable to pay the price to get out. On the other hand, greedy algorithm tolerate the chaos of reality pretty well, the roads between cities change length all the time, it might be impossible to visit some because of some event (be it a strike or a festival), and while you are touring the country, one place might get the new inhabitant that makes it a city. A greedy algorithm adapts instantly, because it has no real strategy.

Often, the best one can do is couple greed and smarts, that is among the cheapest options, not choose the one cheapest, but one cheap one that is compatible with a long term strategy. If the strategy fails, greed is always here as a backup-plan. This will never find the optimal solution, but the art is to get as close as possible to it while adapting to the changes and randomness of reality.

Unsurprisingly, the way nature works seem to follow a similar strategy: greed, with a lot of smarts bolted on top of it, evolve and adapt, but keep around enough variation and richness to avoid being trapped in some corner of the evolutionary landscape. That does not mean that there are no local minima, are a typical example.

Politics, at the core is just about solving a problem: what rules to set up, how to distribute resources to make people thrive and be happy. The underlying problem is much more complex than just travelling around the country, probably in the same ballpark that evolution and life in general. Yet, I think the same considerations apply: finding the optimal solution is not reasonable, because of the complexity of the model and the chaos of reality, but unfettered greed means the system is quickly stuck in a local minima, like for instance high-frequency trading.

The political system seems dominated by people whose projected ideology is either to suggest theoretical solutions that cannot work in practice, or proponent of unsupervised greed, yet at the same time, the way they act on the problem is either by always optimising the next vote, the next political item (greedy approach) or they want a complete revolution of everything (theoretical model), they are particularly consistent between their ideology and behaviour.

Mac OS X Window showing the dungeon heart of Dungeon Keeper

Dungeon Keeper

Mac OS X Window showing the dungeon heart of Dungeon Keeper

While they cannot compete with the graphical quality of today’s games, I still have fond memories of games of the past. While I played most on my C64, ports of games of these days do not feel very stratifying. My two favourite games in those days, and have been re-written as and , I find neither fun to play nowadays.

is a DOS game from , I never played it, but I loved the sequel, which game out two years later and was a Windows game, so when released Dungeon Keeper for Mac OS X at 5.99$, I just bought it.

In Dungeon Keeper, you control the heart of a dungeon, building up the rooms of the dungeon, hosting, feeding and training you minions to defeat either the human adventurers that visit your dungeon or competing dungeon keepers. The game takes ideas from real-strategy games, with a good sense of humor: your units fight among themselves, have different personalities and require some management.

The game appears as a simple Mac OS X application, hidden in the bundle, there is an instance of DosBox that basically runs the original game. The game is fun to play, as the graphics are quite blocky (S-VGA graphics, remember), I prefer playing in in windowed mode. The game playing flawlessly for me, and is quite fluid – which you would expect running a game designed at a time when 100Mhz was the best you could get, running on a 2.4Ghz machine.

While certainly not as engaging as the sequel, Dungeon Keeper is a fun game, which ads a twist to the classical fantasy setting and the general roleplaying game with dungeons trope. I would certainly recommend this game to anybody who designs dungeons, while laughing with an evil laugh. Despite the low resolution, the graphics are pretty nice, with many nice touches, like the wall decorations

I really like the idea of refurbishing old games for a moderate price: 6$ is certainly worth the hassle of not hacking around with emulators, and such games have a much clearer legal standing as abandon-ware. My only wish would be that Good Old Games releases Dungeon Keeper in the same format, as Dungeon Keeper II is a window game, this might be a bit more complicated.

While this might not be considered a real game by today’s standards, the price is anyway that of an phone app, so there is no big risk in buying it.

Grammar for computer geeks

Grammar is one of those things you discover when learning a second language, even though you were using it with you first. Like many abstract way of thinking about stuff, you can live without, but it makes discussing stuff much easier. Instead of explaining those concepts using words, I’m going to explain them using C function pointers.

Transitive Verbs

They are functions that take two parameters, a subject and an object, like for instance the verb to beat. The first defines who does the action, the second defines what the action affects.

typedef void (*transitive_verb)(Object*, Object*);

Intransitive verbs

They are functions that take only one parameter, a subject, like for instance the verb to die.

typedef void (*intransitive_verb)(Object*);

Ambitransitive verbs

They are functions that can have both a transitive and an intransitive form, like for instance the verb to eat.

Unlocking PDF files


People writing RPG scenarios seem to have two bad habits: using weird fonts, and distributing their texts in password protected PDF files. Very often, the weird font is either not included in the PDF, or so corrupt that any modern operating system will flat out refuse to load it; when the document is displayed, poor Helvetica is forced into strange bounding boxes, and the result is basically unreadable. Because the document is copy-protected, one cannot simply copy-paste the text into a text editor to simply read it.

Thankfully, it is possible to get to the text by making a round-trip using ghostscript. Please only use this to read documents, and not to copy them or do anything nefarious. On Mac OS X the sequence is the following (assuming you have MacPorts installed).

sudo port install gs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf

Where encrypted.pdf is your encrypted pdf file. On exit, unencrypted.pdf will contain the unencrypted text, the layout will still be broken (although often makes things less evil in the process), but you will be able to copy-paste the text. Beware that depending on the tool that produced the PDF file, there might be weird spaces all over the text, and bits of text will be moved into random places…

C++ level

I realised something amusing about the C++ language. When I ask to people around me to estimate their level in C++ language, on a 1-10 scale, people who know how to code in this language will usually give themselves a 7. The thing is, I don’t think their level is the same, put their mindset regarding the language is the same: they can use it to code, but there is still a lot of stuff that they don’t fully understand.

I think this is a very good mindset, because it is one that acknowledges complexity, and the fact that one always learns. A path where there are few self claimed gods and the journey is more important than the goal.

Les forums du grand Ouest


Une des métaphores souvent associées pendant la première époque du web est celle du Far-west, un monde où tout est encore à construire, sans règles. Les sites et les systèmes ont fleuri a profusion : wikis, blogs, forums. Pour peu qu’il y ait un geek dans le groupe, chaque organisation, chaque groupe avait son propre système, voire un de chaque type.

Curieusement, on ne parlait pas tellement des problèmes typiquement rencontrés dans les Western, les pillards, les indiens, ni même d’un problème plus simple quand on construit sa propre ferme, son propre site : la maintenance. Le temps a passé, des nouvelles technologies, de nouveaux concepts sont apparus, ont atteint leur apogée et disparu. Les nouveaux sites sont devenus, vieux, criblés de failles de sécurité, beaucoup d’espoir et de naïveté incarnée sous forme de code. Spammeurs et Hameçonneurs (c’est comme ça qu’ont parle du phishing semble-t-il) se sont révélés moins pittoresques que les peaux-rouges, mais bien plus efficaces.

En conséquence le paysage a pas mal changé, si je regarde dans mes bookmarks, parmi les forums qui m’avaient à un moment où l’autre intéressés, la majorité est à l’abandon, principalement utilisés par des bots qui y contribuent leur prose absurde. Curieusement, les blogs ont mieux survécu, je trouve, peut-être parce que ce sont les seuls sites où il y a une politique éditoriale implicite claire. Ce sont les outils qui s’intègrent le mieux dans le réseau sociaux.

Les réseaux sociaux, pour les gens qui ont fréquentés les forums de la première époque, c’est la déchéance, la masse des gens qui sont venus après, ceux qui ne sont pas des pionniers. Bref, c’est la ville. La ville a fondamentalement deux problèmes : tout le monde et son frère s’y trouve, et il y règne l’habituelle loi des intolérant bruyants.

La triste réalité, c’est que nombre de ces communautés seraient probablement un peu plus actives si elles se rapatriaient sur un réseau social plutôt que d’essayer de survivre dans la plaine, à lutter contre les hordes de bots, les humains incapables d’entrer parce qu’ils ont oublié leur millième mot de passe phpBB