| Comments

“This is the first generation of kids expected to live a shorter life than you.  Or...you guys can start kicking some ass.” – Jamie Oliver.

Jamie Oliver's Food Revolution

There’s been a show running on ABC recently…about 6 episodes.  It’s called Jamie Oliver’s Food Revolution.  It appears to have been taped during the fall of 2009 in Huntington, West Virginia (which evidently was selected because of high child obesity data).  The show absolutely has a bit of Hollywood, a ton of editing, but I don’t think anyone can doubt Jamie’s (and the producers, who also includes Ryan Seacrest) intention to get the word out about change in our food for our children.  Their target primarily was school lunches for kids.  This isn’t a review of the entire show, but I highly recommend watching the season finale of the show.  It tells a serious story that I don’t think is isolated to a small town in West Virginia.  In fact, as I look at my daughter (7-years old) and her school lunch offerings, I see the same things of food choices.

I’m a bit of a documentary buff.  I love controversial topics.  Perhaps that is why I’m drawn to this.  I am also a fan of things like Food, Inc., King Corn, and other food-based documentary.  If you haven’t seen these and want a perspective on where your food in the US comes from, watch them.  Are they one-sided?  Perhaps.  Are they factually inaccurate?  I don’t think so personally.  But it’s good information, controversial or not – as it caused me to think about the food I eat.

Several years ago my father had a heart attack.  His third in fact.  This one didn’t go well.  He went into intensive care and his heart was damaged beyond repair.  He needed immediate help.  For 8 months he had an artificial heart and had to live in Tucson Medical Center in a hospital room for this time.  You see, an artificial heart sounds ‘easy’ but it actually was an external ventricle system attached to what looked like a washing mashing.  He couldn’t walk without an engineer pushing this washing machine sized thing with him.  In a fortunate/unfortunate situations a heart was made available and my father is alive today because of a human heart transplant.  Truly a miracle.  His history in his family is one of obesity, high blood pressure, and poor eating.  And I’m the next :-0.

According to the CDC BMI indexes, I’m overweight and bordering on obesity.  Seeing that word ‘obese’ is frightening because I don’t at all consider myself obese.  This January I started to change that process.  I lost about 18 pounds.  Getting it off takes dedication and determination, but I did it.  Now keeping it off continues to be a tough challenge, but I recognize a healthier and better feeling as the pounds come off.

Now when I see Jamie’s show, it hits home a lot harder.  My kids Zane (4) and Zoe (7) are my only children and as I continue to grow as a parent.  Things like music lyrics and television shows or only half the battle.  My kids’ diets are a concern in my family.  Unfortunately I’m victim to the same things every parent is, being surrounded by hugely convenient options over healthy options.  Breakfast at my house?  Waffles.  Lunch for my son?  Usually chicken nuggets.  Frankly he doesn’t eat anything that isn’t orange.  My daughter is pretty picky as well. 

Jamie also had an opportunity to present at TED and actually won the TEDPrice for 2010.  His talk is worth watching.

If you are a parent, watch these shows (they are free on ABC.com or Hulu).  Like I said, sure there is some Hollywood action happening, but the message and reality behind school lunches is real.  See if you are the same parent that packs the brown bag lunch of crap like I do.  Is a hamburger at lunch going to kill your kid?  I don’t think so, but all things in moderation right?  We, as parents, need to help our children make the right food choices and provide a healthy lifestyle at home first as we know they won’t get it elsewhere.  It starts at home.  Period.

I’m grateful that Jamie and Ryan produced this Food Revolution show.  It was both entertaining and informative.  I hope that others can join in the ‘food revolution’ that Jamie brought awareness to in their own homes and communities.

Sorry for the distraction from the normal technology geekiness…but this ‘food revolution’ has struck a chord with me as an important thing to ensure I shared.  I’m going to try to start making changes at home.  I know it won’t be simple, I know it won’t be convenient, but I also know that my children’s health is MY responsibility.

| Comments

A little bit of hidden gem in the Silverlight 4 release is the ability to modify the Authorization header in network calls.  For most, the sheer ability to leverage network credentials in the networking stack will be enough.  But there are times when you may be working with an API that requires something other than basic authentication, but uses the Authorization HTTP header.

The Details

Basically you just set the header value.  How’s that for details :-). 

Seriously though, here’s a snippet of code:

   1: WebClient c = new WebClient();
   2: c.Headers[HttpRequestHeader.Authorization] = "Auth header from same domain-browser stack";
   3: c.DownloadStringCompleted += ((s, args) =>
   4:     {
   5:         if (args.Error != null)
   6:         {
   7:             response.Text = args.Error.Message;
   8:         }
   9:         response.Text = args.Result;
  10:     });
  11: c.DownloadStringAsync(new Uri(http://localhost:4469/handler.ashx));

As you can see in the code is rather simple.  Prior to Silverlight 4 you’d receive an exception that setting the header isn’t possible…but now it is.  If you are using HttpWebRequest instead it would be just as simple:

   1: HttpWebRequest req = (HttpWebRequest)WebRequest.CreateHttp("http://localhost:4469/handler.ashx");
   2: req.Headers[HttpRequestHeader.Authorization] = "Auth header from same domain using HWR";
   3: req.BeginGetResponse((cb) =>
   4:     {
   5:         HttpWebRequest rq = cb.AsyncState as HttpWebRequest;
   6:         HttpWebResponse resp = rq.EndGetResponse(cb) as HttpWebResponse;
   7:  
   8:         StreamReader rdr = new StreamReader(resp.GetResponseStream());
   9:         string foo = rdr.ReadToEnd();
  10:         Dispatcher.BeginInvoke(() =>
  11:             {
  12:                 response.Text = foo;
  13:             });
  14:         rdr.Close();
  15:  
  16:     }, req);

That’s it.

The Support Matrix

As such this feature does have some restrictions for security reasons.  Basically the difference has to do with cross-domain calls.  Here’s the feature support matrix in the simplest terms:

Network Stack UsedDomain TypeAuthorization Header Allowed
Browser (default)same domainYes
ClientHttpsame domainYes
Browser (default)cross-domainYes with policy
ClientHttpcross-domainYes with policy

As you can see a cross-domain call of this (i.e., setting an Authorization header on a 3rd party site) would require that a valid clientaccesspolicy.xml be in place.  Here’s an example of a pretty liberal one:

   1: <?xml version="1.0" encoding="utf-8" ?>
   2: <access-policy>
   3:     <cross-domain-access>
   4:         <policy>
   5:             <allow-from http-request-headers="Content-Type,Authorization">
   6:                 <domain uri="*"/>
   7:             </allow-from>
   8:             <grant-to>
   9:                 <resource include-subpaths="true" path="/"/>
  10:             </grant-to>
  11:         </policy>
  12:     </cross-domain-access>
  13: </access-policy>

I should note that when I mean ‘pretty liberal’ this means that the above makes all your resources available to all Silverlight clients.  But pay attention to the http-request-headers section.  Notice the addition of the Authorization header (Content-Type is default always).  By adding this you would be able to have a cross-domain Authorization header writing ability.  Without it you’d see a security exception.  And remember, the policy files exist on the destination endpoint and not in your app.  To demonstrate this, here’s my quick sample application output:

Auth header sample app output

You can download the code for this sample tester application here: Authheaders.zip

Summary

Hopefully this is good news to some developers.  Now with Silverlight 4 we have network credentials support and the ability to use the Authorization header when needed for other purposes.  It’s a little hidden gem that frankly could have been better called out in the docs a bit.

Hope this helps!

| Comments

One of the new features in Silverlight 4 is the ability to sign your XAP applications so that your out-of-browser trusted applications look more friendly (trusted) to your users, they come from a verified publisher, and they can take advantage of the auto-update APIs in Silverlight.

If you don’t know what I’m talking about, here’s some resources for some background:

Basically if you are writing a Silverlight 4 trusted application, you WANT to be signing your XAPs.  The XAP sign process uses the normal Authenticode process for code signing. 

Thanks to our friends at GoDaddy, they want you to sign your apps as well and have them delivered from a verified publisher!  They are providing Silverlight developers a 50% discount on their code signing certificates for XAP signing!  If you don’t have a code signing certificate, now is the time!

To participate in this offer, be prepared to have all your information ready.  Certificates are issued to individuals/organizations.  It is much more of a verification process than something like an SSL web certificate.  In fact, the process actually involves human interaction!  You will be required to verify your information on your submission and perhaps be required to provide documentation of verification (if you are an organization readily found on the web, this usually isn’t a problem).  Follow the steps carefully and specifically.  I also recommend using Internet Explorer to go through the process to be safe.  Additionally, you will only be able to pick up your certificate from the machine you requested it on…so don’t pave that machine until you get it :-).

To take advantage of this offer, visit the GoDaddy code signing area and start the process.  You can choose a 1- or 2-year code signing certificate to apply this discount (might as well go for the 2 years so you maximize the discount).  Add the code signing certificate to your shopping cart then add this discount code in the promocode area: MSSILVER.  This will apply the 50% (of regular rates) to the 1- or 2-year code signing certs in your basket. 

Then complete your purchase.  Once complete you’ll receive email instructions on how to redeem the credit you purchased and start the verification process.  Be patient…this is not a 5-minute process.  In fact, in some cases it might take a few days to complete the verification process.

This offer is only good from 20-April-2010 until 20-May-2010 and only on 1- or 2-year code signing certificates, so act quick.  This is a great chance to get a well-known certificate authority code signing certificate.  During the order process you will be given the option to choose a Certificate Authority between GoDaddy and Star(something)…I recommend sticking with the GoDaddy CA on this one.

I hope you are able to take advantage of this offer.  This is a certificate that you can use to sign multiple applications…not just one, so it is definitely a worthwhile investment.  Make sure you timestamp your codesigns!!!

Hope this helps!

| Comments

This week, Seesmic announced a new Seesmic Desktop platform.  They finally revealed more details to the public and released developer previews of their shell, SDK and some sample plugins.  You can get them on the Seesmic Developer Wiki.

Seesmic Developer Platform

The best part?  It’s built on Silverlight 4 and the Managed Extensibility Framework (MEF)!  This is awesome news for those of us who have been using various clients that have been locked down to specific use scenarios.  There always is a few things I want/need/etc in software and it’s great now that (at least in this space) I can change things I don’t like.

That’s right, Seesmic Desktop is moving more toward a “shell” concept (my words, not theirs) where they provide some defaults but also extensibility points for anyone to replace and/or extend.  Don’t like the way they implemented Twitter?  Fine, change it (or search for a better plugin).

This is a great way to get started with MEF as well.  Seesmic Desktop 2 gives you an implementation of extensibility points and you just have to implement them, mark as the right Export/Imports and watch how ‘it just works.’  There were two plugins that I wanted to create right away, so here they are in my own personal ‘works on my machine’ release band.

Translator Plugin

One of the things I’ve found in using Twitter and Facebook is that when you start searching for things you notice that you find interesting information but it might not be in your native language.  Recently I’ve been playing around with Microsoft Translator, which had an updated release at MIX10.  As a frequenter of Twitter, I often just ignored the non-English information as I simply couldn’t read it and didn’t have a ready way at my fingertips to translate it.

My first plugin is my Translator for Seesmic powered by the Microsoft Translator engine.  Simply drop this XAP in the plugins directory for Seesmic Desktop 2 and you’ll see new action options in the menu area of any timeline item:

Translator for Seesmic screenshot

Click this and it will translate the text to the current culture setting of your desktop (i.e., the intention is that your desktop is likely set to your preferred language).  Here’s a video of it in action:

Get Microsoft Silverlight

This is an example of a TimelineItemAction plugin that is global combined with a dynamic adding of a TimelineAttachment (the translation control).

Foursquare Venues

I’ve been using Foursquare a lot lately.  Why?  I have no idea.  Fun I suppose.  If my political ambitions don’t work out in real life, I always know that I can be Mayor of Yogurt Jungle.  Anyway, when in Twitter, Facebook, whatever people can ‘check-in’ to Foursquare and announce their location.  This posts a note like I’m at Yogurt Jungle http://4sq.com/XXXX where the short URL points to the venue where you can get details.  I wanted to be able in my app to see the venue details without having to visit the site.  Luckily Foursquare has a public API.  With that I can integrate ‘expanding’ their short URLs into Seesmic Desktop 2. 

Seesmic Foursquare Plugin

See the plugin notices when a Foursquare venue was mentioned (based on the short URL) and gives you the option to view more details (this is called an attachment in Seesmic Desktop Platform).  Once clicking on it, it will expand to show the details (with a clickable title to the further venue details if you want) and an embedded map showing the location.  Pretty cool?  Maybe not to you, but I’m having fun finishing it.  This is an example of a timeline Processor plugin with an attachment in the plaform.

Summary and test my plugins

As a Microsoft/.NET/Silverlight developer, extending the Seesmic Desktop Platform is easy.  I’m familiar with everything I need to do, and just needed to familiarize myself with the extension points of the platform.  MEF makes it easy to focus on what I want to do in my plugin and let the platform worry about loading things up, managing lifecycle, etc.  I look forward to extending the platform for my needs more (and sharing what I’ve created for others).  I’ve always extended things for my own use (creating 3 plugin extensions for Live Writer to meet my needs) and this is not different.  I hope others can share their extensions as well!

The Foursquare plugin has a bunch of bugs I’m trying to work out right now so I don’t consider it stable to share just yet.  The translator one is ready for testing.  I’ve listed them on a page I’ll maintain my other contributions until Seesmic has a better distribution method.  Visit my Seesmic Desktop Plugins page for more info.  Be sure to subscribe to my feed for updates on Silverlight and my contributions!

| Comments

I use Seesmic for my social media stuff (Twitter, Facebook, etc.).  Recently they created the Seesmic Desktop Platform which enables software developers to enhance, change or extend their Seesmic Desktop application.  This platform is built upon Silverlight 4 and is quite simple to extend.  To learn more about the Seesmic Desktop Platform, view the developer wiki.

I’ve created some plugins for my use and post them here to share with you.  Use them as you’d like, they imply no warranties :-).  For installation of the XAP files, see the developer wiki above.  In the future I’ll provide easy installers for these (or I think Seesmic may enable easier consumption as well).  Here are the ones I have:

How to develop plugins for Seesmic Desktop 2

Interested in developing plugins? You can start by installing my helpful Visual Studio Seesmic Templates and then visit http://devwiki.seesmic.com for details on how to write plugins!

How to Install plugins for Seesmic Desktop 2

While I firmly believe this process will improve, here is the simply way to install these (or other plugins) for Seesmic Desktop 2.  It’s as simple as copy/paste.

  • Windows: "My Documents\Seesmic\Seesmic Desktop 2\Plugins" (or Documents if you are on Windows 7)
  • Mac: "$HOME\Documents\Seesmic\Seesmic Desktop 2\Plugins"

Translate Plugin

This attaches a Translate this item action menu to any timeline item.  It takes the contents of the timeline item and attempts to translate it to the user’s chosen machine language using Microsoft Translator.

Seesmic Translate Plugin

This will also allow you to translate text from your current language to a supported language BEFORE you post the message to the service like Facebook, Twitter, whatever.

Seesmic Translate Plugin

Download: TimHeuer.Seesmic.Translate.xap (06-SEP-2010)

Foursquare Venue Plugin

This looks in your timeline items for Foursquare URLs and attaches an adorner for you to be able to expand the Foursquare short URL format into the details of the venue and see them presented in the timeline view.

Seesmic Foursquare Plugin

Download: TimHeuer.Seesmic.Foursquare.VenueFilter.xap (06-SEP-2010)

Image Previewer Plugin for Twitpic, yFrog, Twitgoo, Flickr, Instagram and Tweetphoto

This looks in your timeline items for Twitpic, yFrog, Instagram or Tweetphoto URLs and attaches a preview of the image with a link to the direct image again (per the terms of the APIs).

Seesmic Picture Previewer

Download: TimHeuer.Seesmic.PicturePreviewer.xap (06-SEP-2010)

Migre.me URL Shortener

Per a user suggestion on the desktop platform plugins forum, I created this Migre.me URL shortener add-in.  These are perhaps the easiest to create.  No screenshot but it adds the Migre.me option to the URL shortening toolbar.

Download: TimHeuer.Seesmic.Migre.xap (06-SEP-2010)

Twitlonger

While not a service that I frequent, it is handy to have.  Twitlonger was developed to shrink longer messages to the standard Twitter 140-character limit and provide a link to the full text.  This plugin puts a button Shorten with Twitlonger in the posting area and shrinks the content for you automatically.

Download: TimHeuer.Seesmic.Twitlonger.xap (06-SEP-2010)

img.ly Image Posting Provider

This plugin lets you choose the http://img.ly service to post and host your images in your messages.  Use this in conjunction with my Image Previewer plugin to get posting *and* previewing of images from img.ly!

Download: TimHeuer.Seesmic.ImglyProvider.xap (21-SEP-2010)

Goo.gl URL Shortener

Enable Google as your URL shortening service within Seesmic Desktop.  No screenshot but it adds the goo.gl option to the URL shortening toolbar.

Download: TimHeuer.Seesmic.Googl.xap (11-JAN-2011)

UberFilter

Sick of seeing all the Foursquare, Gowalla or Paper.li postings flood your feed? Install this plugin to choose what to filter out (none by default). After installing, view the settings section of this plugin to choose what noise to turn off. Version 1 is limited to Foursquare, Gowalla and Paper.li but next version will add more known noise and allow for custom filters. Updates will come automatic after installing this one.

Download: TimHeuer.Seesmic.UberFilter.xap (16-JAN-2011)


This work is licensed under a Creative Commons Attribution By license.