Blake (old posts, page 10)

More stuff on the iTouch.

Yeah, like I was done messing with my iTouch. Whatever.

I've been playing around a lot with the iTouch, and developing quite a few programs for it. The first one was by request, although I’m also finding it very useful. (And apparently a few other people are as well! Cool!) It’s called WifiToggle, and it’s a small app that simply toggles on and off your Wifi connection, so as to save batteries. The next thing I did was a port of the SpiderMonkey Javascript interpreter. It works, and it wasn’t that hard to get compiled and installed, which is really pretty cool when you stop to think about it.

The final thing I got working just tonight (which I was playing around with mostly to take my mind off of stuff. See tomorrow’s post for details), was a port of the Gambit Scheme interpreter. I know, Scheme is just like Javascript, only with an uglier syntax, but I still like it, and hopefully the lack of punctuation will make it easier to use on the iTouch. Heh.

Anyways, if you own an iPhone or iTouch, and have jailbroken it, be sure to add to your list of Installer sources, and geek out!

Whatever will I do without trashy TV?!?

Well, it’s official. I just cancelled my cable service, effective January 23rd. I found that for the past few weeks, I really haven’t been watching anything worth while, and $96.22/month is a lot to spend to have the only thing on be the HD version of American Gladiators. (No, seriously, that’s what I’m watching right now. Pity me.) I’ld like to say that it’s the writer’s strike, and the resulting lack of decent shows, or that I’m getting smarter and the shows are appealing to me less and less, but really it’s just gotten too expensive for the value I’m getting out of it. Heck, maybe I’ll take half of that money, and buy a couple of DVDs every month. But we’ll probably use it to pay down the Line of Credit that financed the deck.

I can’t remember the last time I didn’t have cable of some sort, and so I’m not really sure how I’ll be occupying my time. Reading books? Reading the Interweeb? Programming? It’s a blank slate. It’s all up in the air. And if I end up spending all my time at my sister’s house, watching her TV, then we’ll know I’ve got a bad addiction, and should seek professional help.

Oh, I should also mention that the person on the other end of the line was really nice. She tried to figure out a way for me to pay less, and still get the channels I wanted, (the best deal was $19.95/month for channels 2-28 and 59-70, but that was only for 6 months, and it’s still $20/month I would rather spend elsewhere,) but totally wasn’t pushy about it and was fine with me cancelling the service outright. I picked up the dial phone when they called me back for the customer satisfaction survey, and so couldn’t complete it, but I did want to make a mention of how helpful she was, and how well it all went.

Sprinting on DrProject.

On Friday and Saturday afternoon this week, I took some time out of my day to go down to the University of Toronto and participate in the DrProject Code Sprint. It was a lot of fun, and I managed to fix a couple of bugs, and get a better understanding of one of the hairier parts of DrProject. At least I hope it’s one of the hairier parts of DrProject, since if the whole codebase is as ugly as the wiki parts, we’re in some serious trouble. To be fair, it’s a not-entirely-deterministic parser for a not-entirely-deterministic language, so when something goes wrong, it’s kind of, uh, tricky to figure out what’s just happened. For example, after parsing a link surrounded in square brackets, the following character seems to be treated as text. Why? Who knows. As someone new to the wiki parser, I’ld love to have the code be simpler to understand, but I’m starting to suspect that the complexity is inherent in what it’s trying to do.

The two bugfixes/feature additions I did, although they seem sort of unrelated, both work together to let people create a bibliography/set of footnotes to pages, which is something Greg said that he’s been wanting for a while, so that was kind of cool. It’s nice to be able to go somewhere, be surrounded by smart people, and concentrate on making something better without interruptions.

Speaking of the bugfixes, they were:

  • adding support for dl/dt/dd in the wiki syntax, which turned out to be surprisingly hard, since it seemed to be the first bit of syntax that wanted to either return more than one tag or insert a tag into the already-generated stream, so I had to figure out which option to go with, and how to get it working, and
  • coming up with and implementing a wiki syntax for creating and referring to anchors in a page, which I think I did a pretty decent job on. The syntax uses [wiki:#foo] as an anchor, and [wiki:MyPage#foo] as a link to that anchor

How to break web applications.

I’m watching a video on my new iTouch about how to break web applications, and it presented the idea that Javascript is the same as stack overflows which are also the same as getting free phone calls by whistling a note into a payphone…
They're all examples of bad things happening when you intermingle code (javascript/return addresses/command tones) and data (html/arrays on the stack/your voice). I guess it’s sort of expensive to set up two connections for every connection, but that seems to be the only way to avoid stuff like this, which has apparently been happening for years.

I don’t think there’s a lot I can do with this new idea, but it seemed interesting, so I figured I’ld record it for posterity.

Bazaar on the iPod Touch.

Because I was curious, and because it has Python, I figured I'ld give it a try, and see what happened...
The results are:

# ./bzr selftest
testing: /private/var/root/bzr-1.0/bzr
   /private/var/root/bzr-1.0/bzrlib (1.0.0

bzr: ERROR: exceptions.ImportError: No module named pyexpat

Traceback (most recent call last):
  File "/private/var/root/bzr-1.0/bzrlib/", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/private/var/root/bzr-1.0/bzrlib/", line 758, in run_bzr
    ret = run(*run_argv)
  File "/private/var/root/bzr-1.0/bzrlib/", line 492, in run_argv_aliases
  File "/private/var/root/bzr-1.0/bzrlib/", line 2659, in run
  File "/private/var/root/bzr-1.0/bzrlib/tests/", line 2373, in selftest
    suite = test_suite()
  File "/private/var/root/bzr-1.0/bzrlib/tests/", line 2531, in test_suite
  File "/private/var/root/bzr-1.0/bzrlib/tests/", line 89, in loadTestsFromModuleNames
  File "/private/var/root/bzr-1.0/bzrlib/tests/", line 96, in _load_module_by_name
    module = __import__(mod_name)
  File "/private/var/root/bzr-1.0/bzrlib/tests/", line 32, in <module>
    from bzrlib.bundle.bundle_data import BundleTree
  File "/private/var/root/bzr-1.0/bzrlib/bundle/", line 42, in <module>
    from bzrlib.xml5 import serializer_v5
  File "/private/var/root/bzr-1.0/bzrlib/", line 26, in <module>
    from bzrlib.xml_serializer import SubElement, Element, Serializer
  File "/private/var/root/bzr-1.0/bzrlib/", line 47, in <module>
    from xml.parsers.expat import ExpatError as ParseError
  File "/usr/lib/python2.5/xml/parsers/", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat

bzr 1.0.0 on python (darwin)
arguments: ['./bzr', 'selftest']
encoding: 'ascii', fsenc: 'utf-8', lang: None
  launchpad            /private/var/root/bzr-1.0/bzrlib/plugins/launchpad [unknown]
  multiparent          /private/var/root/bzr-1.0/bzrlib/plugins/multiparent.pyc [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at
    including this traceback, and a description of what you
    were doing when the error occurred.

Doing a bit of googling led me here (or rather, the google cache of that page). which says:

# 1/ The python installation from the installer ("unjailed iphone") does not come with the pyexpat module.

So, that's a little surprising.

I tried to install easy_install, to try an "easy_install pyexpat", but because I'm missing a Makefile, that fails with the following:

# python
Traceback (most recent call last):
  File "", line 229, in <module>
  File "", line 163, in main
    from setuptools.command.easy_install import main
  File "build/bdist.linux-i686/egg/setuptools/", line 2, in <module>
  File "build/bdist.linux-i686/egg/setuptools/", line 2, in <module>
  File "build/bdist.linux-i686/egg/setuptools/", line 5, in <module>
  File "build/bdist.linux-i686/egg/setuptools/command/", line 13, in <module>
  File "/usr/lib/python2.5/distutils/command/", line 29, in <module>
    class bdist (Command):
  File "/usr/lib/python2.5/distutils/command/", line 37, in bdist
    "(default: %s)" % get_platform()),
  File "/usr/lib/python2.5/distutils/", line 78, in get_platform
    cfgvars = get_config_vars()
  File "/usr/lib/python2.5/distutils/", line 493, in get_config_vars
  File "/usr/lib/python2.5/distutils/", line 352, in _init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.5/config/Makefile (No such file or directory)

And that was the end of that. Interesting, though...

Oh, yeah, and I ended up going with the iPod Touch (hereafter referred to as the iTouch) to replace my Palm TX. It's not the perfect device, as the above stack traces show, but it's pretty good, and a fair bit closer than the Palm TX was.

Malted Barley Flour Review

At the Royal Winter Fair this year, Amy picked up a small bag of malted barley flour, because she likes the taste of malt, and because we have a recipe for malt bread which calls for malted (not barley) flour. We’ve since tried to use it in a few different loaves, and while I quite enjoy the taste, as little as a quarter of a cup will make the bread twice as dense as usual, and incredibly sticky to boot.

It seems like it would be a useful thing to have, so that if you had a bread that you knew was going to be a little dry for some reason, you could just add a pinch of the stuff, and moisten it right up, but I still haven’t figured out how little to put in to get a slightly-moister bread which doesn’t adhere to the knife. If I do, I’ll be sure to post a comment, but until then, if you manage to get some malted barley flour, be exceedingly sparing in your use of it, and I’ll continue experimenting and picking bread out of my teeth.

Choices, choices...

So I hit the Apple Store in the Eaton Center again today, to play with the iPod Touch a little more, and now I’m kind of sad that I did. There seem to be a few things about it that I don’t know if I can deal with. First, the screen apparently uses a capacitive screen, which basically means that you need to use your fingers to touch it. No slightly-longer-than-normal thumbnails, no left-over spare stylii, nothing that could make the large surface area of my stubby fingers slightly smaller. This turned out to be a little annoying when I was trying to type. I would probably get used to it if it weren’t for the second problem. Very few of the apps seem to support landscape-mode text input. Where by "very few", I mean "only Safari". The keyboard in portrait-mode is just a little too small for my fingers. Bah, who am I kidding? The keyboard in landscape-mode is just a little too small for my fingers. The keyboard in portrait-mode is way too small for my fingers.

So, I can’t really type on it. That’s a fairly big problem. But at least I can download videos and music from my website, so that when I’m at the office, and I see that my long DVD-to-iPod conversion has finished, I can grab a copy of it over HTTP to watch on the commute home… But when I tried it, it was a total no-go. None of the avis worked, which isn’t totally surprising, but the mp3s in the same directory also gave me the “Safari is unable to download this file”. WTF?!? An MP3 player that can’t play MP3s? The biggest downside of this whole trip is that I can’t really think of a good way around either of those problems. I mean, I guess text editors will come out which allow landscape-mode keyboards, but it’s going to be annoying every time I go to enter a new appointment, or contact. And I don’t have any idea what I could do to get around the no-downloading stuff. So I guess I’m back to looking at other options (and maybe ending up asking Jeremy for my SD Card back). And no, I don’t think the Nintendo DS is a reasonable replacement. It’s too… game-y. Not enough like an actual PDA.

A Tale Of Woe

A few weeks ago, I was reading a pdf file on my Palm TX, when all of a sudden, it reset itself. Now, if that was the end of this story, then it would have been slightly annoying, but nothing to post about. However, that’s nowhere near the end. After resetting itself, it came back to the initial orange Palm logo, as seen on the left, then it switched to the grey PalmPowered logo, as seen on the right. And there it sat. And sat. And sat… The only thing I could consistently do is reset it, and every time I did, it ended up on the grey screen, sitting there. Soft resets, debug resets, hard resets, zero-out resets… Nothing could get it to move past the grey screen. On the off chance it was just taking a long time to do its thing, I left it sitting overnight. In the morning, I opened it up expectantly finding… the grey screen again. I read on the internet that it might fix this problem if I left it sitting without any power for a week, so I did, and the next time I plugged it it? Yeah, grey screen. My heart was broken. What could I do?

I could call Palm’s tech support, and get a replacement! It’ld only be $35 to get them to ship one. But when I called I found that I was way out of warranty. Like, a year out of warranty. So I decided not to go that route, since it would be $150 to get it fixed, (or $185 to get the advance exchange,) and I just don’t have that kind of money kicking around. Then I remembered that I had bought an extended warranty from the store, good for a year after Palm’s warranty had run out, until Boxing Day of this year. Excellent, now I can just trade it in for a new one at the store. But, I couldn’t find the receipt from two years ago, nor could I find the credit card bill. So I’ld have to figure out a way of getting them to honour the warranty without knowing the warranty number. That was going to be hard, but in theory they had my information in their big database, so it should be possible. On the Monday morning, I was checking through our filing cabinet one last time before heading off to the store, and in the midst of a bunch of other receipts, (Why are we keeping receipts for two year old meat purchases, anyway? I’m pretty sure that at this point, even if the meat was bad, we couldn’t return it.) I found it! So now, with all my ducks in a row, I left for the store, Compusmart at Yonge and King.

Arriving at the store, I was slightly surprised to find the doors locked, and a notice up from the landlord, saying that this location was closed. Apparently, some time in the past two years, Compusmart had decided to close all of its Ontario locations. Well, great. What the heck do I do now? Getting to the office, I hit the internet, found a phone number, got redirected to a different phone number, and then spoke with someone who checked my warranty number (convieniently printed on my two-year-old receipt), and said that they’ld send me some email which I should sign and fax back. Since there were no more Compusmart stores left in Ontario, they couldn’t exchange the merchandise, and so they were going to buy it back from me for the purchase price of $400! I was elated, until I realized that, because I had already done an early exchange on this unit with Palm to fix an unrelated problem, the serial number on the back of the TX was different than the one they had on file. And I bet that’s the sort of thing you would check if you were going to send out a $400 cheque. I called them back, and asked what I should do. They replied that I would need to get some sort of proof from Palm that I had traded in the one unit for the other. After another set of phone calls and emails, I eventually got a PDF from Palm, listing the date, and the early advance exchange, and the two serial numbers, which I proceeded to forward off to the warranty company. And now I’m waiting for them to update my policy and send me their buyout agreement so that I can fax it back to them, send them my Palm TX, and get my $400.

In the meantime, I’ve got one of those problems people don’t mind having. I’m trying to figure out what to spend the money on. Should I get another Palm TX, with infrared keyboard, for $300? Basically replace my current setup, and pocket the extra $100? Or should I get something a little newer? That back there is supposed to be a link to the iPod Touch. Specifically, the 16 Gig version. (It’s really not, but let’s pretend it was.) It’s going for $449, which is a fair bit more than I’m getting a cheque for, but… If I go to the American Apple Store, I see that the price for the 16 Gig version there is only $399 USD, or around $373 Canadian. (Remind me, again, why I’m paying $70 ($80 USD!) more for stuff just because I live in Canada? Honestly, people, fix your freaking prices already!) And I know people in the States who would be more than happy to ship it to me. Heck, some of them might even be coming up here for Christmas, and could just pack it in their luggage. Uh, where was I? Oh, yeah, do I stick with the devil I know, or do I go for the devil I don’t know? I was leaning towards the Palm TX recently, because there’s no text editor/note taker for the iPod Touch, and you can’t create appointments in the Calendar app, two things I kind of do a lot of. But today I read about a text editor, and a way to enable the missing add-appointments feature. Then I was worried that the best way to view a PDF would be to convert it to text, but maybe not.

I think the thing that finally convinced me was this picture. Yeah, I’m a huge geek. What can I do? (This picture didn’t hurt either.)

Running Out Of Space…

If anyone out there has been trying to email Amy or I, we haven’t gotten it. While I was home alone with Delphine, I subscribed to a few podcasts in iTunes, so that we would have a ton of new music to listen to, but when I went back to work, I forgot to unsubscribe, and as a result filled up my entire hard drive with music and videos. This caused a bunch of things to fail for various reasons, the most notable of which being that no-one has recieved any email for the past few days. I can only hope that the various mail servers around the world will continue trying to send the messages, but if there’s something urgent that you really wanted a response to, you might consider re-sending it.

Blake and Delphine’s Excellent Week Together – Part 6… Uh, 7?

I have no idea what happened to last night’s update. Well, that’s not entirely true. I was at a FogBugz demo given by Joel Spolsky, and Delphine had a sleep-over at her Baba and Zaida’s, so I took the time to write a spec, and that led me to whip out a bunch of code. The spec is written in something called reStructuredText (uh, that’s the link to the spec, which probably isn’t the best way to learn about it, but is the document I’ve been using the most), but my favourite Mac text editor (TextWrangler) doesn’t support it in any way, shape, or form. So I started writing a plugin that would teach TextWrangler what the heck reStructuredText was. (You can apparently get a tarball of the project from this link, if you’re so inclined, or if you’re not, you could just try the compiled plugin itself. Just double-click the .dmg file, then double-click the .bblm file inside of it, and it’ll tell you what to do. Or mail me, and I will.)

So yeah, a busy, busy night, but I got to sleep in until 7:00, which was really nice. Today was more of the same, except it was really hot out when Delphine got out of kindergarten, so instead of playing in the school playground, Delphine and I decided to go to Hollywood Gelato, the local ice cream store. Tasty. Tomorrow Amy gets home, so it’s looking like it’ll be a pretty busy day as well.