Archive for April, 2010

Ugly software

I’ve gone through multiple motherboards, multiple audio chipsets, and the associated software seems to just keep on getting worse. This is the VIA HD Audio Deck in my latest motherboard:

VIA HD Audio Deck

VIA HD Audio Deck

Functionally, yes, it works, but there isn’t even at attempt at any sort elegant layout or UI here – it’s difficult to navigate and an eyesore to look at. Sadly, judging by the custom widgets, it seems a significant amount of work actually went into creating this monstrosity.

Stop Crying

From robots with feelings,

stop crying

XML DOM object to string conversion

One of those simple things which has eluded me for far too long. I finally found the solution here:

var string = (new XMLSerializer()).serializeToString(xmlobject); alert(string);

While the above is good to know, I’ve also discovered I don’t need it. I was looking to convert an XML DOM object, from an AJAX call, to plain text, but the XMLHttpRequest.responseText property provides just that. For jQuery users like myself, the XMLHttpRequest can be access via a synchronous jQuery.ajax call as the return value, or asynchronously via. the jQuery.ajax.complete callback or the jQuery.ajax.success callback (as of jQuery 1.4 the XMLHttpRequest object is now the third parameter).

File.OpenRead, FileShare issues

The following piece of C# code to open a file for reading (an MS Word document, opened by Word), generated an IOException.

FileStream fs = System.IO.File.OpenRead(oldFullPath);

The IOException:

The process cannot access the file ... because it is being used by another process.

Not too unusual, but curiously, the following code, to do the same same thing, did not generate any exceptions and the file was read successfully.

FileStream fs = System.IO.File.Open(oldFullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

I’d always assumed that File.OpenRead() was equivalent to the File.Open() call above.
Bad assumption.
It looks like the FileShare flag is set to FileShare.Read not FileShare.ReadWrite by File.OpenRead().

Note that the FileShare flag is a bit misleading as described by the docs, it doesn’t only apply to subsequent operations. Here’s a good explanation by Darin Dimitrov from stackoverflow:

In the case of future openers, a FileShare.Read means “future openers can open the file for reading”. In the case of past openers, FileShare.Read means “open this file for me only if it has past openers that opened it for reading only”. That’s why FileShare.ReadWrite needs to be used here, because Excel opens the file for writing.

Multitouch

I came across the following video of a toddler using an iPad for the first time. It’s amazing to watch and see how quickly she is able to acclimate to the touchscreen interface and navigate to and launch the apps she wants. I certainly haven’t seen kids able to do this with the traditional mouse/keyboard combo much less a touchpad on a laptop or netbook.

This is exactly the reason I was optimistic for the JooJoo … and why I’m optimistic for the iPad and the HP Slate, and touchscreens in general … it’s the touch-based user input which is poised to radically reshape and simplify the personal computing experience.

The accompanying blog post at laughing squid provides a nice write-up and analysis of the UX experiment. The concluding remarks are interesting:

Most of all, though, it’s cool to consider that as one of the new Children of Cyberspace, her expectations about computing will be shaped by the fact that she’s growing up in a touchscreen world.

The video along with this remark instantly reminded me of the TED conference where Jeff Han presented his multitouch interface and expressed his disappointment, in regards to the $100 laptop, of introducing a new generation to computing with the standard mouse and pointer interface.

It’s also amazing to remember seeing this video is 2006, where multitouch seemed like some conceptual idea that would never find its way into any real consumer-level product – only about a year later the iPhone was introduced.

Collateral Murder

The WikiLeaks video showing the unprovoked killing of over a dozen people in the the Iraqi suburb of New Baghdad. Among the dead were 2 Reuters news staff members, Namir Noor-Eldeen and Saeed Chmagh.

The corresponding NYTimes article on the incident.

From the Times article, it’s clear that the military clearly tried to cover to this up,

The American military said in a statement late Thursday that 11 people had been killed: nine insurgents and two civilians. According to the statement, American troops were conducting a raid when they were hit by small-arms fire and rocket-propelled grenades. The American troops called in reinforcements and attack helicopters. In the ensuing fight, the statement said, the two Reuters employees and nine insurgents were killed.

“There is no question that coalition forces were clearly engaged in combat operations against a hostile force,” said Lt. Col. Scott Bleichwehl, a spokesman for the multinational forces in Baghdad.

There was no raid, no small-arms fire, no RPG. In fact, there was no fight, as all the bullets came from the Apache.

This also very much bring into question what the rules of engagement are in Iraq and to what degree they’re being followed, as the debate always seems to be centered on how restrictive the ROE are, whereas, in this case, simply having an AK-47 (not necessarily uncommon in this part of the world) was sufficient cause to engage.

h/t to reddit for being the only site I’ve seen that mentioned the video. CNN only recently picked it up.

Dress codes

At the Mana Bar in Austrailia, which is co-owned by Ben “Yahtzee” Croshaw (the guy who does Zero Punctuation, for those too lazy to click the link).

mana bar dress code

Would be awesome to have something similar in New York.