Re: Sorry dad, you'll understand, someday

This is a quick blog post, in response to Zac Gorman's excellent Magical Game Time comic.

http://magicalgametime.com/post/19718347285/ill-stop-when-ive-saved-the-world-and-fallen-in

As you play through the game Earthbound as the kid protagonist Ness, your phone would ring every few hours, and your dad would ask you if you'd like to take a break.  If you say Yes, it'd save the game and switch it off.

The comic cleverly replies as Ness: I'll stop when I've saved the world and fallen in love.  (Sorry dad, you'll understand someday).

 

My boy is still three, he doesn't understand about saving the world, or falling in love, yet.  I'm sure he will soon.  And here'd be my response to him:

  • All dads were boys once.
    We already understood.
  • So off you go, save the world.
    Go and fall in love with your girl.
  • You do what you have to do.
    This is your time, we don't expect you to hold back, or stay at home.
  • When you are tired from saving the world, stop by and have some hot chocolate and ice cream.
    We will always be your biggest fan.

 

We will return to our regular SharePoint updates soon. 

AUSPC 2012 summary

I had an awesome time presenting Building your own custom REST Services and consuming them with jQuery AJAX in the Australian SharePoint Conference 2012.  A big thank you to the developers that came and geeked out with me for an hour on a Wednesday afternoon.

Notes

When you build a custom WCF Service using the CKS template, it is deployed to a subfolder the web front end's ISAPI folder, which, in turn, is mapped to the site's /_vti_bin/ folder.

image

 

It appears that in my earlier attempt to create an incomplete version of the REST service template item, I interfered with how CKS's templates worked - and correct features for deploying the WCF service is no longer being included in the package.  While existing items were updated and deployed, the new WCF service that I was creating wasn't being deployed to the ISAPI folder.

I've removed the REST template item from my Visual Studio .NET environment, and voila - the WCF services deployed nicely once again.

So that's one mystery resolved.  Now I scratch my head about how to fix my VS.NET REST template item.

 

Downloads

AUSPC 2012 quick update

I'm in the strange and calm interlude between day 1 and day 2 of awesomeness in the annual Australian SharePoint Conference (AUSPC) 2012.

Day 1 has been a lot of fun.  Manned the user group booth in the morning with Dan Brown.  Met many of the SharePoint guys in the community that I haven't seen for the last 6 month to a year.  Talked to a number of vendors, and attended a number of awesome sessions on the developer track.

I also got to sit on the panel answering developer questions amongst the legends like Nick Hadlee, Ishai Sagi, Brian Farnhill and Jeremy Thake

The oddest part is probably with MCA SharePoint Wayne Ewington sitting in the audience.  Every time we said something silly he'd start shaking his head and we'd all stop.  Hilarious.

 

Tomorrow morning, my session on Building your own custom REST Service and consuming them with jQuery AJAX is running in the developer track at 10:30am.  Hope to see everyone there.

All my related resources and presentations on this topic are summarized on /rest

Dummy guide to install Win 8 on VHD for Boot to VHD

 

Summarized from:

You'll need:

 

Set up boot to VHD!

  1. Create a VHD

clip_image001

clip_image002

Note: I make this a dynamic disk, although I allocated up to 60GB, it only uses what it needs which was about 10 GB.

 

clip_image003

clip_image004

clip_image005

clip_image006

clip_image007

clip_image008

clip_image009

Created, and attached the VHD to Y:

 

Load the ISO into a virtual CD drive, mine is G:

I use virtualclonedrive to load ISO - this is a free utility.

clip_image001[5]

 

Next install the windows image into the VHD

Easiest way that worked for me is this wonderful powershell script.

 

clip_image001[7]

Remember to unblock this script

 

If you see:

File C:\Install-WindowsImage.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.

You will need to allow remote script

PS C:\>set-executionpolicy remotesigned

 

PS C:\> .\Install-WindowsImage.ps1 -WIM G:\sources\install.wim

Index   Image Name

[1]     Windows Consumer Preview

Done.

PS C:\> .\Install-WindowsImage.ps1 -WIM G:\sources\install.wim -Apply -Index 1 -Destination Y:

PS C:\> .\Install-WindowsImage.ps1 -WIM G:\sources\install.wim -Apply -Index 1 -Destination Y:
Applying "Windows 8 Consumer Preview" to Y:...
WARNING: This may take up to 15 minutes...

Elapsed Time: 00:08:40.4870618

PS C:\>

 

Lastly, make the VM a boot record.

 

PS C:\> bcdboot Y:\Windows\
Boot files successfully created.

 

You can check it with bcdedit

PS C:\>bcdedit

Windows Boot Loader
-------------------
identifier              {default}
device                  partition=Y:
path                    \Windows\system32\winload.exe
description             Windows 8 Consumer Preview
locale                  en-us
inherit                 {bootloadersettings}
custom:17000077         352321653
osdevice                partition=Y:
systemroot              \Windows
resumeobject            {1abc7489-8e4b-11e0-877a-af036ca44d2f}
nx                      OptIn
custom:250000c2         1
detecthal               Yes

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {1abc7482-8e4b-11e0-877a-af036ca44d2f}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {1abc7480-8e4b-11e0-877a-af036ca44d2f}
nx                      OptIn

 

Restart and you are off to go

 

Your PC will boot into Windows 8, which has a new happy looking boot loader.  If you feel the 30 second delay is too long, you can change the delay to 5 seconds from the boot loader options.

Knockout binding formatters for date and currency

 

Dependency

  • Requires Knockout
  • jQuery (for setting text())
  • ASP.NET (for the formatting functions).

 

ko.bindingHandlers.date = {
    update: function(element, valueAccessor, allBindingsAccessor) {
        var value = valueAccessor(), allBindings = allBindingsAccessor();
        var valueUnwrapped = ko.utils.unwrapObservable(value);
       
        var d = "";
        if (valueUnwrapped) {
            var m = /Date\([\d+-]+\)/gi.exec(valueUnwrapped);
            if (m) {
                d = String.format("{0:dd/MM/yyyy}", eval("new " + m[0]));
            }
        }       
        $(element).text(d);   
    }
};
ko.bindingHandlers.money = {
    update: function(element, valueAccessor, allBindingsAccessor) {
        var value = valueAccessor(), allBindings = allBindingsAccessor();
        var valueUnwrapped = ko.utils.unwrapObservable(value);
       
        var m = "";
        if (valueUnwrapped) {       
            m = parseInt(valueUnwrapped);
            if (m) {
                m = String.format("{0:n0}", m);
            }
        }       
        $(element).text(m);   
    }
};

Usage:

 

  • data-bind="money: myMoney"
  • data-bind="date: myDate"

 

Note:

Dates are converted from ASP.NET's date format: \/Date(1000+1000)\/