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.