Author: max

It’s a kind of magic

Evenimg_0744tually I had to take my old computer from my parents’ house. It has been a long story, now it’s nearly 9 years I’m married and I ran out of excuses for leaving those huge boxes in their basament. The alternative would have been to trash my old and yet beloved Amiga.
So I brought my A2000, keyboard and TV monitor home and last Sunday. After unpacking everything in the living room, under the attentive and slightly worried look of my wife, I connected and switched it on.
It has been a strong emotion. Amiga meant a lot to me. It was the first Real computer back then, it was a Linux before Linux (someone may put that Linux is an Amiga after Amiga), and I spent a lot of time with it. With my Amiga I played, I learned, I wrote software, I painted, I created…
The computer, true to its spirit, happily and trouble-less answered to the switch flip, with a ready humming, a proper hard drive clicking sound and blinking light. To make it short, despite of about 15 years spent in the basement, the Amiga worked fine as out of the box.
Rivers of inks have been written on the Amiga, so I won’t tell anything new here. The Amiga had been a turning point, a milestone in the history of personal computers. It was the second pre-emptive multitasking cheap computer (the first was the Sinclair QL some years before), it was the first multimedia platform, the first to have no configuration hassles.
Continuing the tradition of home computing (ZX Spectrum, Amstrad CPC and C=64), Amiga brought the fun of computer to new levels.
Well, now I’m a bit battled on its future. I don’t have the space to keep it at home (my wife patience is not endless) and it’s rather expensive to add an ethernet adapter and tie it up to my network. On the other hand leaving it in the basement doesn’t look as a pleasant perspective, even if it is much better than bringing it to wasteland.
For sure, I’m going to extract everything was on the 120Mbytes HD (that has no bad blocks!) and have a try to UAE or something like that. Using the RS232 interface at 57.6kbit/s won’t be a brief experience.
I already recovered the screens I drew for ‘Polignomica’ a graphical adventure technically inspired to “Zak McKraken”, set in the Milan Polytechnic, and going (soon or later) to upload them here.
In the meantime my look felt over my new palm (‘new’ to me, it is used and is 2 years old), it is some 50 times faster, has a memory capacity 20 times larger and fits perfectly in one hand (or pocket for what matters). Well, that’s how the world goes.
Anyway Amiga has more magic!

Today conspiration theory

You may have noticed that the new euro coins are no longer made of iron as the old liras were. This is a clear intent behind this choice! They do want we are no longer able to recover lost coins from wells, fountains, trapdoors, tunnels, grates through the clever application of rope and magnets. And the consequence is clear: They have developed a new kind of magnet able to attract euro coins alloy!

Just in case you missed…

Hello to everyone of my two readers 🙂 about one week ago, the new version of the blog software went on-line. If you click now on the (silly named) ‘readings’ link here to the left, you’ll bounce to the shining new Book section. Each book review has a summary box with book details and you can leave your comment there, too. You’ll find there my review of Baudolino complete with errors 🙂 (yes I know the right form is ‘one of the most’ instead than ‘one of the more’).
Now next steps for the site are: renew the domain, fix review errors, add ‘peopleware’ review, package the blog software and add it for download.
Enjoy and let me know what you think about.

Alive

I just realized how much time is past since the last time I updated my blog. While writing the new php code for my blog I was driven by the idea that soon everything would have been ready and that I could start again writing on-line. This is somewhat related to the 99% ready syndrome. Everything seems to be nearly complete, really it misses just few bits here and there… but the time flies.
So, what happened? Apart from writing, I completed Broken Sword – the Sleeping Dragon, Baudolino and Peopleware. I managed another round of WindowsXP vs Intel 2200 wireless adapter. But I have not (yet) completed the new blog code, therefore I wait before updating my blog with all my brilliant thoughts about.
Stay tuned.

Baudolino

Umberto Eco is for sure one of the more knowledgeable men of our times. He’s main interest is semiotic, but he knows about everything on the middle age topic. In his books I read in the past, his huge knowledge transpired from every page. I don’t know if it is the will to teach, or the familiarity he has with facts, stories, concepts, that leads him to write very dense novels. Enjoyable plots that need a great deal of patience to read.
For these reason I was quite surprise when started reading Baudolino. The first half of the book was a really smooth reading. Funny at times, interesting because many aspect of the middle-age life style and story were presented to the reader as part of the plot, and not forced into.
Unfortunately I found the second half of the book less smooth, never reaching the levels of “The Focault’s Pendulum”, nonetheless quite different from the first part.
The story is about a boy named Baudolino from a small Northern Italy village. One day he meet a man which turns out to be the Emperor Frederic ReadBeard. The Emperor is lost in the forest and Baudolino leads him, unknowing of his real identity, to home. For this reason the Emperor decides to take Baudolino under his wing and brings the boy along him and later will send young Baudolino to the University of Paris.
Baudolino is very clever and inclined to smart lies, but above all is really fitting its time.
Belonging to Emperor Court, Baudolino is more or less involved in every events of the time – wars, councils, siege.
In fact the story is presented as Baudolino, now about 60, telling it to a historian in Bisanzio.
About every middle age myth, event, every day life is touched in the novel – the Graal, the unknown lands to east, the pervasive religiousness. It is likely that you can read “Baudolino” on more levels. Hardly some ideas, some dialogues, some points can be placed where they are by chance, or just because Eco didn’t find a better place. Anyway further levels of readings remain quite beyond my reach :-). For sure one of the central theme is lie, truth and doubt. Baudolino is telling lies to the historian, but they fit the expectation of the time and they build up an intriguing story. On the other hand the historian has to tell history by selecting what is worth and what is not and adjusting things so that a sense could emerge.

Linux – Windows 1 – 0

Sometimes there are things you give for granted, like gravity, water being wet, 220V being harmful, and Windows interfacing painlessly with every kind of hardware. I was so convinced about this that I was utmost surprised to find problems with the wireless network of my notebook. In fact, I had no problem with Linux, Fedora Core 3 latest kernel (2.6.10-1.741_FC3) supports naively the Intel pro 2200BG hosted in my Toshiba. Just a matter of a few settings and I could access the internet from my living room without wire hassle.

I expected Windows XP HE to be more or less the same thing, and the starting was good – it told me it was looking up all available wireless networks. Good… But after some minutes of idle wait, it returned to me with one network that wasn’t mine for sure. So I tried to configure it manually with the network name (maxpagani.org 🙂 ), it waited another bunch of minutes, but wasn’t able to find it. So I tried to connect to the other network to get exactly the same result… no connection.

I spent something more than an hour trying to make it work with no success. What is puzzling is that XP-HE came pre-installed on my notebook and my wi-fi network is just a plain network with default options (even no encryption enabled).

So… Linux, good job!

Halo 2

According to the January Issue of Edge, 2004 has to be considered the best year for videogaming ever. Half Life 2 seemed to have reached so high mark that I doubted anything could come close. Anyway I had to reconsider this after starting playing Halo 2. First I have to say that I didn’t play Halo 1. Yes I know, at this point some friends from Redmond would start making some hostile screaming, but that is. I wasn’t able to overcome the frustration of playing an FPS with the analogue stick instead of the mouse (as FPS are meant to be played) in the first level.
I get back to Halo 2 thank to the suggestion of my friend Paggio who described it as a masterpiece (along with Prince of Persia 2). And I should add that some TV commercials made their job clearing up all my doubts.
Halo 2 is truly spectacular game, in the Hollywood sense. Be prepared for fast action, humor and great cut-scenes. Maybe it’s the first time I see some cut-scenes with a real movie taste, where huge, armored space ships moves and acts as you would expect and not like a detailed, but dummy and empty geometric model.
I really appreciate some clever tricks, for example most of the FPS available on console allows you to reverse the Y-axis of the analogue stick. The net result I got has always been I moved the stick the wrong direction and never understood which was my natural movement (of course the natural movement for this kind of game is the one of moving a mouse). Halo 2 avoids all this pain by an in-game trick. Right at the start of the first level you are given a new armored suite and a pal ask you to calibrate the new suite, by looking at the lit one from 4 lights cleverly placed up, down, left and right. In this way the program is able to detect your natural movement and configure consequently.
So you start playing. The saga is intriguing, maybe I’m loosing something since I can’t always play with a loud volume and I didn’t listen carefully to all dialogues. Anyway objectives are pretty clear.
Another smart move from bungie is the objective aid. After a while that the game detects the player is not making any progress in the right direction a voice comes to help. If the player is still wandering after a while, then a direction is graphically marked on the display hinting you the right door/direction to take to accomplish the goal.
I found this a very good compromise since it doesn’t spoil anything to the hardcore gamer, but helps first softly, then more decisively the “non professional” player saving her/him some frustration (or worse abandoning the game because too difficult).
From the gameplay point of view I think Halo 2 is good and robust, but lacking of ‘adventure’ taste. I.e. in Half Life 2 (the comparison is unavoidable) the player has to operate some traps in order to advance, providing an extra game play level other than just gunning everything alive (and not, when dealing with zombies). Halo 2 is a plain shooter, extra polished and very entertaining, but it is just that – combat evolved.
Talking about zombies I’ve found some … er… citations of Half Life 2. There are some levels with mutants … really really close to the one found by Gordon Freeman, there are even mutants carrying load of infecting blobs.
From the technical point of view Halo 2 is for sure a masterpiece, first of all it loads just once, after that all levels are streamed from the disc while playing. During the cut-scene the graphic engine enters a super detailed mode that for sure makes the XBox sweat, but the look is great. Halo 2 engine is taking the XBox hardware to its limits, you’ll notice in some occasions that the scene is … built, first undetailed models are shown and in a few frames all the wrapping arrives. Apart from this I never notice severe frame drop in the game play, despite the number of enemies, graphical effects or the huge dimension of the set.
So far so good, what isn’t so good? It happened a couple of time I found what I would call A-class bugs, falling forever below the ground, or missing the time to enter a door to find it closed and being blocked in an hangar. Anyway these problems are not so annoying, first they seldom happen, and the checkpoint save is very fine grained, so restarting from the last checkpoint won’t waste to much time.
Talking about checkpoints, it is a very natural way of saving, when you are done, you just select save & quit from the in-game menu, and the next time you’ll restart from the last checkpoint you reached. This is so natural and the save&quit happens so little, that a couple of times I forget about it and I had to replay quite large sections of the game.
Keeping on the comparison between Half Life 2 and Halo 2, in this game too you are provided, sometime, with a team of warriors helping you, what is different from HL2, is that now they are smart. First of all they never get into you preventing from doing what you intend to do. They are also smart enough to not ruining your stealth entrance in room. They keep themself quite always out of your line of fire.
Halo 2 is for sure a game to play, at least as much as Half Life 2 was. Maybe 2004 wasn’t the best year ever for videogames, but H2 and HL2 are two of the best games ever, my word.

Humble programmer, this time for real

Sometimes even the most skilled programmer like me lose their humbleness and blame the compiler. Luckily for him (or her) reality is ready the put them back at their places. This is what happened to me today. It was afternoon and after some thick coding with containers and containers of containers I was rather tired, maybe in need of a break. I don’t believe in break so I went on and wrote the destructor.
Pretty simple stuff a for loop iterating through all the container elements and basically deleting them one by one.
So far so good, then I wrote the test case (I do believe in test cases) and I got a rather surprising behavior on the destruction of an empty container. My code was supposed to skip the destruction loop and get out of the destructor cleanly, instead what actually happened was that the loop code was executed once causing exception and exception dialog popping all around.
Puzzled I stared at the code without a clue. It was a for loop as thousands other I wrote.
So I composed a small source to test just that behavior (I do believe in small source test, too, they usually help you a lot understanding stuff). And I got it perfectly right. The code was doing what I expected. So I cut and pasted some types from the project into my test. Maybe after all it had something to do with the complex types I used.
But once more the small test code run perfectly.
I was quite astonished and tempted to blame the compiler. So I went for the assembly window just to have the confirmation that the code was actually different and that the project code compiled to execute the loop once.
My personal C++ GURU was away so I had to handle it all by myself. At this point I tried to do some more cut & paste to understand were the problem arise and… I got it… There was, right after the closing bracket of the for statement and before the opening curly bracket… there a SEMICOLON!
Feeling dumb would have been an giant leap upward respect to that I felt. I knew that very seldom the compiler is to blame, so despite of appearance I was the culprit. Also I should believe some more in breaks, just a few minutes to get from ‘fused’ back to ‘bright’. And … yes C++ (or C, in this case it is a common pitfall) is a loaded gun ready to shot into your feet by default… but, what the heck! A little warning from the compiler would have saved me quite a time.
In fact my personal programming style is to always use the curly brackets even when the block is empty. I found this to be more readable and less error prone. It would be nice to instruct the compiler to emit a warning when this rule is broken. If the programmer is so smart to do everything in the for parenthesis and doesn’t need to specify a loop body, then she could spend part of the saved time writing a pair of curly brackets.

Don’t fear, it’s only C++

One thing I’m sure about C++ is that it had a troubled history. It sprang to life in mid 80s as a C with classes, a language aimed to bring the then new object oriented paradigm to C programmers. The standardization was far ahead, but the language when arrived to the first programmers outside AT&T was quite stable: single and multiple inheritance, late binding, function and operator overload.
But quite stable isn’t as stable as stable, so the first addenda to the language arrived by the beginning of 90s: exceptions and templates.
The standardization arrived quite late (late 90s) in the history of C++ and rather than codifying the existing practice, as it had been the case for C, took the way of empowering the language. The committee added many features to the language, one for all the STL. The standardization of the C++ language had been an impressive result, if for anything else at least for being a result. With the heavy load of new features it would have been easy to get lost on the way killed by the committee overhead.
Today, by admission of the language creator himself, Bjarne Stroustrup, it is unlikely for a single programmer to have a perfect knowledge of the whole language (considered as both the core language and the library).
With this troubled history, compiler vendors had their hard time to keep up with improvement first and standard later. The standard presented for sure a hard challenge. Being compliant could be a too ambitious goal when you have actually to develop a product and put it on the shelves.
Incompatibilities, non-compliancies, misbehavior were only part of the problem that programmers had to deal with, the part was the increased level of complexity: whole new concepts in the template field, tons of components and functions in the library. Also from the development battlefields new concern arose. Exceptions which had considered an elegant way to deal with errors and anomalies turned out to be if not a false friend, at least a very difficult one. If not carefully planned and the code actually being written with exceptions in mind, the exception mechanism would yield no benefits and the problems caused by misuse are more or less the same you would have without using exceptions and ignoring anomalies.
Another pretty impressive result from the battlefield was the meta-programming. Templates were intended to describe a set of classes or functions that performed the same algorithm on different types. In order to do this some business have to be done at compile time. It was discovered, from a programmer, that this kind of business could be used to perform non-trivial computation at compile time. If generating a set of prime numbers at compile time could be not much interesting, the matter changes when the result of the generation is a parser or an optimal evaluation of complex expressions.
With this sort of history it is pretty natural that many programmers are scared by the new features of C++ (if not by the whole language itself). As any kind of fear, this too deserves to be analyzed and addressed. There no point in avoiding everything that hide some side effect, because this is the main mechanism behind abstraction – ignoring details of the lower levels. Instead the programmer should develop an approach that let her avoid pitfalls and undesired effects of the use and abuse of the language.
Also, nowadays most of the compilers are reasonably compliant with the standard. Even Microsoft Visual C++ is now a pretty good compiler by standard… standards. Therefore even from this point of view, programmers could stop worrying and start using the language to its full potential. And C++ has a huge potential being nearly the only language that allows the programmer to properly choose the right amount of abstraction to employ.
For sure C++ isn’t for the faint hearted, stealing someone words, C++ is like a gun loaded, ready to shot and aimed straight to your feet by default. I’m sure it’s what you want when there are grizzly around.

Train of mysteries

There are things the go beyond the reach of the human intellect and challenge the human wit. To reach the workplace I use a local train from a local private company. Now riding a train on long standing railway should be a pretty well defined business. By itself a train is quite a deterministic object. There are no traffic jams, commuters are, more or less, always the same, waiting for the carriages about in the same position along the track.
So why a train should be late on a daily basis? The only chance that comes to mind is the time table being wrong. But if the time table has just been changed then it couldn’t be the cause.
But the mysteries don’t stop here. For example, an empty train should be a lot more expensive to ride than a full one. At least for the incontestable fact that a paying commuter bring to the company more money than an empty seat. So the mystery is why everyday an empty train (the (in)famous) Malpensa Express) travels in front of thousands of depressed commuter eyes without letting them in?
The idea is that the Malpensa Express is for travellers going to and from the Malpensa airport. Nonetheless is an empty train that eats up railway time and space (and this is very scarce being a single track railway). On the contrary the commuters train is usually full, reaching its destination hardly with the space for a pin.
Another interesting mystery is how the delay statistics are computed. The mean delay which entitles commuters for a (little) refund is computed as the mean of the delays for the same railway line. Apart that the same commuter hardly spreads her rides uniformly on all the trains, but the damage that the company is causing to the society for the bad service is bound to the delay per person. I mean an empty train late is basically causing no problem, since no one is arriving late at the workplace. On the contrary a train carrying one thousands people late for 5 minutes is causing 5 thousands minutes of delay to the society considered as a whole.