Friday, 1 October 2010

It’s a Wonderful Life

One week ago my beautiful wife gave me a son.

Actually it was more like a surgeon removed my son from my beautiful wife, handed him to a paediatrician who cleaned him up, I ceremoniously cut the cord and then the paediatrician handed me my son and I presented him to my beautiful wife.  But that description seems a little less romantic.

Either way, we now have a complete family with the addition of Dean Patrick Harris, born on 22nd September at 3:34pm New Zealand time.  One whole week after his sister Serenity had her first birthday.

He weighed in at a very reasonable 4kg (8lb 15).  The odd thing is he is taller than his big sister, but his feet are a little smaller.  Though his toes do seem almost freakishly long.  You can find some pictures on www.facebook.com/blackmael/photos.

This time we ended up opting for an elective caesarean section.  As such, it was quite a different experience from Serenity’s emergency c-section.  Last year, after a 19 hour labour, rushing into theatre after being up all night was much more surreal. 

So tired.  So emotional, So stressed,

The whole procedure went by in such a blur.  You barely had time to think.  And I had the easy part.

This time around you noticed everything.

My wife noticed everything.

Last year, she was so tired the surgeon had difficulty keeping her awake enough to confirm if the epidural was working sufficiently to continue with the procedure.

Being fully aware of what was going on has a significant downside.  Of course for both Dean and Serenity, the main action was hidden from us behind a curtain.  But this year we had time to hear everything and the procedure sounded very different from what we remembered from last year.

The most noticeable sound was an awful lot of snipping.  A serious amount of snipping.  I don’t remember any snipping from last time.

Then there is the physical tugging and pulling.  I cannot imagine how that felt.  Dean is a longer than the average baby and it seemed the surgeon and her assistant had a little difficulty even pulling Dean out.

Eventually Dean was pulled from his warm home of nine months and was quickly presented to his parents over the top of the surgical curtain.  Suddenly it was all worth it.

All the pain and discomfort of pregnancy and surgery was instantly cast aside once we met our baby boy for the first time.

No more fears.  No more anxiety.  No more stress.

At least until the euphoria of child birth was worn off and we then have the fears, the anxiety, the stress of raising and caring for two children…

Wednesday, 8 September 2010

Email Attachments

Today I spend just a little too long trying to attach a in-memory Excel 2007 spreadsheet to an email.

I have recently started using ExtremeML to create Excel documents and today I attempted to go a step further and use the in-memory instance of the generated document as an attachment for an email.

It seemed straight forward, create a MemoryStream object and pass it to the routine in ExtremeML to fill it with the Excel document.  Then add the MemoryStream object to the MailAttachments property of the Message object and Send!  How easy can that be…

Well, I receieved the email, the attachment was there but it was empty!

Actually, Outlook was stating it was stating the attachment was 386B but when I saved the attachment to my desktop, it was actually zero bytes.  I can only assume that Outlook is reporting the size the attachment is taking up in respect to being embedding in the raw email body.

Anyhoo, I am left scratching my head for ages.  I can swap the MemoryStream for a FileStream and it successfully saves the file.  But if I use a MemoryStream it suddenly forgets the data.  I can check the stream before it attaches it to the mail message and it seems to contain data.  And then I realise…

The stream has just been written to, the pointer within the stream is pointing to the end of the stream!

   1:  attachmentStream.Seek(0, SeekOrigin.Begin);

Is all I had to do before attaching the stream as a attachment.

I fire up the test app and I dutifully receive the email with a fully populated attachment.

I win!

Tuesday, 7 September 2010

Lufthansa Virtual Pilot

Not sure how good or bad this is but I seemed to be doing reasonably well for making mostly guestimates.

Wednesday, 26 May 2010

Quick and easy query to Active Directory

For ages I have needed a means for finding out details of the person behind a windows login as the login is just an employee number.  I had means to find these details but it was always cumbersome – not to mention slow.

The following DOS command queries Active Directory for details about the given login.

NET USER /DOMAIN <Login>

Another handy DOS command queries a who is a member of the given group.

NET GROUP /DOMAIN <Group>

Just a simple little code snippet that make my life a little easier.. :)

Saturday, 22 May 2010

OMG! A year since my last post!

Dang!

Where has the time gone?

This time last year I had a baby on the way.  Her name is Serenity.  She is a wonderful addition to the family and I love her with all my heart.

We now have a second baby on the way.  He is due on the 26th of September 2010.  Serenity was born on the 15th of September 2009.  I was a slow starter but I am certainly making up for it now.

We have a few names being kicked around at the moment.  My choice this time as Leah chose last time.  Unfortunately Leah is definitely not keen on the name, Teal’c.  I don’t know why… Just kidding :)

In fact most things sci-fi related are out of bounds.

You may think Serenity is very sci-fi related and you would  be correct.  But I didn’t chose it so the name “Serenity” was acceptable.  I am happy.  Leah is happy.  Serenity is happy too.  The thing that is really cool is that Leah came by the name “Serenity” from seeing a movie poster.  The movie the poster depicted just happened to be based on a TV series I enjoy immensely.  The TV series being Firefly of course.  It is funny how things turn out sometimes.

Anyhoo, it has been a whole year since my last blog post, sorely overdue for some kind of update, hence the purpose of this post.

I was supposed to blog about my experience with Typemock.

I am supposed to be blogging about my experience with Lightspeed from Mindscape.  Just as an aside I just recalled my old BBS days and a friend of mine, Kenji, who ran a BBS using a application called Lightspeed for the Amiga.  Ahh… those were the days… :)

I am also supposed to be blogging about my experience with Silverlight Elements also from Mindscape.

I do have a project in the works in which I could try out all the above.  My only obstacle in the way is time.

In the very near future I should be able to allocate some time to this project, subsequently blog the results here and hopefully appease the generous people from Typemock and Mindscape.

Wish me luck…

Tuesday, 19 May 2009

TypeMock ASP.NET Bundle

Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.

Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle - and for the launch will be giving out FREE licenses to bloggers and their readers.

The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.

Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePoint, ASP.NET, MVC, WCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.

The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you'll get a license automatically (even if more than 60 submit) during the first week of this announcement.

Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.

Go ahead, click the following link for more information on how to get your free license.

Sunday, 3 May 2009

Windows 7 RC and Me

This weekend I installed the recently released Windows 7 RC.

My goal was to dual boot Windows XP and Windows 7.  Apparently that was not to be.

I had most encouraging attempts at installing the new release over the weekend.  My main issue was how insanely long it took to install.  When I say long, I mean it was counted in hours.

The first install was taking so long that I also forced a reset.  It was sitting on Completing Installation for so long without any sign of progress other than the tiny little animation with the “…” that I started to hold the Power button on the PC to force a reset.  One Mississippi… Two Mississippi… Three… Holy cr4p the install just came to life!  Abort Reset!  Abort Reset!!!

The first install seemed to work just fine but I went and did a silly thing.  I have a number of partitions set up and I have assigned specific letters to them in XP which I wanted to do in Win7 as well.  The only issue is Win7 decided to assign “D:” to the XP partition.  I didn’t like that as I always set “D:” to my “Development” partition.

So I happily went along an dutifully renamed all the partitions.

Then it didn’t want to reboot anymore.

Sigh…

There is a trick to reassigning a System drive.  I had forgotten to implement it.  Time to reinstall Win7 again.

The next time, just play failed.

It ended up taking so long that next attempt that I gave up and left it “installing” over night.  Unfortunately at some point it crashed and every time it tried to recover it would complain that it had previously crashed and I should restart so that it would recover and continue where it left off.  It kinda felt like Groundhog Day seeing that message over and over again.

So then again I go through the pain of insanely long installs… except the third was relatively speedy.  For a moment there I had tried disconnecting my external drives having vaguely recalled that there was an issue with them some time again.

It seemed to do the trick.

Shame this install didn’t pick up the “Legacy” install of XP.

I tried everything I could think of.  I even resorted to restoring the XP partition from back-up even though it was a little dated - by only a couple of months mind you.  Strangely that didn’t help.  The XP partition wouldn’t boot and would keep reporting the Boot.ini file was corrupt and the NTDETECT failed.

Sigh…

So maybe I should take the plunge and commit to Win7 100% and finally dropping XP once and for all.

Time for another install.  No point keeping that XP partition any longer, I’ll move Win7 into pole position on the HDD.

So here I am, onto my fourth or fifth install of Windows 7 RC.  It took forever again… Sigh.

I have no major complaints really other my installation issues.  Most of which were caused by my own ineptitude but the speed of installation was worrisome.

I now have a shiny new install of Windows 7 RC.  I am now rested and calm again.  All that is left now is to install every other application I need to complete my PC…  Visual Studio… Add-ins… SQL Server… Subversion… Browsers… Tools… Utilities… ad infinitum…

A geeks job is never done…