VPlan4: A bit of history

Some of you might have already noticed that there is a new page on VPlan4. VPlan4 is — as the name implies — the 4th complete rewrite of my small task planning tool. Before I ramble on a bit on VPlan4 itself and its development, let me take you on a trip into the past.

Why VPlan?

VPlan is based on “Getting things done“, a very nice book by David Allen which describes a work-flow. That particular work-flow tries to maximize the time you spend on advancing various projects, for instance, some stuff at work or the long-overdue car repair. At the time VPlan1 was written, there were no web-based services like remember the milk or todoist. So I went out to write a first small basic task-tracker.

VPlan1

The original version: I had no clue back then what features to use, so I started with a very simple tree structure for everything (one tree only), with C#. Storage was done by serializing the tree, and the tree-view was very rudimentary. All of the UI was implemented using WinForms. There was no drag&drop, but it served as a test-bed for some prototyping. I quickly scrapped it once I wanted to implement projects (which group several tasks together.) The key take-away from VPlan1 was that a WinForms based UI is a workable path, and that the backend is key.

VPlan2

The first VPlan I actually used for a longer time. Still written in C#, with a WinForms based UI, but a completely rewritten backend. Tasks where now stored as a table, and the tree structure was built on the fly. This gave some robustness improvements, but the WinForms UI was starting to become the limiting part. However, I had a much better separation now between UI and data, as the UI was just containing pointers into the data table and all manipulation was done on the database backend only.

VPlan3

In order to finally get a nice UI, I turned to C# and WPF (at that time, the .NET 3.0 framework was brand new, and 3.5 SP1 was not yet announced.) The backend was switched to SQL Server Compact, which allowed for low-level consistence checking via foreign keys. I wrote a model for the database backend, and hooked it up to the UI.

However, choosing WPF was a double-edged sword: While I really liked the declarative approach, making an usable tree-view was totally overkill. For instance, I wanted check-boxes in the tree-view to close tasks (something which is dead easy in WinForms): However, WPF does not support this out of the box, and the workarounds are rather cumbersome. I also never managed drag&drop to work nicely, even though I spent quite some time on the UI. There were also a bunch of platform-related issues, like a 3-5 second startup (even on a pretty beefy machine!) and the high memory use (used to be 70 MiB with .NET 3.5, went down to 30 MiB with .NET 4 now.)

What was nice about VPlan3 was the backend, which made all changes ACID and thus pretty reliable. I also spent some time polishing the UI (nice messages, questions, hot-keys, etc.) and used VPlan3 quite a lot since then. Interestingly, it was again a total rewrite of VPlan2 — I couldn’t use much of the old code base, and all of the UI was completely rewritten from scratch.

VPlan4

Fast-forward to 2010: I started to use Linux for some of my development work, and I really wanted VPlan to run on Linux as well. In the meantime, all of the web-based tools have appeared with nice UIs, drag & drop, comfort functions etc. which VPlan lacked, so there was really some reason to give it another shot. I eventually turned away from C# and gave it a shot in C++ — to see how much work it actually is, and to get acquainted with Qt.

In the next weeks, I hope to get around to post a bit about the development experience and deploying. I’ve spent quite a bit of work this time to get a solid deployment and servicing story working on Windows, based around MSI and WiX.

Posted in Programming | Tagged | 2 Comments

Heading back from NVIDIA

I’m heading back from NVIDIA right while this post comes online. It was a fun and interesting time at NVIDIA Research, and we had an absolutely stunning summer with sun in mid-November. I’ve met a lot of interesting people, worked on some cool topics, had access to fat hardware, and learned a lot. I think that summarises this summer quite well :) Thanks to all people at NVIDIA who made this possible!

Hopefully, the submitted work gets accepted, and I’ll be able to write a post-mortem analysis soon. I’m heading straight back to university work, so I’ll be likely really busy during this week. If time permits, I’ll get back to more regular blogging again. There’s a bunch of topics I want to write about, which are like semi-finished in the queue.

Posted in General | Tagged , | Leave a comment

Blog content updated/revisited

During the last two weeks, I’ve went through all blogs posts to clean up the content, reformat stuff, fix broken links and add other minor improvements. All posts have been tagged now, which should improve the “related posts” accuracy a lot and also make searching more reliable. I’ve also added info-boxes to various posts — for instance, all old posts have a warning at the top, and some have a specific note attached to them.

In total, I have modified 50% of my posts (formatting mostly), tagged all of them, and re-categorized > 25%. Going forward, I’m using custom fields now and filter functions so I can make large-scale changes more easily (for instance, I’ve added a “project” field to all posts, so I can easily add a box which warns that a project is no longer maintained.) Finally, you’ll also notice that the headings have been corrected. The twenty-ten theme I’m using has a SEO tweak which makes post titles level 2 on the front page, but level one on single-post pages. Nested headings in posts are thus broken on one of them, but there’s no way to make it work everywhere without a filter. If your interested in a very simple introduction to customising WordPress, please drop me a line in the comments and I’ll write about it soon.

Posted in General | Tagged | Leave a comment

Poor man’s animation framework

I had to produce an animation towards the end of the research project, and as usual, there was not enough time left for heavy-duty video editing work. Everything for the animation had to be done really fast and still produce the correct result. As the video should compare our algorithm to previous work, I had the following set of required features:

  • Labelling: I needed to put labels on the animation, so it would be clear which part shows which algorithm.
  • Four-up comparison: I.e. splitting the screen into four quadrants, and playing back four different streams in sync.
  • High compression quality: Of course, the compression should not introduce new artefacts or hide those from the algorithm.

Duct tape, glue, and a hammer

I decided pretty early on to reuse the animation framework I had for regression testing. That is, I could produce fixed-frame-rate rendering of the animation path and write out every single frame to disk. So the first step was to do exactly this, some Python glue and then just dumping out the whole animation.

For processing the images, I decided to use ImageMagick as the all-around tool. In particular, ImageMagick has great functionality to label images, so I slapped a Python wrapper around the ImageMagick executable and went through all images to label them.

Stiching & cropping can be also done with ImageMagick. While it requires a lot of disk I/O to do so, it’s still pretty fast and there is no quality loss in the pipeline (all my images where PNG throughout all the processing.) I did everything step-by-step with intermediate outputs for easy debugging. That is, I cropped the image firsts, generated four outputs, stitched them together and added the labels on top. That’s easier than adding the labels first, especially if you need to resize the images. For resizing, ImageMagick provides point-filtering which is very useful as there is no blurring from the resizing, which was crucial for my stuff.

Finally, I would number the images and run them through VirtualDub to create a single AVI file with no compression — basically appending each image after the other. There was only one step left, compressing the AVI, and it turns out that FFMPEG‘s h264 implementation is pretty good, especially with the two-pass compression with variable bit rate. I used something around 2.5 MBit for 720p, which resulted in a 10 MiB file for 30 seconds.

Caveats

There are some caveats here which took me a while to figure out:

  • After labelling a 24-bit PNG with a transparent label, ImageMagick changed the depth to 32-bit. Unfortunately, VirtualDub cannot load 32-bit PNGs, and all the guides I found which explained how to get rid of the alpha channel somehow didn’t help. What helped was to write the final image as TGA.
  • FFMPEG two-phase encoding: With one-phase encoding, the quality seems equivalent but the compression is worse, so I opted to use the two-pass encoding. My main problem was that the input AVI was larger than my main memory, so reading through the file was pretty slow … still, the two-pass results were worth the additional compression time. For the record, I used the very_slow presets :)
  • Virtual Dub’s default framerate is 10 frames per second. You have to change it before writing the AVI, for some reason or another, setting the fps in FFMPEG didn’t help.
Posted in Graphics | Tagged , | 2 Comments