Monday, April 28, 2008

Race Results

Steve, Penny, Madison and James before the race
I won't be winning any olympic medals, but I managed to finish in just over an hour. I had issues with my calf muscles leading up to the race so didn't manage as much training as I would have liked but I don't think it would have made much difference. I was reliably told that there was only one hill in the race, which was true, except for the fact that the "hill" was an undulating 8km mass! Anyway, whinging over. It was a lovely day and a well organized event, and the proceeds all went to a worthy cause.

To all of you who sponsored, thank you very much. Your support made the difference and spurred me along up the steepest parts of the hills! The total is up to £140 so far, and the website stays up for another 90 days, for those of you who may have forgotten! (www.justgiving.com/jamessugrue)

Anyway, it's something I will definitely do again (although maybe I'll pick a flatter course next time) and intend on keeping the training up so next time I can break the hour

Made it. Trying to cool off

Friday, April 25, 2008

New Family Member

As a long time and dedicated Windows developer and user, it will probably come as a surprise to some of the people who know me to hear that a nice TNT delivery man called today and left the following package for me:


I have decided that like James, I am also going to attempt a change in direction. For me though, I hoping to wean myself off the endless hamster wheel of software development and at long last delve into the equally challenging but for me potentially more rewarding career as a writer. My genre of choice will inevitably be SciFi and will be likely to span the range from near future dystopia to giga-epoch spanning space opera.

For me, the biggest issue is the problem of being overloaded with little projects of which writing is usually only one. In situations like this I would sit at my HP laptop and be almost literally paralysed by the need to make progress on so many tasks that I don't actually do anything at all. The Air will help me as I intend to have that machine as a dedicated creative space.

I will be posting the traditional "unboxing" article and first impressions soon.

Wednesday, April 23, 2008

New blog. Change in focus for this one

As I have announced in a previous post, I am looking for a change in direction. As such, I am opening a new blog which will concentrate more on things like Ruby on Rails, iPhone and Mac development and anything else that I encounter while trying to reach my goal.

The new blog is currently under development, and I am writing it completely in Ruby on Rails as a test site and a showcase site all rolled into one. I will be posting my thoughts about the process on the other blog when I get something publishable.

What does this mean for this blog? Well I still intend to post here, but it be more of a focus on .NET related topics, and general rants. If over time I succeed in my goal, then I would guess that poosting will slow down here and increase over on the other blog, but time will tell. In the meantime it will be transmission as usual.

Monday, April 21, 2008

Using Control + Alt + Delete in a Remote Desktop Session

Just a note to self as much as anything else...

If you are in a virtual remote desktop session you can't use Control Alt Delete to bring up the shut down / reboot dialog. In this case try Control + Alt + End to achieve the same result.

Friday, April 18, 2008

Mac tips for the switcher: Print Screen

I was in need of capturing the current window (for the last post actually) to store as an image. I went to press Alt + PrnScrn. Ah. Where's the print screen? So after doing a bit of research, here are all the ways you can do a screen capture in OSX.

Capture All
Press Command + Shift + 3

This will place a document in pdf format on the desktop. You can then open and Save As...

Capture selected Window
Press Command + Shift + 4 + Space. This will turn the cursor into a camera and you then click the window you want to capture. Again it will save to the desktop in PDF

Select Area to Capture
Press Command + Shift + 4. This will turn the cursor into cross hairs which you then select what you want captured.

While these are useful, what if you want to save to the clipboard instead of saving to the desktop? Well Apple has thought of that too - just press the Cntrl key with all the combos above.

Firefox 3.0 b5


I have been sipping from the Firefox firehose for a long time. Long enough to remember that it used to be called Firebird! (bet ya didn't know that!)

Since moving to the Mac about a year ago, I have been pretty happy with the speed of Safari so have pretty much just used that. I use Camino when I encounter sites that isn't Safari friendly - my bank for example. The reason I choose Camino over Firefox is purely aesthetics. Camino renders widgets natively, whereas Firefox 2.x doesn't.

After reading a bit about the speed and memory improvements in the last FF3 beta, I decided to give it a try. Wow. They weren't kidding about the improvements. I like the new skin and it is noticeably quicker to load and render. FF3 now feels about as fast as Safari 3.x when rendering pages.

The biggest new feature about FF3 is that is now renders widgets natively. Nice.

I have been using FF3 for a week and haven't used Safari once. I think that says it all.

Thursday, April 17, 2008

Looking to change direction...

A conversation on Twitter yesterday with Tim got me thinking.

I have been getting a little bored with being a software developer of late. I'm not really sure if it is a general apathy toward software development in general, or just the stuff I have been doing.

As any regular reader to the blog will know (all three of you), I am a born again Apple addict. I think my development boredom has come out of the fact that I sit in front of Windows for 8+ hours a day. Every time I fire up one of my Macs, my inner ten year old, open to the endless possibilities of computing returns, only to be beaten away by the 32 year old reality of being a commercial software developer when I sit back in front of a Windows box.

So I have made a conscious decision to make a change. My end goal is to eschew Windows completey and make a living as a developer on the Apple platform. I have made a start on that front with a bit of iPhone consulting, but by the end of the year I am looking to either be a full time Mac developer/consultant - whether that be Cocoa or Cocoa Touch, and/or get more in to Ruby on Rails.

I am also aiming to be getting 75%+ of my income from telecommuting gigs. Tim is showing me the way on that front, he has been completely freelance for the last 5 or so years and hasn't looked back.

Of course commercial and financial pressures might mean I have to do a little .NET stuff here and there, but there's no point setting a goal if you don't set the bar high enough. (That's enough mixed metaphor's for one post)

BTW if you are a Apple dev shop looking to offload some work I can be contacted at

james at softwarex.co.nz

Monday, April 14, 2008

10km Charity Fun Run

I am participating in a 10km fun run for the Marie Curie Cancer Care organisation on April 27. From their blurb:
Marie Curie Cancer Care provides high quality nursing totally free, to give terminally ill people the choice of dying at home supported by their families. Your local Marie Curie Hospice actively promotes quality of life for people with cancer and provides support for their families. The services are completely free to patients. World class scientists at the Marie Curie Research Institute are investigating how cancer develops to find better ways of treating the disease in the future.


I really can't think of a better way to expend a few calories and raise a little money. My original target was £100 but through the generosity of friends and family we have reached that in under a day!

But, you can never raise enough money so for anyone reading this with some spare cash here is the link to my page and feel free to donate as much or as little as you can. As the old saying goes, It all helps.

Sunday, April 13, 2008

.NET NZ (expat) catchup in London number 2.0

Nic, Dan, Tana, Vince, Shekhar and myself got together for a few drinks and a chat in Earl's Court recently. We have these catchup's roughly monthly - it's just a way for a bunch of Kiwi geeks to have a catch up, a few beers and a general chin wag.

Topic of conversation was varied - from Rugby to Security concepts, but never strayed to far from Web development, and our thoughts on Microsoft, and where they are heading. We talked a bit about Apple, and Mac's in general - three of us run Mac's as our personal machines. The general consensus is that if you are running Windows, then Apple hardware is the fastest way to go!

Anyway, any other Kiwi geeks in the UK drop me a line and I'll be sure to send you an invite next time it's held. To the other guys, cheers for a enjoyable evening and catch ya next time!

Wednesday, April 09, 2008

Tips from the Frontline: null coalescing operator

I knew about this feature but for some reason thought it was new in .NET 3.5.
It's not, the null coalescing operator has been available since 2.0.

So what is it? It's hard to say but easy to use, so a code example might be easier:

string name = Request.QueryString["name"] ?? "Please Supply a Name";

Basically it allows you assign a value for the not null case and an alternate value for the null case.

This used to be done using the conditional operator:

string name = null != Request.QueryString["name"] ? Request.QueryString["name"] : "Please Supply a name";

Very handy for example when populating C# Model Classes from a DataReader.

Friday, April 04, 2008

Who needs Ruby on Rails?

This is one of the funiest things I've seen in a long while. I guess it helps that I have maintained a few COBOL projects in the past.

For fsk sake.

http://news.bbc.co.uk/sport1/hi/motorsport/formula_one/7328018.stm

Lets make this clear. Nothing Max Mosely has done is illegal, or infact remotely illegal. What people do in private, is their business. Period. The fact that something gets published and put into the public domain, does not make it public domain.

Let me say that again. The paper in question posted a story and video of a private act and made it public. This in no way makes it public.

Issuing statements like this doesn't distance Toyota, Honda, Mercedes or BMW from anything Mosely did. Because they were never implicated. To issue these sort of statements infact makes you look like a bunch twats. What they should have said was something like, "while we disagree with Mr Mosely's conduct, we find the posting of such material abbhorent and an invasion of privacy. Mr Mosely has our full support in this difficult time for him and his family"

That's what a company with intergrity and balls would say. Or better yet, just say nothing.

This comes from the PC society we have become. I for one am sick of it. Surely the out cry should be against the paper, not whether or not some old dude gets off on being spanked by someone dressed up in a Nazi uniform?

Wednesday, April 02, 2008

ASP.NET MVC Framework - First Look

I have been playing with the ASP.NET MVC Framework (Preview 2) recently. For those of you who don't know what the MVC framework is about, then read the overview docs in the link above. (I'll wait).

Issues with ASP.NET
While the ASP.NET framework is a huge improvement over classic ASP, it does have some pitfalls and downsides. The Postback and Viewstate pattern does add flexibility, it does also add bloat in the form of encrypted values to your page. This means slower download times and ugly HTML (Some designers really, really hate this. Good synopsis of Viewstate issues and work arounds Here

While ASP.NET goes some way into code seperation, by splitting the View from the Code, the Page_Load mechanism can promote lazy developers into stuffing alot of business logic into there.

Also the current model makes unit testing ASp.NET pages difficult.

Alternatives
There are alternative patterns already being used. The current project I am working on uses the Model View Presenter pattern. MVP adds more seperation from standard ASP.NET and allows for greater testability. I quite like MVP and is probably better suited to larger projects, due to extra initial coding. I will do a follow up post on my experiences with MVP, but there are quite a few resources available for a quick grok.

While I like the MVP pattern, I would strongly recommend people looking at the MVC pattern also before comitting to the MVP.

Model View Controller
The MVC pattern is quite common in standard GUI apps. Cocoa development on the Mac and iPhone actively promotes and enforces the pattern, and Java developers have been using it for a while. It is only in the last few years that web developers have embraced the technology.

The ASP.NET MVC framework is still in beta, with Preview 2 being released recently. The major benefits I can see are

  • Greater Testability and Mockability

  • Greater seperation of concerns - logically breaking down app into components

  • URL rerouting built in

  • Elimination of PostBack and Viewstate



Along with these it enforces a logical project and solution layout, so going back to old code will be easier under MVC.

I went off on a tangent on what I originally thought I would post about, but I will post some sample code about MVC in the future as I get to grips with it.