How to ask a question

You may have noticed the odd rant now and again when I get frustrated at people on forums who need help but seem incapable of doing even the tiniest thing to help themselves in the first place. If you haven’t and are sufficiently voyeuristic here are a selection:

Well, now I have  a solution in the form of a link to a Microsoft Knowledge Base article. It is clear, it is polite, and it tells people almost everything they need to do in order to obtain free help from forums.

And here it is: How to ask a question

NOTE: This was rescued from the Google cache. The original date was Tuesday, 10th April, 2007.

Got Vista Installed

I’ve finally installed Vista on my PC! It wasn’t a trouble free installation though.

IT is always good to have a clean out of old stuff from time to time, so I took this opporunity to blow away the cobwebs of my old XP installation so during the installation I reformatted the partition where my XP installation was and started everything from scratch.

Unfortunately the installation only got so far before it just quit.  Basically, the installation has to reboot a few times during the install and on the first reboot it got itself into a bit of a fankle and just quit. When I tried to reboot again it gave me the option of booting into safe mode. So, I tried that and it said that it couldn’t continue the installation in safe mode.

A friend of mine , John Thomson, runs Roundtrip Solutions (an IT support company) and I emailed him just in case he’d heard anything about this. After checking the usual things (I have an ATI Radeon 9700 PRO graphics card) he suggested that my second monitor might be confusing it and that I should unplug it for the installation. So, I did that and the installation got further than before.

My next problem was that it obviously checks the capabilities of the hardware and sent a signal to my monitor (a Philips Brilliance 200W) that the monitor couldn’t cope with. The monitor detects this and puts up a wee message to say that it can’t cope with the signal and what its display capabilities are. Unfortunately it doesn’t remove the message once the signal has been corrected. I thought that the installation had messed up again.

So, a new attempt at installation was made, but this time I’d discovered that I have to “reboot” the monitor, so to speak. When the invalid signal came through I turned the monitor off and waited a few seconds before turning it on again. It came back to live and the installation continued without any more problems.

Once installation had completed I plugged the second monitor in again and extended the desktop to it. It works fine now. I’ve got the fireworks at the end of a winning game of Mahjong playing on the second monitor, Media Player playing my CD collection (which took about 30 seconds to reimport from my second hard disk). Shortly I’ll be installing Visual Studio and Office – Then we’ll see just how much stuff this can cope with at once. While I was running Windows XP it was typical for me to have a dozen web pages open, an Office application or two, Visual Studio 2005, Media Player, countless explorer windows and goodness knows what else running.

Tags:

NOTE: This entry was resued from the Google Cache. The original date was Saturday, 14th April, 2007

Visual Studio 2005 on Vista

I’ve got Visual Studio 2005 installed on Vista – It wasn’t the trouble free installation I’d hoped for. I had to go through the installation cycle twice.

On the first attempt it got so far and then informed me that that it couldn’t continue due to “known compatibility issues” and that I had to install SP1 and then the Vista Update in order to get it to work. It directed me to a knowledge base article that seemed to assume that VS2005 was already installed. (At this point I’m actually still trying to get it installed)

After reading through the article and downloading the service pack and vista update I waited for the installation to continue. It didn’t. After a very long while it was obvious that it had hung somewhere. I managed to stop the installer and check the “Programs and Features” control panel applet (this is the replacement for the old “Add Remove Programs”) and Visual Studio was listed along with Microsoft Document Explorer 2005. So, it looked like something had installed.

I figured at this point, given no guidance on how to actually install Visual Studio 2005 on Vista that I should just install the service pack and vista update on what ever was there and see what happens.

After installing the Visual Studio 2005 SP1 and the Visual Studio 2005 Update for Vista I launched Visual Studio. I got some very odd error message about not being able to load a J# add in. It was odd because I’d removed J# from the installation options. It asked if I’d prefer that add in not to be loaded again. I accepted that advice and VS2005 started up.

It was obvious that the installation was still somewhat broken so I went back to the “Programs and Features” and selected “Uninstall/Change” from the context menu on the Microsoft Visual Studio. I was then able to repair the installation. The repair process completed successfully. Just in case it put anything back the way it was I re-ran the installer for the service pack and vista update. They both seemed to run successfully.

I’ve now written a very simple hello world application to satisfy myself that VS seems to have installed reasonably okay. It worked and I’m happy.

If I find a guide that proposes a better solution than the one I cobbled together I’ll post it here so others may benefit. (And me, if I ever have to reinstall)

Tags:

NOTE: This entry was rescued from the Google Cache. The original date was Sunday, 15th April, 2007.

Technorati Tag Builder (Update)

Since announcing my little application to help make technorati tags easier for my blog posts I’ve gone and fixed a couple of bugs. I suppose that’s what you get for writing an application in a few minutes – not enough time for testing.

So, now that non-alphanumeric characters are encoded properly and empty tags (caused by a trailing comma, or no tag between commas) are ignored the new version of the Technorati Tag Builder is available on my website. Also, for those that just want a simple life, an installer is now available.

Tags:

NOTE: This post was rescued from the Google Cache. The original date was Sunday, 22nd April, 2007

How do you return error conditions?

A recent poll on Code Project asked: How do you return error conditions?

I was disappointed to find that in the event of a “critical error that leaves the app in an undefined state” a shocking 5% of people would “cover up the mess and don’t say anything”. I think I would be shocked at even just one person responding with that answer. What is it with these people anyway? Do I have to explain why that is really unwise?

A greater percentage of people chose that answer in the event of non-critical errors, too. While the errors aren’t so bad, someone, somewhere will have to eventually clean up the mess.

It reminds me of a charting component that a company I used to work for bought. I evaluated various charting components and only one did absolutely every type of we wanted. However, in my report I did indicate that the component would not return any error status or throw an exeption when it failed so it was up to the developer who was using it to somehow work out if the component actually did what was asked of it. I just wonder how much more money was spent working around the problems the component created rather than benefit from it solving the existing problem.

Tags:

NOTE: This post was rescued from the Google Cache. The original date was Monday, 23rd April, 2007

Google Map of Scottish Developers Event Location

Google maps has a cool feature that allows you to draw annotations on a map. I’ve created one detailing the transportation links (bus station, railway station and car parks) nearest the location of the upcoming Scottish Developer events.

To create a map like this all you need is an account with Google, then press the My Maps button on the Google Maps page.

NOTE: This blog entry was rescued from the Google Cache. It was originally dated Sunday, 29th April, 2007.

Unit Testing a Static Class

I’ve been trying to find a way to unit test a static class. That is, a class that has no instances. The problem has been that at the end of one test the class’s state could be altered which would mean that at the start of the next test its state would be unknown. This could lead to buggy unit tests.

The solution, I’ve found, is to invoke the type initialiser (sometimes known as the “class initialiser”, “static initialiser”, “static constructor” or “class constructor”) using reflection and ensure that all fields are set up there. That way, each unit test run will be starting the static class with a clean state and it no longer matters what the unit test does.

The code to invoke the type initialiser:

Type staticType = typeof(StaticClassName);
ConstructorInfo ci = staticType.TypeInitializer;
object[] parameters = new object[0];
ci.Invoke(null, parameters);

Tags:

NOTE: This blog entry was rescued from the Google Cache. It was originally dated Monday 7th May, 2007.


There was one comment of note:

If you have a static class with state, then you have a singleton – generally to be avoided, but sometimes unavoidable. One way to think of singletons is as services – they provide a service to your app. Services usually interact with the outside world in some way, so for testing purposes it is useful to be able to switch between a real implementation and a Mock one.

So the trick that I use is to create a singleton service locator class, with a manual switch for changing from Test mode to Normal mode. Fowler calls this the Registry pattern in PoEAA.

5/8/2007 6:38 PM | Steve Campbell

Customised Google Search

I’ve been playing around with Google‘s customised search recently. It is great, I can create a filter on Google that means that, for the majority of the time, I get the results that I want. The majority of the time I search MSDN, Code Project, my own website and my blog.

  • MSDN is the main documentation for all of Microsoft‘s developer tools. It contains nearly everything I want to know.
  • Code Project fills in the gaps with examples of how to do certain things
  • My own website and blog are included because I often write things down so I don’t forget… Then I forget, so I have to find it again. It is much easier searching my own blog for something than it is to search the wide internet.

I’m sure I’ll be adding sites to the filter as I go along. The Microsoft DPEs’ blogs are likely to be added shortly as will a number of other blogs that I read regularly. All will be developer focused so if you want to use my custom search you can be assured that you won’t end up getting crazy results back about cute kittens.

Finally, if you want to use my custom search, just click this link: http://www.google.com/coop/cse?cx=003507701737802140662%3Afwturq34rxo&hl=en

Tags:

NOTE: This blog entry was rescued from the Google Cache. It was originally dated Wednesday, 9th May, 2007.

Developer Day 5

DDD5 seems to have sold out in less that a week this time. I’ve also been looking at the final agenda to get an idea of what I’d like to see. There are a few time slots where I’d like to see two sessions at once so I’ll be thinking hard about which we go for.

For the moment my choice is as follows:

 An introduction to Unit Testing with Mock Objects (Presentation) Colin Angus Mackay

Mock objects are stand-in dummy objects that don’t have any functionality behind them, they just return the values to the application that the real object would have returned. Unit tests are supposed to test isolated bits of code. Mock objects ensure that if the code you are testing calls something external to the class being tested you don’t have to worry about what the actaul real class does. This talk expects the audience to be familiar with the concepts of Unit Testing and will introduce the concepts of Mock Objects.

Team Foundation Server – the answer to all project management problems? (Presentation) Richard Fennell

Sick of SourceSafe? Is Microsoft‘s Team Foundation Server the answer to all your problems? In this session I will cover the key components and usage of TFS, installation issues, the range of third party tools available and how to write your own tools using the API. The session will include demos of cool addins and tips drawn from bitter experience.

An Appraisal of “Object Thinking” (Presentation) Alan Dean

Have we got object-orientation all wrong? “Object Thinking” (ISBN 0-7356-1965-4) by David West asserts that we have. Alan Dean explores this assertion, and demonstrates self-describing objects / self-evaluating rules with code examples. More details…

Agile Methods for ISVs (Presentation) Gary Short

 We’ve all heard of agile methods but when they are spoken of it is mostly in the context of the enterprise. Being an ISV and being agile is a different kettle of fish. In this talk I’ll explain the differences between life as an ISV and life in the enterprise and then I’ll show you how to adapt agile methods for use in the ISV world.

Multithreading patterns (Presentation) Cristian Nicola

In the modern computers is more and more important to use multiple threads to benefit of the multi-core CPU readily available. This session explores multithreading patterns from the flows, data, resources and exceptions points of view, without actually being tied to a particular programming language.

Tags:

NOTE: This entry was rescued from the Google Cache. The original was dated Sunday, 3rd June 2007.

Developer Day 5 Sold Out in 4 Days

Actually I don’t know how quickly Developer Day 5 sold out in. It was announced on May 30th and I noticed on June 2nd the registration page had a notice on it that any further registrations would be going directly onto the wait list. 350 (approx) developers signed up and packed out the venue in less than 4 days. That is simply amazing.

What is more interesting is that this event is taking place on a Saturday (out side office hours basically), so everyone attending is doing so in their own time. Developers are recognising that they need to keep their skills current.

I also know that there are quite a few people travelling, at their own expense, from Scotland. I’m sure there will be people traveling from the north of England also. So people are willing to put their hands in their pockets for somewhere in the region of £200+ expenses to go to this.

What gets me is that for the most part individual people are paying for this themselves. And for the most part it is their employer that is going to benefit. I wonder how many employers are actually helping their employees pay for this?

Tags:

NOTE: This blog entry was rescued from the Google Cache. It was originally dated Sunday 3rd June, 2007.