<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Kennydust</title>
        <description>Thoughts from a C# Developer</description>
        <link>/site.aspx/rss</link>
        <language>en</language>
        <image>
            <url>http://www.kennydust.com/Content/icons/flame.png</url>
            <title>Kennydust</title>
            <link>/site.aspx/rss</link>
            <width>64</width>
            <height>64</height>
        </image>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Concatenating multiple row data into a single row in SQL Server.</title>
            <description>In one of my recent projects, I needed to combine multiple row data values into a single one-liner. No idea about performance, but I leveraged the FOR XML PATH for my example.. Thanks to this &lt;a href=&quot;http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt; for the tip.

&lt;pre class=&quot;brush: sql;&quot;&gt;
USE AdventureWorks 
GO 
 
SELECT 
    CustomerID, 
    SalesOrderIDs = REPLACE( 
        ( 
            SELECT 
                SalesOrderID AS [data()] 
            FROM 
                Sales.SalesOrderHeader soh 
            WHERE 
                soh.CustomerID = c.CustomerID 
            ORDER BY 
                SalesOrderID 
            FOR XML PATH ('') 
        ), ' ', ',') 
FROM 
    Sales.Customer c 
ORDER BY 
    CustomerID
&lt;/pre&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Concatenating-multiple-row-data-into-a-single-row-in-SQL-Server</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Concatenating-multiple-row-data-into-a-single-row-in-SQL-Server</guid>
            <pubDate>Wed, 19 Jan 2011 20:01:00 GMT</pubDate>
            <category>SQLServer</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Identifying and diagnosing SQL Server bottlenecks</title>
            <description>&lt;p&gt;In a job where you’re responsible for an application and how it performs, the worst thing that can happen is waking up to an email chain from management, detailing how the application is sluggish, unresponsive and in short, broken. You are to be blamed; finger pointing is running at an all-time high and you’ve just caught up to your 20th email.&lt;/p&gt;
&lt;p&gt;Has this ever happened to you?  It’s pretty much an engineer’s worst nightmare. Things happen unfortunately, and you need to track it down.&lt;/p&gt;
&lt;p&gt;A situation like that arose recently, and it was narrowed down to it being database related. However, in an environment where there's thousands of stored procedures, countless amount of indexes and an application where there's millions of lines of code; identifying the underlining issue is somewhat of a daunting task. &lt;/p&gt;
&lt;p&gt;I’ve done these level of diagnosis a handful of times, and normally I would load up SQL Server Profiler (on production) to try to capture the events that are happening real time.  Well over a half-hour or an hours’ worth of data is then dumped into a table and quickly gleam over it, sorting it by duration. However, being that I only have a basic understanding of this, I needed more insight. So I came across a few posts which takes it further and really breaks down how to best go about that tool and really identify the meat of the data you've just traced:&lt;/p&gt;

&lt;p&gt;
&lt;A href=&quot;http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-1/&quot; target=&quot;_blank&quot;&gt;Finding the Causes of Poor Performance in SQL Server, Part 1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
&lt;A href=&quot;http://www.simple-talk.com/sql/performance/finding-the-causes-of-poor-performance-in-sql-server,-part-2/&quot; target=&quot;_blank&quot;&gt;Finding the Causes of Poor Performance in SQL Server, Part 2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Referencing Part 1, I had to add the “procedurename” column into that trace table since the trace program does not create it for you out of the gate.&lt;/p&gt;
&lt;p&gt;
The textdata column is an ntext type,  so it needs to be converted to a varchar(max) column type in order for the update procedure to work.&lt;/p&gt;

&lt;pre class=&quot;brush: sql;&quot;&gt;
UPDATE prod11192010_b
   SET ProcedureName = 
   LEFT(
      RIGHT(TextData, LEN(TextData) - CHARINDEX(' ',TextData, CHARINDEX('Exec',TextData))),
      CHARINDEX(' ', RIGHT(TextData, LEN(TextData) - CHARINDEX(' ',TextData, CHARINDEX('Exec',TextData))) + ' ')
   )
where TextData like '%exec%'
&lt;/pre&gt;

&lt;p&gt;and the best part… good data.&lt;/p&gt;
&lt;pre class=&quot;brush: sql;&quot;&gt;
select top(10) procedurename, sum(duration) as timeimpact, sum(reads) as IOImpact, sum(cpu) as cpuimpact,
count(*) as executioncount
from prod11192010_b
group by procedurename
order by timeimpact desc
&lt;/pre&gt;
&lt;p&gt;
to be continued.
&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Identifying-and-diagnosing-SQL-Server-bottlenecks</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Identifying-and-diagnosing-SQL-Server-bottlenecks</guid>
            <pubDate>Fri, 19 Nov 2010 16:01:00 GMT</pubDate>
            <category>performance</category>
            <category>SQLServer</category>
            <category>bottlenecks</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Microsoft AJAX CDN for ASP.NET 3.5</title>
            <description>&lt;p&gt;Late last year, &lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2009/09/15/announcing-the-microsoft-ajax-cdn.aspx&quot; target=&quot;_blank&quot;&gt;Microsoft announced&lt;/a&gt; the launch of their caching support service aka their &lt;a href=&quot;http://www.asp.net/ajaxlibrary/CDN.ashx&quot; target=&quot;_blank&quot;&gt;CDN service&lt;/a&gt;, for their ASP.NET AJAX libraries (and the third party jquery libraries) at no cost. Sweet!&lt;/p&gt;  &lt;p&gt;The problem was, you needed to be up-to-date on ASP.NET 4.0 framework stack in order to take advantage of it. Luckily, the community banned together in an uproar, and shortly thereafter a fix was released. While it’s practically plug-and-play if you’ve running ASP.NET 4.0, some custom code is required to get it to work correctly in the 3.5 framework. I ran across an excellent &lt;a href=&quot;http://blog.turlov.com/2009/11/using-microsoft-ajax-library-35-with.html&quot; target=&quot;_blank&quot;&gt;blog&lt;/a&gt; about this, and it details much more than I was looking for.&lt;/p&gt;  &lt;p&gt;To paraphrase, you need to define a &amp;lt;script&amp;gt; region in your scriptmanager instance and hardcode the CDN path, this will override the default local script reference location:&lt;/p&gt;  

&lt;pre class=&quot;brush: xml;&quot;&gt;
&lt;asp:scriptmanager runat=&quot;server&quot; enablepartialrendering=&quot;false&quot;&gt;
  &lt;scripts&gt;           
    &lt;asp:scriptreference name=&quot;MicrosoftAjax.js&quot; path=&quot;http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js&quot; /&gt;
  &lt;/scripts&gt;  
&lt;/asp:ScriptManager&gt;
&lt;/pre&gt;

&lt;p&gt;I wanted to encapulate the logic a little better, so I wrote a small control that inherits the scriptmanager, and conditionally loads from the CDN, because I work without an internet connection at times:&lt;/p&gt;
&lt;pre class=&quot;brush: c#;&quot;&gt;
    public class CustomScriptManagerControl : ScriptManager
    {
        /// &lt;summary&gt;
        /// Microsoft Ajax 3.5 reference.
        /// &lt;/summary&gt;
        private const string CDN_PATH = &quot;http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js&quot;;

        protected override void OnInit(EventArgs e)
        {

#if !DEBUG
            Scripts.Add(new ScriptReference { Name = &quot;MicrosoftAjax.js&quot;, Path = CDN_PATH });
#endif

            base.OnInit(e);
        }
    }
&lt;/pre&gt;

&lt;p&gt;this is called in my consuming page:&lt;/p&gt;
&lt;pre class=&quot;brush: xml;&quot;&gt;
&lt;c:CustomScriptManagerControl runat=&quot;server&quot; EnablePartialRendering=&quot;true&quot; /&gt;
&lt;/pre&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Microsoft-AJAX-CDN-for-ASPNET-35</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Microsoft-AJAX-CDN-for-ASPNET-35</guid>
            <pubDate>Tue, 02 Mar 2010 18:39:00 GMT</pubDate>
            <category>AJAX</category>
            <category>CDN</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Developing iPhone apps in C# and .NET</title>
            <description>&lt;p&gt;Last Month, Novell became the first provider to offer a &lt;a href=&quot;http://www.novell.com/news/press/novell-releases-first-solution-to-build-iphone-applications-using-c-and-microsoft-net-languages&quot; target=&quot;_blank&quot;&gt;solution&lt;/a&gt; for writing iPhone apps in the C# .NET stack. Being a C# Microsoft .NET developer, I immediately became excited -- but then I started reading about it, and my excitement soon soured; their offering is called &lt;a href=&quot;http://monotouch.net/&quot; target=&quot;_blank&quot;&gt;monotouch&lt;/a&gt;, and it costs $399 for a basic license – yikes! and it requires a mac for development (boooo). Give me something I can use, please. &lt;/p&gt; &lt;p&gt;There is an &lt;a href=&quot;http://monotouch.net/DownloadTrial&quot; target=&quot;_blank&quot;&gt;evaluation version&lt;/a&gt;, but it’s limited to development on an iPhone simulator though. Not sure on how many days you can “evaulate” the product for however.&lt;/p&gt;  &lt;p&gt;Prior to, iPhone app development was limited to complex c and Object-c on the mac, using&amp;#160; &lt;a href=&quot;http://developer.apple.com/iphone/&quot; target=&quot;_blank&quot;&gt;Apple’s iPhone SDK&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://mono-project.com/files/thumb/b/b4/180px-Monocatalog.png&quot; alt=&quot;iPhone&quot;/&gt;&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Developing-iPhone-apps-in-C-and-NET</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Developing-iPhone-apps-in-C-and-NET</guid>
            <pubDate>Wed, 28 Oct 2009 17:16:00 GMT</pubDate>
            <category>iphone</category>
            <category>CSharp</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Visual Studio 2008: Clean up your “Recent Projects Sidebar”</title>
            <description>&lt;p&gt;As a developer, you create many projects and open many more third party projects files over the course of your development career. In doing so however, your “Recent Projects” sidebar in the startpage in VS 2008 becomes cluttered with some things that end up being temporary anyways. Here’s how to clean it up:&lt;/p&gt;  &lt;p&gt;Open regedit.&lt;/p&gt;  &lt;p&gt;Navigate through the registry to this spot: 

&lt;pre class=&quot;brush: text;&quot;&gt;
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList
&lt;/pre&gt;

&lt;/p&gt;  

&lt;p&gt;and you’ll see a list that looks similar to this:&lt;/p&gt;  

&lt;pre class=&quot;brush: text;&quot;&gt;
File1 Reg_Expand_Sx Path
File2 Reg_Expand_Sx Path 
File3 Reg_Expand_Sx Path
File4 Reg_Expand_Sx Path
&lt;/pre&gt;
&lt;p&gt;You need to delete the values you don’t want, and then rename all the remaining ones (that you want to keep) in sequential order, while ensuring there are no gaps in between.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Visual-Studio-2008-Clean-up-your-Recent-Projects-Sidebar</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Visual-Studio-2008-Clean-up-your-Recent-Projects-Sidebar</guid>
            <pubDate>Wed, 14 Oct 2009 12:57:00 GMT</pubDate>
            <category>VisualStudio</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Lambda Expressions</title>
            <description>&lt;p&gt;This just in: &lt;a href=&quot;http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx&quot; target=&quot;_blank&quot;&gt;Lambda Expressions&lt;/a&gt; are cool.&lt;/p&gt;  &lt;p&gt;Yes, I'm a tad late, given that this language feature has been around for some time (introduced originally in .net 3.0, and packaged in .net 3.5). But to my defense, I have these reasons: (1) There wasn’t a need for it on my end, (2) I was working in a .net 2.0 shop, (3) There were so many feature enhancements that this particular one flew under the radar.&lt;/p&gt;  &lt;p&gt;Fast forward to today, I've written my first lambda expression and wish to share it.&lt;/p&gt;  
&lt;p&gt;So what are lambda expressions? In my own words, they are just another way of writing code statements; a shorthand way of encapsulating logic. They can be &quot;expressions&quot; and &quot;statements&quot;, and can be assigned to a delegate type. A lambda expression contains a &quot;lambda operator,&quot; =&gt;, with the left side of the expression responsible for handling input and the right side containing logic:&lt;/p&gt;

&lt;pre class=&quot;brush: c-sharp;&quot;&gt;
  //assuming x equates to a value of 10
  x =&gt; x + x;

  (10) =&gt; (10) + (10) //equals 20
&lt;/pre&gt;

&lt;p&gt; Below are a few examples I've put together, they are pretty simplified, but it demonstrates how powerful lambda expressions can be. The challenge? Given some DateTime value, perform a comparison to see whether or not this value has exceeded 24 hours.&lt;/p&gt;  

&lt;p&gt;To start, here’s the original snippet that was coded up.&lt;/p&gt;  

&lt;pre class=&quot;brush: c-sharp;&quot;&gt;
DateTime expiredTime = DateTime.Parse(&quot;1/1/2009&quot;); 
DateTime adjustedTime = DateTime.Now.AddHours(-24);

//original statement 
int comparsionResult = DateTime.Compare(adjustedTime, expiredTime); 
bool isExpired = (comparsionResult &amp;gt; 0);
&lt;/pre&gt;

&lt;p&gt;It's pretty straight forward and it does the job. But we want lambda expressions. Here's an example of that, with an expression that's assigned to a delegate type that expects one input:&lt;/p&gt;

&lt;pre class=&quot;brush: c-sharp;&quot;&gt;
delegate bool del(DateTime t); 
static void Main(string[] args)
{
   DateTime expiredTime = DateTime.Parse(&quot;1/1/2009&quot;); 
   DateTime adjustedTime = DateTime.Now.AddHours(-24);

   del comparisonDel = x =&gt; (DateTime.Compare(adjustedTime, x) &gt; 0);
   bool isExpired = comparisonDel(expiredTime);
}
&lt;/pre&gt;


&lt;p&gt;The second example demostrates wrapping a lambda expression in a Func&lt;&gt; generic delegate.&lt;/p&gt;
&lt;pre class=&quot;brush: c-sharp;&quot;&gt;
DateTime expiredTime = DateTime.Parse(&quot;1/1/2009&quot;); 
DateTime adjustedTime = DateTime.Now.AddHours(-24);

 //Lambda Expression Wrapped in a Func&lt;&gt;
Func&lt;DateTime, bool&gt; ComparisonCheck = x =&gt; (DateTime.Compare(adjustedTime, x) &gt; 0);
bool isExpired = ComparisonCheck(expiredTime);
&lt;/pre&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Lambda-Expressions</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Lambda-Expressions</guid>
            <pubDate>Wed, 05 Aug 2009 15:11:00 GMT</pubDate>
            <category>Code</category>
            <category>CSharp</category>
            <category>DotNet</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Windows Vista and the permissions prompts</title>
            <description>&lt;p&gt;For all of you vista users... are you sick of this?&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/downloads/user_account_control.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Chances are, you are; for Vista throws up security prompts for the all programs they classify as a security risk. I know I get pretty frustrated at times, and I’m considered an “Administrator” of my own machine.&lt;/p&gt;  &lt;p&gt;Here’s a &lt;a href=&quot;http://www.vistax64.com/tutorials/80938-user-account-control-uac-elevate-privilege-level.html&quot; target=&quot;_blank&quot;&gt;helpful link&lt;/a&gt; to make those prompts disappear.&lt;/p&gt;  &lt;p&gt;HTH&lt;/p&gt;  &lt;p&gt;-Kennydust&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Windows-Vista-and-the-run-as-administrator-prompts</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Windows-Vista-and-the-run-as-administrator-prompts</guid>
            <pubDate>Tue, 28 Jul 2009 18:23:00 GMT</pubDate>
            <category>vista</category>
            <category>security</category>
            <category>administrator</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>From Graffiti to Oxite</title>
            <description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;So I've moved off of &lt;a href=&quot;http://graffiticms.com/&quot; target=&quot;_blank&quot;&gt;Graffiti CMS&lt;/a&gt; and migrated my blog posts (via BlogML) to &lt;a href=&quot;http://oxite.codeplex.com/&quot; target=&quot;_blank&quot;&gt;Oxite&lt;/a&gt; -- Microsoft's open source blogging platform. &lt;/p&gt;  &lt;p&gt;As much as I wanted to love Graffiti, I wasn't a huge fan of VistaDB; I've even heard rumors that the product's been dropped by Telligent earlier this year. But mainly as a developer, what I really wanted was full control -- so switching to Oxite seemed like a natural progression.. and it's packed with lots of goodies -- including &lt;a href=&quot;http://www.asp.net/mvc/&quot; target=&quot;_blank&quot;&gt;MVC&lt;/a&gt;, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/cc468366.aspx&quot; target=&quot;_blank&quot;&gt;Unity&lt;/a&gt; and &lt;a href=&quot;http://www.codeplex.com/AntiXSS&quot; target=&quot;_blank&quot;&gt;AntiXSS&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;It wouldn't be a good product without all the problems, so getting started was a bit challenging. Right off the bat, there were 404 errors all over the place -- and found out that the application requires a special URL prefix in order for it to work in IIS6. &lt;/p&gt;  

&lt;img src=&quot;/files/media/image/WindowsLiveWriter/GraffitiToOxite/siteaspx.jpg&quot; style=&quot;border: 1px solid #000;&quot; /&gt;
&lt;p&gt;Shortly thereafter I started witnessing permission issues when referencing one of the third party assembly. But no big deal, downloaded the source, marked that assembly.info file with the AllowPartiallyTrustedCallersAttribute and I was up and running.&lt;/p&gt;  &lt;p&gt;Since I'm on this new platform, will this mean more posts in the future? I'm not so sure, but I'll certainly have a reason to play with the MVC framework now:) I am rather disappointed that images cannot be posted through the metaweblog API at the moment, looks like I'll have to manually move them over (like I did for this post). &lt;/p&gt;

&lt;p&gt;
Non oxite users that are having issues with II6 and MVC should read this &lt;a href=&quot;http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx&quot;&gt;blog post&lt;/a&gt;.
&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/From-Graffiti-to-Oxite</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/From-Graffiti-to-Oxite</guid>
            <pubDate>Fri, 12 Jun 2009 13:41:00 GMT</pubDate>
            <category>graffiticms</category>
            <category>microsoft</category>
            <category>oxite</category>
            <category>mvc</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Dancing around with XQuery and SQL Server - Part 2</title>
            <description>&lt;p&gt;This is a follow up on a &lt;a target=&quot;_self&quot; href=&quot;http://kennydust.com/tech/sql/dancing-around-with-xquery-and-sql-server-part-1/&quot;&gt;prior post&lt;/a&gt; I've made a few months back on XQuery, with the purpose of this post to just show a few more examples on how powerful XML and XQuery can be -- with no additional overhead costs.&amp;nbsp; If implemented correctly, you can even get better performance gains; but I'll possibly discuss that in a future offering. For this segment, I wanted to&amp;nbsp;document the common usages I've come across lately, and refer to it later on as a refresher.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example 1&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;So, you've got xml data, and the structure looks as such:&lt;/p&gt;
&lt;pre class=&quot;brush: xml;&quot;&gt;
&lt;metadata&gt;
    &lt;item&gt;
        &lt;key&gt;key1&lt;/key&gt;
        &lt;value&gt;value1&lt;/value&gt;
    &lt;/item&gt;
    &lt;item&gt;
        &lt;key&gt;key2&lt;/key&gt;
        &lt;value&gt;value2&lt;/value&gt;
    &lt;/item&gt;
&lt;/metadata&gt;
&lt;/pre&gt;
&lt;p&gt;To query this data, we do something like this:&lt;/p&gt;

&lt;pre class=&quot;brush: sql;&quot;&gt;
declare @xml xml
set @xml = N'
&lt;metadata&gt;
&lt;item&gt;&lt;key&gt;key1&lt;/key&gt;&lt;value&gt;value1&lt;/value&gt;&lt;/item&gt;
&lt;item&gt;&lt;key&gt;key2&lt;/key&gt;&lt;value&gt;value2&lt;/value&gt;&lt;/item&gt;
&lt;item&gt;&lt;key&gt;key3&lt;/key&gt;&lt;value&gt;value3&lt;/value&gt;&lt;/item&gt;&lt;/metadata&gt;
'
select 
metadata.[item].value('key[1]', 'nvarchar(25)') as [key],
metadata.[item].value('value[1]', 'nvarchar(max)') as [value],
metadata.[item].value('value[1]', 'nvarchar(25)') as [valueShort]
from @xml.nodes('/metadata/item') metadata ([item])

&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;brush: plain;&quot;&gt;
key                       value                     valueShort
------------------------- ------------------------- -------------------------
key1                      value1                    value1
key2                      value2                    value2
key3                      value3                    value3

(3 row(s) affected)


&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Example 2&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;If you're an attribute guy (or gal), here's one that'll work too:&lt;/p&gt;

&lt;pre class=&quot;brush: sql;&quot;&gt;
declare @xml xml
set @xml = N'
&lt;metadata&gt;
&lt;item key=&quot;key1&quot; value=&quot;value1&quot; /&gt;
&lt;item key=&quot;key2&quot; value=&quot;value2&quot; /&gt;
&lt;item key=&quot;key3&quot; value=&quot;value3&quot; /&gt;
&lt;/metadata&gt;
'

select metadata.[item].query('data(@key)').value('.', 'nvarchar(25)') as [key]
,metadata.[item].query('data(@value)').value('.', 'nvarchar(max)') as [value]
,metadata.[item].query('data(@value)').value('.', 'nvarchar(25)') as [valueshort]
from @xml.nodes('/metadata/item') metadata ([item])
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;brush: plain;&quot;&gt;
key                       value                     valueshort
------------------------- ------------------------- -------------------------
key1                      value1                    value1
key2                      value2                    value2
key3                      value3                    value3

(3 row(s) affected)

&lt;/pre&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Kennydust&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Dancing-around-with-XQuery-and-SQL-Server-Part-2</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Dancing-around-with-XQuery-and-SQL-Server-Part-2</guid>
            <pubDate>Thu, 04 Jun 2009 14:56:00 GMT</pubDate>
            <category>SQLServer</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Visual Studio 2008: Tracking active item in the Solution Explorer</title>
            <description>&lt;p&gt;I've recently made the switch to VS 2008 and noticed that the active file is not highlighted in the docked solution explorer. Being that I work with multiple projects and countless hundreds of class files -- this became somewhat cumbersome; it's necessary for me refer to the file hierarchy and the current project 30% of the time. After some digging around, I discovered that VS 2008 does not enable this feature by default (this was the case for VS 2005); In order to fix this, you need to go into the Tools -&amp;gt; Options -&amp;gt; Projects and Solutions and check off the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/VisualStudio2008TrackingactiveitemintheS_B7A7/focus_4.png&quot;&gt;&lt;img style=&quot;border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px&quot; height=&quot;252&quot; alt=&quot;focus&quot; width=&quot;508&quot; border=&quot;0&quot; src=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/VisualStudio2008TrackingactiveitemintheS_B7A7/focus_thumb_1.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Visual-Studio-2008-Tracking-active-item-in-the-Solution-Explorer</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Visual-Studio-2008-Tracking-active-item-in-the-Solution-Explorer</guid>
            <pubDate>Wed, 20 May 2009 13:04:00 GMT</pubDate>
            <category>VisualStudio</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Facebook Connect -- for the iPhone</title>
            <description>&lt;p&gt;Facebook is stretching their limits of their social reach beyond the web, and onto your iphone. Now, custom apps can be facebook aware, and allow&amp;nbsp;for iphone owners to log-in&amp;nbsp;to facebook, leveraging the facebook connect service.&lt;/p&gt;
&lt;p&gt;For those of you who are not familiar with facebook connect, the original offering was web based&amp;nbsp;only;&amp;nbsp;conceived sometime last year and it allowed any web site to have some user integration with facebook, while allowing access to it's social features via it's API and proprietary markup language. Now with an iPhone offering, it gives the user more reason to stay on the very popular social networking site -- even without being on the social networking site.&lt;/p&gt;
&lt;p&gt;More information about &lt;a target=&quot;_blank&quot; href=&quot;http://developers.facebook.com/connect.php&quot;&gt;facebook connect here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you are interested in developing iPhone applications leveraging facebook connect, here is the &lt;a target=&quot;_blank&quot; href=&quot;http://svn.facebook.com/svnroot/platform/clients/packages/fbconnect-iphone.zip&quot;&gt;link to their starter kit&lt;/a&gt;. Documentation &lt;a target=&quot;_blank&quot; href=&quot;http://wiki.developers.facebook.com/index.php/Facebook_Connect_for_iPhone&quot;&gt;link is here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class=&quot;wlWriterSmartContent&quot; id=&quot;scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:05984887-5da5-4975-a255-d9504c56df1d&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;
&lt;div&gt;&lt;object width=&quot;400&quot; height=&quot;225&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://vimeo.com/moogaloop.swf?clip_id=3616452&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; /&gt;&lt;embed src=&quot;http://vimeo.com/moogaloop.swf?clip_id=3616452&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;400&quot; height=&quot;225&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;a href=&quot;http://vimeo.com/3616452&quot;&gt;How To: Implement Facebook Connect on the iPhone in 5 minutes&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user1326423&quot;&gt;Cat Lee&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Read the original announcement on their &lt;a target=&quot;_blank&quot; href=&quot;http://developers.facebook.com/news.php?blog=1&amp;amp;story=213&quot;&gt;developer blog&lt;/a&gt;.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Facebook-Connect-for-the-iPhone</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Facebook-Connect-for-the-iPhone</guid>
            <pubDate>Wed, 18 Mar 2009 14:55:00 GMT</pubDate>
            <category>ThirdParty</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Commenting with Facebook's standalone widget</title>
            <description>&lt;p&gt;Last week, Facebook &lt;a target=&quot;_blank&quot; href=&quot;http://developers.facebook.com/news.php?blog=1&amp;amp;story=198&quot;&gt;released it's new Comment Box social&amp;nbsp;widget&lt;/a&gt; which allows a developer to add&amp;nbsp;threaded comment&amp;nbsp;functionality to any site they want. It literally took me less than 5 minutes to slap it all together; and maybe if I didn't read stop to read all the itty bitty details, it probably would of taken me half that time. I must say, I'm pretty impressed -- it integrates well with my own site, and it looks slick. Facebook's widget&amp;nbsp;allows allows for anonymous comments, so you don't necessarily need to be facebook user in order to submit your 2 cents.&lt;/p&gt;
&lt;p&gt;So wow, I'm pretty excited, if that isn't pretty obvious. Also included in the widget is a fully functional administration tool to remove comments, blacklist users and all sorts of fun stuff. The developer can also limit the posts per page and further customizations via the &lt;a target=&quot;_blank&quot; href=&quot;http://wiki.developers.facebook.com/index.php/Fb:comments_%28XFBML%29&quot;&gt;XFBML spec&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Check it out, just scroll to the bottom to see their comment interface. Leave a comment if you wish too.&lt;/p&gt;
&lt;p&gt;&lt;object width=&quot;400&quot; height=&quot;225&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://vimeo.com/moogaloop.swf?clip_id=3289354&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; /&gt;&lt;embed src=&quot;http://vimeo.com/moogaloop.swf?clip_id=3289354&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;400&quot; height=&quot;225&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://vimeo.com/3289354&quot;&gt;How To: Create a Comments Box with Facebook Connect in 5 Minutes&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/user1326554&quot;&gt;Pete Bratach&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

EDIT (1/14/2010): Here's the &lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Comments_Box&quot;&gt;link to the Comment's box wiki&lt;/a&gt; for more advance settings and parameters. One issue I ran into was getting the box to render, but thats only because facebook requires a valid callback URL.</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Commenting-with-Facebooks-standalone-widget</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Commenting-with-Facebooks-standalone-widget</guid>
            <pubDate>Mon, 23 Feb 2009 20:25:00 GMT</pubDate>
            <category>ThirdParty</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Validation Application Block</title>
            <description>&lt;p&gt;How many hours during the day do you sit around and write validation code?&amp;nbsp; Way to many to count, if I'm reading your mind. Validation is pretty common it's in usage that it occurred to me that I needed some sort of compact way of encapsulating rules and business logic. So on my train ride home, I thought to myself -- &amp;quot;Gee, I guess I could create validation attributes, and decorate my properties!&amp;quot; I really thought I was brilliant, and somewhat innovative, but lo and behold, I get home and discover there's already an application block written for just that purpose. So I'm going to entertain myself by writing a use case for this, and post code at the end.&lt;/p&gt;
&lt;p&gt;Here's the beauty of the application block: It's flexible. You can decorate your class entities with validation attributes, or validate primitive data types or objects. You can also set up rules via XML, and there's support for ASP.NET, Windows Forms and WCF.&lt;/p&gt;
&lt;p&gt;Here's what we would do traditionally:&lt;/p&gt;

&lt;pre class=&quot;brush: c-sharp;&quot;&gt;

if (String.IsNullOrEmpty(Textbox1.Text))
{
    throw new ArgumentNullException(&quot;No text specified!!&quot;);
} else {

    Foo f = new Foo();
    f.bar = TextBox1.Text;
}


&lt;/pre&gt;
&lt;p&gt;Here's how we can solve that with the VAB in code:&lt;/p&gt;

&lt;pre class=&quot;brush: c-sharp;&quot;&gt;

StringValidator v = new StringValidator(1, 10);
v.Validate(Textbox1.Text);

//validator would blow up if invalid.. and not execute the next line
Foo f = new Foo();
f.bar = Textbox1.Text;



&lt;/pre&gt;

&lt;p&gt;Here's an alternative way by decorating the property with an attribute:&lt;/p&gt;

&lt;pre class=&quot;brush: c-sharp;&quot;&gt;

public class Foo
{
    [StringLengthValidator(1, 50)]
    public string bar
    {
        get;set;
    }
}



&lt;/pre&gt;

&lt;p&gt;This is a very simple usage pattern for what the block can really do; there are Validators that can compare dates, enums and even perform regular expressions. Additionally, you can write you own custom validators, and define more finite rules either inline or using configuration files via XML. It really depends on your business requirements and how crazy you want to extend it. But the point is, you no longer need to stick logic in your website tier.. there's already a framework available that should save your some time.&lt;/p&gt;
&lt;p&gt;Here's more information on VAB:&lt;/p&gt;
&lt;p&gt;&lt;a title=&quot;http://msdn.microsoft.com/en-us/library/dd140088.aspx&quot; target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/dd140088.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/dd140088.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download FAB; You can get it as part of the entire Enterprise library that Microsoft releases every now and then:&lt;/p&gt;
&lt;p&gt;&lt;a title=&quot;http://msdn.microsoft.com/en-us/library/cc467894.aspx&quot; target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/cc467894.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/cc467894.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can &lt;a target=&quot;_blank&quot; href=&quot;http://rendermedia.com/downloads/validationweb.zip&quot;&gt;download my sourcecode example here&lt;/a&gt;. Basically the example is a webform for entering your pet information, it performs validation via inline code and makes use of validation attributes. I'm using the Enterprise Library 3.1 - May 2007 version, only because I need .NET framework 2.0 support.&lt;/p&gt;
&lt;p&gt;Happy Coding.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Validation-Application-Block</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Validation-Application-Block</guid>
            <pubDate>Wed, 18 Feb 2009 20:16:00 GMT</pubDate>
            <category>Code</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>So you want to want HTTP Modules and Handlers working with Vista and IIS7, huh?</title>
            <description>&lt;p&gt;HTTP Handlers and modules are necessary components for any given web app. While it's conceivable that a developer may never develop a Handler/Module ever, there may be legacy handlers/modules that may exist or third party applications that requires to use them. More information on &lt;a target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb398986.aspx&quot;&gt;Handlers and Modules here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So recently, I ran into an issue where all of my old .ashx and custom handlers blew up when running under IIS. I had upgraded to Vista from XP and being that the web application was dependant upon alot of Handler calls, this proved to be the latest challenge in the life of my Vista tenure.&lt;/p&gt;
&lt;p&gt;First off, II7 is &lt;strong&gt;not&lt;/strong&gt; enabled by default with your copy of the Windows Vista. Keeping in mind you'll probably need to research a bit to see if II7 even comes with your flavor of Vista, being that some versions don't have IIS packaged with that build; I've got the ultimate edition, so I'm in the clear (for now).&lt;/p&gt;
&lt;p&gt;To enable II7: follow these &lt;a target=&quot;_blank&quot; href=&quot;http://www.howtogeek.com/howto/windows-vista/how-to-install-iis-on-windows-vista/&quot;&gt;instructions in this link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Make sure that you've checked off all or most the following feature-sets from: &lt;strong&gt;Internet Information Services&lt;/strong&gt; &amp;gt; &lt;strong&gt;World Wide Web Services&lt;/strong&gt; &amp;gt; &lt;strong&gt;Application Development Features&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/SoyouwanttowantHTTPModulesandHandlerswor_E148/iis7_aspnetconf_2.jpg&quot;&gt;&lt;img style=&quot;border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px&quot; height=&quot;417&quot; alt=&quot;iis7_aspnetconf&quot; width=&quot;338&quot; border=&quot;0&quot; src=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/SoyouwanttowantHTTPModulesandHandlerswor_E148/iis7_aspnetconf_thumb.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enabling those features (.NET Extensibility, ASP, ASP.NET, ISAPI Extensions, ISAPI Filters, SSI) ensures that your instance of II7 has more options when you are ready to configure your website even further (in particularly, the Handlers and Modules Mappings).&lt;/p&gt;
&lt;p&gt;After you've gotten that done, follow &lt;a target=&quot;_blank&quot; href=&quot;http://bdotnet.in/blogs/navaneeth/archive/2008/07/06/2056.aspx&quot;&gt;these instructions&lt;/a&gt; to get your handlers and modules working.&lt;/p&gt;
&lt;p&gt;HTH&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/So-you-want-to-want-HTTP-Modules-and-Handlers-working-with-Vista-and-IIS7</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/So-you-want-to-want-HTTP-Modules-and-Handlers-working-with-Vista-and-IIS7</guid>
            <pubDate>Mon, 16 Feb 2009 16:01:00 GMT</pubDate>
            <category>Windows</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Dancing around with XQuery and SQL Server - Part 1</title>
            <description>&lt;p&gt;What's XQuery? It's a language backed by the W3C to standardize querying XML.&lt;/p&gt;
&lt;p&gt;Why XQuery? Microsoft started offering support for it in SQL Server 2000 and in SQL Server 2005, extended it with more support with the introduction of the XML data type column. It's fast, it's compact, and you don't need to add 10 million trivial columns. You just add one XML column and stick raw XML in there. It's that easy, a caveman can do it. Here's more information about &lt;a target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ms345122(SQL.90).aspx&quot;&gt;Microsoft and XQuery&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So what's the bad news? It's yet another language to learn and the syntax is pretty cryptic for simple operations. For those developers that aren't DBA's, it's likely you won't be touching this very often. So since this came up at work, I'm writing part one of XQuery so I can refer back to it at some point in the future when I know I'll be using it once again.&lt;/p&gt;
&lt;p&gt;So I've got a table with an XML data type in one of the columns.&lt;/p&gt;

&lt;pre class=&quot;brush: sql;&quot;&gt;

CREATE TABLE [dbo].[User](
    [UserID] [uniqueidentifier] NOT NULL,
    [WebAddressName] varchar(100) NOT NULL,
    [Properties] [xml] NULL
) ON [PRIMARY]



&lt;/pre&gt;

&lt;p&gt;In the Properties XML data type column, I've got a few rows... and the XML looks like this:&lt;/p&gt;
&lt;pre class=&quot;brush: xml;&quot;&gt;

&lt;properties&gt;
  &lt;property key=&quot;SessionID&quot;&gt;2.iiDhbDmiWSt4UA5CJWRDzg__.3600.1234461600-625164376&lt;/property&gt;
  &lt;property key=&quot;DisplayName&quot;&gt;Kenny Lai&lt;/property&gt;
  &lt;property key=&quot;SquarePictureUrl&quot;&gt;http://kennydust.com/v227/1279/94/q625164376_5201.jpg&lt;/property&gt;
  &lt;property key=&quot;LastProfilePush&quot;&gt;2/12/2009 4:38:47 PM&lt;/property&gt;
  &lt;property key=&quot;Created&quot;&gt;12/30/2008 8:27:54 PM&lt;/property&gt;
&lt;/properties&gt;


&lt;/pre&gt;

&lt;p&gt;So imagine we've got a couple of thousand records. I just need one record with the DisplayName = &amp;quot;Kenny Lai&amp;quot;. How do I grab that row?&lt;/p&gt;

&lt;pre class=&quot;brush: sql;&quot;&gt;

declare @Key varchar(50)
set @Key ='Kenny Lai'

SELECT * FROM User
WHERE [properties].exist('/properties/property/text()[contains(.,sql:variable(&quot;@Key&quot;))]') = 1



&lt;/pre&gt;

&lt;p&gt;So there you have it, there are other techniques and ways to get more granular with your data, including targeting attributes and whatnot -- but this is the simplest way for the goal that I needed to achieve.&lt;/p&gt;
&lt;p&gt;Happy coding.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Dancing-around-with-XQuery-and-SQL-Server-Part-1</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Dancing-around-with-XQuery-and-SQL-Server-Part-1</guid>
            <pubDate>Thu, 12 Feb 2009 16:32:00 GMT</pubDate>
            <category>SQLServer</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>StringDictionary will lower your keys (and your expectations)</title>
            <description>&lt;p&gt;I needed to store a collection of key/value strings, so I turned to a familiar class I've used in the past: System.Collections.Specialized.StringDictionary. It's pretty straightforward to use, you construct it, then add your items one at a time. However, I ran into some pretty odd behavior where all the keys I injected came back out lower cased.. and subsequently, blew up into a nice error screen because some of the underlining code was dependant on specifically cased key strings.&lt;/p&gt;
&lt;p&gt;According to &lt;a target=&quot;_blank&quot; href=&quot;http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringdictionary.aspx&quot;&gt;microsoft&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The key is handled in a case-insensitive manner; it is translated to lowercase before it is used with the string dictionary.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;WTF? There doesn't seem to be any way around it. And I don't see any overloads (StringDictionary has just an empty ctor) or properties to set to override this behavior.. so I may need to find another solution. Microsoft should at least give the developer the option to control how the keys, or values are normalized.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/em&gt;: as I was about to submit this entry, I found this blog entry from &lt;a target=&quot;_blank&quot; href=&quot;http://haacked.com/archive/2004/06/25/685.aspx&quot;&gt;haack boy&lt;/a&gt;. I've resorted to using Dictionary&amp;lt;string, string&amp;gt;.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/StringDictionary-will-lower-your-keys-and-your-expectations</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/StringDictionary-will-lower-your-keys-and-your-expectations</guid>
            <pubDate>Mon, 02 Feb 2009 17:53:00 GMT</pubDate>
            <category>Code</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Preventing TinyMCE from stripping embed tags from rich media code.</title>
            <description>&lt;p&gt;For those who have never used the TinyMCE WYSIWYG pluggin, it's one of the industry's best kept secret; add this pluggin to your website, and you've got an instant Microsoft Word-like interface that supports pretty much all the different browsers and it's variations. Some of the things I've taken advantage of include creating custom toolbar buttons and leveraging their compressor paradigm to keep the scripts lightweight. Pretty neat indeed.&lt;/p&gt;
&lt;p&gt;Now with that said, I've come across one issue which wasn't very clear initially on how to solve, because it had long been a bug since it's predecessor versions; I was inject YouTube object/embed code into the body of the TinyMCE editor -- and coming back out, the &amp;lt;embed&amp;gt; tag would be stripped out entirely. It was a little odd, and I tried a number of things to no avail. The solution? Define &lt;strong&gt;media_strict = false&lt;/strong&gt; in your init() call. But only if you're utilizing the media pluggin. The media plugin assumes &lt;strong&gt;media_strict&lt;/strong&gt; is true by default. The &lt;strong&gt;media_strict&lt;/strong&gt; is a new option as of version 3.2.1.&lt;/p&gt;


&lt;pre class=&quot;brush: js;&quot;&gt;

tinyMCE.init({
   mode: &quot;textareas&quot;,
   theme : &quot;advanced&quot;,
   plugins : &quot;media&quot;,
   media_strict : false
});

&lt;/pre&gt;

&lt;p&gt;Hope this saves someone a day or two.&lt;/p&gt;
&lt;p&gt;&lt;a title=&quot;submit to globalgrind&quot; href=&quot;javascript:(function() { window.location = 'http://staging.globalgrind.com/submission/test.aspx?pid=1&amp;amp;url='+encodeURIComponent(window.location)+'&amp;amp;type=Article&amp;amp;description=placeholderfornow&amp;amp;title='+encodeURIComponent('Preventing TinyMCE from stripping &amp;lt;embed&amp;gt; tags from rich media code.'); })();&quot;&gt;&lt;img height=&quot;16&quot; alt=&quot;Add to GlobalGrind!&quot; width=&quot;16&quot; border=&quot;0&quot; src=&quot;http://globalgrind.com/images/badges/btn_badge1_dark.gif&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Preventing-TinyMCE-from-stripping-embed-tags-from-rich-media-code</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Preventing-TinyMCE-from-stripping-embed-tags-from-rich-media-code</guid>
            <pubDate>Fri, 12 Dec 2008 17:03:00 GMT</pubDate>
            <category>ThirdParty</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Remote Server Administrator Tools (RSAT) for Vista</title>
            <description>&lt;p&gt;I am moving to Vista.&amp;nbsp;Reluctantly at first, but I've found this operating system to be quite feature rich and powerful; and so far I see no reason why to uninstall it (6 weeks and counting). It was probably the exposure to the volume of apple commercials that convinced me that Microsoft and Vista were the plague -- and as a developer I should do everything to avoid it. With that said, I've dev'd primarily on my XP instance in the past, and one of the tools that I need on occasion is the handy &lt;a target=&quot;_blank&quot; href=&quot;http://www.techotopia.com/images/8/89/Windows_server_2008_remote_desktops_sessions.jpg&quot;&gt;remote desktops&lt;/a&gt; application available only in the &lt;a target=&quot;_blank&quot; href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=c16ae515-c8f4-47ef-a1e4-a8dcbacff8e3&amp;amp;displaylang=en&quot;&gt;Windows Server 2003 Administrator Tools Pack&lt;/a&gt; add-on (as an separate download).&lt;/p&gt;
&lt;p&gt;I now needed a Vista version; and in my conversations with a colleague, I was told this tool pack was only available for Windows Server 2003 and XP, not Vista.&lt;/p&gt;
&lt;p&gt;Sprung into action, I performed a few google searches and found out Microsoft does indeed address this for Vista customers. But only if you've have Service pack 1 installed. &amp;quot;RSAT&amp;quot; as they call it, is available in both 32 and 64 bit versions.&lt;/p&gt;
&lt;p&gt;The direct link to the Microsoft KB article (and downloads) is &lt;a target=&quot;_blank&quot; href=&quot;http://support.microsoft.com/kb/941314&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The directions to expose this in your Vista instance (after you've downloaded the right copy) is &lt;a target=&quot;_blank&quot; href=&quot;http://presson.wordpress.com/2008/05/13/microsoft-released-admin-pack-for-vista-rsat-windows-server-2008-remote-server-administration-tools/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Remote-Server-Administrator-Tools-RSAT-for-Vista</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Remote-Server-Administrator-Tools-RSAT-for-Vista</guid>
            <pubDate>Mon, 10 Nov 2008 18:36:00 GMT</pubDate>
            <category>Windows</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Initialization failure: WMI provider and SQL Server 2005</title>
            <description>&lt;p&gt;Ever open up the SQL Server Configuration Manager and receive this message?&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/InitializationfailureWMIproviderandSQLSe_14FD7/Picture%202_2.png&quot;&gt;&lt;img style=&quot;border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px&quot; height=&quot;80&quot; alt=&quot;Picture 2&quot; width=&quot;514&quot; border=&quot;0&quot; src=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/InitializationfailureWMIproviderandSQLSe_14FD7/Picture%202_thumb.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have; and an initial google search bring up a bevy of solutions. Unfortunately, the first several offerings did not solve my problem -- which prompted me to dig a little deeper.&lt;/p&gt;
&lt;p&gt;Apparently, I had corrupted my WMI repository somewhere along the line; and after some reading, the WMI can be corrupted after multiple restores of a database... which I'm definitely guilty of. So the solution? rebuild the WMI. Piece of cake, right? Luckily, I stumbled across this &lt;a target=&quot;_blank&quot; href=&quot;http://msmvps.com/blogs/lduncan/articles/20217.aspx&quot;&gt;blog link&lt;/a&gt; which detail these instructions (which can be batched into a .bat file):&lt;/p&gt;

&lt;pre class=&quot;brush: plain;&quot;&gt;
net stop winmgmt 
c: 
cd %systemroot%\system32\wbem 
rd /S /Q repository 

regsvr32 /s %systemroot%\system32\scecli.dll 
regsvr32 /s %systemroot%\system32\userenv.dll 

mofcomp cimwin32.mof 
mofcomp cimwin32.mfl 
mofcomp rsop.mof 
mofcomp rsop.mfl 
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s 
for /f %%s in ('dir /b *.mof') do mofcomp %%s 
for /f %%s in ('dir /b *.mfl') do mofcomp %%s 
echo DONE reboot 
pause
&lt;/pre&gt;

&lt;p&gt;Ottimo! Everything should work. But not so fast, this message appears the next time I try to start up the SQL Server Configuration Manager:&lt;/p&gt;

&lt;pre class=&quot;brush: plain;&quot;&gt;

&quot;Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 servers with SQL Server Configuration Manager. 
Invalid class [0x80041010]&quot;

&lt;/pre&gt;

&lt;p&gt;Motherfunbag. I guess that didn't do it. Opening the command prompt and typing &lt;a target=&quot;_blank&quot; href=&quot;http://blogs.msdn.com/echarran/archive/2006/01/03/509061.aspx&quot;&gt;the below&lt;/a&gt; addresses this and ultimately fixes my issue:&lt;/p&gt;

&lt;pre class=&quot;brush: plain;&quot;&gt;

C:\Program Files\Microsoft SQL Server\90\Shared&gt;mofcomp &quot;C:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof&quot;

Microsoft (R) 32-bit MOF Compiler Version 5.1.2600.2180 
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved. 
Parsing MOF file: C:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmprovider 
xpsp2up.mof 
MOF file has been successfully parsed 
Storing data in the repository... 
Done!


&lt;/pre&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Initialization-failure-WMI-provider-and-SQL-Server-2005</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Initialization-failure-WMI-provider-and-SQL-Server-2005</guid>
            <pubDate>Sun, 09 Nov 2008 23:54:00 GMT</pubDate>
            <category>SQLServer</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>AssertExtraSocks()</title>
            <description>&lt;p&gt;A word of advice to anyone traveling for more than a day -- pack extra socks.&lt;/p&gt;
&lt;p&gt;I made above the mistake and walked out of my house with just the one pair on my feet. The Microsoft PDC conference was slated for 4 days; and lets just say by the third day -- my feet were pretty smelly. It also didn't help that I stayed in the &lt;a target=&quot;_blank&quot; href=&quot;/events/pdc/my-motel-in-the-ghetto/&quot;&gt;ghetto&lt;/a&gt; with no Target, Foot Locker or anything else in sight; I had to block out an hour on day 3 to find something quickly.&lt;/p&gt;
&lt;p&gt;3 Day old pair:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/Alwayspackextrasockswhentraveling_BA16/IMG_0226.jpg&quot;&gt;&lt;img style=&quot;border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px&quot; height=&quot;244&quot; alt=&quot;IMG_0226&quot; width=&quot;184&quot; border=&quot;0&quot; src=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/Alwayspackextrasockswhentraveling_BA16/IMG_0226_thumb.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;New Socks:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/Alwayspackextrasockswhentraveling_BA16/IMG_0227.jpg&quot;&gt;&lt;img style=&quot;border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px&quot; height=&quot;244&quot; alt=&quot;IMG_0227&quot; width=&quot;184&quot; border=&quot;0&quot; src=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/Alwayspackextrasockswhentraveling_BA16/IMG_0227_thumb.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/AssertExtraSocks</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/AssertExtraSocks</guid>
            <pubDate>Fri, 07 Nov 2008 13:23:00 GMT</pubDate>
            <category>PDC</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>My Motel in the Ghetto</title>
            <description>&lt;p&gt;We made plans for our Microsoft Convention a little too late, so we ended up staying a 50 dollar a night motel in the Ghetto. Think of &amp;quot;&lt;a target=&quot;_blank&quot; href=&quot;http://nbc.com/earl/&quot;&gt;My Name is Earl&lt;/a&gt;&amp;quot;&amp;nbsp; when you see these photos.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/MyMotelintheGhetto_D410/motel_2.jpg&quot;&gt;&lt;img style=&quot;border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px&quot; height=&quot;525&quot; alt=&quot;motel&quot; width=&quot;395&quot; border=&quot;0&quot; src=&quot;http://kennydust.com/files/media/image/WindowsLiveWriter/MyMotelintheGhetto_D410/motel_thumb.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even the locals are nice and friendly!&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;http://eldib.files.wordpress.com/2007/11/homeless.jpg&quot; /&gt;&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/My-Motel-in-the-Ghetto</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/My-Motel-in-the-Ghetto</guid>
            <pubDate>Thu, 06 Nov 2008 15:19:00 GMT</pubDate>
            <category>PDC</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Fallout 3 Rocks</title>
            <description>&lt;p&gt;So I've been playing Fallout 3 on the PS3 recently and it kicks some serious ass. Some of the best things about the game? Intense close-combat fighting scenarios, body dismemberment, fluid graphics and excellent gameplay.&lt;/p&gt;
&lt;p&gt;Fallout 3 is an RPG/first person shooter hybrid which uses the Oblivion engine as its base. Where they differ is the combat systems, however the RPG/gameplay experience is just as rich.&lt;/p&gt;
&lt;p&gt;The game takes place in a post-apocalyptic setting in the late 22nd century, though its story and artwork are heavily influenced by the post-World War II nuclear paranoia of the 1950s. It was originally developed and owned by &lt;a target=&quot;_blank&quot; href=&quot;http://interplay.com&quot;&gt;Interplay&lt;/a&gt;, but development and rights of Fallout was sold to &lt;a target=&quot;_blank&quot; href=&quot;http://bethsoft.com&quot;&gt;bethsoft&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are some of the screen shots:&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://fallout.bethsoft.com/images/art/fallout3screens/screen42B.jpg&quot;&gt;&lt;img alt=&quot;&quot; width=&quot;500&quot; src=&quot;http://fallout.bethsoft.com/images/art/fallout3screens/screen42B.jpg&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://fallout.bethsoft.com/images/art/fallout3screens/screen07B.jpg&quot;&gt;&lt;img alt=&quot;&quot; width=&quot;500&quot; src=&quot;http://fallout.bethsoft.com/images/art/fallout3screens/screen07B.jpg&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://fallout.bethsoft.com/images/art/fallout3screens/screen30B.jpg&quot;&gt;&lt;img alt=&quot;&quot; width=&quot;500&quot; src=&quot;http://fallout.bethsoft.com/images/art/fallout3screens/screen30B.jpg&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://fallout.bethsoft.com/images/downloads/wallpapers/fallout-wp7-800x600.jpg&quot;&gt;&lt;img alt=&quot;&quot; width=&quot;500&quot; src=&quot;http://fallout.bethsoft.com/images/downloads/wallpapers/fallout-wp7-800x600.jpg&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Fallout-3-Rocks</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Fallout-3-Rocks</guid>
            <pubDate>Thu, 06 Nov 2008 15:03:00 GMT</pubDate>
            <category>Fallout3</category>
        </item>
        <item>
            <dc:creator>kennydust</dc:creator>
            <title>Dynamic Typing in C# 4.0</title>
            <description>&lt;p&gt;I'm here at PDC 08 and attended a great session by Anders Hejlsberg for some of the things coming down the pipe for C# 4.0. One of the more exciting offerings is the idea of resolving names in your code at runtime instead of compile time via dynamic lookup. There is a new static Type called &lt;strong&gt;dynamic&lt;/strong&gt; which it's usage pattern is such:&lt;/p&gt;

&lt;pre class=&quot;brush: c#;&quot;&gt;
dynamic calc = new Calculator ();
int sum = calc.Add(10, 20);
&lt;/pre&gt;


&lt;p&gt;In addition, it can be used in as a argument modifier for methods:&lt;/p&gt;


&lt;pre class=&quot;brush: c#;&quot;&gt;
void RunCalculator(dynamic calc, int num1, int num2)
{
   calc.Add(num1, num2);
}
&lt;/pre&gt;

&lt;p&gt;This is an incredibly powerful feature and Anders himself points out the evolution of C# is in dynamic programming. I guess the initial thought racing through my head is obvious -- what is the performance cost of using &lt;em&gt;&lt;strong&gt;dynamics&lt;/strong&gt;&lt;/em&gt;? I've always been against late-binding anything. More thoughts about this later.&lt;/p&gt;</description>
            <link>http://www.kennydust.com/site.aspx/Blog/Dynamic-Typing-in-CSharp4</link>
            <guid isPermaLink="true">http://www.kennydust.com/site.aspx/Blog/Dynamic-Typing-in-CSharp4</guid>
            <pubDate>Tue, 28 Oct 2008 01:44:00 GMT</pubDate>
            <category>Code</category>
        </item>
    </channel>
</rss>

