Wednesday, January 27, 2010

On the Ancestry of Consumer Electronics

Writing about the Newtpocalypse the other day inspired me to get my MessagePad 120 working again. In the comments of that post, Grant Hutchinson pointed out that my MP120 would not be affected and should still work. Indeed, it does! The backup lithium battery still had a little charge left, so my files are still present. The Newton pre-dates Flash memory, and stores all files in battery backed SRAM. The battery faithfully kept the SRAM powered for the last 13 years sitting in my garage, patiently waiting for me to use it again.



This morning Kara Swisher republished a Steve Jobs interview from 2004, talking about the products which Apple chooses to pursue and not to pursue. Its an interesting perspective on the eve of Apple's media event today. As she notes, in some respects Apple's new device will be "the Newton’s great-grandson."

Friday, January 22, 2010

Sun Microsystems, 1982-2010

I was a summer intern at Sun Microsystems in 1991, working on Verilog test cases for a 155 Mbps ATM adaptor. I still have the T-Shirt, shown here. Only after we had the shirts made did the intern coordinator really look at it and notice the Sun logo was orange instead of purple, a bit of a gaffe. On the back are shown the companies who we, the interns, perceived as competitors. I've no idea why Apple is there while SGI is not, chalk it up to the exuberant misinformation of youth.

Sun Microsystems intern T-shirt 1991.

I returned to Sun as an ASIC designer (eventually transitioning into software) and worked there from 1992-2000. The first few years in that span were rough for Sun: the market was just beginning its transition from Unix-based CAD and graphical workstations to Windows NT on x86. Sun managed the transition pretty well, moving the bulk of its business into large SMP servers which the Intel boxes of the time did not scale to. Then came the dotCom boom, which were heady days for Sun.

Sun had a tradition of elaborate April Fools jokes. One year a complete hole of miniature golf was constructed in Scott McNealy's office. Another year a platform was built submerged 1" under the surface of the campus lake, with Andy Bechtolsheim's Ferrari parked upon it. I have the T-Shirt from the 1993 joke: the SHARCStation with superSHARC processor. A complete workstation was submerged at the bottom of a pool, with a scuba diver operating it. I don't remember whether it worked while underwater, but given the culture of Sun at the time I suspect they had come up with a way to waterproof it. Amusingly, I just searched for superSHARC: its now the name of a real processor, a DSP from Analog Devices.

Sun Microsystems April Fools T-Shirt SuperSHARC 1993.

I left Sun 10 years ago... but I've missed it. In the mid 1990s it was a heady place, a company at the top of its game with extensive resources to push the industry along. Its corporate culture valued engineers highly, which showed up in lots of little ways but one big one: enclosed offices. Sun would use cubicles if necessary, but the corporate preference was an office with a door. MTS level positions would be doubled up in an office, Staff Engineers and above were allocated a single office.

After the dotCom bust, Sun's fortunes changed considerably. The way is now clear for Sun to be purchased by Oracle. Rest in Peace, Sun. These last few years have not been kind.

Thursday, January 21, 2010

Colloquialisms in Code

Both of my parents are from Tennessee. Per capita, Tennessee has the highest density of colloquialisms than any other place in the western hemisphere. So ... lets code them up. You can mouse over each item to show the original phrase it purports to represent. Note: the Javascript rollovers don't work in the RSS feed, only on the web page. So far as I know, its all akin to voodoo.


--------


justification = my_ass.pull();
I pulled the justification out of my ass.

--------


Drawer = Set(["knife1", "knife2"])
if not "sharpest" in Drawer:
Not the sharpest knife in the drawer.

--------


if not (hand[left].find(his_ass) ||
        hand[right].find(his_ass) ||
        flashlight.find(his_ass)):
He couldn't find his ass with both hands and a flashlight

--------


ASSERT(dead.val() > doornail.val());
Dead'er than a doornail.

--------


if (them.fitness == fiddle.fitness):
Fit as a fiddle.

--------


CHECK(!(water[FISH_CONSTANT]));
Like a fish out of water.

--------


error: prototype for 'Silk_Purse(Cows_Ear)' does not match any in class 'Silk_Purse'
You can't make a silk purse out of a sow's ear.

--------


interface Wagon {
  public:
    void Wheels();
}
class Grandma implements Wagon {
If Grandma had wheels, she'd be a wagon.

--------


Bricks[LOAD - 2];
Two bricks shy of a load.

--------


class Shadow {
 public:
  Shadow(Shadow); // copy constructor
}
class Person {
 public:
  Shadow Stand();
}

Person Skinny;
Shadow S(2 * Skinny.Stand())
So skinny they have to stand up twice to make a shadow.

Tuesday, January 19, 2010

Recollecting The Calculus

Allow me to summarize my recollections of The Calculus:

  1. One must always refer to it as "The Calculus," never just "calculus."
  2. The first derivative is the instantaneous rate of change, i.e. the velocity.
  3. The second derivative is the instantaneous rate of change in the velocity, i.e. accelleration. Etc, etc.
  4. Laplace transforms are a much easier way to compute derivatives.
  5. I have no recollection of how to use the Laplace transform.

Thats pretty much it, in a nutshell. I suspect that had the modern web existed back then, my calculus classes would have been different but my retention of the material decades later would be about the same.

Wolfram Alpha computing a derivative

Friday, January 15, 2010

Intel Acquiring FPGA Vendor?

EE Times reports on a JP Morgan Analyst prediction that Intel will acquire an FPGA vendor. The purported reason: to expand its competitiveness in embedded systems and system-on-chip. The two obvious market leaders in that category are Altera and Xilinx, though there are several smaller vendors like Actel and Lattice as well.

Fake Intel x86 with FPGAs

The SoC angle is interesting, in terms of the disruptive change it might allow. Freescale carries a huge variety of part numbers with various combinations of PowerPC core plus networking, USB, CAN-BUS, encryption, etc. Some of the functionality is implemented via an independant communications processor (a 68k descendant) alongside the PowerPC, to try to make each chip more flexible and able to serve different markets. Nonetheless, its still a very large collection of chips. Intel could be aiming for just a few different parts, with embedded FPGA blocks of various sizes and I/O pinouts. Need CAN-BUS? Buy a part with the right type of pins bonded out, with a license for soft logic IP to load into it. More sophisticated customers could load their own design logic into the FPGA blocks.

At one time Xilinx offered parts with hard logic PowerPC cores, but the CPU performance was modest and did not remain competitive over time. Xilinx and Altera both now emphasize soft logic CPU cores instead. These certainly work... but implementing a CPU in FPGA gates is an awfully expensive way to get your software to run. If Intel were to enter this space it would come from the opposite direction: a modern CPU core paired with a modest amount of FPGA logic.

EETimes published a subsequent rebuttal of the acquisition rumor, throwing around big numbers about the premium to be paid for Altera or Xilinx. The numbers make my head hurt, but its worth a read if you're interested in the topic.

Monday, January 11, 2010

Long Hidden Easter Eggs

As we have a 4 year old daughter, computer games have become part of the background noise in our household. One of the popular games at the moment is Pajama Sam 2. It was published in 1998, and we'll see in a moment why that is relevant.

Pajama Sam Boardroom scene

One scene in the game involves the Chairman of the Board brainstorming who should fill the empty board seat with the other board members. As it is a kids game the Chairman is an overstuffed seat, and the board members are anthropomorphic lumber. Of course. The dialog is complete filler, chosen at random from a small set of snippets:

Board Member: "Did I suggest Bernie from Research?"
Chairman: "Yes."
Board Member: "Did I already mention Bill, the Security guy?"
Chairman: "Yes."
Board Member: "Did somebody suggest the supply clerk?"
Chairman: "Yes."

There is one more snippet, weighted to be played with very low probability. I only happened to hear it once, when the game was left running for an hour. The developers had a little joke.


Board Member: "Maybe we could get Gil Amelio to be on the board."
Chairman: "I'd prefer an internal candidate."

Gil Amelio was the CEO of Apple at the time. Pajama Sam ran on both Windows and Macintosh, which was rather unusual for 1998. That was the deepest part of the "beleaguered Apple" period, where the death and dismemberment of the company was predicted daily.

This is funny for the parents, of course, because a corporate Board is supposed to consist mainly of outside directors to prevent excessive inward focus and make the company more Oh, nevermind.

Wednesday, January 6, 2010

Y2.01K

Crash the Y2K bug

Y2K was a big deal. A huge amount of money was spent updating older software which stored dates using only two digits. A common solution at the time was to treat dates of 00-09 as post-Y2K, and 10-99 as pre-Y2K. Effectively this only delayed the problem for ten years - our ten years ran out a few days ago. Some examples of failures experienced since Jan 1, 2010:

A huge amount of money and effort was expended in the 1990s to upgrade systems for Y2K. When Jan 1 rolled around and civilization did not end, there was much criticism that the whole thing had been hyped by vendors eager to sell new gear. Quite likely we overspent... but I believe the consequences of underspending would have been more expensive to clean up afterwards.

Fortunately, it appears that magic pixie dust is available to fix all Y2.01K problems, according to a press release from BogusTech. Obviously a spoof, its very funny and well worth reading.

Tuesday, January 5, 2010

A Big Day for Mobile Technology

Newton MessagePad 120

Today, January 5, 2010, will be a big day in the history of mobile technology. A huge day. Any tech news site worthy of your attention should devote many resources to the events of today.

I am, of course, referring to the impending Newtpocalypse.

The Apple Newton was a groundbreaking device. The picture accompanying this post is my much-beloved Newton MP120.

NewtonScript tracks time intervals using a 30 bit signed integer, with an epoch of 1993. 229 bits from 1993 is January 5, 2010, at 6:48:31 pm. Tonight. When the NetwonScript time overflows into bit 30 it becomes a negative number, and Bad Things Happen. Fixes have been developed, but only for the later model Newtons. My beloved MP120 will stop working tonight. Sniff. Of course, it hasn't been charged since 1999 so its effective behavior will be unchanged.

PS: in addition to being the Newtpocalypse, I think Google has some kind of announcement today relating to mobile tech.

Monday, January 4, 2010

Access Hatches

Underground labYes, the rumors are true. Google has constructed a series of secret underground labs connected by high pressure pipes, to synthesize and transport Google Juice around the planet. Google Juice is devilishly difficult to generate and must be infused into a website quickly before it begins to destabilize, though once absorbed by the server it is remarkably stable.


The apparatus which powers this system requires constant supervision and maintenance, and if you watch carefully you might spot the access hatches scattered here and there.

Google manhole cover

(Kidding. Really. Nothing to see, please move on.)

Monday, December 28, 2009

Crowdsourcing Backup

Jeff Atwood recently suffered a catastrophic loss of data of his long-running blog Coding Horror. The site was running on a virtual machine, and apparently VM backups at the hosting provider had been routinely failing for years without anybody noticing. Jeff maintained his own backups... within the VM itself, which were lost when the VM was lost. Jeff's story has a happy ending as one of his readers, Carmine Paolino, had a complete archive.


Obviously the happenstance of somebody on the Internet having a complete copy of data important to us does not constitute a practical backup strategy, but it got me to thinking about the idea of crowdsourcing backups. Everybody should have offsite backups, but practically nobody does it. Could a system be designed where each participant wanting to back up their most important data would in return offer a chunk of local disk space to use for storing data for other people?


With terabyte drives becoming common, it seems like many systems have an abundance of disk space which could be better taken advantage of. Perhaps the data you want to be backed up can be broken into chunks and stored in the free space of a number of other backup users, while your drive simultaneously stores their data.


  • Your data would have to be encrypted, as it will be stored on media controlled by random and potentially untrustworthy people.
  • A large amount of redundancy would have to be baked in, as people could drop out of the system at any time and take a chunk of stored information away. Many copies of each chunk would be stored in multiple places.
  • Forward Error Correction would also be good, to further improve survivability in the face of missing data. Recovering most of the chunks would be sufficient to reconstruct the rest.

The practicality of the details aside, with Amazon, RackSpace and others offering cloud storage options, would it even be worthwhile to construct such a crowdsourced system? In 2010, I'm not sure that it is. I suspect this is an idea whose time has come... and gone.

Wednesday, December 23, 2009

Satellites Should Respond to My Whims

There was a pretty spectacular accident in Jamaica last night, where a 737 skidded off the runway and broke into pieces. Check the picture in the linked story, I'll wait. Amazingly only two passengers were injured.


Surely I'm not the only person who immediately checked satellite imagery, on the off chance that maybe, just maybe the periodic flyover happened to be this morning. Alas, no.



View Larger Map

Monday, December 21, 2009

North Pole Compression Algorithm

Santa floppy disk ornament

Note the lack of the "HD" logo on the dust cover? Santa must have remarkable compression technology to fit the entire 1998 naughty/nice list on an 800k disk. The prevalence of popular baby names from year to year probably helps, there is a lot of duplication.

Wednesday, December 16, 2009

Slashdenfreude

Slashdenfreude [slash-den-froi-duh] (noun) : To take joy in the slashdotting of others.

Monday, December 14, 2009

A Coroutine, Thread, and Semaphore Walk into a Bar...

This article about multicore programming techniques is pure comedic gold.

In particular, threads suffer badly from 'race conditions'. The race of despised worker threads is made to do boring, low status, 'background' tasks. Meanwhile, the high privilege 'system' threads get to party with the hardware. It's the same the whole world over.

It is a great read with that peculiar British humor humour which The Register is so good at. It is also a good technical overview of techniques for taking advantage of multiple cores.

Thursday, December 10, 2009

Untouchable Code

Behold: the Blaupunkt CD50.

Perhaps "behold" is too pretentious for a basic car stereo, but it is the topic of today's screed so I feel a dramatic introduction is called for. Let me call your attention to four buttons on the left side: RDS, AM, FM, and CD-C. They do what you might expect:

  • RDS - enable decode of station and song identification from an FM signal. I'm not sure why you'd ever disable this.
  • FM - switch to FM radio.
  • AM - switch to AM radio.
  • CD-C - switch to CD Changer mode. Once in CD-C mode, the RDS/FM/AM buttons have no effect until you push CD-C to get back to Radio mode.

This makes perfect sense, right? I mean really, once I'm in the CD player mode I wouldn't expect the buttons from Radio mode to do anything, would I? Yes, this is sarcasm. On the web. Dangerous, I know.

I'd speculate that the fine engineers at Blaupunkt did not actually want the user interface to be this way, and that they would have preferred the FM button to always switch to FM radio. I suspect they were presented with an existing AM/FM radio design which, for whatever reason, they could not modify. Perhaps the CD50 project had a very tight budget, or a narrow market window which didn't allow time to tweak the radio components. Less charitably, perhaps the radio design had degenerated into an unmaintainable mess and any change risked breaking the whole thing. The path of least resistance to get the product out is a mux: you're either in our new mode where we add all the shiny new goodness, or the crufty old mode where we haven't touched anything from the existing design.

The situation of an unmaintainable portion of a system should be familiar to any software developer tasked with working on a large codebase. I suspect the natural entropic state of software is unmaintainability, requiring constant infusions of energy to stave it off a while longer.

So what can we do to ensure systems remain maintainable? Unit testing is frequently suggested as an answer, though I've never been a fan of extensive unit testing. If the target platform is very different from the build system, structuring the code to be able to run unit tests is a non-trivial amount of extra work. However I've recently started working in an environment where development testing is strongly encouraged, and I have to admit it does help in keeping code maintainable as developers come and go. The lowest level unit tests are not terribly useful in this regard; even code in a complete mess will have unit tests. On the other hand, a functional testbench for a module where the interfaces to the rest of the system are mocked out is very helpful. You have a much firmer grasp of how changes you make in the module are going to impact the rest of the system. You also have more hope of being able to reimplement the module, as its interfaces are described by the mock framework. If other portions of the system reach in to the internals of the module without using the interfaces... then the cancer has already metastasized and you're probably doomed.

People say that refactoring early and often will keep code maintainable, but that requires agreement from management to spend development time paying off technical debt without an increase in marketable features. In a product environment I rarely win that argument. However, I've now worked on a complete re-implementation of two different systems where the bug load had simply become impossible due to indecipherable engineering. I suppose that is an extreme form of refactoring: extract the best bits of the old system, and throw out the rest.

Do you have tips for keeping code maintainable across multiple generations of products? This site uses Disqus for comments. You can comment anonymously if you wish, or use an existing identity like Twitter, Facebook, or any OpenID provider.