headermask image

header image

Monsters are real

On July 23, 2007, two career criminals broke into the home of a prominent Connecticut doctor, intent on robbing it. When they entered, they discovered the family was at home - the doctor, his wife, and their two daughters, 11 and 17. They beat the doctor. They tied the 11-year-old girl to her bed, and raped her. They raped and strangled the wife. Then they poured gasoline on their victims, and set the house on fire with three people still alive inside. The doctor is the only survivor.1

On December 18, 2005, a 37-year-old woman who was mother to three children answered her door, and was greeted by a man who claimed he was having car trouble, and needed to use her phone. She was later found shot and hanged to death in the basement of her home, near Culpeper, VA.

On New Year’s Day, 2006, a family of four were found beaten, stabbed, and bound in the basement of their house in Richmond, VA. The two daughters were 9 and 4 years of age. None of them survived. One of the two men who slaughtered them was the same man who had killed the woman near Culpeper. The pair went on to kill another family of three only five days later.2

Monsters are real.

I tell you this because, of late, I’ve been hearing from a lot of people who seem genuinely puzzled as to why I feel the need to own a gun. Some have made me the subject of jokes about “violent tendencies” (which I do not have, and as a matter of fact, those of you who do not possess concealed carry permits are statistically 5.5 times more likely to be arrested for a violent crime than those of us who do3). Some have even gone so far as to pay me the insult of questioning my intelligence, my background, and my mental competence. Since so many of you have been so forthright in sharing your opinions about my choice to keep a firearm, I’m going to be very blunt about one of my own:

I am completely dumbfounded that any of you seem to have to have this explained to you. I am shocked that so many of you who are otherwise sharp, intelligent, reasonable people have been so snowed by the anti-gun crowd that you appear to actually believe their myths, when the truth is so easily discovered. I am honestly disconcerted to have found that several of you are so naive as to believe that in this day and age, no one needs to possess or conceal such a weapon.

Following are some of the fallacies I have heard put forth by some that honestly causes me to question their own intelligence and mental competence.
Keep Reading »

“abcdab” or, why I don’t work for Yahoo

As many of you know (because I have no internal filter), I was recently in talks with Yahoo, who were talking about relocating me to California to go to work for them. The title of this post refers to an interview question they asked me, which was, “Can you think of an efficient algorithm to detect the first repeated character in this string?” My answer was, essentially, not really. I’ve made my career writing web applications in Java, Ruby on Rails, and even occasionally PHP (I’m not proud). I’ve never had to find an efficient way to detect the first repeated character in an arbitrary string, except maybe in some college class I no longer remember. If it ever comes up, then I’ll know that Yahoo was wise to try to make sure I could do it, and I’ll turn in my developer’s cap and take up carpentry or something. At least until someone asks me if I can dream up a clever way to build bookcases using only a pipe wrench and toothpaste, and exposes me for the non-carpenter that I am.

But that I couldn’t satisfactorily answer that question is not why I don’t work for Yahoo (and I don’t really begrudge them asking such algorithmic questions, even if I think they’re mostly contrived and silly). In fact, almost all of my interviews could not have gone better than they did. There was one at the end of the day that completely derailed, but it was actually unimportant (long story). My first interview, which was with the lead architect of the group, ended with her saying “Well, I like you. I’m gonna tell them to hire you.” Much of the rest of them went about as well.
Keep Reading »

Face it, Northern VA - there’s nothing northern about you

I recently learned that people in Virginia - that’s people in general, certainly not every one of them - have a keen distaste for the state of Maryland and its contents. I don’t know why this is, much as I cannot explain to you why people from Michigan look south to Ohio with disdain, even though I myself hail from Michigan. In Ann Arbor, directions to Toledo are typically given as “South until you smell it, then east until you step in it.”

What I find more amusing, though, is the animosity between Virginia and West Virginia. I hear a lot about this, given that I have now lived in West Virginia and worked in Virginia for years. When Virginians hear that I live in West Virginia, they often have all manner of hilarious comments for me. I’m sometimes asked if I have a “yard car” or not (I don’t). Once, on a business conference call (yes, really) a woman who shall remain nameless (though who I’ll tell you I secretly referred to as “Scout Finch”, because that’s who she reminded me of) took a shot at West Virginia. I told her, as I’ve told others, “Being from the north, the thing I don’t understand is why you Virginians act like there’s some sort of a difference.” Clearly, this touched a nerve, because she shot back with some hostility, “There is a difference - we don’t chase our brothers and sisters around.” In a fit of quick thinking the likes of which I have experienced neither before nor since that moment, I replied “That’s only because they don’t run.”

She didn’t even try to recover. Someone tried to come to her aid with some dumb comment about ice fishing in Michigan that sort of fell flat, the awkward silence passed, and the world moved on.

You see, the thing is, I really work in Northern Virginia, most of the inhabitants of which it would seem consider themselves a completely separate state from not only West Virginia (which they are), but also from the rest of Virginia (which, of course, they are not). You will almost never hear anyone from Northern Virginia say they live in Virginia; they almost invariably will tell you they’re from Northern Virginia. But I remember in 5th grade having to learn all the states in alphabetical order - you know, for that song? - and I’m pretty certain there’s no Northern Virginia anywhere on it. Just plain old Virginia. In fact, there’s no Northern anything on the list. It goes straight from North Dakota to Ohio, with no stops in between.

When I think about Northern Virginia’s identity crisis, I’m both saddened and amused. Northern Virginia is like the south’s very own Quebec. If you’re not familiar, Quebec is the province of Canada where everyone speaks French, acts French, thinks of themselves as French, and looks down upon the rest of the country for not being as French as they are. As far as Quebec is concerned, they’re more French than they are Canadian. What they don’t seem to grasp, though, is that France doesn’t claim them. France will happily tell them they are, in fact, a bunch of Canadians in denial. Similarly, Northern Virginians seem to fancy themselves part of the north (hence the Northern).

Sadly, as a genuine, bona fide, dyed-in-the-wool, has-forgotten-more-about-being-cold-than-Northern-Virginians-will-ever-know northerner, I’m afraid I have some bad news. If you’re reading this and you’re from Northern Virgina, first, sorry for all the multi-syllabic words and complex sentence structures, and second: You’re southern. No, really. I know news like this is hard for you to hear, but you had to hear it. You are southern. The north does not claim you. Never has, never will. Our collective advice to you is to embrace your southern brethren before it’s too late and they refuse to take you back. You don’t want to be a land-locked island nation all on your own, do you? Probably not. You’ve got a pretty nice place here, actually. It would be a shame to see it wind up that way.

Besides, the only thing worse than a southern redneck is a southern redneck disguised in a 3-series BMW or Mercedes C-class. So embrace your southernness. Do what comes natural, whether it be buying a pickup truck with huge wheels and CB antennae tall enough to hit traffic lights as you pass beneath them, or wearing one of those tight tank-top style undershirts (commonly referred to as a “wife beater”) while you peruse the aisles of Wal-Mart in search of such trendy home decor items as Billy Bass, the singing fish. Go ahead, drink Budweiser from the can, I know you want to. Free yourselves from these senseless charades!

I mentioned that in addition to being saddened by the plight of the indigenous peoples of Northern Virginia, I’m also amused. It’s because - and it took me a while to realize this - their shots at West Virginia (which, by the way, is a real state separate from the rest of Virginia (lucky them); I looked it up) are really just self-deprecating humor. It used to bother me a little when Northern Virginians waxed disparagingly about the state I now live in (even though it’s not my home), but not now that I’ve realized they’re just lashing out at what they see in themselves like chickens attacking a mirror. Whenever a Northern Virginian asks me if I have a yard car yet, I know it’s because he secretly yearns for one of his own, and wishes to live vicariously through me. I also now realize this is why Scout Finch so vehemently reacted to my gentle suggestion that, from the viewpoint of real northerners, there’s not much difference between the hillbillies from West Virginia and the hillbillies from Virginia (nor those from Northern Virginia, since we’re on the subject).

I wonder if it was a brother or a sister she’d have chased after, if only they’d had the decency to run.

Bluetooth Imports says “We’re among the most expensive”

Sometimes you run across someone so profoundly dumb you do a mental double-take before realizing that, yes, they really did just do something that stupid.

Case in point: Today I was browsing around doing a little research on a Bluetooth headset I’ve had my eye on when I stumbled across a site belonging to a company called Bluetooth Imports. Like so many online retailers, Bluetooth Imports purports to bring you and me “the best products at the lowest prices possible”. I love a good deal as much as anyone, so I thought I’d check their price on the particular device I’m interested in.

According to their site, they do offer a pretty good deal on the Aliph Jawbone I’m pondering. According to their site, they’ve knocked $30 off the regular price of $169.95, and will part with it for a paltry $139.95.

That is, according to their site. And I say “according to their site” because according to reality, that unit retails for $119.99, and can be had for significantly less than that all over the web.

Also according to their site, they offer the $169.99 Plantronics Discovery 665 for a mere $149.95. What a bargain! Except . . . the Discovery 665 is not regularly $169.99, it’s $149.95 at full retail, and can also be found for a lot less than that at dozens of sites around the web. Puzzled why a site that boasts “the lowest prices possible” would be so ridiculously overpriced, I wrote them a note. Unfortunately I used their web form to send the note, so I don’t have what I sent to them verbatim, but I recall pointing out these pricing disrepancies and asking the question, “Why are online sites that say they offer the lowest prices always the most expensive?”

They had an answer. They wrote me back, using a subject line of “Becuase” (their spelling, not mine), and this pubic relations pearl as the entire body of the message - save for their boiler-plate signature:

“We are online stores trying to make money please get over it and choose the cheapest.”

There you have it, folks. If you’re an online store trying to make money, it’s okay to mislead the public into thinking you’re giving them a discounted price on merchandise you’re actually charging full retail - or more - for. Bluetooth Imports said so. The thing that I love most about this response is that, essentially I asked them why they are among the most expensive merchandisers on the web for the products they’re selling, and they actually provided a reason. They didn’t refute it, they explained it. Oh, sure, they explained it with all the tact and language skills of a 7th grade drop-out, but the point is they explained it. They agree that they are amongst the most expensive out there; they have a reason for being so.

Yes, they really did just do something that stupid.

8 Things

I’ve been tagged. I’m supposed to tell you (in case there is a you) eight things you (probably) don’t know about me.

  1. I first attended college at the ripe old age of 12. I thought I was 14, but last Christmas the topic came up and my parents convinced me I was 12 (and of course they’re right; it was 1987).
  2. I can sing.
  3. I used to be a locksmith.
  4. I grew up in a house on a lake in Michigan. I’ve forgotten more about being cold than many of you will ever know, I believe that hockey is a religion, not a sport, and every once in a while you can still catch my accent (I’m told it sounds vaguely Canadian).
  5. I am very mechanically inclined, and can fix all kinds of stuff.
  6. I can do a killer Arlo Guthrie impression. I didn’t know this about myself until today.
  7. I am staunchly opposed to capital punishment. If you want to know why, ask me.
  8. I have been with my wife since we were teenagers. We both turned 32 this year (her 3.5 months more recently than I).

I’m supposed to tag 8 people, but I only know so many people with personal blogs, and some of them are already tagged. So I’m tagging Alan, Kevin, Jason, Randy, and Will. I have no idea how I’m supposed to alert them.

BarCamp!

Photo by Joe Loong

This is me trying to look like I know what I’m talking about at Barcamp in Washington, DC this past Saturday, August 11. This day was the most fun I’ve had in a long time, and I managed to learn a few things, too. I immediately went home and fixed some of my code based on things I learned there.

The event was very well run, which is due in no small part the outstanding efforts of Jason Garber, Justin Thorp, and Jackson Wilkinson. The space to hold the event was graciously provided by Fleishman-Hillard, and funding was provided by a number of generous sponsors, listed on the BarCampDC home page.

But by nature, the success of a BarCamp relies largely on its participants. I’m happy to say that the participants at this event were a great bunch. The presenters at all the sessions I attended knew their subject material exceptionally well, and they shared their knowledge willingly and eagerly. The audiences were great, too, asking lots of good questions and contributing their own knowledge to the sessions.

The after party was a blast, which you have to expect when you put that many cool people in that small an area. Even though I spent most of the day and evening with folks I know from work, I also met several people I otherwise might not have. Everyone was friendly and just all-around awesome (as Kevin might say).

As Mr. Garber said the other night, I, too, am in awe of the organizers and participants of this event. I’m already looking forward to the next one with great anticipation.

I can’t say it enough - thank you organizers, thank you sponsors, thank you presenters, thank you Fleishman-Hillard, and thank you participants. Thank you everyone!

habtm and the :id field

I spent all day today discovering something that’s both useful, and frustrating. To put it shortly, having a primary key on the join table for your habtm relationship will cause you problems. But having an :id field that isn’t a primary key does something useful. Want details?

I was trying to figure out how, even though my join table only defined a relationship between two records, ActiveRecord appeared to know which direction that relationship was created in. I have two classes, Product and Language, which have a habtm relationship with one another. If I take a Product p, and a Language l, and do first “p.languages << l” and then “l.destroy”, the row in the join table holding this association survives. But, if I do “p.destroy”, the association goes away with p. It makes sense - but how the heck did ActiveRecord know that the relationship had been declared as “p having l” instead of the other way around? For the answer, follow this bouncing ball:

We begin with a language whose ID in the database is 1, and a product whose ID is 2 (just so we can tell them apart). When I do “p.languages << l”, Rails does this in the database:

INSERT INTO languages_products (`product_id`, `id`, `language_id`) VALUES (2, 1, 1)

The color coding is there for a reason, and is a big hint as to what’s going on. Now, when I do “l.products << p”, watch what Rails does:

INSERT INTO languages_products (`product_id`, `id`, `language_id`) VALUES (2, 2, 1)

Do you see the trick? Watch what happens when I execute “p.languages.delete(l)”:

DELETE FROM languages_products WHERE product_id = 2 AND language_id IN (1)

. . . and when I run “l.products.delete(p)”:

DELETE FROM languages_products WHERE language_id = 1 AND product_id IN (2)

If you haven’t figured it out yet, what Rails is doing is cleverly using the id field in the languages_products table to tell it which side of the relationship holds the reference to the other side; in other words, which is acting as the “belongs_to”. Once it knows that, it knows whether or not it should delete the relationship. (Well, it doesn’t really “know” any of this - it’s using clever SQL to make it happen automatically).

Pretty slick if you ask me. But then it occurred to me to wonder - if ActiveRecord is (ab)using the id field to track the side of the relationship that holds the reference, what would happen if you tried to, for example, state that two products had a particular single language in their collection? The answer is, not surprisingly, this:

Mysql::Error: #23000Duplicate entry ‘2′ for key 1: INSERT INTO languages_products (`product_id`, `id`, `language_id`) VALUES (3, 2, 2)

Since the id field on the join table is a primary key, you get a collision. So you have two options - you can either remove that field altogether (in which case all that smartness about the relationships goes away, which can be desirable if you want the relationship to be destroyed regardless of which side goes away), or you can include it, but not allow it to be a primary key. Remember that migrations create a primary key by default, and you have to explicitly tell it not to when you create your join table. In the case of Products and Languages:

create_table :languages_products, :id => false do |t|

Accidental flight of the bird

 Bird

Captured this on the Ohio Turnpike. I admire the guy’s chutzpah, showing the world what he thinks of it even as he’s passed out in the back seat of a car.

Reality

Reality

Spotted these on a store shelf in Michigan. I wonder if “Reality” means that the box is actually empty.

Time

When I started this thing I thought I would have time for it.

It’s really not turning out that way.