Improving on “Righty-Tighty”

Most mechanically-inclined people are familiar with Righty Tighty and his sister, Lefty Loosey (Lucy?). The idea is that to tighten a fastener, you turn it clockwise (moving the top of the fastener to the right relative to its center), and to loosen it you turn it counterclockwise (moving the top of the fastener to the left). 

This works great for standard situations, where you’re facing the fastener and “loosening” the fastener results in it moving toward you. However if you’re trying to loosen a nut on a bolt that’s at any other angle relative to you, the mnemonic won’t help, and could very well end with a shorn-off fastener. God help you if you’re trying to loosen a pipe union. 

My solution to this (mine only in the sense that I arrived at it independently) is both completely obvious and yet unheard of by most people. Engineers refer to the standard way in which fasteners are threaded as “right-handed.” Only a few items on Earth (for instance the left pedal on most bicycles and the left axle nut on some cars) use the other orientation (called, you guessed it, “left-handed threads”). It turns out this nomenclature has some basis in the real world.

The Right-Hand Rule

The Right-Hand Rule

Sophomore physics students are familiar with illustration above from the right-hand grip rule in electromagnetics: if your right hand is grabbing a conductor such that the current flows in the direction your thumb is pointing, your fingers point in the direction of the circular magnetic field around the conductor. 

Well right-handed threads obey a similar rule: a fastener turned in the direction that your closed right hand’s fingers curl will move in the direction that your extended thumb is pointing.

So if you’re trying to remove that stubborn oil filter from the other side of the engine block, just point your right thumb in the direction that you want it to move (presumably away from the engine block) and turn in the direction your fingers are pointing. 

Just remember when to use your left hand changing the pedals on your bike.

My Favorite Election Website

I’m not sure how well known this site is, but it’s a great tool for understanding the politics of federal elections in the US. The site is http://www.electoral-vote.com/. If you’re not familiar with it, check it out.

Why the Gas-Tax Holiday Won’t Work

Senators McCain and Clinton have proposed a “gas-tax holiday” this summer, which would eliminate the 18.4-cent-per-gallon federal tax on gasoline between Memorial Day and Labor Day.

If you squint and ignore the $10 billion hole it leaves in the federal highway budget (which McCain would fill by borrowing from taxpayers, and Clinton would take out of oil companies’ profits), at first this seems like a good idea: a gallon of gas would be about 18 cents cheaper, saving each hardworking American family a good $50 over the course of the summer.

Unfortunately, that’s not how these things work. Our hypothetical American family is never going to see those fifty dollars. Who will get them? Well let’s just say they aren’t exactly hurting for cash at the moment.

Imagine you’re an oil company. People are buying the stuff as fast as you can pump it out of the ground, at prices that are three times what they were a few years ago. And if Americans won’t buy at those prices, China and India are happy to.

Maybe you’re even a Big Oil company, like Exxon or Chevron, but that means you still only produce a few percent of the world’s oil. So you don’t have the clout to set the price of oil, although you can certainly benefit when it’s high. In any case you can’t immediately pump your product out of the ground any faster no matter how much people are willing to pay.

Now let’s say there’s a gas-tax holiday coming up, and gas is four bucks a gallon. If before Memorial day you charged $3.82 a gallon (for a pump price of $4.00 a gallon) and people still bought all the gas you could produce, how much do you suppose you can charge now the government isn’t taking an 18¢ cut? (Hint: $4.00)

If you think about it for more than two seconds, you’ll see that the holiday price is going to instantly rise to the pre-holiday level. And where will the difference go? Right into the pocketbooks of Big Oil. The Law of Unintended Consequences strikes again!

The end effect of McCain’s plan is to siphon money out of the federal government’s general revenue and hand it to Big Oil (meaning that sooner or later, taxpayers will have to pay for this subsidy).

The best thing we can say about Clinton’s plan is that it does nothing: her “Windfall Tax” on Big Oil would probably roughly make up for the extra money they would get during the tax holiday. But there are better ways to do nothing than to run around in a circle.

Of the major presidential candidates, only Obama has refused to pander to the American people by going along with this counterproductive proposal. Let’s hope Americans are smart enough to see why.

Things I Hate, Part II: Web Forms that Auto-Tab

There seem to be quite a few web designers with too much time on their hands out there, with just enough knowledge of JavaScript to be dangerous. 

What else can explain the fascination with taking what could be a simple text field (for entering a phone number, IP address, or SSN, for instance) and instead making it three or four separate text fields plus a half-baked script to “conveniently” yank the cursor into the next field when the current one is full? This violates at least three common-sense principles of user interface design.

The first violation is of the KISS principle. There is no reason why a phone number can’t be one field that accepts 5558675309, (555) 867-5309, or +1-555-867-5309 and figures out with a regular expression or two that the area code is 555, the prefix 867, and the number 5309. 

Secondly, it violates the principle of least surprise. Other fields in web forms don’t do this: I don’t finish typing “Frank” in the First Name field only to have the cursor magically jump into the Last Name field. Because, of course, my name might be Franklin (it’s not — in Germany “Frank” is a bona fide first name and that’s what my birth certificate says) and if the web form knew my name it wouldn’t be asking for it. But while it’s possible to do this for certain classes of text fields it’s a Bad Idea, because it’s never the expected behavior. 

Finally, it’s fundamentally broken. At least, every implementation of this “feature” that I’ve ever dealt with has been broken. When I screw up and type my area code as “666”, I want to be able to hit the delete key and correct it. Failing that, I at least want to be able to shift-tab back to the screwed-up field and correct it without having the cursor jump right back to the next field. I also want to be able to type 5 5 5 tab 8 6 7 without the “867” appearing in the number field, leaving the prefix blank.

It may in fact be impossible to implement this in JavaScript in a cross-platform way that doesn’t confuse grandmas and confound compulsive keyboard users like myself. Which doesn’t mean you should take a stab at it and make something that kinda works most of the time. It means you should back off, take a deep breath, and take a different approach. 

iPhone Simulator as Try-Before-You-Buy

Apple released the beta version of their iPhone SDK yesterday, and the response from the developer community was an unintentional DDoS of the entire developer.apple.com domain. But there are a few caveats to the otherwise Christmas-morning-like announcement.

Among them is that to get an app into the hands of users, a developer must sign up for a $99 app-signing license, and then sell the app through Apple’s iTunes-esque store, with Apple taking a 30% cut. This is really convenient (if a bit expensive) for the developers, but runs up against the established business model of the vast majority of indie Mac OS X developers: try-before-you-buy shareware. In this model, the software is distributed free-of-charge, often with limitations or nagging that can be turned off (or extra features that can be turned on) only by entering a license code purchased from the developer. It’s not completely clear how this would work under Apple’s model.

But another thing Apple released yesterday was a Mac-OS-based iPhone simulator. Right now it’s Mac-only, and it may or may not be a major PITA for Apple to port this functionality to run under Windows, but it represents an ideal solution to most instances of the try-before-you-buy conundrum: Apple would merely need to allow developers to link their app against the simulator and to distribute the resulting bundle as a trial version of their app. If by playing around with it on your (non- or less-mobile) desktop or laptop you decide that you like it, you would pay to download it from Apple’s store.

Now it’s true that a linked-against-the-simulator app could lead to piracy, but realistically the App Store will do little more than to keep honest people honest; dishonest people will most likely just copy the app from a hacked iPhone. It’s also true that people might use the simulator-widgets on their computer in lieu of paying to use it on their iPhone. But typically anything that can be done on an iPhone can be done better on a PC, albeit in a less pocket-sized fashion.

So I believe that represents another category of people who wouldn’t have purchased the app anyway.

Fixing Leopard Dictionary Hang

Dictionary.app in Mac OS 10.5 (Leopard) reliably hangs when first launched. Even with a very high-bandwidth and low-latency connection to the Internet.

Apparently this is due to the new Wikipedia functionality built into it. Until Apple fixes this, the easiest way to put teh snappy back into your Dictionary is to open the preferences and uncheck Wikipedia as a source.

Easier “Sub-Account” for GMail

In anticipation of getting an iPhone for Christmas, I moved my personal email account from my hosting company to GMail, using Google Apps for my domain. GMail gives me IMAP, first-rate spam filtering, and more storage than I can shake a stick at. I couldn’t be happier with my arrangement, in particular how well it works with my iPhone.

However, there is a project I’m involved with that would benefit from subscribing to a couple of high-traffic mailing lists. While I’d like to be able to peruse and participate in these lists, I don’t want them clogging up my iPhone’s inbox.

It turns out this is pretty easy to accomplish. First, sign into the web interface for your GMail and add a label (click “Edit Labels” in the left sidebar) for the mailing list. Since I followed the advice on the GMail link above and added the [Gmail] IMAP prefix to the account in Mail.app, I will also need to prefix the friendly name of my label with [Gmail]/ (e.g. [Gmail]/List). On my Mac this will show up as an additional IMAP folder at the bottom of the sidebar.

Now you just have to create a filter (click the “Filters” tab under your GMail settings) that will automatically apply the label if the email in question is involved in the mailing list. Choose the appropriate criteria (the “Has the words” setting might be best, since often times “to” address isn’t what you’d expect). After clicking “Next Step” to continue, select the label, and — to keep it from showing up in your inbox — check the “Skip the Inbox” setting as well.

I can now receive email from the mailing list and it goes directly to my archive folder, receives the proper label, does not pass go, and does not collect $200.

One last thing: to get the label/folder to show up, I had to right-click the account in Mail.app and select Synchronize. YMMV.

These steps will let you follow one or more high-traffic mailing lists without them interrupting you every time a message is sent, but also without the latency of receiving digests instead of individual messages. It turns the mailing list “workflow”, if you will, into something closer to that of an RSS feed.

Creating a “Sub Account” with GMail and Mail.app

Update: Here’s an easier way.

In anticipation of getting an iPhone for Christmas, I moved my personal email account from my hosting company to GMail, using Google Apps for my domain. GMail gives me IMAP, first-rate spam filtering, and more storage than I can shake a stick at. I couldn’t be happier with my arrangement, in particular how well it works with my iPhone.

However, there is a project I’m involved with that would benefit from subscribing to a couple of high-traffic mailing lists. While I’d like to be able to peruse and participate in these lists, I don’t want them clogging up my iPhone’s inbox.

By combining a few esoteric features of GMail and Mail.app, I have come up with an arrangement that works superbly.

(more…)

These Folks Don’t Mince Words

In some industries, it’s best to be less than completely forthright about what your product does:

dog-shit-bag.jpg

My guess is some poor sap with a Chinese-English dictionary printed up a few tens of thousands of these, only to have mainstream pet retailers reject them. The ended up at a dollar store in Calgary.

I Wish this had been Written in 1999

…and that my former boss had read it:

Computers make copy-and-paste really easy, so every programmer falls into the trap once in a while. The lesson you eventually learn is that code always changes, always always always, and as soon as you have to change the same thing in N places, where N is more than 1, you’ll have earned your scar.