a blog by Marius Gedminas

TOC marks for FBReader

Weasel Reader had a feature: it would display marks for all the bookmarks in the indicator line. Handy when you're reading a collection of short stories and want to know how much you'll have to read until the next one.

Today I hacked up this feature for FBReader. Get the .deb in the usual place.

FBReader with Table of Contents marks in the position indicator
FBReader with Table of Contents marks in the position indicator. The book is An Oblique Approach by David Drake and Eric Flint, from the Baen Free Library.

While I was doing that, bzr decided to shake my confidence in it and started throwing assertion errors right and left (no link, the mailing list archive lags horribly).

I've got a Nokia N800!

Nokia kindly gave me a developer discount code for the N800 internet tablet, a few weeks ago. That was a very pleasant surprise. Actually buying the thing was complicated, to put it politely. I finally laid my hands on the device his Monday. Yum, yum!

Changes I like best: extra RAM, speed, storage space. The built-in stand. Position of the headphone and charget sockets. Screen (shinier, not as grainy, although I think it reflects a bit more ambient light than the 770 used to). The ability to reorder status bar icons. New Opera toolbar. Backup application that works without killing all other applications and entering offline mode. New themes. Battery time estimates.

Changes I'm not sure I like: new stylus (too short). Lack of hard case (without it I'm forced to lock the keys when I stuff it into my pocket, but the tiny power button is hard to press). The new shape (it's harder to hold it in my right hand while pressing the down button, which is how I like to read books sometimes). The tearing effects when panning in Opera.

The new Media Player merits a category on its own. It indexes all the media files (songs and videos) in ~/MyDocs and in all memory cards automatically. That's very nice when it works. It's frustrating when it doesn't. There's no way to force reindexing after you shuffle files around manually, and no indication when the automatic reindexing is finished. You just have to wait and hope that it will catch up. Also, sometimes the user interaction is very strange: bug 1056, bug 1063.

Overall, I like it better than the 770.

screenshot of the pretty virtual keyboard (Balaton theme)

Sleepless nights

My sleep schedule is totally out of whack. I cannot sleep before 3 AM (sometimes I stay awake until 7 AM), then I cannot get up before noon.

As a result I have more free time for hacking. Today I tried to play around with Metacity's compositor, with some mixed success. I also built a patched FBReader with a numeric page indicator tweaked to the size and position of my liking (screenshot). Bzr rocks for maintaining branches!

eazysvn also got a facelift today. It is now installable with easy_install.

<rant>
I do not like easy_install. It wants to install stuff into /usr/lib/python2.4/site-packages. That location is reserved for Debian packages. A sensible default would be /usr/local/lib/python2.4/site-packages or, preferably, somewhere in my home directory, with the caveat that I'll have to set up PYTHONPATH myself. You can force easy_install to do more or less what you want, but that involves reading tons of documentation, invoking arcane multi-thousand line scripts, or sacrificing small animals. Not my definition of "easy".
</rant>

Last night I submitted a patch to add a tiny help topic to bzr. Before that, nights were dedicated to zope.testing and pyspacwar.

In the mean time, actual paying work suffers. Karmic retribution for those three 11-and-a-half hour days I spent at work during the first week of January? No, just lack of willpower to force myself to go to sleep (or wake up) early instead of, for example, blogging.

zope.testing

Did some hacking on the Zope 3 test runner:

  • Fixed test failures on Python 2.4.4.
  • Fixed some typos in comments and strings.
  • Make test.py not trap Ctrl+C so eagerly.
  • Make test.py -fu run both functional and unit tests.
  • Make test.py -s src/pkg run the tests in the pkg package.
  • Make test.py --list-modules list the test modules that would be imported.

The riskier features I've implemented in separate branches (test-fu, filter-by-dirs, list-modules). Subversion is not very good at handling branches, but that's where ezswitch.py and ezmerge.py come in.

The ultimate goal is to retire the SchoolTool test runner and switch to the Zope 3 one (the SchoolTool project already did so). There are two remaining features that I would miss:

Random hackery

We finished a rather major restructuring of the internals of a system last week at work. I finally got to experimentally test Martin Fowler's refactoring techniques (small steps) on a big change. It was fun and I tended to stay late at work because I wanted to finish what I was working on. I missed that feeling. Oh, and Subversion is good, but merging is a big inconvenience.

During nights I worked on PySpaceWar: added sound effects, support for background music (but didn't look for freely redistributable soundtracks yet), some visual effects, some more configuration options. And once again playing the game became more interesting than coding it. I can beat the computer with 100 kills to its 50-60. I should release a new version soon.

Today I discovered the cause of a long-standing problem of random reboots of my Nokia 770. Turns out FBReader leaks file descriptors, and once the system runs out, some important process crashes and the device reboots. A patch and a fixed .deb are on my FBReader page (of course I also sent the patch upstream).

Meanwhile Nokia released the N800. *drool*. Twice as much RAM, twice as much "disk" space (flash memory, actually), faster CPU, two full-size SD slots, interesting software updates. I want one, but since Nokia only sells them in a few countries, I'll probably have to wait until somebody I know can bring one to me.