From Dapper to Edgy

I upgraded my Dell 8600 laptop from Dapper to Edgy tonight. I waited a bit because I've heard a lot of problem reports, and as a developer, I tend to trick out my machine config, and tricked out machine configs are usually especially vulnerable to upgrade problems. I do want to take a moment to mention that people who label any complaint about the upgrade process as F.U.D. are quite out of order. Your upgrade might have gone smoothly, but that does not invalidate warnings fro folks whose upgrades didn't. These people are doing a valuable service by making users cautious about any upgrade. That having been said, my own upgrade has been very smooth so far. Herein a few notes others might find useful.

I prepped the install by following the suggestion on this SlashDot thread. I ran a query for packages no longer available from any of my repositories:

apt-show-versions | awk '/No available/ { print $1 }'

Then after inspecting the results and not finding anything I was desperate to keep, I nuked them all:

apt-show-versions | awk '/No available/ { print $1 }' | sudo xargs dpkg --remove

I did have to install the apt-show-versions command first. Then I just followed the official upgrade instructions. The first attempt aborted with

Error during update...A problem occurred during the update. This is usually some sort of network problem, please check your network connection and retry.

It turned out that I had stuff in /etc/apt/sources.list that has become unavailable (stuff from Penguin Liberation Front and Cipherfunk). I just edited the file and uncommented the problem lines, but I think they need to fix how the installer handles this situation. A newbie might indeed think he has a problem with his network, and go on a wild goose chase. The error message should at least mention the possibility that certain remote repositories are having trouble, and maybe even offer to disable the problem repositories for the user. As for the PLF stuff the instructions suggest touching up the sources line to:

deb http://packages.freecontrib.org/ubuntu/plf/ edgy-plf free non-free

My first impression of the new version is that it looks even nicer than Dapper. I'm deciding whether I like the aggressive anti-aliasing in gnome-terminal. I don't mind AA in general, but something about a terminal or programming editor makes me prefer sharpness over slickness. The new fonts are definitely slick in Firefox.

I'm yet to upgrade all the multimedia/non-free stuff. I let the upgrade nuke all that (something I highly recommend). I used to use Automatix (check that slick new Web site), but these days the restricted formats Wiki is good enough for me not to need any magic tools.

Based on my positive experience (so far), I'll upgrade my main desktop tomorrow. Thanks, as always, to the Ubuntu folks.

[Uche Ogbuji]

via Copia

First Board 2006/7

Got out to Keystone with Osita (playing hooky) Charles, Dawn and Melette. Keystone was just opening and conditions were hardly as sweet as last year's first trip, but then again that was three weeks into November, rather than the 3rd day. My knee is in better shape this year, but still not at full strength.

It was mad crowded, with only Montezuma lift open (no trails open below that mid-mountain point and we had to down-load at the end), but there were a few modest powder stashes to be found. Early season snowfall this year has been promising, and it might well be as lovely a season as the last. Looking out to Keystone's second peak, it was looking pretty close to fit. Copper claims they have top-to-bottom open, so that might be my second trip.

After the debacle of the crap digicam from last year I think I'm going to spring for a good helmet-cam (seems they run about $350 or so). If anyone has any suggestions for a good model, I'd be grateful. If it is going to be another epic season, I gotta get into some vid-blogging.

[Uche Ogbuji]

via Copia

Amara 1.2 goes alpha, and other developments

First of all 4Suite went 1.0 rather quietly because the day job schedule has left room for very little besides quiet releases. It's probably just as well because by common standards 4Suite has been 1.0 grade for years. Under any less conservative version numbering scheme it would be 4Suite 3.0 by now.

I'm pushing Amara to 1.2 (a more typical progression of version numbers in that case) and after a developers-only alpha, we've released alpha 1.2a2 publicly, but quietly. As I've hinted before I have a lot of ideas for Amara post 1.2. The next major branch will be a full rewrite, probably to be released as Amara 2.0. Anyway, see the draft for the 1.2 full release announcement.

I also put together a quick start recipe for Amara on Ubuntu, and Luis Miguel Morillas has one for Windows users in Spanish. He says he'll be translating it to English soon, and when he does, I'm sure he'll link it from his "Amara Installers for Windows Users" page.

[Uche Ogbuji]

via Copia

“Real Web 2.0: Bookmarks? Tagging? Delicious!”

“Real Web 2.0: Bookmarks? Tagging? Delicious!”

Subtitle: Learn how real-world developers and users gain value from a classic Web 2.0 site
Synopsis: In this article, you'll learn how to work with del.icio.us, one of the classic Web 2.0 sites, using Web XML feeds and JSON, in Python and ECMAScript. When you think of Web 2.0 technology, you might think of the latest Ajax tricks, but that is just a small part of the picture. More fundamental concerns are open data, simple APIs, and features that encourage users to form social networks. These are also what make Web 2.0 a compelling problem for Web architects. This column will look more than skin deep at important real-world Web 2.0 sites and demonstrate how Web architects can incorporate the best from the Web into their own Web sites.

This is the first installment of a new column, Real Web 2.0. Of course "Web 2.0" is a hype term, and as has been argued to sheer tedium, it doesn't offer anything but the most incremental advances, but in keeping with my tendency of mildness towards buzzwords I think that anything that helps focus Web developers on collaborative features of Web sites is a good thing. And that's what this column is about. It's not about the Miss AJAX pageant, but rather about open data for users and developers. From the article:

The substance of an effective Web 2.0 site, and the points of interest for Web architects (as opposed to, say, Web designers), lie in how readily real developers and users can take advantage of open data features. From widgets that users can use to customize their bits of territory on a social site to mashups that developers can use to create offspring from Web 2.0 parents, there are ways to understand what leads to success for such sites, and how you can emulate such success in your own work. This column, Real Web 2.0, will cut through the hype to focus on the most valuable features of actual sites from the perspective of the Web architect. In this first installment, I'll begin with one of the ancestors of the genre, del.icio.us.

And I still don't want that that monkey-ass Web 1.0. Anyway, as usual, there's lots of code here. Python, Amara, ECMAScript, JSON, and more. That will be the recipe (mixing up the ingredients a bit each time) as I journey along the poster child sites for open data.

[Uche Ogbuji]

via Copia

The Prestige-digitation

No spoilers. I watched The Prestige yesterday. Despite the hypesters flogging The Grudge 2 and Saw 3, I'll say that the best horror movie likely to come out this year is this tale of fevered magicians. I haven't had nightmares about a movie since my J-Horror month, but The Prestige made for a wigged out night. I'm pretty sure the filmmakers entirely knew what they were doing, too. Henry James has nothing like any of the "yet another turn of the screw" that's scattered through the story of these characters.

And out-doing The Turn of the Screw is exactly what the movie is about. It's a modern gothic. I used to have fun reading the Victorian macabre, largely to marvel at a completely alien category of horrors. Modern Hollywood ghosts are go about chopping random people into bits (off-hand example: 13 Ghosts) That's never really done much for me. My fun few weeks with the J-Horror classics were all about the menace of physical harm. I once mentioned the interesting contrast between J-Horror and traditional Japanese myth, in which most of the spectral plane was concerned with the menace of conscience rather than physical harm (I should mention that after writing that I did encounter a J-Horror piece: The Eye 2 that more closely followed the traditional Japanese role of ghosts). There's a large tradition of the same in the Western tradition as well, but especially in Victorian times, and in the fullness of Victorian mores, the greatest menace of the supernatural is in the moral corruption of the living (off-hand example: the succubus). Henry James's great "turn of the screw" was that evil enough specters could even corrupt the most innocent of creations. Right. I watch kids shoot up their classrooms on the news every now and then, so I suppose I'm not best conditioned to react to all that.

So if to some extent we moderns are jaded to traditional horrors, what's left to really perform the combination minatory and titillating task of horror? Nothing less than the fundamentals of story-telling. Plot, setting, character, combined with the fundamentals of drama: catalyzing performance. A good Lady MacBeth can give you the heebie jeebies, even though you know that all her result will be run-of-the-mill massacre. Shakespeare has the plot, setting and character on lock. All he needs for midwife of terror is a gifted actress. The terror is not in the ghosts and witches Shakespeare uses as agents and signals, but rather in how you can recognize in his people the extremities of your own tendencies.

There are no ghosts, witches or anything quite like that at all in The Prestige, but the writers got the plot, setting and character finely tuned. They found one perfunctory main performance in Jackman, one serviceable one in Bale, and happily a host of gob-smacking brilliant supporting performances across the board. Seriously, it's as if the casting folks said "OK we got Jackman and Bale, which shouldn't be awful, but whom are we going to plug in to truly electrify this spectacle?" (Electrify. Ha ha. Get it? electrify... oh, you haven't watched the film yet? Never mind, then...) The performance of the two leads prevents the film from being a masterpiece. True obsession carries with it a menace of its own, and the leads are not quite capable of marshaling that menace. They conduct themselves with the smirking attitude of schoolboys pranking each other. Maybe the director asked them to act cavalier. That's a legitimate way of intensifying malevolence, but it does not suit these characters, or at least the actors haven't pulled it off. The atmosphere is saved by those superb supporting actors, some of whom you know and some you probably don't. These created in their own reflection of the main characters, and in their own smaller crimes the Lady MacBeth effect that Jackman and Bale couldn't quite themselves manage.

The idea of the plot is to take turns shocking you with the perversity of each of the magicians, and worse yet to have you sometimes urging one of them on because you are so appalled at something the other had done, and then reversing that bias. In the end, I was not readily able to choose which set of consequenses turned out most intolerable. The film is clearly set up to inform you who is the worst villain, but I'm not sure I buy that part of the package. Part of my reasoning lies in three sentences of accusation Sarah directs at her magician husband (I doubt I have the wording just right).

You say you love me but some days you don't mean it. That makes it more precious the days that you do.
...
Today you really do love me. That makes it more unbearable the days that you don't.
...
I just want the truth from you. No tricks. No Lies. And no secrets.

The effect of these words at the times they are spoken, and the rebounded effect of the words as the plot twists unfold quite haunts me. The film sets this up to provide a mini-climax of a shock at the end, to warm you up for the supposedly greater shock to follow. Again I think in terms of their impact I might have had the revelations the other way round. I can readily see enough of myself as Sarah's accused even though her man's sins are far worse than the usual husband's portion of occasionally tuning his wife out or forgetting an anniversary date. The film weaves in the War of the Currents between Edison's invention and Tesla's as another backdrop of obsession and rivalry. It exaggerates that historical chapter in some ways and understates it in others, but the effect for anyone who can admire the genius of those two inventors is to underscore the accusation of the film. We all think we're just good people working our way through life, and the film gives you the inkling of the important question: "Are you really?" That's the sort of reflection that you don't often get from a film these days, which is why despite its flaws I highly recommend The Prestige.

[Uche Ogbuji]

via Copia

Alternate HTTP representations for wifey (or grandma) A.K.A. in-a Webba stylie

I found Ryan Tomayko's How I Explained REST to My Wife very clever and amusing, but one bit left me begging for more imagination.

Ryan: Actually, representations is one of these things that doesn't get used a lot. In most cases, a resource has only a single representation. But we're hoping that representations will be used more in the future because there's a bunch of new formats popping up all over the place.

Wife: Like what?

Ryan: Hmm. Well, there's this concept that people are calling Web Services. It means a lot of different things to a lot of different people but the basic concept is that machines could use the web just like people do.

Ay-ay-ay. I don't know any non-techie who would be satisfied with such an explanation. And I think the idea of alternative representations is one of the least geeky ideas Ryan is trying to communicate to his wife, so it seems a slam-dunk for a more interesting example.

My wife knows that if she goes to http://tvguide.com on her computer she gets a listing of the TV channels in a table on the Web page. What if our TV suddenly gained Web capabilities? When you went to http://tvguide.com on the TV you should probably get the live feed for the TV Guide preview channel, the one with a scrolling list on what's on each channel of the boob tube. Of course, since it's a Web-stylie TV, forget channel numbers. Each item in the list should be a link you can just actuate with your remote. Click to jump to, say http://www.vh1.com/channels/vh1_soul/channel.jhtml when you saw that the new John Legend video was playing. And you'd get the live channel there, since it's a Web-stylie TV, rather than the Web page bragging about the video. So there you go: live TV as an alternative representation of the resource. And you know that wifey's going to get any example that includes John Legend (OK, for some wives substitute Justin Timberlake).

If your phone were a web-stylie phone, you could go to http://tvguide.com (better have that on speed dial) and have some robot voice reciting the "what's on now" for the channels. And so the audio message is an alternative representation of the resource. Oh, and going a bit Jetsons with the whole thing, if the TV Guide site started throwing up 404s on your web-stylie TV or phone, and you wanted to go to the office to give them a piece of your mind in person, you could hail a web-stylie taxi cab and tell it http://tvguide.com and, you guessed it, you'll be whisked to headquarters. But pay attention, now, the representation of the resource is probably not the destination building, in this case, but rather the street address or directions to that location as retrieved from the URL http://tvguide.com in the web-stylie cab. Or something like that.

Now we're talking alternative representations. Rather than remembering the channel number, hot-line phone number and physical location for TV Guide, it's all available web-style from the URL http://tvguide.com. Of course, as long anyone needs to deal with "aitch-tee-tee-pee-colon-slash-slashes" ain't no way this scenario is playing out in real life. But then again neither is Ryan's example--Web services. Oooooh!

[Uche Ogbuji]

via Copia

Quick grab of XHTML metadata

I recently needed some code to quickly scrape the metadata from XHTML Web pages, so I kicked up the following code:

import amara

XHTML1_NS = u'http://www.w3.org/1999/xhtml'
PREFIXES = { u'xh': XHTML1_NS }

def get_xhtml_metadata(source):
    md = {}
    for node in amara.pushbind(source, u'/xh:html/xh:head/*', prefixes=PREFIXES):
        if node.localName == u'title':
            md[u'title'] = unicode(node)
        if node.localName == u'link':
            linkinfo = dict([ (attr.name, unicode(attr))
                              for attr in node.xml_xpath(u'@*') ])
            md.setdefault(u'links', []).append(linkinfo)
        elif node.xml_xpath(u'self::xh:meta[@name]'):
            md[node.name] = unicode(node.content)
    return md

if __name__ == "__main__":
    import sys, pprint
    source = sys.argv[1]
    pprint.pprint(get_xhtml_metadata(source))

So, for example, scraping planet XML:

$ python xhtml-metadata.py http://planet.xmlhack.com/
{u'links': [{u'href': u'planet.css',
             u'media': u'screen',
             u'rel': u'stylesheet',
             u'title': u'Default',
             u'type': u'text/css'},
            {u'href': u'/index.rdf',
             u'rel': u'alternate',
             u'title': u'RSS',
             u'type': u'application/rss+xml'}],
 u'title': u'Planet XMLhack: Aggregated weblogs from XML hackers and commentators'}

[Uche Ogbuji]

via Copia

Urlacher! Urlacher! Urlacher!

I usually talk the real football on Copia, because it's my favorite sport, but I also like the other football, and I just finished watching one of the most amazing NFL games I've ever seen. The much-hyped Chicago Bears versus the much-maligned Arizona Cardinals. I really like the Bears, even though I have more ties to Green Bay Packer country (I did spend a year working in Chicago and a couple in Peoria). I like them because of the character they show on defense even though they haven't had a useful offense since their SuperBowl glory days in the mid-80s. No one embodies that character like Brian Urlacher. I remember a few years ago seeing an interview with Ray Lewis, another great defender, preparing to play Chicago. Lewis probably knew his Baltimore Ravens would cream the Bears, who were really struggling then, but he still pointed at Urlacher on the scouting video and said "There goes a future hall-of-famer. Stay strong, baby".

That's the sort of respect Urlacher earns with plays such as his stripping, out of nowhere, of Edgerrin James, a pro-bowl running back, when it seemed his team had no hope of beating the Cardinals, up by two scores. His teammate picked up the fumble and ran it in for one score, and after the Chicago defense went right back on the field to force a three-and-out, their special teams made up the other score with an electrifying punt return by Devin Hester. I was jumping up and down as if Arsenal had scored on Man U. Arizona had gone into half-time ahead of the Bears 20-0, and their defense and offense both looked rampant. The Bears' defense seemed to wait until almost the fourth quarter before showing up for the game, and it's just astonishing that one quarter is all they needed to completely reverse the field on the Cardinals for the win. It's hard to say a team that's capable of doing that is not a SuperBowl favorite this year. It's a well-dusted analysts saying in World Football: the greatest teams are those who find ways to win when they're playing poorly. That applies to any sport, as the Bears proved again today.

I will say that one thing Dick Butkus has over his prodigious successors us that his name is a lot easier to chant than "Singletary" or "Urlacher".

[Uche Ogbuji]

via Copia

Today's XML wot he said

...simple - just don't use script in XSLT unless you really really really have to. Especially on the server side - XSLT script and ASP.NET should never meet. Use XSLT extension objects instead. As simple as it is.

Oleg Tkachenko—"XSLT scripting (msxsl:script) in .NET - pure evil"""

Amen, f'real. When XSLT 1.1 first emerged the first thing that jumped out from the spec and punched me in the face was the embedded script facility. I made a fuss about it:

In general, I think the re-introduction of xml:script is execrable. XSLT 1.0 had perhaps the most elegant extension model possible, and xsl:script ruins this by destroying the opacity of extensions to XSLT processors. Language bindings may make sense in the realm of CORBA or DOM, where the actual expression of the program is done in the bound language, but XSLT is XSLT, and introducing the need for language bindings only reduces general interoperability while giving a small boost to interoperability between small axes of implementations.

I even worked with some like-minded folk to put together a petition. I have no idea whether that was instrumental in any way, but soon enough XSL 1.1 was dead and replaced with XSLT 2.0, which was built on XPath 2.0 and thus had other big problems, but at least no xsl:script.

xsl:script does live on in some implementations, and notably MSXML, as you can see from Oleg's post. You can also see some of the problems. XSLT and many more general-purpose languages make for uncomfortable fit and it can be hard for platform developers and users make things work smoothly and reliably. More important than memory leaks, script-in-xsl is a huge leak of XSLT's neat abstraction, and I think this makes XSLT much less effective. For one thing users are tempted to take XSLT to places where it does not fit. XSLT is not a general-purpose language. At the same time users tend not to learn good XSLT design and techniques because they scripting becomes an escape hatch. So an script user in XSLT generally cripples the language at the same time he is over-using it. An unfortunate combination indeed.

Oleg advocates XSLT extensions rather than scripting, which is correct, but I do want to mention that once you get used to writing extensions, it can be easy to slip into habits as bad as scripting. I've never been tempted to implement a Python scripting extension in 4XSLT, which would be easy, but that didn't stop me from going through a phase of overusing extensions. I think I've fully recovered, and the usage pattern I definitely recommend is to write the general-purpose code in a general-purpose language (Python, C#, whatever) and then call XSLT for the special and narrow purpose of transforming XML, usually for the last mile of presentation. It seems obvious, and yet it's a lesson that seems to require constant repetition.

[Uche Ogbuji]

via Copia