Archive for March, 2007

Don’t Be a Turtle

March 30, 2007

The blogosphere is afire with repudiation of offensive speech, catalyzed by Kathy Sierra‘s decision to stop blogging forever (or, presumably, until such speech isn’t part of the Internet—e.g., an end to flamewars). Let me start this entry by saying that I like Kathy’s blog: I can’t think of a single entry that I haven’t enjoyed and I have tremendous respect for her as a blogger and as an evangelist for evangelism. But I’m sorry to say that this move and the mob response really rankles me.

First, I’ve lost some respect for Kathy because this isn’t, in my experience, how strong women behave in the face of adversity or withering statements. Rather than recoiling and stifling your voice, I think a strong person would shout louder. The person or people responsible for the statements she cites want her to shut up, they want her to stop blogging. Complying with such demands just emboldens them in the future.

The cry of misogyny seems misplaced to me because the vile statements and epithets were directed at Kathy Sierra. They strike me as hatred of one woman, not women in general. Maybe the posters are misogynists, maybe they aren’t. With anonymity comes the inability to distinguish between copycats and amplifiers. You just can’t know that two people going by the same name are the same person or vice versa.

Further, as death threats go, they seem pretty low-key. Michelle Malkin’s litany of death threats she’s compiled is pretty scary. The worst offense that I read was about desiring to see her in a noose. Maybe I’ve got thicker skin, but that doesn’t seem specific—something I think actionable death threats have to be to get the police involved. Intimidation isn’t the same as death threats; let’s not conflate bullying with thuggery.

The response from the blogosphere has alternated between self-serving statements like Robert Scoble’s staging a sympathy blogging strike for a week and falling over themselves to deplore those making the comments. Meanwhile, the story got picked up by the BBC and the San Francisco Chronicle. Traffic and discussion have surged to the blogs that have covered this story, but I’m sure no one could possibly have had that in mind in making their public denunciations. (I am well aware of the irony of me making an entry about this story. But I don’t have traffic, don’t expect any from this, and am only writing this because the whole thing bugs me.)

To my mind, this is the latest in the Trottist campaign for civility. Nearly every one of the screeds I’ve read admonishing the perpetrators (including Kathy’s original entry) position this as a threat to the blogging world. It’s as if this sort of behavior is the norm or even an insidious part of the blogosphere. In my travels (and online they’re extensive), I’ve come across plenty of incivility but rarely threats. I’ve had a few on my blogs (even on my family one) and I’ve had some illicit requests for my daughter’s picture. They rattled me every time. But I did what was ultimately within my power: deleted the comments, banned the IPs, removed the pictures, and changed my behavior for the future. I didn’t stop blogging; I just started blogging better. If someone threatened my life, I’d brush it off unless I had some reason to believe that it wasn’t just talk. Like if they were left on my voice mail or nailed to my door. A comment on a public site is just too easy to make. I’d want to see that the person had made some effort to inject himself into my life.

For the record, I think the comments left were disgusting, rude, and inappropriate. Death threats? Maybe, but I don’t really know the law. I think there’s a bunch of overreaction from nearly everyone involved. The proper response is to delete the comments if it’s within your power, ignore the specific participants (they’d love the attention and traffic), and publicly state your indefatigability. Anything less plays right into their hands.

[UPDATE: Oh, I reread Kathy’s entry. I think talking about slitting someone’s throat is worse than the noose comment. So it’s more vile than I originally read. Still too vague to be a death threat to my mind. Also, on further reflection, I think parents should do whatever they think is best to protect their children and families. So while I wouldn’t have expected Kathy to close up shop, I can’t exactly fault her for it if she thought her family was at risk.]

[UPDATE (4/2/2007): Kathy’s posted a blog entry. It notes that she’s going to be on CNN today talking about this. Scoble notes that he was supposed to be on that program too, but he got cut. This all seems more and more disingenuous as it plays out. Death threats are no laughing matter, but shouldn’t we reserve the outrage and fear for when they’re credible?]

[UPDATE 2 (4/2/2007): This is a good article on the subject from Kuro5hin.]

Regular Expressions Aren’t the Devil

March 15, 2007

I love regular expressions. Okay, I love the challenge of crafting regular expressions. I do not enjoy reading regular expressions that I have not created or, really, even the ones I do create. But give me a problem and tell me to make a regular expression to match things and I am all over it.

A co-worker wanted a regular expression to turn unlinked URLs in text into HTML links and to correct linked URLs that lacked a protocol into valid URLs. In other words, if “www.google.com” appeared in some text, it needed to be replaced with <a href="http://www.google.com/">www.google.com</a> and <a href="www.google.com">some link text<a> needed to turn into <a href="http://http://www.google.com">some link text<a>

My first pass was a monster regular expression that handled both situations but I couldn’t get the replacement string to account for the fact that there was already link text in the invalid URL example. And I couldn’t adequately cover the situation where there were attributes before the href attribute. So scrap that one.

This is what I came up with after separating it into two replacement passes. I share it with you both as a testament to my regular expression abilities (good or bad, you decide) and because this situation seems like one that might come up pretty frequently.

Regular expression Replacement string
(?<=\s|^)(?<domain>www\.[^\s]+)(?=\s)
|(?<=\s)(?<protocol>http[s]?://){1}
(?<domain>(www)?\.?[^\s]+)(?=\s)
<a href="http://${domain}">${domain}</a>
href="(?<domain>www\.[^"]+)" href="http://${domain}"

The Ultimate in Keyboard Shortcuts

March 14, 2007

I’ve been using Quicksilver since it came out. I was once an avid LaunchBar user but it just couldn’t compare to Quicksilver’s slick user interface and incredible power. It’s the first app I install on any Mac I touch. But whenever I go to Merlin Mann’s site I invariably find some completely unexpected trick that makes me realize that I’ve barely scratched the surface.

This entry about Quicksilver proxy objects and menu items brings the Quicksilver power to bear on an application’s menus. So. You. Can. Use. Quicksilver. To. Run. Menu. Items. That. Might. Be. Buried. In. Submenus. O. M. F. G.

If you’re constrained to the Windows world, now’s the time to switch. Yes, a free app is worth the switch.

Spoken Like a True San Franciscan

March 14, 2007

I’ve been reading Antenna for forever but this entry forces me to comment. “20% beautiful, 80% ugly?” Hah. “Capitalist geography at its most misanthropic?” Double hah! I haven’t travelled widely, but Phoenix is one of the cleanest, easily navigable cities I’ve been in. More than most cities, perhaps, its beauty takes some searching—something you assuredly can’t do in a week—but there’s a whole lot of there there.

As someone who has lived here his whole life, I’m especially puzzled by the term “misanthropic” applied to our city’s layout. It’s not readily amenable to non-vehicular transportation, but for much of the year I can’t imagine wanting to be outside walking places. The climate, if anything, is misanthropic. Not a year goes by when I don’t spend an afternoon in pensive fascination at the fact that people lived and worked here for well-nigh 80 years before air conditioning became widespread.

And “capitalist geography” is nothing if not a slam against sprawl. The huge mass that is metropolitan Phoenix offends the sensibilities of San Franciscans, New Yorkers, and Bostoners but sprawl is, to me, the most appropriate way a city can grow. Think about it: sprawl is an indication of organic growth, of a spreading out that all civilizations, peoples, and animals follow. No one dictated that Phoenix grow in the manner it did; the decentralization is proof positive of that. I like that idea as it flies in the face of the centralized planning that so many older cities went through.

Sprawl is also perhaps the most human-friendly pattern of growth because it allows for a constant pushing of housing along the periphery. Frontier housing is invariably inexpensive, so it affords people real opportunities to own their own homes as it gradually (sometimes violently) pushes out the edges. Contrast that with cities that are growth-restricted due to all manner of obstacles, natural and man-made. They are among the most expensive cities to live in and force denizens into apartments. And apartments equal density, a density which has both positive and negative aspects to it. Myself, I prefer low density and I’m pretty sure many people do as well since Phoenix is one of the fastest-growing cities in the nation.

Five Things I Hate About C#

March 6, 2007

Inspired by Brian D. Foy’s entry and Titus Brown’s one for Python, here are five things I hate about C#:

  1. You can’t have methods whose signatures differ only in their return values. I think I understand why it might not have been a good idea in the past, but with VisualStudio.NET I don’t see how anyone could get confused any longer.
  2. You can split a class into partial classes. Why you’d want to do that is beyond me. Luckily, it’s a 2.0 thing so I was able to refrain from seeing it for most of my development life.
  3. virtual. I hate how you have to explicitly state which methods can be overridden by descendents.
  4. Constructor chaining. I wish it could be done like normal method overloading where you can have the constructor do something and then call another constructor. Again, I understand why that’s not feasible since the CLR would have to divine when a constructor was being called by another constructor versus a normal call to limit object creation. But the way that it’s handled currently obscures what’s actually happening when it treats the called constructor as a sort of pass-through to another one.
  5. Documentation. This appears to be a universal language complaint. MSDN is quite comprehensive but shallow at the same time. Everything is minimally documented and I can generally start there. But I can almost never end there: I invariably have to go to places like CodeProject in order to get a decent example of the syntax in action. Even that is generally not the final word because I usually then have to go to the blogs to see if there’s any “gotchas” involved in using the language construct. Oh, and MSDN does a horrible job of differentiating between .NET 1.1 and .NET 2.0—something I desperately need because I’m currently working in both versions of the framework.

That was a lot tougher than I thought. I had to comb through the code to find things that I hated that were specifically C# and not ASP.NET. C# is really quite a lovely language. In general, it’s the bee’s pajamas.

Just for grins, here’s five things I hate about ASP.NET:

  1. WebControls. Yes, I generally can’t stand WebControls. I’m quite obsessive about my HTML and CSS; a lot of that combination’s power is stripped away when you use a WebControl because Microsoft makes a lot of assumptions about how you’re going to be using them.
  2. AutoEventWireup defaults to true in 2.0. Okay, so I just talked about this one
  3. but it’s so wrong to change the default like that.

  4. Application event lifecycle. There’s really no adequate documentation about the ASP.NET sequence of events. This article from Peter Bromberg was the best I found. I ended up spending a lot of time in debugging trying to determine what is available when in the event sequence.
  5. I hate ViewState. It is nothing but massive bloat and there’s almost always a better way of storing data. I’ve also had several utterly inexplicable errors caused by ViewState corruption or changing.
  6. PostBack. There’s a reason why the <form> tag has an action attribute, Microsoft. I know that the Javascript trickery involved in POSTing to the same page allows for some nice automagical black-boxing. I just don’t like that model of Web application development.

That one was a whole lot easier. I had to limit myself to just five.

Cutting Back

March 6, 2007

I just saved $20 a month by switching to Family!

I’m actually quite excited by this because the 40 channels in the Family plan (plus locals) represents over 150 less than what I had yesterday. Less channels equals less channel surfing, less opportunity to discover new shows to get hooked on, and, well, less Law and Order. I watched too much of that—sometimes up to three hours a night if I hadn’t seen the episodes already—and it’ll do me good to restrict my viewing to just the new episodes on NBC.

It’s already paying dividends since we got through the three DVDs from Netflix that we’ve had sitting around for the last two weeks and I balanced the checkbook and payed all the bills! It’s not quite no television, which I don’t think my family could do but it’s as close as we’re going to get.

Gots to Get Down

March 3, 2007

In the course of preparing this entry for Found on the Web, I came across this video by aleprechaun AKA Emily. I’m hooked!

I’m still trying to decide what about her, the dancing, and the video is the most endearing. Young woman dancing in front of her computer to some music is a YouTube archetype, but I normally just shake my head in disgust at most of the examples I’ve come across. This one has me watching over and over—something I haven’t done with YouTube since the DJ Format videos. So I had to introspect to see what I was responding to.

My first thought, naturally, was that I found her attractive. She’s quite pretty and reminds me a lot of Tina Fey. Furthermore, she’s got a gangliness that I like. But that’s not it.

Next I thought about the choreography, such as it is. I enjoyed that aspect but in the end it’s not all that compelling. It’s mostly just pantomiming the song’s lyrics, which is quite uninspired. In a similar fashion, I dismissed my love for that song, which is considerable, as a rationale.

Then it hit me. The setting is such an integral part of her videos: it’s so obviously a college dorm room. When I went to college, I lived and worked off-campus. Plus, I was married. So I never got to experience the collegial aspect of dorm living. In my mind, I always pictured college life like that video—just goofing off and unwinding after a long day of studying. I bet that sort of thing goes on all the time in an average dormitory. Maybe it’s not the case, but that’s what it’s like in my imagination.

It also speaks to youth, to joyful exuberance, to feeling like you “gotta dance.” There are times in my own life, when I’m alone, where I just get down because I can’t keep it in any longer. I’m a horrible dancer, which is why I can’t do it in front of people, but the feeling’s there all the same. Anyone that knows me is probably agape right now—it’s not a side of me that anyone but my immediate family has ever seen.

And maybe that’s exactly what aleprechaun was doing, except that she recorded it and made it available to the world.

Full Auto

March 2, 2007

The Page_Load event was firing twice—inexplicably. If I removed the explicit declaration in the code-behind class, then it fired once. That pointed clearly to two bindings, but I could not find anything in the usual haunts of global code. Nothing had changed except that we moved to .NET 2.0.

Of course, I found out that in ASP.NET 2.0 AutoEventWireup defaults to true even if no Page declaration is present. Well, that’s a fine how-do-you-do! In 1.1, it defaulted to false, which made abundant sense. When migrating an application, you’d think that that would have been accounted for since it is such a potentially-disastrous change.

I mean it’s one thing to have Page_Load fire twice. It’s another entirely if you’ve got initialization stuff in OnInit or if you’re doing any multicast delegation. Crazy!

Oh, so the easy fix is to change it in machine.config or Web.config by adding a autoEventWireup="false" to the pages element. Problem solved.