Showing posts with label tech. Show all posts
Showing posts with label tech. Show all posts

Sunday, December 23, 2007

The One Laptop Per Child XO


My wife bought a One Laptop Per Child (OLPC) XO box under the Give One Get One (G1G1) program. You have probably heard about the project. The idea is to provide small, extremely inexpensive laptops to children throughout the developing world. There has been a vigorous debate on whether this is a good idea or not; whether it is better to spend $200 per child on a laptop or on a cow. I am not going to address that question, because I don't know enough about it. I am just going to give my impressions of the box as a work of engineering. The box only arrived a few days ago, so these are first impressions.

To summarize: Wow!

Apple is no longer the only game in town in the area of innovative PC design. The OLPC project rethought the PC from the ground up. The particular constraints of their target users forced some novel design decisions, but many of these innovations are equally applicable in many other situations. I hope other computer makers (including Apple) are paying attention.

Most laptops, no matter how small, are heavy for their size. The XO is unexpectedly light. Not that it feels delicate or fragile. Its skin is a pretty rugged plastic. When it is closed, the screen and all the data ports are protected. It has a sturdy plastic handle. It feels like it can handle being treated casually.

What makes the XO lightweight, of course, is what it is missing. It has no hard disk, no CD-ROM. It has a relatively slow processor. It has a pretty small LCD display (7.5 inches, but, 1200×900 pixel so lots of detail). Since it is missing all these things, it needs no fan. And, voila, a lightweight rugged little go anywhere box.

But, missing all those heavy fragile accouterments of a modern laptop, the XO has plenty of features. A microphone and camera are embedded in the screen. The battery is lightweight, contains no toxic materials (indeed the whole box is pretty eco-friendly), and can be charged with a hand crank or a solar panel. It natively supports a mesh network. Here is a cool little demo of how a mesh network works, but the basic idea is a self-forming dynamically extensible network (downright subversive.) It has a new simplified window manager called Sugar to support the smaller screen. The screen swivels to operate in tablet mode. The screen/windowing system have been designed to operate well out doors in natural light. A number of cool educational applications (called activities) come installed. These applications seem to be designed mainly to encourage collaboration.

The camera, the power system, the mesh network, the table support, all of these things, of course, relate specifically to the XO's intended purpose. These are not extras or frills.

Unfortunately, for us, there is a compatibility issue with our wireless router. Linksys WRT54Gs are not supported, yet. So, we haven't yet been able to fully explore the little box's capabilities.

Its pretty impressive, though.

- J

Monday, December 17, 2007

The John "Chuck" Erreca Rest Stop



If I am driving from LA to the Bay Area I always stop at the John "Chuck" Erreca Rest Stop. I am not a drive-straight-through kind of person. I like to take a break. This particular rest stop has always been clean and well maintained and it is at a good interval from other potential stops. But, mainly it has an amazing ice cream vending machine. As far as I know it is the only rest stop with this particular type of machine.

The machine doesn't look out of the ordinary from a distance. It occupies an ordinary space in the vending machine kiosk. There is a glass window in the middle the same as other machines of the type. The only thing unusual is that you would expect to see a display of the wares through the glass and in this case it is empty. Otherwise it appears to be a completely modern vending machine. But, its not. It is a device worthy of Rube Goldberg. It would be at home next to the fortune telling machine at an old fashioned carnival. When you put in your money and make your selection things begin to whir. A door flips open inside the machine revealing the inside of an icebox. The icebox has a number of cardboard boxes with their tops torn off. Then, more whirring. A vacuum hose trolleys out, positions itself above a box, then drops. The hose starts to suck until it has attached itself to an ice cream bar. Then it lifts its prize and drops it down a chute in front. I have never seen it fail. I always get an It's It. An It's It has the shape of a squat cylinder. All the other products are roughly rectangular. They have differing weights and weight distributions. Yet, the machine handles them all. The machine apparently even responds to empty cartons appropriately.

The interesting thing is what an anachronism this machine is: a completely modern payment system with a delivery system that is from another era. A modern engineering approach would standardize the product size and shape and minimize the moving parts involved. Cardboard boxes would be out in favor of metal guides with more precise dimensions. The freezer door would be always open. A modern design would be completely uninteresting.

- J

Sunday, December 9, 2007

Jonathan Coulton: the future of music.

Web 2.0 gets a lot of hype, but if anyone really gets it, it is Jonathan Coulton. Jonathan Coulton, if you have never heard of him is a singer songwriter from New York City. He writes genial, usually humorous tunes. Some I like are Ikea, Re: Your Brains, The Presidents, and, of course, every geek's favorite, Code Monkey. He achieved a level of internet fame a few years ago for his "thing a week" podcast wherein he composed, produced, and published a new song each week for a year. For this he was profiled in the New York Times Sunday Magazine. At around the same time he did the Pop Sci podcast, an interview program for Popular Science Magazine, and worked with John Hodgman on the Little Grey Book Lectures.

What makes Coulton distinctive though is his relationship to his fan base and use of the internet to maintain this. During the "thing a week" period people started sending him videos, graphics, and other artifacts relating to his songs, which he would dutifully post. This established a positive feedback loop between him and his fans. A number of these home made videos became minor hits on youtube, increasing his audience.

As far as I know, Coulton does not have an agent, a manager, a record label, air play, or any other accouterments of popular music success. His albums are not on Amazon. His songs are not protected by DRM. But, then there he is, making a living and supporting his family. He does have an occasional backup band and he occasionally backs up John Hodgman's bookstore appearances.

Coulton regularly posts concert announcements to his blog, but will also post a little wrapup afterwards, almost a thank you note. The audience is always described as awesome, as I am sure they are. Recently, Coulton has been having his audience pose for a photograph from the stage at concerts and posting them on his blog. I think this is genius. It completes the web 2.0 loop: seamlessly merging the world of real life with the world of the web. At a concert in Chicago not long ago he invited the star of a popular Youtube video for Code Monkey come on stage to reproduce the video live. This, of course, was immediately posted to Youtube.

What really strikes me about the Jonathan Coulton approach to the internet is its old fashioned civility. Trust, thank you notes, and pictures of the event to help everyone remember. If I was running a music company I would be quaking in my boots.

- J

Tuesday, November 27, 2007

Javascript

I have recently been spending a little time updating my knowledge of JavaScript. I have not been working on user interfaces in recent years. When I last looked at JavaScript the main advise was "don't". Obviously, that advise no longer pertains. Apart from XMLHttpRequest and AJAX, the two main things that I have found interesting are:
  • there is a much clearer understanding of the nature of the language and design principals and
  • there are now a variety of mature well supported libraries, including Dojo and jQuery. These are not just hokey widget collections, but appear to provide real programming infrastructure.
I am not very interested, at this point, in AJAX. The ability to talk to the server behind the user's back is nice for some discrete, mainly big pipe, applications. It is best where there is more data than you can effectively send at once or where the data is highly changeable. But, AJAX appears to create as many problems as it solves for most applications.

JavaScript turns out to have more in common with Lisp than Java, having closures. Lisp people are prone to making claims about object oriented programming having appeared in Lisp before some other languages, and in a sense they are right. You can implement inheritable, polymorphic, encapsulated things in Lisp using closures, but you need to think about them differently.

A number of writers have been exploring the idea of unobtrusive JavaScript. In this approach, page content is vanilla HTML and behavior is added in an onload script. This is, in a lot of ways, finally applying some ordinary engineering to the problem: separating concerns, regularizing binding, finding techniques to better leverage common logic, and so on. I like these ideas very much and they make JavaScript much more attractive for me. In many ways, it is contrary to a lot of the AJAX trends. Pushed to its logical extreme unobtrusive JavaScript would strip the body of a web page of everything but pure content and that content's natural structure. The AJAX implementations I have seen make the body of the page content free presentation elements.

Finally, when I last looked seriously at JavaScript there were only a few flakey command line EcmaScript interpreters. Now there are some solid looking ones, two from Mozilla! And a number of unit test libraries that I need to look at. It is not clear to what degree the unit test libraries support an emulated DOM. More later.

All of this is probably old hat to people who have been actually paying attention to the JavaScript world, but it comes as news to me. Worth a continuing look.

- J

Sunday, November 11, 2007

A Simple Blog Backup Tool

I wanted to backup this blog. I looked briefly on the web. There don't appear to be a lot of good alternatives. The instructions on the Blogger site are complex and very manual. There do not appear to be a lot of open source alternatives.

So, I wrote a quick and dirty bourne shell script. Right now it is pretty rough, but it works. It relies upon a number of standard Unix tools; wget, xsltproc, and tidy. These may not be installed on an out of the box system, but can be downloaded as binaries for either windows (from cygwin) or a mac (from fink) so this script should work from any suitably configured computer. I am running my backups on a Mac. The script relies on the Blogger "Blog Archive" widget being present in the blogs template. This may be a problem for older Blogger blogs.

Below is the script. Copy it to a file, make the file executable, cd to the root of your backup directory and you should have a backup faster than you can say "screen scraping".

- J

#!/bin/sh
# Backs up a Blogger blog.
# Should work in any suitably equipped unix-like environment. Requires the
# following programs:
#
# 1. wget
# 2. tidy
# 3. xsltproc
# 4. xargs
PROGNAME=`basename $0`
DIRNAME=`dirname $0`

function usage() {
echo "usage: $PROGNAME [blogURL]"
exit 1
}

TMPFILE=/tmp/$PROGNAME-tmp-$$.html
XSLFILE=/tmp/$PROGNAME-xslt-$$.html
if [ "$1" = "" ] ; then usage; fi
URL=$1

# create xslfile from here-document
cat > $XSLFILE <<- "END-HERE" <?xml version='1.0'?> <xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" version="1.0" encoding="UTF-8" /> <xsl:template match="/" > <xsl:apply-templates select="//html:ul[@class='posts']/html:li/html:a"/> </xsl:template> <xsl:template match="html:a"> <xsl:value-of select="@href"/><xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> END-HERE # get the index file of the blog # clean it up with tidy in case it has bad xml syntax. Blogger uses xhtml. # write to a temporary file. wget -O - $URL | tidy 2>/dev/null > $TMPFILE

# read from temporary file.
# extract from a list of individual posts.
# get each post and all the files needed to render them locally.
xsltproc $XSLFILE $TMPFILE |
xargs wget -E -H -k -K -p

# remove the temporary files.
rm -f $TMPFILE
rm -f $XSLFILE