Oct 8, 2012

Fun with property files

Let's say you have a property file (myprops.properties):

dialog.yes=Yes
dialog.no=No

With a localized version (myprops_sv.properties):

dialog.yes=Ja
dialog.no=Nej

Now add a spurious backslash to myprops_sv.properties:

dialog.yes=Ja         \
dialog.no=Nej

What do you get? When using the localized version you get a mix of English and Swedish ("No", "Ja"). Well, you don't really get "Ja", you get "Ja \dialog.no=Nej", but that's hard to spot if it's used for a fixed width button... Took a while to figure that one out.

Sep 26, 2012

On the "Intel Inside" Sticker Question

The Dumbest Question I've Ever Heard has resurfaced at Daring Fireball.

The reporter in question was ridiculed as the Intel Sticker Guy and called brazenly moronic at the time.

"Can you say why you all are not participating in the "Intel Inside" program, putting the stickers on your new or previous Mac?"

It is actually an excellent question. The job of an interviewer is not to appear smart, but to bring out the best from the interviewee. The purpose of an interview question is not to inform the interviewer, but to inform the listener.

Everyone PC maker using Intel, except Apple, put stickers on their PCs. It may be a small detail, but it really goes to the heart of Apple's product philosophy, and that seemingly innocuous question provoked an emotional response, reflecting that philosophy.

Apple must have been overjoyed at being given the chance to explain how they were different from other computer makers. And I believe that was what the reporter intended.

May 7, 2012

Java is Still Free Software

There's a lot of fud floating around regarding Java and Oracle's enforcement of its Java related rights. E.g.

"If the verdict that Android infringed copyrights stands, it could put programmers in a difficult situation. Java is an open source language, but now it's not clear how free programmers are to use it, since Oracle has said that anyone following the Java APIs—which are basically sets of instructions about how to use Java—needs a license." Ars Technica/Joe Mullin
Google's problem, to the extent that they have a problem, the trial is far from over, is that they have chosen to not license Java from SUN/Oracle at all. In particular, they have chosen to not use the GPL licensed OpenJDK . It's perfectly clear what the GPL license is, and how it works, and the validity of the license have been upheld in several courts of law.

If you if can abide by the terms of OpenJDK, you are as safe as with any other free software*. And indeed, Oracle has not gone after any OpenJDK licensees, nor have they given any indication they would want to do so**.

The API question is yet another red herring that is deliberately used by Java bashers to muddy the waters. If you accept the GPL license, you have licensed the whole work, including any copyrighted parts of the API. If API:s are in fact covered by copyright, we have a real problem, but an industry wide problem, maybe I'll comment on that in some other post, but it's not a Java problem.

Those are the facts, but where do I stand? I would have wanted Sun to endorse the Harmony project. I would have liked for Google to come to terms with Sun before rushing headlong into developing Android. Oracle could have been more lenient. And I definitely would have preferred an Apache style license over GPL for OpenJDK. But the trial is real, and it has hurt Java, Google, and Oracle immensely, regardless of the final outcome.

* I use the term free software rather than open source, since it's a more fitting description of GPL style licenses.
** If you download Java from Oracle you subject yourself to a completely different "binary" license.

Jan 4, 2012

SOPA Amendment

According to my sources, an addition to SOPA is in the works. This addition is spearheaded by the Retail Industry Association of America(RIAA), text taken from an early internal draft:

"The problem of shoplifting is a widespread scourge in the retail industry. Shoplifting costs business owners billions of dollars every year, and hurts consumers as well. To make matters worse, many jobs are lost.

We believe that the general principles of SOPA can be applied to the retail industry with some small additions. Shoplifters often live in apartment buildings, where they stash and consume their loot. It is only fair that the owner of the building is responsible for its tenants belongings.

Our modest proposal is that, if a tenant is found to be a shoplifter, all tenants of the apartment building in question should be evicted to prevent further crime. Furthermore, the address of the building should be removed from all maps to prevent accomplices from visiting. All payments to and from the owner of the building should be stopped.

These measures should stay in place until the owner has put safeguards in place to prevent further crime.

Since it can be difficult to prove that someone is shoplifting, we believe that mere suspicion should be enough to start the above procedure. If further investigation proves the allegations wrong, the measures taken can be reversed with no harm done.

We would also like to use this opportunity to state that we are committed to fair, reasonable and balanced law for the general public, complemented by voluntary ethical conduct code for the retail industry itself.

Noh Wan - on behalf of
RIAA"