Beer Advent Calendar – Day Three

Third Time Lucky! After two days of novelty nonsense, the vase of fate finally served up a half-litre of Harviestoun Brewery’s 4.8% masterpiece, Schiehallion, named after my all-time favourite Munro. Here’s an interesting fact for you: the mass of the Earth was first measured in 1774 when the Astronomer Royal, one Nevil Maskelyne, spent four months mucking about on Schiehallion with pendulums. By observing how the mountain’s bulk caused the pendulums (pendula?) to swing away from the vertical, he was able to estimate the mountain’s mass and extrapolate from this to calculate our planet’s mass at 5,000 million million tonnes—which is a pretty reasonable estimate, if you ask me. Based on that work, it then became possible to determine the mass of all the other planets, their moons, and even the Sun itself. All of which rather puts my own summer’s evening stroll up Schiehallion in 1998 into perspective, enjoyable though it was. ...

4 December 2005

Beer Advent Calendar – Day Two

Well, this evening’s advent beer couldn’t be more different from yesterday’s. I had the dubious pleasure of sampling Crazy Ed’s Cave Creek Chili Beer, all the way from Arizona. Be warned: the website dates from 1999, and boy, does it show—we’re talking Comic Sans in a scrolling <marquee> tag, framesets that have a tendency to get confused (try clicking the “home” link), and a 53-kilopixel JPEG weighing in at an astonishing 232 KB (why?!). Seeing those “Netscape Now!” animated GIFs makes me all nostalgic for the twentieth century… ...

2 December 2005

Beer Advent Calendar – Day One

This is surely one of the best ideas I’ve ever had! I’ve followed through with my plan to buy twenty-four beers from around the world to count down the days until Christmas. Their names are all written on slips of folded paper in a small vase (nobody actually draws things out of a hat anymore, do they?). Today I’m enjoying Young’s Christmas Pudding Ale, which is 5.5% ABV according to the bottle but only 5.0% according to the website—don’t believe everything you read on the web, eh? ...

1 December 2005

Rounding Up The Result of Integer Division

Here’s a damn useful piece of information which should be in the armoury of every modern codemonkey: In Java, if it is required to round up the result of dividing m by n (where m and n are integers), one should compute (m+n-1)/n Source: Number Conversion, Roland Backhouse, 2001 I’ve used this deliciously elegant result in production J2EE code in the past, but it’s equally valid in C#, as long as you can make the additional assertion that m/n is positive. This is because whilst Java treats integer division by rounding to zero, C# merely truncates the result (in an unchecked context). In my experience, the most frequentuse for this result is the deft answering of questions such as “if I have x items in my dataset and I display y per page, how many pages do I have in total?”, where it is obviously safe to make the assertion of a positive result. ...

6 September 2005

10 Things That Should Be More Popular

Some days I feel like I’m spitting in the wind. It amazes me that the following ten concepts, websites and applications aren’t more widely used: RSS Feeds – why waste your time repeatedly trawling dozens of sites looking for new content? Let it come to you! Flickr – practically everyone I know has a digital camera, but still relatively few have a Flickr account. Share your photos, don’t keep them unseen on your hard drive! GMail – by far the most effective web-based email. FireFox – if only for the tabbed browsing. But really, it’s so much nicer than IE6, and a myriad of different extensions are available. OneNote – so much better than scraps of paper. Desktop Search – I don’t care which desktop search program you use, but please install one! You’ll find it so much easier to find old emails and other files. del.icio.us – access your bookmarks anywhere, and share them with friends. ClearType – if you have a flatscreen monitor, you should turn ClearType on. Period. Virtual PC – there’s no need to test beta software on your main machine, or keep several differently-configured computers around the house any more! SyncToy – this is a great little app for synchronizing and backing-up folders; it’s really useful for combining media folders, and for synching files with a portable hard drive.

31 August 2005

Computer Games I Have Loved

Isn’t it funny how one’s tastes change as maturity progresses? I used to spend my summer holidays at the sea-side, playing in arcades and seeking the perfect milkshake (lime); more recently I’ve been spending them in the highlands, playing on the hills and seeking the perfect dram (lagavulin).Hmmm… I think I may have mentioned that the wife is away in the States for a while.At the start of this period of solitude, I panicked, wondering whatever I could do with myself, and came to the conclusion that it would be a good idea to buy a computer game to while away the hours.After all, I spent much of my formative years killing time on a variety of computer and console games, so why not rekindle that prior love affair? So it was that I bought The Sims 2, a truly excellent game, and had an enjoyable evening trying to motivate my wee Sims to improve their skills, better themselves, and generally enjoy life.All good harmless fun. ...

22 August 2005

Project Euler

If you like maths problems, and you like programming (and hey, who doesn’t?), then you’ll love Project Euler.

22 August 2005

Aussie Apostle Claimed By Sea

Holy cow, one of the limestone towers at Australia’s Twelve Apostles park has collapsed into the sea! It was the one in the foreground of the photo to the left. Seeing this fantastic set of rock formations (and flying over them in a helicopter) was one of the many highlights of my vacation to Australia in Dec 2002 / Jan 2003. You always hear about coastal erosion and the way landscape changes over time, but never really expect significant changes to occur during your own lifetime ...

5 July 2005

Stopwatch Class for .NET 1.1

Paul Welter has backported the System.Diagnostics.Stopwatch class from .NET 2.0 to 1.1. Handy. http://weblogs.asp.net/pwelter34/archive/2005/07/01/416999.aspx

5 July 2005

New Recommendations for String Comparisons in .NET 2.0

I know it’s a rather geeky and dry subject, but I found this MSDN article on new recommendations for using strings in .NET 2.0 quite interesting. It’s going to be difficult to stop using CultureInfo.InvariantCulture habitually!

4 July 2005

eXtreme .NET

Up at 0500 yesterday and onto the early GNER Mallard down to that London town for the MSDN briefing on eXtreme programming with .NET. It was pleasant not to be driving for a change, and speeding through the Yorkshire countryside early on a midsummer morning was very relaxing – what a stark contrast with the hot crowded tube that I had to catch on arrival to the big smoke. Three stops down to Oxford Circus seemed to last as long as the entire preceeding train journey. How people do this every single day I do not know.. ...

18 June 2005

Tech Books

I succumbed to temptation and bought another book at the MSDN briefing yesterday, pausing only out of concern that the guy who mans the Computer Manuals stand at these events might think that I’m stalking him (or fancy him!). Having determined that I could hand over my Barclaycard whilst flashing my wedding ring, I brought my current reading list up to three: Developer to Designer: GUI Design for the Busy Developer – this was a wedding present from my mother-in-law and is proving to be an interesting, easy-going read so far. My competencies lie in the middle tier and database, and although I’m technically capable of making GUIs, I prefer to leave the design up to others. It’s inevitable though that most coders end up doing some design, and this book is, er, designed (sorry) to help with that process. The early section of the book concentrates on each UI element in turn, whilst the later part of the book looks at putting it all together, and has particular focus on the web – layout design patterns and interaction patterns. It’s a good read, making a nice contrast from the heavier books, and I’m pleased to learn that I’m not alone in hating Outlook’s labyrinthine Tools->Options dialog! ...

18 June 2005

Software Development Books

Elizabeth Keogh has been blogging her advice for software-developer apprentices, and recommends buying and reading a selection of good software development books. I think this is sound advice – personally I felt that my career and abilities starting taking off when I stopped reading tech-specific Wrox tomes that were obsolete within six months of publication and started buying timeless Addison-Wesley hardbacks. Why so many newbie coders insist on rediscovering solutions to well-known problems instead of leveraging the knowledge of our programming forebears is beyond me, but most of us have behaved in this way at some point. Give yourself a leg-up and read some decent software design books. ...

13 June 2005

Framework for Persisting .NET Classes Into SQL Server Image Fields, With Locking Ability

There seems to have been a lack of .NET-related stuff on this blog recently, so let me show you something I cobbled together for work purposes last Wednesday: A common requirement we have in our ASP.NET applications is how to reliably persist object instances for a lengthy period of time. End users shouldn’t have to concern themselves with the concept of Session expiry, and it’s unacceptable for them to return to their PC after nipping off for a coffee to be confronted with the dreaded “Object reference not set to an instance of an object” when they try to continue editing their basket / sales order / timesheet / whatever. ...

18 January 2005

999999999..

Never underestimate the stupidity of users—or the benefits of a little field validation. One of the web-based systems I’ve been developing allows users to enter a customer’s fax number and automatically fax confirmation details (using Zetafax). It’s been working pretty well—until we discovered a flaw today. One user, tired of obtaining valid fax details from customers, had been entering a string of nines and then actually attempting to send the fax to this number. ...

11 January 2005