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!

Friday, March 6, 2015

Quadruple vision...

Quadruple vision...  The Hubble telescope has imaged a spectacular example of “gravitational lensing” (see image at right, click to embiggen).  The yellowish supernova seen four times is actually behind the closer galaxy that appears to be centered between them.  The gravity field of that galaxy is acting like a lens, bending the light from the supernova around itself so that we see four different images of the supernova.  This is a phenomenon Einstein predicted as a consequence of his general relativity theorem...

Thursday, March 5, 2015

Folding fractions...

Folding fractions...  You can easily fold a piece of paper to half its width – but can you do a third, or a seventh, or a nineteenth?  Sure you can!

Horses in the moonlight...

Horses in the moonlight...  This morning when I got up at 3 am to take Mo'i for a walk, I didn't turn the outside lights on – there was no need.  The moon was nearly full, and quite high, the sky was crystal clear, and there's snow covering most of the ground.  The result was fairly bright lighting outside, more than enough to see the color of our flags, our orange trailer and FJ, etc. Walking was no problem at all.  The temperature outside was around 20°F, cold enough to make the snow crunchy.

As Mo'i and I walked around the yard, I noticed a dim light across the street from me, along the dirt road that borders the property belonging to my neighbor to the east (Gary and Elaine S.).  Thinking that it might be someone broken down in a car, I walked over there with Mo'i.  It was a beautiful walk in the moonlight, just a few hundred yards but full of sensory delights.  In addition to the cool white moonlight there was the crunch of my boots on the ice and snow, the occasional sound of ice falling off a tree, the snuffling of my neighbor's two horses, and the aroma of their pasture.

When we got to the light, I discovered it was a small round sign that said “Vivint”.  I'd never heard of Vivint before, but with a little googling I discovered it was a home security company.  Apparently there's an alarm system in the adjacent horse barn.  I'd never noticed the lit sign before; perhaps it was recently installed, or perhaps I just never noticed it in the glare of the outside lights I usually have on when I walk the dogs at night.

As I checked out the light, my neighbor's two horses came trotting over to greet us; black shapes in the moonlight, accompanied by horsey sounds and smells.  One of them is entirely black, the other also black except for a small white blaze on its forehead.  They looked a little spooky in the moonlight; a bit like the black horses ridden by the Nazgûl of the Lord of the Rings.  Both of the horses remembered me from previous encounters, but both were leery of Mo'i at first.  Within a minute or so, though, both of them were rubbing noses with a delighted Mo'i, who's always been interested in large animals.  I think the horses were very happy to have some company on a cold morning; they complained a little bit when we left...

Wednesday, March 4, 2015

The Musashi is found!

The Musashi is found!  The wreck of the Japanese super-battleship Musashi (sunk in the WWII Battle of Leyte Gulf) has been found.  A team of researchers funded by Paul Allen found the wreck after eight years of work...

Geek: the evolution of character codes...

Geek: the evolution of character codes...  For an aging geek like me, this paper was a trip down memory lane.  In the '70s, while writing software for Univac computers that were part of the U.S. Navy's NTDS system, I often wrote programs to convert textual data from one character encoding to another.  This was a common problem, as there was no “one standard to rule them all” as there is today with Unicode.  Instead we used a combination of different character encodings, and if we wanted one system or program to communicate with another, we had to write a conversion program to do it.

The character encodings that I worked with included several widely used ones: Baudot, FIELDATA, ASCII, and EBCDIC, all discussed in the linked paper.  We also used some special-purpose, typically application-specific encodings that were basically primitive compression schemes – these were especially common in what we'd call log data today.  For instance, one system I worked on kept a log (on magnetic tape!) of all the targets we had identified and tracked.  Space on that tape was at a premium, so many simple tricks were used to conserve characters.  One that I recall: in an ASCII character stream (5 bits per character), we had a special “numbers-only” mode that was initiated by a control character.  Once in that mode, codes from 0x00 to 0x63 represented decimal digit pairs (00 to 99), and 0x64 dropped us out of that mode.  This was useful because a high percentage of a log was comprised of numbers – so why “waste” an entire ASCII character for just one digit?  If you had a number with 8 or more sequential digits (and we had many of these), this character encoding would save bits.

What a different world with Unicode today!

Quote of the day...

Quote of the day...  From Josh Bloom, writing at Science 2.0:
The "war on drugs" has been a dismal failure by any measure. Turning cancer patients and others with severe pain into collateral damage in this un-winnable war is inhuman.
I have only suffered from serious pain a couple of times in my life.  On both those occasions, luckily for me, I was easily able to obtain powerful opioid painkillers.   That may not be true, should I need them again – and I, for one, am not looking forward to suffering because of that.

There are many reasons to end the war on drugs, and this is but one of them...

Glasses to treat color blindness...

Glasses to treat color blindness...  For real!  But only certain kinds of color blindness, albeit the most common ones.  These glasses work by blocking particular light frequencies – those sensed by both red and green “cones” (the color-sensitive photo-sensing cells on your retina).  By blocking the common sensitivity, the glasses improve the eye's ability to discriminate between colors.  My favorite part: the effectiveness of these glasses was discovered entirely by accident!

I sure hope they've gotten better...

I sure hope they've gotten better ... than they were when was in the Navy (the early '70s).  I was on the USS Long Beach CGN-9 (now decommissioned and sold for scrap), and we had a pair of 5 inch guns on board.  A crew of Marines manned those guns, and we occasionally engaged in some target practice – usually shooting at either towed targets or at stationary targets on small islands off the coast of California.

The ability of our gun crews to miss their target was the stuff of USS Long Beach legend.  We heard stories of ships that would refuse to tow targets for us to shoot at, from the (entirely justified) fear that our guns would hit them instead of the target – no matter how long the towline was.  I remember watching target practice against an island target and seeing shells landing hundreds of yards from their aim point.  From all I could tell, the bad reputation our guns had was well-earned.

I was an enlisted guy, and my living quarters (a “berthing compartment”) was shared with 40 or 50 other technically-oriented enlisted guys (ETs and DSs, for the most part).  Our berthing compartment was right next to the Marines' berthing compartment, and there was a seldom used hatch (door) between the two.  One day after target practice we heard a commotion from the Marines' side.  A couple of us went over to see what the fuss was, and it turned out that a bunch of Marines were delivering some physical justice to the gun crew – for having dishonored the Marine Corps with their bad shooting.

One hopes things aren't quite so bad these days...

Weirder and weirder...

 Weirder and weirder...  The latest episode in the Hillary-didn't-use-government-email saga is an odd twist indeed: the email address she used for official business (hdr22-at-clintonemail.com) was hosted on a private email server.  These days it's pretty darned odd for an individual to go to all the trouble of acquiring, installing, configuring, and maintaining a private email servers.  Even businesses are moving toward hosted email (services like Google's GMail) to save money and the need for expertise.  Often the motive is the realization that email security is hard, and getting harder every day.

So why would Clinton have her own email server?  I don't know the answer to that, of course – but it's darned hard to think of a benign reason for her to do so.  If she was some kind of a geek, I could pass it off as a hobbyist sort of thing – but she's famously not a geek.  The only other motivations I can come up with revolve around a desire for secrecy – which in the case of a government official would be (a) inappropriate, and (b) illegal.

The Clinton machine's response to all this?  It boils down to “Shut up!  You’re talking to the next President of the United States, you insignificant worm!”  How's that for a pleasant thought to start your morning with?

The cure for cyber-bullying...

The cure for cyber-bullying...  A father unmasks some men who made disgusting online comments about his daughter – and suddenly there was an attitude change.  There's an entrepreneurial opportunity here for a nerdy version of the old-fashioned hard-boiled detective...

A pill that provides the benefits of exercise?

A pill that provides the benefits of exercise?  Maybe.  I'll take that as a substitute for the flying car I thought I'd have by now...

First I read a transcript of Netanyahu's speech...

First I read a transcript of Netanyahu's speech ... (here) and I felt a flicker of hope for the free world.  I felt the presence of an adult in the room.  I heard the pride of a patriot defending the country he loves.

And then I read the comments to this piece on the Huffington Post, and all is black and despair again...

Tuesday, March 3, 2015

Progress report...

Progress report...  We've been slowly whittling away at the 25 million little things that need to get done around the place.  We've hung numerous pieces of art, built a bed board, rewired the entire first floor (second floor and basement still to go), installed a couple dozen heating registers (and even more remain to be done), installed interior door hardware on the five doors in the barn, and (yesterday) did the first bit of wiring in the barn. 

That last bit was a learning experience for me – I'd never used plastic conduit before, so I was learning as I went.  I installed two outlets on the ceiling, right next to the garage door opener's motor, and ran conduit with 14/2G romex between there and the breaker panel.  When doing a project like this, one becomes acutely aware of all the angles in the building :)  That run took 8 pieces of straight conduit and 7 90° bends (called “sweeps” for some reason), along with a surface-mounted junction box and a threaded connector for the circuit breaker panel.  The installation involved mis-cutting several pieces of conduit, glue, and creative use of English (especially phrases involving words with four letters).  I did get it installed and working, though – and the rest of the wiring should involve somewhat less learning...