Dutton's blog

How to stop Lego's Life of George iPhone and iPad app from crashing

Lego Life of George ScreenshotFor those of you who know me it's no surprise that I'm a big kid with a borderline unhealthy fascination with Lego, so when Mrs Santa very kindly brought me the Lego Life of George game this year you can understand my disappointment to download the iOS app on my iPhone only to find it consistently crash on startup rendering the whole thing pretty useless.

Same story on my iPad and no matter how many times I restarted or closed all other apps. It's understandably getting quite a lot of bad reviews on the App Store with people threatening to return it.

Anyway, until Lego sort this out you can get the app working (albeit with all the online functionality disabled) if you put your device in airline mode.

Hope this helps any other kids out there (both big and small :) ).

Introduction to Caliburn.Micro on Windows Phone 8

I thought I'd try something different with my latest home software project; after writing a "ViewModelBase" INotifyPropertyChanged implementation for the millionth time (I really should start creating some shared libraries) I decided to have a look at one of many MVVM libraries out there and stumbled across Caliburn.Micro. Here are some newbie notes on my experiences.

Windows Phone 8 Support
I'm writing a Windows Phone 8 application, so fell at the first hurdle after installing the package through nuget and following the tutorial here. This doesn't work under WinRT and so my attempts at using the generic form of Bootstrapper were met with

The non-generic type 'Caliburn.Micro.Bootstrapper' cannot be used with type arguments.

instead you need to derive from PhoneBootstrapper to end up with something looking like this:

    public class AppBootstrapper : PhoneBootstrapper
    {
        PhoneContainer container;


      
Microsoft Deal: 50% off ebook - Build Windows 8 Apps with HTML5 and JavaScript

Build Windows 8 Apps with HTML5 and JavaScript Cover

I mentioned that I took the Microsoft MCTS exam for development in HTML5 and JavaScript a while back, well for those who are still interested in exploring this new area of development Microsoft Press are discounting their beginners guide "Build Windows 8 Apps with HTML 5 and JavaScript" in ebook form today from $19.99 to $9.99.

Check it out here using code MSDEAL at checkout to snag the discount.

 

 

A Simple C# Sorted Observable Collection

I know that this can be done with ICollectionView without modifying the underlying order, but for times when I really must have my bound collection sorted, I use this:

    /// <summary>
    /// A Sorted ObservableCollection.
    /// - Sorts on Insert.
    /// - Requires that T implements IComparable.
    /// </summary>
    /// <typeparam name="T">The type held within collection</typeparam>
    public class SortedObservableCollection<T> : ObservableCollection<T>
        where T : IComparable
    {
        protected override void InsertItem(int index, T item)
        {
            for (var i = 0; i < Count; i++)
            {
                switch (Math.Sign(this[i].CompareTo(item)))
                {
                    case 0:
                    case 1:
                        base.InsertItem(i, item);
                        return;
                    case -1:
                        break;


      
How to FTP to your Azure Website

Yesterday evening I experienced my first WordPress White Screen of Death when trying to open the admin page on this blog. For those unfamiliar with the term, it can be caused by the process running out of memory on the server resulting in a plain white page being served up instead of some part of the site.

This excess memory usage is normally caused by a plugin misbehaving and I have been playing with some new plugins lately so I figured this might be the problem. A quick google took me to this solution which looked simple enough; FTP onto the site, rename the plugins directory to solve the white screen problem, then re-enable them one at the time to see which one causes the issue.

But now I'm using Azure as my web host, how on earth do I FTP onto it? Here's how:

  1. Log in to your Windows Azure dashboard.
  2. Select the website you want to FTP onto.
  3. Click to download the publish profile. AzureDashboard
  4. You will end up with a file which looks something like this:PublishProfile
    I opened this in Programmers Notepad so it was easier to read. Find the FTP publishProfile node and the fields are pretty self explanatory.

    • publishUrl - This is the address to FTP to.
    • userName - Your username.
    • userPWD - Your password.
  5. Bung these into your favorite FTP client, et voila!