Monday, June 11, 2007

Home Hardware

I write this as the Queen's Birthday long-weekend in Adelaide comes to a close. My fiancee has been busy redesigning the front yard and I have been busy with all things technical as I usually do.

On all three days of this weekend - Saturday, Sunday, and the public holiday Monday - my fiancee has been to the local Bunnings Warehouse home improvement store to purchase tools, plants, and pavers for the garden. They were open 9am to 5pm all three days.

Closed Hardware Store Today, the public holiday Monday, I discovered that it would be really helpful if I had a wireless USB adapter to ease the repair of a friend's PC from the comfort of my home office. Unfortunately, I live in South Australia, where we have legislation known as the Shop Trading Hours Act.

This Act, allows home improvement and furniture stores, among others, to be open on public holidays but it denies this same right to electronics and computer stores. This also has the absurd side-effect that Harvey Norman stores open for the sale of furniture and bedding but close access to the computers and communications section of the building.

Why is the consumer allowed to build a garden shed or install a new light fitting on a holy day or a public holiday but not permitted to install a new hard drive or fit surround sound speakers in their lounge? A March 2007 review of the Shop Trading Hours was heavily in favour of maintaining these ridiculous constraints despite the increasingly 24x7 nature of today's lifestyle.

Each business should have the option to open for trading if and when they choose. This decision should be based on the demand for their goods and services on certain days and times, the affordability of staff wages at weekend and holiday penalty rates, the personal beliefs of the owners, and anything else that may impact the profitability of the type of business in question.

Likewise, the devout consumer will prefer to spend Sundays and holidays at their place of worship or having quality time with their family while those without religious concerns or family commitments and wanting to get the most of their busy schedule can shop for items they need.

 Saturday, June 09, 2007

Three Strikes

I bought a LinkSys WAG54Gv2 ADSL wireless modem a couple of years ago. It had a good price and listed many features but I've suffered with unreliable WiFi since and eventually added a standalone access point to my home network.

The local broadband community has a lot of complaints about the LinkSys modem too and the original v1 wasn't any better. For a company advertised as "A Division of Cisco", I was hoping for much more and I wasn't the only one.

As a result I usually steer friends toward something like the D-Link DSL-G604T, a modem that I've installed many times with reliable results. Recently though, a close friend, finally moving from dial-up to broadband, purchased a LinkSys WAG54Gv3 against my advice. I guess the price, the Cisco brand association and the feature list were more convincing than my protests.

Last night I helped install the new modem and configure a Notebook, a Wii, and an iPaq (sounds like the beginning of a joke) to connect to it wirelessly. A fourth player, a wired HP desktop PC, was used to initially configure the modem and couldn't have been easier. WiFi however, as it turned out, actually was a joke.

On all three devices, IP addresses were not being issued by the modem if WEP encryption was enabled but WAP and also no-encryption were fine. The fact that I tried WEP first is entirely another blog post but can be summarised as such: better than no encryption, combined with MAC filter, LinkSys overheat with WAP, and minimal possible damage from an attack.

DHCP over WiFi has been a recurring issue in my experience and it is very disappointing. It is incredibly fundamental and there seems to be an amazing lack of thought put into getting this functionality right. The WAG54Gv3 is new to the market and doesn't have too much feedback yet, but so far it looks like it could be LinkSys' third strike.

I've said before that buying the more expensive product in the first place would probably solve all this messing around, but where should the line be drawn? An entry level Cisco 857 ADSL modem router will easily set you back AU$700, that's double the price of almost every other option.

DasBlog Mobile

Today I had the pleasure of visiting this web site with a Windows Mobile device. I was thoroughly pleased to discover that, without any configuration on my part, the blog rendered in Pocket Internet Explorer in a very clean, usable form.

I was even able to read the comments and submit my own. I must say though that the limited input capabilities of many PDAs really emphasise how annoying CAPTCHA can be.

Anti-spam mechanisms aside, the DasBlog developers have done an excellent job to provide yet another feature out-of-the-box that I was worried I would have to implement myself.

Thank you.

 Friday, June 08, 2007

Small Business, Big Problems

I've had the pleasure of chasing down some complications on a recent Small Business Server 2003 R1 deployment for a client. As is our preferred style for building new machines, we installed Windows then we ran Microsoft Update over and over, rebooting in between as necessary until every available critical and optional update had been installed.

We then proceeded to deploy our software's prerequisites to the server followed by the software itself, and lastly configure the server ready for deployment to the client's network. This last part was interesting... the SBS licensing GUI would crash when we attempted to start it. Some extensive Googling found this KB article suggesting to disable DEP for the offending program. Problem solved.

A little later the program for creating Active Directory Users was crashing exactly the same way. I couldn't find any KB articles for this program but I tried disabling DEP for the entire system and rebooted. Problem solved again. However, I wasn't happy that turning off DEP was right.

I spent an evening wandering through forums and blogs about SBS and eventually concluded that SBS SP1 was supposed to solve the problems. Of course, we had installed all the Microsoft Updates so that should already be fixed right? Sadly, no.

It turns out that because Service Pack 1 for SBS2003 apparently changes too much it doesn't get offered via Windows Update, you have to find it, download it, and install it manually. To make things worse, SP1 for SBS is supposed to be installed before SP2 for Windows Server 2003 but Microsoft Update had already installed that.

Several hours later we had uninstalled Windows Server SP2, installed the multi-file SBS SP1 update, reinstall Windows Server SP2, broken the .NET 2.0 framework, repaired that, broken SQL 2005 Reporting Services then reinstalled that, and finally reapplied SQL 2005 SP2.

Next time I think we'll have to remember to install SBS 2003 R2.

Heading Virtual For The Winter

Last time I looked into the options for migrating physical machines to Microsoft Virtual PC/Server I only found the Virtual Server Migration Toolkit. I downloaded all the appropriate components and began following the installation instructions. I quickly found myself overwhelmed by a solution too complex for moving one or two desktops to virtual machines.

With a notebook refresh on the horizon I decided I should look into my options again, hoping to virtualize my old system as a form of runnable backup. I discovered an excellent collection of blog posts from over a year ago conveniently listed here. The articles are spread out but do an excellent job to explain the common problems and how to solve them. I am summarising the process here mainly for my convenience but I'm sure it will be useful to others.

  • Install the Standard/Generic IDE Controller driver on the physical machine.
  • Copy an image of the physical drive into a VHD*.
  • Use Safe Mode/Recovery Console to disable drivers that halt the boot.
  • Replace System32\HAL.DLL with HALACPI.DLL from the Windows CD.
  • Install VM Additions, uninstall unnecessary drivers.

For full details on achieving these steps, refer back to the original articles and you should end with a functional Virtual PC of your physical machine. Even better, your physical machine is untouched and still usable.

* The original articles suggest using Virtual PC's linked physical disk feature to mount the actual hard drive and then convert it to a VHD. Unfortunately, Virtual PC 2007 does not include this feature anymore, however I found this MakeVM software which sounds promising.

Of course, there is also the VMWare range of virtualization products which apparently have much better P2V solutions.

 Wednesday, June 06, 2007

ReSharper And Other Trivia

As Jim has recently explained, ReSharper 3.0 is now available in beta and for the first time supports VB.NET. As the majority of the code I work with each day is VB, I have, also for the first time, installed ReSharper. I am enjoying the experience so far and it works well across both VB and C# projects in the same solution.

However, as I've mentioned before, I use C# projects to test VB production code and ReSharper was failing to consider InternalsVisibleTo attributes and incorrectly marking code in my unit tests as erroneous. Thankfully Visual Studio still built and executed the code fine. Also very impressive was how quickly the guys at Jetbrains had solved the bug once I had emailed them. Try the nightly builds here for the latest version.

As a side note, if you're working with the InternalsVisibleTo attribute, you may find fellow Australian developer David Kean's generator very useful for extracting the rather long assembly PublicKey.

Now, if I can just convince ReSharper to give back my F12 key.

 Tuesday, June 05, 2007

SQL Server 2008

It's hard to keep up. Microsoft have recently released the June CTP for SQL Server 2008. You may need to sign in with your Windows Live ID to follow that link and you definitely need to apply for the SQL CTP program if you want to download it. I guess it makes sense for us to start seeing SQL 2008 now as it probably coincides with the Visual Studio 2008 RTM later this year.

Finding Closure

Scott Hanselman recently posted about troubles with external hard drives and large files. However, while file systems and compatibility between multiple OSes is quite a problem on it's own (and one I'll still need to solve for myself soon), I've been wrestling with a different large file issue.

Several months ago I purchased (separately) a Samsung 40GB 2.5" PATA hard drive and a USB external hard drive enclosure to suit for quite a low price from eBay. Most of my data trafficking between home and work consisted of Office documents, source code, and other assorted small files. All was well.

Since then, I have needed to transfer Virtual PC images, MSDN DVD images, and server backups and I have had no success. Without any error messages during the copy process I was finding that files over ~400MB copied to the external drive were corrupt. They had the same length as the original but a command line FC /B or an FCIV revealed that random bytes were different.

Extensive Googling suggested motherboard USB power issues, cable quality problems, hard drive faults, and write-caching settings as potential causes. I methodically checked each possibility by using different machines, PCI USB controllers, new cables, a different 2.5" hard drive, and playing around in Device Manager. Nothing helped.

A few weeks ago, my local computer store had a special on Western Digital Passport Portable Drives. The Western Digital brand has always been good to me and I figured I could try one and have someone to complain to if it didn't work. I bought one and since then I've been moving all sorts of large files around (including 16GB Windows backups) without any problems.

That's just one more time for me, learning the hard way to stop buying cheap components and instead to just fork out for the quality brands up front. It's like washing a spoon under a running tap: occasionally you forget what happened last time and you get wet. So if you're getting corrupt files on an hard drive in an external enclosure, just cough up the cash and buy something better.

 Monday, June 04, 2007

Capture To Team Foundation

Dudu Shmaya has just released a plugin for Cropper to create TFS work items from screen captures. You can also use it to add screen capture attachments to existing work items. We already use both Cropper and TFS, and this new plugin should be very useful for creating bug reports.

Dudu says he plans to submit the source code for his plugin to the CodePlex project for Cropper plugins soon. Looks like there are some other nice plugins already on their too.

 Saturday, June 02, 2007

Sharpen Your Unit Tests, Forget VB

We are entering a new stage of development at work, we've released betas of three modules and are now beginning the initial iterations for two new modules. We are taking this opportunity to push unit testing into our standard development cycle, which is something I've wanted to do for a long time.

With friend and work colleague, Jim Burger, leading the charge to unit test and document our common libraries, some "best practices" that suit our project model are starting to reveal themselves.

For each project under test, we create a corresponding test project with the same name suffixed by "Tests". This keeps the projects paired together in the Solution Explorer and creates default namespaces for the projects that are just different enough to avoid clashes.

Within the test project we then create a folder for each class under test and within those folders, we create a unit test class for each function under test. We've found that each function usually requires at least three tests (null guard test, common case, edge case) and giving each function it's own file keeps our tests manageable.

Most importantly, while all our production code is in VB, we write our unit tests in C#. One of the main reasons is that the C# compiler respects the InternalsVisibleTo attribute and allows us to test code marked as Friend without resorting to reflection in our tests or putting test-only code in our production projects.

We also get the nice benefit that C# will automatically put classes in namespaces that match the folder structure in the project. This provides a simple mechanism to categorise our tests for running them and viewing the results. C# also tends to produce slightly more succinct code which just feels better as the number of tests grows.

Although both VB and C# have their pros and cons, the majority of the .NET world is C# and so are the job opportunities. As a VB programmer, by using C# for at least some of your work, you make sure you are learning more aspects of .NET and when you get involved in the .NET community you're more likely to appreciate what they're talking about.


This post brought to you by Windows Live Writer Beta 2.

kick it on DotNetKicks.com
 Thursday, May 31, 2007

Virtual Library

Microsoft now has a collection of Virtual PC/Virtual Server VHD images to trial a decent range of their enterprise products. They currently have Windows Vista, Visual Studio 2005 Team Suite, Windows Server 2003 R2, SQL Server 2005, Exchange 2007, and several others. These should be really useful for testing their new products without requiring a spare machine and also for testing your own software against their various platforms. Hopefully they will continue to keep their images up to date and expand on the packages available.