August 2011 Blog Posts
Grace Potter and the Nocturnals – Big White Gate (Live)

Sometimes you come across a band and wonder to yourself “where the hell have they been, how did I miss this?” and this, for me is one of them.

They are on tour for their current album (which I actually don’t like as much as their 2007 release, which is why I’m posting this one), and I actually looked into driving 10+ hours to see them, but it doesn’t work out.

Anyway, damn can she sing.

Saint peter won't you open up the big white gate
Cause i heard about forgiveness and i hope it ain't too late
I ain't no holy roller but you go tell your king
That all the folks up in heaven might like to hear me sing


posted @ Sunday, August 28, 2011 7:28 PM | Feedback (0)
Repost - Insane Moron Draws Conclusion From NFL Preseason Game


posted @ Friday, August 26, 2011 9:47 AM | Feedback (0)
Tilting at Windmills Award of the Week: Reference Architecture Foundation for Service Oriented Architecture Review announced by OASIS

Holy crap.

posted @ Wednesday, August 24, 2011 1:05 PM | Feedback (0)
Misheard Lyrics – Pearl Jam – Yellow Ledbetter

After spending a week’s vacation in Canada with my family (Kingston, where I was born, Montreal and Quebec City….I’d never been to Quebec City, and especially enjoyed it), I was driving my sister and her husband to the airport when this song came on the radio and we all began ‘singing’ it, which of course meant muttering random and incoherent sentences, because no one can really tell what the hell Eddie Vedder is actually singing.

Anyway, she forwarded to me this video which explains it perfectly.  As one commenter said, “whats so hard to understand that he doesnt want a whale in a box or a bag”.


posted @ Wednesday, August 24, 2011 11:29 AM | Feedback (0)
Craptastic Tekpub Account Setup

One would think one would try to follow even basic practices for this sort of thing.

So, I went back through the fantastic process of trying to buy the Full Throttle – TDD Brad Wilson Rocks episode, and managed to do it, though it required emptying out my shopping cart as it initially said I wanted to purchase 4 of them.

After setting up my account through the fantastic process, after the purchase, I got an email saying (paraphrasing) “Hey, we setup an account for you based on your email, here’s the bizarre password we created initially, you might want to change it.”  This is decent enough, bizarre initial password is fairly normal.  So, I clicked on the link that got me to the page that lets me change the password.  All good.  Password changed.

Then I get an email from Tekpub saying “We just updated your password for you! If this wasn't you it means there was some kind of mischief afoot!”

With no link whatsoever in case it hadn’t actually been me changing the password.

What the fuck?  Seriously?  What if there had been “mischief afoot”?  What’s the process?

Here’s a little tip to anyone who might want to set up a store.

There’s this web thing called Amazon.  You might not have heard of it, it’s not that popular.  But, at least in some circles, it’s known.  It is accepted that not everything this little web store called Amazon does is perfect, but, in general, it seems to follow some practices that seem to be halfway legit.  You might want to think about following them unless you have reason to diverge from it.

Just a thought.

At least I have now downloaded the TDD “for real, except it is part of a webcast that by definition probably isn’t for real” episode.

Seriously, this isn’t 1998.

posted @ Tuesday, August 23, 2011 10:06 PM | Feedback (2)
Buying something off of Tekpub kind of sucks

Based on a previous post and a recommendation, I’ve decided to take a look at the Full Throttle – TDD with Brad Wilson session to see if I can be convinced that my hatred dislike of TDD can be changed, or, more likely, that I can at least see how it is done ‘for real’, whatever that means.

Whenever I have the ‘opportunity’ to purchase something, I tend to ‘dick around’ (technical term) on a site I’m not familiar with to see how it works before I click that buy button.  Tekpub seems to be pretty bad in general from what I’m familiar with.

From the home page, you can find what you want pretty easily.  Or at least, since I knew what I was looking for (the TDD session), it was easy to find.  Once I found the session, I clicked on the happy ‘buy now’ button.

The resulting page is pretty terrible.  Other than the URL saying it was a cart page, the design of the page is lousy.  There’s an unstyled ‘remove’ link that you wouldn’t know was a link.  The checkout button is pretty obvious, so I clicked that.

Immediately, I’m confronted with a page that appears to ask for my Tekpub account email address.  Well, I don’t have one.  So, what do I do here?  Leave it blank and then fill in the billing address information and click ‘Continue to next step’?  I shouldn’t have to even think about this.  I don’t like this, it makes me suspicious, let me go ahead and get out of this page and back to home.  Very weak link for that, but okay.

Hmm, I’m on the home page now.  There is no indication that I have added anything to a cart, or that I even have one.  Let me go ahead and confront my silly fear of the weird cart system, and click on the full throttle item again.

That’s nice.  Back to the same page with the lame picture and decent description.  Let’s click on the ‘buy now’ button again.

Okay, wait a minute.  The total appears to suggest that I’m interested in buying two of ‘Full Throttle’.  There’s still the lame unstyled ‘remove’ link, but no indication of a quantity.  This is a video subscription site, isn’t it?  Why would I want to buy two ‘Full Throttle’ items?  What does it mean to buy two of them?  The ‘terms and license’ section is cutesy, but amateurish, especially since the cart is a joke.

I click on the ‘checkout’ button, back to the horrible page that has no quantity value and asks for an email address.

Fuck this.  Maybe I’ll try another day, but this is horrific usability. 

I note that it is through ‘shopify’, so strike them off my list of any company I want to work with.

posted @ Monday, August 22, 2011 9:18 PM | Feedback (0)
Why do I have to use NuGet?

NuGet is Microsoft’s attempt to copy Ruby gems, as far as I can tell.  Great.  All for it.

But why is it that I have to use it, instead of getting the option to install normally through some MSI or other option?

Maybe I’m missing something, but if I want to install, say, EF 4.2 Beta 1, why can’t I have an option to install it globally, as opposed to having to install it within some specific project/solution?  I’m using a Microsoft release as an example, but I could just as easily use, e.g. AutoMapper as an example.

While I like the NuGet option, I don’t want to have to install things repeatedly across multiple projects if it is something I know I want across the board.

posted @ Monday, August 22, 2011 8:53 PM | Feedback (7)
Does anyone actually do TDD?

Obviously, the answer is yes.  The person who first convinced me that “all that agile stuff” was really the direction to look towards (note, that’s “a direction to look towards”, not “embrace uncritically”, but I digress) practiced it.  Or at least, he always had his NUnit test runner up, and I could tell when he was too busy to chat by looking at the status of his tests (when they were all green, I figured he was probably goofing off).

I ask the rhetorical question though based on the lead to one of Rob’s posts:

“One thing I've never seen anyone do, for real, is Test-driven Development. We've all sat through the demos of "Red, Green, Refactor" and the To-do list - but never have I seen the presenter do something "Real". That changed last week and it was pretty fun.”

Wait a minute.  I’m confused.  Isn’t Rob a practitioner of TDD?  I swear he did some stuff back when he was at Microsoft, something about an MVC storefront…hmm, isn’t this it?:

“I'm creating an ongoing series of webcasts and blog posts, documenting the building of an eCommerce storefront using ASP.NET MVC. It's important to understand that this application has not been built yet - you're gonna help me do it :).

The goal is to build this application as openly, and "currently" as possible using an Agile approach with TDD.”

Yeah, I thought so.

Now, to be clear, this fits quite nicely with another comment that Rob himself made in another post:

“TDD is a design process - not a coding process. Anything with the words "design" and "process" unavoidably are spawned from a theory, and invariably there are those who the theory works for who have the "Sudden Ray of Light" and think that you should have this too. And as with every theory there are the workers who kick some of the theory to the curb in favor (in their eyes) getting some work done.

I'll summarize my point by saying that TDD is discussed far more than it is applied”

One of the common comments I’ve seen in blog posts by people who have embraced TDD (or at least attempted to do so) is something along the following: “I’ve been doing TDD for a year or so now and what I’ve discovered is that I’ve been doing it wrong.”

This fits in nicely with something I’ve talked about for a long time.  Having tests for your code, speaking generally, is a good thing.  Doing TDD itself is not.

I suppose I should pay the $12 and watch the session Rob did with Brad to see how it went.

posted @ Sunday, August 21, 2011 8:06 PM | Feedback (2)
Software Development Troubleshooting Tip #2: When dealing with a large organization

This actually applies to migrations as well.

I’ll leave ‘large organization’ vague…let’s make up a number and say if your entire software team (including developers, testers and support personnel) is greater than 20, it qualifies.

I’ve seen some organizations do this well, and others…not so much.

If you have a critical production issue, you should have two separate call lines, one dedicated to upper management, and the other dedicated to the people actually trying to fix the problem.  One person should be available on both lines, all others should be kept separate.

The reason for this is fairly simple.  When upper management is on the same line as the people looking to find root cause and determine a fix, you inevitably end up having to try to explain everything that you are trying to do to upper management, often in terms they don’t understand.  Furthermore, every time the people trying to find root cause and determine a fix are discussing various items, upper management interjects at almost every turn.

Let the people who are trying to fix the issue, fix the issue.  Since upper management is often involved in large organizations with critical production issues because they have to report up to even more upper management, have a separate line where they can be given status updates without interfering.  Then designate someone (usually a project manager) to monitor both lines and keep everyone informed.

This makes a huge difference in getting problems resolved swiftly, while also allowing proper reporting of status to flow where and when needed.

posted @ Wednesday, August 10, 2011 8:14 PM | Feedback (0)
Implementing multiple joins using EF

From Rob’s post, I decided to double-check how you would transform his ‘semi-complex query’ into EF syntax and see what the resulting SQL was. 

His initial query was:

var results - DynamicModel.Open(connectionString).Query(@" 
SELECT Orders.OrderNumber, Categories.Name FROM Products 
INNER JOIN Categories ON Categories.CategoryID = Products.CategoryID 
INNER JOIN OrderItems ON OrderItems.ProductID = Products.ID 
INNER JOIN Orders ON Orders.OrderID = OrderItems.OrderID 
WHERE Orders.OrderDate > @0", DateTime.Now.AddYears(-1));

Now, I have no idea what database he was hitting against.  To make it easy, I decided to run it against our BFF Northwind, and so I had to reformulate it as follows:

SELECT Orders.OrderDate, Categories.CategoryName FROM Products 
INNER JOIN Categories
ON Categories.CategoryID = Products.CategoryID 
INNER JOIN [Order Details]
ON [Order Details].ProductID = Products.ProductID 
ON Orders.OrderID = [Order Details].OrderID 
order by orders.OrderID, Categories.CategoryName

Since it wasn’t relevant, I left off the the where clause (our BFF Northwind has order dates from 1996, etc.).  This query returns 2155 rows.

I created a simple console application and created a simple EF model from our BFF Northwind.

The equivalent EF query is this:

var db = new NorthwindEntities();
var results = (from o in db.Orders
join od in db.Order_Details on o.OrderID equals od.OrderID
join p in db.Products on od.ProductID equals p.ProductID
join c in db.Categories on p.CategoryID equals c.CategoryID
select new {o.OrderDate, c.CategoryName}).ToList();

This also returns the same 2155 rows.

Two things of interest:

Look at the beginning of the C# code:

from o in db.Orders
join od in db.Order_Details on o.OrderID equals od.OrderID

In a normal SQL statement, on an inner join, the order of the statements is irrelevant.  But, in C# if you reverse this statement to:

join od in db.Order_Details on od.OrderID equals o.OrderID

the EF query won’t compile, so the order does matter.

The resulting SQL run on the server is this:

[Extent1].[OrderID] AS [OrderID],
[Extent1].[OrderDate] AS [OrderDate],
[Extent4].[CategoryName] AS [CategoryName]
FROM    [dbo].[Orders] AS [Extent1]
INNER JOIN [dbo].[Order Details] AS [Extent2] ON [Extent1].[OrderID] = [Extent2].[OrderID]
INNER JOIN [dbo].[Products] AS [Extent3] ON [Extent2].[ProductID] = [Extent3].[ProductID]
INNER JOIN [dbo].[Categories] AS [Extent4] ON [Extent3].[CategoryID] = [Extent4].[CategoryID]

Even though the select in the EF query doesn’t include OrderID, it is included in the SQL that gets executed.  Interesting.  I feel like I should know why, but I don’t.

Since I’m lazy, I won’t put in the specifics of adding back in the where clause.  There’s some interesting things there as well, but it returns the same resultset, without anything all that shocking.

So, there you go.  If you want to know how to write a ‘semi-complex’ query in EF, it is pretty straightforward.  And it won’t cause “your DBA storming down the aisles, threatening you with bodily harm with the SQL that hit his DB.”

posted @ Tuesday, August 09, 2011 8:30 PM | Feedback (0)
This is a semi-complex query?

Rob posted something about how to implement complex queries using Massive:

“Here’s a semi-complex query that is all too common in the business case:

var results - DynamicModel.Open(connectionString).Query(@"
SELECT Orders.OrderNumber, Categories.Name FROM Products
INNER JOIN Categories ON Categories.CategoryID = Products.CategoryID
INNER JOIN OrderItems ON OrderItems.ProductID = Products.ID
INNER JOIN Orders ON Orders.OrderID = OrderItems.OrderID
WHERE Orders.OrderDate > @0
", DateTime.Now.AddYears(-1));

This is freehanded - but if you tried to write this in LINQ and weren’t very good at it you’d end up with a mess, and mangled SQL. You could, literally, email your DBA, ask for a Query, and pop it into your code and be done here. “

Uh, on a scale of 1 to 10, an inner join is at best a 1.5.   And if you couldn’t write it using LINQ, you probably shouldn’t be using LINQ.

Since I’m being all catty and obnoxious about it:


Have you ever worked with the sort of developer who thinks that, because he figures out how to write a SQL query that properly utilizes Group By and Order By, he’s now mastered all that there is to know about T-SQL?

This is the sort of thing that has traditionally led to the ‘divide’ between developers and DBAs when it comes to data access.  ‘Traditional’ DBAs (in some sense as it relates to SQL Server at least, anyway) have reacted to this by insisting on using stored procedures or other ‘harmful’ measures that just gets in the way of successful iterative friction-less development.

As a certified DBA and certified developer (as well as generally being certifiable), this example really isn’t helpful at all.


That crap out of the way, this actually isn’t a reflection on Massive one way or another.  I’ve looked at it, in the same sense that I’ve “looked at” PetaPoco and Dapper, briefly.  I see a lot of strings, but given that I am known to actually champion inline SQL (properly parameterized) over stored procedure calls in managed code, I can’t really complain about that.  The ability to put in a truly complex query and get out a dynamic resultset seems pretty decent from what I can tell.


To get around a common (and reasonably valid) complaint about inline SQL is that it can produce runtime errors due to fat-fingering mistakes, etc.  The easiest way around this is to make your queries available to some integration tests that will parse them against the database of your choice and make it part of your build process.


Since the whole “are stored procedures evil?” debate is old and boring, I will shortcut you to the correct answer.  Are stored procedures evil?  No, not when used properly.  When are they used properly?  Hardly ever.  Some typical cases (though in every case, “Thought Is Required ™”) are:

  • if you need to do set-based operations over large amounts of data (since that is what things like T-SQL shine at)
  • if you need to return multiple result sets (though you can do this in other ways, a stored procedure is often easier)
  • if you need to pass a complex object of some sort into a query (such as a table value into SQL or an array into Oracle)
  • or anytime you need to process through a lot of intermediate steps before getting to your final result (which often happens in ETL situations)

Otherwise, you should prefer to use an ORM, or micro-ORM as I gather things like Massive are now called.


posted @ Tuesday, August 09, 2011 5:28 PM | Feedback (0)
I didn’t think Apple made buggy products: the new MacBook Air 13”

I bought my first MacBook Air 13” in March because of the extended vacation I was taking, and because my main Dev laptop was approaching its end.  I had looked at some of the ultra notebook type things like the Sony Vaio line, but there wasn’t one available, and since I needed to do some IPad/IPhone development soon, I decided to go ahead and take the plunge.

Once the new ones were announced, I bought one as I wanted the faster processor, upgraded memory (since I had bought only the 2 GB model), etc.

My experience with the first one was seamless and largely phenomenal.  I still do most of my work in Windows 7, so I bought Parallels and installed there, but it basically just worked.

With the new one….not so much.

I’ve had a lot of issues with running Parallels on the new one.  The Windows 7 install will simply lock up, to the point that it can’t be shut down gracefully at all.  This requires the Apple equivalent of a hard shutdown, which almost always corrupts the install.  Since I have snapshots taken periodically, I’ve always been able to recover (though with some manual work as I usually have to delete the workspace solution I am working on and re-download), but I’ve had to do it twice now in less than a week.  This could be because I upped the memory used by the virtual machine to the maximum 2302.  I’ll drop it back to 2048 and see if it gets better.

Additionally, even though I should be able to back up to my WHS box using Time Machine, it simply doesn’t work.

Now, both of those things could be seen as non-Apple things.

But, I also have this weird issue with AppStore.  It keeps telling me that I have 3 available updates, which are for IPhoto, GarageBand, and IMovie.  Yet, when I try to update them, it says I can’t since I didn’t purchase them previously.  No kidding, they came with the thing installed.  Also, when I had to update my AppStore profile, it failed at first (without any visual indication that it was necessary) because I hadn’t chosen “Mr” as my title.  Really, that’s required?

Once you use a MacBook Air, it is hard to imagine going back to any other type of notebook due to its form factor.  Yet, I wish I could simply upgrade the memory on the original one (which I can’t since the memory is soldered to the motherboard for form factor reasons) as it never gave me an issue.

posted @ Sunday, August 07, 2011 6:29 PM | Feedback (0)
VS Studio Debugging: The server committed a protocol violation

Thank goodness for that internet thing.  Because Mr. Kulov recorded his pain, I was able to recover from this issue quickly.

If a process already owns port 80 and you try to debug in Visual Studio where you are trying to use your local IIS installation, you will get this error.  Like in Martin’s case, the offending application was Skype (which has an option in tools to use port 80 and 443, uncheck this) which was using the port.  If you don’t have Skype installed or running, run netstat –b to find the application causing the issue.

Also, remember to restart your website after you resolve the issue.

posted @ Sunday, August 07, 2011 6:05 PM | Feedback (0)
Why isn’t TFS more like <insert alternative here>? Blame Visual Studio

Brian Harry, the Product Unit Manager for Team Foundation, has a post about some of the coming improvements to TFS 11.  It’s an interesting informational read for many reasons, but includes this:

“A little background before I talk about the improvements we are making. When we designed TFS 2005, one of our design goals was to build a system that we could use for developing Visual Studio. VS is a VERY large code base. Last I checked, each branch was around 5 million files and I suspect it’s a good bit larger than that now. Your average developer needs 100,000 to 200,000 of those files to do their work. Further, developers are scattered around the globe, sometimes over relatively poor connections (when we started in NC, our effective bandwidth was about 300 Kbps :)). In order to manage this efficiently we chose a design where the vast majority of information (including information about your local workspace) was stored on the server. This meant that operations like Get or Merge, etc. could run entirely within the context of the server and only send to the client the few bits of information that the client needed. It scales incredibly well and allows us to support incredibly large teams and code bases.

Not everyone needs that, of course.”


“To address this, in TFS 11, we are adding a new type of workspace we call “Local workspaces”. You can still use server workspaces if you want to (in fact, we probably will still for most of our developers because of the code base size) but local workspaces will be the default. In local workspaces TFS assumes that your client is “the master” and TFS needs to understand the changes that you make there and “do the right thing”. In configuration management parlance, it’s called Modify-Merge-Commit style version control – or some might think of it as “the Subversion style”.”


“I’m certain that about this time, I bunch of people are asking “but, did you implement DVCS”. The answer is no, not yet. You still can’t checkin while you are offline. And you can’t do history or branch merges, etc. Certain operations do still require you to be online. You won’t get big long hangs – but rather nice error messages that tell you you need to be online. DVCS is definitely in our future and this is a step in that direction but there’s another step yet to take.”

The quotes pretty much speak for themselves and explains a lot.  I think it is pretty safe to say that most projects are not like Visual Studio.

I’m glad to see the movement is towards a Subversion model, with a future step to make it like Git or Mercurial.

I’ll let people think the obvious thoughts now.

posted @ Wednesday, August 03, 2011 7:58 PM | Feedback (0)
A sign you are working for an organization that doesn’t quite understand the Agile Manifesto

When there’s a slide that describes the process improvements they hope to implement and they list “going Agile” as being implemented in the “2013” timeframe.

posted @ Wednesday, August 03, 2011 7:40 PM | Feedback (0)