Fortunately 1

Posted by Oliver on January 31, 2006

Jim Grandy wrote:

From: jgrandy

Subject: stupid Google game

Date: January 7, 2006 6:17:58 PM EST

Google for "unfortunately, yournamehere":

Lots of fun hits for "unfortunately, jim":

  • unfortunately Jim’s orange dry suit made him look like a carrot
  • Unfortunately Jim is no longer with us as he died of a brain tumor in 1993.
  • Unfortunately, Jim did not respond. He disbelieved that it was an angel.
  • Unfortunately, Jim is only one person with a limited amount of time available to
    help Jane find answers to her questions.

I’ve turned this into a web page here.

I prototyped it with a screen scraper for Google, but I didn’t want to deploy a screen scraper.

Fortunately, Google has a Search API.

Unfortunately, Google’s API uses SOAP.

Fortunately, Ruby has a SOAP library.

Unfortunately, the Ruby SOAP library doesn’t work on Dreamhost.

Fortunately, the Yahoo Web Search API uses REST.

Unfortunately, Yahoo’s summaries don’t include enough right-hand context, so it’s harder to extract decent sentences from them.

Maybe I’ll go back to screen-scraping after all.

Update: Jim tells me he got the idea from Jorg Brown at Google.

Expialidocio.us 1

Posted by Oliver on January 08, 2006

Expialidocio.us is a tool for visualizing your del.icio.us posting activity. It displays a graph of your posting activity over time. You can select a timespan from this graph, and it will show you a tag cloud weighted by just those dates.

Expialidocio.us was inspired by a posting by Jon Udell. Coming full circle, Udell has posted since posted about this application. Since then, I’ve published the sources.

OpenLaszlo Ruby library

Posted by Oliver on January 05, 2006

openlaszlo.rb is a Ruby library for compiling OpenLaszlo programs. I use it to build this, this, and the toolbar here. This article describes how to use it with Rake.

Update: This is now available as a gem. The rdocs are here.

Aargh! 29

Posted by Oliver on December 24, 2005

“Aargh!” But how do you spell it?

(Click here to skip straight to the visualization.)

In the late nineties, I tried using internet search as a spelling corrector. (I think I was using AltaVista at the time. It was the latest and greatest search engine, supplanting — was it Lycos?)

At the time, for the words I tried, there were about two orders of magnitude between a misspelling and the correct word. A spelling variant, such as “color” and “colour”, were typically less than one order of magnitude.

In 2002 I used Google to figure out the most common spelling for “closable”, for use in the OpenLaszlo API. It had been “closeable”; why use a spelling that most people would guess wrong the first time, I figured. [Update: This paragraph originally said the word was "resizeable", which is a straightforward misspelling.]

Here’s what this looks like today. First, a common misspelling:

compatible170M
compatable2M1.3%

And a couple of spelling variants:

closable137K
closeable101K73%
sizable8.3M
sizeable6.8M81%

(The percentage is the ratio of the page count to the page count of the most common variant, which is the form in bold above it.)

Some other misspellings:

commit73.9M
comit0.8M1%
resizable1.74M
resizeable0.18M10%
misspell466K
mispell55K12%

And some other acceptable variants:

color434M
colour63.0M16%
gray125M
grey73M59%
judgment77M
judgement24M32%

(What’s the difference between an acceptable variant, and a misspelling? An interesting topic for another posting. Maybe.)

What got me thinking about this again, was, of all things, thinking about how to spell “aargh!” One ‘a’, two, three…? And how many ‘r’s?

This is an interesting problem, first, because so many repetition counts are attested. There’s not just “mispelling” (1s) and “misspelling” (2s), but “argh”, “aargh”, “aaargh”, etc. And second, because the space is two-dimensional: not just “argh”, “aargh”, “aaargh”, …, but also “argh”, “arrgh”, “arrrgh”, … — and the product, with “aarrgh”, “aaarrrgh”, etc.

It’s clear that a wide range of spellings are acceptable. What’s the most common?

Without further ado, I created this page to help me find the answer.

Adding Fractions 1

Posted by Oliver on December 18, 2005

Here’s a picture I drew to explain addition and subtraction of fractions to the sixth-grader:

We also ended up using a variant on Euclid’s algorithm for finding the GCD. It uses subtraction instead of division and remainder; it’s in general less efficient, but it’s easier to explain and can be easier to do in your head, when the numbers are small.

Construct a series whose first two terms are the inputs, and then continue as follows: each successive term is the absolute value of the difference between the preceding two terms — that is, simply subtract the smaller from the larger. If you reach one, the GCD is one; if you reach zero, the GCD is the previous term. (Or, you could also let the series peter out to zero, but the way I’ve stated it is simpler in practice.)

  • 24 and 16: 24, 16, 8, 8, 0.
  • 9 and 7: 7, 9, 2, 7, 5, 3, 2, 1.
  • 12 and 9: 12, 9, 3, 6, 3, 3, 0.
  • 35 and 28: 35, 28, 7, 21, 14, 7, 7, 0.

An added advantage is that the first step lends itself to an optimization that almost always short-circuits the whole process, at least for sixth-grade math problems. Take the difference of the two inputs and test whether that divides both of them. If it does, that’s the GCD.

PackageMapper 3

Posted by Oliver on December 18, 2005

PackageMapper shows you a map of your FedEx, UPS, USPS package routes. Enter a carrier and a tracking number to see your package’s progress plotted on the map. Sign in to enter a list of packages and see their current locations on a table or map.

This is an itch I’ve wanted to scratch for about a year now: being able to see where all my packages are on a map. On Thanksgiving morning I discovered SimpleTracking.com, which gives you an RSS feed for a UPS or USPS package. Over Thanksgiving weekend I added FedEx and mashed it up with Google Maps, and this is the result.

I can’t guarantee that this will stay up if it starts to get much traffic, but in the meantime I’m finding it useful myself, so, enjoy.

Grief 2

Posted by Oliver on December 09, 2005

One warm Monday morning last August my father died. The previous Wednesday he had been planning to see March of the Penguins, a movie he probably would have discussed with his grandchildren over the phone and video chat. Instead, that night he was taken to the hospital, after falling down his apartment stairs. Early Monday I leaned way over him in the ICU and held him as tightly as I could, and felt on my cheek his last, familiar, breath.

I know it’s callous, but when I hear about a man in his eighties dying, I picture someone whose life is done. It doesn’t evoke in me the automatic sorrow, the rage against mortality, that comes from an encounter with the death of a twenty year old, or a teen, or a child. I’m less than half of eighty now, and yet I’m older than most people have lived to for most of time: older than the life expectancies of many countries; older than my friends when we were young and promising; older than Mozart, older than Keats. Despite the extended American adolescence, by the time a man is thirty he’s had time to make his mark. Anything after that is bonus time.

But it’s one thing to read “eighty” on the obituary page. Reality is stepping into the place of someone who just stepped out from it, and looking around, and understanding where he’d stood.

For a few days after his death, I was my father. I lived in his house, I slept in his bed. I sat at his desk and used his phone to call his old friends, the ones that I had known as a child. (They aren’t any older now. Seventy to a forty-year-old looks the same way forty did to a boy of ten.) I learned a little bit about the strands of his life, after the fact, in the process of raveling them.

Even at eighty, my father led a more active life than I do now. There were letters on his desk from students, writers, colleagues. One journalist was writing a book about him. Another was waiting to talk to him for a book of interviews about George Plimpton, with whom he co-founded the Paris Review. He had been planning to co-teach a writing course at UNC-CH again this fall; he had been looking forward to teaching again at Bennington. His computer held some words towards an unfinished book.

It wasn’t an old life that I’d stepped into. It didn’t feel like a life that had been winding down. It’s funny to say it about a man in his eighties, but aside from the inconveniences of his eight-year-body, he had been in his prime. I didn’t just miss him as a father and grandfather then. I wanted to see what he’d do next with his life, what he’d write, and who he’d teach. He was a storyteller and a teacher; there are more stories and students, that only he could have taught and told.

Writers and teachers have friends who are writers too. Having a writer and teacher as a father means that his friends can express what I want the eloquence to say. Max’s lifelong friend Daphne Athas wrote me after he died (and I quote without permission, and hope that she will forgive me):

When Bland [Simpson] called the sun had just set, I had just arrived at the Pension room that I stay in, the phone rang, I sat on my bed and looked out at Sphakteria, the island across Pylos Bay from my window where the Athenians beat the Spartans in the 7th book of Thucydides. So do we lose our fathers. But it was a triumph for the Athenians, and Max would certainly appreciate that.

So do we lose our dads.

Second grade squares 3

Posted by Oliver on December 08, 2005

I posed a second-grader the question of what nine squared was. She reasoned that ten squared is 100, and nine times ten is ten less then that, and nine times nine is nine less than that, so the answer is 81. Then I asked her what eight squared was, and she was flummoxed. She saw that it was a similar problem to the one she’d just solved, but wasn’t sure how to apply the analogy.

Here are the pictures that showed her how to figure out the answer. We drew the location of the squares on a multiplication grid:

and I introduced the idea of a “solution structure”. A solution structure is a graphical representation of the steps of a solution. This is the section that represents the relation between 92 and 102.

Two problems can have different numbers but the same structure. This is the problem structure for both problems shown together:

And then she got it.

But this leads to the arithmetic problem of 81 minus 17, which was harder, for this seven-year-old, than 100 minus 10 minus 9. There are several ways to compute the difference betweeen 81 and 17. The hard ways are to count down by 17, or to do two-digit subtraction and carry the one. The easy way is to adjust the problem to 84 minus 20, and count down two tens to 64. But how can you show that 81-17 = 84-20?

Here’s what didn’t work: explain that adding three to both the minuend and the subtrahend leaves the difference unchanged. Seven was too early for something this symbolic. We used a number line instead:

The difference is the blue bar. Moving it on the number line moves its ends by the same amount, without changing the length of the bar itself. Conversely, you can move both ends by the same amount without changing the length of the line between them.

Problem solved.

OpenLaszlo Blog

Posted by Oliver on November 11, 2005

It was months in the conception, weeks in the making, and minutes in the configuration, but the OpenLaszlo project now has a blog.  That blog is intended for project-related news, announcements, documentation, and musings, posted by members of the OpenLaszlo project and some of our co-workers at Laszlo Systems. And I’ll be returning this blog to more personal and broader topics. (Those are two overlapping categories, not one.) Plenty of Laszlo and RIA stuff where it goes beyond the immediate project work, but more other topics too.

On a related topic, Laszlo Systems has launched Laszlo Mail, a high-polish web mail product focused on cross-browser portability and on user experience . I first wrote about Laszlo Mail here. Laszlo Mail is an excellent example of the kind of application that we created OpenLaszlo in order to enable.  As Jonathan Boutelle says :” It feels like a candy-coated swiss army knife, an appealing mix of aesthetics and pragmatic design.”

Congratulations to the Laszlo Mail team on getting this done. The Laszlo Mail team has a blog too, here.

OpenLaszlo software development position open 2

Posted by Oliver on April 11, 2005

Laszlo Systems has a position open for a senior software architect to work on the OpenLaszlo client runtime. This is a paid position, and you would be working on an open source project. You’ll be working on the bright green box below, but if you qualify, you get to choose your color. :-)

You should be a great software designer, able to navigate complex systems and big architectures, but with wizard-level performance optimization skillz too.

Your idea of a dream job should be writing code that does near-impossible things, and shipping it, and then seeing it used to build products that you can show your friends. But you should also enjoy working with other smart people, bouncing ideas off of them, learning from them, and teaching them. In fact, you should be willing to mentor and lead the efforts of open source contributors, and you should have the leadership and communication skills to do so.

You should enjoy initiative, innovation, and excitement. You’ll be working on the core technology of an emerging technology company. This is an important, visible position, that will change the future of the web.

You should enjoy building complicated things, and making them look simple. You should be excited about working on systems that look like this on the inside:
but look as simple as this to developers:

<canvas>
  <button onclick="animate('x', 100, 1000)">Click me!</button>
</canvas>

and can be used to build things that look like this to your mom:

You don’t need to know Smalltalk, Lisp, Dylan, JavaScript, Python, or Ruby — and you won’t be using any of them except JavaScript — but if you’ve tried dynamic languages before and hated them, you probably don’t want this job either. Conversely, if you’ve never profiled an application or made an educated performance-based decision about whether to use integers or floats, recursion or iteration, or DTO or parameter lists, you should probably look elsewhere too.

You should live in one of America’s Bay Areas (San Francisco or Boston).

You can read more about this position here and here. Send your resume to resumes@laszlosystems.com.