At the ESRI class

Well, here I am at Constitution Plaza in Hartford, Connecticut. I'm actually here on a business trip. My employer sent me to a training course with ESRI entitled Data Management in the Multiuser Geodatabase.

There are a few things to note about the very fact that I'm here. In the 6 years I've been with my current organization (which is far too long), this is the first time I've been on an out-of-state trip. In fact, it's the first time I've been on a trip that lasted longer than a day. It's also the first off-site paid training class I've been sent to. Kind of seems like a waste, given that if things things go well, I'll be able to get the hell out of here before I have a chance to put any of this to use.

As for the class itself, I have no real complaints so far. It's actually hosted by the City of Hartford IT Department, which has 2 people attending. The instructor, Jim, has been in the GIS business forever and has been working for ESRI for 14 years. He's really nice and seems pretty knowledgeable, so I'm actually enjoying the class so far. In particular, learning about the system architecture was kind of cool. Of course, I'll probably never put any of the stuff he's teaching us to use, but at least this gets me out of the office for a week.

One cool thing I've discovered is that Python is apparently one of the favored languages for automating ESRI's system. In fact, the lap machines we're using for the class actually have Python 2.4 interpreters installed on them. I don't know if we'll do any scripting in the class at all, but I just found that to be really cool.

Unhelpful programming tools

You ever have one of those annoying programming moments where you know something isn't working, but for the life of you, you can't figure out why? And then, after spending way too much time on it, it turns out to be a stupid little typo or something like that? And then you're not sure whether to curse yourself for being so stupid or the compiler/interpreter/whatever for not providing a half-way meaningful error message?

I had one of those the other day. I was writing some PHP code to update a MySQL database using the object-oriented interface to the MySQL Improved extension. My problem was that my call to the $connection->prepare($sql) method was failing for no apparent reason.

For those who aren't PHP programmers, PHP 5 introduced MySQL Improved, or mysqli, a new extension for accessing MySQL databases. This includes support for prepared SQL statements. That basically means that you can parameterize your SQL, compiling the SQL and then injecting values from your code into the syntax and type-checked statement. This is a huge improvement over the old, hideously insecure method of just building up a string in code and passing it wholesale to the database.

Anyway, my problem was with the method that prepares an SQL statement. In particular, its return value - it returns a prepared statement object on success, false on failure. In my case, the method was returning false, which meant that MySQL couldn't prepare my statement because...well, it just couldn't. No exception, no message saying what was wrong with the query, just a failure code.

My question is: why? Wouldn't it make more sense to at least raise a warning to give you some idea of why the prepare failed? Or at least set the last error message for the connection? MySQL presumably has some idea why the prepare failed. Why can't the mysqli extension pass that on? After all, machines are good at finding typos. Much better than the developers who put them there in the first place.

Screw encryption!

On Friday, I said I was finally going to secure my wireless LAN. As you can probably tell from the title of this post, that didn't go so well. As of this writing, I am still running an open system because that's the only configuration I can get to work with all three of my computers.

268023_d-link_switch.jpgI've spent several hours messing with this today, and it's put me in a really foul mood. There was a time when I enjoyed messing around with my system configuration, but I just can't do it anymore. I don't care that much about networking. I have too many other things I want to spend my time on. I just want my damn network to function and not let anyone who drives by eavesdrop on all my traffic. Is that too much to ask?

My upgrade process started with a firmware update to my D-Link DI-524 C wireless router. This update included WPA2 support, which was a nice bonus. So my encryption options were now: nothing, WEP, WPA, WPA2, and something called WPA2-auto. On the down side, it included no additional documentation, so I have no clude what this "WPA2-auto" is supposed to be. But "auto" sounded promising, so I decided to go with that mode.

Turns out this was a bad idea. According to this forum thread, WPA2-auto doesn't seem to work consistently. Unfortunately, I didn't discover this until I had spent a considerable amount of time trying to get my PC configuration right. You see, I was misled because my laptop was able to connect one time while the router was in WPA2-auto mode. That led me to assume that the problem was with my PCs, not the router. Guess I should have Googled first.

So, eventually, I ended up going with plain-old WPA. The client configuration was a bit tricky for this. You see, my laptop uses NDISwrapper, so I could just use KNetworkManager to enter the pre-shared key. However, my desktops both have RaLink cards and use the rt2500 driver. This driver does not use the Linux wireless extensions and hence does not work with NetworkManager. To configure these cards, you need to add some lines to your /etc/network/interfaces file, as described here. It works, but the down side is that it breaks NetworkManager. However, since these are desktop PCs with 1 WiFi card connecting to 1 access point, that's not really a big deal.

While the desktops weren't that difficult (one I got the right router settings, that is), the laptop was another story. I still haven't figured that one out yet. Of course, I was out of energy by the time I got around to it, so I wasn't exactly in peak form.

The laptop has in integrated Broadcom card which, as I said becore, is configured to use NDISwrapper. This means it works with KNetworkManager. However, I couldn't get KNetworkManager to connect to the access point with WPA enabled. I selected the encryption mode, entered the pre-shared key, and then the connection progress bar would hang at 28%. The iwconfig output said that the card was associated with my access point, but I never got an IP address.

My current suspicion is that the laptop is using stale configuration data from my failed WPA2-auto attempt. I had some problem with stale configuration on the desktops too. For those, I just did a /etc/init.d/networking stop and then unloaded the driver module, then reloaded and restarted. That cleared everything up. In this case, however, I'm thinking it's the data stored by KNetworkManager. The only problem is, I have no clue whatsoever where I would look to find out. The interface is really spartan and there's no obvious way to delete stale configurations.

There is still one big functionality question I'm left with: how do I get NetworkManager to centrally configure an access point for all users? Both Sarah and I have our own accounts on the laptop, and I'd really like NetworkManager to automatically detect when our home network is present and connect to the access point at system start-up. I'm thinking there must be a way to do that, but there's nothing obvious in any of the configuration tools.

My wireless insecurity

I have a confession to make: it's 2007 and I still haven't set up any encryption on my wireless router. <Wince>

I know I should. I've known I should since I bought the thing two years ago. Every now and then I think I'll set it up, but then I just never get around to it. There just never seems to be a good time. However, as recent events have shown, even the best of us can have security problems, so it's time for me to get my butt in gear.

The real problem is two-fold. First, I'm a programmer, not a network admin. I know the basics of how networking works, and I can set up a basic home LAN without any problems, but I'm hardly an expert. I also know very little about WiFi, so I don't exactly have a lot of confidence that I'll get it right the first time.

This is a problem because I'm married to a lovely woman with absolutely no interest in geeky computer stuff. She also has a very low tolerance for things being temporarily broken. This goes double for "the internet," since web browsing and e-mail are 90% of what she does. This means that my only window of opportunity to mess with our LAN is when she isn't home. However, I usually have other chores to do at those times, so it never gets to the top of the priority list.

The second problem is technical. I wanted to set up encryption when I first installed my wireless hardware. However, the WiFi cards in my desktops are RaLink 2500 chipsets, and at the time, the drivers had only recently been open-sourced. The upshot is that I started out using beta releases of the community-supported driver and I was lucky to get it working at all. Encryption isn't a high priority when the network interface is just barely functional.

On top of the driver, both the router and my software were little help. My router is a D-Link DI-524 C1, which only included WPA-PSK support in a firmware upgrade (I'll be damned if I'm going to set up a Radius server) and included little to no documentation on it. And at the time I was using Slackware 10 and Xandros 3, neither of which had much in the way of helpful wireless configuration tools. So setting it up would have been a command-line, /etc/*, and vi hackathon of the type for which I have long since lost my enthusiasm

Today, however, I'm using Kubuntu 7.04. It includes a nice, stable RaLink driver and the KNetworkManager utility, which allows you to easily connect to any number of wireless networks. I essentially have no excuse anymore.

So, tomorrow afternoon, I'm going to give it a try. I've already downloaded the latest firmware upgrade from D-Link in preparation. I'll just need to dig out my 25-foot network cable, wire up one of my computers, and go to work. With any luck, it will go smoothly and I'll be done in half an hour. If I'm not so lucky...I may still be running an open network next week.

Agile, shmagile

There was an interesting article over on the Typical Programmer the other day. It consisted of a criticism of an anti-agile development paper entitled Agile Methods & Other Fairy Tales, by David Longstreet. While the criticism was interesting in its own right, I found it even more-so after reading the actual paper.

The main criticism the Typical Programmer leveled against the paper was that it was attacking a straw man. Specifically, he claims that many of the practices Longstreet describes are not actually agile, but simply broken. They just look agile because they don't involve much in the way of design, documentation, and so forth. Real agile methods, however, do not scorn those things when they are necessary.

I don't claim to be an expert on agile methods. However, I found Longstreet's paper to be good in some places. It certainly wasn't as intellectually bankrupt as the critique would lead us to believe.

Thinking about all this raised a few questions in my mind.
1) Couldn't the same complaint be leveled at the agile people? That is, might one not claim that they're not reacting against waterfall-style methods, but rather a caricature of them? After all, you can dress some broken methods up as waterfall just as easily as you can dress others up as agile.
2) Just what are real agile methods anyways? How do you differentiate it from "fake" agile? Viewed from the outside, it seems like agile methods could very easily be mistaken for cowboy coding. How do you decide where the line is?
3) Is it just my imagination, or do agile methods get less controversial every time I read about them? For instance, I remember when everyone was talking about the pair programming advocated by eXtreme Programming. Now, it seems like nobody cares about that anymore. (Actually,it almost seems like people have come to a silent agreement that it was kind of a silly idea.) These days, I read about the de-emphasis on documentation and other non-code artifacts. But then, when pressed, the agile people say they're only against the useless documentation.
4) Isn't "requires producing useless documentation" almost the definition of a broken development method? Yeah, sometimes it's demanded by the customer, but in other situations, does anyone ever think this is a good idea? It seems to me that if you're writing design documents that you never use, then you're missing the whole point of writing them in the first place.

Brain dump completed. Time to do some more reading on agile methods.