<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C#/Development</title><link>http://ryanfarley.com/blog/category/8.aspx</link><description>C#/Development</description><managingEditor>Ryan Farley</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Ryan Farley</dc:creator><title>Accessing the Windows RSS Platform with C#</title><link>http://ryanfarley.com/blog/archive/2006/10/24/35190.aspx</link><pubDate>Tue, 24 Oct 2006 09:54:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/10/24/35190.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/35190.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/10/24/35190.aspx#Feedback</comments><slash:comments>16</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/35190.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/35190.aspx</trackback:ping><description>&lt;P&gt;Internet Explorer 7 introduced the Windows RSS Platform. The Windows RSS Platform will be a core part of Windows Vista, but with IE7 it is now avilable on XP as well. The new&amp;nbsp;functionality in IE7&amp;nbsp;to consume RSS feeds is&amp;nbsp;made capable by the Windows RSS platform. This new functionality exists in Outlook 2007 also, giving you the ability to consume RSS feeds in Outlook folders ala Newsgator style, which can also synchronize with the Windows RSS Platform.&lt;/P&gt;
&lt;P&gt;What makes this all so cool is that you now have the ability to have a single common store for subscribed RSS feeds. Well, this is the goal I suppose, although it will take some time for RSS Reader vendors to switch over - if that ever happens. Newsgator/FeedDemon has a utility for synching the Newsgator online feed store with the Windows RSS Platform.&lt;/P&gt;
&lt;P&gt;Accessing the Windows RSS Platform is a simple task. The RSS Platform is exposed by a COM-based API found in msfeeds.dll (in the System32 directory). Add a reference to the COM dll and add a using directive for the namespace in the generated interop assembly and it's all easy work to use. Although, do keep in mind that this is a COM based reference so you'll need to take care to properly release all objects.&lt;/P&gt;
&lt;P&gt;Let's say we want to populate a TreeView control with the feeds found in the local RSS store. An easy enough task, take a look:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Runtime.InteropServices;
&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; Microsoft.Feeds.Interop;
&lt;SPAN style="COLOR: green"&gt;//..
&lt;/SPAN&gt;
&lt;SPAN style="COLOR: blue"&gt;private void&lt;/SPAN&gt; loadFeeds()
{
    TreeNode rootnode &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; treeView1.Nodes.Add(&lt;SPAN style="COLOR: #008080"&gt;"Feeds"&lt;/SPAN&gt;);
    IFeedsManager feedmgr &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
    IFeedFolder rootfolder &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;

    &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;
    {
        &lt;SPAN style="COLOR: green"&gt;// instanciate a new FeedManager
&lt;/SPAN&gt;        feedmgr &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; FeedsManagerClass();
        
        &lt;SPAN style="COLOR: green"&gt;// get reference to the root feed store folder
&lt;/SPAN&gt;        &lt;SPAN style="COLOR: green"&gt;// there is always a root 
&lt;/SPAN&gt;        rootfolder &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (IFeedFolder)feedmgr.RootFolder;

        &lt;SPAN style="COLOR: green"&gt;// call method to recursively add subfolders and feeds to treeview
&lt;/SPAN&gt;        addNode(rootnode, rootfolder);
        treeView1.ExpandAll();
    }
    &lt;SPAN style="COLOR: blue"&gt;finally&lt;/SPAN&gt;
    {
        Marshal.ReleaseComObject(rootfolder);
        Marshal.ReleaseComObject(feedmgr);
    }
}
&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; addNode(TreeNode parentnode, IFeedFolder folder)
{
    &lt;SPAN style="COLOR: green"&gt;// check to see if the current folder has subfolders
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (folder.Subfolders !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (IFeedFolder subfolder &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; (IFeedsEnum)folder.Subfolders)
        {
            TreeNode foldernode &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; parentnode.Nodes.Add(subfolder.Name);
            &lt;SPAN style="COLOR: green"&gt;// recursively add subfolders under current folder
&lt;/SPAN&gt;            addNode(foldernode, subfolder);
        }
    }
    
    &lt;SPAN style="COLOR: green"&gt;// if current folder has feeds add them under the folder node
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (folder.Feeds !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
    {
        &lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (IFeed feed &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; (IFeedsEnum)folder.Feeds)
        {
            TreeNode feednode &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; parentnode.Nodes.Add(feed.Name);
            feednode.Tag &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; feed;
        }
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Once you've gotten the list of feeds it is just as easy to get the items from a feed. In the example above I placed a reference to the feed in the tag of the TreeNode objects. Let's grab that on the TreeView's AfterSelect event and get the items from the feed to fill a ListView.&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
    listView1.Items.Clear();
    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (e.Node.Tag !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
    {
        IFeed feed &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; e.Node.Tag as IFeed;
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (feed !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
        {
            &lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (IFeedItem item &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; (IFeedsEnum)feed.Items)
            {
                ListViewItem li &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ListViewItem();
                li.Text &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; item.Title;
                li.SubItems.Add(item.PubDate.ToShortDateString());
                &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (!item.IsRead) li.Font &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Font(li.Font, FontStyle.Bold);

                li.Tag &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; item;
                listView1.Items.Add(li);
            }
        }
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So now as a last task, when an item in the ListView is selected let's display the text for the item in a webbrowser control.&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; listView1_SelectedIndexChanged(object sender, EventArgs e)
{
    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (listView1.SelectedItems.Count &amp;gt; 0 &amp;amp;&amp;amp; listView1.SelectedItems[0].Tag !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
    {
        ListViewItem li &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; listView1.SelectedItems[0];
        IFeedItem item &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; li.Tag as IFeedItem;
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (item !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
        {
            &lt;SPAN style="COLOR: green"&gt;// let's mark the item as read
&lt;/SPAN&gt;            item.IsRead &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;
            li.Font &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Font(li.Font, FontStyle.Regular);
            
            &lt;SPAN style="COLOR: green"&gt;// set the item's text in the webbrowser
&lt;/SPAN&gt;            webBrowser1.DocumentText &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; item.Description;
        }
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So, that's easy enough. Just as easy to do other things as well, such as add a new feed to the local store.&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; addRyanFarleysFeed() &lt;SPAN style="COLOR: green"&gt;// ;-)
&lt;/SPAN&gt;{
    IFeedsManager feedmgr &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
    IFeedFolder rootfolder &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
    IFeedFolder folder &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
    IFeed feed &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
    
    &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;
    {
        &lt;SPAN style="COLOR: green"&gt;// instanciate a new FeedManager
&lt;/SPAN&gt;        feedmgr &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; FeedsManagerClass();
        
        &lt;SPAN style="COLOR: green"&gt;// get reference to the root feed store folder
&lt;/SPAN&gt;        rootfolder &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (IFeedFolder)feedmgr.RootFolder;

        &lt;SPAN style="COLOR: green"&gt;// if we wanted to add the feed to an existing folder in the store
&lt;/SPAN&gt;        &lt;SPAN style="COLOR: green"&gt;// we could use the following (for example, if we wanted to store
&lt;/SPAN&gt;        &lt;SPAN style="COLOR: green"&gt;// the feed in a folder called "My Feeds")
&lt;/SPAN&gt;        folder &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (IFeedFolder)rootfolder.GetSubFolder(&lt;SPAN style="COLOR: #008080"&gt;"My Feeds"&lt;/SPAN&gt;);
        
        &lt;SPAN style="COLOR: green"&gt;// if you didn't want to add it in a subfolder (ie: in the root instead)
&lt;/SPAN&gt;        &lt;SPAN style="COLOR: green"&gt;// then you'd just use the reference to the root folder
&lt;/SPAN&gt;        
        feed &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (IFeed)folder.CreateFeed(&lt;SPAN style="COLOR: #008080"&gt;"{ public virtual blog; }"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #008080"&gt;"http://ryanfarley.com/blog/rss.aspx"&lt;/SPAN&gt;);
        &lt;SPAN style="COLOR: green"&gt;// now force an async download of the items in the feed
&lt;/SPAN&gt;        feed.AsyncDownload();
    }
    &lt;SPAN style="COLOR: blue"&gt;finally&lt;/SPAN&gt;
    {
        Marshal.ReleaseComObject(feed);
        Marshal.ReleaseComObject(folder);
        Marshal.ReleaseComObject(rootfolder);
        Marshal.ReleaseComObject(feedmgr);
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So now in the course of about 10 minutes you've created your own simple RSS Reader that uses the Windows RSS Platform as the backend. Here's a screenshot of the sample I threw together using the same code I outlined above:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://files.farleyzone.com/images/rssreader.jpg" target=_blank&gt;&lt;IMG src="http://files.farleyzone.com/images/rssreader_th.jpg" border=0&gt;&lt;BR&gt;&lt;I&gt;(click for larger view)&lt;/I&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There's a whole lot more the Feed API can do, including downloading enclosures and more.&lt;/P&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/feedsapi/rss/overviews/msfeeds_ovw.asp" target=_blank&gt;View the Feed API Documentation for the Windows RSS Platform on MSDN&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/35190.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>More Null-Coalescing (??) Operator Love</title><link>http://ryanfarley.com/blog/archive/2006/08/22/28112.aspx</link><pubDate>Tue, 22 Aug 2006 13:21:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/08/22/28112.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/28112.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/08/22/28112.aspx#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/28112.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/28112.aspx</trackback:ping><description>&lt;P&gt;&lt;A href="http://ryanfarley.com/blog/archive/2006/08/10/27196.aspx"&gt;I last posted about the null coalescing operator&lt;/A&gt; in .NET 2.0 and just had to post a follow up. I came accross a post on Born 2 Code .NET (&lt;A href="http://bloggingabout.net/blogs/dennis/archive/2006/08/15/Advanced-usage-of-the-_3F003F00_-operator.aspx" target=_blank&gt;via Dennis van der Stelt&lt;/A&gt;) where several examples of ?? syntactic sugar are listed to demonstrate how the null coalescing operator surpasses the ternary conditional operator (?:) and if constructs as far as usefulness and readability. &lt;/P&gt;
&lt;P&gt;
&lt;DIV class=link&gt;Take a look at &lt;A href="http://born2code.net/?p=50" target=_blank&gt;?? Operator, Part II&lt;/A&gt; (&lt;A href="http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=nl_en&amp;amp;url=http%3A%2F%2Fborn2code.net%2F%3Fp%3D50" target=_blank&gt;Babelfish - Dutch to English Translation&lt;/A&gt;)&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Here's a great sample from the post:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Brush BackgroundBrush
{
    &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;
    {
        &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _backgroundBrush ??
        (
            _backgroundBrush &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; GetBackgroundBrushDefault()
        );
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Which translates to (using a traditional if construct)&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Brush BackgroundBrush
{
    &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;
    {
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (_backgroundBrush == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)
        {
            _backgroundBrush &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; GetBackgroundBrushDefault();
        }
        &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _backgroundBrush;
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The idea here is that the ?? is evaluated first before the return, causing the assignment to occur in the case when the _backgroundBrush variable is null. That is just plain cool. Make sure you check out the link to the post on Born 2 Code .NET for more examples. Also check out Jon Skeet's post on doing elegant comparisons using the null coalescing operator as well.&lt;/P&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://msmvps.com/blogs/jon.skeet/archive/2006/07/28/106119.aspx" target=_blank&gt;Elegant comparisons with the null coalescing operator&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/28112.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>Null-Coalescing Operator in .NET 2.0</title><link>http://ryanfarley.com/blog/archive/2006/08/10/27196.aspx</link><pubDate>Thu, 10 Aug 2006 13:52:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/08/10/27196.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/27196.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/08/10/27196.aspx#Feedback</comments><slash:comments>11</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/27196.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/27196.aspx</trackback:ping><description>&lt;P&gt;I blogged two years ago (See &lt;A href="http://ryanfarley.com/blog/archive/2004/05/18/679.aspx"&gt;Nullable Value Types and the New ? Syntax&lt;/A&gt;, and &lt;A href="http://ryanfarley.com/blog/archive/2004/05/25/726.aspx"&gt;More on Nullable Value Types&lt;/A&gt;)&amp;nbsp;about the new nullable operator in .NET 2.0 (wow, was that really 2 whole years ago? Time flies.). Since then, I waited patiently for it's arrival. Ever since .NET 2.0 came out I've been wanting to return and blog about it again.&lt;/P&gt;
&lt;P&gt;Here's a recap on the Null-Coalescing operator. It is a cleaner replacement for ternary conditional operator &lt;FONT face="Courier New"&gt;?:&lt;/FONT&gt; and has some additional uses as well. Think of the SQL Coalesce function (or IsNull). It is a lot like that. It gives you the first non-null between the two as SQL Coalesce does, but it doesn't allow multiple conditions to be checked as SQL Coalesce does (unless you chain them together). If the left-side is null, it gives you the right side. The right side could be considered your &amp;#8220;default&amp;#8220; in case the value on the left is null for some cases. I've always been a fan of using &lt;FONT face="Courier New"&gt;?:&lt;/FONT&gt; but there was something about needing to, at times, repeat variables in the statement. Here's a sample of what I am talking about:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; name &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; getName();
Console.WriteLine(name == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt; ? &lt;SPAN style="COLOR: #008080"&gt;"No name"&lt;/SPAN&gt; : name);&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;For as much as I love using &lt;FONT face="Courier New"&gt;?:&lt;/FONT&gt;&amp;nbsp;I've just never liked having to specify the variable name twice in that line. Not a huge deal, but things are even better using the null-coalescing operator in this scenario:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; name &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; getName();
Console.WriteLine(name  ?? &lt;SPAN style="COLOR: #008080"&gt;"No name"&lt;/SPAN&gt;);&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Much nicer. Gives you the same warm-fuzzy feelings you get from the SQL Coalesce function, doesn't it? It get's even better as you think of the possibilities you have using the new &lt;FONT face="Courier New"&gt;??&lt;/FONT&gt; operator. What previously would have been this (with the &lt;FONT face="Courier New"&gt;?:&lt;/FONT&gt; operator)&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;Customer customer &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; Broker.GetCustomer(id);
&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (customer == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) customer &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Customer();&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Now becomes this:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;Customer customer &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; Broker.GetCustomer(id) ?? &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Customer();&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I feel the love. But don't forget about nullable types. Nullable types in .NET 2.0 allow you to use a use a value type that can essentially be null. For example, if you have an int, bool, or other value type, it is either uninitialized or a value. Never null. But what if you wanted/needed to indicate null for a value type? A nullable value type is declared with a &lt;FONT face="Courier New"&gt;?&lt;/FONT&gt; following the type. Let's take a look at a nullable int. &lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; GetInt()
{
    &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;? id &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
    &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; id ?? -1;
}
&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Ever since .NET 2.0 came out I've wondered why I don't see more of this syntax around. From everything I come accoss I don't find this very often. Maybe people are still getting used to it, but it sure is some cool stuff IMO.&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/27196.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>Outlook 2007 and the Object Model Guard</title><link>http://ryanfarley.com/blog/archive/2006/08/04/26804.aspx</link><pubDate>Fri, 04 Aug 2006 11:47:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/08/04/26804.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/26804.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/08/04/26804.aspx#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/26804.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/26804.aspx</trackback:ping><description>&lt;P&gt;If you've written code to work with Outlook before, you'll have met the Object Model Guard's messages about a &lt;EM&gt;program trying to access Outlook&lt;/EM&gt;. This change was a real pain for developers when it was first introduced. Since then we've all&amp;nbsp;made our way&amp;nbsp;around it by writing extended MAPI code or using things like &lt;A href="http://www.dimastr.com/redemption/" target=_blank&gt;Redemption&lt;/A&gt; or &lt;A href="http://www.add-in-express.com/outlook-security/" target=_blank&gt;Outlook Security Manager&lt;/A&gt;. However, I was reading some info on the code security changes in Office 2007 and came accross this:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;Security in Outlook 2007 takes advantage of the status of antivirus software installed on a computer. This change represents a major departure from the way the Object Model Guard worked in the past. If Outlook is able to detect that antivirus software is running with an acceptable status, Outlook disables security warnings for the user. This allows external applications that previously had to resort to Extended MAPI or third-party libraries to avoid security prompts under the appropriate conditions. This new behavior helps keep Outlook secure without overwhelming the user with excessive warning messages.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms778202.aspx" target=_blank&gt;Read the article here: Code Security Changes in Outlook 2007&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;That is some awesome news IMO. &lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/26804.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>Code Smells - The Warning Signs</title><link>http://ryanfarley.com/blog/archive/2006/06/06/23560.aspx</link><pubDate>Tue, 06 Jun 2006 20:28:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/06/06/23560.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/23560.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/06/06/23560.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/23560.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/23560.aspx</trackback:ping><description>&lt;P&gt;You may have read it already, but it's working linking to over and over again, &lt;A href="http://www.codinghorror.com/blog/" target=_blank&gt;Jeff Atwood&lt;/A&gt; has an excellent list of warning signs for &lt;A href="http://en.wikipedia.org/wiki/Code_smell" target=_blank&gt;Code Smells&lt;/A&gt;. Be aware of these warning signs. If you are seeing them in your code, then...I'm sorry. I really didn't want you to have to find out like this. Hehe.&lt;/P&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://www.codinghorror.com/blog/archives/000589.html" target=_blank&gt;Read Jeff's post on Code Smells&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;A truly excellent list and something every developer should read. I've been guilty of some of those from time to time myself, but live and learn, right? As long as you are aware of those things that make your code downright stinky, then you can at least learn to improve.&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/23560.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>Top 30 Popular Posts</title><link>http://ryanfarley.com/blog/archive/2006/05/25/22689.aspx</link><pubDate>Thu, 25 May 2006 11:41:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/05/25/22689.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/22689.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/05/25/22689.aspx#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/22689.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/22689.aspx</trackback:ping><description>&lt;P&gt;I started this blog in August of 2003, almost 3 years ago. I've made 176 posts in those 3 years. I don't post too often to my blog because I'm not all that big on posting stories about my kids, wife, dog, etc - although those do come in every now and then. Anyway, even when I have lulls where I am not posting as much, my traffic seems to stay pretty consistent. I'm actually amazed at how much traffic I get, especially when I consider how often I get around to posting (big thanks to all the visitors over the years). &lt;/P&gt;
&lt;P&gt;Some of my posts have apparently been useful :-), so I thought I would post the top 30 most popular posts I've made over the years (based on total number of unique views to the posts).&lt;/P&gt;
&lt;P&gt;
&lt;BLOCKQUOTE style="FONT-STYLE: normal"&gt;&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx"&gt;1. Set Focus to an ASP.NET Control&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Setting focus to controls in your&amp;nbsp;ASP.NET application&amp;nbsp;is a part of giving your end users the feel that they have come to expect. Making your web applications act more like Windows applications is a key to success (IMO). While setting focus to con...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;371,568&lt;/i&gt; - Posted on: 21-Dec-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/12/23/1330.aspx"&gt;2. Using the Web Browser Control in your C# Applications&lt;/a&gt;&lt;/b&gt;&lt;br&gt;It can be a powerful thing to display dynamic HTML in your C# applications. It can give your applications a modern look and feel and can make displaying data in non-standard ways easy with some simple markup. We have the web browser ActiveX control that wr...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;232,037&lt;/i&gt; - Posted on: 23-Dec-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/07/13/879.aspx"&gt;3. Writing to Your .NET Application's Config File&lt;/a&gt;&lt;/b&gt;&lt;br&gt;There's likely been times that you might have thought that it would make things convenient to write back to your .NET application's config file. The framework provides simple methods for reading from the config file, but gives you nothing for writing value...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;197,345&lt;/i&gt; - Posted on: 13-Jul-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/12/19/1313.aspx"&gt;4. Tips for SQL Server Identity Columns&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Tips on allowing inserts to identity columns and also for reseeding the identity value for a table....&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;117,941&lt;/i&gt; - Posted on: 19-Dec-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/01/07/261.aspx"&gt;5. Multiple Monitors rule&lt;/a&gt;&lt;/b&gt;&lt;br&gt;I love multiple monitors. I can't even imagine trying to work without multiple monitors and don't think I could ever go back to a single monitor....&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;96,533&lt;/i&gt; - Posted on: 7-Jan-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/08/23/8540.aspx"&gt;6. Unable to Start Debugging on the Web Server&lt;/a&gt;&lt;/b&gt;&lt;br&gt;I hate that, and it seems that every time I (or a co-worker) gets the error &amp;#8220;Unable to Start Debugging on the Web Server&amp;#8221; on a machine when attempting to debug an ASP.NET project, I have to scramble to remember what to look at. Here's a few things that has...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;91,037&lt;/i&gt; - Posted on: 23-Aug-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/05/16/649.aspx"&gt;7. Stop Hijacking my Browser!&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Often in applications you have the need to launch a browser window to a specified URL. I recently evaluated various RSS readers where links to blog posts could be launched in an external browser window. What I found was that most of these applications woul...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;90,029&lt;/i&gt; - Posted on: 16-May-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/03/11/1886.aspx"&gt;8. Determining the Control that Caused a PostBack&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Many times you might need to perform some action on an ASP.NET postback based on the control that caused the postback to occur. Some scenarios for this might include a form with many regions, each having it's own CustomValidator and the ability to perform...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;69,089&lt;/i&gt; - Posted on: 11-Mar-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/01/14/1439.aspx"&gt;9. Solving problems through programming...and why the Skype API sucks&lt;/a&gt;&lt;/b&gt;&lt;br&gt;I love to take the approach of solving computing problems through programming. Sometimes it backfires and I over-complicate the problem (I have been known to prematurely generalize from time to time). But usually I bask in the greatness of being a programm...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;60,149&lt;/i&gt; - Posted on: 14-Jan-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/05/05/599.aspx"&gt;10. Enabling XP Themes in your .NET Applications&lt;/a&gt;&lt;/b&gt;&lt;br&gt;When you build Windows applications in .NET, by default your application will not have support for XP Themes, or Visual Styles. It is an easy enough task to do, and I think it goes a long way in giving your application a complete and professional look &amp; fe...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;49,397&lt;/i&gt; - Posted on: 5-May-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/02/15/1689.aspx"&gt;11. On the Subject of Dates in T-SQL&lt;/a&gt;&lt;/b&gt;&lt;br&gt;While we're on the subject of dates in T-SQL, I never liked getting the month and year for a date and sticking an '01' in the middle (then casting it all back to a datetime) to get the first day of the month for a given date value. Then you do the same to...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;42,317&lt;/i&gt; - Posted on: 15-Feb-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/02/14/1685.aspx"&gt;12. Determining if a Date is a Weekday in T-SQL&lt;/a&gt;&lt;/b&gt;&lt;br&gt;I was reminded of a SQL function to determine if a date was a weekday or a weekend I wrote a while back when I saw the requirements of a project a colleague was working on. You'll see this requirement fairly often in many business applications. A company m...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;40,265&lt;/i&gt; - Posted on: 14-Feb-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/06/08/766.aspx"&gt;13. Awesome web.config Changes in ASP.NET 2.0&lt;/a&gt;&lt;/b&gt;&lt;br&gt;There are some really cool changes coming in ASP.NET's web.config files that I am really excited about. I'll just point out a few that I've used (I hate going back to 1.1 because I can't use them). The web.config file in ASP.NET 2.0 allows you to set a lot...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;40,145&lt;/i&gt; - Posted on: 8-Jun-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/12/18/1300.aspx"&gt;14. Setting the Value of a TextBox with TextMode=Password&lt;/a&gt;&lt;/b&gt;&lt;br&gt;When the TextMode property of an ASP.NET TextBox is set to Password the value set in the Text property will not display at runtime. This can be a pain, however it is actually by design to prevent the unmasked password from being displayed in the HTML sourc...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;36,984&lt;/i&gt; - Posted on: 18-Dec-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/10/25/1127.aspx"&gt;15. T-SQL Olympics&lt;/a&gt;&lt;/b&gt;&lt;br&gt;OK, there is not an Olympics for T-SQL - but there should be. A friend of mine and I were talking the other day about &amp;#8220;gold-medal&amp;#8221; T-SQL we've come accross. The one that wins the gold for me is the code I found a long time ago on SQL Server Central from Ma...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;36,617&lt;/i&gt; - Posted on: 25-Oct-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/03/01/390.aspx"&gt;16. T-SQL: SET vs SELECT when assigning variables&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Do you know what the difference is between using SET and SELECT when assigning varaibles in T-SQL? Well, there is a difference. I came accross a great article by Narayana Vyas Kondreddi from the UK that describes the difference between the two....&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;36,204&lt;/i&gt; - Posted on: 1-Mar-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/12/27/1334.aspx"&gt;17. Interacting with the Web Browser Control&lt;/a&gt;&lt;/b&gt;&lt;br&gt;In my last post, I outlined some ways to make the Web Browser control more useful in your C# applications, to include things such as printing and setting the text or html of the browser dynamically. That is all good, but in a typical application it does li...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;35,885&lt;/i&gt; - Posted on: 27-Dec-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/04/12/526.aspx"&gt;18. Disabling the Windows Close action&lt;/a&gt;&lt;/b&gt;&lt;br&gt;There are times that you'll see a Window that has a close button in the titlebar, but it is disabled. This is often found in applications where the dialog/window changes it's status past a stoppable point so the Windows close action is removed so the user...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;35,796&lt;/i&gt; - Posted on: 12-Apr-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/03/23/465.aspx"&gt;19. Creating a IWin32Window from a Win32 Handle&lt;/a&gt;&lt;/b&gt;&lt;br&gt;There are times when you are integrating your .NET applications with other existing applications that you cannot modify and is possibly even non-.NET application. This can often result in problems integrating your .NET application's windows with the other...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;35,465&lt;/i&gt; - Posted on: 23-Mar-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/05/14/629.aspx"&gt;20. In Search of the Perfect RSS Reader&lt;/a&gt;&lt;/b&gt;&lt;br&gt;For the last year or two, I've been switching from reader to reader. While each one had features that I loved, they all seemed to fall short on one thing or another and I was never really 100% pleased with any of them. I went from SharpReader, to RSSBandit...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;33,384&lt;/i&gt; - Posted on: 14-May-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/02/17/1712.aspx"&gt;21. Flattening Out Data with One of the Coolest SQL Tricks Ever&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Not sure why, but I seem to be on a T-SQL kick lately - so here's another T-SQL post. One of my favorite T-SQL hacks ever is one that can flatten out data by taking a value from multiple rows and concatenating the values into a single string....&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;33,281&lt;/i&gt; - Posted on: 17-Feb-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/06/16/788.aspx"&gt;22. Dynamically Loading Master Pages in ASP.NET 2.0&lt;/a&gt;&lt;/b&gt;&lt;br&gt;One of the cool new things introduced in ASP.NET 2.0 is Master Pages. Master Pages give you the ability to define a master page layout and look that is used throughout a site to give a consistent look &amp; feel to all pages. Any updates or changes to the look...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;33,156&lt;/i&gt; - Posted on: 16-Jun-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/05/10/605.aspx"&gt;23. Communication between applications via Windows Messages&lt;/a&gt;&lt;/b&gt;&lt;br&gt;At times I'll build a suite of related, but separate applications. Even though each application is a separate executable, I like to be able to integrate the applications so they can work together. Sending messages between your applications is a great way t...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;31,548&lt;/i&gt; - Posted on: 10-May-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/09/06/9208.aspx"&gt;24. Rendering Size (and other things) Correctly in FireFox&lt;/a&gt;&lt;/b&gt;&lt;br&gt;One thing that I just can't stand, is when a web page I build looks different in FireFox than how it looks in IE. Well, who doesn't?! The thing that really sucks is that there are things build in to how ASP.NET works that will cause this to happen. So unle...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;31,325&lt;/i&gt; - Posted on: 6-Sep-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/05/26/737.aspx"&gt;25. Returning Objects from Web Services&lt;/a&gt;&lt;/b&gt;&lt;br&gt;When I work with web services I want things to work the same way as if I were working with a local layer that returns objects, not data. I don't want my code outside of the service to even see the data, just the objects that represent the data. Who doesn't...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;27,545&lt;/i&gt; - Posted on: 26-May-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2005/02/23/1739.aspx"&gt;26. Disabling Auto-Complete on ASP.NET Forms&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Popular browsers, such as Internet Explorer and Firefox support something called Auto-Complete. You've seen this many times. You go to a online form and as you start to type in fields you get a drop-down showing values you've typed in that field before. Th...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;26,844&lt;/i&gt; - Posted on: 23-Feb-2005 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/08/19/966.aspx"&gt;27. Intersection of Date Ranges&lt;/a&gt;&lt;/b&gt;&lt;br&gt;A friend of mine called me yesterday about a scheduling application he is working on. His question was so simple, or so it seemed, but it really drove me nuts. Basically he just wanted to find out if two date ranges intersected at all. Simple enough. It wa...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;24,593&lt;/i&gt; - Posted on: 19-Aug-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2006/01/11/14992.aspx"&gt;28. Tricking out the Desktop&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Something I have always been a sucker for is tricking out my desktop. I love any kind of tweak or gadget that enhances my pc and the whole user-experience thing. It's one of the many reasons I am looking forward to Vista. I've been a fan of applications th...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;24,497&lt;/i&gt; - Posted on: 11-Jan-2006 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/04/03/495.aspx"&gt;29. Retrieving database independent schema information&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Something that I think is often overlooked in the .NET Framework is the cool stuff you can get at using OleDbSchemaGuid to retrieve database schema information. I just thought of this again earlier today when I was reviewing a C# database application where...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;21,989&lt;/i&gt; - Posted on: 3-Apr-2004 &lt;/b&gt;&lt;br&gt;&lt;br&gt;
&lt;img src="/skins/ryanfarleyxpblue/images/icon-tip.gif" align="absmiddle"&gt; &lt;b&gt;&lt;A href="http://ryanfarley.com/blog/archive/2004/06/10/773.aspx"&gt;30. Creating Tracking Images for ASP.NET&lt;/a&gt;&lt;/b&gt;&lt;br&gt;Often with web applications you want to track traffic statistics to get a general idea of the number of visitors viewing a resource. Whether it be a web page, an RSS feed, an e-mail or whatever, you might want an inconspicuous way to determine that it has...&lt;br&gt;&lt;b&gt;Total views: &lt;i&gt;21,725&lt;/i&gt; - Posted on: 10-Jun-2004 &lt;/b&gt;&lt;/BLOCKQUOTE&gt;
&lt;/P&gt;
&lt;P&gt;Some of these are not as relevant now with .NET 2.0, so I guess I better get back on the bandwagon ;-)&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/22689.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>EZShellExtensions.Net Awesome Library for Easy Shell Extensions</title><link>http://ryanfarley.com/blog/archive/2006/03/29/19330.aspx</link><pubDate>Wed, 29 Mar 2006 14:41:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/03/29/19330.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/19330.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/03/29/19330.aspx#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/19330.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/19330.aspx</trackback:ping><description>&lt;P&gt;I came across Sky Software's EZShellExtensions.Net &lt;A href="http://www.larkware.com/dg5/TheDailyGrind844.html" target=_blank&gt;via The Daily Grind&lt;/A&gt; and decided to check it out. Wow. I have to say I just love this library. There are &lt;STRONG&gt;so&lt;/STRONG&gt; many different kinds of shell extensions you can easily do with hardly &lt;EM&gt;any&lt;/EM&gt; effort at all. Take a look at a few tests I threw together:&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://files.farleyzone.com/images/shellextensions1.jpg" border=0&gt;&lt;/P&gt;
&lt;P&gt;There is so much more that you can do this this library for shell extensions (see the link below for a full list of extensions you can do). Support for both VS 2003 and VS 2005, .NET 1.1 and .NET 2.0. Definitely worth checking out!&lt;/P&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://www.ssware.com/ezshell/ezshell.htm" target=_blank&gt;Check out EZShellExtensions.Net&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;And no, I am not &lt;EM&gt;only&lt;/EM&gt; posting this to get my &lt;A href="http://www.ssware.com/bloggers.htm" target=_blank&gt;free developer license&lt;/A&gt; ;-)&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/19330.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>Generating Thumbnails for PDF Pages</title><link>http://ryanfarley.com/blog/archive/2006/01/31/15840.aspx</link><pubDate>Tue, 31 Jan 2006 13:23:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2006/01/31/15840.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/15840.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2006/01/31/15840.aspx#Feedback</comments><slash:comments>18</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/15840.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/15840.aspx</trackback:ping><description>&lt;P&gt;I was making some changes to a website where I had some PDF files and I wanted to be able to post thumbnail images of the PDF file. There were enough PDF files for me to want to take the &lt;A title="Programmers are lazy..." href="http://blog.outer-court.com/archive/2005-08-24-n14.html" target=_blank&gt;lazy route&lt;/A&gt; and write some code to do it for me. I didn't want to go out and get some library that might have been able to do this for me, so I started poking around to see what I might already have to get the job done quickly.&lt;/P&gt;
&lt;P&gt;Turns out that Adobe Acrobat Professional does expose quite a bit via COM. So I decided to see how far I could get with it to accomplish the task of generating thumbnail images for my PDF files. Well, guess what? It worked. Sort of. I could successfully open the documents and get a reference to a page in the PDF, the problem was then getting an image of the page for the thumbnail. But, the page class does have a &lt;FONT face="Courier New"&gt;CopyToClipboard&lt;/FONT&gt; method where you can copy the currently referenced page to the clipboard&amp;nbsp;(and even specify the rect coordinates&amp;nbsp;you want to copy). While I am not thrilled about using the clipboard, I couldn't find any other route to get the task done, so I decided to go with that. Once you get the page copied to the clioboard, it is easy enough to get the clipboard data as an image and use it however you need.&lt;/P&gt;
&lt;P&gt;So I created an app that traversed the PDF images in a directory creating a thumbnail for each one. Pretty easy. Not the fastest thing ever, and it does use the clipboard so that rules out using this from a serviced context, but all in all it got the job done with flying colors. I put together a scaled down version of the app as a demo so I could post about it here. Here's the code in a simple form to generate a thumbnail image for the first page in the PDF file:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: green"&gt;// add reference to "Acrobat" COM server defined in "acrobat.tlb" 
&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// add using directives 
&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Runtime.InteropServices;
&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.Drawing;
&lt;SPAN style="COLOR: green"&gt;//...
&lt;/SPAN&gt;

Acrobat.CAcroPDDoc doc &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;
Acrobat.CAcroPDPage page &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;

&lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;
{
    &lt;SPAN style="COLOR: green"&gt;// instanciate adobe acrobat
&lt;/SPAN&gt;    doc &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (Acrobat.CAcroPDDoc)&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Acrobat.AcroPDDocClass();

    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (doc.Open(&lt;SPAN style="COLOR: #008080"&gt;@"C:\MyFile.pdf"&lt;/SPAN&gt;))
    {
        &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (doc.GetNumPages() &amp;gt; 0)
        {
            &lt;SPAN style="COLOR: green"&gt;// get reference to page
&lt;/SPAN&gt;            &lt;SPAN style="COLOR: green"&gt;// pages use a zero based index so 0 = page1
&lt;/SPAN&gt;            page &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (Acrobat.CAcroPDPage)doc.AcquirePage(0); 

            &lt;SPAN style="COLOR: green"&gt;// get dimensions of page and create rect to indicate full size
&lt;/SPAN&gt;            Acrobat.AcroPoint pt &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (Acrobat.AcroPoint)page.GetSize();
            Acrobat.CAcroRect rect &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Acrobat.AcroRectClass();
            rect.Top &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; 0;
            rect.Left &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; 0;
            rect.right &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; pt.x;
            rect.bottom &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; pt.y;

            &lt;SPAN style="COLOR: green"&gt;// copy current page to clipboard as image 
&lt;/SPAN&gt;            page.CopyToClipboard(rect, 0, 0, 100);

            &lt;SPAN style="COLOR: green"&gt;// get image from clipboard as bitmap
&lt;/SPAN&gt;            IDataObject data &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; Clipboard.GetDataObject();
            Bitmap bmp &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (System.Drawing.Bitmap)data.GetData(DataFormats.Bitmap);

            &lt;SPAN style="COLOR: green"&gt;// calculate new height and width for thumbnail and maintain aspect ratio
&lt;/SPAN&gt;            &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; h &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;)((double)pt.y &lt;SPAN style="COLOR: navy"&gt;*&lt;/SPAN&gt; ((double)100 &lt;SPAN style="COLOR: navy"&gt;/&lt;/SPAN&gt; (double)pt.x));
            &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; w &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; 100;

            &lt;SPAN style="COLOR: green"&gt;// create thumbnail
&lt;/SPAN&gt;            Image img &lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; bmp.GetThumbnailImage(w, h, &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;, IntPtr.Zero);
            img.Save(&lt;SPAN style="COLOR: #008080"&gt;@"C:\MyThumbnail.jpg"&lt;/SPAN&gt;, System.Drawing.Imaging.ImageFormat.Jpeg);
        }
    }
}
&lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt;
{
    &lt;SPAN style="COLOR: green"&gt;// if we get here and doc is null then we were unable to instanciate Acrobat
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (doc == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) MessageBox.Show(&lt;SPAN style="COLOR: #008080"&gt;"Acrobat is not installed. Adobe Acrobat is required."&lt;/SPAN&gt;);
}
&lt;SPAN style="COLOR: blue"&gt;finally&lt;/SPAN&gt;
{
    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (page !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) Marshal.ReleaseComObject(page);
    &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (doc !&lt;SPAN style="COLOR: navy"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) Marshal.ReleaseComObject(doc);
}&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;One thing to mention. The &lt;FONT face="Courier New"&gt;CopyToClipboard&lt;/FONT&gt; method does allow you to specify &amp;#8220;zoom&amp;#8220;, so why not just use that to size the thumbnail? When you specify a smaller zoom ratio, the image copied to the clipboard is still the size of the entire original document but has the image of the page sized smaller in the corner. Not exatly what I wanted. So I get the full image and then size it myself. Also, if you wanted, you don't have to size it smaller if you also wanted a full size image of the page.&lt;/P&gt;
&lt;P&gt;I threw together a small sample app using the code above to display and save any page from a PDF file.&lt;/P&gt;
&lt;P align=center&gt;&lt;IMG src="http://files.farleyzone.com/images/pdfthumbnailviewer.jpg" border=0&gt;&lt;/P&gt;
&lt;P&gt;Feel free to download the code for your own use &lt;EM&gt;(.NET 2.0 required and Acrobat 7.0 Pro&amp;nbsp;is also required. Version 7.0 is only required since that is the version my interop DLL is generated from although this does work with other lower versions as well)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;
&lt;DIV class=download&gt;&lt;A href="http://files.farleyzone.com/downloads/PDFThumbnail.zip"&gt;Download the code and executible&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/15840.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>kid.IsGood = (kid.Interest == Interests.Programming);</title><link>http://ryanfarley.com/blog/archive/2005/09/21/9907.aspx</link><pubDate>Wed, 21 Sep 2005 08:50:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2005/09/21/9907.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/9907.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2005/09/21/9907.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/9907.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/9907.aspx</trackback:ping><description>&lt;P&gt;I love to see how society evolves with technology. We're all so reliant on the internet now, thinking several years back things sure were different. I had a neighbor several years ago that was trying to teach his two young&amp;nbsp;daughters to be hackers. His thinking was that the &lt;EM&gt;l33t haxor skillz&lt;/EM&gt; would give his daughters an edge as they grew older and would put them ahead of the curve as far as their understanding of computers, networking, and programming. These skills would also&amp;nbsp;put them in a position to be ahead of technology with hopes that they would continue to grow with technology as it advanced.&lt;/P&gt;
&lt;P&gt;Admittedly, I've attempted the same with my kids. My kids are young, from 2 to almost 10 (I have 4, not counting the one on the way), but they understand the basic concepts of how the internet works. They know what is really happening when they visit a webpage, they understand the basic networking concepts that make the internet work. I've had them all watch as I've opened up one of their PCs to add or replace hardware and explained what all the parts are to them. I like to think that my kids are ahead of game when it comes to computers and technology, but that might not be the case.&lt;/P&gt;
&lt;P&gt;A new kids board game, called &lt;A href="http://c-jump.com/" target=_blank&gt;C-Jump&lt;/A&gt;, is now available that teaches kids the basic concepts behind programming languages such as C++ or Java. The object of the game is to get a skier down a mountain with the fastest route possible all by using C-style syntax and&amp;nbsp;the roll of a die to determine the value of &lt;EM&gt;x&lt;/EM&gt;. The kids determine the route down the hill by using very basic math and syntax such as &lt;FONT face="Courier New"&gt;if (x==5)&lt;/FONT&gt; or &lt;FONT face="Courier New"&gt;while (x &amp;lt; 3)&lt;/FONT&gt; where the die&amp;nbsp;provides the value&amp;nbsp;of x.&lt;/P&gt;
&lt;P&gt;
&lt;DIV align=center&gt;&lt;IMG alt="C-Jump board game for kids" src="http://files.farleyzone.com/images/cjumpgame.jpg" border=0&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://www.wired.com/news/technology/0,1282,68872,00.html?tw=wn_tophead_2" target=_blank&gt;Read the Wired article &amp;#8220;Come on Kids, Let's Play Programmer&amp;#8221;&amp;nbsp;about the game&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Looking at the game, I&amp;nbsp;think my older kids would have no problem figuring out how to play the game (my younger kids aren't there yet). It would be great to get them to understand the basics of programming languages at such a young age.&lt;/P&gt;
&lt;P&gt;The other day I read &lt;A href="http://www.larkware.com/dg4/TheDailyGrind713.html" target=_blank&gt;via Mike Gunderloy&lt;/A&gt; about how Morrison Schwartz has taken this a step further. &lt;A href="http://www.ms-inc.net/kpl.aspx" target=_blank&gt;Kids Programming Language&lt;/A&gt; is designed to teach kids that programming is fun, where they can see immediate and exciting results. It has it's own IDE and&amp;nbsp;entertaining samples. From the KPL website:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;EM&gt;KPL&amp;#8217;s language is modeled on the simplicity and readability of BASIC, but it is a structured rather than linear programming language. KPL lets children see eye-catching and immediate results from their programs, while teaching them fundamental concepts like variables, data types, loops, decision structures, methods and functions. KPL&amp;#8217;s data types include integers, decimals, strings, booleans, arrays, and user-defined structures.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;
&lt;DIV class=link&gt;&lt;A href="http://www.ms-inc.net/kpl.aspx" target=_blank&gt;Take a look at Kids Programming Language&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;While the language still seems like more than my young kids could handle, it is just awesome to see how society is starting to evolve and we're &lt;EM&gt;starting&lt;/EM&gt; to think of our kids having an knowledge of computers, to the extent&amp;nbsp;of knowing how to program them,&amp;nbsp;as a fundamental part of learning. &lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/9907.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Ryan Farley</dc:creator><title>Listing Recent Posts on your blog without any programming</title><link>http://ryanfarley.com/blog/archive/2005/08/15/8097.aspx</link><pubDate>Mon, 15 Aug 2005 21:15:00 GMT</pubDate><guid>http://ryanfarley.com/blog/archive/2005/08/15/8097.aspx</guid><wfw:comment>http://ryanfarley.com/blog/comments/8097.aspx</wfw:comment><comments>http://ryanfarley.com/blog/archive/2005/08/15/8097.aspx#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://ryanfarley.com/blog/comments/commentRss/8097.aspx</wfw:commentRss><trackback:ping>http://ryanfarley.com/blog/services/trackbacks/8097.aspx</trackback:ping><description>&lt;P&gt;If you visit my blog via a browser, you'll see that I added a &amp;#8220;Recent Posts&amp;#8221; section in the top left corner. This actually has some humor to it since &lt;A href="http://ryanfarley.com/blog/archive/2005/08/15/8095.aspx"&gt;I've been on a 82 day unplanned hiatus&lt;/A&gt;, so none of my posts are really &amp;#8220;recent&amp;#8221;. But, none the less, I wanted to share how I added that. I did absolutely no programming or changes to the blog controls. Just a few things to set up with NewsGator Online services and a single line to add to your blog (you can even add it in the &amp;#8220;news&amp;#8221; section if you use a hosted .Text or CommunityServer so you don't event need to touch anything on the server).&lt;/P&gt;
&lt;P&gt;So here are the steps to add your &amp;#8220;Recent Posts&amp;#8221; section to your blog:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Go to &lt;A href="http://www.newsgator.com/ngs/default.aspx" target=_blank&gt;NewsGator Online Services&lt;/A&gt; and register for a new standard/free account.&amp;nbsp;Your account will be active immediately so&amp;nbsp;sign-in to your account. 
&lt;LI&gt;Now we have to add your blog to the default&amp;nbsp;&amp;#8220;location&amp;#8220; for your account. Click the &amp;#8220;Add a Feed&amp;#8220; link, then select &amp;#8220;URL &amp;amp; Import&amp;#8220;. Here you can add the Uri for the rss feed for your blog. 
&lt;LI&gt;Now&amp;nbsp;go to &amp;#8220;Edit Locations&amp;#8220;, then click the link for &amp;#8220;Headlines&amp;#8220;. If you don't see a link for &amp;#8220;Edit Locations&amp;#8220; then click the link for &amp;#8220;Settings&amp;#8220; first. 
&lt;LI&gt;While in the Headlines area, check the box to &lt;EM&gt;enable headlines for this location&lt;/EM&gt;. Then edit the text in the text area to look something like this (You can modify this to look however you want. I added images in my list):&lt;BR&gt;&lt;BR&gt;&lt;PRE&gt;&amp;lt;p&amp;gt;&amp;lt;a title=$description$ href="$link$"&amp;gt;$title$&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/PRE&gt;&lt;BR&gt;
&lt;LI&gt;Modify the number of posts to show in the headlines (this will limit how many items you want to show in the Recent Posts list). 
&lt;LI&gt;Before you save the changes, you'll see, in bold, right above the checkbox, a line that starts with &lt;STRONG&gt;&lt;FONT face="Courier New"&gt;script src=&lt;/FONT&gt;&lt;/STRONG&gt;. Copy this line then save the changes. 
&lt;LI&gt;All you need to do now is add the line you copied from the Headlines page to your blog. The line for my blog looks like this:&lt;BR&gt;&lt;BR&gt;&lt;PRE&gt;&amp;lt;script src="http://services.newsgator.com/ngws/headlines.aspx?uid=66566&amp;amp;amp;mid=1"&amp;gt;&amp;lt;/script&amp;gt;&lt;/PRE&gt;&lt;BR&gt;
&lt;LI&gt;You can modify the pages/controls for your blog to add it somewhere, or if your blog is hosted somewhere and you don't have access to the files, simply add it to the News section under the Configuration options in the Admin pages (For .Text or CommunityServer, I'm sure other blogging engines have something similar).&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;That's it. Thanks to NewsGator's free service, you can add that where ever you want. You could add some other feed to that as well if you wanted. If you already have a NewsGator account, then you'll want to create a new location and add you blog to that location. The point is that the headlines show for all feeds in that location, so you want to have a location with just your blog feed added to it. Have fun.&lt;/P&gt;&lt;img src ="http://ryanfarley.com/blog/aggbug/8097.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>