SlowerBuffer

Programming and Technology Related Stuff

Google WebM Licensing

A piece on Google’s recent licensing of patents WebM:

A few days ago, Google and the MPEG-LA announced that they had come to an agreement under which Google received a license for techniques in VP8 that may infringe upon MPEG-LA patents (not the ‘if any’). Only a few days later, we learn the real reason behind Google and the MPEG-LA striking a deal, thanks to The H Open, making it clear that the MPEG-LA has lost. Big time.

A decidedly positive perspective on the recent news (though maybe a tad ranty against H.264). I read this piece perhaps 10 minutes after reading ApplieInsider’s somewhat negative view on the same news (via Marco’s decidedly negative and rather ranty commentary).

These (and their associated comment threads) just go to show that Video Codecs remains one of the hot-button topics of the internet.

But Is It in Debug?

Came across this code in one of our applications yesterday:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
   if (LOG.isDebugEnabled())
   {
      if ( LOG.isDebugEnabled() ) {
         LOG.debug(parameter.getLabel() + " ==================================");
      }
      if ( LOG.isDebugEnabled() ) {
         LOG.debug("\tlabel     = " + parameter.getLabel());
      }
      if ( LOG.isDebugEnabled() ) {
         LOG.debug("\tproperty  = " + property);
      }
      if ( LOG.isDebugEnabled() ) {
         LOG.debug("\tdbValue   = " + value);
      }
      if ( LOG.isDebugEnabled() ) {
         LOG.debug("\tbeanValue = " + BeanUtils.getProperty(bean, parameter.getProperty()) + "\n");
      }
   }
   else
      ; // not debugging

I found it rather hilarious. It’s not terrible code, certainly not The Daily WTF worthy (though maybe not exactly my java coding style). I mean, it’s not terribly inefficient as the conditional doesn’t cost much and, besides, the extra checks will only execute when in DEBUG, at which point you’ve got larger performance issues. But I still wanted to know who would have written this?

The answer: Global Find and Replace

I checked the revision history. The file hasn’t been edited since 2006 and prior to that edit it looked like this:

1
2
3
4
5
6
7
8
9
10
   if (LOG.isDebugEnabled())
   {
      LOG.debug(parameter.getLabel() + " ==================================");
      LOG.debug("\tlabel     = " + parameter.getLabel());
      LOG.debug("\tproperty  = " + property);
      LOG.debug("\tdbValue   = " + value);
      LOG.debug("\tbeanValue = " + BeanUtils.getProperty(bean, parameter.getProperty()) + "\n");
   }
   else
      ; // not debugging

The committed was an old employee of ours, and after seeing his name and the date I recalled that he at one point spent some time going through the code looking for instances where debug logging was done without first checking the log level (if you don’t know why this is a good idea, here’s a read). I can only assume that he decided to run a global find and replace for this, as I can’t really see him hand crafting this example.

My point: Be very careful with full code base find and replace. In this case there’s no problem, just some amusingly useless code, but there could easily be a situation where an actual performance issue is introduced and not quickly caught.

Lynx vs IE5

Saw this get the retweet treatment on twitter:

I followed through to the discussion, and sure enough there is someone posting a screen shot of an ancient version of IE failing to load the site. It is actually IE5 not 6 (see wikipedia: IE5 and IE6) but that is unimportant.

The thread is really worth the read for the laugh. There are jokes involving Mosaic, Netscape, and yes, the tweet-promised screenshot of the site rendered in Lynx.

Really not 100% sure if this was a troll or not (I put myself at 95%). I would think so, but you really never know in this crazy web world sometimes. I’ll leave you with the original poster’s response and let you be the judge:

I would upgrade, but I’m afraid of losing my Active Desktop widgets and Channels Bar. I don’t understand why this can’t work though. IE 5 has ajax support.

Still a Lot of iPhones

As the iPhone rumours continue, analyst Peter Misek (who helped spark off the iPhone “Plus” rumours a few months ago) seems to be backing off a bit saying that it won’t be released until mid-2014 due to production problems.

He does however still think there is a possibility of a low-cost iPhone (I said the rumour wouldn’t stop) this year despite Tim Cook’s denial, so take what you will, as usual.

Cult of Mac has since given us A History Of Horrible Apple Predictions From Peter Misek.