Recovering lost disk space on Windows 7

A colleague at work suggested I download Team Fortress 2 since it’s now free on Steam.

It requires about 10 gig disk space – I only had about 3.5gig. Scott Hanselman recently wrote a blog post on how to Freeing up Disk Space under Windows 7.

I’m normally quite skeptical on these suggestions. 9 times out of 10 they are common sense.

Long story short, I did the first 4 steps (he has about 10 more) and I got back almost 20 gig back!

Who’d have thought?

Setting Entity State in Dynamics CRM 2011

Setting Entity State in Dynamics CRM 2011
I had an interesting challenge recently.

As part of a Credit Card Payment Solution we are working on, I was trying to set the Invoice State.

According to the MSDN documentation, all you need to do is set the Status Code = 100001 and the State Code = 2.

Eg:


Guid invoiceID = new Guid("Existing Invoice Guid");
IOrganizationService orgService = OrgServiceFactory.GetInstance();

orgService.BeginRetrieve("invoice", invoiceID, new ColumnSet(new string[] { "invoiceid", "statecode", "statuscode" }), (result) =>
{
    var fetchResp = orgService.EndRetrieve(result);

    var statecodeAttrib = fetchResp.Attributes.Single(a => a.Key == "statecode");
    OptionSetValue statecode = (OptionSetValue)statecodeAttrib.Value;
    statecode.Value = 2; 


    var statuscodeAttrib = fetchResp.Attributes.Single(a => a.Key == "statuscode");
    OptionSetValue statuscode = (OptionSetValue)statuscodeAttrib.Value;
    statuscode.Value = 100001;

    orgService.BeginUpdate(fetchResp, (updateResult) =>
    {
        /* Web Exception thrown here */
        orgService.EndUpdate(updateResult);
        Console.Write("");
    }, orgService);

}, orgService);

When I did this, I was getting a “NotFound” exception.

So I asked this on Stackoverflow.  Turns out in CRM 2011, you need to use the SetState message.

Digging a little further, the SDK has a good example of how to take an Opportunity to a Won Order, to a Sales Order to an Invoice.

Illustration courtesy of Jon Watson.

Retrieving the Text of an OptionSet in Silverlight

I’ve been pulling my hair out over this.

 

If you look at the Dynamics CRM 2011 SDK, you can see how to get an Entity using FetchXML:

Using FetchXML, you can get to an entity like this:


string fetchXML = "<fetch mapping='logical'>";
fetchXML += "<entity name='account'><all-attributes/>";
fetchXML += "</entity></fetch>";

IOrganizationService orgService = OrgServiceFactory.GetInstance();
orgService.BeginRetrieveMultiple(new FetchExpression() { Query = fetchXML }, EntityGet_callback, orgService);

And the callback:


public void EntityGet_callback(IAsyncResult ar)
{
   IOrganizationService orgservice = ar.AsyncState as IOrganizationService;
   var fetchResp = orgservice.EndRetrieveMultiple(ar);
    var entities = fetchResp.Entities;
    foreach (var entity in entities)
    {
        var email = helper.GetValue(entity, "email");
    }
}

 

Nothing fancy in the helper method:


public static object GetValue(Entity entity, string name)
{
    if (entity.Attributes.ContainsKey(name))
    {
        return entity.GetAttributeValue
&amp;nbsp;
    }
    return null;
}

 

If I wanted to get the Address 1 Type, I would use:


helper.GetValue(entity, "address1_addresstypecode");

Unfortunately this returns the value (0, 1, 2…) Not the string.

The answer is the Entity.FormattedValues.

Eg


entity.GetAttributeValue

With thanks to a post on Sayantan Samanta’s blog.

What is Klout?

What is Klout?

Recently, Cathie McGinn tweeted:

I first heard of Klout during an interview with their CEO Joe Fernandez, on This Week in Startups.

So what is it? For me, Klout is a method of measuring who is popular in social media and why.

Lets use a few examples:

Three people I admire, and all with a Klout score of 60 or better.

The “score” is a percentile rank. 60 or above means you are in the top 40%.

Below is a screen shot of Scott’s, Em’s & Cathie’s profiles:


This is very powerful stuff! It allows me to see how I compare to my peers, and provides me with intelligent data on what I can do to improve my social profile.

If I was being honest with myself, I’d say that I am focused, but not very consistent – the images above reflect this.

 

The lesson learnt here is that I need to create and I need to do this more often.

Back to Cathies’ tweet, it makes sense that she feels her most influential topics aren’t relevant to her – Klout describes Cathie as a Broadcaster – “She broadcasts great content that spreads like wildfire. An essential information source in her industry.

Great!  From that I can conclude that I should be connecting with people like Cathie more often.  If what I write resonates with her, then there is a good chance she will tell her network.

 

Another extreme would Australian Comedian, Wil Anderson:

Klout thinks’ Wil is most influential on kurt cobain, the royal wedding & miley cyrus.  If you have listened to Wil’s podcast TOFOP, then you will have some idea of why the royal wedding was popular but also his material is very broad.

 

What can we learn from all this? 3 take home points:

  1. Don’t take the score too seriously!  (Klout thinks I am influential on Unicorns…)  It is a great tool to see what makes up a person with a score of 20, 30 or 40.  It’s less clear on how you go from a 61 to a 67.
  2. It is a good way to see who is doing what in social media – what’s working and what isn’t
  3. Lastly, it is the only tool I’ve seen that allows you to compare yourself across a wide range of people
What do you think?  What tools do you use to measure & monitor your social profile?
Rock on!
Christian

If the voyage of the best ship is a zigzag line…

I’ve often thought that if you look back through the history of my blog, how would you describe it? With categories like 30 day challenge, Development, Low-carb diets and Photos – probably the kindest thing you could say is that I am a frustrated entrepreneur who doesn’t know what he wants.

I’ve signed up for the #Trust30. This is described as:

To celebrate Emerson’s 208th birthday, The Domino Project is republishing a work of art that’s especially relevant today. Self-Reliance by Ralph Waldo Emerson urges readers to trust their intuition rather than conforming to the will of the majority.

Sign up, and you get a daily warm fuzzy inspirational message. Funnily enough, today’s message really made me stop and think:

If ‘the voyage of the best ship is a zigzag line of a hundred tacks,’ then it is more genuine to be present today than to recount yesterdays
By Liz Bobulate:

I often notice that I beat myself up. I kick myself when I find myself off track (what track that might be at the moment…).

But on reflection, if the best (insert noun – ship, space craft, person) takes a path that is never straight, why would I be any different?

Thanks Liz!

Rock on,
Christian

The problem with Tekpub…

The problem with Tekpub…

I like Rob Conery. But he is the sort of guy who just seems to go out of his way to cause trouble…

A good example is a post I wrote a couple of years ago.

What’s funny is that Rob even commented on the post. But unfortunately he missed the point. Rob is a classic “Ready, Fire, AIM!” type of person.

Case in point, I recently purchased a 12 month Tekpub subscription. (Tekpub is an online technical education resource).

Now a 12 month subscription for a little under $300 is good value. It’s competitors are either Youtube videos or companies like Plural Sight.

Last week, Rob posted this tweet:
.

Awesome! So why did I pay full price?

But that’s ok, Rob’s a good bloke! So I pinged him, asked if I could get a 29% extension, sent my Order Number (twice), followed him up…

And then? Well not much!

I don’t know what to make of it. Maybe he has updated my subscription? Maybe he hasn’t. Funny thing is that Tekpub doesn’t show when your subscription ends, just when you signed up.

I’ll keep you posted…

Home Theater PC

Home Theater PC

Recently Jeff Atwood of Coding Horror fame, updated his Home Theater PC. I had been thinking of doing the same, so below is my experience.

CPU Intel Core i3-2100
Motherboard MSi H67MA-E45
Memory Kingston 4GB DDR3

Standard case + power supply. I also added a 2TB hard drive + a Blueray writer.

Total damage: $800

Originally I installed Windows 7 Home Premium but had a few driver problems.

So I started again with Windows 7 Home Premium N and no problems.

How does it rate next to Jeffs’? 4.6 Windows Experience Index
Jeff managed a 5.1 – but I agree, take out the Aero desktop support and you have a 5.8 machine!

Interesting, Jeff got me all inspired when he started to talk about power consumption. He has been writing about this for sometime now. When I tested this machine, it was just under 40 watts.
Media PC Power Consumption
I have no idea how Jeff pulled off 22 watts, but he did say that he recycled old parts from a previous build.

I’m not too worried since a) this machine will be either in stand-by or turned off when not in use and b) a low power consumption device is going to increase the cost significantly.

For well under $AUD1,000 I’m only annoyed I didn’t do this sooner!