John's Adventures

Archive for the ‘Technical’ Category

The FOWA Workshops, Day Three

Well my head's just about stopped spinning following the Future of Web Apps conference. The third day consisted of a series of workshops, the idea being you chose one for the morning and one for the afternoon.

The morning workshop I chose was Khoi Vinh – who is the design director for NYTimes.com – talking about using a grid technique to design web sites. I hadn't been sure if I'd find this one interesting or not but it turned out to be a fascinating insight into web site design. He's a properly trained graphic designer and unlike me (who used to be a web designer many moons ago) actually knows what he's doing – I'd always had a "keep tweaking until it looks right" approach to design whereas he demonstrated a very impressive technique for designing web content. I left the workshop immediately wanting to redesign this site and any others I can get my hands on so it must have worked!

The afternoon workshop I went to was run by Stefan Magdalinski who is the CTO of Moo. Moo, in case you haven't heard of them, are a company that make business cards. Doesn't sound very exciting, but they make them with a twist. You can choose pictures for the front of them from your Flickr or Bebo photos, they're a different size to your standard, run-of-the-mill business cards and they're made in such a way that they look incredibly cool. As soon as I saw some in the flesh I immediately wanted some! They're so cool you'll want to give them out to people at parties. Go check out the site, order some and then come back here to keep reading… Off you go

Stefan's a really interesting guy. He's been in the software game for years and is a bit of a start-up veteran. He's a proper techie and led us through the challenges of creating Moo along with some of his other past work (particularly UpMyStreet). He had some interesting stories about how Moo came to being, the pitfalls of working to someone else's API (such as Flickr's API – something I know all about with John's Background Switcher) and 3rd party libraries, the problems of getting popular FAST and a host of other things you'll likely come across if you start your own web app company. Very interesting stuff and I've already ordered my Moo cards and persuaded some friends to do the same – all it takes is to just show people and they consistently say "wow, I want some!".

I must take this opportunity to thank my good friend John Topley. Attending FOWA07 was his suggestion and he had the misfortune of being stuck with me for the whole 3 days! How he managed to cope with my dry wit and terrible sense of humour I'll never know! Fortunately he's a long-in-the-tooth cynic like me so we were on the same wavelength for most of the time and both cringed every time we heard buzzwords like "mashup".

John also introduced me to the exciting world of the Mac. There were far more Mac users there than PCs and playing around with Mac OS X for a while showed me just how much Vista's GUI is a copy. Really, pretty much every "innovation" is a straight copy from the Mac and when you see some of them in the context of the Mac they make a lot more sense than on Vista. And it's true what they say, out of the box the Mac really is full of creative-enabling software whereas the PC is all business and starchy shirt and tie. Those Mac vs. PC ads are right!

I'll definitely be going to the conference next year and you never know, by then I might have some exciting web app that'll change the world myself! All I need to do is think how I can bring background switching to the online world – or port it to the Mac where it'll be much more fun for starters…

My Thoughts On The Future Of Web Apps, London 2007

The Future Of Web AppsWell, I’ve just spent the last 2 days attending the Future Of Web Apps listening to a lot of interesting people talk about their start-ups, their successful companies that came from start ups, venture capital funding, some of the movers and shakers in the California tech industry talking about moving and shaking and a sprinkling of other fascinating people from the likes of Yahoo!, Google and Amazon.

I must confess that I’m not really one of these people who pays much attention to hype and “the next big thing”. I know there’s a whole scene of bloggers who’re hyping lots of start ups, lots of cool web apps out there that “everybody’s using” and while a few years ago I’d have been right in there trying everything out and getting amazingly enthusiastic about everything for 5 minutes then moving on, I’m a bit long in the tooth nowadays and prefer to spend my time doing constructive things rather than jumping on bandwagons. I’ve heard of sites like Techcrunch and such but haven’t really paid any attention to them. Enter John The Cynic! ;-)

Having seen first hand what it’s like being in a company that goes from start-up to acquisition and the problems associated with growing from 6 people to 30 it was like a trip down memory lane listening to the stories of companies like Last.fm (which I’ll definitely be checking out – I was impressed by the calibre of the people, how they’ve done what they’ve done and what they’ve actually done). I was reminded of the hard work, the constantly changing direction, the mistakes made, the highs of getting it right and so on. Happy days!

What’s definitely different from when I went through all this is that web software (as opposed to the vision software in the electronics industry I worked in) has to have a community around it using the current (I hate to utter the words) “Web 2.0″ strategy of building interest and ultimately making money. What also struck me is that the some of the challenges are one hell of a lot less of a problem than what I worked on. If you want to try out a new feature on the people using your software, the time between idea and going live with it can be a matter of days, or even hours and the associated costs are much lower. Whereas in nasty old monolithic client software you can’t really get away with that and it ends up taking months before you can try something out (what with long release cycles you can’t just drop in things left right and centre). Plus the tools and technologies available today make realising your idea as a web app a technically far easier proposition than making your dreams a reality a few years ago in so far as your plumbing : creating ratio is much more weighted towards creating. These are good times to be a software developer!

Highlights for me included seeing Kevin Rose (the man behind Digg) talk about the development of Digg and some of the problems facing it. It’s hugely popular and having found myself on the front page of Digg last year I can only guess at how many people use the site. It’s an interesting problem growing a site to the point that it has 900,000 active users in the same place and they don’t all get along. Trying to manage the social aspect of a site like that is a tricky one and must be fun to work on!

Another highlight for me was Jonathan Rochelle from Google. He’s one of the men behind Google Docs and Spreadsheets and was one of the founders of the company acquired by Google that did the spreadsheets part. I’ve used Google Spreadsheets right from when it came out and even did a fair bit of wedding planning on it! Being able to have my good lady looking at it at work while I’m at my office doing the same, both making changes at the same time and chatting over the built in IM was very useful indeed.

But the best thing for me was seeing the man who invented PHP, Rasmus Lerdorf up on stage. Nobody who’s worked on web software over the last 10 years could fail to have come across PHP – it made developing web apps orders of magnitude easier than it was before and forms the cornerstone of LAMP – as used by a great many web start-up companies and BigCo’s besides. Yet for such an important person he was – as is often the case with very smart people – extremely humble and pragmatic. He was definitely from the old school and made a very interesting speaker.

What I found most peculiar – aside from people’s over-enthusiasm over announcements about things like OpenID (which for me like is swapping a bag of cats for a can of worms (that’s the long-in-the-tooth cynic in me kicking in again, sorry)) – was some of the people in the audience. Those who sat and blogged everything that was said in real-time did a very impressive job and I doubt my brain would have let me do that. However, there were loads of people sitting there playing games, emailing, looking at CVs and just generally doing anything but listen to the speakers. Makes me wonder why they (or their companies) have spent good money to send them to a conference where they’re not paying attention.

I always find it strange that people think they can listen, email, IM, play Risk and think all at the same time and be “super-productive” – “connected” as it were. It’s simply not possible – you end up doing a half-arsed job of all of the above. It’s a proven fact that merely talking on a mobile phone while driving massively reduces your ability to concentrate, and neither of those activities requires much brain power.

However, I’ve come away from the conference feeling positive and with a few ideas floating around my head that weren’t there before. Don’t expect any world-beating web applications to appear from me any time soon, but it’s certainly expanded my point of view and exposed me to a world I’d paid little attention to. The future of web apps for me has just started.

Off To The Future Of Web Apps

Well, this is an interesting turn of events. I'm sat on a train down to London on my way to the Future Of Web Apps conference. My friend John said a while ago that he was going to go and suggested I give it a look. Just perusing the list of people going and the subjects they were covering for 30 seconds was all I needed to start pestering my boss to let me go! That was a few months ago and suddenly it starts tomorrow.

I'm sure I'll meet lots of interesting people, listen to lots of interesting things, learn a hell of a lot, have a few ideas pop into my head and come back with my creative juices flowing at Maximum Homerdrive. I'm not going to do the Scoble thing of sitting in a conference blogging about what's going on as it happens. As anybody who's seen me cook knows, I struggle to poach eggs at the same time as making toast – so I'll stick to doing one thing at a time if you don't mind!

I've never been to anything like this before so I'm not entirely sure what to expect but I'll keep my mind and eyes open. Should be fun! I'll keep you posted…

Vista Hates My Scanner or My Scanner Hates Vista

I needed to scan something in to my computer and I realised as I switched my scanner on that my newly installed copy of Vista hadn't seen it yet. "No problem" I thought, it'll either find the drivers itself or I'll put the CD I got with it in.

It failed to find the drivers both on the web and on the CD. "Strange" I thought. I assumed it would be using some standard means of communicating with the computer (TWAIN) that Vista could easily handle. So I went to Epson's web site to get the latest driver and realised there weren't any for Vista (yet there were for some of their other scanners). It's not an ancient scanner, probably a couple of years old so I was surprised I couldn't get it to work.

After a reboot I was greeted with this friendly message:

Vista doesn't support my scanner

Not very reassuring and in all the years I've been using Microsoft Windows, this is the first time a piece of hardware has failed to survive an update. May it rest in peace…

Of course, I also have a server running Windows 2003 lying around so I plugged it into that and the scanner worked as sweet as a nut. But it's interesting to see that underneath quite a lot clearly has changed in Vista and the days of Microsoft's legendary obsession with backwards compatibility may be starting to fade. Either that or Epson haven't updated their drivers yet and I'm just getting burned for being an early adopter!

Welcome To The World Vista

Well, today, apart from being Tuesday, marks the day that Windows Vista is officially released to the world. It's been years in the making, delayed more times than I can remember, been slated left right and centre for having features cut and yet I'm sure it'll be a huge success.

I've been using it since the beta versions last year and while it's being released to the public today it has in fact been available for business and developers (like me) since November (if I remember correctly). Naturally I installed it on my work and home machines to try and live with it full time and see what it's like (I'm curious that way). So having been a constant Vista user for a few months I thought it was about time I wrote down my thoughts.

Firstly, I'm not going to use the words "revolutionary", "incredible" or "amazing" other than to say that it isn't any of those. It's just better.

The fancy graphics are indeed impressive, who wouldn't be impressed by a 3-D windows switcher like this?

The Windows 3-D switcher

The glass-like effect of the windows is very slick as are the animations. But after a while you don't even notice eye candy like that. I use my computer as a tool and so I'm not really that bothered how "nice" it looks, as long as it's easy on my eye. Which brings me to my first point. It really is easier on the eye. I get eye strain when I stare at a computer for too long and have to wear glasses. Since switching to Vista, I haven't needed to wear them once. I don't know what they've done, but the text on the screen doesn't strain my eyes any more!

Vista is like that. Compared to XP there are little improvements here and there that, on their own, don't really amount to much. Like touch-up tools on the picture viewer, or the address bar in explorer acting like buttons so you can go up the hierarchy much more easily than before, or the Start menu being more logically laid out. But together these things add up to a better experience – it just gets in your way less like all good software should.

It's undoubtedly more secure – I wrote before about how annoying User Account Control was, but I'm happier with it now. It doesn't get in the way once your machine is set up and it's reassuring that you're running as a restricted user so if some rogue software does take over your machine, it can't do any damage. Having said that, I haven't had a virus or Trojan on any computer for many many years.

It's also faster than Windows XP on the machines I use. My home desktop is an ageing dual P3 800MHz (which isn't exactly fast by today's standards) but Vista is noticeably snappier than XP was before it. My work machine is still as fast as always as is my laptop. It's not often that new operating system is quicker in this day and age.

I know that an enormous amount of work has gone into Vista and underneath some huge advances have been made. But to the average user none of that is likely to make a whole lot of difference. And that's the problem. If I had to go back to XP I could and while I might miss a thing or two about Vista, it wouldn't matter that much to me. Make me go from XP to Windows 98 or 2000 and I'd complain a lot more!

If I had to fork out the upgrade cost out of my own pocket, I'd find it really hard to do so. At the end of the day Vista is a better operating system than XP, but it's not really that much better on the surface and in day to day use. Trouble is though, Microsoft created a pretty good O/S in XP and to create a new one that seems as large a step forward as XP was is practically impossible.

That being said, I'm not about to go back to XP and it's very easy to sit and say I "could", but quite another to actually go through with it! It's definitely a big step forward although it's really a case of a huge number of tiny steps adding up to one big step. It's been oft said that people hate change, yet people seem to have been expecting some revolutionary changes with Vista (most likely the Microsoft PR machine causing that perception) that it's not living up to. However I think in reality people really want lots of small incremental changes that mean they know where they are, don't feel lost, but make their lives easier. And I think Vista has managed to do that well, as well as looking very pleasing to the eye.

Contrast that with the revolutionary Office 2007 that's also released today. It really is revolutionary since there are no toolbars or menus – everything has moved! When you start using it you really struggle to work out how to do anything at all. Your previous knowledge is rendered useless and you have to relearn everything from scratch. Sure, once you get there it's better than it was before, but the learning curve is a frustrating nightmare and a lot of people have moaned about it. I think Microsoft are damned if they do and damned if they don't at times!

Still, in many ways it's the dawn of a new era. Only time will tell if it's one for the better or the worse for Microsoft. If I were a betting man I'd say the former.

How to default to Search Companion with Windows Desktop Search 3

Much though I love the newly released Microsoft Office 2007, one thing bugged the hell out of me. To get search to work in Outlook (and search is handy if you want to find specific emails from 6 months ago with work you were supposed to have done by now) you need to install Windows Desktop Search 3. This is all well and good until you decide you want to search for files on your hard drive. You click ‘Search’ and this comes up:

Windows Desktop Search where I don't want it

Yep, it’s replaced the standard Windows search companion (and the friendly dog). That’s all well and good, except it’s an indexed search so doesn’t necessarily reflect what’s really on disk. And since by default my program files folder isn’t indexed, it never shows any results no matter what I search for – until I go in and change the settings then wait for it to get around to indexing the folders.

There’s a link at the bottom of the tab to use the trusty old search companion, but it means clicking it every time. Oh, and before you ask, no, there isn’t an option to disable this irritating integration in WDS! I hate it when software comes along and arrogantly replaces existing functionality with itself and gives no way to remove it. I only put the thing on so Outlook would be able to search emails, not to make me click more buttons to search for files!

Of course, you can in fact turn it off, as a little digging has turned up. Simply open RegEdit (hit Start > Run then type ‘regedit’). Go to the following node:

HKEY_CURRENT_USER\Software\Microsoft\Windows Desktop Search\DS

Then double-click on ‘ShowStartSearchBand’ and set the value to ’0′. Close that and you’re done, the next time you click ‘Search’ in explorer, the old, reliable search companion will appear. This applies to operating systems before Windows Vista, since Vista has far better search that actually works! (Okay, now someone will say it just uses WDS and I’m an idiot – wouldn’t be the first time).

Some Thoughts on Windows Vista

I decided to install the first release candidate of the new operating system from Microsoft called - as I’m sure most people know - Windows Vista. Like all users, I’m not a big fan of change so it took me a while to get used to where everything’s moved to. Much like Office 2007, things are more logically organised, it’s just that when you get used to them one way it’s hard to adapt to the new way, even if it’s more logical.

Once I got past that I was a bit underwhelmed initially to be honest. I like Windows XP and I’m quite happy with it. My initial impressions were that while there was some fancy new eye candy there really wasn’t anything groundbreaking that would make me say “ditch XP and go to Vista now!”. However under the hood, an incredible amount of work has gone on to make Windows more secure and run faster.

In terms of security, frankly I found all this User Account Control to be a pain in the ass so I disabled it. The idea is that you run software and it’s run as a restricted user so it can’t do any malicious damage to your machine, unless it requests admin rights and then you’re asked if you want to grant them. This can be irritating when it pops up for everything you run (an exaggeration I know but it feels that way after a short while), and even more irritating when you run older software that unwittingly accesses “restricted” areas as part of its normal operation so stops working correctly. I found this with TextPad not being able to remember all of its settings, for example. You can opt to run applications as an administrator but it’s still a pain and gets in your way when using software not designed to use it (I guess a lot of software companies will have to release patches to fully support Vista). Since I know what I’m running, I just turned UAC off for now, I’ll take the risk!

In terms of performance it seems to be a lot faster than Windows XP, which is no slouch. I’m testing it on my trusty old dual P3-800 workstation with 1GB of RAM (which used to be BUILDMACHINE3 at a company I used to work for) and while the fancy Aero glass interface won’t render (the graphics card is ancient) it really does fly.

It’s a lot easier on the eye too. I can suffer from eye strain when staring at a computer screen for too long so sometimes wear glasses. With Vista I’ve noticed I don’t need them at all and I can stare at the screen for hours and have no eye strain whatsoever. They’ve obviously done something to the fonts and ClearType because it’s just so much easier to look at!

So it’s faster than XP, looks better than XP, has some fancy software that XP doesn’t have and a lot of redesigned GUI like the Start menu and control panel amongst others. I was looking forward to using it from now on. But I’ve hit a problem. “Find in Files” hangs Visual Studio 2003 in Windows Vista and it’s not likely to be fixed. You see, Microsoft are not going to support Visual Studio 2003 on Vista.

I can perfectly understand why. In previous versions of Windows Microsoft have gone to unbelievable lengths to preserve backwards compatibility with older software. The number of workarounds coded into Windows for bugs in 3rd party software is staggering. However since Vista has such a different security model to previous versions, some things are just going to break and in the interests of protecting end users in the future and moving the technology forwards, that’s a sacrifice they’re making. Were I in the shoes of those making the decision, I suspect I’d make the same call.

Print preview won't be in Notepad any time soon!It’s very easy for someone to criticise and say “well they should just fix it”. But when you see the amount of work that goes into every feature that makes it into Windows (in short, anything ending in “bility”, such as reliability, localisability, internationalisability, compatibility, usability, testability, manageability, upgradeability and so forth), you have to admit that you just can’t do everything, you have to make judgment calls and do what you think is best. Putting a feature like Print Preview into Notepad would be a straightforward coding task, but to get it into the next version of Windows would take a hell of a lot of work and quite a few people – all of which takes time and money. They have to choose very carefully where to invest that time and money if they want to actually ship the product in the next century. Those who are quick to criticise clearly don’t appreciate what a massive undertaking shipping a new version of Windows really is – you just can’t get away without having such controls in place to ensure shipping a solid product. It would certainly scare the hell out of me!

I still use Visual Studio 2003 to develop John’s Background Switcher and some other bits and pieces. In fact that’s all I use it for since at work I use VS2005 and .NET 2.0. I’ve been tempted to move to VS2005 for many reasons including the number of bugs fixed in 2.0 that exist in 1.1, although I’ve not done it yet since .NET 2.0 penetration is nothing like as high as 1.1. I’ve posted a question on my discussion forum to see if anybody has any opinions, if not I suspect I will so I can keep using Vista!

However for the time being it means I won’t be running Vista exclusively since the only work I do on my home machines is VS2003 based and I seem to use “Find in Files” a surprising amount! It’s a shame because Vista really does look impressive and the more I’ve been playing with it the more I’ve liked what I see. And remember, I don’t like change, so for me to jump to a new version of Windows, I must be going to a better place…

Update (27 Feb 2007): Jim Salem found a fix on the MSDN forums for the Find In Files problem I mentioned with VS2003 on Vista – check the ‘Disable visual themes’ box on the Compatability tab of the properties for the shortcut to VS2003. Thanks Jim!

TinyMCE and Movable Type In Perfect Harmony

I've been a Movable Type user for a few years now and prior to the release of 3.3 I was considering making the switch to WordPress. This was primarily for the WYSIWYG (What You See Is What You Get) editor which meant I would no longer have to type in raw HTML when I wanted to insert a picture or a table. When 3.3 came out I realised that they hadn't added one so I thought I'd have a look on the net and see if there was another way to do it. And then I came across TinyMCE (which is what WordPress uses incidentally).

TinyMCE is an open source javascript control that can turn any text area on a web page into a rich text editor with only a couple of lines of code. Since it's pretty easy to write transformer plugins for Movable Type to change its appearance it was very straightforward to embed TinyMCE in the editor window like so (it looks like it should always be there):

TinyMCE in Movable Type

All of a sudden I don't need to worry about HTML tags, previewing what the entries will look like, spell checking (it uses the Google spell checking API), creating tables and a whole host of other things I shouldn't even think about in the year 2006. It makes me wonder why SixApart don't include TinyMCE as standard…

Of course Movable Type, WordPress and their brethren don't just have to be for blogs. The 'My Software' section of this site also lives within Movable Type, was really easy to set up and trivial to make changes to.

When people ask me why I give away John's Background Switcher for free I just need to look at software like TinyMCE, see the amount of work that's gone into creating something so incredibly useful that's given away for nothing and think that I'm doing the right thing!

An Intelligent Copy Constructor In C# Using Reflection

Whenever I write a copy constructor I know that at some point I'm going to add a field to the class, forget to add it to the copy constructor and cause a difficult-to-identify bug later on down the line. So I came up with a simple solution in C# to this problem using Reflection. Here's the code (oh, you'll need to put 'Using System.Reflection;' at the top of the file):

    public MyClass( MyClass rhs )
    {
        // get all the fields in the class
        FieldInfo[] fields_of_class = this.GetType().GetFields(
          BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance );

        // copy each value over to 'this'
        foreach( FieldInfo fi in fields_of_class )
        {
            fi.SetValue( this, fi.GetValue( rhs ) );
        }
    }

Basically, it enumerates all the public and non-public fields in the class and copies their values from the class passed in. You can modify the flags passed to GetFields() to include or exclude fields as you need. So now I can't miss out any fields that I add to the class – and that means at least one less bug I've caused!

Clarification: This sample only performs a shallow copy of MyClass and therefore if you have fields that are reference types (like classes), then it will only copy a reference to those fields from 'rhs'. The class I used this for only contained value types (like int's and so forth) and so works exactly as I'd expect. I'll leave the modifications to this code to handle reference types as an exercise for the reader!

About As Unhelpful As Ian’s Unhelpful Error Message

To rival Ian’s unhelpful error message, I just encountered this one while trying to do a Get Latest in TFS:

An unhelpful error message

I did what it said and the problem still arose – not surprisingly. I can just see the developer’s thinking when they wrote it: “Well if an error gets through to here it beats me what it is, let’s just tell them to restart and hope is sorts itself out!”. I’m sure Joel would be amused…