Today at work we found a subtle issue that will sometimes break your code in very difficult to find ways. Read this if you don’t like days of bug hunting for mysterious issues only occurring on high-load production machines.
Ever wrote code like this?
private static final DateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd");
Most of us did. It’s the most intuitive way to use a DateFormat to format some Date object as a human-readable String.
Unfortunately, it’s wrong.
When used in a multi-threaded context (e.g. in a Servlet), this will end up breaking. Sometimes. When you least expect it.
Back in september of 2010 I wrote a blog post about the Breaking Float rendering bug I found in WebKit, the rendering engine backing the Safari, Chrome and Opera browsers. In april of 2013 the WebKit team landed a patch which would eventually end up in the browsers relying on WebKit. Case closed right? Well, not quitte…
Blink brought it back
Coincidentally, in the same month that the Breaking Float bug was fixed, Google forked WebKit into a new project called ‘Blink’. And the fix to the Breaking Float bug was not in the fork. Over time, the Chrome browser switched over to using Blink instead of WebKit, bringing back the issue in all it’s breaking glory.
Just after midnight on monday I posted my first sports-related post. I’m not much into sports myself but I happen to know someone who is and often makes predictions about sports matches that come true. So I thought it would be fun if he would share some predictions about the 2014 World Cup that is drawing to a close right now. So I wrote a post about his World Cup predictions.
The Oracle’s first prediction was on the money
My ‘Oracle’ as I will call him from now on predicted that Germany would convincingly beat Brazil. Well it does not come much more convincing than winning with 7 to 1!
The Brazilian supporters where shocked at what they were seeing. Germany walked all over Brazil and they are off to the finals!
I’m not into sports but I do watch the European and World Cup matches that my country partakes in. The Netherlands have reached the semi-finals so it seems like a good moment for a post. But as I don’t know anything about sports I consulted with my brother-in-law and a sports-oracle of sorts, Stefan.
Germany to win convincingly from Brazil
With Brazil having lost it’s two most important players, Neymar who is suffering from a back injury and Silva who is suspended, Germany is a huge favourite in the eyes of Stefan. They will win convincingly he says. He points out that statistically, the German team is right up there with the Brazilian team, but that the Brazilian team without it’s key players is just not up to that level. “Only if the German team loses it’s keeper in the first minutes of the game to a red card and a penalty that Brazil scores do they risk losing this game”, he says.