<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Cum Grano Salis</title><link>http://blogs.msdn.com/cumgranosalis/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Optimizing life – Life in Async</title><link>http://blogs.msdn.com/cumgranosalis/archive/2009/07/01/optimizing-life-life-in-async.aspx</link><pubDate>Wed, 01 Jul 2009 17:43:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9811528</guid><dc:creator>Shahar</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/9811528.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=9811528</wfw:commentRss><description>&lt;p&gt;I was going to get coffee today at work, minding my own business, when someone from the test-team asked me if the order I was doing things when preparing coffee was intentional. Absentmindedly, I explained the reasoning behind the order of things and how I reached this way of doing things and belatedly realized that I may have gone too far in my explanation – I think it was the look of pity in his eyes that clued me in. &lt;/p&gt; &lt;p&gt;To explain, first you need to understand what our kitchenette looks like and the various steps in making coffee:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/OptimizinglifeLifeinAsync_937/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/OptimizinglifeLifeinAsync_937/image_thumb.png" width="514" height="376"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Here are the various things we are seeing here:&lt;/p&gt; &lt;p&gt;1) Access – that’s where I typically come to the kitchenette from. &lt;br&gt;2) The coffee machine&lt;br&gt;3) Counter&lt;br&gt;4) Cups&lt;br&gt;5) Lids&lt;br&gt;6) Fridge (Where milk is).&lt;/p&gt; &lt;p&gt;Our coffee machines basically give you an Americano – no milk. The way I take my cup’o’joe is to do 12 oz of machine generated coffee (into a 16 oz cup) and fill another 2-3 oz of milk – and then the&amp;nbsp; cup needs to be lidded as well. Of course, there are a number of variations on how to make such a coffee with this layout.&lt;/p&gt; &lt;p&gt;Making Coffee – the naive way:&lt;/p&gt; &lt;p&gt;Step 1: Go to position (4) – grab a cup.&lt;br&gt;Step 2: Go to position (1) – place cup at machine.&lt;br&gt;Step 3: Press buttons - Wait for coffee to be made.&lt;br&gt;Step 4: Take milk from fridge (6)&lt;br&gt;Step 5: Fill cup with milk (possibly at position (3))&lt;br&gt;Step 6: Discard milk carton or, if still full, place back in fridge.&lt;br&gt;Step 7: Go to (5) and grab a lid.&lt;br&gt;Step 8: Place lid on cup.&lt;/p&gt; &lt;p&gt;And we are done. To understand how this can be optimized we first need to figure out how much each part of the coffee making process takes:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Making coffee (the machine phase)&lt;/strong&gt;: ~2 minutes (constant).&lt;br&gt;&lt;strong&gt;Getting milk (from position (1))&lt;/strong&gt;: On average, takes about 20 seconds. Depending on traffic, can easily take as long as 1:00 minutes if there is a lot of traffic and even longer if you consider the possibility of people talking to you while you are making the coffee.&lt;br&gt;&lt;strong&gt;Getting a cup: &lt;/strong&gt;Usually takes about 5 seconds from position 1 – can take longer due to traffic and chat. Rarely takes more than 30 seconds and requires little concentration.&lt;br&gt;&lt;strong&gt;Filling cup with milk:&lt;/strong&gt; Takes about 5 secodns.&lt;br&gt;&lt;strong&gt;Discarding/Returning milk: &lt;/strong&gt;Takes about 10 seconds. Worst case (traffic etc) can take up to a minute.&lt;br&gt;&lt;strong&gt;Grabbing a lid&lt;/strong&gt;: 5 seconds from position (1).&lt;br&gt;&lt;strong&gt;Lidding the cup&lt;/strong&gt;: 5 seconds at position (3).&lt;/p&gt; &lt;p&gt;So.. Translating this into pseudo code, this is what we get:&lt;/p&gt; &lt;p&gt;function NaiveCoffeeMaking()&lt;br&gt;{&lt;br&gt;WalkTo(4);&lt;br&gt;GetCup(); // 10s&lt;br&gt;WalkTo(2);&lt;br&gt;PlaceCupInMachine(); // 1s&lt;br&gt;MakeCoffee(); // 120s&lt;br&gt;GrabCupFromMachine(); // 1s&lt;br&gt;WalkTo(6);&lt;br&gt;GetMilk(); // 20s&lt;br&gt;PourMilk(); // 5s&lt;br&gt;DiscardOrReturnMilk(); // 10s&lt;br&gt;WalkTo(5);&lt;br&gt;GrabLid(); // 5s (probably closer to 3s in this case)&lt;br&gt;WalkTo(3); &lt;br&gt;LidCup(); // 5s&lt;br&gt;}&lt;br&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;Phew.. Okay.. So we have that. Now lets calculate how much time this takes (best case):&lt;strong&gt;&lt;font size="4"&gt;177 seconds!&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The thing to consider though is that the machine phase can be asynchronous – that is to say – while the machine is making coffee, the CPU (me) is waiting Idle. The question is, how can we use that to optimize the time? For our pseudo code then, we will now separate MakeCoffee into two functions: BeginMakeCoffee() which essentially means pressing the buttons on the machine and immediately return to the caller and EndMakeCoffee() which completes the operation (and if not done, blocks until done). And so, the most optimized version of how to make coffee is:&lt;/p&gt; &lt;p&gt;function FullyOptimizedCoffeeMaking()&lt;br&gt;{&lt;br&gt;WalkTo(2);&lt;br&gt;BeginMakeCoffee(); // 120s – but returns immediately&lt;br&gt;WalkTo(4);&lt;br&gt;GrabCup(); // 5s&lt;br&gt;WalkTo(6);&lt;br&gt;GetMilk(); // 20s&lt;br&gt;PourMilk(); // 5s&lt;br&gt;DiscardOrReturnMilk(); // 10s&lt;br&gt;WalkTo(5);&lt;br&gt;GrabLid(); // 5s (probably closer to 3s in this case)&lt;br&gt;WalkTo(2);&lt;br&gt;PlaceCupInMachine();&lt;br&gt;EndMakeCoffee(); &lt;br&gt;LidCup(); // 5s&lt;br&gt;}&lt;/p&gt; &lt;p&gt;Notice that when we call BeginMakeCoffee(), we immediately return and continue processing – going through the phases of getting the milk, preparing the cup and only then, when done, placing it in the machine. So, in this case, best case time would be: &lt;strong&gt;&lt;font size="4"&gt;125 seconds&lt;/font&gt;&lt;/strong&gt;. That’s 120 seconds that it takes to make the coffee plus the 5 that it takes to lid the cup. The rest of the time is taken up in parallel to making the coffee.&lt;/p&gt; &lt;p&gt;But there’s a problem! BeginMakeCoffee() and EndMakeCoffee() do not work exactly like a machine async operation. Generally speaking, when you issue an async operation, the sub-system will take care to store the result for you when it’s done and wait patiently for you to call the second part of the operation (EndMakeCoffee) before it returns the result. A coffee machine does not work that way. When the coffee is ready, it’s coming out – whether there’s something to store it or not. That presents some problems for the FullyOptimizedCoffeeMaking() function! What happens if instead of talking about Best case, we were to talk about worst case. The GetCup() can sometimes take 30 seconds. GetMilk can sometimes take 120 seconds. As well as some of the other things that make take longer under high-stress cases. What happens then? Well, what happens is that the coffee starts pouring and there’s nowhere for it to go, so it gets wasted. Sacrilege!!&lt;/p&gt; &lt;p&gt;In essence, we need something that’s both optimized AND safe. Since life does not have convenient temporary memory (where the coffee would have been stored) or sync objects (where the act of pouring the coffee could have been locked and deferred until a cup is to be placed underneath the nozzle), it means we need to work around those limitations:&lt;/p&gt; &lt;p&gt;function OptimizedAndSafeCoffeeMaking()&lt;br&gt;{&lt;br&gt;WalkTo(2);&lt;br&gt;BeginMakeCoffee(); // 120s – but returns immediately&lt;br&gt;WalkTo(4);&lt;br&gt;GrabCup(); // 5s&lt;br&gt;WalkTo(2);&lt;br&gt;PlaceCupInMachine();&lt;br&gt;WalkTo(6);&lt;br&gt;GetMilk(); // 20s&lt;br&gt;WalkTo(2);&lt;br&gt;PourMilk(); // While cup is in the machine – 10s&lt;br&gt;WalkTo(6)&lt;br&gt;DiscardOrReturnMilk(); // 15s&lt;br&gt;WalkTo(5);&lt;br&gt;GrabLid(); // 5s (probably closer to 3s in this case)&lt;br&gt;WalkTo(2);&lt;br&gt;EndMakeCoffee(); &lt;br&gt;LidCup(); // 5s&lt;br&gt;}&lt;/p&gt; &lt;p&gt;The CPU (me) now needs to work more – you will notice that there is more walking around to accommodate the new placement of the cup (it can no longer be carried around – one needs to walk to it to pour the milk and then back to the fridge to discard or put back). The time this now takes is still &lt;strong&gt;&lt;font size="4"&gt;125 seconds&lt;/font&gt;&lt;/strong&gt; - 120s to make the coffee and prepare the cup and another 5s at the end when the cup is lidded. Switching the lines around and doing more leg work though has bought us a lot more safeness.&lt;/p&gt; &lt;p&gt;Note that this is still not perfect – if the 5s it takes to get a cup and place it in the machine would balloon from 5s to 120s, we would be right back in our original position of losing our coffee. However, that is far less likely to happen in this case. If you want to eliminate risk completely, simply switch BeginMakeCoffee() with GrabCup() and PlaceCupInMachine(). You will lose 5 seconds (making the total time 130 seconds), but you are then completely safe.&lt;/p&gt; &lt;p&gt;So that’s what I was trying to explain to the tester when that look came to his face. The thing is, I am sure everyone does this. But people probably do this unconsciously or at least in a less &lt;strike&gt;obsessive compulsive&lt;/strike&gt; analytic manner than a software developer would.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9811528" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Development+Related/default.aspx">Development Related</category><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Geekdom/default.aspx">Geekdom</category></item><item><title>Windows 7 RC – Media Streaming (“Stream” button in Windows Media Player)</title><link>http://blogs.msdn.com/cumgranosalis/archive/2009/05/07/windows-7-rc-media-streaming-stream-button-in-windows-media-player.aspx</link><pubDate>Thu, 07 May 2009 20:28:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9594854</guid><dc:creator>Shahar</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/9594854.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=9594854</wfw:commentRss><description>&lt;p&gt;I found out about this feature a bit ago and.. Wow.. I am so impressed. The set-up procedure is a little convoluted, but once you do it, the thing just works.&lt;/p&gt; &lt;p&gt;Here’s the idea: Allow your identity (your Windows Live account, basically) to stream your media accross the interwebs. If my home computer has my entire outdated music library on it, I don’t need to copy the entire thing to my laptops to access it – I just make sure to associate my Windows Login user to my Live account user and voila – I can stream media from my house when I work!&lt;/p&gt; &lt;p&gt;Step by step:&lt;/p&gt; &lt;p&gt;You can associate your live-id to your windows user account by using the control panel, but Windows Media Player gives you a shortcut. In the Stream drop-down, choose “Allow Internet access to home media”:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb.png" width="451" height="322"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Then, you will be presented with a dialog containing the options you have. You should click “Link online ID”:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb_1.png" width="520" height="434"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once you click that, WMP will bring you to a window that allows you to add an online ID provider. Click the&amp;nbsp; “Add an online…” button:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb_2.png" width="666" height="466"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Once clicked, you will be presented with providers. Click the “Windows Live” one – that will again redirect you to a download from Microsoft. Choose the correct architecture (x86 or x64) and download/install the package. Once you did that, going back to the “Link online IDs” dialog will look like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb_3.png" width="666" height="466"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You now need to select the “Link online ID” on the WindowsLiveID highlighted item. That will ask you to log into Windows Live with your Live-ID. Once that’s done, the window will again change to show the linked account:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_10.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb_4.png" width="599" height="217"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;If you go back to Windows Media Player, you should choose the”Allow internet access to home media” option on the open dialog box (same as the second image in this post). Once clicked, the dialog should close and you should land back inside Windows Media Player. But now, you will have your home library available to choose from:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_12.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb_5.png" width="836" height="711"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You can now play your music to your heart conent. Apparently, this also supports streaming of video. The quality seems kind’a random – I have seen it be very good (indistinguishable from the original) and pretty bad. I guess it takes your bandwidth into account:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_14.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Windows7RCMediaStreamingStreambuttoninWi_B52D/image_thumb_6.png" width="244" height="195"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Enjoy!!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9594854" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Win7/default.aspx">Win7</category></item><item><title>Prish Resizer moved to another blog (Also, new version – jpg quality support + custom size through context menu)</title><link>http://blogs.msdn.com/cumgranosalis/archive/2009/01/20/prish-resizer-moved-to-another-blog-also-new-version-jpg-quality-support-custom-size-through-context-menu.aspx</link><pubDate>Tue, 20 Jan 2009 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9344402</guid><dc:creator>Shahar</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/9344402.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=9344402</wfw:commentRss><description>&lt;p&gt;Image Resizer has moved to another blog – this way it does not interfere with this blog which is all about Excel Services – my actual daytime job.&lt;/p&gt; &lt;p&gt;&lt;a href="http://prishcom.spaces.live.com/"&gt;Find it here!&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9344402" width="1" height="1"&gt;</description></item><item><title>What new features would you like to see in Prish Image Resizer?</title><link>http://blogs.msdn.com/cumgranosalis/archive/2009/01/14/what-new-features-would-you-like-to-see-in-prish-image-resizer.aspx</link><pubDate>Wed, 14 Jan 2009 17:39:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9319085</guid><dc:creator>Shahar</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/9319085.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=9319085</wfw:commentRss><description>&lt;p&gt;Now that the x64 issue and the non-latin characters issues are solved, what new features would you like to see in the resizer? &lt;/p&gt; &lt;p&gt;Post your comments.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9319085" width="1" height="1"&gt;</description></item><item><title>New version of Prish Image Resizer (x64 support. Unicode support).. It’s been a while..</title><link>http://blogs.msdn.com/cumgranosalis/archive/2009/01/14/new-version-of-prish-image-resizer-x64-support-unicode-support-it-s-been-a-while.aspx</link><pubDate>Wed, 14 Jan 2009 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9318232</guid><dc:creator>Shahar</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/9318232.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=9318232</wfw:commentRss><description>&lt;p&gt;Well.. It’s been a while since I updated..&lt;/p&gt; &lt;p&gt;Short and sweet – this is the new version of Image Resizer. There are 2 setups now – one for 32bit and one for 64bit.&lt;/p&gt; &lt;p&gt;This also solves the issues people have been having with foreign characters making resizing impossible.&lt;/p&gt; &lt;p&gt;You can find the new versions in here:&lt;/p&gt; &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-bc8abb78b2dd1c63.skydrive.live.com/embedrowdetail.aspx/Pub/PrishImageResizer/1.0.2513" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;Direct links:&lt;/p&gt; &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-bc8abb78b2dd1c63.skydrive.live.com/embedrowdetail.aspx/Pub/PrishImageResizer/1.0.2513/32bit%7C_PrishResizer%7C_2513.msi" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-bc8abb78b2dd1c63.skydrive.live.com/embedrowdetail.aspx/Pub/PrishImageResizer/1.0.2513/64bit%7C_PrishResizer%7C_2513.msi" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9318232" width="1" height="1"&gt;</description></item><item><title>Tips on Excel Services article published on MSDN</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/05/23/tips-on-excel-services-article-published-on-msdn.aspx</link><pubDate>Fri, 23 May 2008 21:33:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8541735</guid><dc:creator>Shahar</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8541735.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8541735</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc514223.aspx#MOSS2007TenTips_QuickTipsforCommonExcelServicesIssues"&gt;This article&lt;/a&gt; contains some basic troubleshooting/tips on using Excel Services.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8541735" width="1" height="1"&gt;</description></item><item><title>New published paper - advanced usage of Excel Services and File Format manipulations</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/05/06/new-published-paper-advanced-usage-of-excel-services-and-file-format-manipulations.aspx</link><pubDate>Tue, 06 May 2008 17:46:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8463551</guid><dc:creator>Shahar</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8463551.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8463551</wfw:commentRss><description>&lt;p&gt;Sergei Gundorov (whom you may remember from a &lt;a href="http://blogs.msdn.com/cumgranosalis/archive/2008/03/01/single-select-dimension-member-analysis-services-filter-web-part.aspx"&gt;previous post&lt;/a&gt;) has published a paper on MSDN where he talks about a very interesting solution his team wrote in the Microsoft IT department. The solution is probably one of the most advanced implementation of Excel Services I have seen to date and includes lots of ingenious customizations - the white paper, specifically, talks about how to use Excel Services as a landing pad for data and then get the file stream from it, customize it (add stuff into it) and serve it up to the user.&lt;/p&gt; &lt;p&gt;You can find the paper on &lt;a href="http://msdn.microsoft.com/en-us/library/cc540662.aspx"&gt;MSDN&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8463551" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Excel+Services/default.aspx">Excel Services</category></item><item><title>Awesome mouse-pad</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/04/24/awesome-mouse-pad.aspx</link><pubDate>Fri, 25 Apr 2008 03:28:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8423309</guid><dc:creator>Shahar</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8423309.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8423309</wfw:commentRss><description>&lt;p&gt; We have a surplus computer store near my house which I like mostly because their pricing on cables is not equivalent to the GDP of a small island state. They have some real wonky stuff in there - very old printers, monitors, etc.&lt;/p&gt; &lt;p&gt;I passed through there today and saw this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Awesomemousepad_11FED/IMAG0039_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="IMAG0039" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/Awesomemousepad_11FED/IMAG0039_thumb.jpg" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Most-awesome-mouse-pad evah!&lt;/p&gt; &lt;p&gt;It is so much better than the competition because it has space not for two, but FIVE 3.5 diskettes. I think the only way this could be even awesommer is if it had space for 5.25 disks.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8423309" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Geekdom/default.aspx">Geekdom</category></item><item><title>Transitioning from TiVo to Windows Media Center</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/25/transitioning-from-tivo-to-windows-media-center.aspx</link><pubDate>Tue, 25 Mar 2008 20:55:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8336523</guid><dc:creator>Shahar</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8336523.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8336523</wfw:commentRss><description>&lt;p&gt;I finally made the jump to Windows Media Center 2 months ago or so and, overall, I am much happier for it. I have had TiVos in my house since 2001 and it has gotten to be that I just never watch live TV anymore. I adore the concept of the DVR and am greatly annoyed when I dont have it at my fingertips.&lt;/p&gt; &lt;p&gt;Except for a few hiccups when I started (some due to me and others due to the fact that I bought the Dell 420 when it just came out, before Dell has fully gotten rid of the kinks), the machine has been working famously for about 2 months now. And it's just great.&lt;/p&gt; &lt;p&gt;There are a bunch of things I don't like about it, but for the most part they revolve around the programmability model. The software itself, out of the box, is absolutely awesome - it is SO much more responsive than TiVo (a Quad processor helps!) and the fact that you can upgrade HDDs and hardware generally is great too. The menu system is also miles ahead of TiVo, not to talk about integration with my home network and the Internet - totally and utterly sweet. The Movie Guide is a real nice touch and very easy to use. So is conflict resolution - I find it much better presented and handled.&lt;/p&gt; &lt;p&gt;The one feature I really miss though is grouped-shows by title ordered by date.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8336523" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Geekdom/default.aspx">Geekdom</category></item><item><title>Who's Afraid of the big-bad cast operator?</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/24/who-s-afraid-of-the-big-bad-cast-operator.aspx</link><pubDate>Mon, 24 Mar 2008 16:00:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8333011</guid><dc:creator>Shahar</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8333011.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8333011</wfw:commentRss><description>&lt;p&gt;My &lt;a href="http://blogs.msdn.com/cumgranosalis/archive/2008/03/23/using-a-generic-return-type-that-does-not-appear-in-the-parameter-list-when-to-use-it.aspx"&gt;previous blog entry&lt;/a&gt; (which was completely misunderstood by some people who commented - I blame the fact that English is not my native tongue) reminded me of another poor coding behavior. Just so we don't have a repeat of that last post, let me clarify that &lt;strong&gt;I have nothing against the &lt;em&gt;as&lt;/em&gt; operator - I use it all the time - I just have a problem with certain usage patterns that employ it.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;For whatever reason, people tend to use the "as" operator instead of the cast operator.&lt;/p&gt; &lt;p&gt;A lot of times you will see code like this:&lt;/p&gt;&lt;pre class="csharpcode"&gt;MyClass c = o &lt;span class="kwrd"&gt;as&lt;/span&gt; MyClass;
c.DoSomething();&lt;/pre&gt;
&lt;p&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
Where the following code makes MUCH more sense:&lt;/p&gt;&lt;pre class="csharpcode"&gt;MyClass c = (MyClass)o;
c.DoSomething();&lt;/pre&gt;
&lt;p&gt;I have two theories as to why people do it this way:&lt;/p&gt;
&lt;p&gt;1. People are afraid of Exceptions.&lt;br&gt;2. People are used to dynamic_cast&amp;lt;&amp;gt;() from C++ which is the easiest way to check if a class is of a certain runtime type.&lt;/p&gt;
&lt;p&gt;The reason the example above with the"as" operator is a Bad Thing is because it defers the exception to a later point in your code. If the class is not what you expect it to be, your cast will succeed (resulting in NULL) only to fail a few lines later on a NullReferenceException - which in turn makes debugging and logging harder to understand because you are not really seeing the correct exception.&lt;/p&gt;
&lt;p&gt;Now, there are many valid usages of the &lt;strong&gt;as&lt;/strong&gt; operator - but they almost always rely on the fact that you actually do something with the fact that the class is different than what you expect. So for example, if you want your Equals method to be able to handle classes different than your own, that's a GREAT place to use &lt;strong&gt;as&lt;/strong&gt;:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Equals(&lt;span class="kwrd"&gt;object&lt;/span&gt; o)
{
    MyClass other = o &lt;span class="kwrd"&gt;as&lt;/span&gt; MyClass;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (other == &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    &lt;span class="rem"&gt;//....&lt;/span&gt;
}&lt;/pre&gt;However, if you do not intend for your .Equals method to support comparison with other types (and have no other usage for the knowledge that the reference you got is not what you expected), you should definitely use&amp;nbsp; the regular cast operator.
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8333011" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Development/default.aspx">Development</category></item><item><title>Using a Generic return type that does not appear in the parameter list - when to use it</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/23/using-a-generic-return-type-that-does-not-appear-in-the-parameter-list-when-to-use-it.aspx</link><pubDate>Sun, 23 Mar 2008 21:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8332628</guid><dc:creator>Shahar</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8332628.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8332628</wfw:commentRss><description>&lt;P&gt;&lt;STRONG&gt;EDIT: Contrary to what people understood from this post, it is &lt;U&gt;NOT &lt;/U&gt;a "Do not use Generics" post - I think Generics are a GREAT addition to the language/framework and I use them all the time. It is against a very specific usage of Generics&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Short Answer: Rarely.&lt;/P&gt;
&lt;P&gt;Slightly longer answer: When you are aware of the alternatives.&lt;/P&gt;
&lt;P&gt;Yet longer answer:&lt;/P&gt;
&lt;P&gt;I have seen this a couple of times recently and thought I'd drop a line about it. As always, take it with a grain of salt, but here goes...&lt;/P&gt;
&lt;P&gt;You find yourself wanting to write a method that returns a value to the caller. Said value can be of many types and you decide to create a template out of it - a recent example I saw (which is very typical to the misuse of this mechanism):&lt;/P&gt;
&lt;P&gt;T GetRegValue&amp;lt;T&amp;gt;(string path); // Get the value of a registry path&lt;/P&gt;
&lt;P&gt;This method calls into the Win32 wrappers and gets back an Object, the code then returns it to the caller in the following manner:&lt;/P&gt;
&lt;P&gt;T result = (T)objectResult;&lt;/P&gt;
&lt;P&gt;I have heard many reasons as to why people choose to use this mechanism - the two that come up most often:&lt;/P&gt;
&lt;P&gt;1. It's easier to understand/write/maintain or it is "cleaner".&lt;BR&gt;2. It's more type-safe.&lt;/P&gt;
&lt;P&gt;Lets go over those one by one... &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It's easier to understand/write/maintain or it is "cleaner"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The amount of code that needs typing in this case is exactly the same as if you had returned an object. Compare and contrast:&lt;/P&gt;
&lt;P&gt;string result = (string)GetRegValue("path"); // This is when using the "old and boring" way&lt;BR&gt;string result = GetRegValue&amp;lt;string&amp;gt;("path"); // This is when using the "new and shiny" way&lt;/P&gt;
&lt;P&gt;It's EXACTLY the same amount of code characters and I am pretty sure more people know how to read/parse casting operators (the &lt;STRONG&gt;(string)&lt;/STRONG&gt; bit) than generic type parameters (the &lt;STRONG&gt;&amp;lt;string&amp;gt;&lt;/STRONG&gt; bit). So it's the same amount of code (not easier to write), it's using a mechanism that less people know (not easier to understand). That leaves "easier to maintain" which I &lt;EM&gt;usually&lt;/EM&gt; equate to "easier to understand".&lt;/P&gt;
&lt;P&gt;We are left with it's "cleaner" but that's a whole new blog entry - to me both mechanisms look alike from the cleanliness point of view.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It's more type-safe&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is just not true. In the typical example, a cast is made to the requested type (T in this generic method) - casts in .NET are safe (that is to say, they will throw an exception of they do not work and if they do work they are guaranteed to work properly). The code doesn't even eliminate the cast - it just moves it to the inside of the method.&lt;/P&gt;
&lt;P&gt;Here's my rationale behind why such a mechanism should not be used:&lt;/P&gt;
&lt;P&gt;1. It's harder to debug.&lt;BR&gt;2. It doesn't contribute anything.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It's harder to debug&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In the cases where the type of the retrieved cannot be cast, your exception will be thrown &lt;STRONG&gt;inside the inner method&lt;/STRONG&gt; which may throw you off when you are trying to figure out what's wrong. It's not a big deal, especially if you own the library that is making the call, but it's just a little harder to understand what went wrong.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It doesn't contribute anything&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Generics are a more advanced language construct that casting and as such is harder to understand. At the end of the day, you are getting the same result and so should be using the simplest mechanism possible.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So when should I use this?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There are cases where this can be useful - for example, when some property of the return type is used to make the method smarter. This is where you go onto the gray line. The above snippet, when presented to me, actually looked a little different:&lt;/P&gt;
&lt;P&gt;T result = Convert.ChangeType(objectResult, typeof(T)); // Used to be T result = (T)objectResult;&lt;/P&gt;
&lt;P&gt;This is a subtle difference, but an important one. Here we are asking the runtime to force one type unto another. To understand the difference, consider the following call (first one is the generic version and the second the non-generic):&lt;/P&gt;
&lt;P&gt;double d = GetRegValue&amp;lt;double&amp;gt;("path");&lt;BR&gt;double d = (double)GetRegValue("path");&lt;/P&gt;
&lt;P&gt;In this case, the fancy version will actually work whereas the non-generic one will fail with an InvalidCastException. The reason behind this is simple - the API method used to fetch the value from the registry returns a boxed integer. A boxed integer can only be cast into two things - an Object or an Integer - it can't be cast to any other type. For this to work, the caller would have had to do one of the following:&lt;/P&gt;
&lt;P&gt;double d = (double)(int)GetRegValue("path"); // Cast the object into an int and then the int into a double.&lt;BR&gt;double d = Conver.ChangeType(GetRegValue("path"), typeof(double)); // Coerce the value.&lt;/P&gt;
&lt;P&gt;Both these choices ARE indeed somewhat less readable and perhaps less maintainable than the generic alternative - I personally could go both ways on this - not married to either of them. In the case of Registry access, the values are usually known beforehand and thus you probably know exactly what you are looking for so I would probably go with an object retval.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8332628" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Development/default.aspx">Development</category></item><item><title>Hitting "Session Timeout" errors when you clearly are not supposed to be hitting them</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/18/hitting-session-timeout-errors-when-you-clearly-are-not-supposed-to-be-hitting-them.aspx</link><pubDate>Tue, 18 Mar 2008 21:09:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8322537</guid><dc:creator>Shahar</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8322537.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8322537</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;You are working on preparing dashboards or uploading workbooks to your SharePoint site for usage with Excel Services. Every now and again, even though you are clearly interacting with the session, EWA will suddenly tell you that the session has &lt;a href="http://blogs.msdn.com/cumgranosalis/archive/2006/03/31/ExcelServiceSessionTimeout1.aspx"&gt;timed out&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Reason:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Under some circumstances, the server may decide that it needs to recycle itself or stop servicing requests targeted at a specific workbook. In those cases, the server has no way of distinguishing between a timed-out session, and invalid session (a session identified by an invalid string internally - the same thing used by Excel Web Services) or a session that died because of the reasons just cited.&lt;/p&gt; &lt;p&gt;Because of those reasons, the server gives the most generic session-related error it sees.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;What to do:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Nine times out of ten, this occurs because a workbook is corrupt in some manner or contains something that Excel Services otherwise does not expect. Identifying the problematic workbook and then using the forums to send it (scrubbed of any private info of course) would be a great first step at trying to resolve the issue. Also, if the workbook has recently changed, it could be useful to go back to an earlier version and see what change actually caused the issue.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8322537" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Excel+Services/default.aspx">Excel Services</category></item><item><title>COM Library for Excel Web Services - Use EWS from VBA!</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/05/com-library-for-excel-web-services-use-ews-from-vba.aspx</link><pubDate>Wed, 05 Mar 2008 17:00:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8046287</guid><dc:creator>Shahar</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8046287.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8046287</wfw:commentRss><description>&lt;p&gt;In the ODC 2008, I gave a demo of how to use Excel Web Services from a VBA client - the demo was basically just a managed library that wrapped a generated Web Services proxy.&lt;/p&gt; &lt;p&gt;Since Microsoft no longer seems to supply a SOAP toolkit for office, this is the easiest way of achieving access to Excel Web Services.&lt;/p&gt; &lt;p&gt;The library gives access to all of the important methods exposed by EWS and will allow users to read data/set data and otherwise manipulate an Excel Services session. The following VBA example shows how to use the library:&lt;/p&gt; &lt;div style="border-right: windowtext 1pt solid; padding-right: 4pt; border-top: windowtext 1pt solid; padding-left: 4pt; background: #f2f2f2; padding-bottom: 1pt; border-left: windowtext 1pt solid; padding-top: 1pt; border-bottom: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242"&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;Sub DoIt()&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Dim Es As New EwsCom.ExcelServicesSession&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;' Open the workbook.&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Es.Open "http://bluemonster/_vti_bin/ExcelService.asmx", "http://bluemonster/Test/Shared Documents/Wow.xlsx"&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Debug.Print "Session is:" &amp;amp; Es.SessionId&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;' Get a single cell result.&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Dim R&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;R = Es.GetCell("Range2", True)&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Debug.Print "GetCell of Range2 got:" &amp;amp; R&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;' Set a single cell back.&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Es.SetCell "Range2", "My New Value"&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;' Get a range and fill the workbook with the results gotten from it.&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Dim MyRange As EwsCom.ExcelServicesRange&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Set MyRange = Es.GetRange("Range1", False)&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;For Row = 0 To MyRange.RowCount - 1&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;For Column = 0 To MyRange.ColumnCount - 1&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ActiveCell.Offset(Row, Column).Value2 = MyRange(Column, Row)&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Next&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Next&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;' Save the session workbook into a local file.&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Es.SaveWorkbook WorkbookType_FullWorkbook, "c:\temp\MyFile.xlsx"&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;' Close the session.&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Es.Close&lt;/p&gt; &lt;p class="MsoNormal" style="border-right: medium none; padding-right: 0in; border-top: medium none; padding-left: 0in; background: #f2f2f2; margin-bottom: 0pt; padding-bottom: 0in; border-left: medium none; line-height: normal; padding-top: 0in; border-bottom: medium none; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 242; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;End Sub&lt;/p&gt;&lt;/div&gt; &lt;p&gt;As you can see, the major difference between the way the library works and the EWS works is that the Session ID is wrapped so that it doesn't need to be used over and over again - as well as that annoying status array that's usually ignored.&lt;/p&gt; &lt;p&gt;I have published the library on &lt;a href="http://code.msdn.microsoft.com/EwsCom"&gt;MSDN Code Samples&lt;/a&gt; - it's called EwsCom - enjoy.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8046287" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Development/default.aspx">Development</category><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Excel+Services/default.aspx">Excel Services</category></item><item><title>Chapter of the 'Professional Excel Services' book is on MSDN.</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/04/chapter-of-the-professional-excel-services-book-is-on-msdn.aspx</link><pubDate>Wed, 05 Mar 2008 00:49:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8039616</guid><dc:creator>Shahar</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/8039616.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=8039616</wfw:commentRss><description>&lt;p&gt;MSDN has just published a chapter from my book "&lt;a href="http://www.amazon.com/Professional-Excel-Services-Programmer/dp/0470104864"&gt;Professional Excel Services&lt;/a&gt;". You can find it on &lt;a href="http://msdn2.microsoft.com/en-us/library/cc268428.aspx"&gt;this link&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;This wouldn't happened without the great work of Siew Moi Kohr. Thanks Siew!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8039616" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Excel+Services/default.aspx">Excel Services</category></item><item><title>Single-select Dimension member Analysis Services Filter Web Part</title><link>http://blogs.msdn.com/cumgranosalis/archive/2008/03/01/single-select-dimension-member-analysis-services-filter-web-part.aspx</link><pubDate>Sun, 02 Mar 2008 05:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7985687</guid><dc:creator>Shahar</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cumgranosalis/comments/7985687.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cumgranosalis/commentrss.aspx?PostID=7985687</wfw:commentRss><description>&lt;p&gt;A long long time ago, in a building far far away, two &lt;s&gt;Jedis&lt;/s&gt; developers called Sreepada Santhegudda and Sergei Gundorov showed me a solution they came up with for a single-select Analysis Services &lt;a href="http://msdn2.microsoft.com/en-us/library/ms494838.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms494838.aspx"&gt;filter web part&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;While SharePoint ships with a set of filters that allow users to build interesting dashboards, and while one of them allows you to select dimension members for filtering, the solution is by no means a one-size-fits-all solution. Apart from the issue of having a somewhat convoluted way of doing single select (you essentially need to un-select all elements one way or another and then select the item you want - and then, when you want to switch from one member to another, you need to remember to un-select the previously selected one).&lt;/p&gt; &lt;p&gt;They have sent me the solution eons ago and one way or another, I kept procrastinating and never posted it - Mike Reese prodded me enough that I felt totally ashamed of myself and so I finally got off my fat behind and posted it. Anyway - here's the solution, including source code, for your usage. They also have a document that explain usage and installation.&lt;/p&gt; &lt;p&gt;Here's a screen-shot that shows the simplified selection mechanism:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/SingleselectDimensionmemberAnalysisServi_1295D/clip_image002_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/SingleselectDimensionmemberAnalysisServi_1295D/clip_image002_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="Single-Select-AS-Filter" src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/SingleselectDimensionmemberAnalysisServi_1295D/clip_image002_thumb.jpg" width="217" border="0" mce_src="http://blogs.msdn.com/blogfiles/cumgranosalis/WindowsLiveWriter/SingleselectDimensionmemberAnalysisServi_1295D/clip_image002_thumb.jpg"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I have created an &lt;a href="http://code.msdn.microsoft.com/ASSingleSelectWP"&gt;MSDN Code Sample library and have uploaded&lt;/a&gt; it to there. Enjoy!!!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7985687" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Development/default.aspx">Development</category><category domain="http://blogs.msdn.com/cumgranosalis/archive/tags/Excel+Services/default.aspx">Excel Services</category></item></channel></rss>