Nifty Link Roundup

Over the past week or so I’ve ended up bookmarking a lot of links that I thought would make good blog posts. (All are technical in nature.) I haven’t had the time, so I’ll just post them here as bullet points with brief comments:

  • I discovered the Prowl API today. It’s meant as a simple API for sending push notifications to iPhones. They call it Growl for the iPhone. And they have a lot of pre-written plugins, too. (Maybe Nagios can start sending Growl notifications instead of text messages!)
  • If you’re doing much with MySQL, you really owe it to yourself to check out Maatkit. It’s a set of tools written by people who say “I really wish I could…” even more often than I do. Some highlights:
    • Delayed replication. Set up a MySQL slave that runs an hour behind, and when you accidentally DROP DATABASE mission_critical, you’ve got an hour to STOP SLAVE and start recovery. (Sure, sure, you have backups. But having a live version in MySQL somewhere is extraordinarily handy, especially if you can just promote it to master for a while.)
    • There’s really no easy way to show all grants in MySQL, and I know that I’m far from the only person peeved by this. mk-show-grants does exactly that.
    • Some neat profilers on query stats and such.
    • An equivalent to UNIX “find” exists, allowing you to search tables by various criteria. Doing it by disk usage (data and index, split as you wish) is something any DBA should do often. Why in the world do we have an archive table with indexes turned out?
    • Xapbr builds on Maatkit a bit with this post on watching traffic via tcpdump instead of MySQL Proxy and showing errors; showing the queries with errors is just one idea.
    • The one tool that doesn’t exist and I’ve always wanted is a “tail -f”, both on a table’s data (to see new rows of data as they’re added), and just on binlogs. There are a lot of situations where this would be an unmanageable amount of traffic
  • Percona is probably a well-known name to anyone who does anything interesting with MySQL, but I have to admit that I hadn’t seen their Percona builds page before. They’ve added some nifty patches, and, because they’re totally awesome, released them under the GPL. (And I’m still eager to toy with XtraDB somewhere.)
  • VeriSign (whose name is really too confusingly similar with Verizon) has announced that DNSSEC for the root zones and .com and .net is coming proceeding. (The ability to spoof DNS is kind of scary, largely because it’s so easy to go unnoticed. Your browser will legitimately show that it’s connected to “paypal.com” because it is, it’s just that the DNS server was tricked into giving some phisher’s IP instead of PayPal’s IP.)

Building a Better Washer

I’m one of those people who tends to see technology as the fix to a lot of things. Sometimes technology is used to fix things that don’t need fixing, and we end up with overarchitected solutions that are just a waste of money. I’m pretty confident, though, that washing machines are a case where technology can make the process a lot better. With washers and dryers, the problem isn’t so much washing clothes, but the awkward dance that goes on when multiple people are vying for washers and dryers.

For one, it drives me crazy that I have to get quarters. Yesterday, I was all set to go, but realized I didn’t have enough quarters. I had cash, several credit cards, a checkbook, and a PayPal account, but not the $6 in quarters that it’d cost me to wash and dry two loads of wash. Today I had to buy a roll of quarters. When I used to work in a bowling alley, we had a lot of coin-operated video games, and the quarters were a huge hassle. Coins moved between a giant cash-to-quarter machine and the games, and we’d periodically have the person leasing us the games come and count all the quarters, and then move them right back into the quarter machine. Besides a colossal waste of time, it was also a frequent headache, because the games or the quarter machine were constantly getting jammed. So quarters are inconvenient for both users and operators.

I think both parties would win if I could get a card and swipe that directly on the washer or dryer. I’d prepay, perhaps in $20 increments, online, and the money would come out of my account when I used it. This would be great for me, but it would also double as a money-maker for the wash operators, because they would be collecting money upfront and holding onto it for a while, earning interest on the float. It’s the same thing that happens with gift certificates. Less likely than with gift certificates, but still possible, is that some people will never redeem the full amount. (Although really, this money is eventually forfeited to the state, apparently, not taken as profit.)

But then another possibility opens up. Since I’m swiping a card that uniquely identifies me, you know who’s using the machine. You can send me an IM / e-mail / text message reminding me when the wash is almost over. (You can also display my name on the washer when I’m using it / before I’ve emptied it, to shame me into actually coming to get my clothes.) I’ve waited an hour for someone to get their clothes out of the dryer. And that always happens when doing wash on shared washers and dryers.

Another nice advantage is that I could hit a web GUI and see if there were any washers or dryers open, rather than trudging downstairs. There could even be a ten-minute reservation feature whereby I could lock a washer or dryer before leaving to go there, to avoid the problem of me getting downstairs and someone having walked in before me, although I’m not sure if that’s actually a good idea.

This isn’t really a very wild idea, either. Things like this have been done for a long time. It’s just that no one has bothered to implement them. It really shouldn’t be that hard.

My Near Death Panel Experience

Earl Blumenauer has a great piece in the New York Times right now, entitled My Near Death Panel Experience. He’s a Democrat representing Oregon in the House of Representatives, and helped to push for a provision to ensure that Medicare would cover the cost of one voluntary visit to discuss end-of-life issues, like living wills and such. Medicare currently does not cover this, but doctors on both sides of the aisle have said it’s really important.

If this sounds vaguely familiar, it’s because this provision would turn into a giant controversy about death panels and forced euthanasia of the elderly, neither of which are even tangentially related to the text’s actual purpose. The article is a neat perspective into what also happened, but also leaves me worried about where things will go from here.

Eset NOD32 Review

I’m a Linux user and Mac snob. I have a Windows laptop, but it’s sitting in a box somewhere. But I used to run Windows, and I play occasional tech support for lots of Windows users, so I spent a while researching anti-virus software.

I’ve used a few over the years, and I’ve hated a lot of them. When I was in college, we had an enterprise Symantec subscription. I hated Symantec, and it periodically freaked out and wrote multi-gig logfiles for no good reason. We used to run Norton on all our home computers. And I discovered something amazing: removing Norton made the computers much quicker. Also, removing Norton is extremely hard to do. I’d be remiss if I didn’t drop a vague reference to the fact that “slows down your computer a lot” and “difficult to remove” being the two main descriptions of viruses, not anti-virus software.

Another interesting thing about some of the popular antivirus solutions is that I read a lot of people who got horrible virus infections when using them.

Enter NOD32. A lot of people swear by it. It’s made by Eset, a company no one has ever heard of, with headquarters in Slovakia. That didn’t inspire a lot of confidence, but I reluctantly tried it on peoples’ recommendations.

I don’t really have problems with viruses, so I can’t tell you any exciting stories about how I used to have some terrible virus and NOD32 fixed it. I’ve read lots of people saying it does. And a lot of professional reviewers have given it top marks. The one thing I can say with certainty is that it’s considerably faster. Removing Norton and putting NOD32 on an old computer breathed new life into it. Formerly too slow to even use, it now runs just fine. And for what it’s worth, it didn’t have any viruses. It just had Norton. (I hope it doesn’t seem like I have something against Norton. I think it’s a fine piece of software if you enjoy masochism.)

It downloads daily updates. It does it in the background, without popping up annoying windows. There is no giant toolbar you have to add to IE. You install it, and it runs in the background, keeping viruses at bay. You can also do on-demand scans. You can even, apparently, do virus scans of network drives, something most anti-virus solutions don’t allow. (Caveat: I never actually tried that.)

NewEgg sells a single-computer license for $30. If you go through Eset’s site, you can get bulk licenses (starting at a two-seat license) for pretty good discounts. Oh, and there’s a fully-functioning 30-day trial. Just be warned: you can’t have two anti-virus programs installed or they’ll fight to the death and take your computer down in their feud.

If you’re happy with your current antivirus software, there’s probably no reason to switch. But I swear by NOD32, and it has some remarkably good ratings. It just works.

The Weather

Two quick bits of advice for people giving out the weather:

  • If the day’s low temperature is 48 and it’s 39 degrees when you’re saying that in the morning, then the low temperature is 39. Why? Because it is 39 degrees.
  • If it is raining — nay, if it has been pouring all day — then the chance of precipitation is 100%, not 90%.

Såd

I went to Ikea last weekend with some friends, and we came across this terribly depressing scene. The text is obviously my own doing, but otherwise, this is what we saw when looking at the Lack coffee tables:

Sad Panda

We found another one of these depressed pandas lying with its face in the corner of a couch. I turned it around so it didn’t look quite as much like it wanted to die.

Really, though, nowhere between the obviously-emotionally-distraught designer at Ikea drawing this thing, through the asleep-at-the-wheel-or-equally-demoralized management, and all the way onto the factory floor where these things are made, did a single person say, “You know, these pandas we’re churning out look like they’re going to slit their wrists if we leave them alone?” And then, unpacking them at my local Ikea, no one said, “Hey, you know, these things corporate keeps sending us are unbelievably depressing? Do we have to put them out on the floor to bring shoppers down, too?”

Keeping Originals after a Delete in Paperclip

This is almost certainly not of interest to the non-technical regulars here, but I’m hoping it’ll save someone down the road some time.

At work I was having a hard time with what should have been a simple problem: we use paperclip for image uploads, and create a corresponding Photo object in the database. It is not necessary to have a database backing paperclip uploads in general, but in our case, it was. (In fact, with some polymorphism, too. Many things have Photos.)

The problem is that paperclip has a feature that’s useful in 99% of cases: if you delete a Photo record (or whatever object has_attached_file), it will delete the object off of disk. This makes a lot of sense: if you tell the database to delete the reference to a photo, you probably want to get rid of the disk. The problem is that I did not. We wanted to preserve (“orphan,” a purist might argue) the image / “attached” file on disk even when you called Object.destroy.

After a while of trying to figure out how to do this in paperclip, I finally found this discussion. The answer, it turns out, is that you hack in. In the object that has the attachment (Photo for me), you override paperclip’s destroy_attached_files and just have it return true. Your neutered version takes precedence of paperclip’s, and the photos sit on disk with no reference in the database.

Incidentally, I’ve found that I’m a grumpy curmudgeon who hates tools that “just work,” largely because when they don’t “just work” in some obscure situation, it’s a real pain to try to figure out why. People always say not to fight Rails. The thing I didn’t realize is that they don’t mean, “It will create a little extra work for you.” They mean, “You will want to change careers.”

GPS

I seem to have a thing lately for posts griping about the state of technology. Here’s another thing that bugs me.

I own a GPS. It’s a couple years old, but it has maps of the entire US, and can give text-to-speech directions. It also has WAAS support to help improve the accuracy of GPS. (That receiving signals from space can pinpoint my location to a few feet is pretty marvelous, if you think about it.) A few of the roads are wrong, but not really around here, just when I was driving to a conference at Clark a couple years ago. It gives me excellent directions, and can seamlessly recalculate when I take a wrong turn or overrule it.

I also own a good smartphone. It has 3G Internet access. It can determine my position, but not very well. It accesses Google Maps, so the maps are continually updated. It also pulls in traffic data, from wherever Google gets it. It also has a database of everyone I know and their address, plus the app on the iPhone is really slick at allowing me to put in “Pizza” and showing me all the nearby establishments. It can show me satellite imagery, which is occasionally handy.

It can do turn-by-turn directions, but I have to manually hit “Next,” and the font is tiny. It’s bailed me out once or twice, but usually only enough to get me to a couple steps of the way before I have to pull over and try to read what it’s telling me. Plus, if you take a wrong turn, it won’t ever adjust. Selecting “Wherever the heck I am right now” as the “From” location is counter-intuitive. Oh, and sometimes it does foolish things like assuming that, if I’m 500 feet past an exit on the highway, I can still take the exit, or it shows me driving on the wrong side of the highway, or having abruptly jumped from the highway to a parallel road. Maybe it’s just a function of not having very good accuracy.

If someone could merge the two devices, it would be amazing. A GPS that always had accurate maps. A GPS that would give directions and recalculate the route if I took a wrong turn. A GPS that knew about traffic, and would reroute you. A GPS that knew where your friends lived, or would let you look things up. A GPS that didn’t use 10-point font when it knew I was driving 70 miles an hour and that there was traffic.

It just seems weird that no one has really made the killer combo. Smartphones still have shoddy GPS receivers. Maybe it’s to save power, or maybe it’s because no one wants a big antenna on their GPS. (But, cell phone makers — if you made a cradle that cost about $50 and merely gave a better antenna and a car-powered battery source to my phone, I’d pay! And a cradle that just has a GPS antenna and a power cord to your cigarette lighter should cost all of $0.79 to make.) The software lags even further behind the GPS hardware on phones. My iPhone is capable of amazing graphics, complete with animated transitions slicker than on most computers, drop shadows, and so on. It just feels like a really polished device. The Maps interface feels like the polar opposite. And it has little quirks: the phone always shows north at the top of the map, which is really counter-intuitive to me. (If I’m driving south, I still expect to see myself going “up” on the map, towards my destination. But it’s not capable of rotating the map so that “up” is forward.)

There is enormous potential for someone to combine the two and wow everyone. And really, I think a lot of people would pay for it. But so far, I remain unimpressed, and carry a GPS, lamenting the lack of features on my iPhone, and carry an iPhone, lamenting the lack of features on my GPS.

Statistics

I just got an invitation to my high school class’s fifth reunion. (Yikes!)

They mention a memorial mass and then list those who have passed away from all the classes that are included in the reunion. Here are all of the classes included, and the count of students from that class who died:

  • 1959: 1, at the girl’s school that merged with ours
  • 1969: 5
  • 1974: 5, plus 3 from the all-girl’s school
  • 1979: 2
  • 1999: 1
  • 2004: 2

Besides the fact that it’s pretty scary to realize that two people from my class — both of whom I knew — have died, the numbers just seem really strange to me. (Yes, I realize that we only include classes every 5 years.) In particular, among all the included classes between 1979 and 1999, there were zero deaths, yet 1974 saw eight deaths.

The only explanation I can think of is the Vietnam War, which would explain the surges in ’69 and ’74. However, my parents back up Wikipedia in suggesting that there weren’t many soldiers in Vietnam by 1974, so it doesn’t seem likely that very many people who graduated high school in 1974 would have been sent to Vietnam, nor would it explain why there was still an apparent “tail” from the class of 1979, who would have graduated several years after the war was over.

If you write ’69 and ’74 off as being related to the Vietnam War, even though I’m not sure that’s the case, it’s still troubling that the class of 2004 had what is now the greatest number of deaths of any year, although it’s tied with 1979.

I’d really be interested in seeing a graph of this data across all years, not just those ending in 4 or 9. But it seems like it would be in poor taste to try to contact the alumni office to request it. The numbers just don’t make sense to me, though; it’s too wide a fluctuation to be random chance, I think.