SQLite on .NET CF

SQLite just doesn’t stop to amaze me. First, we got it to compile on our small ucLinux based barcode scanner where it not only works flawlessly, but extremely fast too.

Now I thought about using SQLite in a little PocketPC application I intend to write using the .NET compact framework. This after some very bad expirience with SQL Server CE

  • There is no useful frontend to modify the data in the sdf-File: There is no tool for the desktop (besides using SQL-Server and then replicating the data to the device which I actually got to work this march or so, but it was a major pain in the ass to set up and is no solution to me. I mean: Why should I install a whole SQL-Server just to get some test-data to a smart device?) and the little frontend on the PocketPC suffers from the small screen and the lack of a keyboard.
  • Despite everyone claiming it’s fast, it isn’t (though this certainly is relative. I’m sure, the marketing departement of MS is still conviced that it’s fast). Where some operations may be, others are not. Searching for strings is an example of extreme slowness.
  • Starting an application using SQL Server CE takes about a minute on a usual 400 Mhz PocketPC. Way too long to be used in production with customers.

So, using a leightweight local SQL-engine which is fast even on a 66 Mhz CPU without MMU sounded quite appealing to me. Just: How much work would it be? How well would I be able to integrate SQLite into .NET?

Knowing about the lack of features in P/Invoke on the compact framework and knowing that the SQLite API uses callback functions, I feared the worst, but fortunately, I googled before getting to work.

So, I found this project.

They provide you with a full-fledged ADO.NET driver for SQLite, so you can use all the database classes and components you are used to, while still profiting from the advantages of SQLite

Compiling it was easy (while they provide pre-built binaries of sqlite.dll and the P/Invoke-Wrapper sqlite_wrapper.dll, they do so only for ARM and the desktop version of Windows for x86, so if you want to use the emulator for developement, you have to build those two DLLs yourself – using eVC4) and a quick look (it’s already late now – I got up more than 17 hours ago, so I’m quite tired now) using the sample project here was quite successful: The application started (instantly, no wait) and displayed the data inside the SQLite-File.

So, the speed-problem is solved. What about the frontend? While I don’t know any Windows GUI frontends for SQLite (though I know they exist), I have already worked with the SQLite ODBC driver (it’s funny to think of that: Usually ODBC-drivers are just a middleware between the Application and the dtabase, but in case of sqliteodbc, the database engine is linked into the ODBC-driver. Strange) and of course the command line tool and the PHP extension. So for my purposes, I’m going to create the database using a PHP-Script on Linux and copy the .db-File to the PocketPC. As seamless as possible. No replication, no installation of servers, no nothing. Just plain old copy.

Soundblaster Audigy 2 NX Driver

If you are like me, then you certainly throw away or lose CDs containing drivers for your hardware. I mean: Why should you not? These days, every hardware vendor has the most current drivers on it’s webpage, ready to be downloaded.

Actually, using the drivers on the CD often does not even work… You know – little or now quality management.

But then, there is my Audigy 2 NX card. I bought it, so I can hook my AC3-Receiver to my ThinkPad when watching an occasional DivX movie with AC3-Sound. For that matter, I have not used the little silvery box for the last five months or so. As I noted before, I have long lost the driver CD.

You can certianly imagine how annoyed I was when I saw that Creative Labs only provides driver updates requiring the original driver to be already installed.

I don’t even want to think what I would have to do to get back to a CD or a full installer. I can well imagine that the support – if it even answers my calls for help – would really like to see me buy another package – just for a new driver CD (which I will lose again – eventually)

So, I needed another solution.

This is what I did:

  1. Plug in your the Audigy and turn it on
  2. Download and run the driver installer (the older of both versions)
  3. Wait for it to tell you that the software must be installed
  4. Go to [Path_to_profile]Local SettingsTemp (mostly c:Documents and Settings[your username]) and look for a folder just created. If you don’t want to search, use Process Explorer and look what handles the installer has opened.
  5. In this directory, you’ll find a folder named “Drivers”. Copy that to somewhere else
  6. Open the Device Manager (Start – Settings – Control Panel – System – Hardware – Device Manager or much faster Windows-Pause)
  7. Right-Click on your Soundcard (either not recognized or recognized as “USB Audio Device”), select “Update Driver…”
  8. Don’t let the assistant install anything automatically
  9. Provide the path where you copied the Drivers directory to in step 5
  10. Windows will install the driver which creative’s installer would not have let you to
  11. Click “OK” in the installer from Creative. It’ll think that the original software ist installed, re-install your manually installed driver, flash the card’s firmware and exit nicely

This saved me from a lot of stupid asking-arond or even re-buying a piece of hardware I already own.

I can’t understand why Creative Lab’s does not provide un-crippled installers for their drivers. This procedure is far from obvious and many non-geeks are probably not able to do this. If this policy should be a new business-case in selling more products, I don’t really see how this will work in the long run…

Anyway. I could get it to work and I will now please myself watching this DivX-Video using my beamer and my AC3-Receiver. ;-)

More programmers fonts

In an older post of Urban Mainfraime, I read about some fonts for programmers. Jonathan recommends Anonymous and Bitstream Vera Sans Mono.

While both fonts are certainly better than the omnipresent Courier, I still think, ProFont, which I’ve already written about is much better than te other two alternatvies.

ProFont is a Bitmap font, optimized for 8px size, which is incredibly small. Because every character is hand-painted, the font is still very readable desite it’s small size, so it’s great if you want to have much text on little space – als always when programming ;-)

Maybe it takes a litte getting-used-to, but every Monospaced font I’ve seen since I switched to ProFont in Putty, Thunderbird, Delphi, jEdit and all other applications, looks clunky and too large for my eyes. Try it!

RSS Readers for PocketPC

I really like surfing the web on my PDA while taking a bath. Every morning before leaving home for the office, I use my PDA to check my email and read some news-sites like Slashdot or the Heise Newsticker (which is available in a PDA-optimized version, which I have linked here)

Some days ago, I thought that actually reading all the RSS feeds I’m subscribed to could help me prolong my bathing-expirience, so I went looking for a decent RSS-Reader for the PocketPC. Here’s what I found (all products reviewed here understand all the RSS-variants and Atom 0.3 and work without a permanent connection to the net):

Egress

Egress is Shareware and costs $12. Like all the readers I’m reviewing here, I began using it by importing this OPML file. After importing, Egress insits on checking all the feeds for new entries, so don’t do that if you are connected via your cellphone. Of all the readers reviewed here, Egress has the best UI: The whole Channel-List is compacted to just a little menu bar at the top of the screen, leaving lots and lots of space for the entry itself. To the left is a drop-down menu showing all your feeds, to the right are two arrows to navigate within the feeds containing unread items.

While there is a “Manage Channels” function, it’s not possible to move imported channels into subfolders – at least I have not found out, how to do it

The content viewer somewhat supports HTML, though I’m missing support for the <pre>-Tag as I’m reading quite a bit of programming-blogs. Another thing that bothers me is the support for the four-way navigation button of my iPaq: Accitentally hitting left or right insted of down will switch to another unread blog. Paging back will not scroll to the point where you were interrupted reading. Additionally, in contrast to PocketIE, scrolling down using the nav buttons just scrolls a few lines instead a whole screen.

By clicking on an entry you can toggle it’s expanded/colapsed state. The former is used to read the whole entry, the latter just presents it’s title. Unread items are bold-faced

The reader has quite an extensive preferences screen and is the only application tested here where one can set the User-Agent-Header with which it should request the feeds.

A Today-Screen-Plugin provides an alternating view to new entries, but is not really useful.

Unless your are constantly connected, you should turn of Egresses feature to automatically refresh the feeds as it will trigger the Windows CE autodial routine for every feed in your subscription list, not stopping the process when you hit cancel, which is a major pain in the ass

PocketFeed

PocketFeed is the only free software I’m reviewing here. It’s interface is devided in two parts: At the top there is a tree view containing the feeds and the entries. Unfortunately, unread ones are not displayed in boldface or any other way.

The bottom half is the reader which does not support scrolling with the navigation buttons.

There is no today-plugin or a way to automatically check for updated entries.

All in all, PocketFeed is a nice start, but many features are still missing.

PocketRSS

PocketRSS, like Egress is Shareware. It costs $5, so it’s slightly cheaper than Egress. The user interface is similar to the one of PocketRSS (with a tree view taking a lot of precious screen estate), though this time, the viewer is at the top of the screen. Unfortunately, scrolling with the navigation buttons changes from entry to entry and does not scroll the current one.

Like Egress, PocketRSS has a Today-Screen Plugin – the most featureful of all the readers.

Settings-wise, there’s not much the user can change and the settings are devided into a “Preferences” and a “Configuration”-Menu. Not that useful.

Just by looking at the review-length alone, you should be able to see, which reader I prefer: It’s Egress. Egress is the only one that’s really parctical for me (many full-content feeds subscribed). The problem with taking screen estate and the non-working navigation buttons is reason enough for me not to use the other two programs

Granted: You can switch off the panel, but it involves always more tapping than with Egress

Additionally, Egress is the only program properly displaying the unread-state of the feeds – an absolute must for me.

While there are some somewhat annoying buglets, I probably will pay those 12 bucks, but not without directing it’s author to this review here, in the hope that those little problems get fixed eventually.

PS: I’m writing this entry on the just repaired IBM Thinkpad. I will write about the wonderful experience I had with the IBM support in another entry.

What the heck?

Friendly error messages?

Then tell me, what PHP wants to say me with this:

Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/pilif/…/include/simple_news.inc on line 131

Whatever. Back to work.

Unforeseen annoyance

Today something happened that I never though could happen:

My Thinkpad died.

And I really mean it. The device did noting more than beep once long and twice short. A quick look at the very informative support pages of IBM showed me that the worst possible thing happened: Failure on the System Board or the RAM (which is just as bad as I have only built-in RAM).

A call to the IBM support line got me a ticket number and about half an hour later, they told me to send the machine to their repair center but because I can reach that by train and foot in about 15 minutes from my office, I’ve asked whether I can bring it to them which they accepted.

So now I’m working on a helplessly underpowered Thinkpad T41 that was lying around in the office. Starting Delphi takes a bit more than a minute just to give you an impression of it’s speed (256 MB of RAM is much too less for me)

They told me that the computer will be fixed in two to three days, so I will have to live through the week-end without my beloved Thinkpad. Too bad.

This is the first of about 7 Thinkpads in my life where something like that happened which should speak a lot for their incredible quality. And while this whole story was certainly annoying, the support was helpful and speditive. This is all I could ask for. Thanks IBM.

In case you ask how I could get to work on the new computer so fast: I’ve removed the harddrive of the defective machine and put it into the older one. While Windows XP comlained a bit about the graphic driver on the new machine, the rest of the hardware was detected flawlessly, so this was extremely un-painful. To be on the secure side non the less, I’ve created an image of the partition containing my personal data [note to self: Finally blog about your partition scheme].

Eclipse 3.1 M2

The Eclipse team seem to have stopped announcing Milestone releases on the front page, so it’s a bit tricky to know when a new one is released.

So it may be old news, but Eclipse 3.1 M2 has been released.

It contains some nice new features.

The Milestone builds are extremely stable, so there should be no problems using it.