Archive for September, 2008

Bug in FeedTools

Wednesday, September 10th, 2008

I’ve been chasing a bug in Amethyst for over a week. Sometimes accented characters cause problems, sometimes they don’t. MySQL will often complain about a duplicate key in a multi-row INSERT. The INSERT is correct, but the duplicate key doesn’t appear in any of INSERTs! With enough examples I figured out that they are all the prefix of the key from one of the INSERTS, up to the first accented character. But not all accented characters cause problems, though all accented characters on one feed do cause problems. I’ve been tracing the incoming data starting with the data on the network and working my way through the system.  In  chatting with Greg Foster of  the Consumers Union at the Lone Star Ruby Conference, the topic came up and he mentioned that in spite of various feeds proclaiming that they are UTF-8, sometimes they contain Latin-1 characters. He said he had a conversion routine in Ruby he’d send me. Sure enough, I looked closer and there they were! Depending on what I used to look at them, they might render as expected, or as a ‘\361′ sequence.

Later in the conference I became impatient to fix the problem and Googled “Latin1 conversion UTF8 Ruby”. At the top of the list was
How-to fix ruby’s FeedTools latin-1 parsing. There is a bug in FeedTools, it converts numeric HTML entities under 256 to Latin1 characters instead of UTF-8 characters.  The blog entry includes some code to monkey patch FeedTools to correct the problem. I dropped the code in, deleted the corrupt data, refreshed the feed, and voila, problem fixed.

Less is More

Tuesday, September 2nd, 2008

I am preparing for a talk at the Lone Star Ruby Conference on Ruby and Rails on NetBeans, a IDE written in Java.  It’s only ten minutes long and so a bit of a squeeze.  With practice and dropping all the “You knows…” and such I can shorten it, but I still have a 20 minute talk.  Listening to a podcast last night by the Common Craft folk, I was reminded that it is more about what you leave out than what you leave in.  It was reinforced this morning by a video on the Guardian’s site on New Orleans and Hurricane Gustave.  There is no voice over, just the sound of the wind and pictures of trees, sofas, and people being pushed about by the wind.  The last third is President Bush boarding a plane.  Again no voice over, just the whine of an idling jet.  Powerful.