Monday, 20 October 2008

Help! I have Multiple Internet Personality Disorder!

Update - looks like you can already do this. chrome.exe will accept a --user-data-dir="" switch, so you can set up shortcuts with different profiles - and it works, really quite well. I now have three Chrome shortcuts that bring up different homepages with different sets of persisted cookies. No colour-coding or cool icons, though...

I have too many Google accounts. Or rather, I have the right number of Google accounts for me, but that's too many for Google, who would seemingly be much happier if I only had the one.

I'll explain. I have a Gmail mailbox, which I forward copies of stuff to, so I can get hold of it from anywhere. My main mailbox runs on a Linux box so old I think it's actually running Redhat instead of Fedora, so Gmail acts as a second-level backup strategy as well. There's a couple of calendars and things in this Google account as well. I also have a Google account linked to my 'real' e-mail address, which I use to sign in to Blogger and various other online services that have ended up under the Google umbrella. Then I have another set of credentials, which are the accounts we've set up at work for access to stuff like Google Webmaster Tools and Google Analytics. I'm not entirely happy with Google linking my e-mail or my blog to my employer's website statistics, so I keep this separate as well.

imageBasically - I want multiple, independently-persisted identities, with their own history, their own cookies and their own shortcuts, so when I say "remember me", I'm actually saying "remember who I'm pretending to be right now" Google Chrome already has 'incognito mode' (and we all know what that means, right?). Can we have work mode, home mode, geek mode, pretending-to-be-a-client-so-I-can-test-my-own-website mode, and as many other modes as we want? With their own colours? And icons? And desktop / start menu shortcuts?


Actually, it doesn't have to be Google Chrome at all, it's just that their little "secret agent" icon guy worked really well for the screen mockup. Firefox could do this. Or even Internet Explorer. I know there are cookie-switcher add-ons for Firefox et al, but what none of these solutions offer, as far as I can tell, is the ability to use multiple identities simultaneously - and since Google's made such a big thing of Chrome's separate-processes-for-each-tab technology, it seems like it couldn't be too hard to give those processes their own profiles and history.

Saturday, 18 October 2008

Adding a work-in-progress to Subversion

I love Subversion, but from time to time I'll stumble across a bit of SVN behaviour that just doesn't feel quite right. Case in point - you've created 10-15 files, set up a folder structure for a new project, made rather more progress than you were expecting to, and now you want to check the whole thing into revision control.

The 'proper' way of adding existing code to a repository is via the svn import command, but that doesn't turn your local folder into a Subversion working copy. Having completed the import, you'll then need to move/rename/delete your work in progress, and then do an svn checkout to download the version of your project that's now under revision control. This can take a while if you're working on big files and your repository is on the far end of a slow connection... and even when that's not applicable, it's still frustrating.

So, here's how you can add a new project to Subversion without having to do the import-checkout shuffle.

  1. Use the repo-browser to create a new empty folder in the repository - this will form the root folder of your new project, so call this folder /myproject/trunk or whatever you'd normally use.
  2. Check out the empty folder into the folder containing your work-in-progress project.  You'll get this warning - which is fine, because what you're doing is 'wrapping' an empty SVN folder around your existing work.


  3. You'll check out a single folder, and you'll see that your project now consists of a root folder with the happy green SVN icon, containing a bunch of folders with the question-mark overlay that means "Subversion doesn't know about this folder yet..."


  4. Now you can do an svn commit in the usual way, and it's trivial to add the 'new' files (i.e. all of them) that should be added to the repository. On the first commit, you'll need to uncheck the bin/obj folders for .NET projects, and then on the subsequent commit, you'll be able to add them to the SVN ignore list (you can only ignore a folder whose parent is already under version control)

Friday, 17 October 2008

Googling the Zeitgeist

Just for fun, I googled "website", and got  a little glimpse into the internet zeitgeist as Googlebot sees it. With such a generic query, it's basically comparing websites based on a lowest common denominator and, presumably, the sites with the greatest number of incoming links and highest page-rank bubble to the top. tells us the most important website-related websites in the world, right now, are

  1. The painted shutters of Serra san Quirico, in the Marche, Italy.Website - Wikipedia, the free encyclopedia
  2. Welcome to Obama for America - Barack Obama's presidential campaign website
  3. Microsoft
  4. (who are presumably here because they talk about websites a lot)
  5. Adobe
  6. Apple
  7. The IRS (US tax and revenue agency)
  8. Starbucks
  9. McDonalds
  10. Subway (restaurants)

That's interesting... Wikipedia, Barack Obama, tech companies, coffee, taxes and fast food. It's like a little summary of the daily lives of hi-tech America. (Worth noting that of the sites in that list,  Microsoft, Apple and Adobe have a Pagerank of 9/10, while has a fairly unremarkable 6/10)

Then Ben Taylor tried the same thing on Google UK, which gives us

  1. The BBC
  2. Banksy (the "street artist")
  4. Oasis (the band)
  5. The Secret Intelligence Service
  6. The British royal family
  7. Bloc Party (the band)
  8. The National Trust (an organisation that works to protect historic buildings and sites of natural beauty in the United Kingdom)
  9. Number 10 Downing Street (official residence of the Prime Minister)
  10. Shakespeare's "Romeo & Juliet" on Google Books.

That's us... Graffiti, Shakespeare, history, and rock'n'roll... how very British.

It'll be interesting to see how those lists change over time... graphing the progress of specific topics up and down the Google "website" results over time would make for interesting viewing. Watch this space. Or rather, come back in about six months when I've got the data, and then watch this space.

Thursday, 16 October 2008

Updated VS2008 / Castle / NHibernate solution bundle

image I've just uploaded a new version of my quick'n'dirty VS2008 solution, which now includes the log4net and Iesi.Collections projects (these were formerly being referenced from Program Files\Castle Project\ and so wouldn't build on a box without Castle installed).  The whole thing is now completely self-referential, so it should build & run without any dependencies other than the .NET framework itself, and everything's done using relative project references so you should be able to get step-debugging right down to the SQL command calls. But it's late and I haven't tried that yet.

As I've said before, this is aimed at getting something up and running with the Castle ActiveRecord stack as easily as possible, so I can play with it and see what it does.

Having seen Ayende's post about building Rhino-Tools from the various libraries' SVN trunks, I'm now convinced there might be a way of using SVN externals and NAnt to create a single project that automatically builds against latest trunk revisions of the various libraries - I guess this is one of those areas where only experience will tell you whether you're better off running against nightly trunk commits or just picking a stable revision and building against that, but I'm sure it'll be educational finding out.

You can get the ZIP here if you're interested. Again, I must restate that I didn't write any of this; log4net is distributed by Apache, NHibernate is from,  Castle is from, and all I've done is package them together for convenience.

Thursday, 9 October 2008

Cycling, Eyedroppers and the Benefits of Laziness Applied with the Proper Tools

I  cycle to work. I work in Leicester Square in London, and I live about three miles away. On a really good day, the trip door-to-door by public transport takes about 25 minutes. On a really bad day, you can end up stuck on a crowded bus full of angry people, in standstill traffic, for two hours, because there's a problem on the Underground on the same day they're digging up the water mains along the bus route.

Dahon Matrix 2007 - yep, it's a proper bike that folds in half. That's how I get it up to the fourth floor in the lift every morning.By bike, it takes about 20 minutes, plus time to shower & change when you get there. But that's a constant. It doesn't vary depending on traffic or roadworks or industrial action by Underground staff.

I believe that cycling is the 'optimum' way to travel to and from work. If software development was travel, cycling would be agile, test-driven and all that jazz. It's healthy, it's cheap, it's green, it's often fun. What I really love about it, though, is that even after a rotten day when I'm tired and fed up and just want to go home, I still get 20 minutes of exercise on the way home, because I have to get home somehow, and cycling is the fastest and easiest way to do it.

Good software tools should be like bikes; they should encourage better habits by making the right thing to do  the same as the easy thing to do.

Which, by a rather circuitous route, brings us to Instant Eyedropper, which I stumbled upon earlier this week and find myself rather smitten with. It's tiny. It's fast. It's free. It works ridiculously well. It loads on startup, sits in your system tray, and when you need a colour , you just drag it out of the system tray, drop it onto the colour you need, and it copies the appropriate hex code to your clipboard. It takes about a second - literally - and then gets the hell out of your way so you can get on with whatever you were doing.

I have occasionally, in the past, "guessed" HTML colour codes on the fly because I can't face digging through CSS looking for the or opening Photoshop just to use the eyedropper tool to pick a colour off a screen capture. I've used eyedropper tools before, but somehow they've never quite got the formula right. With Instant Eyedropper, thought, when you're in a hurry, it's quicker to do it properly than it is to guess. I like that.

Check it out. It's free and you might like it.

Thursday, 2 October 2008

ASP.NET MVC Preview 3 and Linq-to-SQL - One Month On

At the start of September, we launched a web app based on ASP.NET MVC preview 3 and Linq-to-SQL, and I'm happy to say that it's generally gone really, really well.

Our primary codebase is legacy ASP in JScript, but for this latest project - an online proof and payment system for actors renewing their Spotlight membership - we needed something faster, more robust and generally better. I'd been playing with the ASP.NET MVC previews since version 1, and while the framework's obviously still very much in development, I figured my ASP.NET background would mean a much easier learning curve than trying to pick up MVC at the same time as learning a new view engine like Brail or NVelocity. I used a Linq-to-SQL implementation of IRepository<T> based on code from Mike Hadlow's Suteki Shop project -the original intent was just to try it out for a couple of hours to see how it worked, but it performed so well for what we needed that I just went ahead and built the rest of the app on top of it.

Linq-to-SQL clearly has some interesting potential, but it's also clearly showing right now the biggest problems with it are the slightly clunky tools (having to hack the XML to create cascade delete relationships, no way to refresh a table in the LINQ designer if the schema's changed, for example) and the big question mark hanging over its future. Between Entity Framework and the various open-source OR mappers competing for mindshare, not to mention talk of a Linq-to-NHibernate implementation, it's really not clear whether Linq-to-SQL will ever see another release which fixes the problems with the current release, or whether it's just going to be quietly retired as a historical curiosity.

ASP.NET MVC, on the other hand, looks like it's really going to go places - especially with the news that Microsoft are going to be shipping - and supporting - jQuery with ASP.NET MVC and Visual Studio. The day I get my hands on Intellisense for jQuery will be a good day indeed. I can't wait.