jump to navigation

A quadrillion dollars in debt July 15, 2009

Posted by Peter Hornby in software, tech.
3 comments

After an unconscionable period of quiet, the blog bursts into life with a post which will probably only be of interest to a small subset of my vast reader audience.

The BBC reported today that some poor guy in New Hampshire discovered that his bank had debited his account by $23 quadrillion dollars after he bought a packet of cigarettes at a local gas station.

The story concludes:

But no-one has yet explained to Mr Muszynski how such a astonishing error could have been made.

I’m here to help.

The amount quoted in the story is $23,148,855,308,184,500.00

Type eight space characters into a text editor.  It’ll look like  ”        ” on screen (minus the quotes, of course).  What has the computer stored in memory?  If your text editor uses the ASCII character-encoding scheme, you’ll get 3264 bits which look like this when represented hexadecimally – “2020202020202020”.  Each “20” is the ASCII representation of a space character.

Here’s where it gets interesting.  Suppose you tell the computer that this memory location doesn’t contain a string, but a decimal value, what do you get?  The answer is 2314885530818453536.  I’m not sure how the bug manifested itself, but it seems likely that some memory location which was supposed to contain the number of cents in the debit amount was actually overwritten with a text string which was all, or almost all, spaces.

Oh well, geek credentials established.  Now back to hummingbirds and choral music.

Updated: Peter points out in comments that eight spaces take 64 bits, not 32.  Indeed they do (slaps forehead in annoyance).  He also points out that “2020202020201250” converts exactly to the correct decimal value, and wonders whether the pack of  cigarettes cost $12.50.  Maybe.  Thanks for the notes, Peter.

Jim Gray – LA Times version May 30, 2008

Posted by Peter Hornby in software.
add a comment

Look, I know it’s hard to describe someone as multi-contributory as Jim Gray in one paragraph, but, really, I think Michelle Quinn, in her story in this morning’s Los Angeles Times, might have done better than this:

The daylong event honoring the computer-science whiz who helped create automated teller machines will be part celebration, part science fair.

“The computer-science whiz who helped create automated teller machines”?  That’s it?  Really?

I guess it’s possible that Michelle Quinn’s research led her to the Microsoft press release announcing Gray’s 1999 Turing Award, which has this as its subheading

Gray’s database research paved the way for ATM machines, computerized airline reservations and e-commerce. The Microsoft senior researcher this month received the prestigious A.M. Turing Award-the “Nobel Prize of computer science”-for his contributions.

The Times story is actually pretty good once you make it past the open.  It talks at some length about tomorrow’s tribute symposium at Berkeley, and spends more time on Gray’s wife Donna Carnes, and her life since his disappearance, than it does on his life and achievements.

Build your own font May 13, 2008

Posted by Peter Hornby in software.
add a comment

I’ve never developed a font.  I don’t suppose many people have.  It’s always seemed as though you need expensive tools, planetary-level creative skills and, let’s say, a tendency to the obsessive.  Well, some of those barriers to entry have just been broken down with the release of FontStruct, a free web-based font construction tool from a font house called FontShop.

The metaphor is simple.  You fill a rectilinear grid with bricks.  OK, it’s just pixel editing. But the bricks can be odd shapes, so you can round off corners and end up with some radical character shapes.  Once you’re done, you can save your work, and download a TrueType version for use in your own work, or you can share your font with other users.

I have to say that FontStruct is really well done.  You have the tools you need, and no more.  The interface is clean and attractive.  All in all, an excellent job.

So, building a font is now simple.  Of course, designing a great font is exactly as hard as it was before, and for that, you’re on your own.

Thanks to Jason Kottke for the tip.