Thursday, 14 October 2010

Words of the day – Sesquipedalian Loquaciousness

“A predilection by the intelligentsia to engage in the manifestation of prolix exposition through a buzzword disposition form of communication notwithstanding the availability of more comprehensible diminutive alternatives.”

A colleague pointed this phrase out to me at the office today. So far I’ve spent the last ten minutes practicing trying to pronounce it.

[ses-kwi-pi-dey-lee-uh n] [loh-kwey-shuh s ness]

And it’s available for you right now for only ten measly syllables…

Tuesday, 5 October 2010

Who messed with my config file?

I hit this doozy of an error in CRM when deploying code to a production environment today. Specifically when i was publishing changes to a workflow.

“AN ERROR OCCURRED WHEN THE WORKFLOW WAS BEING CREATED. TRY TO SAVE THE WORKFLOW AGAIN”.

WTF? So apparently when you have made unsupported changes to the CRM config file, when subsequent rollups are applied they don’t update the config file,  As it detects that it has changed and does not apply the latest updates to prevent the unsupported changes from being overwritten.

I’m looking forward to finding out who the tool was thought it was a good idea to makes changes to the config file on the production environment and then not tell anyone. There’s a straight shooter with upper management written all over them.

Thank god for Pablo Peralta and this blog he wrote last month, describing the cause and the fix. He probably just saved someone's life.

Wednesday, 7 July 2010

TDD Kata

Courtesy of Roy Osherove. A nice TDD Kata that helps to introduce the applying of the fundamentals of TDD to any language. Red, Green, Refactor!

Wednesday, 19 May 2010

Enabling a wireless adapter on Hyper-V

I was working from home last night and kick started my Hyper-V VM to VPN to the client development environment (in order to remote to the development machine.. don’t get ne started on the 3 or 4 computer hop) when i found that my image wouldn’t connect via my wireless connection. I did some digging and it turns out that Hyper V does not support connecting via a wireless adapter by default. (There are apparently good reasons for this.)

It requires a small amount of configuration kung-fu. I found this great article by Ben Armstrong a virtualisation manager at Microsoft outlining how to resolve this issue

To paraphrase

  • Create a new internal network on the virtual network manager – i called mine wireless
  • Open network and sharing and find the wireless network adapter on your machine (make sure you have the actual adapter and not a wireless network you can connect to).
    • Right-click and find properties and select the sharing tab
    • Check the Allow other network users to connect through this computer's Internet connection checkbox

You’re done. Assign the internal network adapter to your hyper-v image and enjoy.

Thursday, 6 May 2010

Test framework comparison

A great comparison of the various .NET testing frameworks available

SIM to MicroSIM

Great “how to” article by John Benson. The meat cleaver is nice touch too,

Wednesday, 5 May 2010

Google to launch digital books

Currently called “Google Editions” this might hopefully start Amazon and Apple to start unshackling their respective Kindle and iBook stores.

“The company is hoping to distinguish it from offerings from incumbents like Amazon by allowing users to access books from a broad range of websites using a broad array of devices”

Speaking as a consumer in New Zealand who can not access e-book content on either platform (without some serious geek kung-fu), because we suffer form some archaic form of regionalised protectionism (we’re a global economy, media companies… come join us in the 21st century) i would just like to say…

It’s about time!

Tuesday, 20 April 2010

What’s with all the CRM?

In case you’re curious I have shifted teams at work and now I am working with Microsoft’s Dynamics. Specifically CRM at the moment. So for the last two weeks and for the next month and a half I am working with Microsoft CRM. And quite enjoying it too. 

Change is good!

Writing to a CRM date control from a child form

Despite the fairly innocuous title this issue had been bothering (driving me crazy) for most of the last day.
Problem:
The clients CRM Contact form has a button that uses JavaScript to launch an external web page (we’ll call it the child form). This form would perform a search and return a list of matching users. Each user would have a button and when you clicked a user’s button it would use JavaScript to populate the parent form’s (in this case the CRM contact form) fields such as address, gender, ethnicity and date of birth.

e.g. opener.document.crmForm.all.address1_line1.DataValue = [address text];
Now this worked fine for the text fields, and pick lists but when I tried to write to the date control it did not play nicely. Now to populate a date control in CRM using JavaScript you set the DataValue to a JavaScript date
e.g. opener.document.crmForm.all.birthdate.DataValue = new Date();
However when I called this code from the child form it would populate the CRM Contact Form’s date of birth control successfully but that’s as far as it got. It would then hang if I tried to close or save the form. It would say a CRM error occurred and it that it had to close the form.
However when I tried putting the exact same piece of code without the parent reference in the Contact form’s CRM load event
e.g. crmForm.all.birthdate.DataValue = new Date();
it would work fine. It would save or close the form with no problem. Awesome!! Nothing like inconsistent behaviour.

Solution:
My work colleague Steven Foster wins the chocolate fish for the “magic” workaround (I thought magic sounded better than dirty) that saved the day :)
The solution was to have a hidden text field on the CRM Contact form that the child form would write the date to as text e.g. “21/11/2009”. Fortunately the child form would always write the date in a consistent manner so I could rely on it being in the format “dd/MM/yyyy”. Then I called the hidden fields FireOnChange() event to trigger the CRM OnChanged event. I then added a CRM OnChanged event to the new hidden text field that would parse the string and convert it into a JavaScript date and use that date to populate the date of birth control.

The JavaScript code on the child form
opener.document.crmForm.all.[hidden text field].DataValue = [date of birth text];
opener.document.crmForm.all.[hidden text field].FireOnChange();

The JavaScript on the CRM Contact from hidden text field OnChange event
var textDate = crmForm.all.[hidden text field].DataValue;
var dateParts = textDate.split(“/”);

var birthdate = new Date();
birthdate.setDate(dateParts[0]);
birthdate.setMonth(dateParts[1]-1);
birthdate.setFullYear(dateParts[2]);

crmForm.all.birthdate.DataValue = birthdate;


So there you go problem solved!

Monday, 19 April 2010

How to migrate iTunes libraries

Surely this process should be easier…

Thursday, 15 April 2010

Do not develop CRM on a machine that you are also deploying into the GAC

I was getting a System.TypeLoadException as it couldn’t find the file i had just added in my project. Every time i ran my test against the project i kept getting the same result. Enter plenty of colourful language and head bashing.
Fortunately in my googling i came across this helpful explanation on StackOverflow. It turns out that if a version of the file exists in the GAC then it will use the GAC version (assuming the version number is the same) and not the version you think you are debugging. Thank god for Google but how did i get here?
I am currently on a Microsoft CRM project and i had to build a plugin (dll) and deploy it. The development environment is hosted by the client and is also the test environment. Anyway it turns out when you want to deploy two dlls as part of a plugin (for example the plugin dll and some domain or business logic layer dll) then you have to deploy the secondary dll (not the plugin) to the GAC so that it can be referenced… nuff said there really.

So the short version is try and avoid debugging projects that are in the GAC as well. I think Chandler from friends sums it up quite nicely “oh god, can open… worms everywhere”

Wednesday, 14 April 2010

MP3 store Comparison

It is very interesting to see who is putting in personal tracking details in the music they sell. As a bit of an Apple fan i am pretty disappointed

Tuesday, 30 March 2010

Base 10 file

A friend of mine on twitter @benmcdowell (i recommend his Harmonica iPhone app by the way) recently twittered about the file size 1 kB being 1024 versus 1000. The reason being that Ubuntu has just made the shift to base 10. With Apple having made the shift in Snow Leopard it leaves Microsoft still clinging to a slightly outdated version of measuring file size.

It’s an interesting topic as it seems logical to shift to base 10 but it is obviously a lot easier to execute the ostrich manoeuvre and just stick your head in the ground and hope it goes away

Kind of reminds me of the classic metric versus imperial debate

Thursday, 25 February 2010

Mercurial

Today i was planning to write about my decent into the world of Distributed Version Control Systems (DVCS. Specifically i was going to talk about Mercurial but it turns out that most of the heavy lifting has been done for me.
I felt very motivated to use a DVCS in my next personal project after reading Martin Fowlers bliki and then writing about them last week. Based purely on Martin Fowlers recommendation, some light googling and my magic 8-ball I decided to go with Mercurial. Also the fact it has strong windows and mac support (unlike GIT) and is a fairly mature product might have had something to do with it :)

Coming from a Subversion background i had a bit of unlearning to do. My first mistake was forgetting that as a distributed version control system every machine needs to have its own repositories. Whoops.... that little assumption took me about half an hour of fluffing around trying to understand why my mac client (murky) kept tanking on me.

Anyway it turns out that there are some great articles/tutorials out there of those who have done the hard yards for you. So why reinvent the wheel?

  • Joel Spolsky has put together a fantastic series of six tutorials at http://hginit.com outlining the key concepts. My favourite is the first tutorial where you are forced to unlearn your bad subversion habits
  • StackOverflow has a great wiki on all you would ever need to know on the who/what/where/why/how of Mercurial
  • A great Mercurial client for the mac by Jens Alfke called Murky
  • And for windows subversion users there is of course TortoiseHg to ease the pain of transition
So enough blogging. Time to cut some code

What happens when you type in a url

This is a great blog post by Igor Ostrovsky at Microsoft about what happens when a url is entered.

This should be compulsary reading for any web developer or anyone at all interested in the actual workings of the internet. This is where the magic happens :)

Thursday, 18 February 2010

Source control

Martin Fowler has just posted a really interesting blog on source control... my favourite part was this comment about Visual Source Safe

"I've heard too many tales of repository corruption to trust it with anything more valuable than foo.txt."

Brillant! I think anyone who has touched VSS would agree with these sentiments.


The blog actually got me thinking about source control and continuous integration which is a natural level of progression from it.
I was never introduced to to any type of source control or even an overview of what source control was, while i was studying at university. Although that shouldn't really surprise me i guess... i hear they still teach the waterfall software development methodology anyway.
The point is, is that these are major tools in any developers arsenal, from one man start ups to large developer teams. Yet graduates are coming out of their studies and we have to teach them from scratch, the why as well as the how. Being language and platform agnostic there is no reason for universities not to teach these fundamental skills.

Anyway I have been keen to take a look at a distributed version control system (DVCS) for some time now so perhaps this is the push i need. The only question is now GIT or Mercurial?

What is your preference and why?

Thursday, 11 February 2010

From C# to Objective-C

The book The Pragmatic Programmer recommends that as part of a programmers ongoing learning that we should learn a new language every year. So this year i thought I would actually follow through on this and learn Objective-C.

The reasoning was pretty simple. I love my iPhone, so messing round with writing apps for it in my own time kind of appeals. Also i own a still shiny late 2009 MacBook Pro, so i can just download the SDK and start having a poke around. Finally i have always wanted to learn C in some way shape or form, (in fact Joel Spolsky has quite a strong opinion on this) and as Objective-C is classed as being a "Strict superset of C" i thought this would be an ideal way to knock off two goals of mine.

Now as a Java/C# developer by study and then professional life I'm not quite used to the different syntax or degree of flexibility that a lower level language live Objective-C offers. For example an Interface is not what i understand an Interface to be, for that you need a Protocol (or are they more abstract classes?) Good times!!

Fortunately in my potting around i've found some good links/resources which i've included below. I'll continue to update this list so please feel free to drop me any of your tips or hints. 

  • This is a great post by Scott C Reynolds who also gave me the inspiration for this post  as well. 
  • Very useful article on going from C# to Objective-C and some of the pitfalls encountered. Also a nice reminder of some very helpful design patterns. 
  • Great blog by Chris Small with heaps of detailed code examples comparing C# to Objective-C 
  • A useful question raised by someone in a similar situation on StackOverflow


Let me know what works for you


  

Google as an ISP?

Anytime that Google wants to come to New Zealand and try this out is fine by me

http://googleblog.blogspot.com/2010/02/think-big-with-gig-our-experimental.html

1 gigabit per second over fibre straight to your door! I don't think the day is far away when houses will start needing fibre in the house, not just leading to it.

Tuesday, 9 February 2010

Xcode - Can't find outlet or action server on the inspector panel


Turns out it's on the library window on the classes tab. As they refer to the class not the instance.

Monday, 8 February 2010

So it turns out that vaccines do not cause autism

What i don’t get is how come it took the lancet so long to print the retraction

Friday, 5 February 2010

Great comment on flash… or the lack thereof

I really enjoyed this little article by Barry Dorrans talking about how Apple not having flash (or the little blue brick) on the forthcoming iPad is not such a bad thing
My favourite line “It’s not a little blue brick people, it’s a little blue condom …

Sunday, 31 January 2010

Lamb on a spit

Just a friendly warning,  if you are squeamish then you might not want to scroll down. There are photos of a lamb being prepared for cooking.
So today was the day of the trial run. Despite the grey weather and one of the two burners playing up i think i can safely mark it down as a successfully day.
We were guided through the process by our resident spit expert Anthony. So without further ado.. lets get amongst it
DSC01431
The lamb

DSC01433 
Step 1 (see above).  Insert the rod at the business end. Insert skewer with the wing nut facing up, if you hit bone use a hammer to punch the skewer through it. Ensure you have room at the other end of the rod (move the lamb down the rod if necessary). Tighten the wing nut.

DSC01436 DSC01435
Step 2 (see above). Insert the skewer at the neck end with the wing nut facing down this time. Again hammer the skewer if it gets stuck on bone.

DSC01439 DSC01440
Step3 (see above). Adjust the position of the lamb by hammering the prongs at the neck end (making sure you remember to loosen the wing nuts) until feet are just short of the grove for the spit. Pull the hind feet up and hold against the rod. Thread the wire through the tendon and around the rod and then loop around again this time going all the way under and the feet. Then get pliers lift up to get tension on the wire and twist until the wire is tight. It is important to note that you do not want to over tighten the wire as this will weaken it and cause it to snap.

DSC01443 DSC01442
Step 4 (see above). Take the neck and hold against the rod. Thread the wire through the hole in the rod and wrap around the lamb several time and then tighten by lifting up the wire and twisting (as in step 3)

DSC01444DSC01445 
DSC01447DSC01448 
Step 5 (see above). Take about 1 foot of wire and shoe horn it so it looks like a very skinny version of the letter “U”, then about two thirds of the way down the lamb punch it through the body either side of the spine trying to aim between the ribs. This might take several attempts. Then pull the wire through with pliers and lift, tighten and twist (as in step 3). Then about one third of the way down the lamb repeat the process.

DSC01450DSC01451 
Step 6 (see above). Take a carving knife and punch 20-40 holes (depending on the size of the lamb) all over the lamp. Then insert a clove (or half clove) of garlic into each hole and add a small one inch length of rosemary. Then rub a generous amount of salt through the inside and outside of the lamb.

DSC01455DSC01457 
Step 7 (see above).  Take two bits of wire both about a foot (or less) long.  Close up the chest cavity at the head end and take the two bits of wire and tie up the cavity. One at just below the highest point (picture on the right) and the other about half way or a bit further down.

DSC01458DSC01459
Step 8 (see above). Remove the front legs with a boning knife. This is quite tricky and you need to make sure you cut through all the tendons while leaving the knuckle on the lamb. Then on each leg hold the meat side up and half way down cut all the way to the bone (as if you were trying to cut it in half) then put the two front legs aside.

 DSC01462
DSC01463
Step 9 (see above). About 1/3 of the way between the top of the chest and the bottom of the chest make two 1 inch cuts running parallel to each other on either side of the lamb. Then pull the skin though like a button hook and feed a front leg through with the cut facing up so that the ‘button hook’ fits in the cut. Then repeat again for the other foot about 2/3 of the way down.

DSC01464DSC01465 
Step 10 (see above).  Take a whole onion and any remaining garlic and put into the cavity of the lamb. Then close up any remaining gaps with more wire. Finally rub some more salt on the outside.

DSC01468
Step 11. (see above). Throw onto the spit and cook for 3-4 hours (depending on weight). We cooked this 15.3 kilogram lamb for 3 hours.You probably need to allow 4+ hours for 17-18 kilograms.

DSC01480DSC01484  Step 12 (see above). Remove when cooked and cut all the wire. Then cut up the lamb and enjoy!

Friday, 29 January 2010

Steven Fry on the iPad

He writes an insightful article about the iPad and why you should try it before you judge it.
My favourite line
Slightly annoying that the iPhone autocorrects iPad into upas – which is a kind of poison mulberry I believe…

Thursday, 21 January 2010