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]  | 
Sunday, October 01, 2006

I had a lot of fun presenting to everyone today but now that the presentation is complete I can point you to some good RubyCLR references!

The first site I recommend that you visit is the homepage for RubyCLR at http://www.rubyclr.com/ here you will find the RubyCLR download and instructions on how to install RubyCLR. I am going to make an additional screencast on how to install RubyCLR and post it on this blog so stay tuned!

I will also point you to John Lam's blog where he has a great article called Fun with const_missing and method_missing, this article explains the magic behind RubyCLR. I mentioned this in the presentation but I think I didn't emphasize how important this really  is!

Another good resource is John's presentation at the Lang.NET Symposium.

Here are the completed (and error free) code files and the screencasts for my part of the presentation: CollectionsDemo/CollectionsDemo Screencast  LinqExample/LinqExample Screencast. Please note that in the CollectionsDemo screencast it should be require 'rubyclr' not require 'rubclr'. If you are new to Ruby please watch my co-presenter Justice give an intro to the Ruby language beforehand.

I encourage you to check out the samples in the sample folder when you install RubyCLR. There are some great examples that show using WPF and ActiveRecord.

The other efforts to unite Ruby and .NET are IronRuby by Wilco Bauwer and Ruby.NET by the Queensland University.

And, last but not least is my powerpoint for the presentation. If you have any questions, my contact information is on the slides, feel free to give me a shout.

 

Technorati Tags: - - - - -

[ Currently Playing : Nothing Owed (live) - Bonobo - Live Sessions -EP (6:24) ]

Sunday, October 01, 2006 6:14:25 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Saturday, September 30, 2006

Tonight we put together the swag bags (hey that rhymes) for the Edmonton Code Camp. Some choice quotes:

"Hey, now that were done this, I can finish my presentation."

"I can't keep up to the guy in front of me, I am going to have to start eating the bags, like in I Love Lucy."

"Holy shit."

"Don't knock over the scotch with the swag."

"I need to spend some quality time with my wife."

In case you signed up and you were not planning on attending the code camp tomorrow, this is what you are missing (note the copious amount of swag):

Saturday, September 30, 2006 5:31:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
Friday, September 29, 2006

Tonight at Edmug we had Jean-Paul Boodhoo give a talk about the MVP pattern. Although I voted for PEAA and because we use the MVP pattern  at work, I was a bit disappointed that MVP won, however I still found the presentation to be very informative.

There is always an opportunity to learn something new when JP presents, so if you are a user group he has recently been added to the MSDN speakers bureau so bring him to your group on MSDN's dime!

Friday, September 29, 2006 5:53:15 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
Monday, September 25, 2006

This weekend, Catherine and I participated in 2 charity walks this weekend. The first one was the Superwalk for Parkinson's. The Parkinson's Superwalk was extra special because of the passing of my Grandpa last week.

DSCF0705

Thanks to everyone who was kind enough to donate, Catherine and I managed to raise over $1,000 for Parkinson's research, hopefully next year we wont have to! If you would still like to donate you can still sponsor me using the instructions here.

Today, Catherine and I also participated in the 15th Annual HIV/AIDS Walk for Life. We decided to bring along Daisy along for the walk and she got pretty tired after 1km so I ended up having to carry her for the rest (4km) of the walk.

 

 

Technorati Tags: - - - -

Monday, September 25, 2006 6:03:59 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
Friday, September 22, 2006

Recently I installed Windows Vista and I noticed that after installing it all of my purchased music from  iTunes was gone (kind of). Normally this wouldn't be an issue but I had bought the entire U2 library and I can't lose that!

When you install Vista overtop of Windows XP, everything is moved to a folder named Windows.old. For some strange reason, the new search in Vista will not search Windows.old!

To restore your purchased music go to C:\Windows.old\Documents and Settings\Your Old UserName\My Documents\My Music\iTunes

Copy all of the folders in here to C:\Users\Your Username\Music\iTunes

Next in iTunes go to File->Add Folder to iTunes and select C:\Users\Your Username\Music\iTunes this will add all of the files to iTunes. You will have to re-authorize the files to play on your new installation of Vista. If there is an easier way please let me know! You only have to re-authorize it once.

 

[ Currently Playing : The Entire Purchased Library of U2]

Friday, September 22, 2006 2:21:13 AM (GMT Standard Time, UTC+00:00)  #    Comments [2]  | 

Theme design by Jelle Druyts

Pick a theme: