Sjeiti

PSP as e-book

Sjeiti @ 25/11/2007 19:44 in book, javascript, php, psp

When I first got my PSP I really dove into the Netfront browser and it’s DOM. First thing I did is create a better typing pad because the PSP’s build in typing thingy really sucks. Then I made an e-book reader: php converts txt format e-books to a local directory you can copy to your PSP. I must say the PSP reads remarkably pleasant (for a light emitting electronic device).

I’m traveling a lot by train again these days, so my reading has also gone up a bit. And since I do not always have a fresh stash of unread books I thought I’d liven my PSP e-book reader a bit.

There are a few problems with the Netfront browser on a PSP. The most irrating one is that you cannot store cookies on when accessing files locally. Cookies would have been the only way to make the PSP remember what line (page) you are reading. So you’ll have to remember the line yourself (so there’s also some free braintraining there).

For that same reason I’ve put in an input field through which you can go to a particular line. The php also renders a 15×1000 png with the line numbers. I’ve tried to go up to a height of 10.000 but not even my good old Firefox would take that (even though the image was only 40kb).

Also annoying is the fact that the Netfront browser is missing some events. The only way I found to get the scroll height is by means of a document.body.onmouseup. The onscroll event is missing, and even pageYOffset or scrollTop don’t work.

The memory also isn’t all that. Big pages really slow the browser down which you’ll notice when scrolling. I could of course divide a txt file into multiple pages to correct that, maybe later.

Anyway, if you have a webserver and a PSP and you like to read books, download this. Collect some books, convert them, put em on your PSP and start reading….

Here’s a great place to start your ebook search: http://www.gutenberg.org/!!!

– update –

I made it easier, just add books using an online form, download the zipped contents, and unpack it to your PSP.

Flash plugin bug

Sjeiti @ 09/11/2007 17:01 in actionscript, code, flash

I don’t normally talk this type of geek talk but I just spent hours trying to debug the weirdest IE glitch.

When I code Flash I mostly always code positions relative to the stage dimensions (stage.stageWidth and stage.stageHeight). This prevents the trouble you go through when your client decides to add another x amount of pixels to the dimensions.

Now I only got this IE glitch online, and only on my Vista OS. XP was working fine for me, but on other machines XP did the same thing. That’s already quite random behavior but it probably has to do with the Flash plugin version.

The first time the page loads everything is fine. But if you reload, or navigate away and go back, both the stageWidth and the stageHeight are 0 on the first cycle. This is probably due to cashing and initializing but a Flash plugin bug nonetheless. A way to circumvene this problem is to run an enterframe and only startup the lot when the stageWidth and -Height are something else than 0. Or hardcode these values of course, but who would want that?

Hope this helps some desperate souls out there.

as3 or p55

Sjeiti @ 02/11/2007 00:42 in actionscript, code, flash, processing

I have this attractor viewer written in Processing. I wanted to finish it up a bit: calculate Lyapunov exponent, save to movie, save online, etc. The problem is it’s written an older version of Processing. Then I thought: why not try as3 on for size. It’ll be faster for me to write since my Processing is getting a bit rusty. Well I got halfway and I’m going back to Processing for this. Just compare a million iterations in Processing to the same in as3. Processing kicks Flash’s ass! I just hope Processing has gotten a little better while I was away. I do hope I’ll be able to save movies.