A brief history of construction:

This starts in the first week of January, and runs through last week.

Living in a house that’s under construction has been, …, interesting. But we’re starting to see the light at the end of the tunnel.

Putting together the animated GIF was pretty easy, too. I’ve been taking pictures from the same spot across the street from our house. I loaded each image into the Gimp as a separate layer. Then increased the transparency of that layer, so that I could line up the roof lines. I used the roof peak that’s over the dining room, in the front of the house, as the key, since the main roof line changes during construction. Then, because they weren’t all framed the same,I cropped it to the intersection of all of the frames. When you save a multi-layer image as a GIF file in the Gimp, it asks whether to save as an animated GIF, or to flatten the image.

Pretty easy, once I learned what the tools could do.

Thinking about Exception Safety in C++

Thanks to David Abrahams, we have a framework to discuss the relative exception safety of C++ components. Quick reiteration:
# The basic guarantee: that the invariants of the component are preserved, and no resources are leaked.
# The strong guarantee: that the operation has either completed successfully or thrown an exception, leaving the program state exactly as it was before the operation started.
# The no-throw guarantee: that the operation will not throw an exception.

A corner case, that came up recently in discussion about shared_ptr, is how to describe the situation where the invariants of the component are preserved, the state of the component is what it was before, but the state of the program is not exactly as it was before the operation started.

shared_ptr potentially can throw an exception during construction. If it does, the pointer that it is constructed on is deleted (or the deleter called). This is important, as it prevents any resource leak. But it does mean that there is a change in the state of the program. Whatever the pointer is pointing to is gone. Does this mean that shared_ptr only provides the basic guarantee?

That would be unsatsifying.

The only way out of it that I see is that any attempt to observe the changed state would involve undefined behavior. And it would be the same undefined behavior, at that point in the code, if the operation did succeed.

Concrete, simple, case:

Widget * w = new Widget; // 1
// … some more code
shared_ptr sp_w = shared_ptr(w); // 2
// … yet more code.
w->widgetOp(); // 3

How could we arrive at 3 if an exception was thrown at 2? Only if 2 was inside a try block of some kind, which implies at least one block scope level difference between //1 and //2.

Which means that when that scope was exited, sp_w would have gone out of scope and been deleted, so that any reference to w at //3 would be invalid.

It seems to me that the program state in the strong guarantee must be one that is marked as being the beginning of a transaction by opening a try block. That this is necessary, although not sufficient for transactional behavior. Of course to accomplish this, each component must revert its state to the initial conditions, no component can know enough to revert the state of the entire program.

We Have a Roof!

Not only a roof, a whole second floor up there! This picture is from Monday morning. Our contractor worked over the weekend to keep us from freezing (more) than we already were. To be fair, he warned us it was going to be like living in a war zone once the roof started to come off.

Moving homebrew around

I have two batches of beer in progress at the moment. The first was

supposed to be a Scottish Wee Heavy, but due to technical difficulties during the mash, it ended up a lot lighter and therefore hoppier than I had intended. The hose connecting the false bottom to the outlet valve came loose, and I had to dump out all the grain, reconnect the hose, add more water to keep the grain bed floating, the dump all the grain back in. Only to discover that some grain had got stuck in the valve, and I had to do it all over again. So it ended up with about a gallon of extra water in it.

That batch got bottled last night. It looks pretty good. I’d noticed earlier a problem with haze, and added some Sparkalloid,

which took everything out of suspension, leaving really bright, clear beer.

The second batch is what the first batch should have been. A nice rich, malty, Scotch Ale. Original gravity of 1.096, which is down to 1.016 right now.

Pine Wood Derby

Friday night was Pine Wood Derby night for both of my kids. So, for
the past few weeks, on top of all the house construction, we’ve been
working on making little tiny race cars. Michael made it to the
semi-finals in his division, Jonathan made it to the finals in his,
where he came in second and got a medal. Michael was a bit
disappointed. We’ll have to work harder next year.

The Roof is OFF!

This is before they started work in the morning.


This is what it looked like the following morning.

There’s some temporary framing so they can work under the tarp, so it doesn’t look as dramatic as I thought it might.

It’s a little chilly in the house, though.