<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Tom Gidden &#187; bug</title>
	<atom:link href="http://gidden.net/tom/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://gidden.net/tom</link>
	<description></description>
	<lastBuildDate>Fri, 02 Jul 2010 13:00:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1-alpha-15359</generator>
		<item>
		<title>iTunes Library Regeneration</title>
		<link>http://gidden.net/tom/2007/05/10/itunes-library-regeneration/</link>
		<comments>http://gidden.net/tom/2007/05/10/itunes-library-regeneration/#comments</comments>
		<pubDate>Thu, 10 May 2007 12:48:43 +0000</pubDate>
		<dc:creator>Tom Gidden</dc:creator>
				<category><![CDATA[Techie]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[podcasts]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://gidden.net/tom/2007/05/10/itunes-library-regeneration/</guid>
		<description><![CDATA[The final major thing that "I Don't Like About iTunes and iPod" has annoyed me from Day One:  the monolithic bloaty binary library, and the accompanying tidy-but-inefficient XML backup.  For a small library, it's no problem, but mine has major issues.  Heck, and I don't even consider my ~40GB library to be particularly big!

Over the past few months, I've noticed that iTunes has been getting slower and slower.  It's clear that iTunes doesn't scale particularly well.  For anything under, say, 5000 tracks, it starts up quickly.  If you go much above that, it gets sluggish on startup.  Searches start getting slower too.  This doesn't happen linearly, either.
The binary library file was also significantly larger than the XML library file.  As a rule, I've noticed that the XML tends to be a little bit smaller, but my binary file was almost twice the size of the XML.  In this case, I felt it was worth regenerating the library.
Okay, the usual procedure for this (rather drastic) action is to shut down iTunes, and purposefully corrupt the binary library file.  iTunes will then rebuild the binary from the XML "backup" when it next starts.  If you just delete the file, it'll assume you don't have a library and will wipe the XML too.  So, I tend to move the old binary into a backup directory and then create a new dummy file.
In the past, this has tended to work well.  Occasionally there are a few quirks:  in an old version of iTunes, I seem to remember the play counts got trashed.
This time, there was a problem.  My Podcasts section was empty!  The files were still there, but they didn't appear on the list.  I then noticed that there was a new static playlist called "Podcasts" with all my old podcast files, but as as normal audio files rather than categorised podcasts.  These items didn't appear anywhere in the Library section: just the playlists.  So, it's not seemingly possible to delete them from iTunes.
I tried adding the Podcasts again from the iTunes Store, foolishly hoping it would notice the existing files.  Unfortunately, it just downloads fresh copies instead, naming them with a " 1" suffix.
So, I deleted the files manually, and then used the excellent Super Remove Dead Tracks from Doug Adams's site.
This problem highlights the design bloat I spoke about in my previous post.  Back before podcasts, audiobooks, video and all the other stuff appeared in iTunes, everything was neatly kept in the Music Library, and it all worked.  It was possible for the filesystem and iTunes to get out-of-sync with both missing and excess files in the iTunes Music folder, but on the whole, it worked well.
Nowadays, the addition of these new media types to the increasingly-inaccurately-named iTunes has complicated everything.  There's no central folder of everything and stuff can seemingly fall through the cracks.  If a Podcast isn't in the Podcasts list, it won't appear anywhere.
I think Apple should build a new piece of software, called iMedia or something like that, for managing everything currently handled by iPod, iTunes, iPhoto, iPhone, Apple TV and Front Row.
They should also consider using something intrinsic to the OS -- such as Spotlight -- to manage the libraries themselves, rather than relying on easily-breakable and easy-to-desynchronise monolithic files.  At the very least, they should rework it using Core Data, and if I had my way, also add "proper" RDBMS support to Core Data so I can use MySQL as my music library index!
In the process, they should reconceptualise the whole thing.  How should a digital hub operate?  It should work well with multiple libraries at the same time, with network nodes as data suppliers, so families and housemates can share media.  It should allow offline media integration, such as Delicious Library, so I can organise and manage my books and DVDs too.  Ideally, I'd want it to be able to control DVD jukeboxes, so I could build the mother of all home entertainment media servers around a single Mac Mini and a bunch of external jukeboxes, sources and filestores.  It should be open enough to allow companies like Elgato to fully integrate stuff like EyeTV.
That's the kind of innovative thinking we've come to expect from Apple.  Instead, we've got bloated, inflexible creeping featurism of the kind we've come to expect from Microsoft.
Oh, one more thing.  I'm on iTunes 7.1.1 on OS X, and it's crashing more than it did before.  I've had it bomb out a few times while converting videos for iPod.  Not good.
In conclusion, I must say that I still prefer iTunes and iPod to the alternatives... by a long way.  They're just not as good as they could, or should, be.]]></description>
		<wfw:commentRss>http://gidden.net/tom/2007/05/10/itunes-library-regeneration/feed/</wfw:commentRss>
		<slash:comments>-2</slash:comments>
	
		<series:name><![CDATA[iTunes and iPod rant]]></series:name>
	</item>
		<item>
		<title>iPod Video Conversion in iTunes</title>
		<link>http://gidden.net/tom/2007/05/10/ipod-video-conversion/</link>
		<comments>http://gidden.net/tom/2007/05/10/ipod-video-conversion/#comments</comments>
		<pubDate>Thu, 10 May 2007 12:48:14 +0000</pubDate>
		<dc:creator>Tom Gidden</dc:creator>
				<category><![CDATA[Techie]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://gidden.net/tom/2007/05/10/ipod-video-conversion/</guid>
		<description><![CDATA[The kludginess of video conversion for iPod in iTunes is another one of the things "I Don't Like About iTunes and iPod".  I don't like the conversion process, and I particularly don't like the bug I think I've found.

Even before I got an iPod Video, I managed to accumulate a few videos in my iTunes collection.  Mostly music videos, in various formats, but a few other things too.  I've got a few from the iTunes Store, which transfer to the iPod just fine.  However, most are different formats and need re-encoding.
Apple have not made this as easy as they could.

"Movies" and "TV Shows" have their own sections in iTunes, but music videos appear in the music list.  This is inconsistent with the iPod, on which music videos get their own section in the "Videos" top-level menu.
As a result, it's difficult to focus just on the music videos for conversion.  You can use a Smart Playlist, but you don't get full control of the items in a playlist:  for example, you can't delete items without going to the main library list.  This is important later, after conversion.
You can't change the type of a video by bulk editing.  On import, my non-iTunes-purchased videos came up as "Movies" rather than "Music Videos".  To change this (and therefore decide where they appear on the iPod), you have to "Show Info", select "Video" and then change the "Video Kind" dropdown.  This function does not appear in the "Multiple Item Information" window usually used to edit groups of items.  The keyboard shortcuts for this procedure are also non-optimal, and this all translates to a lot of mouse work.
After a track is converted using "Convert Selection for iPod", it is not marked in any way.  The original is not unticked, tagged or labelled.  Instead, you have to look at the kind, such as "QuickTime movie file" or "MPEG-4 video file", and it's possible those are the same.  Otherwise, it's up to the Date Added column.
As the original files aren't disabled, they still trigger the warning dialogue on the next sync, saying that they're incompatible with the iPod.  The originals in my opinion should be unchecked so they don't get synced.  I'd ideally export the files out and then remove them altogether.  However, as there isn't an easy way to select those originals avoiding the converted versions, it's a chore.

Okay, all of those are design flaws.  Fairly annoying ones, too.  I've been of the opinion for a while that both iTunes and iPhoto were great packages in their day, but are in dire need of redesigns and rewrites.  They've lost their simplicity and elegance.  They're bloated.
The next thing, however, is a bug, demonstrated by this screenshot.  A number of the converted videos appear with blank names and artists on the iPod.  They play fine, but they're just not there.
In addition, it's also made the band's Music Videos entry appear six times:  three with the correct name, and three with a blank.  All six menus contain the same items, as above.
Upon investigation, all of these files are named fairly oddly.  They appear fine in the Show Info "Info" panel, but on the "Summary", there's a quirk:  the names are spaced out, and the file path has alternating underscores.  Checking the file paths and the iTunes Library XML file gives similar results:
I've seen this kind of thing before.  It looks like it's almost definitely a Unicode interpretation error.  As with most other modern string-handling APIs, NSStrings inside OS X (Cocoa) are stored with (at least?) two bytes per character, rather than the old-style one byte per character.  It's easy to make the mistake of failing to convert this back and assume one byte per character.
In the example above, the artist name -- R&#246;yksopp -- is clearly not plain ASCII, so I wouldn't be surprised if the programmers of iTunes's conversion interface failed to test for this problem.  However, I did also encounter the problem with some videos with plain English names and artists, too: my copy of Leonard Nimoy's "The Ballad Of Bilbo Baggins" also came up blank.
To fix this problem, I just went into each item's "Show Info" in turn and retyped the names.  Fine for the few items I imported, but not if I'd had any more.
I think Apple's point with all of this is that you should buy all your videos from them.  Mine mostly came from "enhanced limited edition" CDs instead.
Incidentally, in the shots above, you might notice two different versions of the incredible "Remind Me" video by R&#246;yksopp.  I've discovered that there are (at least) two subtley-different versions of this video, and the one on the iTunes store isn't quite as good.  Apart from the gratuitous cartoon boobie shot, the non-iTunes version has a couple of little hidden jokes in the background, and a few more scenes.]]></description>
		<wfw:commentRss>http://gidden.net/tom/2007/05/10/ipod-video-conversion/feed/</wfw:commentRss>
		<slash:comments>-3</slash:comments>
	
		<series:name><![CDATA[iTunes and iPod rant]]></series:name>
	</item>
		<item>
		<title>Mac Flight Tracker widget timezone bug</title>
		<link>http://gidden.net/tom/2006/08/10/mac-flight-tracker-timezones/</link>
		<comments>http://gidden.net/tom/2006/08/10/mac-flight-tracker-timezones/#comments</comments>
		<pubDate>Thu, 10 Aug 2006 20:54:07 +0000</pubDate>
		<dc:creator>Tom Gidden</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Techie]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bdt]]></category>
		<category><![CDATA[bst]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[flight-tracker]]></category>
		<category><![CDATA[flighttracker]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Mac-OS]]></category>
		<category><![CDATA[Mac-OS-X]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[nsdate]]></category>
		<category><![CDATA[OS-X]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[os_x]]></category>
		<category><![CDATA[tiger]]></category>
		<category><![CDATA[timezone]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://gidden.net/tom/2006/08/10/mac-flight-tracker-timezones/</guid>
		<description><![CDATA[The Flight Tracker dashboard widget that comes with Mac OS X 10.4 (Tiger) seems to have a fairly major bug.  However, this bug seems to be the result of something quite obscure to do with timezones, and it only seems to manifest itself in the UK during the summer.

I've noticed this problem a few times:  specifically whenever any one of my close friends or family members flies anywhere.  This time, my mother is on her way back from San Diego to Bristol via Newark.  Thanks to the incredibly annoying terrorist attack attempt today, my dad and I were understandably concerned about flight delays, so I pulled up the Flight Tracker.  Unfortunately, the information seems completely wrong.
Turns out, the minutes are right but the hours don't relate to any of the relevant timezones.
Anyway, a little background.  Here in the UK, we have two main time scenarios:  firstly GMT, which is for all intents and purposes, UTC.  We also use BST:  "British Summer Time" which is UTC+1h, and kicks in for archaic agrarian reasons and the "Think of the children!" brigade who are convinced it'll stop traffic accidents.
While the rest of OS X seems okay and correctly uses BST, Apple's Mail.app has always strangely listed incoming mail as being sent relative to "BDT", which comes out as "British Daylight Time", which is fairly meaningless as there's no such thing.  The times are correct, but they just have the wrong abbreviation afterwards.  On researching it, this seems to be the result of bad data from the Unicode people which might have made its way into NSDate.  Anyway, it's usually just a cosmetic thing, and of little or no consequence.
I believe, however, that it's the cause of the Flight Tracker widget's problems.  To test this, I altered the widget to display the timezone, by replacing the bit in FlightTracker.js, in function formatDateForDisplay() that says
var timeStr = date.toLocaleTimeString("short");
with
var timeStr = date.toLocaleTimeString("long");
This reveals that the times are supposedly in "BDT".  I believe this might be the problem.  I think something is reinterpreting this as "Brazilian Daylight Time", which would explain the weird offsets.  I think JavascriptCore or something is referring to the same bad data as Mail.app, probably via NSDate.  I'm not a Safari hacker, and I haven't really investigated that far, so I'm not sure where the problem is.
Looking a bit deeper into FlightTracker.js, I'm not really surprised there's a problem.  The timezone calculation code is fairly messy, with comments such as:
// We're going to be stupid and hard coded about parsing the server provided date strings for now
// ??? for some reason parseInt returns 0 on this but parsefloat works ???
and
// here we do proper handling of the timezone offsets.
// We enter everything in pretending it's UTC time
// and then we convert it to miliseconds since 1970,
// add the timezone offset in miliseconds to it
// and then set this as the new UTC time
There seems to be some string hacking going on at several places to decode the data sent from FlyteComm.  The original data is reasonably well structured, with the timezone offsets being given correctly as -0700 and +0100, which presumably indicate that the times are given as local times of the departure/arrival locations, as per normal for the airline industry.
I'm not completely sure what's going on, as I'm not really set up to debug someone else's widget, especially one with weird custom controls, and barely any code comments.  It's obvious to me that the widget isn't particularly well written, and is one of those things that "just works".  It was probably hacked up for fun by a Dashboard developer, and then fasttracked to the nearest Steve Jobs keynote rehearsal.  As Steve Jobs's Dashboard demos tend to be done at MWSF and WWDC, I doubt this problem has ever really been seen at Apple.  I bet if it was a problem with Pacific Daylight Time being misinterpreted, it'd be fixed immediately!  I've done a little bit of googling, and it looks like the BDT bug has already been submitted to Apple (several times), and it's still there.
When I get a chance, I may try to debug this one further, and perhaps rewrite FlightTracker's timezone code properly using the correct offsets rather than performing nasty magic using getLocaleTimeString().
What I would prefer is that the timezone of each time is given next to the time.  Ideally, they should toggle-on-click or slowly fade between local times (to the flight) and local times to the machine, and possibly relative times ("1 hour ago", "in 53 minutes", etc.)  That would make the tool a lot more intuitive anyway.  I'd rather not reinvent the whole widget, as in all other ways, the widget's really not too bad.]]></description>
		<wfw:commentRss>http://gidden.net/tom/2006/08/10/mac-flight-tracker-timezones/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
