Hulu Desktop 0.9.8.2 is Out

November 20th, 2009

This morning I noticed that Hulu Desktop 0.9.8.2 was out. It was only a week ago that 0.9.7.2 was released. This could be part of the build-up to the stated plans by Hulu to start charging for content in addition to the ad revenue. While I'm not against someone charging for something, it will make me delete the application as I have no interest in paying for content like Hulu when I can get all the content I want in iTunes for a price.

It's their choice, but I have a feeling this is the motivation for the quick update.

No release notes are available.

Gotta Admit, Heads-Down Coding is A Ton of Fun

November 19th, 2009

Today I've been doing a fair share of heads-down coding on the Google Visualization DataTable in Java - to get it up to the current JavaScript API published by Google. I started with this update a few days ago, but I stopped at the filtering and sorting. Today I dug into the filtering and allowed either a Java List<Map>, or the standard JSON array of maps. To make this a little easier, I made a parser to take the JSON string and convert it into the Java List<Map> and then have the JSON version of the method call the Java version. Pretty simple, but the converter was a little tricky, but not too bad.

I was pleased with the filtering. It worked wonderfully, and while it's probably not the highest performance implementation, it's pretty good, and certainly good enough for what I'm going to be using it for initially, which is just filling out the API spec. But if there becomes a problem later, I can imagine a few ways to make it nicer, I just didn't mess with them, and so performance tests to see which is better.

But the really nice thing was just that I was able to shut the floor out, listen to some decent music instead, and focus on coding. The one thing I really enjoy. That was the treat I gave myself today - the pleasure of creating. I really don't get to do it enough.

Fantastic Quote On the Passion of Creation

November 19th, 2009

I was reading Daring Fireball this morning and the following was a posting that hit me the second I read it. It's an interview with Cormac McCarthy:

WSJ: How does that ticking clock affect your work? Does it make you want to write more shorter pieces, or to cap things with a large, all-encompassing work?

CM: I’m not interested in writing short stories. Anything that doesn’t take years of your life and drive you to suicide hardly seems worth doing.

I love the passion expressed in that one line. Create something so utterly fantastic that it demands of you years of life or nearly every shred of your sanity. If you're doing less, then you could be doing more. And if you can do more, then you should do more.

I can't find who said it first, but this Life is not practice for anything. Do, and be, and follow your passion. And if you have none, see if you can find someone to infuse you with some. You'll be happier for it.

Camino 2.0 is Out

November 19th, 2009

Big news from the alternative browser space - Camino 2.0 has been released and is out there for all. It's not my top-flight browser choice, but you need to have a bunch of them to test all the pages you make, and this one is nicely Mac-like with the Mozilla engine behind it. It looks like it's got a new tab overview - like Safari's latest pages feature. Could be nice, sort-of like Expose for the browser. We'll see if it's really useful.

DrawIt 3.10.2 is Out

November 19th, 2009

This morning I noticed that DrawIt 3.10.2 is out with a nice little update list in Sparkle:

  • Slightly updated user interface in the filters stack
  • You can now click an effect in the favorites to add it, instead of having to drag
  • The visible and locked symbols are now displayed properly in the list
  • Adds Noise and Random Noise filters

Had to upgrade, of course.

Google Chrome dev 4.0.249.0 Fixes AnnotatedTimeLine Bug

November 19th, 2009

I noticed this morning that Google Chrome dev 4.0.249.0 was out for the Mac, and it fixes the nasty JavaScript bug that I submitted to Google a while back. I'm really excited to see this fixed, not for the Mac, per se, but the fact that this was the reason the Google Chrome Frame stopped working.

When I got to work and restarted IE 8, I was able to see that the auto-updating of the Google Chrome component in the Google Chrome Frame was working and my pages were working once again. Fantastic! I really love it when good software is written by great engineers.

Cyberduck 3.3 is Finally Out

November 19th, 2009

This morning I noticed that they finally had an official release of Cyberduck 3.3. This new release is Snow Leopard compatible, and 64-bit all the way. Not that I use an FTP client a lot, but this is one of the cleanest I've ever seen. It does it all.

How Bad Can it Be, Really? Plenty…

November 18th, 2009

This morning I came in to a horrible problem brought on by a new business focus, and folks not asking the right people what the possible impact would be of a seemingly simple change. Both of the apps I'm responsible for suffered this morning - one was a disaster until I could get a fix in the code for the problem, and another was simply not showing the right data. Arguably, not a lot better, but at least it was up and running.

The problem started long before I joined the Shop with the decision by someone to make all the databases case-insensitive sorting. This means that the data: "Steve" and "STEVE" are different in the database, but if you try to do a SELECT on the data, you'll get both values on any variation of "Steve" in the WHERE clause.

Let's assume we had a table in this database where people's names were held.

ID First Last Age
412 Steve Jobs 44
21 Tom Swift 44
332 Bill Gates 44
12 Tom Slick 44

then it would be possible to do the query:

  SELECT * FROM people WHERE FIRST='steve'

and get:

ID First Last Age
412 Steve Jobs 44

but you'd get the exact same results if you did:

  SELECT * FROM people WHERE FIRST='STEVE'

or:

  SELECT * FROM people WHERE FIRST='sTeVe'

It doesn't matter to the query processor. I can't see a possible reason for this - why not just force all the data in a table's column to be uppercase? It would make it case-insensitive, but not open you up to the following disaster.

Last evening something was added to this mythical table - a new "Steve Jobs". Let's say the table originally looked like this:

ID First Last Age
412 STEVE JOBS 44
21 Tom Swift 44
332 Bill Gates 44
12 Tom Slick 44

and they wanted to correct the mistake in the case of the name. Well... the obvious change to me is to run the SQL:

  UPDATE people
    SET FIRST='Steve', LAST='Jobs'
    WHERE ID=412

But that's not what was done. No, they created a new person so that the database looked like this:

ID First Last Age
412 STEVE JOBS 44
21 Tom Swift 44
332 Bill Gates 44
12 Tom Slick 44
601 Steve Jobs 44

now we're in a pickle. When we try to find Steve with the SQL:

  SELECT * FROM people WHERE FIRST='Steve'

we're going to get both of the rows:

ID First Last Age
412 STEVE JOBS 44
601 Steve Jobs 44

and where we were expecting one row to be returned, we now have two. Different systems will handle this differently, but there's no way the database will be able to differentiate them by their names. In reality, the ID is all that you have, and that's typically not visible to the users of a complex system.

This is what hit me this morning - two rows, and the new row was the first one returned, and it wasn't completely set up properly, so a lot of the supporting data wasn't there. Disaster.

Since there's nothing you can do to the SELECT statement, you have to filter the output, so my code went from:

  String    sql = "select ID from people where First='" + name + "'";
  ResultSet rs = stmt.executeQuery(sql);
  if (rs != null) {
    if (rs.next()) {
      id = rs.getInt("ID");
    }
  }

to:

  String    sql = "select First, ID from people where First='" + name + "'";
  ResultSet rs = stmt.executeQuery(sql);
  if (rs != null) {
    while (rs.next()) {
      if (name.equals(rs.getString("First"))) {
        id = rs.getInt("ID");
        break;
      }
    }
  }

and then later in the code, of course, I need to check and see that I actually got something.

While it's not horrible, it's something that's totally avoidable by either setting the case on the fields in the table, or allowing correct case determination in the SELECT statements so that this would easily have been found out early in the process.

As it was, I spent several hours on this - fixing code, and planning for other similar problems as they migrated datasets in the database. It's just not necessary.

Web Sites aren’t Made for Ampersands

November 17th, 2009

Today I've had a little fun with ampersands. Those little buggers are nasty to get right in the URLs and the HTML pages and XML config files of a typical Tomcat web site. But after having done it enough today, I think the rules are pretty simple, but need to be followed to the letter.

In URLs - Escape, Escape, Escape!

If you're in a JSP, or Java, in general, then the easiest thing for a URL is to use the URLEncoder that's in the standard JDK. It's possible to do the manual replacement, but it's so easy to use the URLEncoder that there's really no reason to do it the hard way.

  StringBuilder  vars = new StringBuilder();
 
  var.append("report=").append(URLEncoder.encode(report));
  var.append("&page=").append(URLEncoder.encode(page));
  var.append("&name=").append(URLEncoder.encode(name));

it's so easy, that there's no reason not to. However, a surprising number of developers forget to do this simple act.

In HTML Pages Go Verbose

It's been said that the escape sequence &amp; is one of the most verbose HTML escape sequences, and I have to agree. It's a mess, but it needs to exist for the reason that the ampersand is the escape sequence initiator. So it goes. In HTML, use it. It's just what you have to do.

In XML Config Go Verbose Again

It makes a little bit of sense to have the HTML and XML escape sequences for ampersand the same, but as with other things, I would not have been surprised if it had worked out that things were different in the two markups. What I am surprised at is that the URL escape code (%26) is not allowed in the XML config files, but then again, I guess it's exclusively for the URLs.

There's what I learned today. Doesn't sound like much, but it was a pain to pin down.

Getting Back in the Game

November 16th, 2009

I had a pretty rough weekend, and Liza still isn't feeling very well, so today has been a short (8 hr) day at work because I needed to be home to help her out. It's no fun having a migraine, and with all she's been through, it seemed to be the least I could do. So I left a little early.

Before I did, it was a day of messing with the configuration of one of my inherited apps to make it more granular for the business. Their plans for next year include paying closer attention to things in slightly different portfolios, so the took a very large one and made it several small ones. Nothing really earth-shaking about it, but there's a lot of little configuration details to make sure that things are ready to go. Nothing earth-shaking, but time-consuming.

I sure hope Liza is feeling better tonight.

UPDATE: we took her to the doctor near the house and got her a migraine 'shot' to clear up the migraine. It's a horrible thing. I wish she felt better.