Page 10 of 13

2008 has started… So does my PhD programme

Fortunately or unfortunately 2008 has come!

I had a pleasant time with family and friends during my vacations in Italy, despite the bad weather and a flu. Fabio has been a great host: he showed me Milano, Sondrio, Como, and the surroundings of the Como’s lake, in other words, a kind of “Lombardia in a Nutshell” trip. 🙂 I also enjoyed New Year’s Eve so much, thanks to the company of Andrea, Hilde and all their friends.

But at the end, as expected, I had to come back in the rainy Bergen… And here I am, without being homesick yet. Today is an important day in my life, as I finally started the PhD programme here at the University. The staff at the Department of Informatics was kind to me, and the working environment seems pleasant. First, they toured me around the building and introduced me to the various researchers and professors. Then, they gave me the key of my office, which is located on the fjord side of the building. And a note for my geek friends: the office has a powerful Dell PC with a 24” LCD monitor, running Fedora GNU/Linux 8. 🙂

All in all, I could not wish a better welcome. Looking at this result, it seems that some people kept their finger crossed for me. 🙂

Changes, changes, changes…

It has been about five months since I moved to Norway, and I can say that “I’ve seen things you people wouldn’t believe…”

Well, let’s start with my social life. My goal of having a network of (mainly) local friends has been a partial failure yet. People here seem to need more time to get confident with someone, although girls appear to be more open than guys. Of course, this may very well be just because an Italian man can be quite exotic to them, as my local friend Mikal pointed out many times. 🙂 I still feel confident about the future though, especially once I will be able to speak Norwegian fluently.

In the end, I managed to create a little network of international friends around me. Lovely persons, who helped me in the difficult moments and who gave me a lot of good memories. My special thanks go to Mikal, Federico, Silje, Petra, Sonia, Valentin, Enrichetto, Diego, Fabio, and Regine, (merely ordered by who I met first) for all the moments shared together.

I finally started studying Norwegian. Here the approach with the local languages is completely different from what I am used to having in Italy. There are two official standards of written Norwegian: Bokmål, which is the one I study (literally “book language”, used by 85% of the population) and Nynorsk (literally “new Norwegian”, used by 15% of the population). On the contrary, there is no officially sanctioned standard of spoken Norwegian. My course is a 48-hour intensive course, and I although my Norwegian skills improved considerably, it is still impossible to jump into a conversation for me. I am mainly trained to listen to the spoken dialect of Oslo (or urban upper class Eastern Norwegian, as someone would call it), but in real life, Norwegians use to speak their dialect with each other, and the differences can be significant. You can imagine how challenging this can be for someone who is only at the beginning of the learning process. Anyway, I will continue with an intermediate course the next year, not only because I want to improve my skills but also because I have to be ready to speak Norwegian fluently as soon as possible.

The reason is that another big change is going to happen again in my life. I was a bit unsatisfied with my work lately, so I decided to come back to my original plan of continuing my studies. Becoming a researcher has been one of my biggest ambitions, so I applied for a PhD research fellowship position at the University of Bergen, and I got it. The position consists of three years of research and one year of teaching, meaning that I will live in Bergen for a long while. I will start in January, and I will probably be travelling several times to conference and spending months abroad as visiting researcher, hopefully in some sunny, warm place where I will be able to charge my batteries. 😉 I will do research in the field of model-driven engineering, under the supervision of Uwe Wolter and Khalid A. Mughal. It was a difficult choice, but I feel it was the best for my life, and I am looking forward to starting this new experience.

That’s all at the moment. Please, keep the finger crossed for me once more. 🙂

How to install XenServer 4 on systems with Realtek RTL8111/8168B based network adapters

Disclaimer: These instructions are provided on as-is basis. The procedure has been tested on two different hardware configurations, but do not blame me if it does not work on yours.

The latest version of Citrix XenServer Express Edition misses support for Realtek RTL8111/8168B-based Gigabit network adapters, which are quite common. When trying to install XenServer on a system equipped with this card, the installation will stop reporting the error “No Network interfaces found on this host.”

Even though the issue was reported several months ago, no updates have been released for XenServer since the 17th of August 2007, date of the 4.0.1 release. The official procedure for installing additional drivers—also suggested by Citrix in the support forum—seems overcomplicated and at least with my systems, it did not work. So I decided to write this article about how to install the last version of XenServer on systems equipped with Realtek based Gigabit network adapters.

Just follow these steps:

  1. Download the r8168.ko kernel module
  2. Copy the r8168.ko file to a removable storage
  3. Boot the XenServer 4.0.1 Installation CD
  4. Select the Keymap
  5. Once in the “Welcome to XenServer” page press Alt+F2 (you should get a bash shell with root access)
  6. Issue the following commands:
    #> mkdir storage
    #> mount /dev/sdb1 storage (I assume that the removable storage is /dev/sdb1, change it accordingly to your configuration if this is not the case)
    #> cp ./storage/r8168.ko /lib/modules/2.6.18-8.1.8.el5.xs4.0.1.125.163xen/extra/
    #> depmod -a
    #> modprobe r8168
  7. Press Alt+F1;
  8. Complete the XenServer installation and reboot;
  9. Boot the system; (you can ignore the errors caused by missing network adapter)
  10. Login as root;
  11. Issue the following commands:
    #> mkdir /mnt/storage
    #> mount /dev/sdb1 /mnt/storage
    #> cp /mnt/storage/r8168.ko /lib/modules/2.6.18-8.1.8.el5.xs4.0.1.125.163xen/extra/
    #> cp /mnt/storage/r8168.ko /lib/modules/2.6.18-8.1.8.el5.xs4.0.1.125.163kdump/extra/
    #> depmod -a
    #> reboot

Now XenServer should finally boot with the network card up and running.

Cheers!

ZNF project closes—Why I abandoned it and PHP

ZNF was an open-source framework for building enterprise web applications in PHP5 based on the model-view-controller (MVC) design pattern.

After three years of development, the other project manager Graziano and I acknowledged that it was challenging to continue the development and maintenance of ZNF. Therefore, we decided to discontinue the project.

Several combined reasons lead to this difficult choice. First of all, I got a position as a software engineer in Norway, while Graziano started his own business in Italy. The design and implementation of ZNF were time-consuming activities, and they could not be carried out in the ever decreasing spare time. Moreover, the project did not have any external financing. Despite the handful of firms which based their business on ZNF, the project received only one donation in three years. However, the main reason why I decided to discontinue the project was another: I could not stand PHP anymore.

PHP 4 was a poorly designed scripting language suitable only for quick and dirty hacks with web pages. On the one hand, the language had an intuitive syntax, provided a lot of functions, and offered support for various database management systems. The weak typing system together with the flexible parsing engine (that most of the times revealed spurious code only with the E_ERRORS = ALL directive) made the language popular among unskilled developers. On the other hand, however, the language had limited support for object-oriented programming (i.e., lack of support for information hiding, encapsulation and abstraction). The coexistence of both procedural and object-oriented programming lead to substandard source code. The PHP Extension and Application Repository was also developed the wishy-washy way, with core packages not even compliant with the quality guidelines.

Despite all that, PHP 4 acquired popularity and almost every cheap hosting provider started to support it. Soon after, PHP 4 content management systems started to spread, such as PHP-Nuke and phpBB. I wrote my first PHP 4 code for an assignment of a Bachelor course of web development at the University. I liked the syntax of the language, but I hated the mixture of both procedural and object-oriented programming, and I thought it was probably a good idea to invest some time on other scripting languages… Until PHP 5 was announced.

PHP 5, and especially its brand new Zend Engine II, promised to introduce full-blown support for object-oriented programming. Being young and inexperienced, I thought that this would mean breaking with the past and creating a language and a set of packages providing all features in an object-oriented fashion. Because of that, I decided to give PHP 5 a chance and started working on ZNF when PHP 5 was still beta. With hindsight, I would not make the same choice again.

Firstly, PHP 4 ended up to be supported for three years after the first PHP 5 stable release. The majority of hosting providers then ignored PHP 5 for way too long. They should not be blamed after all: most of the customers were likely to run PHP 4 content management systems like Joomla, Drupal, or WordPress, so why upgrading to PHP 5 and risking compatibility issues as long as PHP 4 was supported? As a consequence, ZNF lost a big potential user base.

Secondly, the vision behind PHP 5 turned out to be different from the one I expected. PHP 5 kept as much as possible of the compatibility with PHP 4, including the mixture of both procedural and object-oriented programming. Key new features such as input filtering were added to the language as functions rather than classes. Not to mention that support for namespaces and Unicode is still missing and that errors can be handled in at least three different ways (i.e., trigger/handler, PEAR error stack, or exceptions).

Considering all these reasons, I guess it is not difficult to understand my disappointment. 🙂

The ZNF project is not searching for new maintainers. Feel free to fork the project, as long as you respect the LGPL 2 license. Special thanks for their contribution to the project goes to Tomasz Kuter, Denis A. Konovalyenko, Emad B., Christian Kassab, Markus Wigge, Valentin David, and J. Chalmers.

Update 15 February 2017

Just for fun, I migrated ZNF to PHP 7. Surprisingly, I only had to replace ereg() with preg_match() and upgrade all dependencies (PEAR and Smarty) to do so. It is remarkable that our 12-year old legacy code could be migrated to the latest version of PHP in just a couple of hours 🙂 If you are interested in these patches, feel free to contact me.

One month in Bergen—Life of a software engineer in the most beautiful city of Norway

26th of July-26th of August. I have been in Bergen for exactly one month, and my life has changed dramatically…

I live in a cosy flat in the city centre, close to all the attractions of the city. It has three rooms, one bathroom, and two little storage rooms. The kitchen has gas stoves instead of electric hot plates, something rare here in Norway since cities have no gas networks, and this makes me feel a little bit at home. Unfortunately, there is no living room, but my room is large, about 16m², and has a sofa.

I share the flat with other two nice Norwegian guys, Thorolf and Willy. The life at home is a bit different from what I am used to having in Italy or during my Erasmus. People spend most of the time in their rooms. Sometimes they come to the kitchen to prepare some food, but they even eat back in their room. Kind of weird to me, but I was told that Norwegians tend to be reserved and that this behaviour is normal…

The company where I work is not so big, and sometimes I feel like I work in a family-managed business. It is located in the city centre so that I can be at work in 10 minutes with my bicycle. I have flexible working hours, but in general, I work from 9:00 to 17:00.

I work closely with Mikal, the guy who helped me in finding this position. We will have to develop an entirely new project about surveillance systems starting almost from scratch. The way is long, but we want to do the things in the right way, as Ian Sommerville teaches in the Software Engineering book. 🙂 We agree on the goals of the project, but we have diverging opinions about its implementation. As you may know, I am a believer and advocate of free software, but Mikal is an enthusiastic Microsoft fan. While I recognise that some of the Microsoft solutions could do better than the free/open source alternatives, I am a bit concerned about becoming a locked-in company. Anyway, the final word on the technology is always up to the technical leader so that we will see.

Soon I will receive my first salary, and I am looking forward to feeling some economic stability in Norway. Here the cost of living is a bit higher than in the rest of Europe. The rent of the room costs 3000 NOK (about 375 EUR) per month, which is not so much more than in other countries, but a half litre beer, for example, costs 50 NOK (about 6 EUR). The salary, however, even normalised to the cost of living, can be considerably higher than in the rest of Europe.

My parents sent me a package of 30 Kg, which took almost one month to be delivered. It was stopped by the customs at the Italian border because of some “missing documentation”, but it made it through in the end. Now I can finally eat some decent food. 🙂 I do not like a lot of things about my home country, but I still believe that Italy has the best cuisine in the world.

I came to Bergen with few contacts left from my Erasmus exchange and the short trip I had here in Easter, but this was more than enough to get to know lots of new people. The bad news for me is that most of them have just left or are leaving soon. Thank you Mauro, Silje, and the other guys at the “Auberge epagnole”, you have been very gentle. I hope to keep in touch with you and to see you again, maybe here in Bergen or maybe somewhere else in the world.

And by the way, Silje taught me a little bit of Norwegian (and I taught her a little bit of Italian). At the moment I can only say childish sentences like “Jeg heter Alessandro og kommer fra Italia” (My name is Alessandro, and I come from Italy), but I hope to improve my skills soon.

I have also registered to Facebook, a social network which is popular here. Everyone I met so far has a profile there, and it seems like this media is going to be a usual means of communication in the future, at least here in the North. I see Facebook as a useful tool, but I still prefer to get to know people the old way: face-to-face, possibly in front of a glass of wine. 🙂

Anyway, I see that I have written too much this time, and my stomach is reminding me that it is time to eat something. I will keep you posted!