All i can start with at this stage is wow…..

I went through by feeds this morning and innocently picked up an article introducing mocking using Moq. I’ve read a little about it, followed the fact that it’s gathered quite a following, and figured it best I give it a spin to see for myself.

And then I followed the links in that article….
And then I read the links in that article…..
And i was shocked to learn about the bad blood between the very two opposing camps, which i’d never realised….

Incidentally, I started off trying to learn more about Moq, and now i’m reading up about TypeMock Isloator…all in a day’s work i suppose 😉

I found this article explaining the differences between a good programmer and an average one

I’m pleased that i can read that list and honestly say I am/do most of those things. Possibly the notable exception is reading books. I agree with one of the commenters in that books are virtually outdated from the moment they’re printed. Software is changing so fast, the most beneficial information you could get from a book is not instructions on implementing a solution (ie: “Teach Yourself XXX in 24 Hours”), but the theories behind good solutions (eg: “Design Patterns: Elements of Reusable Object-Oriented Software“).

I own both, and I have rarely ever picked up the former after reading it.

The title says it all.

The problem was simple – we have a legacy .NET 1.1 website project, and have several branches for each environment it’s currently running in. In order to test bug fixes for a branched version, I always find myself needing to go into IIS management console and switch the website to the directory of the branch. A reasonably easy step, but always cumbersome because it takes focus off solving the problem at hand.

What i wanted was to create a batch script i could execute, and IT would be clever enough to update the IIS website to the correct directory.

Searching for command-line management tools for IIS turned up a lot of results, but none of them mention anything about modifying an existing website. They all have functionality to query/add/delete a website from the IIS metabase, but nothing to modify an existing one.

After a bit more digging, i was lucky enough to find this article explaining how to modify an IIS website path using Active Directory Service Interfaces (ADSI). It’s a small C# code snippet, but was enough for me to write a console-app to do exactly what I needed.

The only thing that the utility did not mention was that it relies on the input id being the IIS metabase website id, and not the name of the website. But determining the id of the website from the name was a trivial call to the iisweb.vbs script, and then a regex to pull out the ID from the output

%SystemRoot%System32iisweb.vbs /query “My Website”

Once the app was written, I knocked up a quick batch script to perform the switch (with a little refresher on my ms-dos syntax):

@echo off
echo Switching My Website to directory %CD%

echo First lets stop IIS (unnecessary, but being defensive here)
iisreset /stop

.toolsswitchiisswitchiis.exe “My Website” “%CD%MyWebDir”

echo Restarting IIS…..
iisreset /start


In case people are interested, i’ve zipped and attached the project (assembly and code). It’s not robust, and it could be better, but its a tool for a specific job. YMMV.

Download SwitchIIS

Inspired by a colleague at work who was required to research an area of audio technology as part of his audio engineering degree, i’ve been dabbling over the last few weeks with a Nintendo Wii Remote and DirectSound.

Basically, what he needed was a piece of software which could simulate a audio-centric virtual environment. The audio simulation would involve a sound being modified based on the head-orientation of the user. If the user looks to the left, the sound “appears” to come from the right side of the head, and the same vice-versa. In order to perform the head-tracking we were going to rely on the capabilities of the Wii remote and all it’s IR camera glory. As with all clients, there really wasn’t anything much clearer specified, and I was left to kind of work out the rest 😉

The general concept behind the head-tracking is to use two points-of-reference on the user’s head to determine which side is left/right. Just like Johnny Chung Lee had done with his head-tracking exercise. With a little nudge forward from my old high-school electronics days, and $10 at JayCar, I’d soldered and constructed 2 purpose-built head-mounted IR LEDs. Blu Tack is an amazing product, and there’s nothing I found it won’t stick to. I won’t go into the detail of making one of these. It took me 20 mins, and the following article on making an IR LED pen was sufficient enough. As a tip, to check if your IR light is working correctly, you can use a digital camera and point the IR light toward the camera. Our eyes can’t pick up infra-red light, but the CCD on a camera can.

Post-hardware construction, the first phase of this project basically entailed a proof of concept, and an opportunity for me to learn about the two major components of this project i knew close to nothing about:

  1. Connecting and using the the Wii remote on a PC
  2. Using DirectSound to control audio

But first there would be more pressing matters. Like getting my Soleil Bluetooth receiver to work under VirtualBox on Linux. I don’t run any development software under my windows-boot partition. My windows partition has one intended purpose….To cut a long story short, it looked like it would be a bigger hassle trying to get the BT dongle to work under linux than to just install VS in my gamebox partition…So that’s that.

The BlueSoleil software worked like a charm, and within minutes I was hooking up the Wiimote to the laptop. no problems. The Wiimote is detected as just another HID, so it pretty much worked out of the box on XP.

At this point, I went out to find *how* to actually do each of the individual unknowns for this project. And it’s at this point I need to credit two articles which pretty much gave me everything I needed to get going. I was fortunate enough to find this article on CodeProject on using DirectSound, and an MSDN blog with a managed library for controlling the Wiimote. Too easy.

Hooked up the sample Wiimote library, turned on the Wiimote, turned on my IR lights and voila – worked a treat.

And that’s it for this post….next post, i’ll describe in a bit more detail the putting together of the software – certainly more interesting than all this drivel – and with pictures…..

I’ve been battling this one for a long time….Finally got it solved…..(sort of)……

Last year, I bought a cheap $70 NAS external drive case to use as network storage…The poor man’s SAN, if you will.

Since I bought it, however, i have been unable to mount the drive under the linux console so that i can access it’s contents in bash script. Accessing the drive from Gnome file browser, works fine, however.

I tried and exhausted all options:

  1. Using smbmount (although deprecated) would mount the drive, but the contents of any subsequent directory listing would be garbled and look like corrupt text

    ———- 1 root 16 114P 1940-10-24 12:26 ?
    ———- 1 root 16 114P 1940-10-24 12:26 ?~?????
    ———- 1 686040 32 115P 1940-10-24 12:26 9.jpgj
    ———- 1 root 16 114P 1940-10-24 12:26 and star cityg

  2. Using mount.cifs would not even get that far – it would just mount error out with:

    mount error 20 = Not a directory

And then i stumbled across a newsgroup post which had the answer:

modprobe cifs
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
mount /mountPoint

According to this link apparently the NAS drive doesn’t support the smb extensions supported by my client’s kernel, so disabling them allows me to mount the drive successfully…

i don’t know what the Linux extensions actually are, but i’m guessing that they have something to do with codepages and the interpretation of content, because now when i try and browse the mounted directory under Gnome’s file browser, it comes out all garbled…no problem….i can still browse the network share directly through gnome so no need to browse the share….

Just another day in front my computer…..

On the upside, i’m now able to mount the network drive on my linux server, and share the network mount using samba on the server. This is a long and nasty workaround to the problem that Vista can’t access the NAS server without patching the NAS device itself.

Because IE6 still has a 30% market share , it’s important to test your website on IE6.

Sadly, installing IE7 removes any hope of safely being able to do so….There are compatibility issues with apps like IE6Standalone etc which don’t make them 100% reliable. In my case, Windows auto-update was kind enough to upgrade my specific IE6 virtual machine to use IE7. *rolls eyes*

To uninstall IE7, and revert back to IE6:

  1. click Start -> Run.
  2. Type: %windir%ie7spuninstspuninst.exe into the text box, then click OK.

It’s pretty quick to run, but requires a restart.