Why airplanes don’t fly in straight lines…

…and other information about airplane engine failures.

I’ve sometimes wondered why airplanes don’t seem to fly in straight lines. I once saw someone give a seemingly-simple explanation: the Earth is round. While that fact is true, it doesn’t really explain it. When I flew from New York to Hong Kong, “curvature of the Earth” doesn’t explain why we practically flew through the arctic circle. It was certainly not the most efficient path.

I suspect there are many components to the answer, and perhaps the earth’s curvature factors in a bit. I also suspect that weather and wind factor in. But there’s one big, glaring reason that I’ve found: a twin-engine airplane must, at all times, be able to reach an airport on a single engine within a certain period of time. Early on, the limit was 60 minutes, though that figure has gone up over time.

The idea was simple—with only two engines, if one fails, you want to be able to land pretty quickly. So the FAA set a limit of 60 minutes. This surely had all sorts of positive safety implications, but it was also inconvenient, and led to some circuitous routes, plus some areas just not being possible to reach in a twin-engine plane. Over time, apparently, evidence allowed these rules to be relaxed. For one, it turns out that a plane is capable of flying just fine on a single engine.

For example, here is a rather chilling video of an airplane (a Boeing 757) ingesting a bird into one of its engines during takeoff, causing the engine to spew flames until it is shut down:

It continues its takeoff normally, declares an emergency, and lands normally a few minutes later. If you ignore the flames during takeoff and the inspection by the fire department upon landing, it looks entirely normal. Also fascinating to me is how the pilot seems entirely calm during the whole situation, and how half of the radio traffic is just about how they’ll be able to exit the runway normally so other flights shouldn’t need to divert, and how they plan to taxi back.

While a video of an airplane engine spewing fire might not inspire a lot of confidence, what’s intriguing to me is that the plane flew just fine with only one engine operating. It didn’t begin flying sideways or have difficulty landing as I might have naively expected. Hence the initial justification of the 60-minute rule—if an engine failed mid-flight, pilots would be able to safely fly to the nearest airport with only one engine.

Over time, apparently, evidence showed that spontaneous failure of an engine mid-flight was extremely uncommon, and that the 60-minute limit was excessively conservative and made many flights impractical. Over time, allowances of up to four hours have been granted, and newer planes are being certified for times in excess of five hours. But many older planes are still limited by shorter times, hence the seemingly-odd routes they take—they need to stay within range of airports.

I Use This: iTerm

I ran into some trouble with the Mac’s Terminal not supporting vim colors properly. It turns out that Terminal doesn’t have very good support for some things. Someone recommended I try iTerm, so I did. I wish I’d done it sooner. And it implements the feature I’ve craved for the longest time: blurring the background if you have a translucent terminal window:

There’s a little weirdness in that it doesn’t seem to update quite as fast as Terminal did, and that triple-clicking selects the line shown, not the whole line if it wraps. For the most part they’re petty differences. Overall, though, Terminal’s a thing of the past, and iTerm’s here to stay.

Update: I’d noticed that iTerm hadn’t been updated in a long time. Thanks to George for commenting below that he’s picked up development and rechristened the project iTerm 2. Even better!

Cool MySQL Projects

I think part of the thing I love about MySQL is the same thing I love about Firefox and Thunderbird. Even though I sometimes wonder if there are databases that would work better than MySQL or have fewer bugs, MySQL has an incredibly rich community that’s home to myriad fascinating projects.

I’ve looked into MySQL Proxy at work a bit, and found it pretty interesting, but it’s still considered alpha-level code, and we don’t really need a proxy in front of our database right now.

I’m not even going to pretend that the links that follow are all things I’ve just found on my own. They’re inspired from this Xapbr post, with Xapbr being a blog run by one of the top guys at Percona, and Percona being a well-known MySQL consulting firm, perhaps best known for the O’Reilly High Performance MySQL book. (A must-read even for people who aren’t full-time DBAs!)

It turns out that MySQL Proxy has a competitor, Dormando’s Proxy for MySQL, better known as dpm. It’s a BSD-licensed proxy created by SixApart’s DBA. (SixApart used to own LiveJournal, which is well-known for releasing memcached to the community.) Given that I’ve worked with neither dpm nor MySQL Proxy, I’m not able to comment on the merits of either, but it’s a handy link to have.

I’m also interested in the Tungsten Replicator, an Open Source project providing (emphasis mine) “database-neutral master/slave replication,” which was interesting enough to keep me reading past the words “JDK” and “Ant,” which are technical terms meaning “bloat” and “memory leaks.” (I kid… Sort of.) It looks like the project is mostly MySQL-centric right now, but capable of replicating MySQL databases into Oracle. (But apparently not the other way, probably since Oracle binlogs aren’t as publicly-documented as MySQL’s.)

And then there’s WaffleGrid, a project using memcache as an L2 cache. That is, MySQL will first look in its own caches, but in the event of a cache miss, will check memcache before turning to disk. It looks like it gives stellar results, even though it’s one of those things that seems kind of wrong. (You’d think that, if you’re adding memory to better cache your database, you’d want to put it in the MySQL machine, and if you needed to scale to a cluster of memcache boxes, you might be better off spreading the load around several MySQL boxes… But at the same time, clustering isn’t something MySQL excels at right now.)

Drizzle is “a lightweight SQL database for [the] cloud and web,” which is forked from MySQL 6. (And for those of you scratching your heads: yes, I said version 6. Yes, 5.1 is the latest release branch.) There are some big names working on Drizzle, and besides “the cloud,” they talk a lot about “massive concurrency,” which is something that should be of interest even to people running more traditional databases.

And, of course, there’s Percona’s XtraDB engine for MySQL, a significant overhaul to InnoDB. It seems a bit of a young technology for production environments, and yet it seems like it’s production environments where it would have the best impact.

This is only tangentially related to MySQL, but I’ve seen Sphinx mentioned in at least three distinct places today, a SQL-based fulltext search index. I’d be curious in seeing how it compares with Lucene.

Big Antennas

I’m on a local ham radio mailing list. (Though I’m actually not sure how this came to be.)

So a few neat links. The first is a yagi for 160 meters. Antenna size is inversely proportional to frequency, and 160 meters is the lowest ham radio frequency out there. The notion of a 160 meter yagi is almost obscene. You can just barely make out that there are two people working in the antenna.

There are also photos as a neat site called Artificial Owl of the former Russian Woodpecker, a Cold War-era “over-the-horizon radar” meant at detecting incoming missiles. It’s rumored to have transmitted as much as 10 million Watts (ERP), spewing interference all over the HF/shortwave bands the world over.

Daily Dose of Politics

Wow, a lot’s happened in the past 24 hours.

Vladimir Putin (President of Russia, not Germany) has accused the US of starting the war in Georgia, to benefit “a political candidate.” For once, I’m going to have to give the White House the benefit of the doubt on this: as crazy as George Bush is with starting wars, Vladimir Putin seems even more out of his mind these days. It seems as if Russia started the war with Georgia, not that the US got Georgia to start a war with Russia. (And besides, if it were done to “benefit a presidential candidate,” it seems to have backfired, as most of the US realized it wasn’t the US state of Georgia and immediately dismissed the news.)

Obama gave his acceptance speech last night. I haven’t watched it in full yet, but the consensus seems to be that it was a good speech, but that the rest of the event was a snooze. Many have reported that the convention turned Denver into a police state, apparently resulting in an ABC news anchor being arrested for… filming a news broadcast in public? Obama had an insanely huge crowd at Invesco.

The news of today, though, is that McCain has picked Sarah Palin, the current Arkansas Governor, as his running mate. As I referenced in my previous post, I don’t know her full background yet, but she strikes me as a good complement to McCain: she’s young (you might even call her good-looking), has a track record of exposing corruption in the Republican party. She’s married to an Eskimo, making her pick doubly not a “white boys club” pick. Her eldest son enlisted in the Marines last year at age 18, and her youngest son has Down Syndrome. (From Wikipedia: “Palin refused to let the results of prenatal genetic testing change her decision to have the baby. ‘I’m looking at him right now, and I see perfection,’ Palin said.”) She’s aggressive on fighting wasteful spending (my friend Chris says she’s the one that canned the Alaskan “Bridge to Nowhere“), but isn’t the sort of insane, “No taxes at all, close down everything” person that makes fiscal conservatism look bad. She’s opposed GOP porkbarrel spending, and pushed for ethics reform. Her most recent approval rating as Governor was 80%, which seems awfully high for any politician. She opposes gay marriage, and yet says she has homosexual friends and strongly opposes discrimination; her first veto killed a bill that would have banned the Alaskan government from providing benefits to same-sex partners of government employees.

I still want to look more into her stance on energy, as the Wikipedia page makes it sound like she’s gone out of her way to not become a Big Oil Crony, but I don’t see a lot about alternative energy; given her proximity to ANWR in particular, I’d like to know more.

But I still think the, “Oh crap” I got from a fellow Dem in a text message is exactly the right reply. I wasn’t enthused about Biden. He’s a good guy, with a good track record, but that’s about all I have to say about him. Not bad, but there’s nothing exciting. (I’ll call him “plain,” if only because I keep typo-ing “Palin” as “Plain,” which I think might better describe Biden than Palin.

Of course, we’re electing a President, not a VP, and I’m only growing more confident that Obama’s the best pick. I’m not even sure that running mates are normally that big a deal. But if I were an undecided voter? Palin, I think, is a superb answer to Obama. He’s new, he’s young, he’s bringing fresh change and excitement and a promise of a “clean” (as in, “Not insanely corrupt”) government. I don’t see any of that in McCain. Palin almost brings a lot of Obama’s qualities, but packaged as a Republican.

Where I think this might make a huge difference is over the sizeable number of people in the center. They might be truly independent, or they might even be center-left Republicans. They’d fed up with George Bush and status quo. They think Obama can change that, but they don’t want to vote Democrat, or they’re scared about what they’ve been told (mostly lies, but I digress) about how Obama’s going to raise taxes, and so forth. McCain claims to be a maverick, but tends to vote in step with Bush. (And enjoyed a birthday party on the airport tarmac with him in the wake of Katrina.) They see a lot of hope and possibility in Obama, but still aren’t keen on voting blue. Palin, I think, can bring a lot of what those people like about Obama into a Republican. And with the two candidates neck-and-neck, it might be enough to let McCain pull ahead.

And then there’s the Hillary-for-McCain people. I really don’t believe that the “Hillary Supporters for McCain” camp is half as big as they make it out to be. And I do not mean to suggest that the average Hillary supporter was a crazy feminist who only supported her because of gender, though that’s kind of how these people are coming across today. But I’m quite sure that McCain’s campaign had these people (what’s the acronym they use again?) on their mind (at the very least, on the back burner) when picking Palin. Not only is she a woman, but she’s going to give them good justification: McCain and Hillary may be diametrically opposed on everything, but Hillary and Palin, while still taking opposite sides on most issues, are at least a little closer on the issues.

So I don’t know enough about Palin yet, but I have to admit that I’m kind of impressed with the little bit I’ve seen. As a Democrat, I’m kind of scared. But as an American, I’m kind of pleased: even if it’s McCain-Palin who take office in 2009, I think 2009-2012 might be better than 2000-2009. But do remember that we’re electing a President, not a VP: while Palin counters a lot of what gives me pause about McCain, I’d still take Obama over McCain.

Georgia

This is getting way too confusing. All along, someone said “Georgia” and I thought of the southern state. And then there was a war in Georgia with Russia, and I was just geographically-astute enough to know that they meant the country.

So that raged on for a while, and now, whenever I hear about something happening in Georgia, I think of the country.

So now, people in Georgia claim to have found Bigfoot. And I was thinking, their country is kind of insane-sounding. Like, one day most people have never heard of them. And then one day President Bush visits and someone hurls a grenade at him. But it’s apparently a dud, and no one notices until afterwards anyway… (Talk about failing at terrorism.) And then we all forget about the country again. And then Russia invades them, confusing everyone who both assumed that the news was talking about the US state, and that Russia was a nice country that wouldn’t go starting wars. And then their war ends. And then like the next day they find Bigfoot.

But it seems that it’s actually our Georgia that found Bigfoot.

*proud to be an American*

Nas’ Black President

Rapper Nas has a new song, Black President [obscene lyrics, NSFW]. I don’t give it high marks musically, but it’s interesting to me for two reasons. The first is that rap music actually addressing contemporary issues is rare. (Though it’s not entirely unheard of: Changes, for example.) The seconds is that the song is about Obama.

As I said, don’t set your standards too high if you listen to it, and don’t even waste your time watching the video, which seems to just be a montage of images of Nas. Do take care to read the lyrics carefully: a lot of people seem to miss the leading “They said…” and interpret the song as being against Obama. And the “Although it seems heaven-sent, we ain’t ready to see a black President” is actually from Tupac’s Changes, not an assertion that Nas is making.

What troubles me about the song:

Whats the black pres thinking on election night,
Is it how can i protect my life? Protect my wife? Protect my rights?

KKK is like what the f—, loading they guns up, loading up mine too,
Ready to ride ’cause I’m riding with my crew, he dies we die too

I read an article a while ago, citing absolutely no evidence, saying that there’s a persistent belief among African-Americans that Obama would be assassinated if elected. Hillary played into it, too, if inadvertently, both when some speaker in NH at a campaign event made a comment to the effect of, “Some have compared Obama to JFK, but let’s not forget what happened to him” (which Hillary denounced), but also when she said the same thing about Bobby Kennedy to explain why she was staying the race when it was clear she couldn’t win. It’s creepy how often it comes up, and then you add in the creepy amount of parallels to Lincoln…

And I find this snippet interesting, too:

Gotta do what we gotta do,
We ain’t got no governors comin’ through to help,
Anything we need, we gotta do for self,
New improved JFK on the way…

You may recall Kanye West’s spontaneous George Bush doesn’t care about black people remark during a Red Cross fundraiser, which then led to the (highly profane, thus NSFW) video, George Bush Don’t Like Black People song. While I’m not necessarily supporting the claim that Bush was overtly racist, I think it’s historically significant: not only was the whole Katrina event horribly mismanaged (the lyrics to the song include, “If it’d had been Connecticut, he’d have been there twice as fast”), but the whole deal with shooting looters (who were inevitably black) makes it entirely understandable that African-Americans may have felt a tad bit alienated.

Again, I’m hardly in agreement with everything put forth in the song, but I think it’s culturally significant. It’s not an advertisement or a campaign song, but just his perspective on the state of affairs. And I think it was interesting to look at.

Deal!

I’d posted before about my interest in picking up a low-capacity SSD card for my laptop, to drastically speed up disk access. (This actually has nothing to do with my recent posts about slow hard drives…)

Newegg seems to have a 64 GB SSD, 2.5″ SATA disk for $240 after rebate. Interestingly, from the specs, it seems as if not only are the seek times nill (on account of being solid-state), but the throughput exceeds that of your average hard disk. It won’t be released for four days, however. (Found via FatWallet, which also links to a review here.)

For those who aren’t major geeks, SSD is short for “solid-state disk.” Your ordinary hard drive is a bunch of spinning platters, whereas solid-state is the technology you see in a USB thumb drive or the like: no moving parts. The major benefit of SSDs thus far has been seek time: with a normal hard disk, the disk has to find the right spot on the disk and read it. Seek times average 8-10ms on most normal drives, but that adds up quickly with fragmentation or concurrent I/O. With an SSD, there are no moving parts, so “seek time” is pretty much non-existent: files are ready instantly. Early SSDs seemed to not be capable of moving as much data (in terms of MB/sec), though, meaing that SSDs were great for lots of small “random” access, but not so hot for handling big, contiguous files. Now, it’s looking as if OCZ has made SSDs kick butt over normal hard drives, and somehow offered the product at a fraction of what it normally costs. (This 64GB SSD is more normally-priced, to give you an idea of why they haven’t caught on so quickly.)

Incidentally, today I came across deals on two different notebooks for about $700, both of which have 4GB RAM, but 1280×800-pixel screens. The RAM is incredible, as are most of the other specs (though it’s 5400RPM drives), but I think you can do much better on the resolution.

Location Error vs. Time Error

This post christens my newest category, Thinking Aloud. It’s meant to house random thoughts that pop into my head, versus fully fleshed-out ideas. Thus it’s meant more as an invitation for comments than something factual or informative, and is likely full of errors…

Aside from “time geeks,” those who deal with it professionally, and those intricately familiar with the technical details, most people probably are unaware that each of the GPS satellites carries an atomic clock on board. This is necessary because the way the system works, in a nutshell, by triangulating your position from various satellites, where an integral detail is knowing precisely where the satellite is at a given time. More precise time means a more precise location, and there’s not much margin of error here. The GPS satellites are also syncronized daily to the “main” atomic clock (actually a bunch of atomic clocks based on a few different standards), so the net result is that the time from a GPS satellite is accurate down to the nano-second level: they’re within a few billionths of a second of the true time. Of course, GPS units, since they don’t cost millions of dollars, rarely output time this accurately, so even the best units seem to have “only” microsecond accuracy, or time down to a millionth of a second. Still, that’s pretty darn precise.

Thus many–in fact, most–of the stratum 1 NTP servers in the world derive their time from GPS, since it’s now pretty affordable and incredibly accurate.

The problem is that GPS isn’t perfect. Anyone with a GPS probably knows this. It’s liable to be anywhere from a foot off to something like a hundred feet off. This server (I feel bad linking, having just seen what colocation prices out there are like) keeps a scatter plot of its coordinates as reported by GPS. This basically shows the random noise (some would call it jitter) of the signal: the small inaccuracies in GPS are what result in the fixed server seemingly moving around.

We know that an error in location will also cause (or, really, is caused by) an error in time, even if it’s miniscule.

So here’s the wondering aloud part: we know that the server is not moving. (Or at least, we can reasonably assume it’s not.) So suppose we define one position as “right,” and any deviation in that as inaccurate. We could do what they did with Differential GPS and “precision-survey” the location, which would be very expensive. But we could also go for the cheap way, and just take an average. It looks like the center of that scatter graph is around -26.01255, 28.11445. (Unless I’m being dense, that graph seems ‘sideways’ from how we typically view a map, but I digress. The latitude was also stripped of its sign, which put it in Egypt… But again, I digress.)

So suppose we just defined that as the “correct” location, as it’s a good median value. Could we not write code to take the difference in reported location and translate it into a shift in time? Say that six meters East is the same as running 2 microseconds fast? (Totally arbitrary example.) I think the complicating factors wouldn’t whether it was possible, but knowing what to use as ‘true time,’ since if you picked an inaccurate assumed-accurate location, you’d essentially be introducing error, albeit a constant one. The big question, though, is whether it’s worth it: GPS is quite accurate as it is. I’m a perfectionist, so there’s no such thing as “good enough” time, but I have to wonder whether the benefit would even show up.