How to Spend a Friday Night

When I pulled out my eBook reader today (a Sony PRS-350 - quite old, but new to me - I got it a couple months ago from a friend who wasn't using it anymore), I was surprised to find the battery dead even though I'd charged it a couple days ago. One of the reasons I've really been enjoying the reader is because the battery usually lasts a week or more, much longer than the 10" Android tablet I was using previously for reading eBooks. It's also much lighter than the tablet. So I plugged the reader in to charge at work, and when it was time to head home, I unplugged it. It restarted itself, and then complained there were no books, the battery was dead, and it was shutting down. Huh? Ten seconds after that, it restarted, and eventually told me there were no books, the battery was dead, and it was shutting down. Rinse and repeat. No amount of button mashing - including the classic "hold the power button for 5, no 10, no 15 seconds," or even the recessed Reset button - would stop that behaviour. What would stop it was plugging it in again: it goes into storage-only mode. So I read up on the Sony readers, and found out that there are books they just don't like, and this is their response. Which explained the battery going flat: I had put a couple new books on the device when I last charged it.

As I left work, I explained to my last remaining co-worker that I'd be spending the evening fixing an eBook reader and then debugging JavaScript - because I really know how to spend a Friday evening. Not that he was much better off: he was doing homework for his course.

The last two books I added to the reader were the second edition of the very well regarded Eloquent JavaScript and the almost as well known Pro Git, also second edition. With the Sony's relatively small screen, I usually get epub - they work better than PDF. So I fired up Calibre and removed Eloquent JavaScript ... and voila, no rebooting. The author also provided a "PDF for Mobile," which I've installed on the reader without problems.

The JavaScript I'm debugging is another issue: I'm writing a single page app, and I'm having ongoing problems with localStorage. Mostly Firefox whining about SecurityErrors, which is usually associated with cross-site scripting - not the case here, as it's all happening locally at the moment. It's at least made me realize it would be a good idea to have the page respond politely if localStorage isn't available - instead of its current behaviour, which is to do a FULL STOP. Oops.