Integrating direnv with ghc

2020-02-02 15:32:31 +0000

I’m reading “Practical Haskell”, which requires a different version of Haskell than Ubuntu installs so I figured I’d add another entry to my direnv series.

» read more

Elixir's use functionality

2020-01-02 15:54:00 +0000

use is a way that you can inject code into your module. Elixir uses this for boilerplate in GenServer, and Phoenix uses it for metaprogramming.

» read more

A UPS post-mortem

2019-02-21 10:48:07 +0000

This morning, something electrical went wrong in my “network cabinet” (hall cupboard), which knocked me offline for about an hour. Here’s the post-mortem.

» read more

Installing kiex

2019-01-30 17:05:00 +0000

\curl -sSL | bash -s
» read more

Rebuilding kerl Installations

2019-01-30 16:50:00 +0000

If kerl list installations is displaying Erlang installations that you deleted ages ago, and you’ve got all of your installations in ~/.kerl/erlangs/, you can rebuild the list by running the following command:

» read more

jq reduce

2019-01-11 19:38:00 +0000

I found myself having to process a large JSON file using jq --slurp, and it was using up a lot of memory, so I thought it was time to learn about jq’s reduce function.

» read more


2018-06-12 14:52:00 +0000

When you use gen_server:start/3,4 or gen_server:start_link/3,4, the call blocks until the other process has finished running init/1.

» read more

git rebase tips

2017-10-27 13:10:00 +0000

This is an internal email I wrote almost exactly 2 years ago. I had to refer to it today, and I figured that it bears sharing publicly.

» read more

No new blog engine

2015-04-26 08:13:00 +0000

Periodically, I become unhappy with my blog implementation and decide that I should do something about it.

» read more

Running Chromium as a Dashboard

2015-01-28 08:26:00 +0000

On my desk I have a dashboard (an “information radiator”) that displays various useful things, such as the build status of various Jenkins jobs, clocks showing important timezones (Electric Imp is a distributed company), and so on.

» read more

Reverting Erlang 17

2014-10-09 12:22:00 +0000

We’ve found a couple of problems with Erlang R16 that mean that one of our projects requires Erlang 17. Conversely, we’ve found a couple of problems with Erlang 17 that mean that one of our other projects should stick with Erlang R16.

» read more

Using kerl with direnv

2014-09-30 00:00:00 +0000

kerl allows you to easily build and install multiple Erlang/OTP releases. It’s kinda like nvm or rvm, but for Erlang. It doesn’t do everything, and that’s what direnv is for. direnv allows you to run commands upon entering or leaving a particular directory.

» read more

Adding lager handlers at runtime

2014-05-10 08:49:00 +0000

You’re using lager for logging in your Erlang program, and you discover that your configuration isn’t logging anything more verbose than info-level messages. How do you bump that up to debug?

» read more

Debugging Erlang with a remote shell

2014-05-08 15:54:00 +0000

If you’re connected to an Erlang node via a remote shell, and you don’t have access to stdout on the original node, you’ll need to redirect the trace output to your current shell.

» read more

epgsql: invalid_password

2013-12-31 14:55:00 +0000

I’m writing a simple web application in Erlang that uses epgsql to talk to a PostgreSQL database. I keep getting invalid_password, despite the fact that the user doesn’t have a password (and I’m passing “”). I can also log in by using psql -U foo.

» read more

vim plugins

2013-11-22 12:22:29 +0000

This, for no particular reason, is the list of vim plugins that I’m currently using:

» read more

Lego Storage

2013-11-03 19:59:11 +0000

My son has quite a lot of Lego, but he stopped playing with it. It turns out that he gets frustrated when he can’t find a particular piece. So we started exploring storage options.

» read more

Dependency Injection in node.js

2013-10-05 19:26:44 +0000

node.js modules are singletons. If you require('foo') from one module, and then require('foo') from a different module, you’ll get the same instance.

» read more

Phones I have owned

2013-06-18 10:37:38 +0000

Apropos of a discussion on Facebook earlier today:

  • Motorola MR20
  • Motorola Startac
  • Motorola (blue thing)
  • Nokia 8310
  • Nokia 6230
  • HTC Desire
  • Samsung Galaxy S3
» read more

Failed to load data access DLL

2013-06-03 10:55:33 +0000

While attempting to debug a crash dump from a .NET 4.0 RTM process on my (.NET 4.5), I got the dreaded Failed to load data access DLL, 0x80004005 error message.

tl;dr? Skip to the end…

In full, the error looks like this:

0:000> .loadby sos clr
0:000> !vmstat
Failed to load data access DLL, 0x80004005
Verify that 1) you have a recent build of the debugger (6.2.14 or newer)
            2) the file mscordacwks.dll that matches your version of clr.dll is 
                in the version directory or on the symbol path
            3) or, if you are debugging a dump file, verify that the file 
                mscordacwks_<arch>_<arch>_<version>.dll is on your symbol path.
            4) you are debugging on supported cross platform architecture as 
                the dump file. For example, an ARM dump file must be debugged
                on an X86 or an ARM machine; an AMD64 dump file must be
                debugged on an AMD64 machine.

You can also run the debugger command .cordll to control the debugger's
load of mscordacwks.dll.  .cordll -ve -u -l will do a verbose reload.
If that succeeds, the SOS command should work on retry.

If you are debugging a minidump, you need to make sure that your executable
path is pointing to clr.dll as well.

There are lots of words here, but they’re not the easiest to understand, particularly when you’re in a hurry (like, say, you’re attempting to debug an issue on a production server).

I’m assuming that you’ve got a recent version of WinDbg. I was running 6.12, which should be OK.

If you’re lucky, however, (and you’ll need to have !sym noisy turned on to see this), you’ll get:

DBGHELP: clr - public symbols  
SYMSRV:  mscordacwks_AMD64_AMD64_4.0.30319.01.dll from 502605 bytes - copied         
DBGHELP: c:\websymbols\mscordacwks_AMD64_AMD64_4.0.30319.01.dll\4BA21EEB965000\mscordacwks_AMD64_AMD64_4.0.30319.01.dll - OK

This means that the Microsoft Symbol Server had the relevant mscordacwks.dll file. If not, you’ll have to copy it from the machine from where the crash dump originates, and put it somewhere useful. Unfortunately, the message doesn’t explain what, exactly, it means by “on your symbol path”.

For me, at least, it seems that putting it in (e.g.) C:\WebSymbols doesn’t work – you need to put it in the correct named location. I can’t verify this right now, since it downloaded it successfully from Microsoft Symbol Server.

More importantly for my problem, however, is the easily-overlooked message at the end:

If you are debugging a minidump, you need to make sure that your executable
path is pointing to clr.dll as well.

Given that WinDbg knows that I’m debugging a minidump, it could have made this more prominent. What it’s telling us is this:

  1. Copy clr.dll from the original machine. Put it somewhere. Next to the dump file would be fine.
  2. Add that path to the executable search path, using .exepath+ C:\wherever

Note, that you must use the version from the original machine. If you attempt to use your clr.dll, you’ll get the message:

The version of SOS does not match the version of CLR you are debugging.  Please
load the matching version of SOS for the version of CLR you are debugging.
CLR Version: 4.0.30319.1
SOS Version: 4.0.30319.17929
CLRDLL: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscordacwks.dll:4.0.30319.17929 f:8
doesn't match desired version 4.0.30319.01 f:8

Just tell me what to do, already!

  1. Copy clr.dll, sos.dll and mscordacwks.dll from the machine where the crash is occurring.
  2. Put them in C:\Temp.
  3. .exepath+ C:\Temp
  4. .load C:\Temp\sos
  5. Done, you can now !vmstat, etc., to your heart’s content.
» read more

Using IIS Express in vs-welcome-page

2013-05-29 17:35:18 +0000

So, why did I use IIS Express to implement my vs-welcome-page extension? I’m using Nancy, so why didn’t I just use the self-hosting support and host it inside Visual Studio instead?

» read more

Killing IIS Express

2013-05-29 17:23:35 +0000

A brief aside: I’ve got to the point where I’m about to fire up IIS Express from Visual Studio. In order to be a good citizen, our extension should probably shut it down again later.

» read more

Creating a Visual Studio Extension

2013-05-29 17:21:36 +0000

The next major piece is the Visual Studio extension, so let’s get on with that. Assuming that you’ve installed the Visual Studio 2012 SDK, it’s as simple as creating a new “Visual Studio Package” (it’s under “Visual C#” / “Extensibility”):

» read more

Rendering Markdown in .NET

2013-05-29 17:19:58 +0000

There are several options for rendering Markdown to HTML in .NET. If you bring up the NuGet Package Manager dialog and search for “markdown”, you get three pages of results, including MarkdownSharp, which is the renderer used by Stack Overflow, so it must be good.

» read more

Spike: Providing parameters to IIS Express-hosted applications

2013-05-29 15:32:53 +0000

An aside: We need to be able to support multiple instances of our small web application (because you might have more than one instance of Visual Studio open). If we host our application in IIS Express (and remember that we’re doing this to avoid messing around with URL ACLs), we either need to duplicate the whole thing for each site, or figure out a way to provide it with parameters.

» read more

Running IIS Express

2013-05-29 15:07:25 +0000

When you create a web application in Visual Studio, you can configure it (on the properties page) to run in IIS Express.

» read more

Finding IIS Worker Processes

2013-05-13 13:37:46 +0000

How do we find out if there’s a worker process for an application pool? Note that there can be more than one worker process for each application pool. Note also that a worker process can host multiple web applications.

» read more

The case of the missing print jobs

2013-04-27 08:02:22 +0000

Having recently moved my home server (Windows 2012) from the hall cupboard to the corner of my study, I decided to connect it to my printer. This means that I can print from my laptop over wireless without needing to turn on the desktop PC that the printer was originally connected to.

» read more

PowerShell and enums

2013-04-17 11:29:55 +0000

PowerShell has a really cool feature where it’ll coerce a string into an enum value. I’ll demonstrate by exporting a certificate from the Windows certificate store:

» read more

Acer Aspire S7 and Secure Boot

2013-03-29 13:59:28 +0000

I just bought myself a shiny new Acer Aspire S7-391, with a view towards nuking Windows 8 and to install Linux Mint on it. Stupidly, I didn’t consider that Windows 8 logo certification now requires a UEFI BIOS and Secure Boot.

» read more

Installing Windows 8 Pro on Acer Aspire S7

2013-03-27 16:47:34 +0000

  1. Make sure that the ISO file you’ve downloaded is not corrupt – this caused me a bunch of grief.
  2. Format a bootable USB stick as FAT32.
  3. Mount the ISO.
  4. Copy the files from the ISO to the USB stick.
  5. In the Acer’s BIOS, select UEFI; enable F12 boot menu.
  6. Restart the Acer.
  7. Press Fn-= (F12).
  8. Select the USB stick.
  9. Add the Intel drivers.
  10. Continue with the installation.
» read more

Bouncy Castle - Being a Certificate Authority

2013-03-24 16:14:15 +0000

Over the last few posts, we’ve seen how to create a self-signed server certificate in C#, by using the Bouncy Castle library. How do we create a CA certificate, and how do we issue certificates from that authority?

» read more

Bouncy Castle - Subject Alternative Names

2013-03-24 14:20:58 +0000

When you connect to a server using HTTPS, the server provides a certificate that identifies it. Your browser will then typically check that the name in the server certificate matches the address that you’ve gone to. In this way, you can be sure that you’re connecting to the correct server.

» read more

Bouncy Castle - Missing Certificate Attributes

2013-03-20 14:52:15 +0000

Over the last couple of days, we’ve seen how to use Bouncy Castle to generate certificates from C#. However, if you compare the certificates we’ve been generating with those generated by (e.g.) makecert, you’ll see that we’re missing a few things.

» read more

Logging Learnings

2013-03-16 11:16:58 +0000

I’ve just spent the bulk of the morning attempting to understand a bug by reading through some fairly large log files. I’ve come to the realisation that:

Make them text-editor-friendly

Most log files are text. This means that, if you’re tracking down a problem, you’ll probably want to search them, and you may want to edit them.

In particular, you may want to do a search+replace to pull out a bunch of lines to do with a particular event or client. For this reason, don’t spread an event across multiple lines. You might think that it makes the file easier for a human to read (and it does), but it makes it impossible to (for example) delete all of the events that mention client 321 (because you’re interested in client 123), because you’ll end up with hanging lines, as in the following example:

Client #123: Getting orders...
Order #1: Foo
Order #2: Bar
Client #123: Returned 2 orders.
Client #321: Getting orders...
Order #3: Baz
Client #321: Returned 1 order.

If you search-and-replace to delete “Client #321”, you’ll end up with the following:

Client #123: Getting orders...
Order #1: Foo
Order #2: Bar
Client #123: Returned 2 orders.
Order #3: Baz

If you tag-and-copy-to-new-file for “Client #123”, you’ll end up with the following:

Client #123: Getting orders...
Client #123: Returned 2 orders.

Either way, you’ve lost information, and confused yourself. This makes it harder to understand what’s going on.

So, either include the context on every line:

Client #321: Getting orders...
Client #321: Order #3: Baz
Client #321: Returned 1 order.

Or, don’t spread your output over multiple lines.

Consider using CSV (or JSON)

Yeah, your log files are human readable. That’s great, provided you can find a human prepared to read through a couple of million lines of log file.

Why don’t you make them machine-readable? Then you’d allow the file to be parsed and processed by a vast number of tools that already understand CSV (or JSON).

Don’t use XML

Whatever you do, don’t use XML. If you do, you’ve got two choices:

  1. Output a malformed XML document that doesn’t have a root element. If you do this, what’s the point in using XML? I suppose that you could claim that each snippet was an individual XML fragment.
  2. Close the root element after every write, and rewind to remove the </root> before every write. Say goodbye to your performance.

Also, it’s massively verbose. Just use CSV or JSON.

Consider using one file per client

Obviously, this isn’t going to work for your web-scale application, because you’ve got millions of clients visiting every second. However, if you’ve only got a couple of dozen clients, consider using one log file per client.

» read more

Reliable Sessions and HTTPS don't mix

2013-03-15 12:33:56 +0000

System.InvalidOperationException: Binding validation failed because the WSHttpBinding does not support reliable sessions over transport security (HTTPS). The channel factory or service host could not be opened. Use message security for secure reliable messaging over HTTP.

…reliable sessions and HTTPS don’t mix.

» read more

Hyper-V Remote Management

2013-02-20 18:59:55 +0000

It turns out that you cannot manage a Windows 2008 R2 Hyper-V installation from a Windows 8 desktop (even with the Remote Server Administration Tools for Windows 8 installed) or from Windows 2012 Server.

» read more

What is this?

2013-02-06 21:25:00 +0000

I got fed up with my existing blog, so I decided to write a new blog engine, as a way to learn some new tech.

» read more

MSBuild Tasks, Input Parameters and ItemGroups

2013-02-01 16:20:00 +0000

While looking through some MSBuild scripts recently at work, I came across some stuff to do with Task output parameters that I thought might be worth blogging about. First, however, I need to talk about Task input parameters.

» read more

PowerShell tip: Deleting certificates

2012-07-31 10:20:48 +0000

$certs = Get-ChildItem cert:\LocalMachine\My | where { $_.Subject –like 'CN=Victim*' }
foreach ($cert in $certs) {
    $store = Get-Item $cert.PSParentPath
» read more

Streaming HTTP responses in .NET

2012-07-14 19:11:10 +0000

Sometimes you have a web service or web application, and, for one request, you need to transfer an unknown (and potentially unbounded) amount of data in the response.

» read more

New Theme

2012-01-05 16:55:00 +0000

New theme: Acquia Slate. It’s maybe a little dark for my taste, but I’m going to leave it for a couple of weeks and see if it grows on me.

» read more

PowerShell: ImportSystemModules

2012-01-05 13:58:41 +0000

I’ve been using PowerShell as a better Command Prompt for a while now. Increasingly, however, it’s one of the first tools I reach for when I come across a problem, rather than being an afterthought.

» read more


2011-12-21 11:10:45 +0000

I’ve not posted this until today, because my blog’s been poorly, but the BT engineer came round last week and upgraded me to FTTC.

» read more

Repairing image links in drupal

2011-12-20 15:52:56 +0000

Somehow – I’m not sure how, and I’m not exactly sure when – my website (powered by drupal) lost all of its images. They were still there in the filesystem, and the rows were still in the node table, but they’d vanished from the actual pages.

» read more

Reactive Extensions: Elapsed Time

2011-01-30 15:05:53 +0000

I’m using SqlBulkCopy to insert a large number of rows into a database table. I used Observable.FromEvent to hook the SqlRowsCopied event. Rx provides the .TimeStamp() method, but I wanted to know the elapsed time, so I did the following:

» read more

Release Process: Using Source Server

2010-07-14 13:33:54 +0000

One of the cool things you can do with the Microsoft Debugging Tools is set up a source server. This works by embedding source control details in your PDB files. Once you’ve published these to a symbol server, and set that up properly, you should be able to load a minidump file in Visual Studio (or WinDbg) and be taken to the correct line of the correct revision of the source file where the crash happened.

» read more

Release Process: Goals

2010-07-14 13:33:06 +0000

One of the many things that my former company, 1E, does well is its build and release process. That got me thinking: what makes a good build process?

» read more

Returning HTML from a WCF service

2010-06-20 13:05:10 +0000

I’m messing around with writing yet another a blog engine, as a way to learn ASP.NET MVC. One of the things that I’d like to do is have it support uploading from Windows Live Writer. This means that it needs to support XML-RPC and Really Simple Discovery (RSD). More on the XML-RPC stuff later.

» read more

NBehave Notes

2010-05-20 08:55:37 +0000

We’ve just started using NBehave, so this is a random selection of notes:

» read more

Setting up Squid on Windows

2009-09-16 08:38:27 +0000

At work, we do a lot of our testing and debugging with virtual machines (using Microsoft Virtual Server or Hyper-V, mostly). The virtual guests are generally not allowed any access to our live network, which makes accessing the Internet difficult. To get around this, I usually set up Squid on the host machine. This allows the guests to access (e.g.) Windows Update and Microsoft Symbol Server, which makes things a bit easier.

» read more

More unplanned downtime

2009-07-04 14:54:37 +0000

The hosting outfit that I’ve been using for is cheap for a reason: they’re not very good.

» read more

Symbol Store: How are EXE files stored?

2009-04-23 15:12:23 +0000

If you’re using the Microsoft Symbol Server to pull down symbols for Windows, or if you’re using SYMSTORE.EXE for your own stuff, you’ll see that EXE (and other binary files) are stored in a path similar to C:\WebSymbols\user32.dll\4226015990000\user32.dll.

» read more

Unplanned downtime

2009-03-04 07:14:34 +0000

At the end of February, suffered filesystem corruption. I had to revert pretty much everything to a previous backup, which meant losing about a week’s worth of stuff.

» read more

Numbering on shop fronts

2009-01-29 16:50:22 +0000

When I’m supreme ruler of the universe: shops will be required to place the “house” number somewhere on the front of the shop. It should be easily visible.

» read more

Windows 7 beta on Samsung NC-10 Netbook

2009-01-29 16:38:42 +0000

Nothing to report. It all works fine. Installation took an hour. The only hiccup was that I had to download the Marvell Yukon drivers (I used the Vista x86 ones) from Marvell’s website, but the WiFi works, so that was easy. I also slapped an SDHC card in there for some ReadyBoost goodness.

» read more

Things I learnt this week: SetWaitableTimer

2008-10-25 12:23:56 +0000

SetWaitableTimer doesn’t accept NULL for the pDueTime parameter. It returns FALSE; GetLastError() returns ERROR_NOACCESS (998). If you specify zero (i.e. a LARGE_INTEGER containing zero) for pDueTime, the timer is signalled immediately.

» read more

Things I learnt this week: SVCHOST

2008-10-25 12:23:02 +0000

SVCHOST services are configured by having ImagePath set to “%windir%\system32\svchost.exe -k name-of-service”, and a Parameters key containing ServiceDll (REG_EXPAND_SZ), which names a DLL with a ServiceMain entry point. ServiceMain has argc and argv.

» read more

Things I learnt this week: RegQueryValueEx

2008-10-25 12:21:49 +0000

RegQueryValueEx, when passed lpData = NULL, will set *lpcbData to the length required in bytes, even if it’s already set to something. If lpData != NULL, and *lpcbData is too short, RegQueryValueEx will return ERROR_MORE_DATA.

» read more

Tweaking TeamCity

2008-01-12 14:11:52 +0000

I just started using TeamCity Professional Edition for some personal projects (and we’re evaluating the Enterprise edition for use at work).

» read more

Roger's ReSharper Live Templates

2008-01-07 21:58:49 +0000

ReSharper allows you to define “Live Templates”. They’re like Visual Studio snippets, but much more useful. So that I don’t lose mine, I’m going to stash them here.

» read more

When I'm supreme ruler: Vacations

2008-01-02 09:12:37 +0000

When I’m supreme ruler of the universe: If you’ve taken more than 5 days vacation, employers will be required to let you work only a half-day on your first day back. It could be the morning, or the afternoon, but you’ll be required to work only 4 hours.

» read more

An empeg reports progress of OP_STATFID

2007-12-16 18:53:10 +0000

We’ve seen the format of the packet that emplode sends to find out the length of a file on the empeg (OP_STATFID). The empeg seems to always send a progress packet in response. The packet looks like this:

» read more

Packet format

2007-12-16 18:18:47 +0000

The format of the packets in the empeg’s TCP/IP protocol owe a lot to the fact that the empeg mk1 communicated over a serial link. This means that there’s a certain amount of cruft still in the protocol.

» read more

Which of my MP3 directories don't have a Folder.jpg file?

2007-09-08 16:39:22 +0000

There’s probably a better way to do this, but here’s what I came up with in a couple of minutes…

Get-ChildItem $mp3_root -recurse -include *.mp3 | 
Split-Path -parent | 
Get-Unique | 
ForEach-Object {
    $folder_jpg = Join-Path $_ Folder.jpg ;
    if (-not (Test-Path $folder_jpg)) { $_ + ": missing Folder.jpg" }
» read more

Source Code License

2007-08-06 11:41:07 +0000

Unless specified otherwise, all source code published on the website is available under the following license terms: Do what you want with it, but don’t claim you wrote it, and it’s not my fault if it doesn’t work.

» read more

FindFirstFile and SE_BACKUP_NAME

2007-05-25 17:04:57 +0000

If you want to read a file and bypass security (e.g., if you’re writing a backup program), it’s not enough to simply enable the SE_BACKUP_NAME privilege, you have to also pass FILE_FLAG_BACKUP_SEMANTICS to CreateFile.

» read more

Calling C# from JScript

2007-04-27 09:03:18 +0000

It’s possible, through the magic of COM interop, to call C# code from JScript or VBScript. Here’s an example of how to do it from JScript.

» read more

Implementing For Each in JScript

2007-04-24 11:01:30 +0000

function forEach(enumerable, delegate)
    for (var enumerator = new Enumerator(enumerable); !enumerator.atEnd(); enumerator.moveNext())
» read more

How do I debug my gadget?

2007-04-24 10:34:09 +0000

As far as I can tell, you’ll have to go “old school”, and do the equivalent of adding lots of printf statements to your code. This should help:

» read more

Enabling Concurrent Remote Desktop Sessions in Vista

2007-04-22 20:26:08 +0000

At work, I do all of my development on a Windows 2003 box. I generally log in as a normal user, and then use Remote Desktop to concurrently log in as Administrator. This means that I’m relatively safe from malware when doing day-to-day stuff, but that I can still get hold of Administrator privileges when I need them.

» read more

A list of HRESULT codes

2007-02-16 10:50:44 +0000

…because every time I search for a given HRESULT, all I get is yet another frigging VB website regurgitating the contents of WinError.h

» read more

Turning off Registry Virtualization

2007-02-15 10:51:58 +0000

On Windows Vista, applications running without admin privileges can write to HKEY_LOCAL_MACHINE, and they’ll be transparently redirected to HKEY_CURRENT_USER\Software\Classes\VirtualStore. Similar redirection applies to C:\Program Files.

» read more

Roman Numeral letter H

2007-02-07 17:26:27 +0000

Someone appears to have spent some time searching my site for the term “Roman Numeral letter H”. This is pointless, for two reasons:

» read more

Things I found out today while looking at Side-by-Side DLLs

2007-02-07 16:37:45 +0000

  • You can add DLL dependencies to your EXE file’s manifest by using the /manifestdependency linker switch. As with several other linker switches, this can be done using #pragma comment(linker, ...).
  • The Visual C++ 2005 compiler automatically inserts a /manifestdependency switch into .OBJ files that it creates. It marks them as dependent on the Microsoft.VC80.CRT DLL, version 8.0.50727.762. It does this in the VC\include\crtdefs.h file.
  • You can tell it to use the RTM version (8.0.50608.0) of the runtime by defining the _USE_RTM_VERSION macro. See VC\include\crtassem.h. The behaviour of this macro can be confirmed by opening (e.g.) stdafx.obj in a hex editor.
  • This also adds the /include:__forceCRTManifestRTM switch to the linker. I’ve not yet found out what this does.
  • MFC and ATL do something similar in the VC\atlmfc\include\atlassem.h and MFCassem.h files.
  • In order to allow you to merge your own manifest files, the linker is asked to create the project.exe.intermediate.manifest file, using the /MANIFESTFILE switch.
  • This is then fed to the MT.EXE utility, which can be controlled in the project property pages, under “Manifest Tool”. The .intermediate.manifest file is added to the list implicitly.
  • If you add your own .manifest files to the project, these are also added to the MT.EXE command line implicitly.
  • MT.EXE is almost as bad as MIDL when it comes to error messages. If you include an empty or malformed manifest file in your project, it simply reports “general error c101008f: Failed to compile manifest(s). The parameter is incorrect.”. It doesn’t tell you which file or line caused the problem.
  • As an aside, the “No files were found to look in” misfeature still exists in Visual Studio 2005. Press Ctrl+Scroll Lock to fix it.
  • I don’t actually have a copy of the RTM VC80.CRT DLLs on my Windows XP box, anyway. I have versions 8.0.50727.42 and 8.0.50727.762. One of these would appear to correspond to the RTM version of Visual Studio, and the other to SP1. I’m not sure about this, though.
  • These live in the C:\Windows\WinSxS folder. They both have extremely long names. For example, the latest one lives in a folder called x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.
  • In the C:\Windows\WinSxS\Policies\x86_policy.8.0.Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_x-ww_77c24773 directory, there’s a couple of policy files. The first one says that any CRT versions between 8.0.41204.256 and 8.0.50608.0 should be redirected to version 8.0.50727.42. Presumably this covers a range containing all of the CTPs and betas up to the RTM version.
  • The second policy file appears to override this by saying that these same versions, and everything from there to 8.0.50727.762 should use the 8.0.50727.762 version.
  • I found the blog of the man responsible. He’s not updated it since 2005 :-(
  • There’s a tool called FUSLOGVW.EXE which is supposed to help diagnose problems with Side-by-Side DLLs.
» read more

qmail STARTTLS is slow

2006-12-22 11:01:59 +0000

I’ve recently been struggling to reliably send email via my qmail server. I’ve got STARTTLS and SMTP AUTH enabled, in order to allow relaying for authenticated users. However, it’s been really slow, and Thunderbird quite often times out and gives up on the connection.

» read more

Unable to open Web Project

2006-11-16 12:43:08 +0000

Unable to open Web Project 'foo'.
The file path 'C:\wherever\foo' does not correspond to the URL 'http://localhost/foo'.
The two need to map to the same server location.
» read more

Access Denied to Temporary ASP.NET Files

2006-05-08 16:17:35 +0000

Sometimes, when attempting to debug an ASP.NET Web Service, you’ll get the following error: Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\_somewhere_” is denied.

» read more

Empeg File Structures

2005-02-13 10:17:00 +0000

If you’ve ever gone looking for the music and playlists on your empeg, you’ll find them in the /empeg/fids0 and /empeg/fids1 directories.

» read more

Getting hold of the current directory in a batch file.

2004-05-19 16:33:00 +0000

A common UNIX shell idiom is to write things like cwd=$(pwd) to save the current directory so that in case be used later when other things might have changed it. For a long time I didn’t think this was possible in Windows batch files. It turns out that it is, but it isn’t pretty and it does generalise to getting the output of any command.

» read more

Partitioning an empeg's Hard Disk Manually

2004-03-25 09:20:00 +0000

If you’re attempting to upgrade the hard disk in your empeg, and the disk builder is not working for you (this is often the case with disks larger than 60Gb), then you might want to build your new disk manually.

» read more

Sent Items: Thunderbird and Outlook Express on the same account

2004-03-23 11:46:00 +0000

Outlook Express likes to store a copy of your outgoing email in a folder called “Sent Items”. Thunderbird likes to store a copy of your outgoing email in a folder called “Sent”. If you use both to access the same email account using IMAP, you’ll end up with both folders being created, and your outgoing email will end up in either, depending on which client you used at the time.

» read more

Recursively Finding Files

2004-03-21 09:45:00 +0000

On my list of “things to do in my copious free time” is: “write a replacement Rio Receiver server in C#”. So I’ve started putting together snippets of code that might turn out to be useful as I start learning C#. This one is a recursive file finder. It uses delegates.

» read more

Installing qmail and vpopmail

2004-03-11 09:24:00 +0000

My mail server runs qmail. This is the first of a multipart series showing how I went about installing vpopmail for virtual domain support.

» read more

Disabling the Cancel button in a Wizard

2004-01-09 13:03:00 +0000

CPropertySheet provides the SetWizardButtons function, allowing you to enable or disable the “Back” or “Next” buttons. It doesn’t, however, allow you to disable the “Cancel” button.

» read more

Conflicting 'lib' target

2004-01-09 10:39:00 +0000

empeg’s source tree has a directory called lib, in which the core libraries used by all of our products live. Unfortunately, this conflicts with one of the included pseudo-targets that jam uses.

» read more

Linker Command Line Length

2004-01-09 10:37:00 +0000

Jam imposes a hard limit of 996 characters on command lines when built on NT. This limit is higher for other operating systems, and can actually be raised to around 10Kb on Windows 2000. However, it’s still not high enough for some link actions.

» read more

Displaying Progress in a Wizard

2004-01-08 18:24:00 +0000

I’m adding a wizard to the program that I’m currently working on. The wizard walks the user through importing some information from a file. I’d like to be able to display the import progress as a seamless part of the wizard.

» read more


2004-01-07 19:16:00 +0000

Welcome to, where Roger occasionally posts snippets of code and other stuff that he feels like sharing with the world.

» read more


2003-07-07 17:13:00 +0000

The ON_COMMAND_RANGE and ON_UPDATE_COMMAND_UI_RANGE macros are useful when you want to treat a group of commands similarly. In this case, it’s the commands for changing list view style. The command IDs must be contiguous, and you must specify the lower one first.

» read more

RJ45/UTP Crimps

2003-06-23 15:16:00 +0000

(Seen from the bottom of the connector, so that the tab is facing away from you, and the gold pins are facing towards you) Pin 1 is on the left. Pin 8 is on the right.

» read more

Using make-kpkg to build a custom Linux kernel for your VAIO

2003-02-04 15:10:00 +0000

Debian provides a powerful utility called make-kpkg for compiling your own custom kernels. It integrates tightly with dpkg by making .deb files and you can even use this to prepare your kernel image on a faster system. Later on it will make complex operations, such as compiling in patches and modules, a snap.

» read more

Installing Debian GNU/Linux on Sony Vaio SRX87

2003-02-04 15:10:00 +0000

Because the DVD-ROM drive supplied with the SRX87 is Firewire, and is not supported by the standard Debian boot images, you’ll need to use network booting (using PXE) to get it going. This page has some instructions for installing Debian in this manner.

» read more

Vaio: ACPI patches

2003-01-13 16:03:00 +0000

You’ll need to install the ACPI patches, and the ACPI daemon. Grab the patches from here, and apply them to the kernel:

» read more

Streaming to Winamp

2001-12-18 22:44:00 +0000

Since the Audio Receiver Manager (the server) uses HTTP to stream the MP3 data to the Rio Receiver, it’s possible (with some work) to stream directly to Winamp. Here’s how.

» read more

Advanced Searches in emplode v2.0

2001-10-25 19:29:00 +0000

emplode v2.0 adds the ability to search your music database. It provides two methods of doing this: simple searches (which are hopefully so simple that I won’t explain them here), and advanced searches.

» read more

Scanner trials and tribulations

2001-09-25 15:50:00 +0000

This morning, I decided to buy myself a scanner. I’m planning on using it for document filing – keeping my credit card statements on CDROM, etc.

» read more

Moving Message Sign

2001-06-01 10:41:00 +0000

A couple of weeks ago, we got an LED message board at work. They had them on offer at Maplin (if I recall correctly). Anyway, the manual with the board is singularly useless. It’s labelled “Moving Message Sign”, and has a picture of the display with “Taiwan Kingpul” on it.

» read more

Asus A7V Windows Box

2000-12-08 00:01:00 +0000

As mentioned here, my Pentium II-400 got fried by an ocuk power supply. As they say, however: Every cloud has a silver lining. With a dead computer, I could finally persuade my girlfriend that some long-overdue upgrades were necessary.

» read more Power Supplies

2000-12-08 00:00:00 +0000

I don’t know if there’s something in particular about, but we’ve not had any good experiences with their power supplies. We’ve had two power supplies from ocuk, and they’ve both gone horribly wrong, and fried a whole shedload of hardware.

» read more

My name is Roger Lipscombe.

I'm a software developer at Twilio, where I lead the Imp Core (IoT) team, mostly programming in Erlang and C++.

I mostly blog about programming and other technology and gadget stuff.