The Breaking Float Bug is back!

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

blinklogo

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.

Same bug, different project

I was looking over my old posts when I ended up at my test page and noticed that Chrome was rendering it wrong again. Knowing that Google had forked WebKit I realized what had probably happened and reported the bug again, this time to the Blink project.

Have no fear, The Blink project team is here!

Judging from the comments in the Blink issue report, the issue is being worked on and there is already a fix on the Canary branch of the Chrome browser, so it should hopefully just be a matter of time before we can have our floats on one line again. In the meantime it’s best to use one of the fixes I described in my original post.

The Football Oracle’s Predictions

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

Brazilian supporters crying

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!

Tonight the match of Netherlands versus Argentina will be played. The Oracle has calculated that if the Dutch team scores 3 goals, they will still end up with as many goals as the Germans have, even after their 7-1 victory. He seems to think it’s very well possible that exactly that will happen. I’m sure hoping it does!

World Cup Predictions

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

Neymar
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.

Netherlands to beat Argentina

The Dutch team slayed a whole bunch of dragons on the way to the semis. First it shocked the world by running all over the former world champion Spain, beating it with five to one, after getting behind at first. Which was a dragon in itself. Holland usually plays a dominant game, giving very little chances away to the opponent, but when the opponent did score it was usually fatal. Not so in this world cup. And then there is the overtime-dragon. The Netherlands would win their matches in regular playing time, or not at all. Again, doing much better this time.

And then there is the mother of all dragons. The penalties. If, god forbid, the Dutch team did make it all the way through overtime, the penalties would give the final blow. Our statistics on penalties… well I did not ask the oracle about that but they can’t be good. But we’re still here and Costa Rica is not. So… We are rocking right now!

So what about Argentina? We never lost to them. Well… allmost never… We did lose the 1978 World Cup Final’s to them, but hey, stuff happens. But still… Statistically speaking we’re good. And we have Robben! Stefan has little doubt that the Netherlands will win.

Fifa madness

Mad_scientist
On a final note; how is it that Fifa manages to place the two finalists from the previous world cup into the same starting pool?? Our Oracle understands the whole universe of sports, but Fifa remains an enigma even to him.

What do you think?

Do Brazil and Argentina stand a chance? Or will this end up with a European showdown? Please add your voice below.

I like my code wet

Redundancy. Repeating yourself. Duplication. Copy-paste.

These have become like curse words in IT. This data is completely redundant! Did you just copy-paste that code?

No Copy-Paste, No Copy-Paste, No Copy-Paste

We all learn early on in our programming ventures about how code duplication is bad. It creates maintenance nightmares we are told. Our code should be DRY. I believed it and lived by it. But as I am maturing in my programming I am more and more starting to doubt it.

Continue reading

Change the facebook button color

Yes, it can be done!

Changing the color of Facebook’s Like and Share buttons is something that web page designers wish for, but up untill the rise of HTML5 was practically impossible. But today, thanks to SVG filters, it can be done. It’s still not very easy and, as usual, Internet Explorer is lacking support, but it is definitely possible.

Impatient? Just do it

For the impatient, check out the facebook button colorizer tool I built. You just copy-paste your button code, fiddle with the controls keeping an eye on the live preview until you like the result and then just copy and paste the colorizer code to your website. Couldn’t be easier.

screenshot

Continue reading

Enums in Javascript

I recently stumbled onto a question on StackOverflow that I had answered myself a couple of years back and did some more thinking about it after reading some of the comments and decided that this topic was worth an article.

So what was the question I hear you ask?

What is the best way to write enums in Javascript?

First of all, before answering this question, we have to have a look at what an enum is and what it means to write one in Javascript. So let us look at a definition of enum:

What is an enum?

In computer programming, an enumerated type (also called enumeration or enum [..]) is a data type consisting of a set of named values called elements, members or enumerators of the type. The enumerator names are usually identifiers that behave as constants in the language. A variable that has been declared as having an enumerated type can be assigned any of the enumerators as a value.
-Wikipedia: Enumerated type

And a good example often beats a formal definition:

enum WeekDay = {MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY};

So, summarizing: An enum is a type restricting variables to one value from a predefined set of constants. In the example above, WeekDay is an enum and MONDAY, TUESDAY etc are the constants in the set, also called the enumerators. If we declare a variable as

WeekDay payDay;

..we would be able to assign it any of the constants MONDAY, TUESDAY etc, up to and including SUNDAY, but not something else like 12 or "labour day".

…which brings us to a problem.

Continue reading