Pages
Archives
- September 2011
- April 2011
- February 2011
- January 2011
- November 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- February 2010
- January 2010
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- May 2006
- March 2006
- February 2006
- January 2006
- December 2005
- October 2005
- September 2005
- August 2005
- May 2004
- March 2002
- October 2001
Debugging with a drill
We’ve got this great old lamp that blew up recently. Smoke, black charred bits, scary. Easy enough to fix right? NO! The Master Craftsman that originally put this together must’ve been able to bend space & time. Wire doesn’t normally bend at right angles unassisted, much less an acute angle like this:
But the person that wired this up back in the 1960s did it. Twice even.
I spent a couple of days trying to make it happen. Different gauge wire, wire lube (such a thing exists!), hacks with hooks, pulling, pushing, whatever. Other than sore thumbs, nothing.
So could applying some practical real-world software engineering experience help? When facing a code problem, the first tool out of the bag is usually the log statement. (Logging helps you get a better grasp on how a particular piece of code works by exposing the inner workings. Very low-tech, very hacky.)
In my case, I dragged out the power drill and starting adding log statements to my lamp assembly. Luckily I just needed one:
That little black hole at the junction there was all it took. Under real lighting I was able to see how it all came together. Once again, props to the original builder, pretty clever. Sure it’s unsightly but like most code bases, that’s life. Anyway the light works now and everything is hidden by the lampshade.