Using XPath to match a key/value paired XML message


    <values>van der Sijpt<values>




Dealing with interruptions as a Scrum team member

For the last months, I have coached some engineering teams in a large software-intensive organization. Some are running fine, some need extra work. A topic that regularly pops up is "how do I handle all these interruptions during my day?"

I define an interruption as anything that makes you context-switch away from the work you're doing for the team. So, questions from teammates are not interruptions. Neither is responding to email at the time of your choosing. Phone calls regarding different projects, or people showing up at your desk with unrelated questions are.



  • "it has always worked like this",
  • there is no pushback,
  • costs are hidden.

"It has always worked like this"

What and why



How to handle

This is ingrained into the organization, and hard to counter. Make commitments, and consistently meet them ("I'll get back to you next Friday"). Make promises, and keep them, and people will learn to accept you deferring work. We will get back to this. I promise.

There is no pushback

What and why

As engineers, we are inherently nice. When faced with the choice to either shine in front of someone present, of diligently work on for someone that isn't, we choose the former.


How to handle




'Defer' can be part of your system, but is more effective as a team. If you decide to deal with your interruption demons, and to not be as available for the team as you could be, you're hurting the sprint result.

There are many ways to handle this. For instance,

  • One of the teams has picked Tuesday as the 'interruptions day'. For every interruption, they ask "can this wait until next Tuesday?"

About promises


If you make a promise to yourself to get some work done, treat it just the same as making a promise to someone else. If you need to break it, renegotiate. You can't be dependable without being authentic.

Costs are hidden

What and why

We all know context switches are expensive, but just how expensive? How can you explain to the angry manager at your desk "ah, yes, well, you know, you bothering me will take roughly 22.6 minutes of productivity away. From another project." Remember, as engineers we're way too polite for that.

How to handle






Always wonder "what is the most valuable thing I can do at this moment in time" by consciously making the Do/Delegate/Defer/Drop decision.


With your new aura of dependability, use it to manage interruptions even further. Ask people's input to be less disruptive: don't call, email. Don't visit your desk, create a well-written bug report. Use IRC if you must. This leaves you free to handle the interruptions regularly, but when you choose to.


Markdown in the browser, without additional tools

Today I ran into a typical documentation problem.

  • Organization uses mainly Word, but I don't use word.
  • So, HTML is probably good, but I'm not going to write HTML by hand.
  • I don't want any server-side code, and I also don't want to check in 'compiled' HTML.



<div id="content">

Showdown is

- legend...
- ...wait for it...
- ...dary!

<!-- End of div with markdown -->

<script src="" ></script>
var converter = new Showdown.converter();
var content = document.getElementById('content');
content.innerHTML = converter.makeHtml(content.innerHTML);

which gives me a page that says the following,

Showdown is

  • legend...
  • ...wait for it...
  • ...dary!


Oh yeah, subversion


svn propedit svn:mime-type <file>

Devnology community day 2012

First up: for those that don't know Devnology, you probably should. Visit and sign up for one of the upcoming event! Devnology's third Community Day took place at Vx Company in Baarn, in the best-furnished basement I ever visited. The community day is like a one-day conference with blocks of time carved out for different sessions and workshops; I'm only human and have not experienced them all, so I just picked the ones I was a part of.

You shall not pass


Cloud9, or, why do I install all of this stuff


"is to Eclipse as Google Docs is to MSOffice"

I liked the way he walked us through the various features and advantages of Cloud9, but I would have liked a more developer-oriented pitch. We were shown a quick demo of debugging and live changes, but nothing showed up that made me go "wow, time to ditch IntelliJ, Eclipse and TextMate at the same time!"

To inifinity, and beyond!

Never too shabby to take an engineer out of his comfort zone, into the land of mathematics, Felienne Hermans flipcharted her way from ancient Greece's Zeno's Paradox through the more modern notion of Hilbert's Hotel. Felt a bit like infinity-related excerpts from The Clockwork Universe, all compressed into roughly an hour. Also, I'm very charmed by the let's-have-a-flipchart-and-start-talking way of presenting.

On a slightly less related note, it was her birthday!



What I didn't like so much is that there was too much material for the reserved timeslot; probably a day's worth of material paraded by in some two hours, barely leaving time for hands-on Clojuring. I hope Martin finds the time reduce the amount of material (to, let's say an afternoon), then I'll be first in line again!

A programming language is a language too, right?


Well, no. As Michel expertly showed, even though human language is all about conveying meaning and alluding to another person's mental model of the world, the link to programming is pretty slim. Since in science there is no such thing as a failed experiment, I enjoyed this deviation from our usual programming-the-world view.



Roomba and Poang: they can live happily together

Oh yes, it's such a first world problem. Yet, my Roomba has gotten stuck on my Ikea Poang chairs, about once every four or five runs.


Wheels from Praxis
Wheels from Praxis


Prepare with a counter sink
Prepare with a counter sink


Drill the hole, using your hand as a guide
Drill the hole, using your hand as a guide

Prepare the chair by pre-drilling some holes. I used a 3mm drill for this. Since the wheels' 60mm is just as wide as the chair's legs, there is no need to measure anything, just use your hand as a guide.

Attach the wheels
Attach the wheels
Screws, 3.5x20mm
Screws, 3.5x20mm

Then, attach the wheels. I used 3.5x20mm screws.

Attach some felt protectors
Attach some felt protectors
Felt protectors, I used Ikea Praktisk
Felt protectors, I used Ikea Praktisk


There you go, one happy Roomba
There you go, one happy Roomba

There you go! The chair is now just high enough so the Roomba's bumper will hit the chair instead of bravely trying to climb over it. Mind you: this works fine on my hardwood floors, but you may need some additional height if you have carpet.

My git-svn workflow with Tower

Most of the codebases I work on are in Subversion, yet I like working with Git for the sheer joy of it. Below, you will find a short overview of my basic workflow. I do a lot from the command line, but not everything. For most operations Mac Git client Tower is the best solution you can find.

In short

For the impatient reader, my workflow looks a little like this.

  • One time only: clone repository. git svn clone -Ttrunk -bbranches -ttags mylocalcopy
  • Rebase: get all remote changes in. git stash; git svn rebase; git stash pop
  • Create awesome features, committing frequently with Tower.
  • DCommit: push changes back to Subversion. git stash; git svn dcommit; git stash pop

In a little more detail

Checking out

Git works with a local history, which makes it quite distinct from Subversion. Also, Git assumes that you have a working trunk, with optional branches and tags; this means your repository should at least have a trunk directory.

Assuming your trunk is at, you can clone a remote Subversion repository to your system using git svn clone -Ttrunk -bbranches -ttags mylocalcopy

This will copy over all revisions of the repository to your own system, placing a Git repository in your mylocalcopy directory. Since it goes through all revisions, this can take a while for repositories with a lot of commits. If Git somehow stops, and your local copy is still empty, go into the local repository directory, and execute git svn fetch.

Updating and committing

With your local working copy, you can use Tower to create your commits.

If your want to merge your copy with the remote Subversion repository, it's best to only do that after you have (locally) committed all changes. Then, use git svn rebase If you need to have some local uncommitted changes, use git stash; git svn rebase; git stash pop

Pushing your changes to the remote Subversion repository is roughly like rebasing. Again, it's best to only do that with a 'clean working copy', that is, having committed all changes to your own Git repository. git svn dcommit Again, if you must, you can pad this command with git stash and git stash pop.

Remember that, when you commit, all your commits will get the timestamp of the dcommit.

How do I use Git with Subversion?

I have noticed that in Git, there are at least six ways to do anything you want. I have settled on a simplified way of doing things, and I know I am missing out on some awesomeness.

  • I rarely use feature branches. I only use them when I am really working on two things at the same time, but not for every feature that comes along.
  • When I do use feature branches, I tend to dcommit from the feature branch, instead of merging to my trunk first.
  • Intellij's Git integration is pretty good, and it works together nicely with external tools. In Eclipse, I don't use any integration, but rely on command line tools and Tower only.
  • For Eclipse-based projects, I use Git to keep track of the full working directory, instead of tracking individual Eclipse projects. This usually means that I clone some repository at the level above the Eclipse projects, and import the projects into Eclipse using the 'Import existing project' feature.

Using a ManagedServiceFactory

One of the most elusive, yet very useful parts of the OSGi specification is the ManagedServiceFactory (part of the ConfigurationAdmin specification, chapter 104 in the 4.2 OSGi compendium specification). A long time ago, I gave an example on the Apache Felix users mailing list, but it's hard to find. So, time for a nicer looking example. In the four steps below, we will take a simple program, and make a ManagedServiceFactory out of it. I find it useful to follow the progression, but if you're only interested in the ManagedServiceFactory part, skip to step 3. I assume you're familiar with basics of OSGi, and have seen a ManagedService up close before.

Running the examples

I have put up an example project, which shows all the code covered below. When you import the project, you will get a warning about a missing 'test' folder. Just create a new 'test' source folder, this is due to Zip not being able to package empty directories.

The examples use Neil Bartlett's excellent Bndtools, and next to the environment that ships with, we use

The case

Step one, code in package net.luminis.websitewatcher.withmain.

Suppose we want to have some service that checks the availability of our favorite website. It's pretty easy to devise a method that does this. Given that we have a method for this (full code in the example), we can call this repeatedly from a thread.

new Thread("Watcher for " + site.toExternalForm()) {
  public void run() {
    while (true) {
      if (isReachable(site)) {
        System.out.println(site.toExternalForm() + " is reachable.");
      else {
        System.out.println(site.toExternalForm() + " is NOT reachable.");
      try {
      catch (InterruptedException e) {

We can call this from a main method,

public static void main(String[] args) throws MalformedURLException {
 new WebsiteWatcher(new URL(""));

Run this, and you will see whether or not Google is available from your machine, every five seconds.

Wrap it in a bundle

Step two, code in package net.luminis.websitewatcher.simplebundle and simplebundle.bnd.

We can take the code we had before, and wrap that in a bundle. We add an activator, which uses the Apache Felix Dependency Manager to ease or registration, and create a component for our watcher,

  .setImplementation(new WebsiteWatcher(new URL(""))));

In our WebsiteWatcher, we move the thread-code to an inner class, and add some plumbing code,

public WebsiteWatcher(final URL site) {
  m_watcher = new WatcherThread(site);

public void start() {

public void stop() {

The start() and stop() methods are called by the Dependency Manager when our component is, well, started or stopped.

You can see this working for yourself by running the bnd.bnd file in the project.

A ManagedService

Step three, code in package net.luminis.websitewatcher.managedservice and managedservice.bnd.

Moving it up one notch, we create a ManagedService out of our component. To do so, we make the WebsiteWatcher implement ManagedService, and add some contants we will need later.

public class WebsiteWatcher implements ManagedService {
  public static final String PID = "net.luminis.websitewatcher.managedservice";
  public static final String URL = "url";

A ManagedService must implement an updated(...) method,

public void updated(@SuppressWarnings("rawtypes") Dictionary properties) throws ConfigurationException {
  if (properties != null) {
    if (properties.get(URL) == null) {
      throw new ConfigurationException(URL, "url cannot be null");
    try {
      m_site = new URL((String) properties.get(URL));
    catch (MalformedURLException e) {
      throw new ConfigurationException(URL, properties.get(URL) + " is not a valid URL", e);

This takes some explanation. Line 3 is a nullcheck on the configuration we receive: null is a valid configuration if our configuration is being removed. However, we will let the Dependency Manager take care of wether or not our configuration is available, so we can ignore the null-case. Line 4 checks the availability of our configuration property, and on line 8 we create a new URL to watch from the URL property in the configuration. If any of these checks go wrong, we create a ConfigurationException telling the world what happened (lines 5, 11).

Finally, we need to instruct the Dependency Manager of our newfound managed-service-ness.


What happens when we do this?


The Configuration Admin spec tells us that a ManagedService should be registered as a service, with the PID as a service property. When a configuration becomes available, the Configuration Admin will call that ManagedService with the configuration properties. The Dependency Manager nicely wraps this as a 'configuration dependency', i.e., our component can only start if it has a configuration.

In the example project, we use the Apache Felix FileInstall bundle to get configurations into the Configuration Admin. It watches the load directory for files with a name like <pid>.cfg. You can play around with the configuration in net.luminis.websitewatcher.managedservice.cfg, and see what happens!


A ManagedServiceFactory

Piece de resistance, code in package net.luminis.websitewatcher.managedservicefactory and managedservicefactory.bnd.

Having a configurable watcher for a single website is nice, but we really want to be able to watch more sites, without having to create PIDs for each of those, or instantiating multiple watchers 'by hand'. This is where the ManagedServiceFactory comes in.


The task of a ManagedServiceFactory is to create instances of whatever it manages, based on the configuration it gets.

We first create a ManagedServiceFactory implementation,

public class WebsiteWatcherFactory implements ManagedServiceFactory {
  public static final String PID = "net.luminis.websitewatcher.managedservicefactory";

  private volatile DependencyManager m_dependencyManager;

  private final Map<String, Component> m_components = new HashMap<String, Component>();

  public String getName() {
    return "website watcher factory";

  public void updated(String pid, @SuppressWarnings("rawtypes") Dictionary properties) throws ConfigurationException {
    if (m_components.containsKey(pid)) {

    Component component = m_dependencyManager.createComponent()

    m_components.put(pid, component);

  public void deleted(String pid) {

Right, what happens here?

  • For each FactoryConfiguration, the Config Admin will call the updated() method on line 14. In here, we
    1. create a new Dependency Manager Component for our watcher (line 19),
    2. make it depend on a configuration for its own PID (line 21), like we did before,
    3. register its existence (line 23), and
    4. add the component to the Dependency Manager (line 24)
  • If a configuration is deleted, the deleted() method on line 28 will be called; we thus remove the related component from the Dependency Manager.

Note the private volatile DependencyManager field: the Dependency Manager will inject an configured instance in each component that has a field of this type.

Now we have a factory, we need to register it in our activator.

Properties props = new Properties();
props.put(Constants.SERVICE_PID, WebsiteWatcherFactory.PID);

  .setInterface(ManagedServiceFactory.class.getName(), props)

And with that, we have a fully functional factory for creating numerous watchers of all you favorite websites. Apache Felix FileInstall will also handle factory configurations if you use filenames like <factoryPid>-<instance>.cfg, like net.luminis.websitewatcher.managedservicefactory-google.cfg.

When creating configurations, you might get a warning like

*ERROR* Configuration for net.luminis.websitewatcher.managedservicefactory.560fe0c0-a691-475e-854a-b4caab68f6d4 has already been used for service [, id=39, bundle=10] and will now also be given to [, id=41, bundle=10] which you can safely ignore. This has to do with the fact that the configuration is initially linked to our factory, but is used to configure the generated service later on.

By the way, you may have noticed that we wrote a new WebsiteWatcher for each step of the process, except for the last one: we just reused the one from step 3.

ApacheCon NA 2010

Early last november, I visited ApacheCon NA in Atlanta, Georgia. I wrote up some trends I spotted there at my company's blog. Furthermore, the materials of my session on distributing and managing software on large numbers of embedded devices is now up on Slideshare. I'm more about some striking images and a live story than about self-descriptive slideware. Still, you could try to reconstruct the story I told. Have fun!

Why don't you _not_?

The longer I work in tech consulting, the more people start to rely on my choices in tough situations. And, the longer I do that, the more I tend to gravitate to a pair of questions: "why" and "why don't you not". Let me share a short anecdote about the second one. I recently worked in a team extending a tool for a customer; this tool abstracts the configuration of a complicated device to a more understandable level. For some expert-level situations, you sometimes need information (indices, etc) that is generated later in the process. A colleague asked my help with this feature; it seemed to required us to entangle UI code with configuration logic. Not being happy about this, I started wondering "why don't we not do this"?" Is there a way we can change the problem? We chose to remove the information from the UI, but make it more prominent in the generated configuration. Given the audience of this feature (expert users), there is no problem in making the user dig around in the generated configuration.

So, we all heard about the five whys; now add why don't you not to that list. Ask yourself, "what's the worst thing that could happen if we don't" and "how can we make this problem go away without solving it?"

Sharpie, paper, ScanSnap, Keynote. Or: My presentation routine

Some time ago, I tweeted about using both low- and high tech tools for creating presentations. Some of you that know me, know what I'm talking about; for those that don't, a quick run-through of the way I create simple graphics or highlights for my presentations. The bottom line: I use this setup because it's the quickest way to get an image out of my head, onto paper, and into my computer.

Why would I use hand-drawn images? I grew tired of all the run-of-the-mill graphics people use in their presentations, and I'm not exactly a graphics guru with all the nice tools. Also, I'm highly impressed by Sacha Chua's The Shy Connector; while I don't strive to have all hand drawn presentations, I like the personal touch of something made by my own hands.

The tools

My not-so-permanent setup consists of

How does that work?

As stated above, I need a quick way to get something out of my head, and into my keynote. Here goes.

1. Draw

I like to put a piece of cardboard under the paper I'm drawing on, as these Sharpies tend to bleed through.

2. Scan

I have a preset that takes the image from the ScanSnap, scans it in the second-best quality, and opens the result in Preview.

3. Move to keynote

Once opened in Preview, it's easy to copy-and-paste the image, or a part of it, to Keynote. Sometimes it's useful to enhance the image a little in Preview, e.g. by increasing the contrast or saturation, it depends on whether or not you want the images to have a paper-like texture.

4. Post process

You now have an image in keynote, to which you can apply all the snazzy keynote effects. I'll take you through two of my favorites.

The 'scribble'

If you have an image that should visually 'stay together', draw a line around it, then only apply an alpha filter on everything outside that line. There's no need for the lines you draw to be straight.

The black-on-black

When you use a theme that has a black (or dark) background, it's hard to use any of the Sharpie-colors directly. You could invert the colors, but this gives an unnatural feel.

In stead, I like to saturate the image to full black (or red, or whatever), and use a two-pixel white outline. Simple, yet effective!


I like to use this technique for most of my presentations; for some examples, see

Apache ACE building instructions

Hi there!

If you're reading this, you're either one of the RSS-subscribers, or I have just pointed you, as a visitor of LJCUC02, to this location.

Building an ACE target

Snapshot dependencies

First, we need two snapshot dependencies. Check out /felix/trunk/dependencymanager and /felix/trunk/deploymentadmin to some convenient location. From these locations, call mvn -DskipTests=true clean install

Building a target

Check out to another convenient location and run mvn -DskipTests=true install (Yes, this does take a long time.)

Setting up the build target

You now have a target waiting for you in ace-target-devgateway/target/ace-target-devgateway-0.8.0-SNAPSHOT-distribution/ace-gateway In the conf directory, edit

  • to point to my machine that works as a server; at time of writing, my IP is
  • to give you some unique name. Don't use spaces or punctuation for this, and clashes gives an undefined state. Remember, this is usually a managed environment.

All set! You can now run your target with sh

"De kracht van Scrum"

"De kracht van Scrum" (bol) is a short story, written in Dutch, telling the tale of a CTO with all the usual suspects of problems in his organization, and his journey into Scrum.

The book poses and answers all the usual questions and concerns one might have when adopting Scrum, and shows an example of a possible method of transition. I believe the authors have deliberately erred on the side of simplicity, flattening some of the mechanisms, and posing certain solutions as the best (or maybe only?) way. This is very much in line with the goal of the story, which is mainly to "inspire".

I don't believe this book is the best possible story to inspire Scrum adoption from 'up above', but it is by far the best I have seen so far. It being in Dutch is an advantage for my projects, but I think an English edition would be a welcome addition; I haven't found anything like it in another language.

In short, "De kracht van Scrum" is a welcome addition to my gift chest when starting new projects, as I already had "Scrum & XP from the Trenches" (pdf, amazon, bol) for the new Scrum Masters.

Demoing Ruby on Rails

Insipred by the 15 minute weblog, I created a demo of Ruby on Rails for my colleagues.

The material for this demo is listed below. The presentation is used to explain concepts, and to illustrate elements of the case we use. The speaker notes contain instructions on the order in which to do stuff on the command line, in the text editor, in the browser, and when to point out something using keynote.

When typing like a maniac, you should be able to get through this in about an hour. Have fun!

Sway by Rom Brafman - recommended reading

Sway book cover

Sway (amazon, bol) is one of those books that feels 'done done': well-researched, written with a sharp clarity and factualness that rivals Malcolm Gladwell's, and a sense of imparting upon you the wisdom of ages.

Last year, at around the same time, I read Dan Ariely's Predictably Irrational (amazon, bol). Sway takes it one step further: being written by two brothers, one a pyschologist, and one an "organizational thinker" (I believe the book credits him as "economist"), it has a unique style, that leaps through years of research, picking the juiciest bits of scientific literature and, dare I call it, trivia, and distills it into an easy to swallow chunks of insight. Somehow, I can't stay away from food metaphors describing this book. Highly recommended!

Using Turnkey Linux Rails with Capistrano

The guys at have, among other stuff, a very useful Rails VM. As useful as it is out of the box, I like to use together with Capistrano. To do so, it needs some minor tweaks.

Clean up the current app

Fire up the VM, and ssh to it. ssh root@ The application is in /var/www/railsapp; go there, and delete the contents of the directory. cd /var/www/railsapp; rm -rf *

Configure Apache

With that out of the way, we need to tell the embedded Apache that something has changed. In /etc/apache2/conf/railsapp.conf, replace the occurences of 'public' by 'current/public'. Then, restart apache by using apache2ctl restart

Install subversion

For some reason the Turnkey VM doesn't ship with subversion. Install that using apt-get update; apt-get install subversion

Connect to your subversion server once

When you're using svn+ssh as I am, you will want to connect to your subversion server once, for instance using something like svn info svn+ssh://angelo@ This gives ssh the chance to 'get to know' your server.

That's it!

There, with a few minor tweaks, you can start using an off-the-shelf VM for you Capistrano deployment. I personally use one of these to test my deployment scripts, and hence use it as a staging server.

Some time soon, I will (a) do a walkthrough of building an application that can readily be deployed onto this VM, and (b) show how you can use Capistrano to deploy to both a staging environment in one of these VM's, and to a 'real' production server.