Archive for January, 2008
1/29 iCal timezones are wrong (5)
A bit ranty, proceed.
The designers of iCal did it wrong. I applaud them for including timezone support at all because of the can-of-worms I envision it being. Dates are scary in the parsing sense. For the uninitiated, here’s about how iCal works now:
You can enable timezone support (rightfully off by default as it adds clutter that 90% will never click) in Preferences and then have an editable timezone option for every event on your calendar. This part will be strange in text but I’ll try: changing the timezone on a single event will cause that event’s block of time (in week view or day view) to shift up or down by the offset between your home timezone and the event timezone. Easy-to-follow example: an event in St. Louis (Central Time) at 10:00 am appears at 8:00 am on my calendar because I’m in Pacific Time.
The right way is to allow setting entire days to a certain timezone. Perhaps this setting would be inferred from a multi-day event on your calendar or (bonus!) a feed imported from Dopplr? Tying a timezone to a multi-day event would be sweet as it could be expanded to start and stop at certain times of day, thereby satisfying even the craziest of travellers. Assuming this default would eliminate my need to micromanage my calendar.
Benefits? I could say (to my computer, with mouse clicks), “I will be in the Central timezone from February 1st until February 9th, please show those day’s events accordingly.” If an event is scheduled on a day that I’m slated to be in the Central timezone, it should always be shown as if it is in the Central timezone. Displaying everything in the current timezone just makes me do extra math.
The tradeoff in design here is day-to-day consistency versus the rate at which I can consume information from my calendar. I can understand why Apple’s designers made the decision they did but respectfully disagree. It is much easier to casually remember where I’ll be at any given time (in the macro sense) but much more difficult to remember that I must constantly do timezone math when looking ahead on my calendar.
1/22 Please don’t X-UA-Compatible me like that (6)
The echosphere is making quite a stink about Microsoft’s proposed X-UA-Compatible header to explicitly match HTML pages to rendering engines. There are two possible outcomes, assuming Microsoft goes ahead and implements this HTTP disaster. More likely is that we will be roughly where we are now, with special cases to make IE do what we want and other browsers just working reasonably correctly by themselves. Less likely is that the Redmond dream will be realized and every browser will become a time capsule of rendering engines ready to happily consume whatever 1997 garbage you can throw at it. Oh yeah, if you add the header to all of those ancient pages.
For maximum effect, X-UA-Compatible requires the support of the other browser vendors, otherwise it is just another Microsoft hack with a pretty mask on (read: no regular expressions). (Aside: The ideal solution to problems like the old broken box model would have been to fix it immediately instead of six years later. I can’t help but think that X-UA-Compatible would never have been proposed had that bug not persisted for so long.) In this best-case scenario the cynic in me still sees ignorant developers either omitting this header or setting it only for IE, leaving other browsers to do … something. If the header is set for all of the major vendors (and we’ll just assume that those major vendors will still be the only major vendors down the road) then I must admit, browser bloat is the biggest concern we have. I for one don’t want my Firefox to get any bigger. Just imagine the new and exciting memory leaks!
In the (I think) more likely case of Microsoft pushing ahead with this feature alone then developers have the slight advantage of being able to code to one version of IE instead of several, in addition to Firefox/Webkit/Opera. This may prove to be useful in fixing those sites that IE7 broke. But seriously, why haven’t those already been fixed?
Ultimately, it all comes down to what browsers do if that header isn’t sent or they aren’t paying attention to it at all. It sounds like Microsoft is content to leave everything its IE7 state forever unless told otherwise but I doubt anyone else will be keene on the idea. Microsoft is a much bigger fan of backwards-compatibility than Apple (think Classic Mode) or Mozilla (each new version of Firefox breaks all of my extensions) so I expect to see these others defaulting to their cutting-edge browser unless told to retard themselves. This most-important point of the whole feature is summed up best by Jeremy Keith, “Unless you explicitly declare that you want IE8 to behave as IE8, it will behave as IE7.” I’m a desktop software developer by day and wish I could say to Windows, “Make this app work just like an out-of-the-box Windows XP installation.” I can’t because having such a ridiculous level of backwards-compatibility ultimately makes software too big and unwieldy — it hurts you in the long run. I hope, when framed in the desktop version that the insanity here shows through.
My final thought on the matter is that the best thing Microsoft can do for the future is to push IE7 out to everyone. Like pulling off band-aids, it’s best to do these things fast and deal with the consequences all together. Fixing the IE box model should not take seven years. Get it over with and move forward without the hacks.
Elsewhere:
1/22 wp-screenshots plugin (6)
Ever wanted Wordpress to display small screenshots of pages you’re linking to like the del.icio.us homepage? Neither have I but a friend wanted it and I wanted to build a Wordpress plugin, so here it is.
wp-screenshots takes the URL of a del.icio.us RSS feed as input and gives back a <ul> containing thumbnails from the unofficial Snap API.
Installation is as easy as running svn co http://svn.rcrowley.org/svn/wp-screenshots/ ./ in your wp-content/plugins/ directory. You can then use the PHP function screenshots() anywhere in your templates. As a bonus, if you setup wp-screenshots.php to run as a cronjob, it’ll understand what’s up and just hit the proper image URLs to make sure Snap’s cache is primed for your page views.
1/14 When you can’t statically link, manifest (3)
Manifest (verb): To embed XML describing libraries which are expected to be available at runtime, done in the course of developing software using Microsoft Visual Studio.
The wisdom of the collective T-Rex (#xulrunner on irc.mozilla.org) says that statically linking against the Microsoft C Runtime (msvcr80.dll and friends) is the way to go. However I’ve run into a case where I cannot do this (deciding whether this is due to technical limitations or lack of competence is for readers to help me decide).
The image processing component of the Flickr Uploadr links against GraphicsMagick and Exiv2, libraries that do image processing and EXIF/IPTC metadata processing, respectively. Without them, it doesn’t fly. Problem is, they both link the C Runtime themselves by using std::string and such. Both of these libraries will build fine given the /MT flag, which instructs them to statically link the C Runtime. When they themselves are statically linked into the XPCOM component later, all hell breaks loose. It seems that the static linker can’t resolve the duplicate definitions caused by overzealous static linking.
The solution, as it stands, is simply to include the C Runtime and its manifest in the distribution. Placing the following files in Uploadr’s components/ directory has allowed life to go on for the moment.
msvcr80.dllmsvcp80.dllmsvcm80.dllMicrosoft.VC80.CRT.manifest
Lastly, make sure your XPCOM project in Visual Studio is set to embed its manifest from Project Properties » Manifest Tool » Input and Output » Embed Manifest.
A more optimal solution might be to combine the Visual Studio projects for GraphicsMagick (and therefore libjpeg, etc), Exiv2 and the XPCOM component into one large tree that Visual Studio might be able to better manage. Has anyone out there done such a thing with Microsoft’s static linker (even if not with XULRunner)?