Blog

Software, search, and lessons learned along the way.

A problem with metric-driven development

Exploitation stops at a local optimum; exploration crosses a valley to reach a higher optimum.
Exploitation stops at a local optimum; exploration can accept a temporary setback to reach a better outcome.

There's an approach to software development that requires every piece of engineering work to be justified against a metric that it will move. Before committing to a piece of work, you need to identify the metric, articulate how the work will influence it, and ideally quantify the expected improvement.

On the face of it, this seems very reasonable. Engineering time is a finite resource, and organisations should be making considered decisions about where to invest it. Having objective measures against which to evaluate the effectiveness of those investments is generally a good thing.

Where I think this becomes problematic is when the ability to demonstrate a measurable improvement becomes an absolute prerequisite for doing the work in the first place.

Read article: A problem with metric-driven development

Using technology to unveil the past

A document from the Upper Austrian State Archives

Tracing one's family history can be an emotionally charged but rewarding journey, especially when it involves piecing together fragments from tumultuous times. My neighbour, who is of Yugoslavian/Serbian descent, embarked on such a quest to uncover what happened to her great-grandfather following the Second World War. Her great-grandfather had been displaced during the war and was believed to have died in a displacement camp in Austria. The search for answers led her to various archives and eventually to a significant breakthrough, with the help of technology.

Read article: Using technology to unveil the past

Deploying Statiq Web to GitHub Pages

I finally got around to porting this blog over to a static website. After several years running on Orchard, followed by many more on MiniBlog, I'd been looking for a simpler experience for some time, in the hope that a simpler experience would encourage me to blog more. I came across Wyam a while back, and followed its evolution into Statiq Web, and finally took the time to port things over.

Read article: Deploying Statiq Web to GitHub Pages

Monitoring processes on remote Windows machines with Procmon

Process Monitor capture

I do a fair bit of work with VMs somedays, using them for a variety of purposes, including integration tests for Windows installers and building components for different platforms. Much of this work runs headless without a GUI and without manual intervention.

Sometimes things can go awry with a process, such as not shutting down as expected and keeping a handle open to a file that should be deleted, or spawning other processes and threads unexpectedly. When this happens on a Windows VM, it's useful to run Process Monitor a.k.a. Procmon on the remote VM to capture process activity for further investigation. This is the topic of today's post.

I've put together a small PowerShell script module to make the process of running Procmon on a remote Windows VM easier, and will walkthrough how to use it.

Read article: Monitoring processes on remote Windows machines with Procmon

Beware mixing Tasks with async/await

I recently came across an issue within a pipeline of asynchronous method calls where an attempt to deserialize a response from json to a known type may throw an exception, usually when the response is not json. For example, this may be the case when using something like nginx as a proxy for authentication purposes and failed authentication returns a HTML page. A simple reproducible example would be

void Main()
{
    MainAsync().Wait();
}

async Task MainAsync()
{
    var result = await TryDeserializeAsync().ConfigureAwait(false);    
    Console.WriteLine(result);
}

Task<double?> TryDeserializeAsync()
{
    try { 
        return DeserializeAsync(); 
    }
    catch {
        // swallow any exceptions thrown.
    }
    return null;
}

async Task<double?> DeserializeAsync()
{
    await Task.Delay(100);
    throw new Exception("Serialization error");
}

Here we await TryDeserializeAsync() which in turn calls the actual DeserializeAsync() implementation, swallowing any exception that may occur in deserialization and simple returning null. That's the plan anyway.

Read article: Beware mixing Tasks with async/await

Type to search. Use the arrow keys to browse results and Escape to close.