Feel like a geek and get yourself Ema Personal Wiki for Android and Windows

26 February 2010

Amber Alert 404

Scott Hanselman geeft op zijn blog het idee door om bij een 404 foutmelding ("pagina niet gevonden") foto's van vermiste kinderen op te nemen.
It's a simple and brilliant idea. Millions of 404s are delivered every day. We are reporting on missing pages, but not on missing children.

Ik heb het idee overgenomen en een html pagina gemaakt die de RSS feed van Amber Alert laat zien. In deze pagina wordt alles voor 100% aan de clientkant geregeld, zodat er geen aparte servercode nodig is. Uiteraard met uitzondering van de instructies die de webserver nodig heeft om deze pagina bij een 404 fout te laten zien.

Voor ASP.NET websites pas je in de web.config in de system.web sectie de customErrors instructie als volgt aan:

<customErrors mode="On">
    <error statusCode="404" redirect="/amber-alert-404.html" />
</customErrors>

Je kunt de webpagina voor eigen gebruik downloaden vanaf deze locatie: http://www.janwillemboer.nl/2010/amber-alert-404.html.

22 January 2010

Memory leaks with WPF windows


WPF is like an Escher drawing. You should always close the window. Even if you ... did not open it!

If you create a new WPF (XAML) Window object, and do not show it for some reason, you still have to close it or it will stick in you memory until the end of days.
  • In VS2008, create a New WPF application
  • In Window1, create new Button
  • in the Click handler of the Button, put the following statement:
    var w = new Window1();
  • F5, click on the button
  • Close the application: now it won't close because the Window1 instance that was created in the click handler is still somewhere in memory
  • Now change the click handler and Close the window you did not open:
    var w = new Window1();
    w.Close();
  • F5 and click and close: now the application will function normally

This seems very odd to me. Moreover, if there is some cleanup required, the Window class should implement the IDisposable interface.

21 December 2009

Todo lists should be fun if you want to stick to it

Since a few years I use David Allen's Getting Things Done system for organizing "stuff". Stuff includes todo lists, project materials, things on your mind, things to keep track of, etc.

One of the statements in the David Allen book is that you should use a system that you find fun to use, because that will make it easier to stick to it. To me, it is always fun to try out new things, and abandon old stuff in favor of new software.

My way to stick to my GTD lists is that I once in a while change the system with which I keep track of the lists. To find a new, shiny peace of software, keeps me interested in using the lists, which is of vital importance for the success of your GTD system.

Systems I have used so far:
  • The todo application and memos of my Palm Tungsten T3
  • Microsoft Outlook in combination with a HP ipaq 214. (Note: I found this setup extremely inconvenient. In my opinion, Outlook Mobile is not a user-friendly application.)
  • AbstractSpoon hierarchical todolist 
  • Home-made GTD tracking software. This worked for a while, but wasn't really a good idea in the long run since you have to solve issues and create additional features all by yourself ;)
  • Remember The Milk
  • Evernote
  • bLADE wiki. It is a personal wiki that works on Windows Mobile and on my desktop. It has no built-in support for GTD because it is a plain wiki. But if you take some time to arrange things the way you like it best, it is a very pleasant system to work with. At least I am very pleased so far. And my wife is too.
  • [Update] Because I bought an HTC Desire Android device lately, I created my own Personal Wiki for Android which I'm using now. 
Apart from the HUGE advantage that the switching gives me by keeping me interested, the other advantage is that it forces me to copy all the data from one system to another. This is a pleasant way to purge items and go over all of the lists in all of the corners of the system.

(The image is a GTD wallpaper from http://anabubula.com/)

12 November 2009

Filezilla and the trash

Filezilla took a lot of time lately after I gave the command to delete a local file or directory. Like ten seconds before the file or directory was deleted. That is really unacceptably slow, so I fired up sysinternals procmon to see what was happening.

Filezilla turned out to be browsing through my trash stuff before deleting the file which I requested to be deleted. There were really a lot of items in the trash, so it is obvious why Filezilla became so slow. I emptied the trash and Filezilla was happy again.

Less obvious is: why is Filezilla browsing through my trashed items? Or is it a system "feature" for which Filezilla cannot be blamed?

04 November 2009

One of the advantage of open source libraries

Today I once again experienced one of the great advantages of using open source libraries over using its closed source equivalents.

For our core library, we make use of several open source components, Nini being one of them. In our case Nini is used to read and write INI files.

Recently we discovered that a problem in one of our product had to do with this library. The library simply "ate" characters behind a double quote if the double quote was part of the setting.
[Blocks]
Block1 = Something, "Some caption", 1
The output would be:
Assert.AreEqual("Something, ", getValue("/Blocks/Block1"));
After discovering the Nini library was the cause, we decided we should investigate if we could solve the problem ourselves by creating a patch, since the library is open source. So we downloaded the code and opened it in Visual Studio. After some browsing through the code however, we quickly found a workaround: set the ConsumeAllKeyText property true on the IniReader instance.

With a closed source library, problems like this are as likely to occur as with open source products. The huge advantage of using open source in this case is obvious. If you're using a closed source product, you can only hope and pray for support in case of problems. With open source libraries, you can take things into your own hand.