Friday, 31 July 2009

Symantec's Norton Ghost - not the experience I had hoped for

I recently bought a new laptop (64bit Vista. Brave or stupid?) and it took me a very long time to install and configure everything I needed, simply because of the amount of tools I need. This prompted me to do something I've been meaning to do for ages: sort out a disk backup/recovery system so if ever it fails on me, or I drop it, or it gets nicked, I can restore it to pretty much the same state without losing a whole week of my life.

Now, I could have spent some time researching the options and I'm sure there are some OK open source solutions out there, but I figured for £40 I could save time, and I couldn't go wrong with Norton Ghost, from Symantec. A big name with a huge B2C paying customer base must have a slick, intuitive, bomb-proof solution, right? You'd have thought so.

Installation went well, but my first problem arose when the product first ran. Simultaneously I was launched into two different interfaces and processes - the easy startup interface and the Live Update tool, which checks for and installs product updates. This did indeed find a product update for my newly-installed software, and attempted to install it, but the following happened:

From this point onwards I couldn't run Norton Ghost without watching Windows desperately loop in circles telling me to wait 'while Windows configures Norton Ghost' and that the functionality I was requesting wasn't available in the file C://God Knows Where/Tmp/Completely Random Place/Blah blah blah/NGhost14.msi.

So I sought help from the website, downloaded and ran the removal tool as advised, and started again.

After installing again, I chose not to run Live Update this time as it gave me problems last time. This turned out to be a mistake, as several reasonably lengthy attempts to perform a backup resulted in the following non-descript problems. Interestingly, clicking on the 'more help on the web' link did absolutely nothing.

Only later through despair did I try running Live Update again. This time it worked and updated my newly installed version of Ghost. And, lo and behold, the next time I tried a backup, it worked.

So for my next do I test the recovery process? Do I really want to practise a full disk recovery? Or, conversely, after my experiences so far do I really want to put my faith in it only to find out it doesn't work just when it really matters? hmmmmm.

I'll look into this, but assuming it works ok I think £40 for this little lot is a good deal.

Tuesday, 28 July 2009

Trimming text notes

It's been 20 days since my last post, in which time the Pitt family has grown by one and I've done very little programming, choosing sleep in my down-time rather than looking at a screen. But here's an issue I made a draft entry of a while back but never posted it for some reason.

I had some Revit files that were showing unexpected characters at the end of inserted text notes. I say unexpected, as I wasn't expecting them, so neither was our software. Closer inspection revealed these to be linefeeds or carriage returns, unprintable in your everyday text editors but nonetheless there when handling the data and making database comparisons. They got there because of the tendency to hit 'return' when completing a text note; something unpreventable, so I have to clean them up.

I looked into the .net String.Trim method, but this didn't seem to work. Then I had a look at String.Replace, to replace the offending character with nothing. The problem then was identifying what the character actually was. I tried \n, VbCrlf, etc etc to no avail.

Then after a coffee I tried Trim(String), which I had imagined did the same thing as String.Trim. This time it worked.

So what's the difference between String.Trim and Trim(String)?

Public Function Trim(ByVal str As String) As String
Member of Microsoft.VisualBasic.Strings
Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), or no leading or trailing spaces (Trim).

Public Function Trim() As String
Member of System.String
Removes all leading and trailing white-space characters from the current System.String object.

Subtle, and not entirely clear, but it works for me :)

Wednesday, 8 July 2009

Get googling for Revit API help

Fellow blogger and all-round clever bloke Rod Howarth has founded a Revit API search engine using Google's custom search feature.

My blog is one of five blogs which the engine currently searches, and no doubt this will grow. I'm honoured to be recognised as a useful and reliable source of information, and to be there right from the start.

Perhaps I should get insurance?

DoEvents() with Revit

Just a quickie as a follow-up to my last post. DoEvents isn't recommended for .NET, but given that Revit doesn't support multi-threading we have to use it sometimes to keep our UI responsive whilst we crunch some data.

It's commonly referred to as Application.DoEvents() but in your Revit plugin Application will probably refer to the Revit app and DoEvents won't be recognised as a method. So you need to use this: