Archive for January, 2009

Three more DN247 network sites

I’m pleased to announce that we have launched three more DN247 sites with the same “special sauce” that goes into .NET 247. (Which, honestly, I cannot believe is coming up to its eighth birthday!)

We have EHLO Exchange (http://www.ehloexchange.com/) and SQL Server Wins (http://www.sqlserverwins.com/) which are dedicated to Exchange Server and SQL Server. We also have Old Skool Developer (http://www.oldskooldeveloper.com/) that is basically everything that is not Office VBA-type stuff and not .NET-type stuff – essentially all the stuff that you either need to do legacy code or all the stuff you need to do weird and wonderful things on Windows.

Enjoy!

Random thought – what’s the word…

So, I think there should be a word for the feeling you get when your iPod plays songs that you think are *excellent* one after another, after another.

I personally would like this word to be a German sound, something like schadenfreude, but obviously not that as that’s more to do with how you feel when someone’s iPod is playing bad song, after bad song, after bad song…

Anyone got any ideas?!

Fiddler saves my life once again

So there I am, gone midnight, trying to fix a showstopper bug for a customer dem tomorrow.

What comes to my rescue *again*, Fiddler – http://www.fiddlertool.com/fiddler/.

If I had to pick the best developer tool out there, I would absolutely pick Fiddler as my number one choice.

The .NET Framework is *very* big

I have uploaded an update of the metadata model for the .NET Framework to .NET 247. This goes all the way (finally!!!) up to .NET 3.5, and includes WCF, WPF and so on.

When I started .NET 247, .NET 1.0 was on the scene. At the time this had, from memory, something like 3,500 public types and about 70,000 public members. (Originally, .NET 247 was only bothered about public types and members, but now .NET 247 has the private types and members too. Over the years I have often found the weirdest problems to be rooted in the private parts of the Framework.)

If you now take *all* of .NET, you have something like…

14,797 public types (22,249 in total)

1,484,013 members. *ONE AND A HALF MILLION*. (An average of 66 members per type.)

623,285 of those members are public.

That is *astonishing*. I knew .NET was big and complicated, but *wow*. Seeing as the average person knows between 30,000 and 40,000 words, that would mean that anyone who could identify all 15,000 .NET public types has got a vocabulary that is 27% .NET.

CAPTCHA components

Back in 2004, I implemented CAPTCHA checking on .NET 247. At the time I used as component called FormGuard from a company called Xheo (http://www.xheo.com/). In the intervening years, Xheo have stopped supporting this component, so I looked elsewhere.

In the end I found a link to a free component punted by a gentleman called Peter Kellner (http://peterkellner.net/2006/08/20/the-ultimate-captcha-custom-server-control/). Didn’t take long to get it working on the site and was a quick and easy solution.

One thing that was interesting during this process though is that if you Google for “captcha”, one of the links that comes up is from a company called “decaptcha”. They offer a service where they will defeat 1,000 CAPTCHA checks for you for $2. Minimum buy is $8. So – OK, I am an IT professional with a certain reputation to keep, but good grief, I presume this is one of these services where they pay a bunch of people in a room to read and defeat CAPTCHAs all day. What I found amazing about this is that Google are quite happy to allow them to advertise on their network…

And then on the subject of CAPTCHA, I love “reCAPTCHA” (http://recaptcha.net/learnmore.html), which is a service whereby in situations where people who are trying to digitise old books come across words that they cannot OCR, they farm out the text to people filling out CAPTCHAs – which sounds lovely in that your users end up contributing to community projects to scan old books.

25 most dangerous programming errors – SANS

The SANS Institute has released a list of the 25 most dangerous programming errors – here: http://www.sans.org/top25errors/.

What’s interesting about the way they have produced this list is that they are not pitching it as “these are bad, so don’t do them” rather they are pitching it as being a helpful list from four perspectives. The first perspective they pitch is that it gives customers of software intelligence about how to select software that is likely to be more robust. Personally, I think this is quite an interesting way of looking at the problem as I sit on both sides – i.e. I’m generally interested in how people build software, but I am also interested in how people buy and sell software as that’s my day job.

The other perspectives are more classical – i.e. help developers build better software, but also help people coming into the industry know how to build better software from the get-go.

.NET 247 is (sort of) back

Those of you who missed it .NET 247 (http://www.dotnet247.com/) is more-or-less back online.

It is slightly sickly at the momet, and the content has not been updated in a *long* time, but here’s to hoping that what was once one of the top-rated .NET developer resources is back for good.

Building a DNS server

In my time as software developer, I have ended up building a lot of strange esoteric applications, but a requirement received from a customer meant I spent some time last night building a DNS server.

The requirement from the customer was that they operate two servers, and each of their customers (”end-customer”) is “homed” to exactly one server. From time-to-time they need to move a customer from Server A to Server B. At the moment each end-customer connects to a URL like http://servera.foo.com/application/customera/default.aspx. The problem is that should an end-customer need to move to a new server they have to change the configuration in an application running on the customer’s site. This can almost certainly never be done in a hurry – sometimes it can take weeks.

The requirement from our customer was that the application installed on the end-customer’s computer would call into a Web service which would return the IP of the server to connect to, update the local configuration and away you go. Basically the “switching” server would always stay in one place.

And as I was thinking about that I thought that there was already an established technology that takes a name and turns it into an IP… DNS. This would mean that customers could configure themselves as http://customera.foo.com/application/customera.aspx and obviously the physical location of customera.foo.com would be transparent and could change. This approach removes the need for any weird or complex code and allows the right protocol to do the heavy lifting.

Not knowing off the top of my head any DNS servers that allowed queries to come out of a database, I wondered how hard it would be to build one. The answer was “not hard to do, but hard to come across the information required”. RFC1035 was *eventually* discovered offered the required information and I was somewhat blown away by the fact this RFC is 22 years old. I started by building a DNS client that would do “A” lookups against our in-house Microsoft DNS. Once I broke the back of building the client, a DNS server that only answered “A” queries for a known domain was relatively straightforward.

That said, driving back home it did occur that running BIND and creating a utility that dumped a new configuration file periodically would probably be a more robust, production-ready solution! But at least I got to build something I had never build before…

Jungle Disk and automated offsite backups

A perennial problem that I have in the office is worrying about backups. It of course doesn’t matter how many copies of something you physically have in the office, you can only solve the burglary/fire/flood problem by getting a copy of the data offsite. And you would think that with bandwidth being as cheap as it is these days that would be easy – but it isn’t as our data is too “chunky” to get offsite each night. What I want is one snapshot of a point in time of the operational databases that we run (one for source control, one for project management, one for invoicing and finally Exchange) copied offsite each night, but the reality is that we cannot get one of those databases offsite in a single night because they are all too big. In addition you have the problem of where to put it – i.e. where do you put the backups so that you can get them back easily should the office burn down.

We have solved one aspect of this problem using Jungle Disk and Amazon S3. For those who do not know, one of Amazon’s strategies is to expose its own IT infrastructure to the IT community in general as a paid service. One aspect to this serviceis Amazon Simple Storage Service (S3). For virtually no money, you rent space on Amazon’s servers.

We use Vault for our source control, and we have a separate application that monitors the Vault database for new labels. When a new label is found, the code under the label is retrieved and written to a folder. This means that we can go to our file server and see a list of every project and every build and grab the source when we we need it.

So, the problem with S3 is that you can’t just expose it as a fileshare, which seems to me to be a missed opportunity, but then again it is supposed to be a Web-based resource so you can understand that. What Jungle Disk does is exposes your S3 account as a network fileshare. This means that you can access it directly in Windows Explorer. What we did was modify our utility so that when the label was “got” from Vault, it would create a zip file (using #ziplib) and copy the zip file over to the file share and dump it straight up on Amazon’s servers. This means that customer source code is copied safely offsite the moment the developer sets up the label within Vault.

The only caveat is that Jungle Disk’s developers for some reason have not implemented it as a Windows service, which means that the shared network drive is only available whilst the user is interactively logged in. Whilst there are many utilities out there for hosting a regular executable as a Windows service, frankly I could not get any of these to play nicely with Jungle Disk and so we have a machine setup to logon as a local user and lock the console immediately.

The other nice thing about Jungle Disk is the licensing. For “desktop” use, you can install it on as many machines as you like providing it accesses a single S3 account. They also offer a “workgroup” option, which is something like $2/user/month which is more “proper” for corporate use.

My next objective is to stream SQL Server log files over to S3 to create a log shipping/offsite incremental backup of our databases. Then it’s just offsite Exchange to solve – although really I wonder whether some cloud-based solution for that is a better long-term plan.