January 2009 Entries

Euler Problem 13 - F#

I finally managed to solve a Euler problem in F# without first resorting to a C# version... That problem? 13... The problem is: "Work out the first ten digits of the sum of the following one-hundred 50-digit numbers." //Numbers all here... Usually, I go for the C# approach first, then see how I can work that into F#, but seeing as I didn't have any 'BigNum' types in C# (and I didn't consider the fact that I only needed to add the first 11 digits of each number - doh!) I dove straight into F#'s 'BigNum' ......

Fun binding an enum value to Viewbox child content

Catchy title eh? I've just solved this problem and thought I'd write about it. To be honest, I'm not sure it's the correct way, but it works, and at the moment, that's what matters. The problem I had was this: I have a property on a class called 'TheEnum', which is defined as such: private MyEnum theEnum; public MyEnum TheEnum { get { return theEnum; } set { theEnum = value; RaisePropertyChanged("TheEn... } } with 'RaisePropertyChanged' looking like this: private void RaisePropertyChanged(string ......