<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.popart.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>Andrew Hay&amp;#39;s Blog</title><link>http://blogs.popart.com/andrew-hay/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>InnoTech Presentation Notes: Understanding LINQ</title><link>http://blogs.popart.com/andrew-hay/archive/2008/04/16/innotech-presentation-notes-understanding-linq.aspx</link><pubDate>Wed, 16 Apr 2008 19:50:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2293</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2293</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2008/04/16/innotech-presentation-notes-understanding-linq.aspx#comments</comments><description>
&lt;p class="leadtxt"&gt;Since I&amp;#39;m posting this in advance, I hope my session titled Understanding LINQ was a huge hit and everyone loved it. I&amp;#39;ve been working on the content for a while and its tough whittling it down to fit inside the specified time slots; there&amp;#39;s just so much cool stuff. I probably phat-fingered some keys once or twice, but hopefully I didn&amp;#39;t start my sentences with &amp;quot;So....&amp;quot; too often or speak so fast that I made a whistling noise. I hope you enjoyed it.&lt;/p&gt;

&lt;p&gt;Here&amp;#39;s what you need to run my demo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.popart.com/media/blog/innotech08/understandinglinq.zip" target="_blank"&gt;Visual Studio 2008 Solution Files&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;amp;displaylang=en" target="_blank"&gt;Northwind Database Scripts&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are a collection of URLs that I referenced during my session at InnoTech. They&amp;#39;re great references for understanding LINQ.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.asp.net/learn/linq-videos/" target="_blank"&gt;Scott Stanfield videos&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx" target="_blank"&gt;Scott Guthrie&amp;#39;s nine part blog&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://dotnetslackers.com/articles/csharp/IntroducingLINQ3.aspx" target="_blank"&gt;dotNetSlackers.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.albahari.com/nutshell/predicatebuilder.html" target="_blank"&gt;LINQ Predicate Builder&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.albahari.com/nutshell/linqkit.html" target="_blank"&gt;LINQKit&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/charlie/archive/2006/10/05/Links-to-LINQ.aspx" target="_blank"&gt;Charlie Calvert&amp;#39;s List of LINQ Resources&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/howard_dierking/archive/2007/01/18/lambda-lambda-lambda.aspx" target="_blank"&gt;Howard Dierking on Lambda Expressions&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/Introducing-Microsoft%C2%AE-LINQ-Paolo-Pialorsi/dp/0735623910" target="_blank"&gt;MS Press: Introducing LINQ&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/Professional-LINQ-Programmer-Scott-Klein/dp/0470041811" target="_blank"&gt;Wrox Press: Professional LINQ&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/LINQ-Action-Fabrice-Marguerie/dp/1933988169" target="_blank"&gt;Manning: LINQ in Action&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Session Feedback&lt;/h2&gt;
&lt;p&gt;If you attended the session, would you please provide some feedback using this online survey?&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.polldaddy.com/s/B7103DD293100E4D/"&gt;Launch Survey&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2293" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/LINQ/default.aspx">LINQ</category></item><item><title>Speaking at the InnoTech Conference</title><link>http://blogs.popart.com/andrew-hay/archive/2008/03/26/speaking-at-the-innotech-conference.aspx</link><pubDate>Thu, 27 Mar 2008 03:54:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2260</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2260</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2008/03/26/speaking-at-the-innotech-conference.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.innotechconference.com/pdx/"&gt;&lt;img alt="Innotech, Portland 2008" hspace="6" src="http://www.popart.com/media/blog/innotech08/innotech.png" align="left" border="0" /&gt;&lt;/a&gt;I&amp;#39;ll be speaking at the InnoTech Conference in Portland, Oregon on April 16th and 17th. &lt;a href="http://www.innotechconference.com/pdx/Event/Portland_Events/Understanding_LINQ.php"&gt;My session will get you started with LINQ&lt;/a&gt;, a new feature available in the Microsoft .Net v3.5 Framework.&lt;/p&gt;
&lt;p&gt;Language-Integrated Query is one of the most compelling features for your business in the Microsoft .Net 3.5 Framework. LINQ provides a succinct and expressive layer over your database tables, stored procedures, XML, and other objects. You’ll learn how to get started with LINQ and gain some visibility into what’s going on under the hood with this game changing addition to the .Net Framework.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll start with some of the fundamental features that enable LINQ to exist including object initializers, local inferred types, extension methods, lambda expressions and then dive into LINQ to SQL and LINQ to XML. Hopefully, I&amp;#39;ll have time to touch on LINQ to XSD and some of the other activies going on with this game changer.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also looking forward to seeing some friends talk about Silverlight and agile development practices. Hope to see you there!&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2260" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/LINQ/default.aspx">LINQ</category></item><item><title>What's Your Pet's Name?</title><link>http://blogs.popart.com/andrew-hay/archive/2008/03/25/what-s-your-pet-s-name.aspx</link><pubDate>Wed, 26 Mar 2008 04:40:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2258</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2258</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2008/03/25/what-s-your-pet-s-name.aspx#comments</comments><description>&lt;p&gt;Such a casual question at party could have terrible consequences when you use weak passwords on the Internet. The best advice is to use a unique password for each account. If you spend all day online like me, plus a little more at home, you&amp;#39;ve probably garnered somewhere north of 50 or more accounts.&lt;/p&gt;
&lt;p&gt;The question to ask yourself is which of those accounts are just fine for a hacker to slip into because you used a weak password? Probably none, right? &lt;/p&gt;
&lt;p&gt;Just to put a little more emphasis on it, let&amp;#39;s say you use a reasonably good password for your account on Amazon.com and you liked it so much that you&amp;#39;ve used the same password when you had to create an account last week just to leave a comment on a blog. Now, let&amp;#39;s not get too blue and say that blog site was evil and successfully phished your password. Let&amp;#39;s just say the security was a little too low on that site and someone else happened to glean all of the e-mail addresses and passwords from that blog. &lt;/p&gt;
&lt;p&gt;So now the bad guys have your password. What else can they get into with it? If you&amp;#39;ve been adhering to the rule, then absolutely nothing. If you&amp;#39;ve been lazy, then they just need to guess the username or e-mail address to your bank, your corporate Intranet, your social networking sites or anything else you use. Kinda bleak, eh?&lt;/p&gt;
&lt;p&gt;How are you supposed to remember all of those passwords? Well some fine folks are working on that very problem with technologies like CardSpace and OpenID. That&amp;#39;s all well and good, but what do you do today with the accounts you already have? Start buying more Post-It notes? &lt;/p&gt;
&lt;p&gt;Until you&amp;#39;ve got a better plan, start out by using a tool like Password Minder. Its free and available here: &lt;a title="http://www.pluralsight.com/tools.aspx" href="http://www.pluralsight.com/tools.aspx"&gt;http://www.pluralsight.com/tools.aspx&lt;/a&gt;. This is a simple program written in .Net that helps you collect, organize and use all of the various passwords that make up your life. The data is encrypted into a single XML file that you can store on a USB key, copy to every computer you own or anything else that accepts an electronic file. &lt;/p&gt;
&lt;p&gt;&lt;img alt="Password Minder" src="http://www.popart.com/media/blog/password-minder/passwordminder.png" /&gt;&lt;/p&gt;
&lt;p&gt;You can leave the program running all day, so long as you remember to lock your computer when you leave, or you can start and stop it every time you need to pull out a password. This program is great because its simple, it can be copied to any computer and its protected by a secure master password. &lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how it works:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download and unzip file from PluralSight.com &lt;/li&gt;
&lt;li&gt;Launch the program file name pwm.exe &lt;/li&gt;
&lt;li&gt;Create your master password — this is what you&amp;#39;ll have to type every time you launch the application. &lt;/li&gt;
&lt;li&gt;Add all of your usernames and passwords into the application; each password is unique, right? &lt;/li&gt;
&lt;li&gt;Copy the data file to your other computers or keep it on a USB key for portability. This application is light weight and very portable. &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Better yet, take a look at &lt;a href="http://www.popart.com/media/blog/password-minder/default.html"&gt;a short Silverlight video I made showing how to get started with Password Minder&lt;/a&gt;. If you&amp;#39;ve kept your computer current with Windows Update, then it should be no problem to use.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2258" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.popart.com/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.popart.com/tags/Identity/default.aspx">Identity</category></item><item><title>Start-Up Junkies</title><link>http://blogs.popart.com/andrew-hay/archive/2008/02/18/start-up-junkies.aspx</link><pubDate>Mon, 18 Feb 2008 17:47:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2223</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2223</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2008/02/18/start-up-junkies.aspx#comments</comments><description>&lt;p&gt;When I was 8 to 12, I was big into Dungeons &amp;amp; Dragons. My brother was five years older, and sometimes I could sit with his friends and play. We had all the books, much to the chagrin of my parents. When the D&amp;amp;D cartoon came on, all other things ceased to exist for those short 30 minute chunks of time.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=c8042230-ed19-47bd-a2ff-9a7c99dcde0a&amp;amp;url=http%3a%2f%2fwww.mojohd.com%2fmojoseries%2fstartupjunkies%2f" target="_blank"&gt;&lt;img alt="Start-Up Junkies" hspace="8" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/StartUpJunkies_88EC/startupjunkies_3.png" align="left" border="0" /&gt;&lt;/a&gt; Now that I&amp;#39;m older, I watch a new show called &lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=c8042230-ed19-47bd-a2ff-9a7c99dcde0a&amp;amp;url=http%3a%2f%2fwww.mojohd.com%2fmojoseries%2fstartupjunkies%2f" target="_blank"&gt;Start-Up Junkies, its on the MOJO channel&lt;/a&gt;. I first heard about the show at my local &lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=c8042230-ed19-47bd-a2ff-9a7c99dcde0a&amp;amp;url=http%3a%2f%2fpadnug.org%2fpadnug%2fdefault.aspx" target="_blank"&gt;.Net User Group&lt;/a&gt; meeting. The PADNUG organization gets together about once a month, sponsors buy pizza and someone presents for 60-90 minutes on a .Net related topic; recruiters abound here. Being so close to Redmond, we&amp;#39;re a little spoiled with lots of juggernaut speakers around. At the last meeting, &lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=c8042230-ed19-47bd-a2ff-9a7c99dcde0a&amp;amp;url=http%3a%2f%2fblog.rolpdog.com%2f" target="_blank"&gt;Matt Davis&lt;/a&gt; gave what was arguably one of the best sessions I&amp;#39;ve ever seen here. He&amp;#39;s a relaxed speaker and clearly an expert in his craft. &lt;/p&gt;
&lt;p&gt;Matt works for a company called &lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=c8042230-ed19-47bd-a2ff-9a7c99dcde0a&amp;amp;url=http%3a%2f%2fwww.earthclassmail.com%2f" target="_blank"&gt;Earth Class Mail&lt;/a&gt;, a start-up with a great idea. They offer a mail processing service. When you sign up, you change your address and send your mail to them. They scan all of your mail and you access it online. They can scan just the outside of the envelope or open and scan all of the contents too. You can shred it or have the physical document sent to you if you want to keep it. The company was growing at a reasonable pace when they signed on the mysterious giant corporate client, code-named &amp;quot;cheetah&amp;quot;. If they make this pilot project with cheetah work, they&amp;#39;ll be huge. Matt mentioned the TV show in passing during the presentation and I looked it up.&lt;/p&gt;
&lt;p&gt;Start-Up Junkies follows the company through the frantic pace of trying to scale up without failing. I saw the .com bubble rise and fall so I really get this show. The cameras wander all over the offices, covering the CEO, marketing, sales, I.T. and operations. Sometimes I&amp;#39;m cheering and other times I&amp;#39;m yelling and the screen and shouting WTF!?!?! &lt;/p&gt;
&lt;p&gt;I love my job and now I get to watch a little bit of it portrayed on HDTV. Watching in the one-piece jammies with feet is optional.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2223" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/Start-Up/default.aspx">Start-Up</category></item><item><title>Test for Existence of a JavaScript Method</title><link>http://blogs.popart.com/andrew-hay/archive/2008/02/15/test-for-existence-of-a-javascript-method.aspx</link><pubDate>Sat, 16 Feb 2008 07:05:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2219</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2219</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2008/02/15/test-for-existence-of-a-javascript-method.aspx#comments</comments><description>&lt;p&gt;One of my teammates recently had a problem with some Flash injection code. She was setting some properties and then calling a function on a JavaScript object that threw an error. We got a message that said &amp;quot;Object doesn&amp;#39;t support this property or method&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Object doesn&amp;#39;t support this property or method" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/TestforExistenceofaJavaScriptMethod_14218/image_6.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;We isolated it down to a timing issue by dropping an alert() into the code just before we called the method. With the alert() pausing execution for a few seconds, the browser had enough time to fully instantiate our object. Without the alert(), the method was called before it was built. Its a problem that can make your brain hurt.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s how you can test for the existence of a JavaScript method before you call it. You might need to do this if you&amp;#39;re working with asynchronous calls or dynamic objects that take a while to build.&lt;/p&gt;
&lt;p&gt;I created a sample page to demonstrate the issue and how to deal with it. I put three hyperlinks on the page that each call a JavaScript method. Here&amp;#39;s the JavaScript code.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Testing for a JavaScript method" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/TestforExistenceofaJavaScriptMethod_14218/image_thumb_3.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;At the bottom of the previous code block, you&amp;#39;ll see some JavaScript in the mainline section. This code gets executed as soon as the browser sees it. JavaScript is an interpreted language and the browser processes it in a top-down fashion. So, by definition, the browser already knows about my three methods before it runs my code in the mainline.&amp;nbsp; This is where I define an empty object to test and then create an instance of that object. Just two lines, not much so far.&lt;/p&gt;
&lt;p&gt;When I click the link that runs the function named TestForFunction(), I perform some due diligence tests by checking for an undefined object as well as a null object. The last test with the arrow pointing to it is the key part. This will tell me if the method exists without actually running the method. I show one of two messages based on the existence of the method.&lt;/p&gt;
&lt;p&gt;The top function named CreateFunction() just spot welds a method onto my object. Even though I&amp;#39;ve already created an instance of my object, I can still see this method in my instance because I&amp;#39;ve added the method to the prototype. When this function returns, I&amp;#39;ve got my new method. When I run TestForFUnction() again, it will see the method.&lt;/p&gt;
&lt;p&gt;The bottom method just executes the function I added on the fly. When my DoWork() method fires, it shows a message in the alert() pop-up.&lt;/p&gt;
&lt;p&gt;If you find that you need to deal with this type of problem in your code, inspect the object for the method before you call it. If the method doesn&amp;#39;t exist, refactor your code to call the window.setTimeout() function for a few milliseconds and check again. Once it exists, your code can continue executing.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2219" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>Its only Monday, and I'm Already Out on a Branch</title><link>http://blogs.popart.com/andrew-hay/archive/2008/02/04/its-only-monday-and-i-m-already-out-on-a-branch.aspx</link><pubDate>Tue, 05 Feb 2008 06:34:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2205</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2205</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2008/02/04/its-only-monday-and-i-m-already-out-on-a-branch.aspx#comments</comments><description>&lt;p&gt;...or two.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve had two projects this week where their/my bacon was saved by the branching strategy used for the source code repository. In my line of work, I touch a wide variety of projects. Some are still shiny new and others were written years ago; they&amp;#39;re all in a source control repository.&lt;/p&gt;
&lt;p&gt;Modern source control repositories (and by modern, I mean things that are not your file server or P:\ drive) let you create a branch. Branching might appear complex at first, but it&amp;#39;s really pretty simple - at least conceptually. Here&amp;#39;s a little story to illustrate the point of branches.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When I create a branch, I have a snapshot of the code at a particular point in time. So, imagine that on Monday, I have a single branch called the &amp;quot;trunk&amp;quot;. It contains all of the code for my web site. On Tuesday, I created a branch based on the code in the trunk. I named my branch &amp;quot;BR-1&amp;quot;. When I created BR-1, it was a mirror image of the trunk. I edited the code in BR-1 for a couple of days and nearly got it how I wanted it. My edits were isolated to BR-1 and they did not exist in the trunk.&lt;/p&gt;
&lt;p&gt;I got a call early on Friday morning about an important change that needed to go out right away. I couldn&amp;#39;t implement the urgent change to BR-1 because it contained my partially completed work. It was a pretty small change; a few hours of brilliant coding and I would be ready for a peer review of my changes. So, I checked out the trunk and made the edit right there and checked it back in. I published the urgent change I made on the trunk out to the live web site in the early afternoon and went back to working on BR-1.&lt;/p&gt;
&lt;p&gt;By mid-day on the following Monday, I had finished all of my changes to the BR-1 branch. I had merged the BR-1 code into the trunk too. Now my trunk code contained the changes from BR-1 as well as that urgent change that came through on Friday morning. Complete control with the flick of a switch.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;In the previous story, I was able to handle the urgent request efficiently because I used branching to manage my code changes. If I didn&amp;#39;t have branching available as a software development tool, I would have some bad choices to make. Either I merge the urgent fix with my own enhancements and risk problems by rushing it, or force the urgent change to wait until my own changes were done; neither are necessary.&lt;/p&gt;
&lt;p&gt;Branching is great way to ensure that I can always put my work on the shelf in lieu of more pressing matters. Understanding the concepts of branching is essential to being a valuable member of the team. The keys you actually press to make a branch or merge two branches can be left up to the nerdy folk. For more info, check out &lt;a href="http://www.amazon.com/Pragmatic-Version-Control-Using-Subversion/dp/0974514063" target="_blank"&gt;Pragmatic Version Control Using Subversion&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2205" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/Subversion/default.aspx">Subversion</category></item><item><title>Understanding LINQ</title><link>http://blogs.popart.com/andrew-hay/archive/2007/12/18/understanding-linq.aspx</link><pubDate>Wed, 19 Dec 2007 01:43:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2176</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2176</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2007/12/18/understanding-linq.aspx#comments</comments><description>&lt;p&gt;LINQ is an acronym for Language-Integrated Query and a new feature in v3.5 of the .Net Framework from Microsoft. This new version of Microsoft .Net reached RTM status a couple of weeks ago — this framework is chock full of brilliant things I can use to improve my efficiency and effectiveness on daily tasks here at Pop Art.&lt;/p&gt;
&lt;p&gt;As one of my favorite features, LINQ helps me write data-driven application even faster than what .Net 2.0 brought to the table. A common example starts with launching Visual Studio 2008. After dragging a collection of tables from a SQL Server database onto a surface in my solution, I can see a visualization of the columns in the tables as well as the relationships between them. Click the following thumbnail to see a larger image.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=e56335bf-89d5-4cac-900c-73583fb5dba7&amp;amp;url=http%3a%2f%2fwww.andrewdothay.net%2fblog%2fcontent%2fbinary%2fWindowsLiveWriter%2fUnderstandingLINQ_8EA2%2flinq-map_2.jpg" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="196" alt="database schema" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/UnderstandingLINQ_8EA2/linq-map_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Next, I start writing data access code directly in my C# program as opposed to switching languages and writing in the T-SQL language. Visual Studio gives me Intellisense here too; as I type the name of a table and click the period key, all of the columns in the table appear where the cursor is located. Big time saver. Huge! I&amp;#39;m certain that I didn&amp;#39;t misspell a column name and that my code will compile.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=e56335bf-89d5-4cac-900c-73583fb5dba7&amp;amp;url=http%3a%2f%2fwww.andrewdothay.net%2fblog%2fcontent%2fbinary%2fWindowsLiveWriter%2fUnderstandingLINQ_8EA2%2flinq-intellisense_2.jpg" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="192" alt="intellisense is beautiful" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/UnderstandingLINQ_8EA2/linq-intellisense_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The syntax for LINQ in a C# program is very similar to the T-SQL language, which is a &amp;quot;set based&amp;quot; language. LINQ statements are compiled, just like the rest of my C# code. The first thing someone well versed in T-SQL will notice is that the columns normally specified in a SELECT query are at the end of the LINQ statement instead of the start as in T-SQL. The idea is that you&amp;#39;re articulating your constraints at the start of the LINQ statement and then pulling out the fields you need at the very end.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=e56335bf-89d5-4cac-900c-73583fb5dba7&amp;amp;url=http%3a%2f%2fwww.andrewdothay.net%2fblog%2fcontent%2fbinary%2fWindowsLiveWriter%2fUnderstandingLINQ_8EA2%2flinq-sample_2.jpg" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="169" alt="a LINQ sample" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/UnderstandingLINQ_8EA2/linq-sample_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Behind the scenes, LINQ is using the relationships expressed in the database to generate T-SQL scripts on the fly. This is a clear line of demarcation for LINQ. If you&amp;#39;re using stored procedures exclusively for database access, then LINQ isn&amp;#39;t going to buy you much. You&amp;#39;ll still get Intellisense inside Visual Studio and you can specify an existing stored procedure instead of using the auto-generated SQL, but you&amp;#39;re giving up a lot of acceleration tools. Perhaps more than you&amp;#39;re getting in return.&lt;/p&gt;
&lt;p&gt;LINQ really shines in multiple table joins and aggregation. The following two blocks of code show a query is performed in LINQ and its equivalent T-SQL script. The query retrieves product information from three tables where the list price is below a given amount and a sub-category name exists. If you go the T-SQL route, you will still need to write some C# code to call your database query.&lt;/p&gt;
&lt;p&gt;Which of the following versions would you rather author and support?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LINQ Version&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=e56335bf-89d5-4cac-900c-73583fb5dba7&amp;amp;url=http%3a%2f%2fwww.andrewdothay.net%2fblog%2fcontent%2fbinary%2fWindowsLiveWriter%2fUnderstandingLINQ_8EA2%2flinq-complex_2.jpg" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="201" alt="a more complex LINQ statement" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/UnderstandingLINQ_8EA2/linq-complex_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;T-SQL Version&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=e56335bf-89d5-4cac-900c-73583fb5dba7&amp;amp;url=http%3a%2f%2fwww.andrewdothay.net%2fblog%2fcontent%2fbinary%2fWindowsLiveWriter%2fUnderstandingLINQ_8EA2%2flinq-sql_4.jpg" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="154" alt="an equivalent T-SQL statement" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/UnderstandingLINQ_8EA2/linq-sql_thumb_1.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;MSDN is a great online resource for developers and they really hit a home-run here. They have a page with &lt;a href="http://www.andrewdothay.net/blog/ct.ashx?id=e56335bf-89d5-4cac-900c-73583fb5dba7&amp;amp;url=http%3a%2f%2fmsdn2.microsoft.com%2fen-us%2fvcsharp%2faa336746.aspx" target="_blank"&gt;101 LINQ samples&lt;/a&gt;. This is my preferred way to learn when I already know the surrounding technologies and I want to fill in a specific gap. The page categorizes several ways of retrieving and iterating over information.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2176" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/.Net/default.aspx">.Net</category><category domain="http://blogs.popart.com/tags/LINQ/default.aspx">LINQ</category></item><item><title>Dear ClementDesign Mocha Master Coffee Maker</title><link>http://blogs.popart.com/andrew-hay/archive/2007/12/16/dear-clementdesign-mocha-master-coffee-maker.aspx</link><pubDate>Sun, 16 Dec 2007 22:22:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2175</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2175</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2007/12/16/dear-clementdesign-mocha-master-coffee-maker.aspx#comments</comments><description>&lt;p&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="139" alt="mocha master" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/DearClementDesignMochaMasterCoffeeMaker_C892/mochamaster_3.png" width="167" align="left" border="0" /&gt; I think you&amp;#39;re a good person, but I can&amp;#39;t be with you. I have to break up. Sure 2007 was a fun year, galloping around the estate with that thick scent of delicious coffee in our hair and eager for the new dawn of a dark roast. We had some good times.&amp;nbsp;The Techni Vorm label made me feel European too and I tried to embrace it, I really did. Its not you, its me.&lt;/p&gt;
&lt;p&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="160" alt="virtuoso" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/DearClementDesignMochaMasterCoffeeMaker_C892/virtuoso_3.png" width="191" align="right" border="0" /&gt; It wasn&amp;#39;t easy with your friend, Virtuoso, the coffee grinder. He never made it simple for us. I don&amp;#39;t think he ever really accepted me. What was up with that static electricity? It let forth a brilliant shower of charged coffee grounds after each use. I&amp;#39;m mean really, how can he expect to keep someone around? Sure his sleek exterior and large bean reservoir would make anyone grin, but I&amp;#39;ve got to think of myself sometimes, I have to ask, what&amp;#39;s in this for me? It was just too much of a mess to clean up after every grinding session.&lt;/p&gt;
&lt;p&gt;Mocha Master, why did you start spilling over? At first, I was willing to blame it on the other people you saw. There were several accounts sent around on how to properly make coffee. But time and time again, you spilled when no one was looking. The final straw was when you spilled yesterday for me. It was me Mocha Master! I was here all alone with you and yet you forsake me. How could you do it? You know the level of coffee grounds in there was well within the accepted norms. Somehow you clogged up and spilled over the counter just like all of the times before. I have to give you up.&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height="151" alt="mr coffee" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/DearClementDesignMochaMasterCoffeeMaker_C892/mrcoffee_3.png" width="185" align="left" border="0" /&gt; Hello Mr. Coffee, its been a while. I know I&amp;#39;ve been a bad friend and traipsing all over the coffee producing regions of the globe with my European friend, but its over, I swear. &lt;/p&gt;
&lt;p&gt;I see you&amp;#39;ve gotten some new buttons and they look great, all shiny and in different colors. I&amp;#39;ve even started using a carafe so you don&amp;#39;t need to worry about burning the coffee and ruining the flavor.&lt;/p&gt;
&lt;p&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height="171" alt="starbucks grinder" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/DearClementDesignMochaMasterCoffeeMaker_C892/starbucksgrinder_3.png" width="164" align="right" border="0" /&gt; Oh, and hello little grinder! How have you been? I sure do miss you. Sure, you&amp;#39;re from Starbucks, but that&amp;#39;s ok. You&amp;#39;re a good little guy and you don&amp;#39;t have any static electricity. We love large machines and small machines alike. Sometimes you&amp;#39;re abused and blamed for a mess, but its far and few between and I know you mean well. You can&amp;#39;t fight gravity! Plus, you can grind your beans in 10 seconds flat. I&amp;#39;m going to enjoy seeing you around.&lt;/p&gt;
&lt;p&gt;Mr. Coffee, I want you to know that I&amp;#39;m ready to get down to work and you won&amp;#39;t have to worry about any more whimsical adventures from me. We have a simple agreement in place; you make coffee and I&amp;#39;ll drink it. We don&amp;#39;t need any drama in our lives around this matter and neither of us wants a high maintenance relationship. I&amp;#39;m glad you were willing to come back. I love you Mr. Coffee.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2175" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/coffee/default.aspx">coffee</category></item><item><title>Thinking about ROI</title><link>http://blogs.popart.com/andrew-hay/archive/2007/11/10/thinking-about-roi.aspx</link><pubDate>Sun, 11 Nov 2007 02:14:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2157</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2157</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2007/11/10/thinking-about-roi.aspx#comments</comments><description>&lt;p&gt;In my experiences as a software developer, its fairly normal to hear comments like the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;That&amp;#39;s too many hours &lt;/li&gt;
&lt;li&gt;They don&amp;#39;t have the budget &lt;/li&gt;
&lt;li&gt;I&amp;#39;m not paid enough &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;I had the good fortune of attending a &lt;a href="http://c2.com/cgi/wiki?PortlandXpUsersGroup" target="_blank"&gt;Portland XP Users Group&lt;/a&gt; presentation a few weeks ago by James Shore. He got off on a slight tangent and gave us (well, at least me) a simple equation to chew on:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" alt="ROI" src="http://www.andrewdothay.net/blog/content/binary/WindowsLiveWriter/ThinkingaboutROI_FFC9/roi_2.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;He explained that at its core, Return On Investment is represented by the previous equation. It can help explain quite a bit about the world. This was in response to someone asking about the high cost of the software development methodology under discussion that night.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re presented with a scenario where the value is constant, then the only way to play the game is to minimize costs. Think of a job that never changes. If it always provides the same value to a business, management will seek ways to reduce cost in order to improve the ROI equation.&lt;/p&gt;
&lt;p&gt;On the other hand, a scenario where value has the capability for growth is much more interesting. If you wanted to make $500,000 a year then you would be challenged to deliver some multiple of that cost as a value to the business. &lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my favorite take-away: At some point along the graph, as value increases then cost becomes insignificant. This is the place to be.&lt;/p&gt;
&lt;p&gt;The initial cost of software can make some people squeamish. I&amp;#39;m certainly not one to be afraid of zeros; I&amp;#39;m much more interested in the value.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What is this solution doing for the business? &lt;/li&gt;
&lt;li&gt;Is there a practice in place for tracking ROI over time? &lt;/li&gt;
&lt;li&gt;How soon can it begin providing value? &lt;/li&gt;
&lt;li&gt;Can it provide even more value? &lt;/li&gt;
&lt;li&gt;It is possible to reduce cost and drive the equation even higher? &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;This is why I love my job at Pop Art. Driving value higher and then swooping back to cut costs with new technology that makes me more productive. Value will often come in several forms including cash value, brand value and community value. In any case, it all starts with that equation.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2157" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/Software/default.aspx">Software</category></item><item><title>Double Hop Disaster</title><link>http://blogs.popart.com/andrew-hay/archive/2007/11/10/double-hop-disaster.aspx</link><pubDate>Sat, 10 Nov 2007 16:57:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:2156</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=2156</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2007/11/10/double-hop-disaster.aspx#comments</comments><description>&lt;p&gt;I was working with a web service client that talked to SharePoint this week. I wrote a quick Silverlight app that extracted a list of tasks out of a SharePoint list. I love how simple this is to tap into:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;a href="http://sharepoint.yourcompany.com/_vti_bin/lists.asmx"&gt;http://sharepoint.yourcompany.com/_vti_bin/lists.asmx&lt;/a&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The previous URL will show the path to one of the web services provided out-of-the-box by SharePoint. This particular web service provides several methods for dealing with SharePoint lists. I just needed to call the GetListItems() method and pass in the list name and view name as parameters in order to get my data.&lt;/p&gt;
&lt;p&gt;This worked fine on my local machine, but when I migrated the solution to a staging server, the SharePoint web service refused to send me the data. After a bit of finagling, I realized the web service was happy to talk to my laptop, but it politely declined the remote web server&amp;#39;s request as I lacked the proper credentials. I even was running the web solution with impersonation enabled because I wanted to pass along my Windows credentials during the call from the web server to the remote SharePoint server. I forgot that this is just simply not possible. &lt;/p&gt;
&lt;p&gt;For security reasons, the web server does not hold on to my credentials &amp;quot;just in case&amp;quot; I might want to use them later. In this scenario, I do need them - but no dice. This particular list in SharePoint is locked down tight.&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t have the proper credentials when my web service client fired off a request to SharePoint. When I was running on my local machine, using Casinni, my credentials were readily available. On a remote web server, the credentials vanish. This is called a &amp;quot;Double Hop&amp;quot; problem - the hops are from the browser, to the web server, to another remote web server. The second hop tanked. It was a silly mistake on my part, but hopefully by writing this down now will help me remember sooner next time.&lt;/p&gt;
&lt;p&gt;The code below shows how I solve this problem by manufacturing a credential on-the-fly and then fire off a request to SharePoint. There are multiple ways of solving this problem; I just happened to chose this one.&lt;/p&gt;
&lt;div style="PADDING-RIGHT:0px;PADDING-LEFT:0px;BACKGROUND:#eee;PADDING-BOTTOM:20px;PADDING-TOP:20px;"&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MySharePoint.Lists list = new ProjectBoard.MySharePoint.Lists();&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Credentials = new System.Net.NetworkCredential(&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings[&amp;quot;Credential.Username&amp;quot;],&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings[&amp;quot;Credential.Password&amp;quot;],&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings[&amp;quot;Credential.Domain&amp;quot;]);&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlNode listItemsNode = list.GetListItems(&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings[&amp;quot;LoremIpsum.Guid&amp;quot;], &lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.AppSettings[&amp;quot;LoremIpsum.View.Guid&amp;quot;], &lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null, null, &amp;quot;100&amp;quot;, null, null);&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlNode dataNode = listItemsNode.ChildNodes[1];&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (XmlNode rowNode in dataNode.ChildNodes)&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // extract values here&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now that I&amp;#39;ve got this little prototype functional, I can encrypt the credentials in the web.config file by using &lt;a href="http://msdn2.microsoft.com/en-us/library/ms998280.aspx" target="_blank"&gt;DPAPI&lt;/a&gt;, an encryption tool that makes it easy to protect sensitive information. Since I&amp;#39;m creating new credentials here, I can avoid the Double Hop problem and get on with my prototype.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=2156" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.popart.com/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.popart.com/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.popart.com/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>How I Married Into Mathematics</title><link>http://blogs.popart.com/andrew-hay/archive/2007/09/29/how-i-married-into-math.aspx</link><pubDate>Sat, 29 Sep 2007 20:59:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:1926</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=1926</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2007/09/29/how-i-married-into-math.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;m working on a solution that requires a special type of chart to visualize results from some elaborate number crunching algorithms. &lt;a href="http://www.dundas.com/Gallery/Chart/NET/index.aspx?Img=Circular2" target="_blank"&gt;Dundas Chart for .Net&lt;/a&gt; has an implementation of the standard polar chart.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Dundas Chart for .Net" src="http://www.andrewdothay.net/silverlight/theta/dundas-polar-chart.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the closest &amp;quot;buy&amp;quot; option I could find and it might very well do the job. I&amp;#39;m a big fan of using existing software when it can solve a significant portion of the problem domain. When you find a good off-the-shelf option, they&amp;#39;re often inexpensive and supported (by someone other than me), two big wins right off the bat. The ultimate solution has a few features that are difficult or impossible in the &amp;quot;buy&amp;quot; option, however they might be deemed insignificant. So the &amp;quot;buy&amp;quot; option might very well win out during the upcoming evaluation of my solution, but as part of my due diligence I had to see what the &amp;quot;build&amp;quot; option could offer me. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/silverlight/theta/interknowlogy.png" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Collective Molecular Environment" src="http://www.andrewdothay.net/silverlight/theta/interknowlogy-thumb.png" align="left" border="0" /&gt;&lt;/a&gt;When I first envisioned the solution, I had ideas of 3D modeling like the work described by Tim Huckaby at InterKnowlogy &lt;a href="http://www.interknowlogy.com/lab/Pages/Network.aspx" target="_blank"&gt;for the Scripps Research Institute&lt;/a&gt;. They built a cancer research application called the Collective Molecular Environment.&lt;/p&gt;
&lt;p&gt;Researchers from around the world can review the same&amp;nbsp;model, zoom in, rotate models and insert annotations of their observations. The screenshot to the left shows&amp;nbsp;one of the sample&amp;nbsp;molecule views that comes with the demo. Spinning the molecule around with your mouse is pretty cool.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s written in C# using Windows Presentation Foundation. SharePoint&amp;nbsp;tracks the collaboration on the back end, but its invisible to the user. Researchers just launch the application and start clicking on cells in 3D. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.interknowlogy.com/Downloads/Scripps/IKCME.zip"&gt;Download a demo&lt;/a&gt; of the WPF application and twirl cells around on your own computer. The thing that floors me is that the proof of concept took only six weeks to build. WPF and SharePoint were really put to good use here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/silverlight/theta/musicplasma.png" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="MusicPlasma.com" src="http://www.andrewdothay.net/silverlight/theta/musicplasma-thumb.png" align="right" border="0" /&gt;&lt;/a&gt;Independently, Ben Waldron reminded me of &lt;a href="http://www.musicplasma.com/" target="_blank"&gt;MusicPlasma.com&lt;/a&gt;. You enter a band name and it shows related music artists in a 2D model using Flash.&amp;nbsp;The mash-up&amp;nbsp;pulls information from Amazon.com. When you click on another artist, the map adjusts and they become the new &amp;quot;center of the universe&amp;quot;. Its a cool way of visualizing relational data.&lt;/p&gt;
&lt;p&gt;Then I thought about the specific challenges I would have to solve in order to build the solution myself. I knew my data would have a central point and other points around it at various distances. Related points would have a line connecting them — not all points are related to each other. Each point would also display a short keyword or phrase.&lt;/p&gt;
&lt;p&gt;So, to put it in mathematical terms, I had a center point at (0,0) that was surrounded by multiple invisible circles. The solution had to plot an unknown number of points on the appropriate circle. The size of each point could vary between 40 pixels and 4 pixels in size. The unique phrase beside each point could remain the same size. Finally, related points need a line connecting them.&lt;/p&gt;
&lt;p&gt;I selected Silverlight for my proof-of-concept vehicle. Its a technology that can extend a web page and draw shapes or play video, like Adobe Flash. I first heard of this technology a while back at the &lt;a href="http://visitmix.com/" target="_blank"&gt;MIX06 conference&lt;/a&gt; in Vegas. Silverlight runs on Windows and Mac OS X today and they&amp;#39;ve announced plans to support Linux so there&amp;#39;s no worries about the supported platforms. &lt;/p&gt;
&lt;p&gt;I use XAML or Extensible Application Markup Language to express how the Silverlight component appears on the page. The XAML used in Silverlight is a subset of the XAML used in WPF applications since Silverlight is browser based while WPF apps can take advantage of the full Windows platform. Just like a new version of the Adobe Flash player, you have to download and install the Silverlight component the first time. Then any&amp;nbsp;page on the Internet that uses Silverlight can take advantage of the&amp;nbsp;plugin.&amp;nbsp;It takes less than 60 seconds on standard machine to download the 1MB file and install it. Here&amp;#39;s the button created with 100% XAML just by launching Visual Studio and clicking File, New Project, Silverlight Project. With just pure XML, Silverlight can draw a fancy glossy button. Pretty cool.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Silverlight Sample" src="http://www.andrewdothay.net/silverlight/theta/silverlight-file-new.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;Now my problem was the math. How could I calculate the points on a circle? So I headed straight to The Wife; a number crunching machine with more degrees than that Nick Lachey&amp;#39;s boy band.&lt;/p&gt;
&lt;p&gt;The Wife &lt;strike&gt;taught&lt;/strike&gt; reminded me about some fundamental principles of algebra and geometry. As she tells it, this is sophomore/junior level high school stuff. First, I needed to calculate the central angle between two consecutive points. We&amp;#39;ll call that theta. As it turns out, it doesn&amp;#39;t matter where the points are, providing they lie on the same circle. For starters, I just wanted an even distribution, so if &amp;quot;n&amp;quot; equals the number of points on the circle then (2pi)/n gives me theta.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Calculating Theta" src="http://www.andrewdothay.net/silverlight/theta/theta.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;Next, I need to start calculating the exact (x,y) coordinates of the points on the circle. The first point is easy, its just (r,0) where &amp;quot;r&amp;quot; is the radius of the circle. &lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Calculating Points on a Circle" src="http://www.andrewdothay.net/silverlight/theta/point1.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;The second point is a little tougher as it gets into sine and cosine. These are just names for ratios in a triangle. The mnemonic SOHCAHTOA helps you remember this on quiz day. Let&amp;#39;s look at a following right triangle. &lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Right Triangle" src="http://www.andrewdothay.net/silverlight/theta/right-triangle.png" border="0" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sine is calculated as &amp;quot;opposite over hypotenuse&amp;quot;, or the &amp;quot;SOH&amp;quot; part of the mnemonic &lt;/li&gt;
&lt;li&gt;Cosine is calculated as &amp;quot;adjacent over hypotenuse&amp;quot;, or the &amp;quot;CAH&amp;quot; part of the mnemonic &lt;/li&gt;
&lt;li&gt;Just for good measure, the tangent is &amp;quot;opposite over adjacent&amp;quot;, the &amp;quot;TOA&amp;quot; part &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Now that I have all the ingredients, I can bake my pi. Ha! Ok, onto the task of plotting the points. The second and subsequent (x,y) values of my points are calculated by the following formulas.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;P&lt;sub&gt;0&lt;/sub&gt; = (r,0) &lt;/li&gt;
&lt;li&gt;P&lt;sub&gt;1&lt;/sub&gt; = (r(cos(θ), r(sin(θ)) &lt;/li&gt;
&lt;li&gt;P&lt;sub&gt;2&lt;/sub&gt; = (r(cos(2θ), r(sin(2θ)) &lt;/li&gt;
&lt;li&gt;P&lt;sub&gt;3&lt;/sub&gt; = (r(cos(3θ), r(sin(3θ)) &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;For the &amp;quot;x&amp;quot; coordinate, I multiply the radius by the cosine of theta. The cosine of theta is &amp;quot;b&amp;quot; divided by &amp;quot;c&amp;quot;. For the &amp;quot;y&amp;quot; coordinate, I multiply the radius by the sine of theta. The sine of theta is &amp;quot;a&amp;quot; divided by &amp;quot;c&amp;quot;. In case its not obvious,&amp;nbsp; the P&lt;sub&gt;2&lt;/sub&gt; and subsequent points need multiples of theta, so the formula has that minor adjustment.&lt;/p&gt;
&lt;p&gt;To apply this information, I created a simple XML file with some elements that define the number of points to draw and some supporting information. I&amp;#39;ll just focus on a single circle or level for now. If I can make one, I can make more really fast.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="XML Data Source" src="http://www.andrewdothay.net/silverlight/theta/xml-inverted-transparent.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;Next, I created a simple ASP.Net page that reads the XML file and outputs the necessary XAML that will allow Silverlight to draw the chart.&amp;nbsp;My C#&amp;nbsp;code iterates over the list of elements in the XML file can calculates the (X,Y) coordinates using the previous formulas. Just to keep things simple, I linked all the points to the center for now. Later on, it&amp;#39;ll be easy enough to link other points together with lines as I have already calculated all of the necessary (X,Y) values. You can download my solution through the link at the bottom of the post.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.andrewdothay.net/silverlight/theta/xaml-output.png" target="_blank"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="XAML Output" src="http://www.andrewdothay.net/silverlight/theta/xaml-output-thumb.png" align="right" border="0" /&gt;&lt;/a&gt;This XAML block produces the following output in Silverlight shown below.&amp;nbsp;As you can see, XAML is just a special XML syntax that is pretty easy to pick up. &lt;/p&gt;
&lt;p&gt;To draw an ellipse shape, you add the &amp;lt;ellipse /&amp;gt; element. To draw a line on the canvas, you add an &amp;lt;line /&amp;gt; element. Of course there&amp;nbsp;is tooling available&amp;nbsp;to abstract these details away, but its important to have a fundamental understanding of the work going on under the covers.&lt;/p&gt;
&lt;p&gt;Silverlight translates the XAML markup into pretty images as shown below.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" alt="Silverlight Custom Chart" src="http://www.andrewdothay.net/silverlight/theta/result-inverted.png" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;If this &amp;quot;build&amp;quot; solution turns out to be a winner, we&amp;#39;ll be able to apply nice gradients to the images, add click() events to the bubbles so more information is available through a pop-up and maybe even add the &amp;quot;wet floor&amp;quot; look the feels so cliche these days. These are easy enough in Silverlight, so I didn&amp;#39;t spend anytime on the glossy extras just yet. &lt;/p&gt;
&lt;p&gt;So, my entire exploration of the &amp;quot;build&amp;quot; option in Silverlight took about two hours, including the time spent with The Wife — time well spent, indeed. It&amp;#39;ll be interesting to see how the evaluation of my solution options pan out. Can you tell I love my job?&lt;/p&gt;
&lt;p align="center"&gt;&lt;a href="http://www.andrewdothay.net/silverlight/theta/solution.zip"&gt;Download the solution&lt;/a&gt; described in this blog post.&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=1926" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/pop+art/default.aspx">pop art</category><category domain="http://blogs.popart.com/tags/XAML/default.aspx">XAML</category><category domain="http://blogs.popart.com/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.popart.com/tags/Software/default.aspx">Software</category><category domain="http://blogs.popart.com/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.popart.com/tags/.Net/default.aspx">.Net</category></item><item><title>Ain't No Party Like A Pop Art Party!</title><link>http://blogs.popart.com/andrew-hay/archive/2007/09/23/ain-t-no-party-like-a-pop-art-party.aspx</link><pubDate>Sun, 23 Sep 2007 21:48:00 GMT</pubDate><guid isPermaLink="false">0cadb8f9-e248-4ad2-9ef7-fb879747d684:1892</guid><dc:creator>Andrew Hay</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.popart.com/andrew-hay/rsscomments.aspx?PostID=1892</wfw:commentRss><comments>http://blogs.popart.com/andrew-hay/archive/2007/09/23/ain-t-no-party-like-a-pop-art-party.aspx#comments</comments><description>&lt;p&gt;Ten Years! Wooo-Whooo!! &lt;/p&gt;
&lt;p&gt;and I&amp;#39;ve been here for half of &amp;#39;em!&lt;/p&gt;&lt;img src="http://blogs.popart.com/aggbug.aspx?PostID=1892" width="1" height="1"&gt;</description><category domain="http://blogs.popart.com/tags/party/default.aspx">party</category></item></channel></rss>