Wednesday, November 15, 2006

I am halfway through my vacation in the Caribbean and right now I am sitting on a beach in St. Maarten having some kind of Guava alcoholic beverage.

Last Saturday, I asked my girlfriend to marry me and she said yes! Pictures to come later.

Wednesday, November 15, 2006 4:42:47 PM (GMT Standard Time, UTC+00:00)  #    Comments [7]  | 
Sunday, November 05, 2006

There will be no spoilers in this post. I'm not that kind of guy.

Today Catherine and I went to see the movie Borat (Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan). This movie was one of the funniest movies I have seen in a long time.

The way that Sacha Baron Cohen portays another culture coming into a new country, really shows how oblivious the western world is to other cultures. Kazakhstan is taking the movie in stride (they get it), but the brilliance of this movie is how it portrays some of the radical extremes in the United States using a character who is oblivious to absolutely everything.

So if you are like me and only see one movie a year (because you are playing too much buzkashi), go see Borat.

Fun
Sunday, November 05, 2006 6:00:44 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Wednesday, November 01, 2006

Navigating in the Solution Explorer

Ctrl + Alt + L: Open the Solution Explorer (the most important one).

Esc: Return focus to the coding window (hides the solution explorer).

Up Arrow: Move up between nodes.

Down Arrow: Move down between nodes.

Right Arrow: Expand current node.

Left Arrow: Collapse current node.

Solution Explorer Project Actions

Ctrl + Shift + A: Add a new item (project must be highlighted).

Shift + Alt + A: Add an existing item (project must be highlighted).

Alt + P + R: Add Reference to the current project.

Alt + P + E: Add Web Reference.

Alt + P + A: Set the current project as the starup project.

Alt + P + P: View the current project's properties.

 

If you have any others related to the solution explorer windows please post them in the comments.

Wednesday, November 01, 2006 12:01:29 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 

Esc: Closes any of the windows below and returns focus to the code.

Ctrl + Alt + S: Open the Server Explorer.

Ctrl + Alt + L: Open the Solution Explorer.

Ctrl + Shift + C: Open the Class View.

Ctrl + Alt + J: Open the Object Browser

F4: Open the Properties window.

Ctrl + Alt + X: Open the Toolbox.

Shift + Alt + Enter: Go fullscreen.

If you have any others related to viewing and opening windows please post them in the comments.

Wednesday, November 01, 2006 12:00:45 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Friday, October 27, 2006

I have started using Team System at work and I stumbled upon the built in functionality to generate a unit test for a private method. At first I thought it was sweet that you could test private methods but then after going for a walk, I have come to the conclusion that this is not a good feature.

Someone has probably complained about this before but is there a situation where you would use a private method that is not eventually called by a public or protected method that is itself testable? Shouldn't you test the public or protected method to see if your private method is called and returns what you are expecting? I am going to avoid using this functionality until I find a valid reason to use it.

Friday, October 27, 2006 6:42:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [2]  | 
Tuesday, October 24, 2006

It took me 46 episodes to discover it but Geekdrome is an awesome podcast. From their site: "Two geeks debate movies, comics, music and video games while ripping each other new ones... or re-ripping each other fresh ones."

Over the past couple days I have found myself watching this over regular television.

Fun
Tuesday, October 24, 2006 4:43:14 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 

This is a follow up to the short Rhino Mocks presentation I did tonight at EDMUG.

Remember, the purpose of a tool like Rhino Mocks is to test the interactions between 2 objects.

You can find the download for Rhino Mocks here: http://www.ayende.com/projects/rhino-mocks.aspx

The source code for the presentation is here: http://www.stevenrockarts.com/code/UserGroup.rar

I have also included the syntax to create mocks in VB.NET and C# in.NET 1.1 and 2.0 .

If you have any questions about Rhino Mocks at all, feel free to send me an email using the contact information on this page or leave a comment.

Tuesday, October 24, 2006 4:18:41 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 

One of my favorite record labels has to be NinjaTune. Not only do they have cool artists such as Bonobo, Kid Koala, Amon Tobin and Yppah on their label they also make their artist's music available for purchase in high quality MP3 DRM free! Why can't all music be like this?

[ Currently Playing : Transmission 94 (Parts 1 & 2) - Bonobo - Days To Come (07:57) ]

Tuesday, October 24, 2006 3:46:56 AM (GMT Standard Time, UTC+00:00)  #    Comments [2]  | 
Saturday, October 21, 2006

Many people are familiar with the handy Open Command Window Here powertoy for Windows but did you also know that there are Visual Studio Add-Ins that do the same thing right from inside VS.

If you are using Visual Studio 2005 check out Cool Commands 3.0 for Visual Studio and if you are using Visual Studio 2003 check out Solvent. To use them you right click on your project and select the Open Command Prompt here option and you get a command window in the same location as that project.

While I am on the subject of developer tools I should mention that I will be presenting on Rhino Mocks along with a bunch of other talented developers at the Edmonton .NET User Group October meeting this Monday.

Friday, October 20, 2006 11:46:22 PM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
Sunday, October 08, 2006

A lot of complexity in programs comes from complex if-then-else statements. If it takes you a long time to read and understand an if-then-else statement you should take a look at the Decompose Conditional refactoring.

To show you how powerful this can be, from the example below choose which code you think is easier to understand:

Public Sub ProcessPayment() If _view.PaymentType = PaymentType.Cash Then 'payment type is cash Try _task.SaveCashPayment(_view.Amount) Catch ex As Exception _view.ShowMessage("There was a problem saving the payment.", False) End Try _view.CloseView() End If Else 'payment type is credit card If PreAuthorized(_view.Amount)) Then Try _task.SaveCreditCardPayment(_view.Amount) Catch ex As Exception _view.ShowMessage("There was a problem saving the payment.", False) End Try _view.CloseView() End If End If End Sub

Or this code:

Public Sub ProcessPayment() If PaymentTypeIsCash() Then SaveCashPayment() Else SaveCreditCardPayment() End If End Sub

In the first block of code, notice how it takes you a long time to figure out what the code is trying to accomplish while the second block of code reads like a couple of lines of comments.

Also, notice how the first block has a lot of code duplication. Once the SaveCashPayment and SaveCreditCardPayment are moved into their own methods it is a lot easier to recognize this duplication and refactor it

If there are other ways you can think of to refactor this code please post in the comments, I am always looking for ways to make code better.

Update: Check out Jean-Paul Boodhoo's response on how to further  refactor this code.

 

[ Currently Playing : Reign On - The Brian Jonestown Massacre - Bringing It All Back Home Again (4:31) ]

Sunday, October 08, 2006 5:10:59 AM (GMT Standard Time, UTC+00:00)  #    Comments [3]  | 
Tuesday, October 03, 2006

The NHL season starts tomorrow, I can’t wait (even if Toronto is the first game on).

I am feeling pretty good about the team I drafted for my hockey pool. They are a young team but I think they are all going to have great seasons. Comments and criticism welcome:

Eric Staal

Rick Nash

Patrice Bergeron

Justin Williams

Marek Svatos

J.P. Dumont

Nathan Horton

Glen Murray

Steve Bernier

Raffi Torres (can’t go wrong getting Raffi this late).

Patrick Eaves

Tuesday, October 03, 2006 6:58:04 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 

Overall, I think that the Edmonton Code Camp was a huge success. I remeber talking with my co-worker Anand about starting one and at the time it seemed to me like it was not possible.

DSC00646

 Fast forward a couple of months later to a .NET Wizards meeting with John Bristowe. John came up to me before the meeting and gave me some ideas to help get the code camp ball rolling.

DSC00650

With the help of the guys at EDMUG, our speakers and our contributors over the months leading up to the code camp it all came together.

Some things that I will do different next year based on the comments

- Change of venue. 1 meth addict walking into the room is 1 too many.

- Rate presentations on the 100, 200, 300, 400 scale. This was something simple I could have done but forgot to do.

- More coffee, investigate airborne caffeine. This was the best I could do.

- Do a trial run with projectors. The projector troubles of the Edmonton Rails Group is entirely my fault. I apoligize!

- The thing that I regret the most about the code camp is the way the swag give away at the end went down. I had no idea that security would kick us out the way they did. I worked hard getting the books and swag and I was looking forward to seeing who would get each item but this was not possible due to time constraints.

I was very happy with the attendance and the patience of the attendees. One thing I didn't expect was Lee to bring a shuttle PC to the event:

DSC00653

DSC00647

DSC00649

DSC00648

Lastly, thank you to all the speakers! Everyone exceeded my expectations in their presentations.

DSC00639

DSC00657

DSC00654

DSC00655

DSC00652

DSC00651

DSC00641

If you would like to check out the rest of my pictures from the code camp you can check out the Edmonton Code Camp Flickr photo set. The code camp is also going to be podcasted on Developer Night in Canada so subscribed in your favorite rss reader and keep an eye on it.

If there are any other questions, comments or concerns about the code camp, please leave a comment here and I will see what I can do.

 

Technorati Tags: - -

Tuesday, October 03, 2006 6:16:49 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 

I was going to do a screencast to show people how to install RubyCLR, but if you are familiar with Ruby gems John Lam released an experimental Ruby gem that will take care of installing RubyCLR for you.

Tuesday, October 03, 2006 12:22:27 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: