Jazoon Again

20. June, 2011

It’s that time of year again: Jazoon is around the corner. If you’re there, you can meet me. Yes, I really look like the picture in the header.

I’m a bit worried about the amount of Microsoft tracks (or rather the fact that M$ is involved at all). Does that mean you can’t get enough Java developers for a pure Java conference anymore? Well, stackoverflow might have an influence on that. Or does it mean M$ can’t find enough people to suff…enjoy their great products?

Ah well. As a veteran of the AmigaAtari-PC wars during the late 1980’s, I’m shouldn’t have to worry.

“Le t’atari – the cheese among the computers”

“How does an Amiga user shave? By turning on the screen saver”

“How do you get more than two colors on a PC screen? Put an Amiga 2000 into the case”


JSON Visualization

20. June, 2011

If you have some JSON (possibly broken) and need to know how the browser sees it: JSON Visualization


Clever Way to Support Custom Colors

17. June, 2011

The task: Create a web UI with rounded corners where the user can select the color.

Here is a possible solution.


Two Awesome Browser Demos

16. June, 2011

HTML(5) is starting to take off.

aqu4rium is a demo for a GWT based game framework which mimics an older IE9 demo Fishietank. My numbers: 250 fish, ~56FPS, load 0.1.

ro.me is a 3D music video with interactive effects. After the video, you’ll be redirected to a page with lots of technical details, source and example code.


More Internet Censorship in Great Britian

15. June, 2011

The British government wants to extend the censorship filter lists for undesired content.

Not unexpected. The argument “filter lists are essential to fight child porn” is basically a lie; most child porn is exchanged in private groups which the police either can’t find or can close easily. But since the topic is so touchy, arguments against it were objectionable. It didn’t matter if the tool was useless or even dangerous as long as it looked good.

Now, the road is paved to censor the Internet.

Of course, Britain isn’t China.

They don’t suppress people for political reasons.

Commercial reasons and votes are enough.


Why The West Beat The East

14. June, 2011

Many important developments were made in the eastern part of the world: Gun powder (China), Arabic numerals, Astronomy (Mesopotamia, today Iraq). From the synopsis of “Civilization“:

If in the year 1411 you had been able to circumnavigate the globe, you would have been most impressed by the dazzling civilizations of the Orient. The Forbidden City was under construction in Ming Beijing; in the Near East, the Ottomans were closing in on Constantinople.

By contrast, England would have struck you as a miserable backwater ravaged by plague, bad sanitation and incessant war. The other quarrelsome kingdoms of Western Europe – Aragon, Castile, France, Portugal and Scotland – would have seemed little better. As for fifteenth-century North America, it was an anarchic wilderness compared with the realms of the Aztecs and Incas.

So the question is: If these people had all this knowledge so much longer than the western world, why did the west still outperform them?

Niall Ferguson has an interesting theory: We had six “killer apps” they were missing:

  1. Competitive environment
  2. Science
  3. Democracy
  4. Medicine
  5. Consumerism
  6. Ethics of work

So while China was united under a single ruler, in Europe rulers and subjects had to compete for resources. Leaps in science led to better understanding of the world, better medical support which led to enough free time and effort to be able to demand democracy. Science couldn’t be “kept in the bottle” because scientists could leave one place and do their work in another. Common religious beliefs did slow that process somewhat but in the end, the forces were too great. Still, religion made people work hard to earn their keep. Consumerism led to efficient ways to produce cheaper goods, and to earn the money to actually buy them.


Reading On the Samsung Galaxy II

13. June, 2011

A couple of days ago, I got a new toy: The Samsung Galaxy II. Along came a “readers hub” which I didn’t use. The contract says something about “additional charges might be incurred.” “Might” surely isn’t a word that I like to see close to “money.”

So I got the Amazon Kindle reader for Android. Everything else aside, Amazon is the largest book seller on the planet and the prices are better than anywhere else. Which leads to the question: Are the prices worth it?

On the plus side, reading on the Galaxy II is a nice experience. The text is clear and easy to read. Flipping pages by tapping or swishing over the screen is easy enough. The device is smaller than normal book and the weight is comparable to a 400 page paperback. Since it’s smaller than the book, it’s easier to hold “open” then the book. My fingers are long enough to wrap around the whole backside, so with a bit of strain, I can tap the right side of the screen with my middle finger without moving my hand at all. It shows much less text per page, so you need more tapping but it was very easy to get used to that.

In fact, I completely forget about it. When a piece of the story makes me stop (like “huh? That doesn’t seem to match to what I’ve read before”) and I start to “leaf” back, I’m usually surprised how many “pages” I have to go back to find something I’ve read “just before”.

Another neat gadget is the dictionary. If I press the finger on a word, the dictionary entry for it pop up. Especially useful if your English is as good as mine but not perfect – what was “lambent” again?

On the negative side, with the Kindle and similar tools, I don’t get much for my money. I surely don’t get a book – just the right to read one. Until someone decides different. So to ask a similar price for less service feels like a rip-off. For example, the paperback for David Weber‘s “A Mighty Fortress” costs EUR 5,50. The eBook goes for 5,22. The list price makes it look better: For the paperback, that would be EUR 11,- while the eBook is EUR 8,45 – 23% less.

But that’s without postage and packing and the fact that I get the book right away. So in reality, I get the book for about 40% less and I can get it as soon as I discover it.

But I can’t lend or sell it. Being an author, I usually don’t lend or sell my book, so that’s not a big deal for me. It still irks me. On the other hand, have all my books with me at all times. All of them.

Which leaves the only major drawback: There are two big, competing formats: Kindle and EPUB. And the Kindle doesn’t support EPUB (for obvious reasons). And I’d be surprised if, after one format “won,” you would be allowed to convert all your old books to the new format. OTOH, Amazon isn’t going to drop support for the Kindle format and the EPUB format is open (so anyone can implement a reader), that means your books won’t be worthless.

Until the seller goes bankrupt, of course. Or a lawsuit happens. Or crackers wipe their databases. After that, all your books will be unreadable.


Patent Trolls vs Common Sense 1:0 Again

11. June, 2011

Microsoft failed in court to relax the rules under which existing IT patents can be challenged. A great loss for everyone, even those who like the status quo.

Remember: i4i (is that “eye for an eye”?) owns patent 5,787,449: “A system and method for the separate manipulation of the architecture and content of a document, particularly for data representation and transformations.”

While the first sentence screams XML, it’s actually about a way to save additional data along with an XML document. Microsoft Word allows you to include any other file in the document, hence they violate the patent. Here is a good analysis.

This doesn’t mean anyone using XML is now prone to a lawsuit by i4i, but it’s still bad news. Why?

The parent was granted in 1998. In the very same year, the XML 1.0 standard was created (see here). This is just an example but patents are filed when the world starts to explore the very same field, obviously. We haven’t seen patents for combustion engines in 1603. And no patent office is going to accept patents for intergalactic FTL drives today.

Patents are filed to protect the investments of big companies. The pharmaceutical industry has to spend many million dollars to create a new medicine. Everything else has already been invents, so only the complex == expensive stuff is left. On this scale, it makes sense to generate billions in revenue since that’s about only one to ten thousand times what you invested. And you make that over many years.

IT is different. While the idea to store additional information along with a document might have been novel in 1998, it’s completely obvious today. The investment of i4i was probably on the scale of a few thousand dollars. Now, they made $290 million just by suing Microsoft.

My gut feeling is that they abuse the system. Pharmaceutical companies take great risks, i4i didn’t. i4i doesn’t sue everyone, they sue the big money. It’s perfectly legal. But is it right?

Here in Germany, we have the term of “Rechtsfrieden” which means “peace of law.” People believe and follow the law because it appears to be just. Violating the peace of law means that someone uses perfectly legal ways to harass someone. Think of a lawyer who got dumped by his girlfriend and now uses all the tiny transgressions we all do to turn her live into hell. She parks where she shouldn’t, he send a photo to the police. She drives a bit too fast, another fine. Talking with her mobile on the wheel. Telling people that she is a serial offender but no details, lest he could get into trouble. This behavior creates the impression on other people that the law can easily be used against them. The trust that the law needs to be efficient is undermined.

From my point of view, patent trolls violate the peace of law. They invest little and try to milk society. The damage is much bigger than the $290 million fine. M$ had to withdraw an entire production of Office products, they had to pay a fortune in lawyer fees, and now every software company using a similar technology is under even more stress than before: i4i just got the money to drive anyone out of business. Because today, almost every software company uses technology like that. It’s so obvious today that no one would even think that there might be a patent for it.

And that’s the fundamental problems around software patents: They don’t make sense on any level.

Other industries have to invest millions of dollars in equipment and thousands of people (in the field, lab workers, people building lab equipment, test subjects) and procedures (clinical or other tests, legal reviews, patent research) to develop new products. Actually producing those products is expensive: You need workers, factories, raw material. And then, you haven’t sold a single unit. So you need transportation, packaging, hygiene environments, storage, advertising, sales points, etc.

To bring a new medicine to market, you need one billion dollars today. That is a huge risk. While I don’t like patents, I can understand that you want all the protection you can get in this case.

Software patents are dirt cheap by comparison. Usually, it takes just one person to have the idea. You need equipment that costs a couple of thousand dollars. Even 1998, computers usually cost less than $10’000. Developing the idea to a real patent is in the same range. You don’t need expensive equipment for that, just determination and a good patent lawyer.

Basically, there is no risk in developing a software patent. If the patent is found void, you also don’t lose much. It doesn’t mean your investment is lost. It doesn’t mean your multi-million dollar factory is ripe for an unexpected amortization. It doesn’t bankrupt you.

On the other hand, a software patent is a great tool to harm society, 100% legal. That $290 million isn’t coming out of the pockets of Microsoft, it’s ultimately coming out of the pockets of their customers. The fine doesn’t benefit society, it goes to the owners of i4i. And rich people don’t share.

The judges in the M$ vs. i4i case argued that the government should set the rules. Which sounds good. But apparently, the members of parliament also don’t understand that we have two completely different sets of problems. When biochemical companies argue pro patents, they ignore the fact that one size only fits all when everyone is the same size.

Conclusion: In my opinion, i4i legally “swiped” $290 million from society. Which is a perfect argument to treat software patents completely different from normal patents.


Solutions for Common Xtext Problems

10. June, 2011

Jens von Pilgrim compiled an excellent list of common errors when using Xtext 1 in his blog: When your MWE2 workflow is not working…


Composite Oriented Programming With Qi4j

9. June, 2011

Qi4j LogoComposite oriented programming (COP) addresses one of the short comings of OO: That the meaning of an object depends on the context.

In most OO languages today, it’s hard to change the type of an object. Actually, Object Oriented Programming should be called Class Oriented Programming because the class (the type) is the core feature which we use to build application.

But in the real world, objects can have several types. This isn’t polymorphism. It means that COP allows you use the data in an instance within the context of several classes.

For example, in Java, we have two methods which should be context sensitive: toString() and equals(). When I call toString(), I want a certain conversion but that can change depending on in which context I call it. In a debugger, I might want all fields. In the debug log, I might just want the name. In the UI, I will want a nice, user-configurable conversion.

equals() is a similar beast. Different contexts need different equals() methods that work on the same instance. For example in Hibernate, equals() should use the business key. Which is stupid: As soon as a primary key is assigned to the instance, it would be much faster and precise to use that to check for equality. But if you write a tool to compare graphs, your needs will be vastly different.

DI and IoC tools try to fill the similar gaps: At a certain point in time, your code needs a service and you can’t know ahead of time which implementation will be executing the service. While that works somewhat, it’s just a workaround for a fundamental flaw in todays OO languages: Type rules, instances are part of the problem.

Qi4j tries to solve this fundamental problem. Instead of writing huge classes that do everything, the application is created from small building blocks.

The typical case is names. A lot of instances have a name. Instead of writing this code once and using it everywhere, 10 lines of code are copied into every class: The field definition, getter and setter. And maybe you want to set the name from the constructor, so you need 8 more lines (one default constructor and one with the name parameter).

In Qi4j, you define this once. After that, you just add “extends NamedObject” in all the places where you need it. Almost no duplication. Since NamedObject is just an interface, you can collect several of these building blocks in your entity.