Archive for Dezember, 2007

Latest progress on iKi

Montag, Dezember 31st, 2007

Before my vacation time ends next week I wanted to have a more or less complete and stable version. So what have I added or changed in the last few days:

  • The template processor was completely rewritten. I’ve learned that memory is not a problem on the iPod Touch but speed is. The new approach uses much more memory but is also much faster than the old version. While we’re on the subject: Speed is fine, but not amazing. it could happen that the iPod needs about 5-10 seconds to generate a large article. On the other hand the mobile safari need also a lot of time if a large article is displayed.
  • I’ve added every parser function I’ve found in the documenation: {{lc:xxx}}, {{LOCALTIME}} and so on. Some are not very usefully, but some are: {{NUMBEROFUSERS}} which give you always 1 and that’s most of the time totally correct :)
  • Added #switch and #ifexists parser functions. So every parser function except #ifexpr/#expr is working. The later are implemented as a stub.
  • Added the Table of contents and the related handling (__TOC__, etc.)
  • Port, binding address and base path can be change on the command line
  • Namespace handling for different language editions is working nice. Even links to other editions are supported (if installed of course). Installed editions will be detected automatically.
  • Added a config file for language/edition specific settings: The name of the template prefix or the title of the toc for instance.

BTW: The same code works on the MAC also. Nice for debugging. Compiling for a PC or another PDA should also work.

Still missing is a nice tool for splitting, indexing or even downloading the files from Wikipedia. Further, there is still no application to control the server on the device. You have to start it manually using SSH.

iKi - Some pictures of the project

Montag, Dezember 31st, 2007

I’ve made some images and screeshots so you can see how the application is working. I’ve used the German edition, so sorry if you can’t understand the articles.

First my iPod Touch with iKi running on it:

iki on the iPod Touch

(Sorry for the reddish background because of the artifical light.)

 

The home screen with a search phrase entered:

The home screen

(This time I’m using port 8080)

 

As the search phrase did not meet an article title exactly the search results will be presented:

Search results

(Actual the search is not a ‘like’ search but only looks for the phrase as a part of the articles titles)

 

An here is the result:

The article about the element “Gold”

(Isn’t the table nice?)

 

Another table and the toc box and finally some enumerations, internal and external links and the list of references:

Another table and a part of a TOC box

 

 

Enumerations, external links and a list of references

 

 

Offline Wikipedia reader for the iPod Touch/iPhone makes progress

Mittwoch, Dezember 19th, 2007

First of all, the baby has a name: iKi. Not very fantastic, but rather short. I hope nobody will get angry about the name.

But well, during the last couple of days I’ve made some progress:

  • Every article is found now. This includes template. I’ve rewritten the indexer so Xapian now gets only utf8 coded keywords or article names. Every xml/html coding was removed. In the end, I was able to get article with titles like “template:„Movies“”, including the quotations. Or article with German “Umlaute” (ä, ö, etc.)
  • Most of the templates are expanding well and will render fine. Missing are some like “#ifexp” which is hard stuff to do in C++. At least for me. But they are not often used.
  • iKi has a nice start page which allows you to enter the desired article names or search phrases. Searching is working nice, even with multiple words.
  • Added some style sheets so the result pages are looking nice now.
  • Support for references, tables, enumerations, definitions, internal and external links (doesn’t makes sense without the internal ones), headlines, and so on…

What’s missing?

  • A frontend for the Mac/PC to get the indexer do his job and afterwards upload the result to the device.
  • Not tested with the English edition but it should work (never trust a developer when he says “should”). Some “keywords” must be translated.
  • TOC and categories (the later must be prepared on the host computer).
  • Images: The program tries to load them but if they aren’t there you get an “Image not found” image. I don’t know where I can get the images right now or how large they are. Anyway, the image titles are displayed and thats nice sometimes for background information.
  • Some issues in rendering still existing but mostly for the really complicated articles (Deutschland, München, …)

I will post some pictures soon.

Stay tuned.

BTW: The wikipedia markup language is a crap. For instances, does ”’ means start of italic (”) and a quotation (’) or bold (”’)? It means bold! Ah ha. Looks like that it was designed before xml hits the scene. You can even mix it: ”Italic on and ”’bold also now ”italic of but bold still on”’. Uahh.

Offline Wikipedia on the Apple iPod Touch

Dienstag, Dezember 11th, 2007

Topic says it all. The iPod Touch (as well as the iPhone) is a great device. As my NAS it’s more or less an embedded device, too. And it shares an ARM processor.

The Touch has enough memory to hold the German (app. 900 MB, zipped), the English (app. 5 GB) or both Wikipedia databases. But there was no reader. Based on the ideas in the article “Building a (fast) Wikipedia offline reader” by Thanassis Tsiodras I’ve written a C++ program. It is in fact a small webserver, including a (simple) parser and a simple html renderer. And the ability to get the right wiki markup based on the articles title.

BTW: Nice to have a webserver on the Touch anyway, think of viewing pdf or so.

After dealing two days with the developer toolchain for the iPod Touch (same as the iPhone), cross compiling xapian and bzip2 (the later was easy) it is now running. Wow! It took 3 hours to get anything onto the device (using MacFuse, ssh-filesystem and WLAN).

Now the fun part just begins: Brushing up the renderend html, addind table support, adding a nice search page, adding a logic for disabling not working links (means not written articles).