Feb 17 2010

Recommended reading for developers

I was reminded this morning of an email that I sent to the junior developers on my team when they joined us. It is an overview of some of the development practices, patterns and products that they would get exposed to on our project. I have included it here as a reference collection for others.

Principles and Patterns

These are things that I often use and are still learning to use.

Jeremy Miller also writes a series called Patterns in Practice for MSDN Magazine (see list at http://msdn.microsoft.com/en-au/magazine/cc720886.aspx). They are all a good read, especially:

Tools

These are tools that are good to get experience using. Most of them relate to the patterns above. There are other tools used like ReSharper, dotTrace, StyleCop, WinMerge etc, but they don’t have the up skill requirement that the following tools do.

Probably the most important tool to start using is Rhino Mocks. The only way to get experience with it is to start writing unit tests in VS. See the documentation at http://ayende.com/wiki/Rhino+Mocks+Documentation.ashx.

Tags: , , , , , , , , , , , , , ,

Nov 18 2009

Is there a point to code coverage?

Category: IT RelatedRory Primrose @ 09:40

Code coverage is a concept that is often misunderstood and misused. It gets some criticism every once in a while because of this.

The most common misconception is that code coverage is a measure of code quality. The name code “coverage” also makes it easy to assume that it is a metric regarding the exhaustiveness of test effort. Neither of these are incorrect.

My definition is that code coverage is a measure of what you haven’t tested. Nothing more, nothing less.

Just because something is covered by a test does not ensure that the code is either of adequate quality nor that all possible scenarios are tested for that code. If it isn’t covered though then it isn’t tested and needs some attention.

Tags:

Apr 23 2009

Saying goodbye to friends (for now)

Category: IT RelatedRory Primrose @ 10:44

I’m saying goodbye to some friends for a couple of weeks as I head back into the land of documentation.

Tags:

Mar 30 2009

Going to CodeCampOz 2009

Category: IT RelatedRory Primrose @ 16:24

I'm really looking forward to Code Camp this weekend (nerd camp my mother-in-law calls it). It should be a great weekend of sessions and networking. Hopefully I'll get to catch up with friends and meet some great new people.

See you there!

Tags:

Mar 11 2009

Lightning fast Australian broadband

Category: .Net | IT Related | Software DesignRory Primrose @ 19:45

I've been on ADSL2+ for a few years now. Having a possible maximum speed of 24Gb is nice, but the actual floats between 5-7Gb being 3.5km from the exchange. That's not great, but is fast enough for general net usage. Tonight however, surfing the net has been slow. Really really slow. So slow in fact, that www.speedtest.net tells me this.

In the test before this one, the upload speed was actually a tad faster than the download speed. Did someone say broadband???

Yep, I'm glad that broadband in this country is so fast. My sarcasm drips all the way from this post to this article. Broadband in this country is a disgrace which is a real shame.

Update:

This morning is better :)

Tags:

Mar 11 2009

SCOM event collection fails with (0x8007000E)

Category: IT RelatedRory Primrose @ 08:59

I have written some custom SCOM management packs that read from a database and populate event collection data (see here and here for some examples from other people). My first management pack works without any problems. The second management pack (essentially a copy of the first) fails with an out of memory exception. The Operations Manager event log on the SCOM server contains an entry that starts with the following:

Converting data batch to XML failed with error "Not enough storage is available to complete this operation." (0x8007000E) in rule "[RuleName]"

This has been plaguing me for weeks but I now have an answer.

The definition of a collection event record includes a description field. The description field may be defined with a static value, a property bag (params) value or combination of both. The property bag value can be fully qualified (in the format of $Data/Property[@Name='<PropertyBagItemName>']$) or referenced by index. See here for more information.

My management pack originally contained the following:

<Description>%16</Description> 

In the case of my second management pack, the index is incorrect. There were field differences in the database output between the two management packs such that the param index was pointing to a different field from the database. I fixed this up so that it was pointing to a "Message" property bag value populated from the database.

<Description>$Data/Property[@Name='Message']$</Description> 

Now the management pack works. The difference between the two fields was that the original field (identified by index 16) had a null value whereas the "Message" field did have a value. My scripts deal with null values by ensuring they are always converted to empty strings using the following old VBA trick:

Call propertyBag.AddValue("Message", rs.Fields("Message").Value & "") 

After a bit of playing around, I found that there isn't a problem with the property bag containing empty values, but there does seem to be an issue with the event collection properties themselves having empty values when identified by index. If the fully qualified reference to the property bag item is used and it has an empty value, there is no problem.

Always make references using the fully qualified property bag reference in order to avoid this problem. This will also avoid problems should the structure of your property bag change.

Tags:

Feb 13 2009

SQLEXPRESS fails to start

Category: IT RelatedRory Primrose @ 04:33

I have just encountered a problem where the SQLEXPRESS instance installed on my machine was not starting. It looks like a recent windows update has failed, but also knocked out SQL Server. The event log contains the following entry:

Error 3(error not found) occurred while opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.

After searching around, there seems to be lots of forum posts going back several years about this issue. The problem is that the only known solution seems to be to change the credentials of the SQLEXPRESS service account to Local System. This will then allow the service to start. Doing this through the services console presents a problem however because you can't set the service credentials back to Network Service as you need to know the password.

A better answer was found in this forum post. Using the SQL Server Configuration Manager, you can change between the system accounts without needing to know the password.

image

What you need to do is change the account to Local System, then click Apply and Start. You can then click Stop and change the account back to Network Service and then click Apply and Start again.

Tags:

Dec 8 2008

Kicked it up a gear with ReadyBoost

Category: IT RelatedRory Primrose @ 03:25

A couple of years ago I bought a new Dell laptop. It was a middle range spec that I expected to throw more hardware at in the subsequent years. Sure enough, the hard drive became too small, too slow and the machine good certainly do with more than 2Gb RAM.

RAM was the primary concern. It was running out often enough that Vista was constantly going to virtual memory on a slow drive without much space to work with. I ran the analysis tool over at Crucial which to my complete surprise told me that the laptop only supports 2 RAM slots, each of which can only handle a capacity of 1Gb/stick. Surely this was not right. I searched the Dell site and found the specs for the hardware which told the same sad story. Dell in their wisdom sold a Vista laptop that was hardware limited to 2Gb RAM. So I'm not just surprised now, I'm utterly shocked.

Fast forward to this weekend. The machine now takes 20 minutes to work on some task in virtual RAM which leaves the machine completely locked up. After thinking about getting a larger and faster hard drive, I realised that there is a better solution that would be very cheap. Vista came with a technology called ReadyBoost. It uses flash memory to work with virtual RAM before falling back on the hard drive. Flash is faster than hard drives and easily expanable via a USB connection so I get around the hardware RAM restriction. It is also a lot cheaper than buying a new laptop hard drive.

The good guys down at Harris Technology had some ReadyBoost compatible 4Gb USB flash drives for $18 each. I bought one for the laptop and one for the desktop.

After using the laptop a bit yesterday, I found that it was a lot more responsive. When it did use virtual RAM (which happens a lot), the machine was processing a lot faster.

Tags:

Oct 17 2008

At war with F1

Category: IT RelatedRory Primrose @ 05:30

After implementing the double F1 solution a few moths ago, I now get continuously bitten by the change. I keep pressing F1 just once and then wait for help to come up only to remember that I need to hit F1 a second time. It probably doesn't help that MSDN from Visual Studio takes a long time to come up the first time, but eventually I realise that I need to hit F1 a second time.

It's a war between my automated single F1 press for help vs my misfiring over from the ESC key. I will keep the setting how it is though. Forgetting the second F1 press isn't as bad as accidentally hitting F1 instead of ESC.

Tags:

Oct 17 2008

One day, there will be a Cloud Camp

Category: IT RelatedRory Primrose @ 04:11

So we have Code Camp, SQL Down Under Code Camp and Security Code Camp. I don't think it will be too long before we have Cloud Camp.

Tags: