My Azure Resources List


Just throwing out some resources I like to reference for windows azure.


Blob Storage Explorer – CloudXplorer

Web based Table Storage Explorer

Windows Azure Service Management CmdLets

Cloud Storage Studio

HedgehogDev Azure Cloud Application Monitor

Azure Tool kit for Facebook

Lokad Cloud – Cloud Platform Abstractions cool stuff like Auto Scaling.

Install Azure

Web Platform Installer


Steve Marx – Microsoft Azure Dude

Cloud Cover – Channel 9 Videos on Cloud Platform

Azure Training Kit

Azure Deployment for your Build Server

Inversion of Control vs Dependency Injection vs Strategy Pattern


Warning this my understanding as of today, who knows what tomorrow will bring.

I often hear the terms Inversion of Control(IOC), Dependency Injection(DI) and the Strategy Pattern thrown around in the same context, this was getting really confusing for me. So, I spent a couple of hours trying to clarify the differences.

IOC vs DI: Basically DI is a type of IOC. IOC is a broad abstract principle that covers not only DI but Event-Driven programming and numerous others.

So What is DI? DI is the way you provide the implementation for a dependent service. There are a number of DI frameworks out there I have recently been playing with Ninject mostly because I like ninjas... and the flow syntax for wiring up the dependencies looks nice.

DI vs Strategy Pattern: For a while now I have been using the Strategy pattern thinking it was the same as DI. I know, "Gosh such an idiot :p", but DI assembles the appropriate algorithms for the calling class. Strategy is just one of the patterns that lends itself well to DI.

More Info:

Dependency injection

Inversion of control

Inversion of Control Containers and the Dependency Injection pattern by Martin Fowler

Inversion of Control vs Strategy Pattern

IoC containers are not about a design pattern

Thank you, Eric Ridgeway for answering my 200 questions.

Interview Questions - Fibonacci


I found a interesting interview questions that is most likely a bit over done, but I still like it, it reminds me of my intro to programming classes from back in the day, which for me was only about 5 years ago. This one concerns the Fibonacci Numbers. The problem is write the Fibonacci Sequence without Recursion. With Recursion the fib sequence is relatively easy:

public static int GetFibValueRecursive(int place)
     if (place <= 0) return 0;
     if (place == 1) return 1;
     return GetFibValueRecursive(place - 1) + GetFibValueRecursive(place - 2);

First step to this problem I would write a test to make sure my code is correctly solving the problem.

public void GetFibValue_GivenPlace_ReturnCorrectValue()
     Assert.AreEqual(0, Fibonacci.GetFibValue(-1));
     Assert.AreEqual(0, Fibonacci.GetFibValue(0));
     Assert.AreEqual(1, Fibonacci.GetFibValue(1));
     Assert.AreEqual(1, Fibonacci.GetFibValue(2));
     Assert.AreEqual(34, Fibonacci.GetFibValue(9));
     Assert.AreEqual(144, Fibonacci.GetFibValue(12));           

Then the code.
public static int GetFibValue(int place)
     if (place <= 0) return 0;
     int previous = -1;
     int result = 1;
     for (int i = 0; i <= place; ++i)
         int sum = result + previous;
         previous = result;
         result = sum;
     return result;

Bam! The Fibonacci Sequence without recursion of course if you wanted more than just a value for given place I would write it a little different perhaps return a list of values instead of a single value. (71.66 KB)

Post Seattle Code Camp


I spent my weekend attending Seattle code camp sessions. I learned a lot, but one of the biggest things I learned is how much I still don't know. My experience as a developer is limited I have yet to reach 2 years developing professionally and I am still in school currently working on my last quarter for my BS. I like to think that I am a good developer but speaking to people at the code camp is a nice ego check and I still have a long way to go before I can reach the status of elite alpha geek. My goals as a developer this year is to really dive into WCF and to study the code put out by the Patterns & Practices guys at Microsoft, specifically the Enterprise Library and Smart Client. What I really need is a chip I can insert behind my ear and just download the knowledge and experience I need, I cant seem to consume information fast enough otherwise.

One thing I would like to know is the process of how other people obtain deep knowledge of a subject not just an overview.  I am open to opinions please give me your 2 cents by Email or leave a comment.

Seattle Code Camp


Seattle Code Camp on Jan. 26th from what I hear it is a little smaller than most but seems to have some good content. The schedule includes speakers such as William (Bill) Vaughn and Phil Haack. Most of the tracks covered will pertain to .Net but there are a few Java sessions as well.

The following sessions look interesting to me:
Rethinking Unit Testing:
Data Enhancements in Visual Studio 2008
Windows Application Enhancements in Visual Studio 2008
Visual Studio Reporting
An Introduction to Windows Communication Foundation
Black Belt DSA, building Duplex Agents
The Web via WCF
LINQ Overview

using Statement


The using Statement is simply syntax sugar for a try finally block. If you instantiate an object that implements IDisposable you can make your code look cleaner with the key word using.
StreamWriter sw = File.CreateText(filePath)
The above block works the same as:
using(StreamWriter sw = File.CreateText(filePath))
More Info:

Singleton Pattern


The singleton pattern in C# is very simple to implement and very useful. This pattern ensures that there is only one instance of its self providing a global point of access. There are different ways of doing this but I like to use the example below  because it is thread safe and clean.

public class User
     private int _userId = 1;
     private static User _instance = new User();
     static User()
     private User()
     public int UserId
             return _userId ;
             _userId = value;
     public static User Instance
             return _instance;

Here is a quick test I wrote in NUnit that shows how it is used and comfirms there is only one instance.

public void TestSingleton()
     User sngle1 = User.Instance;
     sngle1.UserId = 1;
     User sngle2 = User.Instance;
     sngle2.UserId = 2;
     Assert.AreEqual(sngle2.UserId, sngle1.UserId);

More Info:
Everything you need to know about C# singleton.
More Patterns

Eponymous Laws Of Software Development


Do you want to sound smart, impress your friends, increase your chances of scoring next time you go out on a night on the town? Take a look at Phil Haack's blog post on 19 Eponymous Laws Of Software Development.

My Favorites are Sturgeon's Revelation Ninety percent of everything is crud (it seems to me to have a duel meaning crud = Create Update and delete or crud = crap) and Hofstadter's Law A task always takes longer than you expect, even when you take into account Hofstadter’s Law.


Getting Started with .Net Development


I am really impressed with the amount of developer support being put out by Microsoft; everything you need to get started is pretty much free. You can download the Express version of Visual Studios and it gives you a majority of its big brothers features which is 300$ IDE, the most notable difference is that the express version is not pluggable. There are different flavors of Visual Studio express, one for windows, web with AJAX, hardware/robotics and game /XNA development.  Although the free IDE is nice and I use visual studio as my primary development tool I am totaly blown away with the amount of resources available for learning. I am not talking about the MSDN Library, most of the time the MSDN documentation just confuses me, but webcast live and On Demand, podcasts and virtual labs are fantastic. There is tons of time worthy information put up here for beginning and advance programmers. It’s the first place I go to when I am trying to learn a new technology. I hear a lot of trash talked about Microsoft everywhere I go but I feel they have the best development support out there.

How do I learn?


    I was at school the other day talking to a class mate he was admitting to me that some thing big needs to change in his life. He was about to graduate with a BS in Software Engineering and he all ready has his AAS in Software Application Programming, but he still did not have confidence in his abilities as a programmer. This made me think; we started school at the same time with about the same skill level. Why has my skill and confidence in them surpassed his? I believe it has to be because I strive to find and consume knowledge in multiple ways.
    I regularly listen to podcasts and watch webcast. I am also subscribing to multiple blogs from people I believe to be successful and knowledgeable programmers. I always have at least one book that I am reading that is related to the field. I attend classes on programming as well as try to instruct others on techniques through my blog as well as in person. On top of my work, I always have a side project going on that allows me to practice new and interesting technologies. That seems like a lot and it is, but I enjoy it. I guess that is the real answer, you have to enjoy it to be proficient at it.