Wednesday, January 31, 2007

You are a douche.

Ever wanted to end a conversation quickly and efficiently? Hand the offending party a douche card, and walk away. Lousy service? Don't want to leave a tip? Douche card. Looking for something to replace those little packets of silica gel inside the new shoes at Walmart? Douche card.

The possibilities are endless.

Want some shoes? How about $5 too?

I've recently learned that there is a war brewing over which website will be the top shoe seller online. For years now, it's been, but recently, Amazon started up their own online shoe store,

The first volley was fired by Endless, as it started by offering free overnight shipping. This was something that Amazon does for many of their other web stores, so it was no big deal for them. Zappos soon countered by offering the same. Endless then did the unimaginable: offer free shipping for -$5. That's right. they're going to pay you to get shoes delivered via overnight service. I think it's a little bit retarded, but I'm not going to complain about a discount.

Endless also has the better website, all full of AJAX-y goodness and plenty of 'wow' factor. Making your way through multiple pages of search results does not even reload the current page! Instead, it fades out the old display set and fades in a new one. Very slick. Also pretty cool is a javascript magnifying glass thing that you can drag over the pictures of the shoes to see a close-up of a particular section.

Anyway, if you're in the market for shoes, maybe you want to check out one or both of those online stores. Personally, I can't buy shoes without trying them on.

Tuesday, January 30, 2007

Constructors vs. factory methods

I have come up with some coding conventions that I seem to spend a not-insignificant amount of time explaining to some of the people I work with. Specifically, I have a convention for what actions are performed in a class's constructor vs. a factory method that creates an instance of the same.

Constructors. It's not very easy to figure out what's going on if your constructor manages to throw an exception. Furthermore, if you've derived from a class whose constructor can throw exceptions, it's even more difficult to debug. Constructors should just initialize a class's members, but do no real 'work'.

Take the .NET class System.DirectoryServices.DirectoryEntry. You can construct an instance of this class with a completely bogus LDAP path in the correct format, but the constructor will not throw an exception. It is not until an action is performed using the instance that anything will go wrong.

Factory methods. In my convention, if you want to create a new instance of a physical object like an object in Active Directory, you'd have to use a factory method. If I had written DirectoryEntry, it would have a static Create() method on it, rather than having to add to the children collection, which I find a bit weird.

eg. DirectoryEntry.Create( DirectoryEntry parentContainer, string commonName, string className );

If you have two constructors, one which just encapsulates an existing physical thing, and another which creates a physical thing, that just doesn't feel right to me. Obviously this is comes down to personal style of coding, and there is nothing technically wrong with doing work in contstructors, I find that I have written more intelligible, easily readable code by clearly differentiating between the two.

My inspiration for this convention came from a Magritte painting, "The Treachery of Images". The painting, just as it says, is not a pipe. It is merely an abstract representation of a pipe. Just like the DirectoryEntry class is not actually a directory entry; it is merely an abstract representation of an object on a server that you can manipulate via code. To construct a instance of a DirectoryEntry class, you'll first need an actual existing directory entry. Let your factory method create that entry, and then return an instance of the class wrapping around it.

Am I babbling yet?

Monday, January 29, 2007

I got a letter and a new card from MasterCard

MasterCardCompletely out of the blue, I received this letter from MasterCard today, complete with a new card with a new number:
Dear Customer,

At MasterCard, we are constantly working to protect our cardholders from credit card fraud. In connection with a recent investigation, we have reason to believe that your MasterCard #---- ---- ---- ---- may have been compromised. This means that your card number may have become known to an unauthorized person(s).

Although there is no evidence of fraud on your account, we feel it prudent to replace your existing card to avoid any potential misuse. Attached please find a replacement card with a new number. We sincerely apologize for any inconvenience this matter may cause you and appreciate your understanding.
Hrm...this really makes me wonder what the hell happened to my card number. They have attached an FAQ section to the bottom of the letter stating, "Due to an ongoing investigation, we are not able to specify how, when, or where your card was compromised, however, we can confirm that it was not at MasterCard."

Update: I spoke to a MasterCard representative on the phone to activate my new card (on the activation website, neither my old card number nor my new card number would let me in), and he told me that it was Winners/HomeSense who recently had their customer information stolen. Apparently anyone who used a credit card at Winners or Homesense between April and September of 2006 has had their card number compromised.

Now I have to update all of my automatic bills to use my new credit card number, not to mention PayPal, and countless other websites on which I have an account. Fuck you criminals. Fuck you right in the ear.

My first burlesque show

Miss C. of Pink Velvet BurlesqueSaturday night, I did something I had never done before. It wasn't because I thought it was a bad idea, just that I hadn't gotten around to it. I went to a burlesque show at the Seahorse. I was promised beautiful women and breasts covered by nothing but the smallest of pasties.

I wasn't disappointed.

Several of the girls from the Pink Velvet Burlesque troupe performed and it was everything that I hoped it could be -- in a public place. If, when you were growing up, and your mom always watched figure skating on television, and since there was only one TV in the house, you had no choice but to watch it with her, but you had no interest in figure skating, so all you could do was fantasize about the women in tight outfits with blades on their feet, then burlesque is a natural progression.

I'm not sure what kind of (proverbial) balls it takes to get up on a stage while barely clothed with no expectation that people in the audience are going to throw money at you, but these girls have got 'em. There was really nothing strip-club-skanky about the whole was just hot.

Thursday, January 25, 2007

Listen for me on the radio

I'm going to be a guest on Mixtapes for Heartbreak this Friday evening from 2130h to 2230h. Check it out on CKDU 88.1 FM in Halifax, or on the interweb at

Later on, I'll also be taking part in a CKDU-run podcasting seminar. If you're going to be in Halifax on the 2nd of February, and you're interested in learning about the ins and outs of podcasting, feel free to drop by. It'll be at 1800h, February 2nd, on the 4th floor of the Student Union Building at Dalhousie University (6136 University Avenue).

Tuesday, January 23, 2007

Quest Idol

I really don't know what to say about this...but I think they did a pretty good job. NetPro, eat your heart out ;)

Friday, January 19, 2007

My Eastlink IP is changing!

Somewhere around the 12th of Jnanuary, 2007, Eastlink started messing around with the IP blocks that they're handing out to residential customers. For literally years my IP address was completely static, and in the range (I don't want to actually give it out in case it is ever given to me again ;)). Now, it's in the range.

What's up Eastlink? Are you reorganizing things?

My grand scheme (new URLs and feeds)

As I've started to do other things, I've started to feel that I no longer really want to have to maintain a website powered by code that I wrote. It's not that it's bad code, I mean, it's served me well. It's just that if there's ever a feature I want, I pretty much have to do it myself. Since a good programmer is a lazy programmer, I have found many other ways online to accomplish what I wanted to do with As a result, I've decided to start a more professional blog on a domain I should have registered years ago:, and to move my personal blog over to

Don't freak out, isn't going anywhere. It's going to stay exactly as it is.

If you would like to find me, however, check out one of those previously mentioned or

I also have a grand plan for feeds for all my various things that have feeds. First of all, I'm going to use Feedburner. Everything is going to be available under the umbrella of Here's a list of my feeds you can subscribe to:

My new professional blog:
My new personal blog:
My photos on
My links on

And of course, there are my other feeds:

My weekly podcast:
My monthly podcast:

Thursday, January 18, 2007

My grand scheme (new URLs and feeds)

As I've started to do other things, I've started to feel that I no longer really want to have to maintain a website powered by code that I wrote. It's not that it's bad code, I mean, it's served me well. It's just that if there's ever a feature I want, I pretty much have to do it myself. Since a good programmer is a lazy programmer, I have found many other ways online to accomplish what I wanted to do with As a result, I've decided to start a more professional blog on a domain I should have registered years ago:, and to move my personal blog over to

Don't freak out, isn't going anywhere. It's going to stay exactly as it is.

If you would like to find me, however, check out one of those previously mentioned or

I also have a grand plan for feeds for all my various things that have feeds. First of all, I'm going to use Feedburner. Everything is going to be available under the umbrella of Here's a list of my feeds you can subscribe to:

My new professional blog:
My new personal blog:
My photos on
My links on

And of course, there are my other feeds:
My weekly podcast:
My monthly podcast:

Coding with FxCop

Like my co-worker, Brent, I have recently been in the process of designing an writing components of a prototype for the next version of the project I work on. I haven't been this excited about going to work in quite a while. There's nothing like designing and building something new, rather than testing and fixing bugs, and maintaining legacy code. However, today was the first full day that I had experienced the full onslaught of compiler errors that is FxCop. I felt like I was in university again. For the newbies out there, FxCop is an add-on for your .NET compiler that will check your assemblies for non-conformity and smack them down if they step out of line. It's kind of like the Borg, if the Borg had assimilated an hard-nosed, ruler-smacking elementary school teacher.

I was writing code that I thought was pretty good, but FxCop had other things to say about that. Everything from telling me not to initialize member variables to null (something that was ingrained in me to DO from an early age) for performance reasons, to standards of naming any public members of your classes, to globalization, to security considerations, to suggestions for maintainability, it really has something to say about all aspects of my code. At first, it seemed like it was pointless, like I was never going to get through the nearly-endless stream of errors produced by the tool, but slowly and surely, they dwindled to practically nothing. The only ones that remain (and I've since changed the settings so they only report as warnings) are ones that tell me that nothing is using a certain class or a particular method. Well no shit. We're in the process of building a prototype!

This was one of my favourites...take the following class:

    public class Foo


private Byte[] privateBytes;

public Byte[] Bytes{ get{ return privateBytes; } }

The compiler with FxCop tells me that I shouldn't return arrays because it could impact performance. Instead, I should return a strongly-typed collection...of bytes.


But I'm bashing a little too hard, perhaps. On the whole, it's right on the money. I think I only suppressed two or three instances of errors in all the projects that I worked on. I want to have FxCop fully turned on (does that sound dirty?) during the entire development process. Nothing makes you feel better than when what you've created conforms to just about the strictest standards out there, not just of functionality, but of aesthetics. And because nothing is worse than going back and fixing errors in reams and reams of non-compliant code.

However, it can be difficult when your compiler is nudging you, nay, forcing you to implement more, and MORE just to stop the errors. FxCop is like a ghetto pusher, "Just one more method, man...come on, you can fix those errors. Just one more method." Everyone else left the office around 5:30 or so, but I stuck around until 7:15 because I couldn't stand seeing errors. And I enjoyed it.

I think FxCop and I are going to have a love / hate relationship.

Wednesday, January 17, 2007

There's a Google Store?

Did you know that there was a Google Store? I'm shocked that I am only just finding out about it today. Incidentally, who knew that a beanbag chair was so expensive? You're probably just paying for the name ;)

I am totally picking up a Blogger t-shirt.

Saturday, January 13, 2007

It's Free Subwoofer Day!

The Futureshop crazy extended warranty has come through for me for a second time. The first time, I ended up bringing back a laptop because the battery wouldn't charge anymore. This time, 6 years (the warranty was good until 2009) after I bought it, I took back a 10" Velodyne subwoofer that had developed a nasty rattle somewhere inside the casing.

The guarantee says that if they take more than 60 days to get it back to you, or if you have to send the same item back more than twice, they'll just replace the item for you with one of equivalent value. 60 days + 1 later, I'm waiting in the customer service line at Futureshop, and it's moving surprisingly fast. The fact that they're going to replace it means to me that I have the opportunity to upgrade. It's like a 6 year layaway plan ;)

I left the store having upgraded to a 15" Velodyne subwoofer (total cost $999). I only paid $310, including a new warranty (I mean why not, it's certainly served me well so far) that covers my new subwoofer until 2016. It is currently sitting in the back of my Honda Element...It's large, heavy, and awkward enough that I haven't quite figured out how I'm going physically move it to the place I want it to be. I'm probably going to have to clean up the downstairs hallway :|

Check back here later...I'll have pictures of the behemoth both in the box and out.

Thursday, January 11, 2007

IDSObjectPicker - Why isn't there one for .NET?

About a year and a half ago, I was writing a piece of software that did a lot of things in Active Directory, with Group Policy Objects specifically, but that's not relevant here.  What is relevant is that I wanted to pop up a dialog to allow the user to select one or more user objects from active directory.  I had used the IDSObjectPicker interface before, however, all the other times I had used it were in unmanaged C++.  This was the first time I would attempt it in managed code.

For the uninitiated, IDSObjectPicker is a goddamn miserable interface.  If I met its author on the street, I would punch balls first and ask questions later.  It looks unassuming with only two exposed methods, but those methods belie a seething underbelly of complex nested structures and obscure enumerations.  You could write a whole page of code just filling out all the required bit masks, creating arrays of other structures to assign to the previous structures, etc.

I honestly thought, given my previous fantastic experiences with C# (especially with COM interop) that this was going to be easier than before.  I would reference the COM DLL in which the interface resided, and everything would be marshaled for me.

I was mistaken.

It turns out that this was my first time using COM interop with a COM interface that didn't stick to automation types (BSTR, VARIANT, etc.) for its parameters -- They would just get marshaled across the interop boundary as Objects.  I spend about two days writing tedious C# code to re-create enumerated types and manually marshal as much of the parameters and return values as I needed until I got to one particular structure that vexed me.  


It's not even really a complicated structure.  MSDN describes it as a "Pointer to an array of null-terminated Unicode strings".  As simple as that sounds, I went as far as manually allocated the array's memory using the Marshal.Alloc* methods, and attempting to binary-copy the memory in an attempt to get it to take that value, but it just wouldn't.

Giving up when it comes to something I'm pretty sure is possible is not something I usually do, but I was ready to punch my monitor at this point (and it was the big, heavy, 19" CRT kind).  I eventually threw in the towel and wrote a wrapper COM object in unmanaged C++ for IDSObjectPicker which translated the input parameters from automation-types to pass in, and the return values back to automation-types to pass back.  That was the only way I managed to get the IDSObjectPicker working in .NET.

I recently stumbled upon this guy who had the exact same problem that I did, which is what prompted me to make this post.  We're not alone.

So WHY isn't there an equivalent, .NET-ified version of this godforsaken interface?

Tuesday, January 9, 2007

New Windows Server OSs

In the past few days, I've heard about two new Server OSs that Microsoft is producing. The first, well, we've all known it was coming for some time now: Longhorn. The second, for me at least, popped up almost out of nowhere, but it think it could be a very cool addition to many homes and/or small offices: Windows Home Server.

Windows Home Server

Watch this video. WHS is a server "appliance" that will basically have power, ethernet, and some USB ports. It promises a central repository of drive-letterless, raid-like disk space. Just add a new drive, whether it's PATA, SATA, or USB, and it will be incorporated into the existing internal spaciness of WHS. This in itself is a more worries that drive D is running out of space, so you'd better put that movie on drive E, even though all the other movies are on D. It also claims to be able to backup every computer in your house overnight. I don't know how many hard drives I'm going to have to put in this thing so that it can store all my media and back up every computer in my house, but at least it's smart enough to use a single-instance-store; i.e., if two computers are both running XP SP2, they probably have some files in common, so WHS will only store one copy.

The feature that both excites me and worries me is that WHS will automatically organize your files. I typically abhor automated systems of organization (read: iTunes) because they don't often match up with mine ;) But since it will probably have some sort of Windows Desktop Search integrated into the interface, I'm sure I'll still be able to find everything I put on it.

Overall, the concept of a headless box that I can stick in the closet, or somewhere equally discrete is appealing. I mean, it's pretty much what I have at home now, but the ability to just add drives and have it incorporate the new space automatically is a feature that I would be willing to pay for.

Longhorn Server

I recently read this ComputerWorld posting about Longhorn Server and I was intrigued. It seems that Active Directory is going to become a hybrid of a Windows 2000 style multi-master domain controller system and an NT 4.0 style of primary and backup domain controllers. This "new and improved" Active Directory will have the concept of a "Read Only Domain Controller" (or RODC). On the surface, that sounds a whole lot like a BDC with a different acronym, but it's actually more complicated than that.

From the same article:

  • The RODCs will not cache administrator credentials. I'm still not clear on whether it just won't cache the domain or BUILTIN\Administrator credentials, or the credentials of any account with administrative access, which would make more sense.
  • The RODCs can be run without a GUI since they require little to no administration on their own.
  • RODCs can have their own set of "administrators" so that the guy in the branch office where the RODC lives doesn't have to be a domain admin.
Longhorn also promises an updated DFS replication algorithm, which should be good news for anyone who has experienced SysVol replication problems (Why aren't that GPO's settings being applied?). But probably the most significant enhancement is that you can now restart the services responsible for Active Directory without actually restarting the entire machine.

I'm looking forward to both these new server products...Guess I'll have to buy some more hard drives.

Monday, January 8, 2007

Hinterland Ho's Ho?

Through Jeff MacArthur, via Mike Lazazzera, I bring you the funniest video I've seen this year. It's a fantastic spoof of those classic Hinterland Who's Who videos that always used to run on TV when you were a kid.

A few years ago, I wanted to see if my company was monitoring internet usage by downloading "Beaver.mpg". Nobody ever called me on it, but I kept the file around just in case I had to back up my story. I guess they've reorganized the website since the last time I went doesn't seem to have the same censor-inviting ring to it.

24 Season 6

Word on the street is that the first four episodes from 24 Season 6 (not intended to be aired until the 14th of January) have been leaked onto the intarweb. Now, should you choose to seek to obtain said episodes, that is your business, and even if I knew how to do such things, I wouldn't say so here. Harumph.

Rumours also flying around (I heard from somebody who might have watched them tonight) is that starring in at least two episodes is Canada's own Shaun Majumder, and in at least three episodes, Star Trek: Deep Space Nine's Siddig El Fadil a.k.a Alexander Siddig. I don't want to give away any plot elements here, so I won't say what roles they're in.

The proposed story line is (no surprises here) that some middle-eastern-looking gentlemen are looking to blow up something American, possibly using nuclear weapons.

Personally, I'm looking forward to Jack Bauer killing various people of all races and creeds. I can't get enough of this shit.

Bauer / O'Brian '08

Thursday, January 4, 2007

Is the Noodle Nook finally opening?

The Noodle Nook

Hopefully, the Noodle Nook on Blowers Street is finally going to open after a lengthy time when nothing was visible inside the place. When I walked by yesterday, however, I noticed some actual woks inside. Maybe that means something?

Woks-a-plenty Is it really?