Finally Moved

Hey everybody!

It took some time but I finally made it, to move my blog to a new server, update to the newest WordPress version and also update my plugins.

Hopefully I will have some time to write new articles as well 😉

Posted in Internet, Misc | Tagged | 1 Comment

Big Brother is watching You

It is about 4 week ago that I switched from my favorite browser Firefox to Googles Chrome. On my Windows 7 system Firefox simply used too many resources.

Today I updated my Spybot installation which protects my registry and made a system scan. What shall I tell you it found 26 tracking cookies on my computer which I caught during only the last 4 weeks. My main usage of the internet is to search for programming informations.

Perhaps I am a little naive but I see no evidence that a session cookie must remain on the computer of a surfer after the user is logged out. Personalization of a website like on Amazon is a nice thing but I think that I should be able to surf in the internet anonymously and only get a personalized view once I reveal my identity intentionally as by logging in.

Instead of anonymity even the browsers reveal more and more informations so that these can already be used as identifying fingerprint as shown in the EFF Panopticlick project.

If you think that all this doesn’t matter to you it is perfectly OK with me but be aware that the companies who are tracking you and your behavior are making a lot of money with your data. What do you get in return? Databases full of tracking data which, connected to a real person, will make you and your doings completely transparent.

What will be the logical next step after connecting you as a person with the sampled data …. ? I don’t think that needs much inspiration.

Be aware when you surf in the internet that many eyes are watching you!

Posted in Internet, Misc | Tagged , | Leave a comment

A dream within a dream

I just came back to the idea that the whole world is just a simulation on a nice super-computer like in the old science fiction film “Die Welt am Draht” from Fassbinder oder in the film “the 13th Floor”.

All that we see or seem
Is but a dream within a dream.

There is always the problem how to hide from the simulated entities that their world is quite limited. I believe in our world they found a nice solution to this problem, they made it round! 😉

Posted in Misc, Thoughts | Tagged | Leave a comment

Rails Plugin Documentations

As computer scientist I am working since 20 years now and since 2 years I have a lot of fun programming in Ruby or better in JRuby.

At the moment I am working on my first bigger Ruby on Rails project and have to state something which I wouldn’t perhaps have agreed with in my earlier years too:

Code (even well documented) is no substitute for good documentation!

I would like to address this specially into the direction of some developers who are writing really great plugins for RoR. A little bit more documentation about the basic ideas would lower the threshold for Rails newbies like me a lot. Naturally I am able to figure out how a plugin really works without documentation and I am sure that I can learn a lot from this experience. But eventually I will end up writing my plugins myself because that makes me faster then figuring out how something works which another programmer has developed.

So please keep in mind: Writing code in a computer language which is easier to understand and comes more natural does not subsitute for a good documentation!

Posted in All, JRuby | Tagged , | 1 Comment

Blog enhanced with WPTouch

Since I am one of the guys playing around with an iPhone now I thought it might be a good idea to make my blog a little bit more readable on the iPhone and other PDAs. After a small research I decided to install the WPTouch plugin and have to state: great work, thanks!

Posted in Misc | Tagged | 1 Comment

Buying an iPhone in China

Lately it was the time that I had to replace my old PDA with something new because I dropped it one time too much on the floor. Because we had business in Shanghai and found a shop with “original” iPhones we decided to switch to iPhones.

The first question when you buy something like an iPhone in China is: How can you be sure it really is an Apple iPhone and not a chinese clone? First I would suggest to search for some detailled pictures of original iPhones, they are very slim and have a characteristic position and border of the embedded camera. But I think the easiest way to identify an iPhone is the software on the phone. If you make a photo with the phone and scale it with the multi-touch ability of the iPhone the image scales and corrects the image resolution at the same time so that you can hardly see pixels while zooming.

So we went into this shop and in total bought 3 iPhones. The iPhones were neatly packed, seemingly in original, brand new boxes and my test showed that they were real Apple iPhones.

Before I bought the iPhones I didn’t now anything about jailbreaking and unlocking. I just tried my chinese and my german SIM card in the phone and both worked.

Back in the hotel the problems started. I reconfigured my phone and it didn’t work with any SIM card any more. So we went back to the shop and they made it run within 5 min and gave it back to me. While leaving they told me better not to update the software on the phone myself which finally made me really curious and back in the hotel I started an internet research to find out if the iPhones where original ones.

Especially the Apple Service and Repair webpage was very helpful. One of the iPhones was a replacement part without any guarantee, the other two were already several month old. Conclusion we bought refurbished iPhones sold as new ones. When the battery life of the replacement part showed that the battery was already quite old we decided to go back to the shop another time and ask the sellers directly about the fact that they hid that they sold refurbished iPhones.

The result was not really satisfactory. They changed the replacement iPhone with the damaged battery to another one but that was all.

Because one of us was really pissed off, she called the police later to ask them what to do. The police forwarded us to a special unit which deals with these matters and they told us that only China Unicom is allowed to sell iPhones in China and therefore they will do nothing about our case.

After we got this information I finally understood what happend to my iPhone which suddenly didn’t work any more and had a closer look on the installed software. The iPhones were original China Unicom phones which have been jailbreaked and unlocked!

As final resultI can only warn you to be aware that most phones, even in official China Mobile Reseller Shops like the one where we bought our phones, are fakes or refurbished. This puts the price we payed into a complete new perspective!

Posted in Around the World, China | Tagged , | 1 Comment

The Nonsense of Software Patents

I am Software Developer and my opinion is that Software Patents are not only Nonsense but also counterproductive!

There are not infinitely many ways to program something. Computer Science Theory already shows that for many problems there are only few methods to solve the problem with programming in a reasonable way if they are solvable at all. And then there are best practices in programming which simply evolved from many programmers coding a huge amount of code and trying to make everything more manageable.

On the other hand there are the software companies who try to claim every idea as theirs to gain control over their competitors or even a part of the software development universe. This turns programming more and more into a run through a minefield and I am already sure that one day when I finally think that I get a big success with one of my programs there comes one of these big patent hoarders and wants its part of my cake because I violated some sort of broad spread patent.

As I can read on Heise Online today this time someone tries to get his piece of cake from our dear competitor Microsoft. It seems that the Canadian company i4i holds a US Patent No. 5,787,449 which describes the separate manipulation of architecture information and data of a document within the same file.

Not that I am not a little bit mischievous that it hit Microsoft, one of the biggest supporters of software patents and rigorous enforcer of his own “rights”, but I have to state that I am a little bit astonished that such a patent is possible after all! I mean, the patent was filed in 1994 but at this time we had already the Java Programming language since 1992. And together with this language came the famous JAR-file which is an zip-archive enhanced with a metadata file. This metadata file describes the “architecture” of the jar-archive and can be manipulated independently from the class files which normally constitute the data. It becomes even more obvious that this method is common sense when you examine the usage of ear- or war-archives because with the appearance of J2EE the usage of XML-Files within the archive for configuration and architecture description of the data within the archive went a huge step further.

Since 2006 the Open Document Standard is specified, which actually does what every smart programmer would do without any guidance. It packs together the formatting information and the data of a document into one archive, the exact same path which was already prepared by the jar-archives.

So, especially in direction of Microsoft, I would like to ask: Does anybody else have the same impression as I that software patents are really counterproductive an therefore should be forbidden?

I for myself have never in this business seen a striking innovation where I would have agreed that this should be protected by a patent. But I am only about 20 years in this business. Perhaps this point is still to come.

Posted in All, Patents | Tagged , , | Leave a comment

Back after a Break

I didn’t write anything for quite a while. But now I am back 🙂

My break had two reasons. The really good one is that I became father of a little daughter named Thalea in the mid of July. Naturally I hope for the next talent in computer science but who knows. If she is only a little bit like her mother she will absolutely have her own head and push her own ideas!

If you hope that I will publish family pictures regularly now I have to disappoint you. Family business stays private. The next public pictures of Thalea you can see perhaps in her own blog one day. 😉

The second reason for not publishing articles was the deceasing of my beloved IBM Thinkpad Tablet. I think the heat and moisture of Hainan have been too much for it and when the fan finally gave up …

As a more suitable solution for the Hainan weather conditions I bought a desktop computer with many fans 😉 and installed Linux in form of the Fedora 11 distro on it. Perhaps installed is said too much. After over a week of installation I am still struggling to get all components supported and fully up and running. Hope that one day I manage to have installed this cool machine as it should be, including accelerated graphics and dolby surround sound.

Nevertheless I will try to revive the laptop. The tablet functionality is simply cool to manipulate images.

Posted in Misc | Tagged | 1 Comment

Ruby Objects, Class-Objects and MetaClass-Objects

After a while of evaluation I started over programming mainly in Ruby about two month ago.

Long time ago I learned for a short while object orientation programming in Smalltalk-80 but soon started to use C++, first with the AT&T preprocessor and later with the gcc. Since 1998 I am programming Java. All these years have left me with a certain idea of practical object orientation which was not really what I learned from Smalltalk-80.

But Ruby changed things a lot as I have to admit. In Ruby everything is an object and Ruby is interpreted like Smalltalk! What are the consequences. This is what my post will try to figure out.

From Ruby Core – Class documentation:

Classes in Ruby are first-class objects—each is an instance of class Class.

A big help for understanding Ruby Objects has been the Pickaxe Book.

In Ruby everything is an object. This includes as well Integers as Classes. So what happens if you write something like:

  a = "test1"
  b = "test2"

You get references a and b to your Objects a and b of class String which is an object too and has the class object Object as superclass. So far the only difference is that the Classes are realized as objects themselves.

But you can do things in Ruby which you cannot do in C++ or Java. For example you can add a method only to one object like:

  c = 'test'
  class < < c
    def double
      self + self
    end
  end
 
  c.double
  =>"testtest"

This piece of code generates a virtual class exclusively for the object c.

What happens if you try the same for integers? If you try the same for integers it should look like object b in this graph:

The code for this would be:

  b = 7
  class < < b
    def double
      self + self
    end
  end
 
  TypeError: no virtual class for Fixnum

So what is this? I thought that all objects can have virtual (or singleton) classes which hold the methods specially attached to this object?

The solution is quite simple. There are special classes like Fixnum which are called eigenclasses. Instead of a reference to an object these classes return the class object itself (for example as parameter for a method call). Eigenclass objects only have one single Object for example for each Fixnum value. This is why it is not possible to create singleton classes for eigenclass objects.

But what you can do is to extend an eigenclass with your own attributes like:

  class Fixnum
    attr_accessor :name
  end
 
  b = 5
  b.class
  => Fixnum
  b.name 'five'
  => "five"

The next thing I want to do is to define a class variable. I found a nice article about class variables in Ruby on John Nunemakers blog. At first I was really astonished about this:

  class Polygon
    @@sides = 10
    def self.sides
      @@sides
    end
  end
 
  puts Polygon.sides # => 10

This is a Polygon class with a class variable which holds the number of sides of the Polygon and a getter class method. Now we create a subclass which inherits from Polygon and holds its own number of sides:

  class Triangle < Polygon
    @@sides = 3
  end
 
  puts Triangle.sides # => 3
  puts Polygon.sides # => 3

What happens here? The Polygon sides have been set to 10 originally.

To understand this behavior you must have an understanding about the Ruby Meta-class and look-up mechanism for methods and variables. When you create a class variable or method Ruby actually creates the following Meta-Class for you:

The Meta-Class hold the Class level extensions of your class. If you subclass Polygon now you have the following image:

In Ruby everything, including class definitions, are executable code. The assignment to the class variable @@sides in the class Triangle leads the Ruby interpreter to search for an existing class variable @@sides which he finds in the Meta-Class of the superclass Polygon first and makes an assignment to this variable instead of creating a new meta-Class with the same variable for Triangle.

So what can we do if we want to have a variable for the sides of our class which is unique to the according class? As the class itself is an object you can assign a variable to the class object

You can do this with the following code:

  class Polygon
    @sides
    class < < self
      attr_accessor :sides
    end
  end

for the Class Polygon and the same for class Triangle. Be aware that you have to assign the accessors to the class object and not to the object itself.

I hope that my explanations are correct and can help other newbies in Ruby to understand the Class handling a little bit.

Posted in All, Ruby | Tagged , | 2 Comments

Tropical Thunderstorms

When I arrived in Haikou a year ago my only experience with a tropical region has been 6 month on Martinique between my studies in physics and the start of my computer science studies. On Martinique the rainy season is about 3 month and the rest of the year there is more or less sunshine.

The September in Haikou last year has been nice even though it was quite warm with around 38°C. In October the Taifun season began and I can tell you that we got drown in our apartment in the fourth floor. The wind pressed the gigantic amount of water which has been carried along with the Taifun directly through the windows into the apartment. This rainy period continued more or less until mid December. The rest of December and January have been dry but unusual cold, specially because there is no heating in the apartment.

In February it started to rain again. First only sometimes and after a while more and more. Since two month now we have temperatures above 30°C and about one thunderstorm every day. The record has been three thunderstorms in a row during one afternoon. When you are outside in such a storm, there is no protection. When you wear a slicker you are wet from your own sweat, otherwise from the rain. The water in the road can easily raise to a torrent of more than 10cm depth. There is no sewer which can take that much water in such a short time even though the city of Haikou is cleaning them all the time. A gaze through the window shows me grey in grey during such a storm and I can hardly see the neighbour building which is only about 30m away.

I never imagined that on a tropical island like Hainan it could be more rainy than in northern Germany where I come from and which I once left because of the “bad weather”. I think life is really funny and we should enjoy this fact much more ! 😉

Posted in Around the World, China | Tagged , , | 1 Comment