Five Essential Firefox Plugins

Even before I converted my laptop to Linux, I had been running Firefox as my browser everywhere. It’s a good browser, made even better by plugins that can do all sorts of neat things. In some cases equivalent functionality can be achieved using other browsers and/or external proxies, but in other cases it’s hard to see how you could get the same functionality other than as a plugin. Here are the five plugins that I find most useful, in the order that I installed them.

Honeybee Killer Found

This is great news.

UCSF scientists have identified two likely suspects in the massive die-off of half a million bee colonies in the US. Joe DeRisi, PhD, and Don Ganem, MD, both Howard Hughes Medical Institute investigators at UCSF, have used a powerful combination of a “virus chip” — a microarray with DNA samples of most known viruses and fungi — and “shotgun” sequencing, which identifies telltale DNA from random samples of the biological sample.

The parasite is called Nosema ceranae, a so-called microsporidian fungus — a small, single-celled parasite that mainly has been associated with affecting Asian bees, and is thought to have jumped to the Western honeybee in the last few years. The shotgun approach succeeded in this search, as the microarry does not include this species’ DNA.

The lab’s search for culprits using the microarray, however, also netted a second potential killer, a virus from the genus Iflavirus, which has been implicated in a number of problems in the bee industry.

Colony Collapse Disorder has been not only a big mystery but a big threat to our entire food supply, and finding a likely culprit is a very important step to removing that threat. Great work, guys!

Amy Stuff

Yeah, it has been pretty quiet on the Amy front. In response to several requests, there are some pictures of Amy (and other things) below the fold . . . but first, a bonus Amy story. The other morning I was giving Amy her breakfast, including the last piece of a pear. I noticed her very carefully placing two crumbs from her previously-eaten cinnamon toast on the pear, so I asked what she was doing.

Putting eyes on the hippo . . . so he can blink.

Well, that’s certainly creative. :) Enjoy the pictures.

Unsafe Pointers

Every programmer worthy of the name knows that it’s better to avoid bugs than to fix them. Whole libraries are filled with suggestions about how to facilitate this, but the particular angle that interests me the most is how we can use computers themselves to help us write better code. A lot of bugs are the result of violating some kind of rule, such as the rule that says not to dereference a pointer that might be null, and computers are really good at dealing with rules. From this observation came the field of static program analysis, which checks code before it’s even compiled to make sure that it conforms to rules the programmer has defined. Engler et al referred to this as Meta-Level Compilation (the “meta” refers to “metadata” about the state of variables or of the program itself) and showed that it could be applied to real-life code without tedious manual code annotation, before they went off to start Coverity. Cqual is another tool based on a similar idea of type annotations. These annotations allow you to distinguish the “tainted” character buffer that contains user data from the “safe” character buffer that contains an SQL command (note that they might be exactly the same bits in either kind of buffer) and flag inappropriate use of one where the other is expected.

I used Coverity’s product at Revivio, and found it extremely useful. Such tools are not without their drawbacks, however. Most significant is the fact that they run separately from the compiler you actually use to generate code, often using their own separate parser to do their stuff. This costs time, makes build processes more complex, and potentially creates problems with incompatibility between their parser and yours. What I would often prefer is some tool or technique that allows me to use my existing compiler, with the help of some macros, to catch a (necessarily more limited) set of rules violations without all that overhead. The other night I thought of one such technique, to solve what I often use as a “test case” for my thinking about all forms of automated bug-finding. Much of my work has to do with concurrency, and one of the rules I’d often like to apply is one that says a certain structure member shouldn’t be accessed without holding a certain lock on that structure. To do this, one must track three types of “events” that might occur within a program. For simplicity, let’s assume the structure type is X and is always allocated dynamically. The three events are:

  • Obtaining/assigning an X pointer.
  • Locking/unlocking an X.
  • Dereferencing an X pointer.

The last one is the trickiest. In C++ you can do some interesting things by overloading the arrow operator for X, but what about C? You can require that all access to X’s members be through macros or functions that check lock state, but that has several drawbacks of its own – it makes the code much uglier, adherence to the coding standard must be checked by humans, and there might be a performance penalty. Read on for a technique that I think achieves much of the same value while avoiding the drawback.

Flaky Fawn

Ubuntu 7.04, code-named Feisty Fawn, was released yesterday. I had heard all sorts of good things about it, so I decided to give it a try and see if it resolves some of the issues I’ve had to deal with on my laptop. I don’t really feel like I need the upgrade, because I think I have a pretty functional system right now, but I was curious to see whether they had made the road less rocky for other people with the same extremely-common hardware. The answer is no. This time it didn’t even manage to initialize my video card in lame-o “vesa” mode, which the previous version had been able to do. It did manage to detect my wireless card, but not to initialize it. The failure mode is revealing: it recognized the card, knew that it needed to download firmware to it from a specific location, but the distribution did not include any file at that location. Perhaps the file doesn’t exist because of some license issue or philosophical objection to including proprietary binaries in the distribution, but I don’t care. If that’s the case, then the appropriate response would be a message explaining – in user terms, not developer/code terms – why the device could not be initialized. A link to resources that the user could use to resolve the problem himself would be even better. “File not found” is not an adequate response, especially when the significance of the file is less than obvious from its name.

My other gripe has to do with the use of the PC speaker. Why does every LiveCD or new install have to start up with the system beep enabled at full volume, with no obvious way to disable it or even turn it down? It’s annoying and inconsiderate to assault the user with such a loud blast every time they (for example) type [tab] for filename completion and no match is found. I’m sure the developers themselves do that all the time, I’m also pretty sure none of them have their system beep enabled at full volume, so why do they subject users to it? The only answer that comes to mind is that it’s because they’re not thinking about the user.

Marathon Man

About three and a half years ago, I bought a stairclimber and started using it regularly. My primary goal has always been aerobic fitness, though at the time I started I was also at the beginning of what would eventually be an approximately 30-pound weight loss. Since then I have done 342 workouts, through travel and sickness and Amy being born and even having to the replace the machine because it broke. About the third month or so of this, I developed the idea of doing the equivalent of a marathon – i.e. the same number of calories as would be expended by someone of my weight running 26.2 flat miles. To that end, I’ve done four half-marathon equivalents, working my way down from 108 minutes the first time (all numbers include breaks) to 79 for the most recent. I’ve never felt quite up to doing the whole thing, though . . . until now.

Two hours, forty-three minutes

Yes, that was my time for what I believe to be the caloric equivalent of a marathon today. Yes, I know the Boston marathon is tomorrow, but I decided this morning that I’d try it today if I felt good because I can’t be sure I’d feel as good tomorrow. Besides, I usually do well when I work out two days in a row, and I had just reached a new personal best during what was supposed to be training yesterday, so when early afternoon rolled around and I felt pretty good I decided to go for it. I did it in five sections of 31 minutes each, minus the last minute, with short breaks in between, at about 80% of my usual maximum rate. This was pretty much in accord with my original plan except that I had expected to stay closer to 75% and take longer breaks; the original plan was to squeak in just under three hours. The results were also pretty much what I anticipated, and what many sources have said to expect: double the distance, take 10% of the speed. This was my fifth-best workout according to my own scoring system, which is based on a similar formula but (intentionally) gives slightly more credit for longer workouts, further showing the accuracy of conventional wisdom.

If my translation between stairclimbing and running were totally accurate, this result would have put me just barely out of the top 25 for the Men’s Masters division of the 2006 Boston Marathon. Frankly, I know that’s not very realistic, but I don’t know how to do any better. I’ve tried finding information on how to correlate between the two forms of exercise, and mostly come up empty. I also don’t really know how accurate my machine’s calorie counting is, though I do know it undercounts steps by ~40% and even after that’s accounted for (which I did in determining my “finish line”) it counts about 30% fewer calories than the brand-name StairMaster machines I used to use at various health clubs. What I do know, from having counted the steps at various intensity levels myself, is that I climbed about 12K vertical feet. If anyone knows a scientifically based translation from that to running distance, let me know. I don’t pretend that I could actually run a marathon, but on the other hand I’m pretty skeptical that most marathoners – even good ones – could do what I just did either. They’re different kinds of exercise, suitable for different people. I’m a lousy runner, and probably always will be. I picked stairclimbing over running (or cycling, or swimming) as the focus of my exercise program for a reason, just as most runners probably made the opposite choice for a reason too. I’m sure many of them are lousy climbers, no matter how fast they are on a flat surface. (Yes, I know roads in general and the Boston Marathon route in particular are far from flat, but they’re even further from the kind of slope my climber simulates.)

All that said, I’ll reiterate that I don’t believe I’m in as good shape as a top-25 marathoner in my age group. Besides, I did cheat a little. I generally try to avoid putting my hands on the support bars like those health-club dandies who do 140 steps/minute because they’re taking three-inch steps with half their weight on their wrists. That’s not really doing them much good, and I’ve seen even less extreme offenders get in trouble when they take their act on a real hiking trail and twist an ankle or a knee because their strengthened big muscles allow them to go faster than their atrophied small ones (needed for balance and recovery) can keep them safe. I’m a big believer in stairclimbing without using the hands for support, but I do generally allow myself to put hands on for up to one sixth of a workout and this was no exception. That’s a luxury I wouldn’t have when climbing or running in the real world, and having to give up that relative rest would probably cost me 5-10% of my performance. I still think I’d be able to finish, though, and even at a 10% penalty I’d still be under three hours. With a reasonable amount of cross-training I think I could even get under the age-group qualifying time for the real Boston Marathon (3:45) but the effort:reward ratio for that is just too high to bother. “Real” marathoners might tell themselves that I’m just kidding myself until I’ve actually done what they do, but I think they’d be kidding themselves to think they can do what I do too, and anybody who has never done either just doesn’t get a say. No matter how you slice it, though, being able to exert yourself that hard for that long takes a lot of determination, and the training to get there even more. I won’t be looking down my nose at anyone running tomorrow, but now I feel like I can look such a person in the eye and say I understand what it takes.

Bad Names

Would you give a food product a name that’s phonetically identical to a nutritional disease? I wouldn’t. It is pretty yummy, though.

Sun’s New Product

We don’t know what it is yet, but we know it’s coming because the Sun bloggers have started “spontaneously” posting their “personal” thoughts about issues related to it. Bonwick makes a lot of good points, for example about “roll your own” OSes, but he also misses on a few. For example:

A single Opteron core can XOR data at about 6 GB/sec.

…if it’s doing nothing else, and if it has a memory system to support it. Is that really a good tradeoff? Many systems, even those sold as appliances, are already running at near computational capacity and can ill afford to throw any cycles at something that can reasonably be done off-CPU. At the same time, really fast general-purpose memory systems (especially coherent ones) are expensive – perhaps more so than a little dab of silicon and a few signal lines to serve a particular limited but performance-critical purpose in a system. CPUs have advanced a lot, but so has the ability to develop and integrate special-purpose hardware into a system. I’ve learned a bit about that lately. ;) This battle between general- and special-purpose has been going on for a long time, and will continue to do so. Lots of people want to believe they’re part of a transition from one era to another, I guess it makes them feel important, but most of them are just fooling themselves.

In the time that Fibre Channel went from 1Gb to 4Gb — a factor of 4 — Ethernet went from 10Mb to 10Gb — a factor of 1000.

That’s not really an accurate picture. Right now the comparison is still 2Gb/s Fibre Channel to 1Gb/s Ethernet in most of the market, and 4Gb/s FC is more “real” in that market than 10GigE. Like everyone who has worked with it for any length of time I’ve learned to dislike FC for many reasons, but the raw bit rate is not the problem. Just about nothing can pump that much data through a single channel anyway, nor should it need to try when multiple channels are available. As in long-haul networking (e.g. DWDM), the higher bit rates are mainly useful for aggregating smaller flows within the core, and there are other ways to deal with that issue within the relatively small distances of a data center. There’s often a tradeoff between “faster but fewer” and “more but slower” with the former relying more on bleeding-edge hardware and the latter relying more on software smarts. If the efficacy of using general-purpose cycles for everything is one of your assumptions, it’s a little odd for “faster but fewer” to be another. Saying that the real distinction is commodity vs. custom doesn’t explain it either, because FC and (10)GigE are both commodities and standards. The real preference here seems to be for what Sun’s doing over what they’re not, and it’s a preference with little bearing on anyone not standing on the Titanic’s observation deck.

And if you think Thumper was disruptive, well… stay tuned.

Oh, I will, but I don’t expect the disruption to come from Sun. I’m a lot more interested in what’s going on with GPUs being adapted for general use, or Cell, or reconfigurable computing, or other things that offer a “serial repurposing” option in addition to the cast-in-silicon general vs. special purpose options mentioned earlier. I’m interested in different memory models that allow more efficient (or cost-efficient) implementation, system architectures that represent a different resource balance than the same old ho-hum, and so on. I’m sure Bonwick has a reason for being where he is, but I have a reason for being where I am too and the same could be said for thousands of others at companies much nimbler than Sun. We’ll just have to wait and see if “disruptive” is more than a marketing term at Sun.

Advice for the Asinine

If you’re walking around in a Boston Marathon parka, you probably shouldn’t be parking in a handicap spot. It might annoy someone enough to do something about it.