Monday, November 27, 2006

To the spammers...

Could you prats please stop spamming this blog?  I will delete your comments quickly so it's a fruitless exercise.  I don't want to have to use moderated comments but if this keeps up I will be forced to.

I do use Bloggers captcha facility and yet still some spam comments are getting through.  Are actual people creating these comments or have the automated spam systems become more sophisticated?

I don't expect this post will help at all but venting relieves stress.  :)

Monday, October 23, 2006

DLL not found exception

I've been working on a C++ project recently that involved creating a DLL.  Although I had unit tests to pummel the objects that were used inside the DLL I wanted an easy way to test the DLL itself through its interface.  I chose to create a C# Winforms app that used the DLL using interop.

Really easy to do:

public static extern int MyFoo(string bar);

There's heaps of documentation out there for this kind of stuff.  Suffice to say that the .NET framework goes to great lengths to make this happen as easily as possible.

One gotcha that I ran into though was that initially the JIT compiler threw an exception - a DllNotFoundException.  I checked to ensure that the DLL and EXE were in the same directory, I used dumpbin to ensure that the DLL was correctly exporting the expected symbols etc...couldn't figure out what was wrong. 

Turns out that my DLL had a dependency on another DLL that wasn't in the path.  Unfortunately the exception doesn't give you any further useful information so watch out for this problem.

Friday, October 13, 2006

Two nifty Windows apps

Rearrange the items in your taskbar with Taskbar Shuffle.

Display your Outlook calendar appointments and tasks right on your desktop with DeskTask.

Tuesday, October 10, 2006

U3 USB drive

My company recently purchased a 1GB SanDisk micro cruzer USB drive for me to use.  These devices are great, providing lots of useful space.  However when you insert the drive it automatically runs some software that "assists" you with such tasks as synchronizing and password protecting your files.  Although the software may be useful to some people it isn't to me and there's no easy way to remove it [1].

Manufacturers should realise that they ought not to install - or run - a damn thing on my computer without my permission.  Ask if you must.  And if I say no don't pester me again.  Ever.  A better course of action is to ask me to opt-in; ship a CD along with the device (or provide a URL) that I can choose if I want it installed.

Anyway, after unsuccessfully trying to remove the software for a couple of minutes I hit Google and found that many other users had complained and some had found a solution.  At some stage U3 (makers of the drive) put an uninstaller online.  My PC is now clean again.

Kudos to U3 for putting the uninstaller online but, please, next time do the right thing in the first place.

[1] It fiendishly mounts two drives when you insert the device - one of which fools the operating system to appear as a read-only CD drive.  Clever, but difficult to remove.  Yes there are ways around getting it to run the software (although in this case even disabling autorun wasn't going to cut it) but I just wanted it gone.

Monday, October 02, 2006

Firefox extensions

OK, I can't find any easy way to transfer my Windows Firefox extensions and configuration to my MacBook - there are extensions to do this (notably FEBE and MozBackup) but they don't work on the Mac. 

Perhaps I can copy my profile folder?  I'll try. 

In the meantime, here are my extensions in case I have to install them one-by-one: 

ListZilla was used to easily create this list.

Are there any others that I should install?

Friday, September 22, 2006

Foldershare venting

Update: Foldershare is back up and running.  As far as I can tell it was down for a solid eight hours plus...

I started using Foldershare a few weeks ago and really like it.  It allows me to easily share files between my home and work PC's.  [1]

Unfortunately I've started becoming reliant on the system.

Today I intentionally didn't worry about copying files to my iPod (to carry them to work) because I knew that I could use Foldershare to access my home PC from work.  Dagnamit, wouldn't you know it; Foldershare has been down all day.

I still like the service but I hope there's not too many outtages!

As a final thought, I've gotta remember to make software that my users become reliant on.  Not to intentionally lock them in but it indicates that you're providing an invaluable service.  User reliance == success.

[1] It works by running a "satellite" app on both PC's.  You can then access files on the PC (that the app is running on) through a web interface.  So, from work, I can log in to the Foldershare website and view and copy files from my home PC.  Sweet!

Thursday, September 21, 2006

Goto's are evil

OK, so I'm working on some legacy code today when I stumble on a compiler warning: "C4102: unreferenced label". The cogs in my brain started ticking over..."label, label, hmm, what could that be"? Then I took a look at the code. Oh crap. Goto's. In C++. In one function (~100 lines) there were 21 goto calls.

Practically unmaintainable.

Lucky the author wasn't still with the company otherwise I'd have given him an earful.

Mr Duffy you suck.

Registering ASP.NET in IIS

I've tripped over this issue a couple of times so I figure I'd offload it to my blog to free up some space in my head.

The short story:

If you've just installed a new web application to your IIS server and it uses ASP.NET and you're unable to view the web page (specifically you may instead be asked to save a file) then it may be because you need to (re)register ASP.NET with IIS.

You do so like this:

> cd "\WindowsFolder\Microsoft.NET\Framework\VersionNumber"

> aspnet_regiis.exe" -i

The longer story goes something like this:

You install the .NET Framework version x.y.  However you didn't have IIS installed in Windows.  Then you install a web application to your IIS server [1].  Viewing the web app pages [2] confusingly just doesn't work, dammit!  Then you remember the magical register command and voila, birds start singing, sun beams out from behind the clouds and the world is a happy place once more.  :)

MS have also documented the issue.

[1] For me it always seems to be CruiseControl.NET.

[2] Which, for CC.NET, is http://localhost/ccnet/default.aspx.

Wednesday, September 13, 2006

Matt's recommended technical books

A friend of mine in Vancouver asked me to recommend some technical books; Ryan, I may be a little late but better late than never, eh?  ;)  Warning:  This list is quite C++ focussed.

Design Patterns, Gamma et. al.  Let's start with a non-language-specific title (although Smalltalk and C++ are used for examples the languages aren't important).  This puppy is necessary and should be on every developers shelf.  It describes, with methodical detail, the most common design patterns that we encounter - learn them all, and glance at this book regularly as a refresher.  Be aware however that many of the code examples are somewhat dated and can be improved with modern techniques so don't copy them verbatim.  Keep the book close particularly during the design phase of the software lifecycle as it can often simplify your "in the head" design.  If nothing else this book gave the software community a vocabulary to discuss patterns; make sure you can talk the talk.

The C++ Programming Language, Stroustrup.  The father of C++ writes the definitive reference book.  Kinda like K&R's venerable The C Programming Language - but for C++.  This book is great when you can't quite remember certain syntax or you're trying to recall obscure behaviour.  If you have a spare bit of cash opt for the newer hardcover "special" 3rd edition as it'll wear better and has a couple of extra appendices (Appendix E on standard library exception safety is required reading) though both can be (legally!) downloaded.

Accelerated C++: Practical Programming by Example, Koenig and Moo.  For newcomers to C++ (or those coming from a C background), this book is terrific for two reasons:  1) it gives the reader practical examples of how to write quality C++ code and 2) it doesn't shy away from introducing common and useful C++ features (like templates and the standard library) early on.  One of the few C++ books I can recommend to beginners.

Exceptional C++, More Exceptional C++ and Exceptional C++ Style, Sutter.  Herb Sutter is one of the true legends in the C++ landscape and his books are all gold.  Once you're into "intermediate C++" territory, buy his books and read.  Each chapter begins with a question, challenging you to think about a particular C++ topic.  The rest of the chapter thoroughly discusses the answer (Sutter began this format many moons ago with the "Guru of the Week" postings to comp.lang.c++.moderated).  Learn the intricacies of the pimpl idiom, exception safety, memory management and a host of other topics.

Effective C++, More Effective C++, Effective STL, Meyers.  Scott Meyer's 'big three' are a common sight on many programmer's bookshelves.  And rightly so; Meyers has a very appealing, easy-to-read writing style that is well suited to the intermediate C++ devs it's aimed at.  Each chapter begins with a guideline which is clarified over the rest of the chapter.  Don't break the Meyer's guidelines!  Note that Effective C++ has recently been revised (now in the 3rd edition) to better cover more modern techniques - pony up the extra dough if you can though the older revisions are still pretty good.

Code Complete, McConnell.  The "how-to" guide for software engineers.  Language neutral (almost - there are some Java and C++ examples) this book covers a diverse range of topics such as defensive programming, variable naming, software quality, testing, refactoring, and programming tools - just to name a few.  What I like about this book is the depth of research (there are many sidebars with "hard facts" giving convincing weight to claims made by the author) and the logical way that McConnell explains why he gives the guidance he does.  I consider this the Book of Common Sense for Software Engineers.  Many experienced dev's will consider some of what is covered a little too simple but there are so many nuggets in here that everyone should go back and flick through this a couple of times a year.  I do. 

Software Estimation: Demystifying the Black Art, McConnell.  I know of not a single software engineer that can give accurate estimates for projects.  Not one.  Nor do I know of any project managers that have really had a project schedule under control.  This book should be read by everyone in those roles.  It provides techniques to estimate (nay, measure) software effort and lists techniques to help both devs and managers get a handle on how to run a project.  Fantastic stuff!

The C++ Standard Library: A Tutorial & Reference, Josuttis.  A simple recommendation.  If you use the C++ standard library you need this book.  It's the best reference material on the subject there is.  Period.  Buy it.  It covers everything in the library from streams to containers, algorithms and iterators and is suitable for everyone from beginners to advanced users.  Many C++ devs I know use only a fraction of the power of the standard library: don't be one of them.

C++ Templates, Vandevoorde and Josuttis.  A book for any developer really itching to understand the nitty-gritty of how templates work.  High intermediate to advanced users will get the most out of this one.  If you've been confused by template template parameters, partial specialization or Koening lookup this book can help out.  Traits, metaprogramming, template instantiation and expression templates are also covered.  Very complete, very clearly written, very good.

C++ Coding Standards, Sutter and Alexandrescu.  The best description is in the subtitle: 101 Rules, Guidelines, and best Best Practices.  If you're team is using C++ make sure your architect(s) have a copy of this book.  Written by two of the most knowledgeable folks in the industry, every one of these guidelines is gold.  The writing style makes for easy reading; the topics are accessible even while some are inherently complex.  Best suited to low intermediate to advanced users.

Modern C++ Design, Alexandrescu.  The most mind-blowing coding book I've ever read.  Chapter three (Typelists) was a revelation, though I had to read it half a dozen times to begin to understand!  Aimed at advanced users, this will challenge your design skills.  Not only does this book cover many advanced techniques (policy-based design, compile-time programming, traits etc) but it does so with the real-world in mind: at the end you'll have a library (Alexandrescu's Loki library is described and freely available) with many amazing components and implemented design patterns such as smart pointers, generalized functors, object factories, abstract factory and visitor.  Although boost now has some better production versions of these libraries, you'll now know to write your own.  Awesome stuff but be prepared for some challenging topics (although the author does a decent job explaining this stuff it's just hard).

C++ Template Metaprogramming, Abrahams and Gurtovoy.  Another one for the advanced users out there, this book covers the relatively newish world of metaprogramming; developing code in the compile-time space.  Abrahams and Gurtovoy both work on the boost libraries and this book covers many of the techniques developed for the boost::mpl library.  As well as trying to explain the concepts, the book also looks at why you'd want to use them - chapter 10 (Domain-Specific Embedded Languages) really sold it for me; all the tough metaprogramming stuff suddenly became more important when I could see what could be done with the techniques. 

Beyond the C++ Standard Library, Karlsson.  Finally a book that covers many of the wonderful boost libraries.  Although the online documentation will always be the definitive guide, this book is great to pass around to colleagues to introduce them to any of the boost libraries.  Although I would have liked to have seen more examples of when to use the libraries and descriptions of how the libraries are implemented, if you use the boost libraries (You don't?  Why the hell not?) you'll want a copy of this book.  Not a necessary book but good to have nonetheless.

Framework Design Guidelines, Cwalina and Abrams.  The bible for Microsoft .NET devs, this book describes rules on how .NET libraries should be constructed.  Naming conventions, exception usage, common design patterns and many other topics are dissected and rules are clearly stated (with some excellent commentary in the form of inline annotations by many MS gurus).  You can use FxCop to help find the flaws in your designs but then use this book to understand why.  Microsoft use this internally and the .NET Framework is all the better for it.

The Design and Evolution of C++, Stroustrup.  This book is a little out of place.  It doesn't describe any software techniques or languages, nor is it really required reading.  But I couldn't leave it off this list.  D&E describes the history of C++, the design decisions, how it was developed, how it went through standardization.  There are many lessons to be learnt here but, for me, I just couldn't believe that a topic so dry as computer language history could be so damn interesting!  Maybe I'm strange though. ;)

So there you have it, that's my list.  I'm sure I've left a few off there as I've got books scattered all over the place at the moment but that should get you started. 

One book I know I've left out is Fred Brook's Mythical Man Month which is fantastic but I've lost it (just buy it anyway!).  When I find it (or buy a new copy) I'll add it to this list.

Disclaimer:  My only affilliation with these books is that I own them.  I don't personally know any of the authors (though I have had some correspondence with some of them) and I don't get any monentary gain by talking about them.  I just think they're great books.  :)

Tuesday, August 29, 2006

Hanselman's Ultimate Developer and Power Users Tool List for Windows - updated for 2006

It's really comforting to know that I'm not the only developer in the world that has to try out every tool in existence! Scott Hanselman recently updated his Ultimate Developer and Power Users Tool List for Windows.

If you're a software dev ensure you're aware of every tool on the list, even if you don't install them. Seriously.

Also be sure to check out the Hanselminutes podcasts, which are always chock-full of great tips.

If this seems like a Hanselman love-fest it's probably because it is - Scott is a guy I respect and admire. Love ya work Scott, keep it up!

Thursday, August 10, 2006

Microsoft loses a good one

Niall Kennedy is leaving Microsoft to start his own business. Sounds like Niall got a little fed up waiting for Microsoft to follow through on promises that were made to him about resourcing a project he was passionate about. Big companies can do that, dammit.

Having heard some of his ideas (though he probably doesn't remember, I met Niall while I was in the bay area attending one of his tech sessions) I'm convinced MS has let an amazing opportunity go begging. I can't wait to see what Niall comes up with working for himself in a startup!

Good luck Niall!

Tuesday, August 08, 2006

Visual Studio designer doesn't like generic controls

Generics rocks; coming from a C++ background it wasn't until .NET was blessed with generics (v2.0) that I began taking it seriously. Without at least some form of parametric polymorphism any programming language is simply hobbled.

Once the almighty Anders got around to giving us generics however, things were all rosy. I could safely (and speedily!) add and remove typed objects to my lists, write generic methods to perform operations and, generally, genericise the hell out of my code. Sure, it wasn't as powerful as C++'s templates but generics are easier to use and have their own advantages (side-stepping the code bloat issue and providing an easy way to package a generic library for example). Anyhoo, I'm using generics and I'm a happly lil' developer.

Until I try to derive from a WinForms control and create a generic class from it.

"Ohh noo, you can't do that!" complains the Visual Studio designer. "Of course I can" I reply (surely I'm not the only developer who talks to their computer?) as I scan the code for errors. There are none; the code compiles and even runs just fine. All I wanted was a type-safe CheckedListBox and generics are the perfect solution. Unfortunately the designer doesn't know how to deal with generic classes. If you create one, that's fine - but try to use it at design-time and you're in deep poo-poo. Bugger, it has a lot of great uses...

Anyone know any way around this limitation? And, for bonus points, do you know why that limitation is there (seems to me - with cursory thought - that there's no good reason for the limitation to exist)?

Annoying Bloglines 'feature'

I love Bloglines, I use it all the time to keep track of my feeds. But lately something has changed, something that is driving me nuts.

Perhaps a month ago I started noticing that when you display all the new posts from your feeds, Bloglines draws the focus to the top of the page when all the posts have finished loading. Arrgggh!

I subscribe to around 200 feeds which typically generates around 250 posts per day to read. It takes awhile for those posts to load and so I begin reading them as soon as they start to appear in my browser. Some time later I'll be midway through reading post #74 and whoosh! Back to the top I go, losing my place and boiling my blood.

[I'm lazy and haven't yet broken out the Javascript to find out why this is happening but I have two guesses. 1) Bloglines is telling the browser to give some element near the top the focus, though which one and why I don't know (it's not the search box). 2) The keyboard shortcuts implementation is interfering somehow. Just guesses, I should really get dirty amongst the code.]

It's only a small thing but please Bloglines, make it stop!

Tagging this post with "bloglines freedback" (Chris Pirillo's freedback idea is a ripper) ought to alert the Bloglines team that this is feedback for them - we'll see how we go!

Thursday, July 20, 2006

California, Redundant, MacBook(?)

Well, well, well. It's been over two months since my last post on this blog and boy has life been interesting!

As you may remember, I spent six months in California's Bay Area to support one of the products I had been working on. What a fantastic experience (if you're interested in reading about some of the sights I saw in Northern California you'll find some stories and pictures on my personal blog.)

Supporting software, compared to developing, requires a whole different slew of skills and I encourage every software developer to exercise those skills if given the opportunity. It'll make you a better developer. And teach you patience. And - sometimes - make you want to inflict mortal injuries on your users. ;)

When I got back I began regular development work again, slipping back into the role pretty easily because I was motivated (getting in close contact with your customers will do that) and still well practiced (I undertook a lot of mini software projects "on the side" even overseas - if you're a 'true' software dev you'll understand!). But a few weeks later bad news rippled through the office; our sales had continued to underwhelm, restructuring was going to occur and some jobs would be cut.

Long story short; mine was one of them.

Now, I'd been considering leaving the company for quite some time, in fact had I not been given the overseas stint it's unlikely I would have stayed much longer. I'd been at the company for over five years and, while it's a great environment, there are many things I found insanely frustrating. I'm not going to discuss them here suffice to say that I thought many things should be done differently and change was very hard to instigate.

Anyway, for whatever reason, my job evaporated and I'm now on the market. After the initial shock wore off I actually felt somewhat relieved; now I was free to decide what I want to do and go after it.

Which is where I am now. I'm trying to figure out if I join another large company, or a start-up. Or perhaps work for myself (I have many ideas of applications to write!). Or maybe returning to uni to pursue post-graduate studies would be good for me. Not yet sure. But I do know I will be involved in software development in some form or another which leads me to the question that prompted this post.

Can I get a MacBook and effectively develop software using Visual Studio?

You see I really like the new MacBooks. I've used a few and am impressed with their UI and the build quality of the machines themselves. The Unix core also strongly appeals. However I need to work with Visual Studio because it's likely my next job will require it and, simply, it's a productive and effective environment. I'm hoping that VS2005 runs well under Parallels - does anyone know? Have any other developers headed down this path? Or will I be forced to run Boot Camp? Is BC really ready for prime time?

Any information you guys might have would be very much appreciated!

Friday, May 19, 2006

Google Maps finally has Aussie roads


Google Maps now has Australian (and New Zealand) road data!

I have been waiting for this for a long time. While in the US I've gotten so used to using online services - because they cater so well to the US market - that it'll be somewhat of a shock to get back home and realise that Australian services are so far behind. But now I at least have road information!

You can even see the outline of the block of my house. Fantastic.

Looking forward to seeing some Aussie mash-ups.

Oh, and before you ask, no, Google Earth data hasn't yet been updated. But it can't be too far away. Sidenote: The "Melbourne" city identifier in GE is still some 10kms too far east...

Update! The Windows Live Local team have just gone live with a new version of their online map product which also includes Aussie road data. Sweet. :) But despite Frank's claims that they use the same provider Google seem to have a significant edge in my area where the detail is much better with Google Maps. Compare my house location: Google Maps, Live Local. Although the Melbourne road data may not be that great (and of course YMMV - I've only checked out my 'hood) there are some fantastic features with the new release - the scratchpad and sharing capabilities for example. It's wonderful to see such activity in the mapping domain!

Friday, April 14, 2006

Google Calendar

Google Calendar is finally here.

Bottom line: For a first release it's slick. A couple of minor niggles and performance issues (it's running noticably slower than yesterday!) but on the whole it's great. I've been evaluating Airset, 30Boxes and Calendar Hub but I'll now switch to Google Calendar.

Thursday, April 06, 2006

Apple Boot Camp

Apple have released Boot Camp, official software that allows an Apple to dual boot with Windows or OSX.

If the performance of Visual Studio turns out to be reasonable I may just buy a Mac Mini. I've been looking for an excuse for awhile. :) Among many other things, I'd love to use it as a front-end for a MythTV setup.

As the rest of the world is discussing, this is an audacious move by Apple but many are predicting that virtualization - running Windows applications within OSX - is coming. Now that would be seriously kick-ass. There are only a handful of applications that tie me to Windows, my development tools being the most important, and it wouldn't take much effort to nudge me over into the Mac world. It would also have many ramifications in the computing world. What would it mean for Linux? Which platform would you target as a developer?

Read more about it:

Ars Technica
Make: Blog
TPN: The Bit
Om Malik

Sunday, March 05, 2006

Virtual Earth Streetlevel

I'm a big fan of Google Earth and, to a lesser extent, Google Maps. I regularly use the services to give me directions and learn about foreign places.

Microsoft's Virtual Earth (now Windows Live Local) has always been an also-ran in my books though in typical MS fashion they've perservered and worked hard to make it a very competitive product. I've no doubt that it will continue to get better.

So I wasn't totally surprised to see Chandu Thota, a key developer in the Virtual Earth team, announce a new technology preview this morning. The team have extended the regular Virtual Earth interface to deliver street level images. It was only a matter of time I suppose, but this technology is very exciting and Microsoft should be pretty happy with themselves - there's gotta be an awful lot of data they're managing there! While the interface is still a little kludgey (and IMO would fit much better in a client-side Google Earth style application) it has the potential to be elegant enough to be useful.

I have been saying for a long time now that GIS-enabled software will spurn a bunch of new software applications and I believe more good stuff is yet to come. :)

Anyways, go check it out:

Windows Live Local Virtual Earth Technology Preview

Scoble also blogged about it (and there's a video on Channel 9).

[Update: The excellent Google Earth Blog made the point that you can achieve a similar effect in Google Earth.]

Thursday, March 02, 2006


I used to subscribe to the Age's RSS feeds to get my dose of Aussie news. I generally like the Age, their reporting is usually even handed and reasonably fair. But I agree with Will that the ABC feeds are much better.

For a start they've got summaries. With the Age feeds you only get headlines - and they're typically quite vague. The ABC gives headlines and a short one-line summary of what the article is about. It's not full text (which would be ideal!) but it's pretty good. And the quality of the ABC articles, while a bit drier than the Age, is also high.

So bye-bye Age, hello ABC. :)

Wednesday, February 15, 2006

The brrreeeport report

Helpin' out Scoble where I can...this is the brrreeeport!

Sunday, February 12, 2006

Kate Gregory gives a "migrating C++ apps to .NET" presentation

Kate Gregory, a terrific C++ presenter, has posted some slides and code from a C++/CLI presentation she recently gave on migrating C++ applications to the .NET framework.