Archive for Mai, 2008

Support for “math” added

Sonntag, Mai 18th, 2008

It was a rainy day today but luckily Norbert Jaspers got in touch with me last Friday.

Norbert added support for mathematical and chemical symbols to Wiki2Touch. Wiki2Touch is an offline Wikipedia reader for the Apple iPhone/iPod Touch.

Background: If you’re editing articles in Wikipedia and like some symbols you add TeX commands into a <math>-tag. This is then rendered by the Wikipedia software using TeX. The result is finally displayed as an image. TeX is great in producing nice formulas or other special symbols.

Norbert did the add-on without any changes to the current version. He exchanged every <math>-section inside an article with a link to a picture. He let TeX created the proper image from the original tag contents. This picture is added with a certain id to the image database. This works quite well. But you had to use a modified “articles.bin” database.

Norbert told me that he used some code from Erik Zachte. So Erik should be credited, too.

Wiki2Touch is now modified and the ids of the math sections are now calculated on the fly, the sections are removed and the proper images are inserted (if installed of course). Works like a charm:

Wiki2Touch featuring TeX rendered symbols

Wiki2Touch featuring TeX rendered symbols

Because the background of the images currently isn’t transparent you can easily spot what is a image and what is text.

A couple of things still have to get changed. But math support is now added to Wiki2Touch. While on that subject: I think there’s finally enough stuff together for a new version now. So stay tuned.

Thanks for all the support!

Tom

ImageGetter working on Mac OS X

Freitag, Mai 2nd, 2008

The “ImageGetter” is a Microsoft .NET framework application which downloads the images for Wiki2Touch. It’s not a cofortable or nice application, but that will be change now.

Here is the story:

I have a free day today. I’ve planed to start a new indexer for Wiki2Touch. Some reasons are to get more control over the articles contents and metadata. Further to join downloading and indexing article together with image retrieving into one application. Then taking the article categories into account in order to create packages only containing some but not all articles. Think of all medical related ones or all excellent ones. Support for some special namespaces (i.e. “Portal” or so) along with math support in the end needs a new indexer, too. And yes, uploading the results to the device.

I’ve decided to use the .NET framework from Microsoft. There were a couple of other option: C++, Java, PHP and so on. I like the .NET framework best and developing is much faster and less prone to errors than using C++. And also I love my Mac I still think the VS.NET developing environment from Microsoft is the best I can get.

When I got my Mac more than one year ago I first tried Mono. Mono is an open source project which allows you to run Microsoft .NET Framework based applications on non Microsoft operating system (like Linux, Mac OS X). I was disappointed in these days, it was not working for me, even not for very simple applications.

Anyway, because I only needed a few hours I’ve written the “ImageGetter” for Wiki2Touch in C# (.NET Framework 2.0). Now I was able to download the images for Wiki2Touch. But I was not completely happy with the result. The application didn’t runs directly on my Mac. I had to use Parallels which allows to run Windows on OS X.

But that has changed: Today I’ve compiled the “ImageGetter” using the latest version of Mono. And it worked right from the start. On Apple OS X. I only had to exchange the hard coded path separator char (”\” on Windows, “/” on Unix, now I’m using the value provided by the framework). Here is the result:

ImageGetter on Mac OS X
The “ImageGetter” running on OS X using the Mono framework.

Speed is fine: It downloads the images not slower than the version running under Windows. And for what reasons ever it crawls to more than 440.000 images I already downloaded in only 2 minutes. I don’t know why that is so fast on OS X, compared to Windows.

I see no reason why that shouldn’t work on Linux, too. The guys from the Mono project did a great job. The ImageGetter uses MD5 hashed, has a GUI, and downloads http content using threads. I’m impressed.

But it even getting better: The open source “SharpZipLib” library works without recompiling, too. This library is needed to decompress the Wikipedia article archives. The job the former “Indexer” did.

Conclusion: Everything is set up to create a nice and feature rich GUI based front end for Wiki2Touch which runs on Windows, OS X and Linux which is easy to use for everyone. I’ve just started.

I will upload the slightly modified sources to the Google code page during the day.