Yesterday I held a G1 phone in my hands. An interesting little device.
I'd buy one in a heartbeat, if I could. T-Mobile sells them only with a data
plan, and T-Mobile doesn't operate in Lithuania.
Openness is the primary reason I'm interested in Android phones. I don't
see how that can be compatible with operator lock-in.
Andrew Bennetts writes why narrative
tests are lousy unit tests. I completely agree.
Narratives are great as documentation, and the embedded doctest sections
help (1) keep the documentation up-to-date and (2) provide concrete examples
that make the documentation easier to understand. Here's a good example of that:
Storm ORM tutorial. But for
unit tests you want many small, isolated tests rather than one big
narrative, for reasons that Andrew so clearly elucidated in his post.
My preferred way of writing unit tests is a mixture of unittest and
from cStringIO import StringIO
from mysuperduperpackage import Gronkulator
"""Tests that Gronculator.parseXML does the right thing
>>> g = Gronkulator()
You pass a file-like object to Gronkulator's parseXML():
... <gronk id="g42">
... <item id="a">One</a>
... <item id="b">Two</a>
... <item id="c" important="yes">Three</a>
and the items are loaded into ``g.items``:
>>> for item in g.items:
... print item.id + ':', item.title, '!' if item.important else ''
c: Three !
if __name__ == '__main__':
about this on Zope mailing lists
One of the little things I love about Python is that you can chain
comparison operators like this:
10 <= x <= 20
x == y == z
Strangely, I hadn't realized until yesterday that this also works with the
x is y is z
My beloved N810 died last Tuesday. Well, not died died, but the
screen stopped working. The topmost plastic layer is fine, but the LCD is
probably cracked underneath. This probably happened while I was in an Apple
store watching a friend of mine buy an iPhone. Coincidence?
I ordered a new one from Amazon that evening, and it arrived on Thursday.
It had the oldest possible OS2008 version (and an incorrectly-formatted
internal flash card), so I had to reflash it, and then install the OS
feature updates one at a time, with forced a reboot in between. Untimely breakage of extras-devel
didn't help either, and neither did the broken
maemo-mapper package in extras. (Both are fixed now.)
Almost all of my data was on the miniSD card (including a week-old backup).
To get the rest I had to blindly get the old N810 online and open a browser
page (measuring distances from the corner of the screen) to get past the hotel
wireless nag screen, and then guess its IP address, so that I could ssh in.
It thought maybe I could use arping on its MAC address to get the IP, but
had no luck there. It didn't respond to broadcast pings either. Finally I
had to ping every IP in my subnet individually and then grep for the MAC
address in my kernel's ARP cache. Oh, how I wish Maemo came with avahi-daemon
preinstalled! ssh mg-n810.local would have been so much simpler!
I'll try to get the old one repaired.
Update: thp describes how
to get avahi-daemon on the tablet.
Update 2: the old N810 is repaired (screen replacement
cost me 510 LTL, which is ~200 USD, at the local Nokia service center).
It now serves as an Internet Radio station at home.