Deals I’m Eyeing

A few good deals I’ve run into today:

  • VMware Fusion 1.0, $19.99 after rebate. Who would want Fusion 1.0 when 2.0 was out? Perhaps anyone who noticed that Fusion 1.0 owners get a free upgrade to 2.0
  • 22″ Dell LCD, 1920×1080, $139.99 with free shipping. I have two monitors at this resolution (sadly, not a pair: one’s at work, one’s at home), and got steals on both of them — and yet they cost more than this one. If you’re in the market for a new monitor, you’d be insane to get anything with a lower resolution.
  • Kingston V-Series 128 GB SSD, $249.99. It is supposedly one of the more recent drives where people stopped designing SSDs for raw throughput, and started working on eliminating the “stutter” problem where drives would periodically take a few seconds to write out a tiny block of data, bringing things to a screeching halt. It still claims 80-100MB/sec., but without the awful stutter that drives with faster throughput claim. (That said, I haven’t tested this, since I’m yet to buy one.)

Followers

A while back I asked on Twitter if people had found that A+ or CCNA certifications were worthwhile if you already know the stuff. I took the A+ course in high school but never got the certification. I’ve dabbled with Cisco at work, but am surely far short of CCNA. So I wondered if it was worthwhile.

No one answered me, but I did have several people whose profiles were devoted to Cisco, CCNA, and Cisco training follow me almost immediately. I was slightly amused and slightly annoyed.

I just asked a question about SEO. Not even expressing an interest in SEO, but asking whether the people who try binding huge blocks of IPs to their servers to “enhance SEO” were as full of hot air as I think they are. Now I have two new followers, both SEO enthusiasts.

What other terms should I mention to acquire some more hollow traffic on Twitter? 😉

Shades of Racism

I just had one of those experiences where a lot of little things conspire to paint a big, scary picture.

The other day I was driving to work and passed a Pontiac with this bumper sticker: “Toyota: From the fine folks that brought you Pearl Harbor Day.” Whoa. I didn’t really consider it blatantly racist, largely because the driver looked really old and he had a Navy bumper sticker, too. Maybe he was there. Not that I love it, but racism from war veterans seems less offensive to me, like John McCain continuing to use the racial slur “gooks” to refer to his captors.

That same night, I was watching the tall ships as a Chinese junk sailed in. I didn’t get the whole context of what they were saying, but someone nearby said something about how it was probably bringing lots of diseases into our country.

I’ve long thought that the immigration issue is being exploited by racists. There are plenty of non-racists who are really bothered by illegal immigration, surely, but I’ve also heard enough discussions about illegal immigration turn into racial slurs describing Mexicans to know that racism is alive and well.

Obama’s election brought out the Ku Klux Klan, a group that I had assumed died off sometime around the 60s. It seems that they’re alive and well, and that their ranks have surged with a black President. And it’s not just some strange people that none of us will ever meet. I’ve heard people express their disgust that we would elect an N-word to govern ourselves.

I also tend to think the same thing about Islamophobia. One’s religion now informs stereotypes about whether or not the person is a terrorist. There are all the people who didn’t vote for Obama because he was a Muslim. Besides the fact that it’s not even true, it’s disturbing. A while back I brushed up against someone calling for Obama’s assassination because he was a Muslim. (And yes, it was reported to the FBI.)

Now there’s a growing concern about growing size of the Ku Klux Klan and other openly-racist, often-violent white surpremacist groups, and the fact that they’re infiltrating our military. The media loves alarmist stories, but really, “Violent supremacist groups are joining the armed forces in record numbers” is about as good a cause for alarm as it gets.

Tallships

I work in (well, in an office next to) the Charlestown Navy Yard. I’d forgotten all about the Tall Ships event until they started docking.

Picton Castle

I haven’t been pleased with the photos I got, actually, largely because I’ve been carrying a bag with my work laptop and my camera bag every time I’ve tried to take photos thus far, plus the weather hasn’t been that great. But I thought I’d share a few for those who aren’t attending but who like boats.

Tallships by Night

Working until 9pm on Wednesday turned out to be a blessing. It was really nice and yielded some good photos.

Check out the whole gallery here.

Easy nofollow tags in Ruby (and Rails)

For a while I’ve been trying to ensure that all user-generated links on a site I code for had the rel=nofollow attribute to prevent giving spammers our link juice.

It’s a tough problem to solve, though. Or so I thought. I ended up doing a global search-and-replace (gsub) on any user-generated text, replacing "<a " with "<a rel='nofollow' " but this was broken for a few reasons. One is that, while apparently legal, it’s bizarre to throw the rel attribute before the href attribute. Maybe that doesn’t matter. The tricky part is that a link of the form <a title="evil site" href="http://www.example.com"> is totally valid, so I couldn’t just match on <a href or I would miss links from crafty users. The more I thought about it, the more it turned into a regular expression from hell. Plus, what if there was already a rel attribute, something like <a title="link from hell" href="http://www.example.com" rel="faked_you_out">? I’d then put in a second rel attribute, which is bad. It was just spiraling out of control, and turning into a lot of code to handle a lot of weird possible cases.

A coworker nudged me in the direction of hpricot, an HTML parser. And suddenly, it was comically easy to do this flawlessly:

require 'hpricot'
html = Hpricot.parse(user_content_here)
(html/'a').each do |link|
   link['rel'] = 'nofollow'
end
return html.to_s

For each ‘a’ attribute, called ‘link,’ set its “rel” attribute to “nofollow”. If there’s already a rel attribute, it’s replaced with “nofollow” and if there isn’t one, it’s added. hpricot handles all of the “special cases” that my code would have required. I don’t care where the rel is at all in this. It just works.

How awesome is that? It seems to work flawlessly, and yet it’s really basic code once you get past the somewhat unconventional format that hpricot uses.

Fixes

There’s this concept I keep running into that seems to have no word to describe it, but that happens all the time. The concept is opposing a fix to something because it’s not perfect. Let’s say that a whole city block was on fire, and the fire chief, having limited resources, commands his crew to start putting out the house closest to them.

“But chief,” a firefighter complains, “that won’t put out the other fires on the block. I think it’s a bad idea.”

“Well, then, what do you propose we should do?”

“I don’t know.”

I see this happen all the time in groups, and it invariably drives me out of my mind. It’s one thing when you have a better fix (“but chief, what about the other 7 firetrucks parked at the station and their crews that we forgot to dispatch to the fire? Let’s call them in!”), but all the time I see people shoot down an okay-enough fix to something, and propose no alternative, because the fix only improves the situation without fixing it entirely.

This isn’t to say that there are no bad ideas at all; if the chief’s recommendation was to spit on the house engulfed in flames, it would be a bad idea, because the improvement won’t be noticed at all. But if the fix is start by putting out one house, why not start there? Fire may be a bad example, since putting out the fire in a house if it’s surrounded by other burning homes will probably lead to the house catching on fire as soon as you move on. But take Ralph Nader’s opposition to seatbelt laws on the grounds that they didn’t go far enough. His opposition worked, but a better solution was never proposed, so he ended up undermining the cause he was fighting for. Or look at California’s budget crisis, in which two parties arguing over how much to cut the budget by end up deadlocked and the state ends up with no budget at all. If something is slow and someone finds a way to speed it up, but only a little, it’s an improvement. If you need a lot of money and someone gives you a little bit of money, it’s an improvement. Don’t say no unless you have a better plan.

This is a fairly ethereal concept, but it pops up everywhere. Watch for it and you’ll see it happen in short order, I promise.

Politics as Usual

This article makes me sick. If I try to distill the story down to a few sentences, I end up with a summary like this: some Republicans are trying to seize the opportunity to stick it to the Democrats by opposing Sotomayor, but other Republicans haven’t seen a good reason to oppose her. Still others think that they should give her carte blanche because she’s Hispanic and they don’t want to seem racist, or because the GOP needs stronger Hispanic backing. Some have blatantly confessed that they’re trying to figure out what would resonate most with voters.

Conspicuously absent in Congress, at least as told by this article, is any discussion about whether or not Sotomayor is a good candidate for the Supreme Court. Isn’t that all that matters? Stop discussing partisan loyalty, organized tactics to make your point, or race. If she’s qualified, approve her. If not, oppose her nomination and explain why you’re doing so. Is it really that hard?

(This isn’t at all meant to suggest that Republicans are alone in doing these things. They’re just the ones in the news at this particular moment.)

Literature Pop Quiz

I just described something as “rather the worse for wear,” and followed it up with, “Who was the person that described?” After receiving blank stares, I explained that I distinctly recalled those words being the last description of some literary figure (an author, not a character), but I couldn’t remember who and no one had any clue what I was talking about.

A quick bit of Googling backed me up. A well-known author was, indeed, described this way just prior to his death:

“[A] gentleman, rather the worse for wear… and who appears in great distress… I assure you, he is in need of immediate assistance.”

So pop quiz: who was the author described this way? No fair looking it up.

Preemptive Lying

A friend once told me a story about her troublemaker of a brother. One day, as a young kid, the dog came running into the house whimpering, and my friend’s brother immediately exclaimed, “I didn’t stab him!” Since no one had accused him of doing such, and since no one had yet realized that the dog had, indeed, been stabbed, his attempt at proclaiming his innocence ended up being a guilty plea.

It’s easy to dismiss as something little kids do, but I think the same sort of thing is happening in world politics. Every time North Korea releases a story about how great Kim Jong-il is doing, the fact that he’s most likely terminally ill becomes even more apparent. (And, by launching a ton of rockets into the ocean, they’re drawing still more attention to their leadership.) And you could say the same sort of thing about Iran: everything they say about being stable and thriving seems to be a pathetic attempt at denying the reality. Or like when the police investigating Rihanna’s beating had the police photos leaked to the press, and came out saying that they wouldn’t confirm whether they were real or a hoax, but that they would fire whoever leaked them to the press.

I’m a bad liar. The uneasiness in my voice and my panicked, paranoid look gives me away almost every time. But it sometimes seems that I can do better than the propaganda departments of some countries.

Cool Rails Links

Radiant CMS is a small CMS written in Rails that looks full-featured without being bloated. If I were to design a new semi-static site, I think I’d probably give it a whirl. It’s got quite a few extensions, too.

There’s also a Twitter gem that Rails (or just plain Ruby) developers can take advantage of. Without actually trying any, it seems that Fleakr may be the best available gem for Flickr. There’s also flickr-fu. Most irritatingly, the top gem, called “flickr,” seems like it hasn’t been worked on in a long time and never left alpha.