Saturday, March 7, 2015

All the sub-panelz are mine!

All the sub-panelz are mine!  I finished wiring in the sub-panel for the woodworking shop this afternoon.  The photo at right shows it with the cover off, and absolutely nothing wired into it yet :)  But it has power, and I've tested the safety ground and neutral wires, just to be sure I don't have problems later on. 

After I finished with this, I spent a couple hours getting started on the lights in the garage section.  It will probably take me a couple days just to get the basic wiring in place, then another day to actually install the ten lights I'm putting up in there...

Never in a million years...

Never in a million years ... would this have occurred to me: photographing people covered in honey.  It's far more interesting and beautiful than I would have guessed.  Watch the video at the link...

Uranium emissions, visualized in a cloud chamber...

Uranium emissions, visualized in a cloud chamber...  I want one!

Geek: integer overflow/underflow in C/C++...

Geek: integer overflow/underflow in C/C++...  My first reaction on reading this paper was this: geez, guys, it's 2015.  This problem has been around since about 1945.  Is this really still a mystery and a source of problems?  I've run into this issue (and other numerical representation issues) over my entire career, and I've no sense that things have actually gotten better over time.

With respect to integer overflow/underflow, the fundamental issue is very easy to understand: computers generally represent integers in a way that limits the range of integers that can be represented.  For example, in today's computers a single byte can represent all the integers between 0 and 255.  If you try to add, say, 200 + 100, the result (300) cannot be represented in a single byte – that's an example of integer overflow.

We humans don't generally run into integer overflow or underflow, as we don't have any particular limits on the size of integers we can represent.  Computers, on the other hand, do have this limitation – and therefore computer programmers have to deal with it.  This is where the problems start, as there are many possible ways one could deal with it – including ignoring the possibility altogether, which is in practice what most programmers actually do.  This is the source of much trouble.

The problem is complicated by at least two things in modern computers: the fact that multiple sizes of integers are available (generally, but not always, some even number of bytes), and the fact that both signed and unsigned integers can be represented.  For instance, a single byte unsigned can represent integers in the range 0..255, whereas a single signed byte can represent integers in the range -128..127.  Older computers (and a few still in production) through a different variable into the mix: they represented integers by schemes other than the now-ubiquitous two's complement encoding.  I've worked extensively with computers that used one's complement integer encoding and signed binary coded decimal (where the sign is held in a special bit), and to a lesser extent with zoned decimal encodings.  Each of these has their own special variations of the overflow/underflow problem, though of course being fixed size encodings they all have the problem.

Anyway, it just seems kind of silly that at this stage of software development we still don't have a standard way of handling integer overflow/underflow, and we still haven't managed to educate programmers about the problems they cause.  Actually, it's worse than that – even within the past few years I've run into programmers in very responsible positions, sometimes with years of experience, who don't actually understand the source of overflow and underflow, and who believe the problem can be safely ignored most of the time.  They're wrong and they don't even know it...

Oopsie...

Oopsie...  Spelling errors can creep into the most unlikely places.  Like, for instance, the title on a video associated (screen capture at right) with this Financial Times article.  I suspect someone's going to get a little talking-to this morning – those British publications take their spelling and style guidelines quite seriously :)

Email outage...

Email outage...  Yesterday our family email (which is hosted by GMail) was down for close to 24 hours.  The symptoms were that we stopped receiving any new mail, and the URL we normally used to access our mail stopped working (though the default GMail URL still worked).  If you're the geekly sort, you probably immediately said “DNS problem!”, and in fact that's what it was.  Once that got resolved, our missed emails started trickling in, much to the general relief of my family members.

Two observations from this experience:

First, how dependent on email (and the Internet, more generally) we've become!  Our email has become one of the rhythms in our lives – we expect certain emails to arrive at certain times of the day, and when they don't arrive, it feels like a major disconnection – a bit like the power going out, or the road to your house being shut down.  Some of my family members, when reporting the outage, had a distinct tinge of, well, panic in their voices.  In actual fact, it's nothing so vital (though for my sister, who uses email in her business, a bit more so).  Nevertheless, when it's cut off, we don't like it.  Not. One. Little. Bit.

Second, how amazingly reliable email has become.  My family has been using this (free!) GMail service for about ten years now.  In all that time, we've only had a couple of short outages.  We access our email from the web on multiple browsers, from email “fat clients” (like Mozilla's Thunderbird), from iPads, and from smart phones.  Wherever we are, whenever we want it, however we want to access it – it just works.  This reliability is in marked contrast to the self-hosted Microsoft Exchange email server that I maintained for roughly ten years prior to that.  That beast would go down about once a week, and sometimes it took hours of troubleshooting (by me!) to get it back up again.  I lived in fear of updates to that server, because about one in four of them would knock it offline.  Contrast that with our GMail experience: I spend zero time managing the service, and it just always works.  Well, almost always.  Google deserves a great deal of credit for building such a reliable system.  Such things do not happen by accident!

Barn progress...

Barn progress...  I've been working away at the electrical wiring in our barn.  Yesterday I mounted a sub-panel in the workshop and started to wire it into the main breaker panel.  There's a 65' run between them, with three 90° bends required.  The sub-panel has a 50 amp capacity, so I'm using 6 gauge wire: two “hot” wires, one neutral, and one safety ground.  I'm using separate wires (rather than romex) to make it easier to pull it through the 3/4" conduit.  I'll have that finished with a another couple hours of work.

Meanwhile, I've mounted an LED ceiling fixture in the bathroom, with a wall switch, and I've ordered lights for the garage section (10 lights) and the workshop (15 lights).  I figure each light is about 30 to 45 minutes of work, so I've got a few days of work just to get the lights up.  Both of these areas present some light-mounting challenges, as there are obstacles on the ceiling.  In the garage area I can't mount any lights where the garage door traverses, and in the workshop area I have the large “hatch” in the ceiling (to hoist heavy items up into storage).  I haven't yet decided how to deal with the latter issue.

Yesterday I ordered the first pieces of equipment for my woodworking shop.  This feels like a milestone of sorts, as that woodworking shop was one of the big motivations for building the barn in the first place.  The first two pieces of gear: a dust-collection system (a 3HP Grizzly model that gets good reviews) and a table saw.  On the table saw I splurged a bit to get a SawStop model with their safety technology.  I've watched their hot dog demonstrations several times in person (see the link for a video), and each time I was astonished at just how well it worked – it stops the blade so quickly that there's barely a nick in the hot dog they feed directly into the spinning blade.  The blade and the brake are destroyed in the process, but for around $100 they can be replaced, and you're back in business.  That seems like a very small price to save one's finger, no?

I'm a careful guy around power tools; I have a lot of respect for the damage they can do to the user.  Table saws have always worried me, though I've never hurt myself when using one.  With that completely exposed blade that you're pushing work into, it would be so easy to make a tiny mistake that cost you a finger.  One little slip, and it's “bye bye” to a finger or two.  On most other power tools, you're not feeding work into the blade, so the danger is substantially lower.  Consider, for instance, operating a drill press: you have the work clamped or held on the work table, and you turn a control to lower the drill into the work – this is inherently a much safer task than pushing a piece of wood straight into a spinning disk rimmed with sharp carbide teeth.  Also the table saw is one of the central tools for any fine woodworking – one would probably spend more time with it than with any other dangerous power tool.  Add all that up, and it starts to make sense to spend a bit more to help preserve my digits.

Both the saw and the dust collection system require 220V single-phase electrical connections.  More wiring :)  With any luck at all, they will arrive within two weeks, and probably a week or so after that I'll have them up and running.  Once I have an operable table saw, I can start actually building some things of wood.  Woo hoo!