ned Productions Consulting

Technology musings by Niall Douglas
ned Productions Consulting
(an expert advice and services company based in Ireland)

Sunday 19th February 2017 10.54am

Link shared: I'm sure you all remember me mentioning my current unemployment side project, a C preprocessor written in Python, and that by far the hardest part in it is correct function macro expansion. Indeed, Microsoft's preprocessor has long gotten it wrong, and it's worth looking into some of the problems. Superficially a C preprocessor looks very, very straightforward. It originated in the 1970s as a simple string match and substitute preprocessor, so: #define FOO foo printf("FOO is %d\n", FOO); … after preprocessing substitutes FOO for foo, but not in string literals (anything surrounded by double quotes), so output is: printf("FOO is %d\n", foo); You can implement one of those very easily, simply scan the line for string literals and replace them with placeholders, then scan the remainder for the macros you know about and substitute them, after restoring the string literals.

Friday 17th February 2017 3.44pm

Link shared: I've been a little quiet on here of late since I came out of contract, and it's amazing how five weeks of unemployment have passed just like that. I had to relinquish my rented office inside town to conserve cash a little over two weeks ago, and since I've returned to being at home all day I've essentially become mostly a daycare worker. It's no bad thing, Clara gets taken out each day to do something with her Daddy, and she's very, very pleased about that.

Thursday 19th January 2017 10.21am

Some interesting thermal results from the Galway passive house yesterday. First is that a thermal camera is deceptive at telling you how well insulated a house is. Below is the system built timber passive house we saw in infra red and visible, the temperature range goes between 3.0 C and 10.4 C, the walls are clearly 8.3 C. The third picture is my house last night, temperature range is nearly the same 3.0 C to 10.6 C with the walls at 8.2 C.

Monday 16th January 2017 1.59am

Final little demo of my new thermal camera is looking at the ceiling of the front room many hours after the heating has turned off. The FLIR One's camera is, as you've no doubt noticed, very low resolution, about 160 x 120. It also has a frame update rate of no better than 15 fps even when using the unofficial (paid) Android app I'm using below which unlocks quite a few features imposed on the device by US military technology export restrictions (I'm in Europe, so those don't apply to me, but the manufacturer which is US based must comply.

Wednesday 4th January 2017 8.48pm

Link shared: Nailed this cunning piece of cmake hackery today, so I thought I would share it. It solves the problem of cmake annoyingly not supporting out of the box per-target setting of C++ exceptions on/off, C++ RTTI on/off and whether to use the static or dynamic C++ runtime. It also, very usefully, stops the warning MSVC makes about overriding the C++ exceptions enable that cmake enforces in the core compile flags on MSVC, this is amazingly useful when you turn on error on warnings and your C++ has exceptions disabled.

Sunday 1st January 2017 3.46pm

The holidays are over! Sun is just setting now after our short walk and just about to leave grandpa's for home. I don't return to work full time until Tuesday, but from then onwards it's very much back to the sixty hour weeks until the ACCU conference in April where I'll be presenting again this year. I think I'll be taking a break from CppCon this year so no Seattle in September, I don't have the free time this year to prepare material for it.

Friday 30th December 2016 4.16am

Link shared: Every Christmas I try to get some essential technical infrastructure maintenance done, and most years it turns into something quite technically tricky which isn't easy to fix and usually involves writing a complex Python program in an area far from my normal expertise to solve. This is one such year. It's good training, and worth writing here about. For fifteen plus years now, my email client has been good old Win3.1 era Pegasus Mail ( which now contains maybe 30k archived emails.

Monday 19th December 2016 12.20am

Drove the old year 2000 Focus for the first time in a month today. It was driving weird, then went into limp home mode where there is no engine power to prevent damage which makes taking off at junctions at roundabouts no fun. So I plugged in my newly acquired ELM327 USB cable from eBay for a few quid that lets my laptop talk to the car's on-board computers. Turns out cylinder 3 is not firing, so the ECU put the car into emergency limp home mode.

Saturday 17th December 2016 3.01am

Finished running some benchmarks comparing my new MacBook Pro 13 with Touchbar and my old Dell E6410. My 2016 MacBook has a 3.3 Ghz (turbo 3.5 Ghz) Skylake CPU with 16Gb of DDR3-2133 RAM. My 2010 Dell E6410 has a 2.53 Ghz (turbo 3.0 Ghz) Nehelem CPU with 4Gb of DDR3-1066 RAM. The former cost me nearly €3,000, the latter €550 as it was a retired ex-corporate laptop I bought from eBay US in 2014 for €160 and I bought it a new battery, charger, SSD etc as ex-corporates don't come with any of those.

Saturday 17th December 2016 12.08am

Grrr I bought a just released MacBook Pro 13 some weeks ago and I've been having one hell of a time persuading it to run Windows. Firstly, you need to use and only use the Consumer Win10 ISO preferably in US only. Anything else tends to cause Bootcamp Installer to crash out randomly, or to bork the install such that the installed Windows won't boot. Secondly, once Windows boots up you'll find it won't connect to any 5Ghz 801.11n network.