Monday, December 05, 2005

coding is dangerous

I found this to be absolutely hilarious.

Friday, November 11, 2005

podcasts that rock

I got my iPod Nano a few weeks ago. The thing that has surprised me a bit is that I haven't listened to very much music on the thing at all since I got it. Instead, I've become enamored with podcasts. I had played around with a few before I got my Nano, but never really got into them. Now that I can transfer them to a portable player, that's about all I listen to anymore. Here's the ones that are currently at the top of my listening list.

The Daily Source Code with Adam Curry
TavernCast
TWiT (This Week in Tech)
Otaku Generation
Dot Net Rocks
Mondays

In addition, I've become addicted to the video blog / podcast phenomenom that is Rocketboom, even though I don't have a video iPod.

I don't have the time left to actually listen to music on my iPod! :)

immutable arrays

I've had a problem for months that, until now, I thought was impossible to solve without writing my own custom code to handle it. I've always wanted to have an immutable (or read-only) collection class. This is quite useful for exposing collections as public properties, but not allowing clients of the code to add, remove, or otherwise alter the collection. To provide good encapsulation, you should most often create methods on the object that contains the collection, so that the container object knows what's happening with the collection it contains. This corresponds to the Encapsulate Collection refactoring.

I've searched Google and every .NET resource I know several times, and it seems many other people have the same problem I do. As luck would have it, I was poking around in the .NET framework using Reflector, and was actually starting to roll my own immutable collection. It was then that I realized that System.Collections.ArrayList has a few static methods that I never noticed before. One of these is exactly what I need: ReadOnly(ArrayList) : ArrayList. Other useful methods I discovered were Adapter(), FixedSize(), Repeat(), and Synchronized. Each of these methods creates collection objects whose types are inner classes to ArrayList.

While I am very thankful that I finally have an answer to my problem, I do have a few gripes about this. Why are these nested classes of ArrayList instead of being more visible outside of the ArrayList class. For that matter, most of these methods take either an ArrayList or the more generic IList. The ones that take ILists create different classes than the ones that take the ArrayList. Why then, are these more generic classes in particular included as nested classes of ArrayList? They don't really have anything to do with ArrayList necessarily.

Of course, what this means now is that I have the nagging urge to go scour my previous code and refactor all those public collection objects in order to encapsulate them. That oughtta take a good long while...

Monday, October 03, 2005

spam, spam, spam

Got my first bit of comment spam. I always figured I flew under the radar of such things, but I guess no one's immune. Because of this, I've turned on word verification for all comments posted here. Don't let that stop you from posting a real comment if you have one though!

extraordinary ways

Conjure One (Rhys Fulber's solo project) released his second album on the first of this month. With the exception of the final song, it's available for streaming on Rhapsody. This album is a must-listen for any Conjure One/Delerium fans. I've always loved this type of ambient/new-age/electronic hybrid music, because you can pretty well just turn it on and just let it wash over you. I'll probably have to dig up the full album somewhere so that I can hear the last song. That, and so I can slap it on my spanking new Nano that should be here in a week or so.

Wednesday, September 14, 2005

the data that would not bind

Just encountered some really strange behavior with the databinding mechanism in .NET 1.1. So far, I haven't been able to determine what went wrong, although I was able to fix it. Those are the most unsettling of fixes; you keep trying things until something works, and when it works, you have no idea why. All I was trying to do was bind a System.Collections.ArrayList to a combo box and set the DisplayMember property of the combo to display the name of the item. So, something along these lines...

...
IList items = Model.GetItems();
combo.DataSource = items;
combo.DisplayMember = "Name";
...

public class Model {
...
public static IList GetItems() {
ArrayList items = new ArrayList();
// Create and add items that implement IMyInterface
return items;
}
}

public interface IMyInterface {
string Name {get;}
}


This code, when bound to the combo box, works just fine for the first item, and displays the Name property just as it should. However, every subsequent item instead ignores the DisplayMember property and spits out the result of item.ToString().

How did I fix it? In the Model.GetItems() method, instead of placing the items in an ArrayList, I created an IMyInterface[] array. Now it works like a charm, and I'm left wondering why.

Wednesday, August 31, 2005

office rodeo

There are some days that you wish you had a video camera at hand. It's not everyday you see a herd of cattle moving through your office parking lot. (Last year, it was pigs.) But what made it truly hilarious is watching one of these bovine chase your boss around a dumpster. :) As they were circling the dumpster, another boss jumped in his Ford Expedition and chased the cow away. If somebody had a camera, we all would've been a bit richer.

Wednesday, August 24, 2005

i <3 google

Two new things from Google have garnered my attention today. The first is a second beta to their desktop search tool. This one’s got a cool sidebar that is capable of showing virtually any kind of widget you’d want to come up with for it. This is probably in order to directly compete with Microsoft, who has announced similar functionality for future versions of Windows. It could also be seen as competition for the excellent Konfabulator, which was recently acquired by Yahoo.

Next, is Google Talk, the new instant messaging client that just entered beta. We played with it here at the office for a bit and I think it’s already replaced other forms of IM for us. We’ll see how it fares after the luster of newness wears off in a few days though. We’re all giddy about the voice chat though. It just works, which is more than I can say for just about any other voice chat software I’ve ever used. Plus, everything’s based off of Jabber, so even if I do stop using the Google-branded client later on, I’ve still got a spiffy new Jabber messaging address. That’s a good thing too, because I never seem to remember my old one without looking it up.

Friday, July 15, 2005

not pron

I've fallen into the trap of addiction recently. The vice? A website called not pron. It's an internet riddle that's both insanely challenging and intriguing. I'm up to level 44 so far and I can't seem to quit. Once you hit about number 10 is when you realize that this game will consume you.

Friday, July 01, 2005

text editor woes

As a programmer, it's no question that a text editor is the most valuable thing in the toolbox. Why is it that not a one of them supports finding and replacing of multiple lines. I can't count the number of times that I've needed to swap out several instances of one section of code or XML for another snippet. But Visual Studio, ConTEXT, and even my beloved Notepad2 don't support finding or replacing on anything more than a single line. It'd be one thing if I could substitue newline ( \n ) escape sequences or something to achieve what I want, but none of them even support that. Am I really asking for something that obscure?

Guess that one goes on my ever-expanding list of personal to-do projects. Maybe I'll patent it and make a million bucks....

Tuesday, June 28, 2005

255 possible causes

I'm currently working with serialization via binary formatters in .NET. I ran across this exception thrown by the ObjectReader's Deserialize() method a little while ago, which I find particularly amusing:

"Binary stream does not contain a valid BinaryHeader, 255 possible causes, invalid stream or object version change between serialization and deserialization      "

Only 255? Gee, and I thought this was going to be hard!

I like the trailing spaces tacked onto the end of the exception text too; that's a nice touch.

<sigh />

my list of tools - part two

Here's part two of my list, which contains some of my favorite development tools that I use often.

Developer Tools
  • Reflector - Every .NET developer will obviously list this as one of their favorite tools. When it comes right down to it, there just isn't another tool out there that comes close to being useful for a .NET programmer than this one.

  • TestDriven.NET - This handy tool integrates with Visual Studio .NET and allows you to run unit tests without leaving the IDE. You can also run ad hoc tests on just about any method you care to right-click on.

  • WinMerge - WinMerge is probably the best diff/merge tool I've been able to find. And I've tried a lot of them.

  • XML Marker - Easy to use XML tool that validates as you type. This is a good one to use if you just want to get down and dirty and crank out some handwritten XML.

  • CygWin - Installs a Linux-like environment onto your Windows machine. Lets you use a Linux command shell and run many utilities that just aren't available for Windows.

  • NAnt - This is Ant, only geared towards the .NET Framework. Great for scripting builds and automation.

  • CruiseControl.NET - Another port from the Java world, this is a wonderful build server automation tool. It will monitor your source code repositories and execute a build script when changes are detected. This lets you know immediately when a checkin has broken the build so that you don't have to hunt through two-month-old code that broke the build.

  • GhostDoc - This Visual Studio plugin lets you use a keyboard shortcut to auto-generate skeleton XML documentation for your C# code. Saves lots of typing.

  • Regions Addin - Yet another Visual Studio plugin that lets you easily create and add existing code to regions. Very useful for organizing code files.

  • TortoiseCVS and TortoiseSVN - These are the best clients for CVS and SVN that I've come across. They integrate exceptionally well with the Windows shell, allowing you to perform checkouts, updates, commits, etc. right from Windows Explorer.

  • NHibernate - A nice ORM (object-relational mapping) solution that has its roots in the Hibernate Java ORM. There are, of course, plenty of ORM solutions out for .NET, but this is my current favorite.

  • Boo - This is a new language for the CLI (Common Language Infrastructure) that a lot of people are talking about nowadays. What I've looked at looks extremely intriguing, and I'm hoping to be able to delve into it a bit more in the near future.

  • SharpDevelop - Can't afford an MSDN subscription? Can't stand Visual Studio? Then this is the IDE to use. It's not quite as full featured as VS, but still has plenty to help you write .NET code. This is an excellent tool for people wanting to get their feet wet writing code for .NET that don't want to invest huge sums of money to get Visual Studio. There's also a Linux version, MonoDevelop, available that lets you write code geared towards the new Mono framework.

  • ColorMania - This is great for web developers, but also for client developers. Lets you find out what color a particular pixel is, and even suggest complementary colors and offers options to tweak the color to your heart's content.

  • Snippet Compiler - Snippet Compiler lets you try out pieces of code in a quick, easy to use environment, saving you from having to wait an eternity and a day for Visual Studio to load a new project.

  • SQL Buddy - This one's great in a pinch. It's basically a replacement for Enterprise Manager. And guess what? If you double click on a table in the treeview, it opens the table as a grid!! What a novel idea!!

  • db4Objects - This is a database engine that allows you to store instances of classes directly, without the need to map them to a relational database. It seems to be quite good at what it does, and is currently the tool of choice for many Mono developers.

  • Mono - This is the open source, funtional equivalent of Microsoft's .NET Framework. It's pretty well striving for binary compatibility with the .NET Framework, but with the goal of getting that running under a number of platforms. There have already been several significant applications built with Mono, and seems like a very viable solution for anyone who wants to target both Windows and Linux.

groktalks are available

GrokTalks were a series of 10-minute presentations given at TechEd earlier this month. They're up and available for podcasting now at groktalk.net. I've watched a few of them, and they do an exceptional job of cramming in lots of information in a very short time frame. From the looks of things, Scott put in a lot of rehearsal time to make sure his presentation was just under the ten minute mark. :) Billy Hollis' presentation was also quite good, as always, even if he does use the god-forsaken language of Visual Basic. I'm hoping to watch the others as I have time this week. Now I just need a new computer to play with all the cool things mentioned in these videos. :)

Tuesday, June 21, 2005

my list of tools - part one

Taking a page from Scott, I decided to sit and catalog some of my favorite tools and programs. Here are the more general purpose tools that I love and use often. If I have time later on, I'll try to list all the development tools that make my life easier.

General Utility
  • Notepad2 - I really like this one as an alternative to Notepad. It's got line numbers, better formatting, syntax highlighting, and tons of options. Yet, it doesn't sacrifice simplicity for all these additional bells and whistles.

  • AppRocket - Great utility for launching programs without a mouse. Simply hit Alt-Space and type in the first few letters of the program you're looking for. It learns as it goes, and even allows you to browse directory structures and find/play music.

  • TopDesk - Great for anyone looking for an Expose clone on Windows. I've already wowed several colleagues with this one.

  • TaskSwitchXP Pro - This is a wonderful replacement for Windows' Alt-Tab functionality. Coupled with TopDesk, any problems you've ever had managing several windows at once while multitasking will disappear.

  • Trillian Pro - Lots of people use the free client, but the only way to go with this one is Pro. The advanced history view, availability of plugins, and meta-contact management are well worth the $30 the pro version costs.

  • imeem - Social networking/P2P/blogging software from the same people who make AppRocket. This is essentially orkut-meets-Blogger-meets-Kazaa. It's invitation only, but I've got 14 invitations to give out, so let me know if you'd like to give this one a try.

  • Foxit PDF Reader - Do you think Adobe Reader is a bloated piece of crap that you just have to deal with in order to read PDFs? This little app will let you read PDFs and weighs in at just under 2 MB. Very nice.

  • Virtual TI-89 - Any math geek will tell you that the TI-89 was calculator nirvana. I love that I can emulate it on the PC now, complete with an authentic skin! You'll have to do your own digging to find a suitable ROM for the emulator though.

  • Paint.NET - As far as I'm concerned, this is the only good freeware paint program out there.

  • MaxiVista - If you've got a spare laptop or tablet PC laying around that you'd like to turn into a virtual monitor, this is the tool to do it. It's really nice if you have a laptop that is only used when you're away from your desk.

  • OneNote - This is, quite honestly, one of the very few Microsoft products that I just can't get enough of. I doubt I'll ever take notes on paper by hand again.

  • del.icio.us - Very cool online bookmark tool with a social networking slant. The link goes to my current bookmark collection.

  • SauceReader - A nice RSS aggregator. I've gone through my share of these lately, and this is the one that best suits my usage habits.

  • Rainlendar - Puts a nice calendar and to-do list on your desktop. It's pretty, and doesn't take too many resources either.

  • Rainmeter - Small plugin-based utility that can do everything from showing an analog clock on your desktop to monitoring CPU and memory usage. Like Rainlendar, it's also very light on system resources.

  • HydraIRC - This is a nice alternative IRC client for anyone who's tired of mIRC.

  • CDBurnerXP Pro - A freeware CD burning utility. Not as full featured as some of the commercial ones, but it's great in a pinch.

  • The GodFather - If you have digital music files, you need this tool. It allows you to rename and organize all your music in a way that you define. It's a little obtuse at first, but after you've worked with it for a while, you can do some amazing things with it.

  • DAEMON Tools - I love this utility. It sits in your system tray and allows you to mount ISO files from your hard drive and view them as if they were actually additional CD-ROM drives in Windows Explorer. As an aside, the tool also claims to be able to sidestep many PC game copy protection schemes, but I wouldn't know anything about that.....

  • CommandBar for Explorer - Integrates with the Windows shell so that pressing Ctrl-M will bring up a command prompt inside of the Explorer window. If you change directories with Explorer, it issues the appropriate cd commands to synchronize the prompt with the current location of the window. There's lots of other goodies that this one lets you do as well. It's incredibly valuable to be able to see the files in Explorer as you work with them on the command line.

Monday, May 02, 2005

vegas, baby

I just got back from my first trip to Las Vegas late last night. My instructor and I headed out there on Friday to attend the 2005 Martial Arts SuperShow. We got the chance to meet and get autographs from David Carradine, which was quite cool.

We also attended the Battle at the Bellagio IV, which was impressive. I'd never actually seen a fight like this live, and it was incredible. It was quite a show. The Brazilian, Feitosa, came out on top with his impressive kicking ability. The final match actually seemed like a pretty good showdown; Feitosa favored kicking, while his opponent, Gary Goodridge, seemed to throw many more punches than kicks. In the end, Goodridge just couldn't keep up with the speed of Feitosa's incredible kicking ability.

Coming home, I was just getting over some congestion I'd had over the weekend. That probably wasn't the best time to be flying on a plane, I found. On the descent into Nashville, my ears started to stop up. This is normal of course, except for the pressure in my left ear never relieved itself. That made for quite the uncomfortable drive home, especially when added to the fact that we didn't start our two hour car ride from Nashville until around midnight. It's still bugging me, but not so bad after going to the doctor this morning. Hopefully it'll pass soon.

Some good news I found this morning though. My playlist, "Straight Outta the 90s" has somehow managed to find itself not only to the top of the Decade Mixes and the Rock/Pop playlist charts, but also to the #1 spot for all Rhapsody user playlists. Wow! I never expected that.

Wednesday, March 23, 2005

fatherhood

It's been a long time since I've blogged, I know. Things have been rather hectic after our son was born on the 24th of February. The first week or two, both my wife and I were zombies, as expected. But now that things are starting to fall into some semblance of a routine, the sleep deprivation isn't quite as bad as it was.

There are no words to describe what finally having him here with us is like. It really is just as they say; the moment I laid eyes on him, I knew that I'd do anything for him. He'll be a month old on Thursday, and it's hard to fathom where the time went. He's starting to become a bit more emotive. Every now and then, you can pick out the hint of a smile. And he's certainly good at expressing when he doesn't like something. Mostly, he's content to just lay there and watch us for long periods of time, cooing and sighing, which are very much the most adorable sounds I've ever heard.

Tuesday, February 22, 2005

his time has come

Yesterday was our baby's due date, and it came and went without incident. We decided to try and induce the labor, so we're going back tonight to do that. With any luck, we'll have the little guy here by week's end, but there is a chance that the process won't start the labor and we'll be forced to just wait it out or look into other alternatives. It oughtta be real fun tonight, because my wife will be forced to lay on her back for about twelve hours or so. I also don't have the first clue what I'm going to do for those twelve hours either, especially without an internet connection. Guess I'll get to catch up on my reading.....

Tuesday, February 08, 2005

lament for a tester

Why does it have to be impossible to sell management on the concept of dedicated software testers? Testing is a vital part of the software development process, yet too many organizations (mine included) only pay lip service to the idea.

Around here, I feel that many hold the belief that software bugs are the programmer's fault and that they are to blame for producing faulty code. If you're of this mindset, here's a little excercise for you. Take 30 minutes and write a 2-5 page essay. Check and proofread it all you want. After that, hand it off to someone of equal or greater literary competence (no fair having your two-year-old appraise your work), and see if they can find any mistakes. Any at all; even a small one. Chances are quite high that they were able to find at least one mistake.

Even the best authors make mistakes in grammar, spelling, or punctuation; it's inevitable. That's why authors have editors and various other proofreaders. These people exist as a check to make sure the author (and the publisher!) doesn't embarass himself by publishing a novel rife with grammatical errors. Why then should writing code be any different?

Programmers make mistakes. As is the case with authors, this fact is inevitable. Don't ever believe that a programmer wants to produce shoddy code. That just doesn't make any sense. To a programmer, code is just like that novel is to the author. It's an achievement. Something to be proud of. But sometimes, the user behaves in ways that the programmer would never in his wildest dreams expect. They double click the mouse when a single click would suffice. They type passwords in with the caps lock key on. Users are all different and see things differently than programmers. Without a second set of eyes on our work, there will be bugs, and should be expected.

This is where testers come in. Testers should work closely with the programmers, helping to greatly reduce the chances that a bug will find it's way out into the open. Without a dedicated QA team, can you really hope to release anything that isn't of beta quality at best? Remember the old adage about a million monkeys on a million keyboards? That's what we need. We need testers to turn the caps lock key on; to type in 3,721 characters into a text box; to stand on their heads and recite the national anthem while drinking orange juice and clicking the mouse. Most of the time, it won't take that much effort to find a bug, but many times, the really interesting and elusive bugs take just this amount of dedication to find.

I could go on for pages more about the need for good software testers, but instead, I'm going to link to an article Joel wrote, that I find particularly fitting.

The Top Five (Wrong) Reasons You Don't Have Testers

Tuesday, February 01, 2005

a friend takes his leave

My colleague and friend had his last day with the company yesterday; moving on to bigger and better things. We've been working pretty closely together for a little over a year on our current project, so it's sad to see him go. We've had both successes and failures, all the while helping to refine and better the other in our craft. I've learned a lot from him over the last year or so, and can only hope that I've been as influential to him as he has been to me. It will be different here without him around, but at least he hasn't gone too far, so it's a good bet that we'll still see him around from time to time.

Thanks, Jay, for all that you've done. For helping me to become a better coder, for pushing me when I needed it, for all the support you've given, for putting up with all my "what if?"s throughout the months, and for being more than just a co-worker. It's been a wild year, but a great one. I wish you all the best in your new position!

Thursday, January 20, 2005

exodus of the ladybugs

It's that time of year again. Every year around February, the thousands of ladybugs that hibernate in the walls come out in droves to try and find an exit to the outside. Sadly, probably about 85% of them never see the light of day and instead spend their time buzzing about my office. I've already got 78 dead ladybugs in the overhead fluorescent light in my ceiling. Clean it out? Why bother? Tomorrow there will just be 78 more....

[Listening to: Brighter Day (flashrider remix) (D I G I T A L L Y - I M P O R T E D - Vocal Trance - a fusion of trance, dance, and chilling vocals together!) - Treesh - ]

Wednesday, January 19, 2005

light tricks

Thought this was pretty cool. I'm gonna have to get some of those lights and learn how to do this!