<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Eric Gunnerson's Compendium</title><subtitle type="html" /><id>http://blogs.msdn.com/ericgu/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/ericgu/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-06-15T14:03:00Z</updated><entry><title>The power of "no"...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/12/01/the-power-of-no.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/12/01/the-power-of-no.aspx</id><published>2009-12-01T18:25:00Z</published><updated>2009-12-01T18:25:00Z</updated><content type="html">&lt;P&gt;Eric Brechner wrote an interesting post titled "&lt;A class="" href="http://blogs.msdn.com/eric_brechner/archive/2009/12/01/don-t-panic.aspx" mce_href="http://blogs.msdn.com/eric_brechner/archive/2009/12/01/don-t-panic.aspx"&gt;Don't panic&lt;/A&gt;", about how to deal with requests. I sometimes agree and sometimes disagree with what Eric writes, but it's usually a pretty good read.&lt;/P&gt;
&lt;P&gt;In this case, I&amp;nbsp;agree with his approach, but&amp;nbsp;disagree with his advice. &lt;/P&gt;
&lt;P&gt;He advocates that when anybody comes&amp;nbsp;with you for a request, your first&amp;nbsp;response&amp;nbsp;should always be "Yes, I'd be happy to help".&amp;nbsp; Which is wrong.&lt;/P&gt;
&lt;P&gt;Way back when my daughter was 4, I was sitting on the couch and she came and asked me for something. My memory is a bit hazy on what she asked for, but I think it was some sort of snack. I didn't think deeply about it, and made a quick decision and answered "no". She got pretty upset and started crying and asked again. &lt;/P&gt;
&lt;P&gt;At that point I had a quandry. I thought about it a bit more, and realized that her request was a reasonable one (lunch was a long time ago) and that there was really no reason to grant it, but I knew that I couldn't because at that point is wasn't about the request but instead was about the way it was asked and the pattern me changing my mind would set. I didn't want to set up a&amp;nbsp;behavior where getting upset and crying is expected to make your dad change his mind. So I held firm.&lt;/P&gt;
&lt;P&gt;And felt really bad about it, because I made the wrong initial call. &lt;/P&gt;
&lt;P&gt;The whole point of the story - assuming that there is a point - is that you need to look not at the current interaction but instead at the meta-level. What message is your response sending? What pattern of interaction is it reinforcing?&lt;/P&gt;
&lt;P&gt;If somebody comes and asks you to do something and you say, "yes", once that word leaves your lips you can assume that the person making the request&amp;nbsp;will think that they are getting everything they want from you. They have in mind a big feature&amp;nbsp;delivered on an impossible date, and your job then becomes trying to scope their expectations down to something manageable, but even if you succeed&amp;nbsp;they'll still be stuck on what they originally had in mind, and will be disappointed with you. &lt;/P&gt;
&lt;P&gt;Not to mention the fact that if you immediately say "yes", it seems like you're either working on unimportant stuff and/or not working hard enough. &lt;/P&gt;
&lt;P&gt;The right&amp;nbsp;thing to do is to say "no", but in the right way. Something like "I'm/we're currently booked and have a lot of high-priority work planned, so I think that would be hard to fit in, but let me understand exactly what you're asking". That puts the requester in the position of having to convince you of the importance of what they want to do and be able to explain the details coherently. &lt;/P&gt;
&lt;P&gt;At that point, you can start the nuanced discussions that Eric talks about - talking about the details of what they want, why they think it's important, etc. It becomes very clear very fast whether the requester has done his homework, and if they haven't you can point out the additional things he needs to figure out before you talk more. If he has done&amp;nbsp;her homework, you can discuss where you think the feature ranks (always subject to the approval of whoever approves features), and how it might be broken apart/modified to bring it in earlier.&lt;/P&gt;
&lt;P&gt;At that point, the answer usually becomes, "yes, we can do &amp;lt;x&amp;gt; in timeframe &amp;lt;y&amp;gt;", which makes the requester happy - you've spent the time to explain to them why you put a specific priority on the request and you've made your life harder by rearranging things to slot their request into your current schedule and (probably) taking on the task of explaining to everybody who's below the new feature's priority why they aren't getting what they expected.&lt;/P&gt;
&lt;P&gt;And, you've set up a healthy pattern of behavior. Requesters are likely to do a bit of homework before they talk to you, and you are busy but willing to take on new work if it makes sense to do so. &lt;/P&gt;
&lt;P&gt;And that's the power of "no". &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9931000" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>Lucky</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/11/16/lucky.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/11/16/lucky.aspx</id><published>2009-11-17T03:11:00Z</published><updated>2009-11-17T03:11:00Z</updated><content type="html">Sometimes you're in the &lt;A href="http://thegunnersons.com/blogs/eric/archive/2009/11/16/lucky.aspx" mce_href="http://thegunnersons.com/blogs/eric/archive/2009/11/16/lucky.aspx"&gt;right place at the right time&lt;/A&gt;...&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9923351" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>HealthVault 0908 SDK Highlights…</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/10/16/healthvault-0908-sdk-highlights.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/10/16/healthvault-0908-sdk-highlights.aspx</id><published>2009-10-16T17:20:11Z</published><updated>2009-10-16T17:20:11Z</updated><content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The 0908 SDK has dropped, and I’d like to talk about some of the highlights of this release. &lt;/p&gt;  &lt;h3&gt;SODA&lt;/h3&gt;  &lt;p&gt;The big one is SODA, our name for the ability to write non-web-based HealthVault applications. SODA leverages our master/child application infrastructure in a different way, and will provide some nice additional capabilities (I have an app or two that I want to write using it). More details will follow in the near future. &lt;/p&gt;  &lt;p&gt;I should note that our current plan is to require SODA apps to deploy with a HealthVault redist package, so that it will be possible for us to service the SDK assemblies through Microsoft Update. We’re working on that but it’s not ready quite yet.&lt;/p&gt;  &lt;h3&gt;Application Creation&lt;/h3&gt;  &lt;p&gt;In previous releases, it was a bit cumbersome to create a new application – you had to create the certificate, upload it, copy helloworld, and update the web.config appropriately. We have extended the HealthVault Application Manager to make this easier. &lt;/p&gt;  &lt;p&gt;If you just want to clone HelloWorld to try something out, you can choose “Create New HelloWorld Sample”, select VB or C# as your language, decide where your project should live, and you’ll be ready to hit F5 in VS to run the project.&lt;/p&gt;  &lt;p&gt;Or, if you want to get fancy, choose “Create New Application”. This does the same thing as the HelloWorld approach, except that it will also create a new application certificate, start the registration process to the application configuration center. Just hit F5, and you’re up and running with your new application.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;Certificate Storage&lt;/h3&gt;  &lt;p&gt;Both of these approaches leverage the new ability to put an application’s certificate on the file store instead of in the certificate store. This should be more convenient in some situations. This is done by adding a key in the web.config file:&lt;/p&gt;  &lt;p&gt;&amp;lt;add key=&amp;quot;ApplicationCertificateFileName&amp;quot; value=&amp;quot;g:\mshealth\Nice App\cert\WildcatApp-3cdc0cea-6008-4c76-9169-36d44c3d63b4.pfx&amp;quot; /&amp;gt; &lt;/p&gt;  &lt;p&gt;If the certificate has a password, that can be specified with the ApplicationCertificatePassword key. &lt;/p&gt;  &lt;p&gt;We do caution that applications should take care not to put the certificate in a web-accessible directory. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9908283" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="HealthVault" scheme="http://blogs.msdn.com/ericgu/archive/tags/HealthVault/default.aspx" /></entry><entry><title>Blog refactoring 2.0</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/09/16/blog-refactoring-2-0.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/09/16/blog-refactoring-2-0.aspx</id><published>2009-09-17T05:16:07Z</published><updated>2009-09-17T05:16:07Z</updated><content type="html">&lt;p&gt;In the beginning, I started this blog just to write. I wrote a lot of C# stuff, some regex stuff, some HealthVault stuff, and a bunch of irrelevant stuff. &lt;/p&gt;  &lt;p&gt;Then, at some point, I started the &lt;a href="http://riderx.info/blogs/"&gt;RiderX blog&lt;/a&gt; to write about some more cycling-specific stuff that I – in a rare moment of discernment – didn’t want to put on this blog. &lt;/p&gt;  &lt;p&gt;Since that time, I picked up a HealthVault team blog (well, two team blogs, actually), and most of the time I wanted to write, I didn’t want to write anything work related, and wanted a place to do a bit less self-editing that I do here. &lt;/p&gt;  &lt;p&gt;Yes, I know, it does boggle the mind a bit, that what I post here is self-edited…&lt;/p&gt;  &lt;p&gt;So, anyway, to make things short(er), I went domain name hunting, found to my surprise that “thegunnersons.com” was available, and spun up &lt;a href="http://thegunnersons.com/blogs/eric/"&gt;a personal blog&lt;/a&gt; there.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896139" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>Question of the day</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/09/03/question-of-the-day.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/09/03/question-of-the-day.aspx</id><published>2009-09-03T19:04:00Z</published><updated>2009-09-03T19:04:00Z</updated><content type="html">Is Cinderella related to Mozzarella?&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9890955" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="Humorish" scheme="http://blogs.msdn.com/ericgu/archive/tags/Humorish/default.aspx" /></entry><entry><title>Ratings from Eric's Vacation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/08/24/ratings-fro-eric-s-vacation.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/08/24/ratings-fro-eric-s-vacation.aspx</id><published>2009-08-25T07:53:25Z</published><updated>2009-08-25T07:53:25Z</updated><content type="html">&lt;p&gt;I've decided to be totally derivative (and likely considerable less good) than "&lt;a href="http://www.amazon.com/exec/obidos/tg/detail/-/0609808524/qid=1069599374/sr=1-1/ref=sr_1_1/103-5769682-7597413?v=glance&amp;amp;s=books"&gt;The Book of Ratings&lt;/a&gt;".&amp;nbsp; A great book.&lt;/p&gt; &lt;h2&gt;State highway signs&lt;/h2&gt; &lt;p&gt;&lt;strong&gt;California&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;It's really a bit sad. They spend all that time putting up "enforced by radar" or "enforced by aircraft" signs, but deep down they know that nobody is going to pay any attention. &lt;/p&gt; &lt;p&gt;To distract themselves, they amuse themselves by putting "80" at the end of all the freeway names around San Francisco.&lt;/p&gt; &lt;p&gt;Rating: C&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Washington&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Boring signs, though the state highway signs do have a nice outline of George's head on them.&lt;/p&gt; &lt;p&gt;Or perhaps I'm just jaded from my long association, and am desperately seeking my midlife crisis of signs. &lt;/p&gt; &lt;p&gt;Rating: C&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Oregon&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Perhaps the Oregon highway department was beaten up by the other highway departments when it was little, but for whatever reason, Oregon likes to do things big, with an outsize "55" telling you that they really mean business, and colossal "do not enter" signs at least 10' on a side. Definitely signs with an attitude.&lt;/p&gt; &lt;p&gt;On the minus side, they insist on putting up "end of speed zone" signs, forcing me to try to remember how fast I was allowed to go at some point in the past. &lt;/p&gt; &lt;p&gt;Rating: B &lt;/p&gt; &lt;h2&gt;Vacation Vehicles&lt;/h2&gt; &lt;p&gt;&lt;strong&gt;Mom's Old Car&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Mom's old car - chosen so the offspring could drive in WA and OR - is a sweet nicely-preserved 1998 Honda Accord, returning a bit over 30 MPG for the trip.&lt;/p&gt; &lt;p&gt;Rating: B-&lt;/p&gt; &lt;p&gt;&lt;strong&gt;ATVs&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;5 minutes of recorded safety lecture, and we're out in the largest sandbox on the west coast, 32000 acres of duney bliss. The last off-road experience I had was a 50cc Honda when I was 12, but I do remember the most important rules - a) You get it stuck, you dig it out, b) don't cross over the unmarked boundaries, and c) you break it, you pay us.&lt;/p&gt; &lt;p&gt;Not really useful for getting from here to there, but a hecka lot of fun (as the kids would say).&lt;/p&gt; &lt;p&gt;Rating: A&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Sand Rail&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;First off, "Sand Rail" is a killer name, beating up on "Dune Buggy", and taking the lunch money of "ATV" ("Hey, I know! People love names that are acronyms").&lt;/p&gt; &lt;p&gt;Four point racing harnesses, goggles, and a suggestion to keep our hands off the top rail "in case we roll", and the first pass is a 30 mph trip down a 45 degree slope and up another. Great fun once I pried my eyes open. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.sanddunesfrontier.com/home.htm"&gt;Sand Dunes Frontier&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A++&lt;/p&gt; &lt;h2&gt;Aquatic Creatures&lt;/h2&gt; &lt;p&gt;&lt;strong&gt;Hippocampinae&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Sometimes confused with the &lt;a href="http://en.wikipedia.org/wiki/Hippocampus"&gt;hippocampus&lt;/a&gt;. Yeah, we get it, they're shaped like horses, and there are tiny fish who act as jockeys, riding them around the tanks is daily races.&lt;/p&gt; &lt;p&gt;Sure, the dudes are the ones that give birth, guaranteed to make all the guys in the audience wince a bit. &lt;/p&gt; &lt;p&gt;Rating: C&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Cephalopods&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The 007 of the water, with adaptive camo, water-jet propulsion, super grippers, and a built-in smoke screen. &lt;/p&gt; &lt;p&gt;Rating: B&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Pinnipeds&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Cute and cuddly, intelligent, mischievous - everything you want in an aquatic animal. Except for the fact that they mostly swim under the water and when outside the water spend their time doing impressions of jumbo furry sausages.&lt;/p&gt; &lt;p&gt;Rating: B+&lt;/p&gt; &lt;h2&gt;Missing mountains&lt;/h2&gt; &lt;p&gt;&lt;strong&gt;Mount St. Helens&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;A bit less known as its larger and better-behaved brother to the north, St. Helens is widely held up as the epitome of a missing mountain. &lt;/p&gt; &lt;p&gt;2/3 of a cubic mile of mountain disappeared in 30 seconds, killing 57 humans, 7,000 big game animals and 12 million hatchery salmon. It inconvenienced people throughout the state, causing millions of people to have to wash their cars ahead of schedule.&lt;/p&gt; &lt;p&gt;The glowing growing dome is a nice touch if you can see it at night, but it could really use some daytime pizzazz. &lt;/p&gt; &lt;p&gt;Rating: B&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Mazama&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;First of all, erupting 3000 years before the advent of mass media is a bad career choice, and the PR is largely non-existent. You still see Jordan's name all over the place, so I think Mazama needs a new agent.&lt;/p&gt; &lt;p&gt;But it's hard to fault it on execution. 25 cubic miles of mountain vanish. What do you put in it's place? A 2000' deep lake. &lt;/p&gt; &lt;p&gt;Brilliant.&lt;/p&gt; &lt;p&gt;Rating: A&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9883206" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>Introduction to HealthVault Development #13: More more than one person</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/08/14/introduction-to-healthvault-development-13-more-more-than-one-person.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/08/14/introduction-to-healthvault-development-13-more-more-than-one-person.aspx</id><published>2009-08-15T00:47:33Z</published><updated>2009-08-15T00:47:33Z</updated><content type="html">&lt;p&gt;In the last installment, we modified our application so that it could switch between family members for data display and entry. This time, we’re going to add a table at the top that shows the current weight for all family members.&lt;/p&gt;  &lt;p&gt;We add the table right after the &amp;lt;h1&amp;gt; title:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Family Summary &amp;lt;br /&amp;gt;      &lt;br /&gt;&amp;lt;asp:Table ID=&amp;quot;c_tableSummary&amp;quot; runat=&amp;quot;server&amp;quot; BorderWidth=&amp;quot;1px&amp;quot; CellPadding=&amp;quot;2&amp;quot; CellSpacing=&amp;quot;2&amp;quot; GridLines=&amp;quot;Both&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;lt;br /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Then we need a method to walk through the records and fetch the current weight from each of them. The following will do that:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;void GenerateSummaryTable()      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; TableHeaderRow headerRow = new TableHeaderRow();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; TableHeaderCell headerCell = new TableHeaderCell();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; headerCell.Text = &amp;quot;Name&amp;quot;;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; headerRow.Cells.Add(headerCell); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; headerCell = new TableHeaderCell();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; headerCell.Text = &amp;quot;Weight&amp;quot;;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; headerRow.Cells.Add(headerCell); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; c_tableSummary.Rows.Add(headerRow); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; foreach (HealthRecordInfo record in PersonInfo.AuthorizedRecords.Values)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HealthRecordSearcher searcher = record.CreateSearcher(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HealthRecordFilter filter = new HealthRecordFilter(Weight.TypeId);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; filter.MaxItemsReturned = 1; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searcher.Filters.Add(filter); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HealthRecordItemCollection weights = searcher.GetMatchingItems()[0]; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (weights.Count == 1)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TableRow row = new TableRow(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TableCell nameCell = new TableCell();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nameCell.Text = record.Name;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; row.Cells.Add(nameCell); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Weight weight = weights[0] as Weight; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TableCell weightCell = new TableCell();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; weightCell.Text = weight.Value.DisplayValue.ToString();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; row.Cells.Add(weightCell); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c_tableSummary.Rows.Add(row);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Currently, there is no way to make a single request that fetches data for more than one record, so we need to create an execute a separate query for each one. &lt;/p&gt;  &lt;h3&gt;Next Time&lt;/h3&gt; With all the operations that we are performing, the application is running a little bit slowly. We’ll do some investigation into what’s going on, and see if we can’t make some improvements. &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9870603" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="HealthVault" scheme="http://blogs.msdn.com/ericgu/archive/tags/HealthVault/default.aspx" /><category term="Tutorial" scheme="http://blogs.msdn.com/ericgu/archive/tags/Tutorial/default.aspx" /></entry><entry><title>Thoughts on agile design and platforms</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/08/14/thoughts-on-agile-design-and-platforms.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/08/14/thoughts-on-agile-design-and-platforms.aspx</id><published>2009-08-14T21:47:49Z</published><updated>2009-08-14T21:47:49Z</updated><content type="html">&lt;p&gt;I started by writing a broad post about design, and it got away from me (apparently I should have spent some time designing the post first…), so I deleted it all and decided to write something shorter, and, with any luck, more understandable and useful.&lt;/p&gt;  &lt;p&gt;I’ve been reading some discussions about how design relates to Agile. Some teams get into trouble because they think that agile means “no design”, when in fact it means “right design”.&lt;/p&gt;  &lt;p&gt;The whole point of design in my mind is to save you work later on. There’s a sweet spot between no design and big design that makes sense in a particular situation. I don’t think that’s a unique insight at all, though I have seen groups how use the “design document” approach where there’s a document with 18 sections in it that everybody has to use. &lt;/p&gt;  &lt;p&gt;The two areas I would like to talk about are about what you are building and the scope of what you are doing right now. I’ll talk about scope first.&lt;/p&gt;  &lt;p&gt;The amount of design you should do depends on the scope of what you are doing, and scope in this situation doesn’t mean “amount of code change” (though it often correlates somewhat with that), it means “impact of code change on the customer”. This is obviously different for every change you make to the code, and my general guideline is that spending 5 minutes bouncing your thoughts off of somebody else generally gives you a good enough conclusion about how much design is required. Notice that I said “guideline” – I expect that developers can use their best judgement about when they can make changes without consulting with others. &lt;/p&gt;  &lt;p&gt;Some people would say that not having the opportunity to make a wrong choice about when to consult with others is a strength of pair programming. I think that’s probably true, but obviously only works for teams that do pair, and that’s not that common in my neck of the woods (and, I suspect in others).&lt;/p&gt;  &lt;p&gt;So, anyway, that’s what I think about scope, and, once again, I don’t think it’s a unique insight.&lt;/p&gt;  &lt;p&gt;My second point – that the amount of design depends on what you are building – is something I haven’t heard talked about much, especially in agile circles. Because most software developers deliver applications, the agile processes are described in that context. &lt;/p&gt;  &lt;p&gt;And in that context, I think that many developers do far too much design up front. You can spend 3 days writing something up that covers how you will do something, or you can spend 2 days doing early implementations and then know which one works better, and have real code to show people. Trying to figure out how things should work before you write them is often less efficient than just writing them when you need them.&lt;/p&gt;  &lt;p&gt;Given that I consider premature generalization to be the &lt;a href="http://blogs.msdn.com/ericgu/archive/2006/08/03/687962.aspx"&gt;#1 sin of developers&lt;/a&gt;, no surprises there.&lt;/p&gt;  &lt;p&gt;But – and I think I may be finally getting to the point – that perspective comes from applications, where you own the code that you’re building, and refactorings can be done when you learn more. &lt;/p&gt;  &lt;p&gt;Platforms are different.&lt;/p&gt;  &lt;p&gt;If you are building a platform, things get a bit schizophrenic. Internally, you are an application – you can refactor the internals without a lot of impact elsewhere, and therefore the amount of design you do should keep that in mind.&lt;/p&gt;  &lt;p&gt;But externally, people depend on your APIs to stay the same. This means that, for a given feature, you need to get it right (or as close to right as you can) on your first release. It also means that you need to think about how the feature that you’re doing right now might be extended for things you might do in the future. &lt;/p&gt;  &lt;p&gt;Which is exactly the thing that you shouldn’t be doing if you’re building an app, because it’s a pain, it’s expensive, you’ll make the wrong choices, and you’ll have to throw work away.&lt;/p&gt;  &lt;p&gt;In my current team, we own both applications and platform API, so we get to spend time in both of these areas.&lt;/p&gt;  &lt;p&gt;And now it’s lunchtime. I may write a future post on how I think you should do platform design. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9870435" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>RAMROD 2009 ride report</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/08/06/ramrod-2009-ride-report.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/08/06/ramrod-2009-ride-report.aspx</id><published>2009-08-07T04:29:00Z</published><updated>2009-08-07T04:29:00Z</updated><content type="html">&lt;A href="http://riderx.info/blogs/riderx/archive/2009/08/06/ramrod-2009.aspx"&gt;http://riderx.info/blogs/riderx/archive/2009/08/06/ramrod-2009.aspx&lt;/A&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9859745" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="Cycling" scheme="http://blogs.msdn.com/ericgu/archive/tags/Cycling/default.aspx" /></entry><entry><title>NASA images lunar descent stage and astronaut path on moon...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/07/17/nasa-images-lunar-descent-stage-and-astronaut-path-on-moon.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/07/17/nasa-images-lunar-descent-stage-and-astronaut-path-on-moon.aspx</id><published>2009-07-18T06:44:00Z</published><updated>2009-07-18T06:44:00Z</updated><content type="html">&lt;P&gt;Just&amp;nbsp;in time for the 40th anniversary of Apollo 11, a NASA orbiter &lt;A class="" href="http://www.nasa.gov/mission_pages/LRO/multimedia/lroimages/apollosites.html" mce_href="http://www.nasa.gov/mission_pages/LRO/multimedia/lroimages/apollosites.html"&gt;images Apollo landing sites&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;The apollo 14 site is very impressive. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9838241" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>21st Century Breakdown - show review</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/07/04/21st-century-breakdown-show-review.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/07/04/21st-century-breakdown-show-review.aspx</id><published>2009-07-04T21:14:00Z</published><updated>2009-07-04T21:14:00Z</updated><content type="html">&lt;P&gt;Green Day remains&amp;nbsp;a very entertaining group to watch, and we had a great time.&lt;/P&gt;
&lt;P&gt;After a dinner at the traditional Seattle eatery 13 coins, we headed over the the Key for the show. Got there fairly early, and headed to the West side to buy some Merch (far less crowded than the east side), and the found our seats and waited.&lt;/P&gt;
&lt;P&gt;Opening group was "The Bravery". I cut opening bands a lot of slack because it's a hard crowd and the sound usually doesn't work well for you, but it wasn't to my taste. The vocals were muddy, and the songs sounded all the same to me. Happy they didn't play for very long.&lt;/P&gt;
&lt;P&gt;After a bunch of listening, 21st Century Breakdown hasn't caught on for me the way that American Idiot did, so I was hoping that they would play a lot of other stuff besides the new album. Which they did - opened with a few cuts of the new album, then a few off of idiot, then some old stuff (Dookie and newer, so not old old), some more new stuff, etc. Nice variety, and you can tell from the crowd reaction that they like the old stuff quite a&amp;nbsp;bit. &lt;/P&gt;
&lt;P&gt;Billie Joe played a lot less lead guitar than in the idiot show, concentrating more on vocals and rhythm guitar, especially on the new stuff. It seemed to work pretty well and the mix between his guitar and the backup guy was pretty good. &lt;/P&gt;
&lt;P&gt;A few issues since this was the first show. Crew isn't quite used to how things work yet (leading to a pretty funny 2-minute segment when the guitar tech keeps trying to hand Billie Joe his guitar and Billie Joe keeps singing), and a notably disappointing t-shirt gun, which despite several attempts couldn't launch the t-shirt more than about 30'. &lt;/P&gt;
&lt;P&gt;They played for just a bit over two hours, with only perhaps a 1 minute break before the encore. Billie Joe spends the whole two hours running around and singing, and it's pretty impressive.&lt;/P&gt;
&lt;P&gt;Great show.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Partial setlist:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Dookie:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Longview&lt;/LI&gt;
&lt;LI&gt;Basket Case&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Nimrod:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Hitchin' a ride&lt;/LI&gt;
&lt;LI&gt;King for a day&lt;/LI&gt;
&lt;LI&gt;Good riddance (time of your life) (closing song, acoustical)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Warning:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Minority&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;American idiot:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;American Idiot&lt;/LI&gt;
&lt;LI&gt;Jesus of suburbia&lt;/LI&gt;
&lt;LI&gt;Boulevard of broken dreams&lt;/LI&gt;
&lt;LI&gt;Holiday&lt;/LI&gt;
&lt;LI&gt;Are we the waiting&lt;/LI&gt;
&lt;LI&gt;St. Jimmy&lt;/LI&gt;
&lt;LI&gt;Homecoming&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;21st Century Breakdown:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Song of the Century&lt;/LI&gt;
&lt;LI&gt;21st Century breakdown&lt;/LI&gt;
&lt;LI&gt;Know your enemy&lt;/LI&gt;
&lt;LI&gt;Before the lobotomy&lt;/LI&gt;
&lt;LI&gt;21 guns&lt;/LI&gt;
&lt;LI&gt;(think I missed a couple here...)&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9817664" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>Is programming a generic skill?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/06/25/is-programming-a-generic-skill.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/06/25/is-programming-a-generic-skill.aspx</id><published>2009-06-25T19:50:00Z</published><updated>2009-06-25T19:50:00Z</updated><content type="html">&lt;P&gt;Came across a &lt;A class="" href="http://www.codethinked.com/post/2009/06/11/Is-Programming-A-Generic-Skill.aspx" mce_href="http://www.codethinked.com/post/2009/06/11/Is-Programming-A-Generic-Skill.aspx"&gt;post&lt;/A&gt; by Justin Etheredge discussion whether changing between languages is just a matter of syntax.&lt;/P&gt;
&lt;P&gt;Or, to pick a specific example, can a Java programmer quickly and easily learn to write C# code?&lt;/P&gt;
&lt;P&gt;The answer is obviously "yes". Development is about a way of thinking and approaching problems, and given the similarity between Java and C#, a good Java developer should take a minimal amount of time to learn how to write functional code in C#. The biggest barrier is libraries, which are more different than the languages are.&lt;/P&gt;
&lt;P&gt;The answer is equally as obviously "no". Sure, you can write functional code, but you will not be able to write idiomatic code. Like a high school senior with 4 years of French class on a trip to Paris, you can make yourself understood, but you aren't going to be mistaken as a native. You ask a question, somebody replies, "Ce ne sont pas vos oignons", and you just end thinking of soup.&lt;/P&gt;
&lt;P&gt;So, yeah, you can write C# code, but it's going to be Java written in C#. Given the closeness of the languages, it may be sufficient, but you're going to force some refactoring on&amp;nbsp;any idiomatic C# speakers who inherit your code.&lt;/P&gt;
&lt;P&gt;It can be worse - when I first started writing in Perl, I wrote C code in Perl, which just doesn't work very well. And over time, I became at least functional, though perhaps not idiomatic in Perl (though, because of TMTOWTDI, it's hard to judge that in Perl).&lt;/P&gt;
&lt;P&gt;However, if you can become idiomatic in multiple languages, your toolset broadens, and you become more useful in all your langauges. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9803936" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="Programming" scheme="http://blogs.msdn.com/ericgu/archive/tags/Programming/default.aspx" /></entry><entry><title>Livestrong Seattle Century report</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/06/24/livestrong-seattle-century-report.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/06/24/livestrong-seattle-century-report.aspx</id><published>2009-06-24T18:53:00Z</published><updated>2009-06-24T18:53:00Z</updated><content type="html">From my &lt;A class="" href="http://riderx.info/blogs/riderx/archive/2009/06/20/livestrong-seattle-century-2009.aspx" mce_href="http://riderx.info/blogs/riderx/archive/2009/06/20/livestrong-seattle-century-2009.aspx"&gt;cycling blog&lt;/A&gt;...&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9801662" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="Cycling" scheme="http://blogs.msdn.com/ericgu/archive/tags/Cycling/default.aspx" /></entry><entry><title>Introduction to HealthVault Development #12: More than one person…</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/06/19/introduction-to-healthvault-development-12-more-than-one-person.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/06/19/introduction-to-healthvault-development-12-more-than-one-person.aspx</id><published>2009-06-20T01:41:46Z</published><updated>2009-06-20T01:41:46Z</updated><content type="html">&lt;p&gt;WeightTracker has gotten popular, and we have a new scenario. Our users would like us to extend our application so that they can easily enter weights for each member of the family.&lt;/p&gt;  &lt;p&gt;This will require us to delve a bit more deeply into users, records, and authentication, and we’ll also explore the HealthVault shell a bit more…&lt;/p&gt;  &lt;h2&gt;Accounts and records&lt;/h2&gt;  &lt;p&gt;HealthVault separates the concept of accounts and records. An account is associated with a specific set of credentials, and a record contains the health information for a specific person.&lt;/p&gt;  &lt;p&gt;It’s not uncommon for an account to have access to more than one record. A person might have access to their own record and the records of their children, spouse, or parents. &lt;/p&gt;  &lt;h2&gt;What data does your application use?&lt;/h2&gt;  &lt;p&gt;HealthVault supports two ways of dealing with records.&lt;/p&gt;  &lt;p&gt;A single-record application – which is what WeightTracker is right now – is intended to work with only one person’s data (ie one record) at a time. The platform keeps track of which record the application is using, and when writing code, you just need to use PersonInfo.SelectedRecord.&lt;/p&gt;  &lt;p&gt;A single-record application can switch between records by redirecting the user back to the HealthVault shell to choose the new record, and authorize it if necessary.&lt;/p&gt;  &lt;p&gt;The alternate way of dealing with applications is to work with multiple records simultaneously.&lt;/p&gt;  &lt;p&gt;We do this by adding the following entry to our web.config:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;add key=&amp;quot;WCPage_IsMRA&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And we also need to tell the shell that we’re an MRA application whenever we ask it to do something. We do this in AuthorizeEmotion.aspx.cs, and we’ll modify the code there to the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;string TargetQuery = &amp;quot;appid=cee3e0fc-03c6-40b4-9550-a151901b4a27&amp;amp;onopt1=Opt_Emotion&amp;amp;ismra=true&amp;quot;; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now, we can go back to the &lt;a href="https://account.healthvault-ppe.com"&gt;HealthVault PPE shell&lt;/a&gt;, create a second record, make sure our existing record no longer allows WeightTracker to use it (via the “sharing” tab). And when we run WeightTracker, we’ll see the following:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img src="http://blogs.msdn.com/photos/ericgu/images/9762862/original.aspx" /&gt; &lt;/p&gt;  &lt;p&gt;Note that there are now checkboxes next to the records. We select all of them, hit “continue”, and then we will need to authorize the application to access each record. &lt;/p&gt;  &lt;h2&gt;Displaying the list of authorized records&lt;/h2&gt;  &lt;p&gt;The list of records that the application is authorized is stored in PersonInfo.AuthorizedRecords. We’ll add a dropdown control to default.aspx:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Welcomes&amp;amp;nbsp;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:DropDownList ID=&amp;quot;c_dropDownCurrentRecord&amp;quot; runat=&amp;quot;server&amp;quot; Width=&amp;quot;262px&amp;quot; OnSelectedIndexChanged=&amp;quot;c_dropDownCurrentRecord_SelectedIndexChanged&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and remove the references to c_labelUser from the code. &lt;/p&gt;  &lt;p&gt;We will use the drop-down list to display the current list of authorized records and to select the one that we want. We’ll add the following code, and call PopulateRecordDropDown() at the beginning of Page_Prerender(). &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;protected void c_dropDownCurrentRecord_SelectedIndexChanged(object sender, EventArgs e)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; foreach (Guid recordId in PersonInfo.AuthorizedRecords.Keys)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (recordId.ToString() == c_dropDownCurrentRecord.SelectedValue)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PersonInfo.SelectedRecord = PersonInfo.AuthorizedRecords[recordId];       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;} &lt;/p&gt;    &lt;p&gt;void PopulateRecordDropDown()      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; c_dropDownCurrentRecord.Items.Clear(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; foreach (Guid recordId in PersonInfo.AuthorizedRecords.Keys)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HealthRecordInfo healthRecordInfo = PersonInfo.AuthorizedRecords[recordId]; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListItem listItem = new ListItem(healthRecordInfo.Name, recordId.ToString()); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (recordId == PersonInfo.SelectedRecord.Id)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; listItem.Selected = true;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c_dropDownCurrentRecord.Items.Add(listItem);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/p&gt;    &lt;p&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;We then need to update our height code to deal with cases where the height isn’t there (or perhaps you already did this…)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Height height = GetSingleValue&amp;lt;Height&amp;gt;(Height.TypeId);      &lt;br /&gt;if (height != null)       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (height.Value.DisplayValue != null)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c_labelHeight.Text = height.Value.DisplayValue.ToString();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c_labelHeight.Text = height.Value.ToString();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;} &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;string bmiString = String.Empty;      &lt;br /&gt;if (height != null)       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; double bmi = weight.Value.Kilograms / (height.Value.Meters * height.Value.Meters);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; bmiString = String.Format(&amp;quot;{0:F2}&amp;quot;, bmi);       &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After all of that, if you run the application, is should now allow you to select between the records. However, we still need to save the information about which record is current.&lt;/p&gt;  &lt;h2&gt;Saving the current record&lt;/h2&gt;  &lt;p&gt;To store the identifier of the current record, what we would like is a storage place that is associated with the person using the application rather than the a specific record. HealthVault provides that through the GetApplicationsSettings() and SetApplicationSettings() methods on the application connection. We could use those directly by putting some XML in there and then pulling it out, but we’re going to encapsulate that in a class. Here’s what we need to do:&lt;/p&gt;  &lt;p&gt;First, we’ll create a new class named “WeightTrackerApplicationSettings”. &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;using System;      &lt;br /&gt;using System.Data;       &lt;br /&gt;using System.Configuration;       &lt;br /&gt;using System.Web;       &lt;br /&gt;using System.Web.Security;       &lt;br /&gt;using System.Web.UI;       &lt;br /&gt;using System.Web.UI.WebControls;       &lt;br /&gt;using System.Web.UI.WebControls.WebParts;       &lt;br /&gt;using System.Web.UI.HtmlControls;       &lt;br /&gt;using System.Xml;       &lt;br /&gt;using System.Xml.XPath;       &lt;br /&gt;using System.Text; &lt;/p&gt;    &lt;p&gt;using Microsoft.Health; &lt;/p&gt;    &lt;p&gt;public class WeightTrackerApplicationSettings      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; private Guid _selectedRecordId; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public Guid SelectedRecordId      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return _selectedRecordId; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set { _selectedRecordId = value; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public void LoadFromHealthVault(AuthenticatedConnection authenticatedConnection)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IXPathNavigable settingsNavigable = authenticatedConnection.GetApplicationSettings();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (settingsNavigable == null)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XPathNavigator navigator = settingsNavigable.CreateNavigator(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XPathNavigator appSettingsNode = navigator.SelectSingleNode(&amp;quot;app-settings&amp;quot;); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XPathNavigator selectedRecordNode = appSettingsNode.SelectSingleNode(&amp;quot;selected-record-id&amp;quot;); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string value = selectedRecordNode.Value;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _selectedRecordId = new Guid(value);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; public void SaveToHealthVault(AuthenticatedConnection authenticatedConnection)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XmlDocument document = new XmlDocument(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XmlElement nodeWeightTrackerSettings = document.CreateElement(&amp;quot;app-settings&amp;quot;);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.AppendChild(nodeWeightTrackerSettings); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XmlElement nodeSelectedRecordId = document.CreateElement(&amp;quot;selected-record-id&amp;quot;);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nodeWeightTrackerSettings.AppendChild(nodeSelectedRecordId);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nodeSelectedRecordId.InnerText = _selectedRecordId.ToString(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; authenticatedConnection.SetApplicationSettings(document);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Then, we add the code to load in the settings at the beginning of Page_Prerender():&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;_weightTrackerApplicationSettings.LoadFromHealthVault(AuthenticatedConnection); &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and modify our methods:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;protected void c_dropDownCurrentRecord_SelectedIndexChanged(object sender, EventArgs e)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; foreach (Guid recordId in PersonInfo.AuthorizedRecords.Keys)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (recordId.ToString() == c_dropDownCurrentRecord.SelectedValue)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PersonInfo.SelectedRecord = PersonInfo.AuthorizedRecords[recordId]; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _weightTrackerApplicationSettings.SelectedRecordId = recordId;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _weightTrackerApplicationSettings.SaveToHealthVault(AuthenticatedConnection);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;} &lt;/p&gt;    &lt;p&gt;void PopulateRecordDropDown()      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; c_dropDownCurrentRecord.Items.Clear(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; foreach (Guid recordId in PersonInfo.AuthorizedRecords.Keys)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HealthRecordInfo healthRecordInfo = PersonInfo.AuthorizedRecords[recordId]; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListItem listItem = new ListItem(healthRecordInfo.Name, recordId.ToString()); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (recordId == PersonInfo.SelectedRecord.Id)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; listItem.Selected = true;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c_dropDownCurrentRecord.Items.Add(listItem);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;That stores the currently selected record away and then restores it when the page starts up.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;&lt;strong&gt;Next Time&lt;/strong&gt;&lt;/h3&gt;  &lt;p&gt;Next time, we’ll &lt;a href="http://blogs.msdn.com/ericgu/archive/2009/08/14/introduction-to-healthvault-development-13-more-more-than-one-person.aspx"&gt;display values from multiple records&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9792284" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author></entry><entry><title>Rekeying the HealthVault/Amalga USB Key</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ericgu/archive/2009/06/15/rekeying-the-healthvault-amalga-usb-key.aspx" /><id>http://blogs.msdn.com/ericgu/archive/2009/06/15/rekeying-the-healthvault-amalga-usb-key.aspx</id><published>2009-06-16T00:03:00Z</published><updated>2009-06-16T00:03:00Z</updated><content type="html">&lt;P&gt;If you attended the connected health conference last week, you got&amp;nbsp;a USB key with a combination lock on it, so you could protect your important data against those with less than 10 minutes of free time, or those with very little imagination.&lt;/P&gt;
&lt;P&gt;But to get this protection, you'll need to change the combination to some other number. Here's how you do it:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Set the key to 0-0-0&lt;/LI&gt;
&lt;LI&gt;On the non-usb end, there's a small round button. Press it in with a pen.&lt;/LI&gt;
&lt;LI&gt;Change&amp;nbsp;the combination&lt;/LI&gt;
&lt;LI&gt;Press the button on the USB end back in.&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9755933" width="1" height="1"&gt;</content><author><name>ericgu</name><uri>http://blogs.msdn.com/members/ericgu.aspx</uri></author><category term="HealthVault" scheme="http://blogs.msdn.com/ericgu/archive/tags/HealthVault/default.aspx" /></entry></feed>