Applying the Decorator Pattern to a DataGridView

In this article, I present a simple example of how you can apply the Decorator Pattern to a DataGridView to extend its behavior without using inheritance. This article is not meant to be a tutorial on the Decorator Pattern. Rather, it is just a brief explanation of how I solved a particular design problem using a variation of the Decorator Pattern. With a bit of thought, the reader should be able to apply my design pattern to decorate other types of visual controls and components from the .NET Framework such as Button, CheckBox, ComboBox, Label, ListBox, ListView, Panel, TextEdit and TreeView.
Continue reading » Applying the Decorator Pattern to a DataGridView

Pages: 1 2 3 4

Visible Whitespace in Visual Studio

Of late, I have been coding in C# using Visual Studio 2005.  One day while merrily going about my way, I must have accidentally hit the Control key and some keys.  A little known “feature” was discovered.  All my spaces turned to “dots”.  Apparently, this is called the visible whitespace feature.  I’ve seen (and used) it in Word, but have never seen it in a code editor.

Unfortunately, my code became highly unreadable in this format.  I tried looking through the dialogs to see if I could find ways to turn it off to no avail.  Finally, I found this article to be of much help:

Ctrl-E-S does the trick apparently.  It turns on and off this feature.

The First Beer of the Vancouver 2010 Olympics

I did it! I ordered the first beer of the Vancouver 2010 Olympics! But how do I know it was the first beer sold at the Olympics? Read on and see if you can follow my logic.

The First Beer of the Vancouver 2010 Olympics

The First Beer of the Vancouver 2010 Olympics

My brother and I were in Whistler yesterday for the first official event of the Olympics: the Men’s Normal Hill Individual Qualification Round. We took the first bus of the day from Vancouver to Whistler and arrived in the parking lot just past 7 AM. We then cleared security, hiked up the hill to the venue and took a few obligatory photos.

Just before 8 AM, my brother Kevin suggested that we get a beer to celebrate and get the party started. We strolled up to the concession stand and enthusiastically said “Two beers, please!”

The concession stand personnel were flabbergasted! “Are you sure you want a beer?”, they asked?

“Absolutely!” we replied.

Dumbfounded, they said, “Wow, you’re the first people to order a beer from us! Everyone else is ordering coffee!”

Admittedly, it may seem a bit weird to order a beer at 8 AM. But this is Canada and these are the Olympic Games! How could we order anything but a beer?

After some grinning and laughter, the ladies gave us our beers: two Molson Canadian, the official beer of the Vancouver 2010 Olympics.

We cracked them open immediately and savoured our first glorious sip of Molson Canadian amongst the stunningly beautiful setting of the Callaghan Valley. And without a doubt, that was the best sip of beer my brother and I had ever experienced in our lives.

Seconds later, it dawned on me that I must have ordered the first beer of the Olympics. After all, this was the first event of the Olympics and the concession personnel said I ordered the first beer of the day. Ergo, that must be the first beer of the Olympics!

I turned to my brother and yelled, “We got the first beers of the Olympics! We got the first beers of the Olympics!”

This yelling caught the attention of my fellow spectators and consequently, several started snapping photos of us. Here is one such photo, with me on the left and my brother on the right.


Me, Joe, and My Brother, Holding the First Beers Sold at the Olympics

Just to make sure we got the first beers, we had a look around to see if anyone else was drinking a beer. We didn’t see anyone drinking a beer. Furthermore, when we went back to get two more beers a few minutes later, the concession stand personnel said, “Sorry but we’re not allowed to sell any beer until 9 AM.”

So, I guess we got lucky. Being proud Canadians, maybe we were destined to get the first beers? I’m sure if Don Cherry were there he would have said, “Those are two good Canadian kids, right there, eh!”.

What could be more Canadian than two brothers drinking Molson Canadian at a winter sporting event?

Although thousands of spectators will be buying and enjoying Molson Canadian during the Olympics, no one else can say they bought the first beers of the Olympics. That simple act of buying those two beers was like the beer version of the Opening Ceremonies.

I close this post by proudly saying:

My name is Joe and…I…AM…CANADIAN!

How to Play Streaming Videos on a Sony Bravia KDL-46W5100 TV

On Boxing Day I finally gave into a long held desire; I purchased a big, flat-panel TV. After checking the thickness of my wallet (or rather, the lack thereof) and doing some online research, I settled upon the Sony Bravia KDL-46W5100 LCD TV.

I won’t review the TV in this post. If you’re interested, check out CNET’s review or the Future Shop’s customer reviews. Needless to say, I’m very happy with my KDL-46W5100, especially considering the low price I paid on Boxing Day.

The real purpose of this post is to show you how to stream videos to a KDL-46W5100. Continue reading » How to Play Streaming Videos on a Sony Bravia KDL-46W5100 TV

Pages: 1 2 3 4 5

Page 10 of 26« First...89101112...20...Last »