Again with more gadgets

Well, my daughter was born this september, and she's still being a bit grouchy, so you'll forgive the lack of posts.

First of all, while she was sleeping in the first months and I was exiled to the living room as the little one was co-sleeping (before we discovered that she really hates it and would rather be in her own bed... She's strange, that one), I found time to update cbrPager somewhat. The main gain was the addition of background threads to pre-load pages. Oddly enough, page switching, while twice as fast, is still slow; it looks like the N800's relatively puny processor is having trouble just scaling the bitmap. I can't very much scale it on load, because the user may require it to be resized. But since then, very few changes. One pending feature request which I'll get around to implementing someday.

Second, I decided to take the plunge after much consultation with online price comparison engines and reading reviews, and, basically, the result is that I'm writing this from an Acer Aspire One AOA110-1698 netbook. It's going to replace my desktop completely. In doing this, I get two advantages:

  1. I hope to free the office to become the little one's room as she becomes older. I'll only require a desk that can hold the 22' LCD, the netbook in front, the external hard drive and DVD-ROM, and a keyboard drawer. This means not much depth is required, and this gives us a lot of flexibility on the size of the desk that I can live with.
  2. I can actually write this while watching the Dear Daughter sleep.

The latter was not part of the original plan, but I've got to admit, the Atom is a pretty amazing chip. It's faster than my old Athlon XP 2000+, and the GMA945 graphics, while not really the speediest in the world, are still quite a bit faster than my old Radeon 9000. Now, I don't recommend using that machine as a primary machine unless you're upgrading from an old clunker like mine; if right now you have a quad-core bomb, this little netbook won't impress you too much. But it's plenty fast enough for my needs; I even got some programming done on it.

Acer Aspire One Mini Review

This is turning into a mini review, so let's just get it done so I can gush about my daughter at the end of the article :) First, let's cover the external appearance of the device.

When you get that machine out of the box, it can't help turn heads. Everybody at the office wanted to have a look at the thing.

The shiny body, as often mentioned, attracts fingerprints more than anything else, so it doesn't impress me that much. Build quality is good, feeling as solid as my Dell corporate lappy.

The touchpad is quite small, and this can be annoying; unless you give it very high acceleration, you'll have trouble traversing the screen in a single swipe. I highly recommend using an external mouse for any kind of serious work. Still, it's built-in, and I still use it quite a bit when no at the desk.

The keyboard is the main reason I chose the One over, say, the Asus EeePC 900A or the Dell Mini 9. It's simply amazing. It's as usable to me as a fully laptop keyboard, and the key stiffness is even better. Key travel is great. Acer can do really nice hardware when they care, so it's too bad their stuff is usually so crappy. But the one feels more solid than the cheaper 14" laptops you'll find in brick-and-mortar stores (such as the really crappy 14" eMachine laptop that sells for the same price--trust me, unless you have to have a 64bit machine, the One is a better box). I only have one complaint about the keyboard: the left control key doesn't work very well, sometimes not registering. I solved that by remapping my caps lock key to control, which I do on regular PCs anyway. If the unit had been bought in a store, I would have returned it, but it's not worth the hassle since I have an alternate solution. One day, I'll take the keyboard apart and try to figure out if it's just a particle stuck under the keycap or something.

The screen is fantastic. At lowest brightness, it's very clear and sharp. You can plug in an external monitor. The graphic card appeared to give a fuzzy image at first, but after messing around with modelines in X, I got it to be pretty sharp. Too bad there's no DVI connector, but there's no room for both VGA and DVI, and VGA is still more widespread, so I understand the decision.

After having to crawl under my desk to reach rear-facing USB ports on my desktop, the side USB ports (3 of 'em, just enough for two external drives + the keyboard/mouse connected to a USB/PS/2 adapter) are really a blessing, and an unanticipated benefit to switching to a netbook from a desktop.

The 1698 comes with a 6-cell battery. It adds a silly protusion at the back, and I'm sure they could have come up with a better design. But do get a 6-cell. This thing has better battery life than my N800, and it shows... I don't use the N800 for web surfing much anymore (it's still getting much use as an e-book/comic book reader/time waster game machine). With the 6-cell, it's still pretty light, slightly less heavy than a thick hardcover book.


Unless you don't know Linux at all, ditch the Linpus that comes with it. It's not that bad, but it's not that interesting either. There isn't that much software available for it compared to, say, Debian, Ubuntu or the latest Fedora (Linpus is based on an old Fedora release).

I initially considered installing Ubuntu, but in the end, I opted for Debian. The SSD in the 1698 is only 16 GB (it's big for an SSD, but it's far from my roomy 80GB I got on my desktop--it's now in an enclosure serving as the drive for multimedia stuff). I'm very satisfied with the boot time (about 20 seconds, not visibly much more than Linpus) and hardware support (full, after some monkeying around).

To install Debian on the AAO, the best hints are on on the Debian Wiki, these guys' blog (it was actually very, very helpful), and the kernel built by this guy (follow the link in the message). I had to monkey around with the kernel sources because I wanted to use madwifi to get the LED workings, and the headers package wasn't working right, but besides that, everything was very smooth.

To get the external screen working at full resolution, I added the modeline as explained somewhere (I can't find the link). The modeline has to be added to the Monitor section. For 1680x1050@60Hz (Samsung SyncMaster 2253w--it was a steal at 200 CAD), it's

        Modeline "1680x1050" 149.00 1680 1760 1944 2280  1050 1050 1052 1089

And then xrandr will see the right resolutions. I think it reads the resolutions from the built-in panel and ignores the external monitor; looks like a bug in the Intel video driver.

To get the screen switching functionality, I used arandr to create the scripts, and tweaked them a bit. In xfce, it looks like xfwm4 is a bit dumb when the monitor is added after X is started. So, the script to switch to the dual-screen configuration looks like this:

killall xfwm4
xrandr --output TV --off --output LVDS --mode 1024x600 --pos 0x1050 --rotate normal --output VGA --mode 1680x1050 --pos 0x0 --rotate normal

And everything works find. It's best to boot X without the external monitor plugged in, or Thunar has very tiny fonts when you unplug the VGA and switch to internal panel only. Don't ask me why; there might still be some glitches in the RandR extension. Still, RandR is really, really cool, and it looks even more flexible than many Windows XP display drivers (dual screen support is sometimes spotty--the worst part is, it's really driver dependent...).

I also installed XP on a small 4GB partition, just for the odd game that doesn't run in WINE or Dosbox. Install was OK, but installing the updates was really, really slow. I thought it was the SSD that was slow, and maybe that's part of it... but maybe it's just Windows Update. Someone at the office had to install SP3 + updates, and it took him as much time on his relatively fast desktop with a good 5400 RPM hard disk as on my paltry Atom 1.6 GHz with a really slow SSD. So, YMMV. If you're a heavy XP user, the hard disk may be a better choice. The external drive is a good compromise; I'll use it for heavy data crunching. But still, Windows really likes writing all over the disk. Use FAT32 and no swap.


I still haven't tested the camera or the card readers. I'll test the card readers soon, moving the /home to a Class 6 8GB card; this should be faster than the SSD. When SSDs become cheaper, I'll swap the built-in one. In general, it's not that slow, but once in a while the whole system locks up waiting for the disk, and that's really annoying. Still, I like the SSD--it stays cool and boot times are really, really good with it. Heck, it boots faster than the fancy Core 2 Duo laptop the office provided me, and that uses a 7200 RPM disk drive!

It's still somewhat fiddly to install other OSs on that thing. But it's workable. Linpus is OK, just not as nice as .deb based distros (why they chose Fedora as a base is beyond me).

I haven't installed Notebook remix, because it depends on GNOME. Why it's not a plain GTK+ program is beyond my understanding. Maybe I'll hack it up a bit, it looks like I've become quite good at porting GNOME programs to plain GTK+.

In Canada, you get the weirdo keyboard with an extra key. However, I don't find it that bad, it's actually quite workable. I just hit the backslash instead of the Enter key once in a while. Nothing too bad, really. The Page Up/Page Down keys around the up arrow are really placed in an ideal way.

There's this fan control thing that is suggested online, but it doesn't seem to work too well with the latest BIOS (fan keeps turning on and off). The fan isn't that loud anyhow; it's not really noticeable. Maybe I lucked out and got a version with a nice fan.


Overall, I'm very happy with this purchase (400$, taxes and shipping included, at Swift Gamers--the guy ships fast, he shipped same day at 19:00 and it got home the following morning!). Mobile computing is in, folks. We now have enough power at low enough prices that you'll see small, light lapops everywhere. And I cannot emphasize enough how small and light the device really is. The only thing that might stop it is the CPU makers' fear that it'll cannibalize the sales on their high-power processors. But I think that'll only delay the inevitable. Low power CPUs are now very powerful, and make no mistake, people want low power. Being free of the power cable was already very cool with the N800, but now, I have my full desktop's power in my hands, and it's just... really cool.

The future of computing may not be determined by trying to beat the physical limits so Moore's law can still be applied. I think it'll be about finding more power-efficient ways of eking out a lot of computing power in small packages, at least for the end users. The big CPUs will be relegated to server racks, where they'll serve the computing power remotely. Star Trek TNG's vision of a big mainframe with small tablets serving as terminals may be the true future, with ubiquitous WiFi or 3G/WiMAX giving fast access to centralized resources.

Or maybe not. I'm not tech pundit, I don't pretend to know the future. But it's a really nice way to organize one's work, in any case.

And now, for something completely different...

This is usually a technology oriented blog, but I'd be a very poor father if technology were my only concern.

Stéphanie Nguyen-Emond came into my wife's life and mine this september, and despite the sleep deprivation (that little rascal was sleeping only 10 hours a day at first, and crying all the remaining hours of the day--with very little reason, believe me!), the worries about the little one not drinking well, the diapers, daddy getting sprayed with the little one's waste products several times, the Dear Daughter twisting around whenever she's being picked up (she wants to see stuff, and hates it when she's not facing outwards), etc. etc. etc... she's given my life meaning and purpose.

She's a robust baby, with very, very good lungs (we can attest to that every time she wakes up), drinks too fast sometimes, and has a wonderful smile when I change her diaper.

As a parent, you have to learn to be patient. Sometimes, I get very frustrated, and then feel bad about it because I feel I should have more patience, more skill calming her down. But the minute after she gives a really wide smile and coos, and then I feel like everything is all right with the world. Despite the crazy economic times and the uncertainty about the whole financial system, I find that I'm still optimistic. I'll work hard to leave her a nice world, and the difficulties we live right now will no doubt yield some good in the end. Hopefully a world that is more just, less crassly materialistic, and focused on protecting the middle class rather than the rich and powerful. One can only hope. Society is a pendulum, and it has swung too far to the advantage of scoundrels and con artists. It's only a matter of time before it swings back, and I hope I'll live to see it so that's the world my daughter will inherit.

Regardless, I'll be there for her, always. And that has to be worth something. Stéphanie, ton père t'aime et sera toujours là pour toi.


Again with the N800 :-)

Well, I'm at it again. I wanted to read mangas on the N800, but the only working application, Comix (a Python application) was somewhat slow. Not the Python code itself, which was actually quite fast, but rather the overall approach. You see, to speed up processing, Comix would always unzip the whole comic archive file (cbz or cbr) in a temporary directory and read from there. It does make page flipping faster.

It also fills the N800's main drive as fast as you can say, "out of disk space" :-)

The approach is acceptable on the desktop, where at worse, we're talking about 50 MB of temp disk space for really large archives. Not an issue, even on my relatively small (by today's standards) 80 GB drive.

On the tablet, though, not only is it problematic (you get 256 MB of drive space and that's it!), but even writing to external memory cards is really, really slow. Expect 2-5 minutes before you see the first page, and meanwhile Comix is hung. And woe to you if it crashes–you'll have to recover all this space at the command line.

The crash thing didn't bother me too much, but the slow boot time did. I read fast, especially manga which tend to have relatively little dialog per image. So I started looking for an alternate solution that ran on GTK+ and that I could potentially port.

After swimming through numerous Java applications (useless on the tablet), there were two candidates: cbrPager and Comical.

Choosing the One

Comical initially looked more interesting. It embeds libunzip, unrar (through a special exception to the GPL in the license) and did all image decoding in memory, which I thought could be faster. cbrPager, in contrast, had a similar approach to Comix (unzip to a temporary directory), except that it unzipped only one image at a time. I worried that this would be slow. Also, cbrPager used the Gnome libraries, some of which are not available on Maemo, and I didn't really expect to have to rewrite parts of the UI layer. But unfortunately, Comical is written on top of wxGTK, which is a bit problematic on Maemo (there's a port, but it's hard to get from a repository). So I decided to take a look at cbrPager and do an initial "straight port" using the Gnome canvas and disabling parts of the interface, just to see whether it was fast enough to be a workable base and not force me to deal with wxGTK.

It was quite fast, thank you very much.

I immediately knew I had a winner.

Modifications: Front end

I Hildonized the toolbar and main window, which was relatively quick. Unfortunately, one of the features that's really useful for tablet-based comic book readers is rotation. Comix had it, together with very high quality antialiasing. A small modification to the cbrPager source gave me antialiasing and rotation, but not both at the same time; rotated images looked really, really bad.

Since I wasn't too happy with using the Gnome canvas anyways, and that it was the last Gnome dependency left (I had had to remove all others), I decided to try to find a nice way to replace it. Initially, I was quite ambitious, thinking I'd do raw updates to the main widget. Looking over in the gdk-pixbuf library, it looked possible, as that library had all the bells and whistles I needed: antialiasing with selectable algorithm, automatic rotation, image scaling, etc.

But then I started to think about how to embed the image render in the main view, and my head started hurting, thinking that I'd have to write a GTK+ widget from scratch (it's not hard, exactly, as I've learned later, but I had never done something like that before...). In the end, I decided to look for a plain image viewer (initially I though gqview, since it has the features I'm looking for) and see if I could scavenge their widget.

In the end, I found GtkImageView, which had a ready-made widget and was only lacking rotation. I added rotation and was a happy camper.

Well, almost :-) I had introduced a memory leak that ate all the RAM of the tablet really, really quickly. Fixing it was really simple, but that didn't happen before I crashed my tablet several times in an effort to figure out what exactly was going on...

From the front-end point of view, I then added a few tidbits: scrolling through direct pen usage, auto-rotate, bookmarks (my wife asked for that one really fast...), persistent zoom settings, fullscreen... All of those were pretty easy to add, which speaks volumes about the initial cbrPager code's organisation (hint: it's pretty nice).

Modifications: back end

I then got annoyed that users were forced to install unzip. One nice feature of Comical is that it embeds the unzip code. So I wanted to do the same. For RAR files, I chose not to do it right away because of licensing problems.

To do that, I needed to extract the archive reading logic. It was embedded in command line use. So I chose to encapsulate it in a gobject. This was probably a bit overkill, but it made sense with respect to the use of the GtkImageView gobject.

I first moved the code of the fork/exec logic into a gobject and got it to work that way. Once that was done, it was really easy to get it to work with direct calls to the unzip library.

I had wanted to extract the image bits in memory and decode completely in memory, thus removing the need for a temporary file. I didn't do it that way right then because there were reports of really slow decoding when doing that through pixbuf loaders. Since image decoding was actually slower than archive reading, I decided to pass for now.

Writing a gobject was kinda cool, but those things are really quite heavy... there's a lot of macros and presumably some overhead. Since the same 3 objects are reused throughout the application (one object per supported archive type), the overhead is negligible, but if I had to do it again I'd just go with a struct and function pointers, although it feels kind of silly to do that given that there's already gobjects in the application.

The result

Well, just go download it at https://garage.maemo.org/frs/?group_id=777&release_id=2075.

You can see the announcement on the Internet Tablet Talk forum. There's screenshots.

Just beware, you need a memory card in the internal slot for this to work... I'll work on a fix tomorrow.

Credits, thanks, etc.

Many thanks to the original author of cbrPager for writing the initial code, and for putting up with me :-)

And thanks to the ITT community, who will be my beta testers, as usual ;-)


N800 Update

Well, after a couple of months with the N800, I must say this was one of the better purchases I've done in electronics since getting my first computer. It's an extremely useful device.

I got a second one for my wife, and it came with an iGo foldable Bluetooth keyboard, which was a pretty good deal. The keyboard is a nice addition, and next time I go to a convention, I'm not bringing the laptop, or at least, not for anything except the tutorials. The tablet is much nicer to carry, its battery can last much longer, and I look like a total geek when I unfold the keyboard and start typing away. Given that I'm now comfortable with my geekiness, this is actually an advantage :-)

Looking at the price I paid for both tablets, it was actually cheaper than many MP3 players, even when factoring in the price of the additional SDHC cards.

So, here's my appreciation of the device after two months of use:

  • For e-books, total success. I'm nearly done with the Honorverse stuff, and I'll move on to other books soon.
  • For tech books, I haven't used it much so far because I've been commuting by car lately. But my wife is using it to study for the SCWCD, and although in her opinion it's better to look at her desktop LCD, the tablet is good enough for reading in public transit. And much less heavy than the SCWCD book...
  • For the Internet, it's really incomparable. No device that size can do it all like this one. I wish they'd upgrade to Firefox 3's final engine instead of an alpha 1 derived version, though. No doubt that's coming soon.
  • For videos, it works very well, although sometimes hitting the optimum encoding can be tricky.
  • For games, it's better than I thought in the end. iNES has excellent performance, so old NES games play extremely well. At least iNES has a saner on-screen button system than FCEUltra. Star Control II (The Ur-Quan Masters) is also extremely playable, but you need a keyboard. I use a small PlayStation 2 USB keyboard with an adapter for this, and it works kind of like a mini console controller.

Also good news, the latest release of Maemo, Diablo, has been officially released to the public. I can report that it was a pretty painless upgrade. The browser and flash support seems somewhat snappier, and I'd say the overall OS feels more solid overall. Except for the weather desktop applet, everything from Chinook (previous release) worked very well.

So Nokia can count me amongst their satisfied customers.


Behold my new toy!

Much to my wife's chagrin, I've acquired a Nokia N800 Internet Tablet. It's been a long, long time since a piece of hardware interested me, so let me tell you about this one.

First, though, some background on why I got one. I got fed up of the huge boxes of books (mostly mine, and mostly old sci-fi or computer books) that take a lot of space in our closets. Also, I'm getting worried that my main bookshelf will buckle and fall under the load; the tablets have nearly 3/4 of an inch deflection at the center. Doubling up the number of books on them was probably not very smart...

So, I decided I'd get an e-book reader.

After a lot of research on the Kindle, the Sony PRS-500 and 505, the eBookwise 1100 and a few rare and too expensive other options (Cybook, etc), I settled on a previous-generation Sony. Unfortunately, it's not really a common device in Canada, so I went to eBay.

The price was rather high in my view, for a previous generation device, and all sellers were shipping by UPS (I really don't like getting packages by UPS, the distribution office is at the other end of the city and they never deliver the package at a decent hour). So, I started looking for other options, such as PDAs, with the philosophy that if I paid more than 200$ for something, it better do more than one thing.

Research on this took a lot of time. Did you guys know that PDAs are a disappearing species? Which is bizarre, in my view, because they are useful beasts, especially with WiFi. But smart phones are killing them. Unfortunately, for e-book reading, a smart phone is not an option... especially since I already have a cell phone (the cheapest I could find) and have no desire to change providers/pay a lot just for getting extra PDA functions.

But after a while, I found a site that mentioned the Nokia 770 Internet Tablet. Being curious (what's an Internet Tablet? Since when did Nokia do something other than a phone?), I researched a bit, and here's a capsule version of what I found:

  • The Internet Tablet series of devices are 4-inch, 800x480 screen devices with WiFi and Bluetooth included;
  • The screen size/resolution yields a totally crazy 220 DPI screen;
  • The screen size means that you can browse web sites from the tablet with a minimum of scrolling;
  • The screen size also means you can read PDFs in landscape mode without too much trouble, which is a HUGE advantage compared to the Sony PRS 505, which doesn't render PDF too well. As much of what I intended to read on it were technical books that tend to be distributed in PDF, this was an excellent advantage;
  • And, the clincher: this thing runs a variant of GNU/Linux known as maemo, and hundreds of programs have been ported to it!

I originally thought of getting a 770, but in the end, I settled for an N800, which looked better, had a faster CPU, more RAM, and as an added bonus, is somewhat lighter.

So, what am I doing with this thing?

  • Reading e-books, of course, mainly David Weber stuff I got on the CD that came with the War of Honor hardcover I bought some time back;
  • Reading tech books, especially since I hacked evince to be a bit closer to my preferences (I wanted the paging buttons to scroll by screen size rather than go directly to the next page);
  • Browsing the internet. Instead of staying in our home office to browse 'til the wee hours of the morning, I can finish reading my favorite blogs elsewhere, the idea being that I don't need to stay in front of the PC 'til the wee hours. It's kinda hard putting this in practice, though;
  • Watching video. This was a surprise, since the tablet is not meant for that and apparently, Nokia sort of goofed the video hardware on that count. But when properly re-encoded, the screen is gorgeous enough and the speaker good enough quality that it's quite a pleasant experience, and doesn't tie up the TV screen. Great for watching smaller clips. My wife and I have been listening to a couple of episodes of La Linea every day when we feel like it;
  • Games. This was somewhat disappointing so far, because the d-pad isn't the best thing in the world, emulators run slow, and button placement is awkward. ScummVM was the best success so far, probably because it's already mouse-based.

But the most unexpected development of all: lately, I've stopped having much fun with my Xubuntu box, because, besides small, occasional sound card glitches I had when following Hardy, I've been having no problems at all... and no incentive to do a re-install. In fewer words, I was getting bored. But the N800 is a new environment. Even though it's GTK+ based, there's lots to do--it's still somewhat rough, and there's a lot of stuff to port to it.

I got the urge to hack on it just for fun.

The first thing I did was recompile evince (a PDF viewer, slightly more flexible than the one that's included by Nokia) to give it key assignments I like better. If anybody wants the patch, I'll be glad to provide it (it's quite trivial). Setting up the cross-compiling environment (known as scratchbox) wasn't the simplest environment setup I've ever done, but after a couple of tries, I got it to work right. I had to try a second time because somehow, I hosed the first version when switching targets.

The second is far more interesting. As I was complaining about the hand writing recognition on the tablet, somebody at the office pointed me to the QuikWriting system by Ken Perlin. That system lets you write without lifting your pen, and the overall mechanism is much less error-prone than hand-writing recognition. I looked and looked for an implementation and could only find an old one for Qtopia. I really wanted to try it out on the tablet to see if it was a viable option.

Finding no port, I ported it myself. The result is available in the maemo Garage. It's not quite finished--namely, I'm a bit annoyed at the current letter display, and international support would be nice. I'd also like to refactor the code and render the input areas using vector graphics instead of a stupid bitmap.

Still, it works right now, and I'm using it in production.

Doing this was the most fun I had in a long time.

As for my wife, she asked me to buy her her own N800.

A nice new toy, indeed! I'd recommend it to any GNU/Linux-head out there. It's pretty capable, the build quality feels solid, the battery life is good, and the screen is fantastic. I give this device 9/10, and I'll be sure to look out for the next version.

(Addendum: yes, I know of the N810, but the hardware is very similar, so I'll probably skip it. My dad got one, though, and he's also having fun with it.)


Musings from EclipseCon 2008, part 1

I totally forgot to mention it for the longest time, but having a fruit hat picture on my blog landed me a free entry to EclipseCon in Santa Clara, CA, USA. Alogient was kind enough to pay for my transportation and hotel room.

I'm writing this from there; the connectivity is really good overall, I wish I'd been wired like this last time I went to a conference...

I'll have more things to say about the overall experience later, but right now, there's an interesting thought I want to write down.

Today's keynote was given by the guy behind Fake Steve Jobs, who, at one point, made an interesting (if not very original) parallel between Apple and a cult. It's mostly interesting because during lunch, I sat at the "Maven" table (and unfortunately, none of the m2eclipse or q4e guys were there--guys, you suck! :-) and one of my lunch colleagues made the reflection that people get on the Maven train because they've invested so much time learning it that they want it to be worth something.

Note that the guy saying that being wry, and we all had a good laugh. But it got me to think that Maven could be seen as a cult as much as Apple, but for totally opposite reasons:

  • Apple is a cult because they do products that are designed and work really really well the first time you pick them up;
  • Maven is a cult because it does not work at all the first time you pick it up, and probably the converted really just want other people to suffer as much as them :-)

So, now you can decide whether that's the reason I'm a Maven fan...