The Importance Of Error Messages
I had a good laugh on Friday as I ready the Pop-up Potpourri: Mayday Edition article over on The Daily WTF. As one person commented: ”These make TheDailyWTF worth existing.” So funny. More so since these pop-ups come from actual applications. I have always believed that if you are going to display some sort of error message, the message should really only display a brief explaination of what happened (ie. ran out of disk space), what didn’t happen (ie. file wasn’t saved) and what the solution is, all from the user’s perspective. The user doesn’t care about internal error numbers or stack traces or anything else that relates to debugging of any kind. All the user wants to know is how can I fix the problem and move on with what I’m trying to do. Everything else is stuff that should be in the application’s log file.
That brings me to log files. I ran into a small error this weekend that caused me to sit down and say “what was I thinking?”. And before you start into me about not using a logger, such as log4j, forget it; this application predates log4j. And not only that, there are some instances I can think of where you may want your logging to go to stdout. I have slowly been migrating the logging over to log4j but there are still a fair number of calls to System.out.prinlnt(). Anyway, once again, I digress. I had been tinkering in the code of an application, adding some new features. But recently I had also been cleaning up old code, mostly instances where methods had been deprecated. I was testing something out, when I saw a string of these in my console logger:
UTF-8
UTF-8
UTF-8
UTF-8
The offending code it turned out was a result of a change I made due to a deprecated method within URLEncoder. The new method requires an encoding scheme, which The World Wide Web Consortium Recommendation states should be “UTF-8”. But what I had instead was “UTF-8 ” (notice the extra space) within code similar to this:
try {
userList.append(URLEncoder.encode(lastUserStr, "UTF-8 "));
}
catch (UnsupportedEncodingException uee) {
System.out.println(uee.getMessage());
}
The end result was that an UnsupportedEncodingException was being thrown and the error message associated with that exception was my invalid encoding scheme. Unfortunately, in a console logging window, that extra space doesn’t show up, so from a developer’s perspective it looks like UTF-8 isn’t supported. And that simply wasn’t the case. Since I haven’t got this particular class set up with log4j and not wishing to introduce any major changes at this point, I replaced the offending code with something like this:
try {
userList.append(URLEncoder.encode(lastUserStr, "UTF-8"));
}
catch (UnsupportedEncodingException uee) {
System.out.println("Unsupported encoding: " + "[" uee.getMessage() + "]");
}
So next time you are writing a error message, think aobut who the reader of the message will be and ensure the message is written from that person’s perspective. And don’t try and write a message that will satisfy multiple types of people.
30,000 Junk Emails
Today is a big day. In late December 2002, I started collecting junk emails. I’m not quite sure of the actual date nor am I quite sure why I started keeping these junk emails, but for whatever reason I did. And I only kept junk emails that were sent to me, via any of my email accounts (I have several addresses). I never asked for anyone else’s junk nor did I go out of my way to get junk mail. I simply collected the stuff that was sent. And now, three and a half years later, my junk mailbox is full of 30,000 emails which were a waste of my bandwidth and time. Not to mention service providers around the world.
Luckily, however, I’ve been using Mozilla Thunderbird since its inception. And one of Thunderbird’s best features is it’s adaptive junk mail detection. Thunderbird uses Bayesian filtering, which was made popular in part thanks to Paul Graham’s ”A Plan For Spam”. Unlike traditional junk mail filters at the time, which were mostly based on the sender’s email or perhaps on specific words, Bayesian was more mathematical in it’s filtering approach and with proper training could reduce false positives to a miniscule amount. If you’re interested in more information, you should read Paul’s essay but in short, filtering based on the senders email address doesn’t work because the spammers simply make up random names and email addresses. And judging spam based on single words like viagra, for example, doesn’t work because while an advertisement for purchasing the drug is spam, a joke email from a friend about taking viagra is not. Read the original essay though as it’s quite enlightening. And there’s a follow up article also.
Since training Thunderbird as to what I consider junk email, I have yet to have any false positives. Though, to be perfectly honest, I’m so convinced of Thunderbird’s adaptive filter that I no longer check for false positives. So the chance exists that there may be a couple. But I doubt it. I have seen a slight increase in junk emails that don’t get caught recently but I don’t mind because marking them as junk is a single click task. And just like life for me, where my learning never stops, Thunderbird continues to learn too. Even after 30,000 junk emails.
ndiswrapper 1.15
This afternoon I emerged the latest version (or at least the latest version available in Gentoo) of ndiswrapper (version 1.15). I figured that since people still seem to find this blog as a result of my trials with the D-Link DWL-G122 Wireless USB Adapter I may as well keep going. Once again there were no issues and ndiswrapper 1.15 worked just fine with the DWL-G122. The process still hasn’t changed since I last wrote about using ndiswrapper.
I’m now using the Linux 2.6.16.x kernel but I didn’t have time to try pulling out the device (without unloading the module) to see if doing so hung the machine like some of the old versions. If I get a chance, I’ll give it a go and update this entry.
Thirty-three Gusting Thirty-nine 1
I flew up north this morning. Not as far north as Aviatrix is, but well north-west of Calgary. Some people might call it Rocky Mountain House but pilots would likely refer to it as CYRM. It was a long slog up there. A really long slog. The winds aloft were forecast to be 330 at 43 knots and based on our groundspeed of 73 knots, I don’t think that forecast was far off. And I was too busy battling the light to moderate chop to muck around with the GPS to calculate the actual winds.
But the best thing about a consistent headwind is that it becomes a tailwind on the return flight. The same route that was a 1.3 hour flight going there, was a mere 45 minutes on the return. The bad news though is that the winds at Calgary/Springbank (CYBW) had increased from ”20 gusting 30” to ”33 gusting 39”. At 30 degrees off the runway, with some fluxuation, that put me dangerously close to exceeding the aircraft’s maximum crosswind component of 17 knots. And, in fact, the maximum would be exceeded during the gusts.
For students, or even licenced pilots, who are are unaware, don’t understand or simply don’t use the correct crosswind landing technique, the notion of a maximum crosswind component may be lost on them. When a pilot improperly employs the use of crabbing on short final in order to return the aircraft to solid ground, kicking the rudder at the last second to bring the aircraft in line with the runway, a maximum crosswind component doesn’t really exist. Or there’s no need for it to exist. If they kick within the last couple feet the aircraft will drift, but on a reasonably wide runway they can get away with that simply by ensuring that they start the kick with the aircraft on the wind side of the centre line. That way the drift simply brings them inline with the centre of the runway and at the very least they have some room to play with. So in a sense, the maximum crosswind component for a ‘kick’ method landing is really related to the width of the runway because for pilots employing this method, the higher the crosswind, the more they’ll drift.
Ultimately though, as Sam points out in his Slipping and Sliding, Kicking and Screaming post, the crabbing method can be dangerous, not only to the airplane structure but to the crew’s health should a runway excursion occur. But with the proper side slip technique, you bank in the direction of the wind and keep the aircraft aligned with the runway using opposite rudder. Here’s where the maximum crosswind component comes in; you can counter any crosswind using this technique but the higher the crosswind, the more bank required. And at some point, your angle of bank will be such that should you continue this all the way to the ground, your wingtip will contact the ground first. And to overstate the obvious, having your wingtip contact anything but air at anytime is a bad thing, but when that wingtip is the first thing to contact the ground on a landing, well, it’s not likely that things will end very well. It’s impossible to tell from the report as to when during landing this Delta aircraft wing strike happened, but I’d say they were lucky. In any case, the maximum crosswind component should make sense now.
So what did I do for my landing in this extreme crosswind? Although this was my first landing with a crosswinds anywhere close to the maximum crosswind component, I planned to do what I always do: side slip on final to correct for the crosswind. I did, however, request an extended downwind. That way I could ensure I would have a little extra time to stabilize my final approach. Although anticipated the tailwind I’d have on the left base for runway 34, my turn to base and turn to final were still one fluid movement. I then myself up in a side slip for the two mile final, during which I time I was able to monitor frequency of the gusting and how much more slip was required. I maintained the slip all the way to the threshold, at which point, unable to ensure I wouldn’t strike the wingtip, I transitioned to a bit of a combination; a partial crab of no more than perhaps two or three degrees with a slip to offset the rest of the crosswind.
I have so much time on the Warrior (though likely not as much as David so perhaps he can comment) that I am never surprised by the touchdown; it’s like having a built in radar altimeter. That said, I’m not entirely sure that it was the best method and I’m not sure that I would recommend it to anyone else unless they too were intimate with their aircraft. But the plane is home safe and without any undo stresses placed on the aircraft or it’s pilot. What I would recommend, however, to any pilot put into any situation on landing that they aren’t used to, is to setup for a long, stabilized final approach. Forget that rule about turning base when the threshold is 45 degrees off your wing in the circuit (or pattern) and instead ask for an extended downwind and thus an extended final. If it’s good enough for the big boys, I don’t see why us bug smashers shouldn’t use it also.
Blog Moving
I’ve decided to move my blog over to my own personal server. A server that I maintain and control completely. So if you’re reading this then that means you’ve either arrived here directly (ie. via Google) or the Zymeta blog server redirected you over here. That’s a good start. And I’ve changed the RSS feed so it also redirects over to my new blog server; hopefully that works also (and feel free to let me know if it doesn’t).
Thanks to the beauty of Postgresql’s import/export dump features, I’ve also pulled all my old entries and comments over as well. So, for the most part, it’s like I was always right here.
Anyway, the nice thing about being on my own server is that no one can mistake my entries as representing my employer (which certain losers have done). The other great thing about being separated is that I can be more openly critical about whatever I want without the potential ramifications of affecting future clients of my employer. So, for example, I can talk about certain airlines executives as being out of touch with their customers without worrying about said airline not wanting to advertise on our network because of my comments. You get where I’m going with this.
So welcome to the new, old blog site. And please let me know if you encounter issues.
Gallery 2.1
I updated to Gallery 2.1 on one of my Gentoo servers last week. And once again the process was amazingly slick. The Gallery developers have gone out of their way to make the process as seemless as possible. It’s not at the stage where my Mum could install it but given that this is a server-based application, it’s about as close as you can get.
I took the lazy route this time and didn’t bother cleaning up the old files and instead simply copied the new set of files overtop of the old ones. I hate doing this because if there’s any kind of problem with permissions, some new files may not get installed. But not to worry with Gallery 2 because the app not only checks the validity of the files when upgrading, it also checks for old files. At that stage of the install, I was presented with a long list of old files and groaned at the thought of having to delete them all. At least until I read this message on the same page:
These files are no longer part of Gallery. They probably won’t cause any problems but it is a good idea to remove them to keep your install clean. Gallery can’t remove these files for you, but you can download and run this script in your gallery2 directory to delete them for you.
And the word “script” was a link to download a nice shell script which removed all the old files for me. Brilliant. And just when I thought the application couldn’t get any better. So if the Gallery development team are doing this, why can’t more app developers? In most cases it comes down to laziness and the cool factor; it’s just not cool or fun to do that kind of stuff.
Chauvinists Live
I was walking home from work this afternoon and saw something I have yet to see in the 21st Century; a real, live chauvinist. At the corner of 17th Avenue (the famed ’Red Mile’) and 14th Street SW while waiting for the light to change, a woman in her late twenties, out for a jog, ran up from behind me. She was reasonably pretty, with a rather skimpy running outfit given that it’s April… in Calgary, which could easily still mean snow. In any case, she was certainly the nicest thing at this particular intersection.
After the light changed, she carried on with her run along 17th Avenue and I carried on with my walk home. As I finished crossing the intersection, I heard a series of “woo’s”. I looked up to see a white crew cab truck, typical of one you would see in construction or the oil patch, with a 40-something guy sticking his head out of the passenger window. And what was he wooing? Yup, the young woman jogger.
I never understand that mentality. Did the man honestly expect the woman to stop jogging and run after the truck? Or was the guy just trying to impress his friends? Although we’ve likely all done the ‘impress your friends’ thing, for most people that stops once you graduate from university. In any case, the chauvinists live. And it made me laugh. And to the woman’s credit, she just kept on jogging.
IFR Lesson #16
At this point in my IFR training, I can get the aircraft in the air, navigate to where I want to go and hold in place there, but I can’t land. At least not if the weather is overcast such that I don’t have visual on the airport from my cruise altitude. So now that we’ve finished up with holds, we are moving onto approaches, which will allow me to follow a procedure down to, hopefully, a safe landing at the desired airport.
We did a handful of approaches at two different airports this afternoon: the VOR 25 at Calgary International (CYYC) and the VOR A at Empress (CYEA). Like all the training thus far, the first time doing VOR approaches is a bit of a gongshow. Everything seems to come too fast, mostly because I’m too slow. I’m too slow with FITS check, too slow with my CRATOG check and too slow trying to get the aircraft settled down and ready for the approach. But it was good to be done holds. Holds are brutally boring. At least I find them as such.
Sim Time: 1.5 hrs
IFR Lesson #15
Today’s lesson was simply a ground brief on approaches. Yes, approaches. Finally. In talking with my instructor Jason today, it seems that my thoughts on people quitting were right. According to Jason, most people that start IFR training but never finish end up stopping somewhere in their holds training. Good times. Did I mention I’m happy to be past that part of the training? Of course, I suspect that there will still be holds in my future sim training, but at least that will just be part of an approach now.
Approaches, in a sense, are the easiest part of IFR flying as everything is basically spelled out for you on the appropriate CAP; outbound on this heading, turn this direction for the procedure turn, descend to this altitude here, etc. Granted there are various methods for starting the approach after reaching the initial fix but everything after that is written down on the CAP. And if you don’t follow those instructions to the letter, not only are you breaking the CARs but you risk running becoming one of those CFIT statistics, especially in mountainous terrain.
That’s not to say that expect approaches to be easy. Although you need to review the approach plate before starting, you need to be sure that you are at least one step ahead of the plane so that you aren’t fumbling around from one step to the next. And thus far, staying ahead of the plane has been my biggest challenge.