Fest08 Geek Dinner

Thanks to the NxtGenUG guys for a very enjoyable geek dinner for Fest08 last night.  Shame I couldn't clear the time to attend the actual event - although I would have been nursing a wee bit of a hangover if I had.

LINQPad - what a great little tool

I highly recommend downloading a free tool called LINQPad (http://www.linqpad.net) which execute LINQ queries and acts as a stripped down query analyser for your SQL Server databases.  I love the ability to view the real T-SQL generated for the LINQ query, or as the lambda expression. 

It's incredibly simple, requires no install (other than .NET 3.5).  It has that key attribute of good quality software; it deals with one simple task and executes it perfectly.

I also like the author's suggestion to use LINQPad instead of the standard SQL Server query analyser tools so that you start thinking in LINQ instead of thinking in SQL and converting it to LINQ.  Think I might give it a try ...

The joy of file synchronisation with Allway Sync Pro

I’m an itinerant developer armed with a laptop which means I have to deal with the issue of keeping my files synchronised with my file server.  Source code is easy, it’s under version control.  That leaves items such as documentation, Outlook PST files and MSDN downloads which are way too big and way too binary for version control systems.

For years I've been synchronising my files with a set of Windows Briefcase folders, when they came in with Windows 95.  They worked fairly reliably.  I put up with the agonizing delay to open a briefcase when the network drive was no longer connected – think 30 second timeouts on every folder being opened while it ‘checked the file status’.  However, it was Vista that was the nail in the coffin, it supports briefcases but file access rights become an issue on dual boot systems.

So I bit the bullet and looked for a file synchronisation tool.  I decided that I would happily pay for this software.  For me, I consider this is an essential business application, so paying for it is not an issue.  I also decided to change my work methods, instead of dragging a laptop around, I would carry around one of my portable hard drives, based on an 80Gb notebook drive, powered over USB, much easier to carry than a laptop (and less expensive if you drop it).

So I was after a many to many copy utility that would make sensible decisions, warn me if there were conflicts, and more importantly, once configured, be a one button fire and forget solution. After researching free products (PowerToys sync included) I found a product called Allway Sync Pro, http://www.allwaysync.com/.  I’ve now been using it for about a month, which allows me to make a considered judgement.

It’s brilliant.  Truly, it’s really, really, really good software.  I can’t believe it only costs $12 a PC (for 5 PCs).

OK, the UI design is a bit messy and old fashioned looking, but it actually does everything that you expect, and sometimes things you didn’t expect (good things).  This is a tightly focused piece of software that has a clear set of functionality in which it excels.

An unexpected feature was that it properly ‘deletes’ files it updates so they are put in the recycle bin.  At some point I must take a look at some of the more fancy options, such as how it can automatically synchronise files when you logon and logoff.

So now, before I leave my office, on my Windows Server 2003 file server I synchronise my server files to the portable hard drive.  Back home, I plug in the same hard drive and synchronise to Windows XP Pro.  Back in the office I also run a copy under Windows Vista that synchronises files from the C: drive to my file server.

So in summary, for me this is now an essential application for my business and is that rare beast - a technology solution which actually delivers what it promises and makes your life easier. 

I also think it’s a clear example of what software developers should strive for in their own software – reliable, functional, focussed on a clearly defined task, simple to use and intelligent in how it operates. I would hope that software I create can be as good as this - although probably with a better UI design,

Thanks to Conchango for hosting Silverlight User Group

Conchango hosted the first Silverlight User Group last night.  It was great to see people discussing real world problems they have encountered and how they are really stretching Silverlight to the limit.  A 3D demo of MRI scans within a Silverlight browser control was very impressive.

Tim Sneath, evangelist for the Silverlight team, was over from Redmond and did a very informative round up of the current state of Silverlight development and the envisaged roadmap to release of 2.0 RTM.

A great start to what I hope becomes a very active user group.  I can't wait for more designers to get interested in Silverlight so the developers within the user group get more exposure to good graphic design.


Although I am used to working with graphic designers in my television projects for on screen graphics and animations, I've never had the same experience with applications or web sites.  It's something I'd be keen to get involved with. Despite using a Wacom tablet instead of a mouse and being happy wandering around Photoshop, I do have a complete understanding of my level of design skills (abysmal).

Software Developement as a Craft - 'The Craftsman' by Richard Sennett

I was listening to the BBC Radio 4 social science documentary strand Thinking Allowed earlier in the week (from my backlog of DAB radio recordings) and they were discussing a new book 'The Craftsman' by Richard Sennett.

The book deals with the concept of learning a craft, as opposed to the acquisition of pure academic skills. It dealt with the sort of manual crafts that you might expect to be included, such as jewellers, wood workers, etc.  To my surprise Richard Sennett mentioned that he has spent a lot of time studying the craft of software development as part of his research.

The surprise is to hear the recognition of software development as a craft, not something obtainable by passing certification courses, but by practical real world experience. Richard Sennett reckons it takes 10,000 hours to become a skilled carpenter or musician, and by inference a skilled software developer too. That's about FIVE years of software development before you're a true craftsmen.

Hallelujah !! I was taken back to my sister-in-law telling me that she had 'decided' to quit being an actuary and was going to become a 'C++ programmer' and could I recommend a book so she could learn it over the next few months ready for applying for jobs. There was a complete lack of any realisation that you software development might require an aptitude for the discipline of software development or that it might require experience to really become proficient.  The later is mentioned by Richard Sennett, in that is important to make mistakes in order to become skilled in a craft. You are unlikely to simply read up on a craft and get it right first time. Try telling the standard line manager or project manager that mistakes are 'good' and will increase the knowledge of the team.

The only 'non craft' area of software development might be seen to be the lack of touching or coming into contact with a material. In my case, the start of any software development is nearly always a paper based exercise. Out comes my trusty ink pen (yep, ink pen, Lamy Safari, complete with blotting paper) on spiral bound notebooks, scribbling flowcharts, workflows and database schemas onto A3 or massive A2 sheets. Let's not forget my favourite tool, a decent sized white board and four whiteboard markers.

So here is to software development as a craft - a fantastic intellectual and creative endeavour that I personally find exciting and satisfying (although not always when it's Visual Studio 2003).

Ref: A meeting between Laurie Taylor (presenter of Thinking Allowed) and Richard Sennett can be found at the New Humanist web site.

ASP.NET MVC Preview 2 (March CTP) - support for shared hosting

I've been investigating the ASP.NET MVC framework for some months, in between a major client project in January and holidays in Frebruary.  In that time the ASP.NET team have been beavering away and released the MVC Preview 2 March CTP (download it here). Jeffrey Palermo has some great blog posts over at codebetter.com which detail some of the improvements.

The big news for me was that I could finally upload any applications to my development site, which is on a shared hosting server at discountasp.net, they have .NET 3.5 hosting as standard which makes life easy.  You can now just copy the MVC assemblies into the application bin folder and you have an MVC application installed.

I did hit one issue, in that the MVC handler does not route as required without the formal setup, and the in line comment s in Global.asax.cs suggesting I add the file extension '.mvc' for routing requests for IIS6 compatibility didn't work either.  The issue is that the DiscountASP team have not registered '.mvc' for processing by the ASP.NET ISAPI dll.  Obviously something I cannot configure on a shared host.

No problems though - I discovered that if I use the file extension '.mvc.aspx' for controller routing in Global.asax.cs the pages get handled by the ASP.NET ISAPI DLL, complete with MVC goodness.  Standard .aspx pages are unaffected, and as long as you don't mind the mangled URLs it all works as expected.

If you haven't yet dabbled with the MVC framework now is definitely the time to try.  Shared hosting support, combined with the excellent quick start video tutorials over at http://www.asp.net/learn/3.5-extensions-videos/default.aspx#mvc makes life a lot less painful.

P.S. after spending a few hours researching the '.mvc.aspx' solution, I found it was already in the forums on the ASP.NET site - DOH!

Virtual PC on two monitors without additional software

I've finally moved my main development environment on my desktop to Vista, and had the issue that I still do quite a bit of work for one client in Visual Studio 2003 which is not supported.  No problem - run up a Virtual PC 2007 image running XP Pro SP2 with just VS2003 and SQL Server 2000 and I have a perfect solution.  On a dual core processer with virtualisation support and lots of memory it runs fine.

However I also run on dual monitors and I'm very used to developing with VS on one screen, and my SQL tools on another.  Also I like Virtual PC in full screen mode.   Unfortunately you cannot maximise, or even resize the Virtual PC screen across both monitors.

But the saviour is the hard to find span option for Remote Desktop, not available via the dialogue but as a command line switch (needs both monitors to have the same resolution);
C:\Windows\System32\mstsc.exe /span

So, configure your Virtual PC image to allow remote connections, start it up, but don't login.  Then use remote desktop to connect over your two monitors.  It all is one big display, 2560 x 1024 in my case, so dialogs get split and you can' maximise code windows but it really works nicely.  The best bonus, running a source code diff in TortoiseSVN over two windows means the original code is one screen and the changed code is on the other - cool.

UK MSDN Roadshow 2008 - registration now open

For those who couldn't make the VS 2008/SQL 2008/Server 2008 launch in Birmingham in March, we have dates for the MSDN Roadshow in April around the UK.  I'd register now if you're interested as these events sell out really fast.

Here's the Microsoft blurb;

Now the roadshow is coming to a city near you

A short while ago you expressed interest in the MSDN Roadshow, which means you're now one of the first to hear that registration is open. We're anticipating high demand, so you'll need to act fast before this opportunity is promoted to a broader audience in the next two days.
 
The MSDN Roadshow is a series of full day, demo-heavy events where you can find out more about Visual Studio 2008 and future Microsoft technologies. It's also your opportunity to meet the MSDN team and discover the latest developer tools.

Now that Visual Studio 2008 and .NET Framework V3.5 have been launched, the MSDN Roadshow will also focus on other products of interest for .NET developers. We'll look at Silverlight, ASP.NET, ADO.NET and Visual Studio Team Suite to create sessions that are all about code, not PowerPoint.

Places are limited so register today

- Cardiff, 21 April 2008 <http://go.microsoft.com/?linkid=8384142>

- London, 25 April 2008 <http://go.microsoft.com/?linkid=8384143>

- Manchester, 1 May 2008 <http://go.microsoft.com/?linkid=8384144>

- Glasgow, 13 May 2008 <http://go.microsoft.com/?linkid=8384145>

- Newcastle, 16 May 2008 <http://go.microsoft.com/?linkid=8384146>

Dead web (href) links - don't panic, try the WayBack Machine

Just had a comment on a post where the original link was out of date (well, it was two years old).  Rather than try to remember the source of the software that was named in the broken link I just went to the 'WayBack Machine' of web archives at  http://www.archive.org/web/web.php.  I typed in the broken link (complete with parameters), and there was the original article with the key information I required.

It doesn't always work but it's a great resource when you're running out of options.

Development tools - CodeRush and Refactor Pro

Oh dear, what a long time since my last blog - a hectic pre Christmas projects, a three week Christmas and another major software development in January have really had an effect.  Fortunately I'm getting back on track with new development and once I'm back from a holiday in the Caribbean I'm hoping to get some serious research into new technologies including the MVC framework from Microsoft and getting my CI Factory installations up to date.

As part of this new push, I looked into finally taking the plunge and buying either Resharper (from JetBrains) or CodeRush (from Developer Express) to enhance my Visual Studio development experience.  The decision wasn't easy, and wasn't affected by the fact that Oliver Sturm (who works for Developer Express) is a member of the London .NET user group in which I'm involved.

I'd heard pros and cons from fellow developers for both sets of tools, read the blogs and studied the respective product web sites.  Visual Studio 2008 support was definitely going to be an issue, as well as legacy support for Visual Studio 2003 (God help me, I still have to use it regularly).  I also wanted something that will run OK on my ageing 1.5Gb 1.6Mhz Centrino HP laptop.

In the end I went for CodeRush and Refactor Pro from Developer Express.  I know that had I already been a Resharper user, I would have missed the ability to quickly find usages of classes - but I've never had it so won't miss it; and this feature only works due to the code analysis which according to rumour, would most likely cripple my 1.6 Centrino laptop.

However, here are my top two show stoppers for Resharper;
  1. Resharper (as of January 2008) does not support Visual Studio 2008 fully (it has a free upgrade when the new version is completed which is a superb offer from Jetbrains)
  2. If I wanted Visual Studio 2003 and Visual Studio 2005 support I would have had to buy TWO licences.  CodeRush comes with a single licence for a developer for ALL versions of Visual Studio.
It was support for ALL versions of Visual Studio that mattered to me, and the single developer licence; it can cover my multi o/s laptop and desktop, as well as a Virtual PC image for Visual Studio 2003 / Windows XP to allow VS2003 development on a Vista base o/s.

My first experiences are fairly positive; creating some new data classes in Visual Studio 2003 was made much easier with the CodeRush templates handling converting private variables into Property get/set blocks.  Also, the ability to break arguments over multiple lines has greatly helped tidy up legacy code which I didn't write.  I nearly panicked that there was very little documentation on all the template short cuts within CodeRush, then I found how to display the CodeRush helper window (now docked with my Solution/Class explorer window) which provides 'next key' help for all the CodeRush short cuts.

Once I'm back from my holidays I expect to be really ramping up the Visual Studio 2008 development on my dual core Vista desktop, which should give me a much better CodeRush experience.  So expect a more detailed review to come towards the end of February.

UPDATE 30 Jan 2008 : Oops, point wasn't true, although the JetBrains web site didn't make this clear, so shame on them for not telling me clearly, and shame on me for not e-mailing JetBrains customer services.  I was still concerned about Resharper's CPU usage though.

Thanks to the guys at the Birmingham NxtGenUG last night

Thanks to the Birmingham NxtGenUG last night who were subjected to my discussion of developing Windows Services and the arcane arts of the Event Log.  It was great to have the opportunity to talk about what is a rather old fashioned topic for most developers.

I have made some minor updates to the PowerPoint and they are all located at; https://www.hosted-projects.com/trac/tigernews/freecode, just login with the user name and password sent out in David McMahon's e-mail.  I'll be enhancing the wiki with more detailed content on how to use the sample code, but for now you can access the PowerPoint, and browse the source in your browser or use SubVersion/TortoiseSVN to download all the sample code from last night.

One guy (sorry, didn't remember the name) asked whether there was a good plug in for Visual Studio to handle SubVersion; it is indeed called Visual SVN, and you can get details about it at http://www.visualsvn.com/. Personally I happily use TortoiseSVN outside of Visual Studio, but I have good reports from other users and the demo that I tested replicated the ease of use you get from integrated source control.

And finally, a thanks to the guys for the speedy drop off at Birmingham New Street which made sure I got back to London on time.

DDD6 - now open for registration

DeveloperDeveloperDeveloper 6 - Saturday 24th November, Reading, UK.

Get your registration in now, it tends to book out quite quickly;

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032357828&Culture=en-GB

Not sure if my CIFactory talk has been voted into the agenda. Not sure whether my speaking would make you want to head off to Microsoft's UK HQ, or ensure you had essential early Christmas shopping to complete.

SqlBits podcast

Craig Murphy was wily enough to record an interview with both myself and fellow developer Matt Barrett after the SqlBits conference.  Enhanced by the 80's music of Reading Bowl you can now experience the effect that several (free) pints of Guinness has on my diction;

http://www.craigmurphy.com/blog/?p=743

Thanks to Craig for the tidy editing (he must have done some, believe me).

DDD6 - 24th November - You have until 19th October to get your vote in

Voting now open on DDD6 here, http://www.developerday.co.uk/ddd/votesessions.asp, so get your 10 votes in to make sure it's the conference you want it to be.

Those who are eagle eyed will note that my bribes to the organisers were obviously well received as my yap about CIFactory has appeared at the top of the voting table .....

SqlBits - notes from grok on using NTFS file encryption to secure SQL Server databases on laptop computers

This is a summary of the grok talk I gave at the SqlBits day at Microsoft UK in Reading on 6th October 2007. Thanks for all the delegates who finished lunch early to make the grok talks and I hope it proved useful.

The target audience for this grok talk was those developers using SQL Server (2000 or 2005) on their laptops who might want to secure those databases. This issue is becoming more important as horror stories of lost laptops containing sensitive customer information now seem to appear every other week.

Admittedly if you use Windows Vista Ultimate / Windows Vista Enterprise and you can make use of BitLocker to encrypt the entire hard drive the job is already done for you.  This is especially true if you have a built in TPM module and a fingerprint reader to accompany it.

If you have any other flavour of Windows Vista (including, unbelievably, Vista Business) or Windows XP, we don't have BitLocker and we have a security hole.  If your laptop is stolen, the drive can be removed placed in an external caddy, and straight away the MDF and LDF can be copied to another SQL Server. NTFS standard file security is implemented by the operating system booting from that drive, so read only access is easy and once an MDF/LDF is attached to another database, user rights within the original SQL Server don't apply.



One solution is to make use of NTFS file encryption.

Ideally don't start with an existing SQL Server installation, as you want to install SQL Server as a known user, not as the default 'Local System' or 'Network service'.
  1. Create a new user (say, Sql2005Developer) with a complex password
  2. Install SQL Server as a named instance, running as this new user
  3. (optional) During install you can specify a separate data directory, say C:\encrypted\Sql2005Dev
  4. Once everything is installed - login as the new user, and use Windows Explorer to encrypt your data directory (make a cup of tea if you have any decent sized DBs in this directory - it takes time to encrypt/decrypt large files)
The reason for using a named user is to give you the ability to easily encrypt/decrypt directories by logging in as that user.

Extra 1 - Don't forget the password for SQL Server user (or see Extra 2)

If you forget the SQL Server user password, and you reset it from the Administrator account the encryption key is reset and all the currently encrypted files will become unreadable.  So make a backup with ...

Extra 2 - command line encryption tool CIPHER (see cipher /help for command line options for this tool)

 cipher /e /a /f <directory-name>    ENCRYPTS directory, including all files
 cipher /d /a /f <directory-name>    DECRYPTS directory, including all files

Demo of cipher
  1. Create the following directories, c:\temp\encrypted and c:\temp\not-encrypted
  2. At a command line use cipher to encrypt directory (if viewed in Windows Explorer the folder name should be a different colour to indicate it is encrypted)
  3. Now create a new text file in 'encrypted', copy to 'not-encrypted' - it is still encrypted, encryption moved with file
  4. Create a new text file in not-encrypted (this should not appear in a different colour as it is not encrypted)
  5. At a command line open a new command line running under the administrator user, runas /user:administrator cmd, and try to edit the encrypted text files (can't read either, encryption followed file)
  6. If you need to backup the encryption keys use, cipher /r:<cert-filename> <directory-name> to backup the keys to the two key files. These can then used to restore encrypted files, see additional information on the cipher tool on microsoft.com.
Extra 3 - removing the new SQL Server named user from fast user switching user list

If you do have a named user for SQL Server, this appears on the user list in Windows XP (only appears if fast user switching is enabled, and not for machines on a domain).
  1. In regedit, locate SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList\ in the HKEY_LOCAL_MACHINE branch.
  2. Right click on the UserList and select New, DWORD value
  3. Rename New Value #1 to the new SQL Server named user account
The name will now disappear from the user list. This prevents the easy method of logging in as the SQL Server user to perform encryption operations via Windows Explorer. However, you can always choose to use the runas command to login as the SQL Server named user, opening a new command window in which you can run the cipher tool.