<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/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Nick Harrison</title>
        <link>http://geekswithblogs.net/nharrison/Default.aspx</link>
        <description>Blog&amp;lt;Nick&amp;gt;.Next()</description>
        <language>en-US</language>
        <copyright>Nick Harrison</copyright>
        <managingEditor>neh123us@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Nick Harrison</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/nharrison/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>No excuses for Tables Breaking your Responsive Designs</title>
            <category>Stylish musings</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/04/03/no-excuses-for-tables-breaking-your-responsive-designs.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/04/03/no-excuses-for-tables-breaking-your-responsive-designs.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/04/03/no-excuses-for-tables-breaking-your-responsive-designs.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Modern thinking on web design is shunning the much loved table tag in html.   The most compelling reason is to make it easier to accommodate responsive designs, but there are additional reasons as well.&lt;/p&gt;  &lt;p&gt;For many the last bastion for the table is when displaying a list of records, after all tabular data should still fill at home in a table, butt if you allow this exception you bump into challenges leading to the table tags fall from grace in the first place.&lt;/p&gt;  &lt;p&gt;The problem is that tables require a rigid structure.   You need to be able to scan down a column of data to compare values.    You need to be able to easily keep context with a key column as you scan across a row of related data.    This does not lend itself well to smaller screens.&lt;/p&gt;  &lt;p&gt;Zurb Foundation includes provides an approach to accommodate &lt;a href="http://www.zurb.com/playground/responsive-tables" target="_blank"&gt;responsive tables&lt;/a&gt; using JavaScript to make the first column “sticky” and the rest of the columns will scroll on smaller screens.    This way you are less likely to loose context.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://css-tricks.com/responsive-data-table-roundup/" target="_blank"&gt;CSS Tricks&lt;/a&gt; also has a running commentary on various other approaches that have popped up.   Some approaches are better than others depending on you needs and project requirements.    Some relying on allowing the user to identify which columns are important and which can be hidden.     Some rely switching from a traditional table to duplicating the headers for each row and turning the table on its side when space becomes an issue.   One option showcased actually switches from a table to a graph at a key break point.  The key thing is that you get a regular table when you have the space but something that is still usable when space gets tight.&lt;/p&gt;  &lt;p&gt;There is also &lt;a href="http://themergency.com/footable/" target="_blank"&gt;footable&lt;/a&gt; which is a jQuery plugin that allows you to specify breakpoints that will get nested in the table as expandable regions when the screen width gets smaller.&lt;/p&gt;  &lt;p&gt;All of these approaches solve the problem of a rigid table breaking a responsive design without having to make many changes to your existing code.   Zurb’s solution and footable particularly can slip into your existing application with minimal interruption.     Now there is no excuse for tables of data breaking your responsive design.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;So how do you accommodate tables in your responsive design?&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152599.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/04/03/no-excuses-for-tables-breaking-your-responsive-designs.aspx</guid>
            <pubDate>Wed, 03 Apr 2013 15:05:40 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/04/03/no-excuses-for-tables-breaking-your-responsive-designs.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152599.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152599.aspx</trackback:ping>
        </item>
        <item>
            <title>Can Trim Packages Help Us Make Sense of OS Editions?</title>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/21/can-trim-packages-could-help-us-make-sense-out-of.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/21/can-trim-packages-could-help-us-make-sense-out-of.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/21/can-trim-packages-could-help-us-make-sense-out-of.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I was thinking about some of the confusion that springs up from time to time over how Microsoft names the editions of it Operating Systems.&lt;/p&gt;  &lt;p&gt;We can all agree that Windows RT is a particularly bad name.&lt;/p&gt;  &lt;p&gt;Unfortunately despite their best efforts, none of their names have been overwhelmingly successful.   There is always confusion over which version has which features and which version would be best for which user.&lt;/p&gt;  &lt;p&gt;I was thinking about how cars solve this problem.   They use trim levels.   Commonly this may be something along the lines of :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;CE &lt;/strong&gt;Classis Edition&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;LE&lt;/strong&gt;  Luxury Edition&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;XLE&lt;/strong&gt;  Extra Luxury  Edition&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Touring &lt;/strong&gt;Edition&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Limited  &lt;/strong&gt;Edition&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This Limited edition catches my attention.   Talk about counter intuitive.   With cars, this is the top of the line, but in any other context this would be the entry level model.   If you go to a Limited Service Hotel you will probably get little more than a basic bed in a cramped room with few other perks.    A Limited Service Restaurant would offer few features and a narrow menu.   A Limited Starbucks may drop some of the more esoteric drink options.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;So maybe we could use the car trim level model but turn it on its head to match what the rest of the world expects.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;RT becomes Windows 8 Limited&lt;/li&gt;    &lt;li&gt;Windows 8 becomes Windows 8 CE&lt;/li&gt;    &lt;li&gt;Windows 8 Pro becomes Windows 8 LE&lt;/li&gt;    &lt;li&gt;Windows 8 Enterprise could stay Windows 8 Enterprise cause that is already clear&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I would like to see Windows 8 Touring being high end hardware on a laptop / tablet form factor.    Mobile ready to go on a tour!&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I don’t know.   I think these levels may make more sense and could be more easily recognizable to consumers.&lt;/p&gt;  &lt;p&gt;This is also one of the area where BlackBerry fell short.   Even when they had the “Must Have” product, they had the worst names.  Calling a handset the Curve 9790 or the Bold Touch 9900 may make sense to the engineers designing them, but consumers are lost.&lt;/p&gt;  &lt;p&gt;Lenova is beginning to figure this out.    It is hard to get excited about T Series, X Series, L Series, S Series, etc.    But it is easier to understand the difference between “ThinkPad”  “IdeaPad”, and Essential Series.&lt;/p&gt;  &lt;p&gt;It is even easier to build excitement for &lt;a href="http://www.lenovo.com/products/us/laptop/ideapad/yoga/?menu-id=learn&amp;amp;ref-id=learn" target="_blank"&gt;Yoga&lt;/a&gt;.   Plus consumers can easily grasp the difference between Yoga 11 and Yoga 13.    So glad they decided not to go with a name like Y620 or something similar.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Now if we could brand it as Yoga Touring Edition, we would have marketing magic!&lt;/p&gt;  &lt;p&gt;Lenova if you read this, I am more than happy to accept a product sample to do a complete review!   Just let me know.   :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152484.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/21/can-trim-packages-could-help-us-make-sense-out-of.aspx</guid>
            <pubDate>Thu, 21 Mar 2013 17:52:06 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/21/can-trim-packages-could-help-us-make-sense-out-of.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152484.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152484.aspx</trackback:ping>
        </item>
        <item>
            <title>4 Simple CSS Tricks to Make Web Input Fields Look Better</title>
            <category>Stylish musings</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/19/4-simple-css-tricks-to-make-web-input-fields-look.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/19/4-simple-css-tricks-to-make-web-input-fields-look.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/19/4-simple-css-tricks-to-make-web-input-fields-look.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Most web sites will have an input form somewhere even if it is nothing more than a contact form.   Any &lt;strong&gt;web application &lt;/strong&gt;will have lots of input forms.&lt;/p&gt;  &lt;p&gt;Regardless of why you have the input form or what it is prompting form, we should strive to have them look as nice as possible to keep the user visually engaged.&lt;/p&gt;  &lt;p&gt;So here are a few CSS tricks we can use to make an input more visually engaging, less intimidating, and hopefully a little easier to use.&lt;/p&gt;  &lt;p&gt;Let’s start with a simple unassuming input form for entering search criteria:&lt;/p&gt;  &lt;p&gt;&lt;a href="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_2.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_thumb.png" width="659" height="138" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Padding is our friend&lt;/strong&gt;       &lt;p&gt;By adding a little padding to the left, the input values are not crammed against the left most border.    This will help make the form seem less compressed and will enhance white space.   I find that half an em works nicely&lt;/p&gt;      &lt;p&gt;&lt;a href="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_4.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_thumb_1.png" width="663" height="139" /&gt;&lt;/a&gt;&lt;/p&gt;      &lt;p&gt; &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Round the Corners &lt;/strong&gt;      &lt;p&gt;Rounded corners can help to soften the look of a harsh collection of rectangles for input fields.    We don’t have to round them by much unless that is the look you are going for.   Even something as subtle as adding a .5em border radius can make a subtle but nice addition, softening the edges&lt;/p&gt;      &lt;p&gt;&lt;a href="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_8.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_thumb_3.png" width="671" height="140" /&gt;&lt;/a&gt;&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Add focus&lt;/strong&gt;       &lt;p&gt;By using the :focus selector, you can make it easier for the user to track where they are. You can set the back ground color, add a box shadow, or whatever fits into the theme and look and feel for your site. One key thing to remember is that you don't want your page to have to reflow as the individual controls get focus so you may want to avoid changing the font or padding, etc.    Here I added a :focus selector to add a gradient color to the background and change the font color as well as add a box shadow.&lt;/p&gt;      &lt;p&gt;&lt;a href="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_6.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_thumb_2.png" width="686" height="147" /&gt;&lt;/a&gt;&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;&lt;strong&gt;Add a little Color&lt;/strong&gt;&lt;/p&gt;      &lt;p&gt;No where is it written that the input fields must be white.   Have some fun.   You have many options:&lt;/p&gt;      &lt;p&gt;Try a solid background: &lt;/p&gt;      &lt;p&gt;&lt;a href="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_10.png"&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/4-Simple-Tricks-to-Make-Web-Input-Fields_B7E3/image_thumb_4.png" width="692" height="147" /&gt;&lt;/a&gt;&lt;/p&gt;      &lt;p&gt;or a subtle gradient&lt;/p&gt;            &lt;p&gt;or a background image&lt;/p&gt;      &lt;p&gt;Experiment and see what looks best in your application.&lt;/p&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;For most of my sights, I use something similar to this changing the actual values based on the color scheme I am using.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;input[type=text] {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    height:1.5em;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    padding:5px 5px 0px .4em;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    margin-bottom: 10px ;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    border-radius:.5em;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    -moz-border-radius:.5em;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    -webkit-border-radius:.5em;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    text-transform:none;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    width:150px;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    background:#5E768D;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    background:-webkit-gradient(linear, left top, left 25, from(#FFFFFF), &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;            color-stop(4%,#c6d1da), to(#5E768D));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    color:#fff;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    font-size:1.1em;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;input[type=text]:focus{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    box-shadow:3px 3px 10px #446;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    outline:none;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;For drop down lists, I recommend &lt;a href="http://geekswithblogs.net/nharrison/archive/2013/01/15/have-you-seen-chosen.aspx" target="_blank"&gt;Chosen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;How do you style your input controls?&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152458.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/19/4-simple-css-tricks-to-make-web-input-fields-look.aspx</guid>
            <pubDate>Tue, 19 Mar 2013 18:07:39 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/19/4-simple-css-tricks-to-make-web-input-fields-look.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152458.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152458.aspx</trackback:ping>
        </item>
        <item>
            <title>The Art and Science of Blogging</title>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/14/the-art-and-science-of-blogging.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/14/the-art-and-science-of-blogging.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/14/the-art-and-science-of-blogging.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many of us with technical blogs started a blog as just a place to jot down stuff we figured out so that we could easily find it later.   &lt;/p&gt;  &lt;p&gt;But if you have ever been thrilled to check the stats on your blog and see that 1,000 people have read one of your entries or been excited to see your blog mentioned on twitter, or had a boost of confidence when someone in an interview mentioned reading your blog, you will want that feeling again.&lt;/p&gt;  &lt;p&gt;Regardless of why you blog, you quickly learn that blogging effectively is as much art as science.&lt;/p&gt;  &lt;p&gt;Kiesha Easley has an active blog at &lt;a href="http://weblogbetter.com/" target="_blank"&gt;WeBlogBetter&lt;/a&gt; devoted to flushing out some of this art and science that can help you capture some of the excitement and energy.&lt;/p&gt;  &lt;p&gt;While she is probably not a true “geek” she approaches many of these concepts with a no nonsense sensibility that appeals to geeks.    Her site offers practical advice with posts such as  &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://weblogbetter.com/2013/03/07/post-when-youre-creative-vs-creative-when-you-post/" target="_blank"&gt;Post When You're Creative vs. Creative When You Post&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogbetter.com/2013/03/11/6-reasons-why-you-are-unfollowed-on-twitter/" target="_blank"&gt;6 Reasons Why You are Unfollowed On Twitter&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogbetter.com/2013/02/26/3-review-types-to-drive-blog-traffic/" target="_blank"&gt;3 Review Types to Drive Blog Traffic&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogbetter.com/2012/07/25/5-ways-how-to-make-your-blog-sticky-and-keep-your-readers/" target="_blank"&gt;5 Ways to Make Your Blog Sticky and Keep Your Readers&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogbetter.com/2012/08/23/5-ways-to-attract-more-comments-on-your-blog/" target="_blank"&gt;5 Ways to Attract More Comments on Your Blog&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogbetter.com/2012/12/31/how-to-create-the-worst-homepage-ever/" target="_blank"&gt;How to Create the Worst Homepage Ever&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogbetter.com/2013/01/16/the-secret-to-getting-blog-comments/" target="_blank"&gt;The Secret to Getting Blog Comments&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;If you blog just to have an online spot to log your own thoughts, you may not be interested.&lt;/p&gt;  &lt;p&gt;But if you are interested in kicking things up a notch, spend some time on her site.   You may learn a new trick or two.&lt;/p&gt;  &lt;p&gt;If you are already rising to the ranks of celebrity programmer, hit the comments and share what has worked for you.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152403.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/14/the-art-and-science-of-blogging.aspx</guid>
            <pubDate>Thu, 14 Mar 2013 13:23:48 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/14/the-art-and-science-of-blogging.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152403.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152403.aspx</trackback:ping>
        </item>
        <item>
            <title>Reviewing Knockout.js Succinctly</title>
            <category>Book Reviews</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/11/reviewing-knockout.js-succinctly.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/11/reviewing-knockout.js-succinctly.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/11/reviewing-knockout.js-succinctly.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Over the weekend I sat down with another book in the Succinctly series.   I have wanted to learn more about &lt;a href="http://www.syncfusion.com/resources/techportal/ebooks/knockoutjs" target="_blank"&gt;Knockout.js&lt;/a&gt; for a while now.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I approached this book knowing very little about &lt;a href="http://www.syncfusion.com/resources/techportal/ebooks/knockoutjs" target="_blank"&gt;Knockout.js&lt;/a&gt;, but I do know a fair amount about JavaScript, jQuery, etc.   Turns out I am their target audience.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;If you need a book that will introduce and explain JavaScript.    This is not the book for you.&lt;/p&gt;  &lt;p&gt;If you need a book that will explain how AJAX works.   This is not the book for you.&lt;/p&gt;  &lt;p&gt;If you need a book that will explain how to use HTML or CSS.   This is not the book for you.&lt;/p&gt;  &lt;p&gt;If you are already familiar with these concepts but want to quickly get up to speed on Knockout.js, this is the book for you.   &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The book is very well structured.   It flows nicely from concept to concept with each concept building on the previous one in a nice logical progression.    The author does a good job of isolating details that are not relevant to the core concepts being discussed.    He briefly mentions that any server side language can be used for responding to AJAX calls without getting bogged down with any details on how.   He briefly mentions that any tool or framework can be used to render the html and JavaScript without getting bogged down in the details of how or why.     &lt;/p&gt;  &lt;p&gt;It doesn’t matter whether you are using ASP.Net, MVC, JSP, PHP, PERL, Ruby, etc.    The book stays true to its core intention of explain &lt;a href="http://www.syncfusion.com/resources/techportal/ebooks/knockoutjs" target="_blank"&gt;Knockout.js&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Having read this book and worked my way through the various sample pages he presents, I am ready to try my hand at a little Knockout.js on my own.    Also like the other Succinctly books that I have looked at, this will easily be a handy quick reference after the fact.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;If you already know Knockout.js still it check it out.   I would love to hear your perspective.   If you are using Knockout.js, I would love to hear what you are doing.    Share your experiences in the comments.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152376.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/11/reviewing-knockout.js-succinctly.aspx</guid>
            <pubDate>Mon, 11 Mar 2013 12:29:38 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/11/reviewing-knockout.js-succinctly.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152376.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152376.aspx</trackback:ping>
        </item>
        <item>
            <title>A Simple Grammar for Excel Views in MVC</title>
            <category>MVC</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/05/a-simple-grammar-for-excel-views-in-mvc.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/05/a-simple-grammar-for-excel-views-in-mvc.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/05/a-simple-grammar-for-excel-views-in-mvc.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In a recent blog, I wrote about &lt;a href="http://geekswithblogs.net/nharrison/archive/2013/02/13/build-a-custom-view-engine-to-create-excel-files-in.aspx" target="_blank"&gt;Building A Custom View Engine to Create Excel Files in MVC&lt;/a&gt;.   In this blog, I skipped over the grammar that we might use in the View definition.&lt;/p&gt;  &lt;p&gt;I have had a few people email me to fill in this gap.&lt;/p&gt;  &lt;p&gt;If you haven’t already read this blog, I encourage you to do so before continuing.   Most of the content here will assume that you are already familiar with what we have already covered.&lt;/p&gt;  &lt;p&gt;In this previous blog, we defined a new View Engine that could be used to build  and send Excel files back to the user as the view.   The goal being to separate the content of the View from the mechanics of creating the actual spread sheet.&lt;/p&gt;  &lt;p&gt;Let’s consider a typical use case.   &lt;/p&gt;  &lt;p&gt;You have a page that displays a list of search results and you want to export these results to Excel.   This is a very common user request.    By structuring this as an Excel view, we don’t have to get bogged down in the mechanics of creating the spread sheet and the grammar that we follow allows the View Engine to be oblivious to what is actually going into the final spreadsheet.&lt;/p&gt;  &lt;p&gt;In defining our simple grammar.   We are going to make a couple of assumptions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The Model passed to the View will be an IList&amp;lt;T&amp;gt;  where T is the type for the data being displayed&lt;/li&gt;    &lt;li&gt;All of the values mapped to the excel file will be retrieved through properties of T (or properties of properties of T)&lt;/li&gt;    &lt;li&gt;Our grammar will not support calling functions or conditional logic only property references&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;With these assumptions in mind, let’s consider what we may need to define for our Excel file.   We want to be able to specify:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Column Headers&lt;/li&gt;    &lt;li&gt;Column Values&lt;/li&gt;    &lt;li&gt;Column Widths&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For this grammar we will have three keywords:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;HEADER:&lt;/li&gt;    &lt;li&gt;VALUES:&lt;/li&gt;    &lt;li&gt;WIDTHS:&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To keep things simple, we will require that each key word be on a line by itself and that the values for the key word be separated by the pipe character “|”&lt;/p&gt;  &lt;p&gt;With these rules in place, a sample View Definition may look this:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;HEADER:Unique Id|Name| PhoneNumber|Status|Payment Scheduled Date&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;VALUES: UniqueId | Name |  TelephoneNumber | DecodedStatus| PaymentsDate &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;WIDTH:14|32|15|30|30&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;



&lt;p&gt;This will define that we 5 columns with these specified headers and we have specified widths for each of these columns.    The values listed after the VALUES: keyword will correspond to properties in the object making up the model.&lt;/p&gt;

&lt;p&gt;We want to keep this grammar simple because we don’t have editor support for maintaining this file.   Also as long as you are using an View Model for your Model the restriction of requiring property references is not as restrictive as it may seem at first.    You can easily implement your property in the View Model to accommodate any function calls that would be required.&lt;/p&gt;

&lt;p&gt;Our View Engine will stay the same from the previous blog with one exception.   The CreateView method now looks like this:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; IView CreateView(ControllerContext controllerContext, &lt;span class="kwrd"&gt;string&lt;/span&gt; viewPath, &lt;span class="kwrd"&gt;string&lt;/span&gt; masterPath)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   var modelType = controllerContext.Controller.ViewData.ModelMetadata.ModelType;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   var contentType = modelType.GetGenericArguments().FirstOrDefault();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;   var item = CreateGeneric(&lt;span class="kwrd"&gt;typeof&lt;/span&gt; (ExcelView&amp;lt;&amp;gt;), contentType&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;                                     , viewPath) &lt;span class="kwrd"&gt;as&lt;/span&gt; IView;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;   &lt;span class="kwrd"&gt;return&lt;/span&gt; item;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Because we assume that the Model will be of type IList&amp;lt;T&amp;gt;, we only need to let the View know about the T.&lt;/p&gt;

&lt;p&gt;Most of the changes in the View will be seen in the render method:&lt;/p&gt;

&lt;div class="csharpcode"&gt;&lt;span class="lnum"&gt;&lt;/span&gt;&lt;/div&gt;

&lt;div class="csharpcode"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Render(ViewContext viewContext, TextWriter writer)&lt;/div&gt;

&lt;p class="csharpcode"&gt;
  &lt;/p&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; filePath = viewContext.HttpContext.Server.MapPath(ViewPath);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt;[] fileContents = File.ReadAllLines(filePath);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    var model = viewContext.ViewData.Model &lt;span class="kwrd"&gt;as&lt;/span&gt; IList&amp;lt;ContentType&amp;gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; action = viewContext.RouteData.Values[&lt;span class="str"&gt;"action"&lt;/span&gt;].ToString();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd"&gt;using&lt;/span&gt; (var excelPackage = &lt;span class="kwrd"&gt;new&lt;/span&gt; ExcelPackage())&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        ActiveSheet = excelPackage.Workbook.Worksheets.Add(action);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        ActiveSheet.Name = action;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        viewContext.HttpContext.Response.ClearContent();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        CurrentRow = 1;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var line &lt;span class="kwrd"&gt;in&lt;/span&gt; fileContents)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;            ProcessHeader(line);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            ProcessWidth(line);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;            ProcesValues(line,model);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        var response = viewContext.HttpContext.Response;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        response.BinaryWrite(excelPackage.GetAsByteArray());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        response.AddHeader(&lt;span class="str"&gt;"content-disposition"&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                            &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"attachment;filename={0}.xlsx"&lt;/span&gt;, action));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        response.ContentType = &lt;span class="str"&gt;"application/excel"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        response.Flush();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        response.End();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;}&lt;/pre&gt;


&lt;p class="csharpcode"&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Everything should look familiar from the earlier blog up the three methods called called inside the for loop.&lt;/p&gt;

&lt;p&gt;These three methods check for their specific keywords and handle the appropriate processing.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ProcessHeader( &lt;span class="kwrd"&gt;string&lt;/span&gt; line)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (line.StartsWith(&lt;span class="str"&gt;"HEADER:"&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        var template = line.Replace(&lt;span class="str"&gt;"HEADER:"&lt;/span&gt;, &lt;span class="str"&gt;""&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        var headers = template.Split(&lt;span class="str"&gt;'|'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; col = 1;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var header &lt;span class="kwrd"&gt;in&lt;/span&gt; headers)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            ActiveSheet.Cells[CurrentRow, col++].Value = header;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        ActiveSheet.Cells[CurrentRow, 1, 1, col]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            .Style.Font.Bold = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        CurrentRow++;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We will simply output the values associated with the HEADER keyword unchanged.   &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ProcessWidth( &lt;span class="kwrd"&gt;string&lt;/span&gt; line)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (line.StartsWith(&lt;span class="str"&gt;"WIDTH:"&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        var template = line.Replace(&lt;span class="str"&gt;"WIDTH:"&lt;/span&gt;, &lt;span class="str"&gt;""&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;int&lt;/span&gt; col = 1;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var width &lt;span class="kwrd"&gt;in&lt;/span&gt; template.Split( &lt;span class="str"&gt;'|'&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            ActiveSheet.Column(col).Width = Int32.Parse(width);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            col++;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
The &lt;a href="http://epplus.codeplex.com/" target="_blank"&gt;EPPlus&lt;/a&gt; library makes it easy to set the width of a column.









&lt;p&gt; &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ProcesValues( &lt;span class="kwrd"&gt;string&lt;/span&gt; line, IEnumerable&amp;lt;ContentType&amp;gt; model)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (line.StartsWith( &lt;span class="str"&gt;"VALUES:"&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        var template = line.Replace(&lt;span class="str"&gt;"LIST:"&lt;/span&gt;, &lt;span class="str"&gt;""&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        var columns = template.Split(&lt;span class="str"&gt;'|'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var item &lt;span class="kwrd"&gt;in&lt;/span&gt; model)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            &lt;span class="kwrd"&gt;int&lt;/span&gt; col = 1;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var column &lt;span class="kwrd"&gt;in&lt;/span&gt; columns)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;                ActiveSheet.Cells[CurrentRow, col++].Value = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;                    EvaluateValue(item, column);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;            CurrentRow++;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The outer loop loops through the items in the model while the inner loop loops through the values associated with the VALUES keyword.&lt;/p&gt;

&lt;p&gt;The magic of pulling the requested value from the model happens in the EvaluateValue method:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; EvaluateValue (ContentType record, &lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    var genericArgument = &lt;span class="kwrd"&gt;typeof&lt;/span&gt; (ContentType);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    var pe = Expression.Parameter(genericArgument, &lt;span class="str"&gt;"p"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;value&lt;/span&gt; = &lt;span class="kwrd"&gt;value&lt;/span&gt;.Trim();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span class="kwrd"&gt;value&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    var components = &lt;span class="kwrd"&gt;value&lt;/span&gt;.Split(&lt;span class="str"&gt;'.'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    Expression referenceExpression = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (components.Count() &amp;gt; 0)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        referenceExpression = Expression.Property(pe, components[0]);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var component &lt;span class="kwrd"&gt;in&lt;/span&gt; components.Skip(1))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;            referenceExpression = Expression.Property(referenceExpression, component);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;value&lt;/span&gt;.StartsWith(&lt;span class="str"&gt;"\""&lt;/span&gt;))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        referenceExpression = Expression.Constant(&lt;span class="kwrd"&gt;value&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (referenceExpression == &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;    referenceExpression = Expression.Convert(referenceExpression, &lt;span class="kwrd"&gt;typeof&lt;/span&gt; (&lt;span class="kwrd"&gt;object&lt;/span&gt;));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;    var expression = Expression.Lambda&amp;lt;Func&amp;lt;ContentType, &lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        (referenceExpression, pe).Compile();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;    var data = expression.Invoke(record );&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; data != &lt;span class="kwrd"&gt;null&lt;/span&gt; ? data.ToString() : &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The foreach loop on line 13 shows the recursive calls that are needed to pull nested properties.    This allows you to refer to properties such as &lt;font face="Lucida Console"&gt;Data.Contact.Address.State&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;When you start worrying about performance or if you are dealing with large excel exports, you may want to consider caching the reference expressions to optimize this functions, but that should be fairly straightforward. &lt;/p&gt;

&lt;p&gt;This simple grammar allows us to define some fairly complex Excel exports without ever having to write any excel code or deal with any of the objects in the &lt;a href="http://epplus.codeplex.com/" target="_blank"&gt;EPPlus&lt;/a&gt; library outside of the View Engine.&lt;/p&gt;

&lt;p&gt;This should provide a good foundation to build up your own grammar for defining Excel views.&lt;/p&gt;

&lt;p&gt;Please share the grammars that you come up with or the use cases that you find.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152330.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/05/a-simple-grammar-for-excel-views-in-mvc.aspx</guid>
            <pubDate>Tue, 05 Mar 2013 21:17:16 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/05/a-simple-grammar-for-excel-views-in-mvc.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152330.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152330.aspx</trackback:ping>
        </item>
        <item>
            <title>Programming Is Not for Everybody?  Everyone needs to be Encouraged!</title>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/04/programming-is-not-for-everybody.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/04/programming-is-not-for-everybody.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/04/programming-is-not-for-everybody.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I just read this blog &lt;a href="http://symbo1ics.com/blog/?p=1615" target="_blank"&gt;Programming Is Not for Everybody&lt;/a&gt;.   I have to admit to being taken aback by the premise.&lt;/p&gt;  &lt;p&gt;I believe that in their heart of hearts everyone wishes that they could program computers.   No it is not always a glamorous profession.   It is often boring and tedious.   It is almost always difficult to explain what you do.    There are days when you wonder why do you put yourself through it all.&lt;/p&gt;  &lt;p&gt;But if you ever experience a  “Holy Crap It worked” moment, you are hooked.    &lt;/p&gt;  &lt;p&gt;Many programmers are more artist than anything else.   We adapt to work in the business world.   We adapt to solve business problems or scientific problems or whatever domain we have find that signs the pay checks, but the passion that drives us is the pursuit of the elegant solution, the beauty of a design brought to life (even if very few will ever see the true beauty),  and the thrill of bending a computer to your will.&lt;/p&gt;  &lt;p&gt;How do I know that this is the secret dream of the masses?&lt;/p&gt;  &lt;p&gt;If you are in a programming shop, ask yourself how many of your co workers studied computer science.    Chances are, not all of them will have a degree in Computer Science.    Chances are you will know many people who studied something else first.   I have friends who studied History in college, and went on to be outstanding DBAs.    I have friends who earned their CPA only to discover that they preferred an Access database or the macros in Excel to their accounting duties.    I know people from dozens of different educational backgrounds who migrated to IT and development specifically after college.   I know many who discovered their passion earlier and skipped college all together, and are still successful.    Granted you will have the best chances for success by starting out with a degree in Computer Science, but this hardly the only entry point.&lt;/p&gt;  &lt;p&gt;I do not know anyone who studied Computer Science who has not stayed in that field.     Where else can you make that claim.&lt;/p&gt;  &lt;p&gt;Programming may not be for everyone, but if you have ever toyed with the idea, it probably is for you.    If you have ever taken a calculator apart wondering how it works.   If you have ever stared in awe at the source code for a web page and wondered how does this work, it probably is for you.    &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;We have a shortage of programmers in this country.   Anyone with an interest needs to be encouraged to pursue it.    Not with false claims of glory and glamour, but with the realization that when the code works, there is no greater thrill.       We need to aggressively seek out anyone who looks like they have the potential to enjoy this passion, and encourage them.   It is not always easy, but it is rewarding, and we need more programmers.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;If you have ever wondered if programming is right for you, by simply asking the question, you have answered it for yourself.    That curiosity alone means that it is and you will have the ride of your life finding it out.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152319.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/04/programming-is-not-for-everybody.aspx</guid>
            <pubDate>Mon, 04 Mar 2013 20:48:24 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/04/programming-is-not-for-everybody.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152319.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152319.aspx</trackback:ping>
        </item>
        <item>
            <title>Dynamic Sorting with LINQ</title>
            <category>LINQ</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/04/dynamic-sorting-with-linq.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/04/dynamic-sorting-with-linq.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/04/dynamic-sorting-with-linq.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;If you use LINQ to retrieve data and display this data in a grid, you may have come across the problem of allowing the user to control how the data is sorted.    Users always want to be able to sort data on their own.&lt;/p&gt;  &lt;p&gt;GridView makes it easy to wire up an event handler or trigger an action to handle the sorting.   The problem is that such sorting is not necessarily so straightforward with LINQ.&lt;/p&gt;  &lt;p&gt;A common approach is to hard code a giant if statement listing out the possibilities:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; IQueryable&amp;lt;FileImport&amp;gt; SortFiles&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:                &lt;/span&gt;(IQueryable&amp;lt;FileImport&amp;gt; files, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;               &lt;span class="kwrd"&gt;string&lt;/span&gt; orderBy)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (orderBy == &lt;span class="str"&gt;"FileName"&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        files = files.OrderBy(o =&amp;gt; o.FileName);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (orderBy == &lt;span class="str"&gt;"ImportDate"&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        files = files.OrderBy(o =&amp;gt; o.ImportDate);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;  . . .&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; files;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;



&lt;p&gt; &lt;/p&gt;

&lt;p&gt;While this is dynamic, it only works for the one data type,  forces a brittle dependency on the property names, and has to be changed whenever a new property is added.&lt;/p&gt;

&lt;p&gt;A better approach may be to use ExpressionTrees and dynamically build up the whole call to the OrderBy function.&lt;/p&gt;

&lt;p&gt;Consider this extension method:
  &lt;/p&gt;&lt;div class="csharpcode"&gt;
    &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IOrderedQueryable&amp;lt;TSource&amp;gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    GenericEvaluateOrderBy&amp;lt;TSource&amp;gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        (&lt;span class="kwrd"&gt;this&lt;/span&gt; IQueryable&amp;lt;TSource&amp;gt; query,&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;string&lt;/span&gt; propertyName)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    var type = &lt;span class="kwrd"&gt;typeof&lt;/span&gt; (TSource);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    var parameter = Expression.Parameter(type, &lt;span class="str"&gt;"p"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    var propertyReference = Expression.Property(pe, propertyName);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    var sortExpression = Expression.Call(&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;typeof&lt;/span&gt; (Queryable),&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="str"&gt;"OrderBy"&lt;/span&gt;,&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; Type[] {type},&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        Expression.Lambda&amp;lt;Func&amp;lt;TSource, &lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;&amp;gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;            (propertyReference, &lt;span class="kwrd"&gt;new&lt;/span&gt;[] { parameter }));&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; query.Provider.CreateQuery&amp;lt;TSource&amp;gt;(sortExpression);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;}&lt;/pre&gt;
  &lt;/div&gt;


&lt;p&gt; &lt;/p&gt;

&lt;p&gt;With this method in place, you can sort by any column on any ViewModel:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(sortExpression))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;   query = query.GenericEvaluateOrderBy(sortExpression);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt; query;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In this case the sortExpression variable would come from the Sort method on the GridView.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Learn this and other tricks at &lt;a href="https://www.simple-talk.com/dotnet/.net-framework/dynamic-linq-queries-with-expression-trees/" target="_blank"&gt;Simple Talk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;How are you using Dynamic LINQ queries?&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152318.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/04/dynamic-sorting-with-linq.aspx</guid>
            <pubDate>Mon, 04 Mar 2013 18:01:08 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/04/dynamic-sorting-with-linq.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152318.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152318.aspx</trackback:ping>
        </item>
        <item>
            <title>Jedi Mind Meld</title>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/04/jedi-mind-meld.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/04/jedi-mind-meld.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/04/jedi-mind-meld.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="float: left"&gt;   &lt;p&gt;I try to keep politics out of my technical blog, but I figured that as long as I keep the focus, narrowly defined, I guess we should be OK.&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;img style="float: right" src="http://data.whicdn.com/images/21562283/use-your-force-harry_large.jpg" /&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;We need to be careful reading too much into this slip of the tongue.   I think the president as proving repeatedly that he is a fan of both franchises.   I pretty sure that this is a humorous slip of the tongue and nothing more.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;If the tech community wants to get up and arms over  the President, we have other issues worthy of out attention.    Cyber weapons, privacy, piracy, and drones come to mind.&lt;/p&gt;  &lt;p&gt;If you want to focus on what he has done for the tech community we can focus on how he embraces social media, the role of big data in the campaign, or the fact that he does seem to be the first one to take cyber security even a little bit serious.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;So while there are plenty of issues to praise him for and to take offense by, the Jedi Mind Meld is simply not one of them.   Hopefully it will actually become a funny Internet meme along the lines of the treasured “Use the Force Harry” &lt;/p&gt;  &lt;p&gt;Thus ends the political portion of this blog.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152317.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/04/jedi-mind-meld.aspx</guid>
            <pubDate>Mon, 04 Mar 2013 17:11:43 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/04/jedi-mind-meld.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152317.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152317.aspx</trackback:ping>
        </item>
        <item>
            <title>Exporting  XML Comments to Your Application</title>
            <category>Documentation</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/03/01/exporting--xml-comments-to-your-application.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/03/01/exporting--xml-comments-to-your-application.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/03/01/exporting--xml-comments-to-your-application.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Recently I &lt;a href="http://geekswithblogs.net/nharrison/archive/2013/02/28/adding-sql-doc-documentation-to-you-project.aspx" target="_blank"&gt;blogged&lt;/a&gt; about adding &lt;a href="http://www.red-gate.com/products/sql-development/sql-doc/" target="_blank"&gt;SQL Doc&lt;/a&gt; Documentation to you Application.    This makes it easy to keep your documentation visible and more likely current.&lt;/p&gt; &lt;p&gt;I wanted to do the same thing with my code documentation.   I wanted to leverage the work taken to add XML comments and add even more visibility.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;There are already tools readily available to convert these XML comments to MSDN looking documentation or help files, and these comments get incorporated into intellisense as you are writing code.&lt;/p&gt; &lt;p&gt;I did not want MSDN style documentation.   I wanted documentation that could be incorporated into the actual application and look like it flowed with everything else.    &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;When you build a project, you can specify the XML Documentation file.   All of your XML Comments will be added to this file:&lt;/p&gt; &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Adding-XML-Comments-to-you_95F1/image_2.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Adding-XML-Comments-to-you_95F1/image_thumb.png" width="774" height="306" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Since this is XML, getting the output to look the way that I want seems like a perfect problem for XSLT to solve.&lt;/p&gt; &lt;p&gt;A little Google searching, brought me to this page on &lt;a href="http://www.codeproject.com/Articles/9698/Simple-XSLT-stylesheet-for-Visual-Studio-NET-XML-d" target="_blank"&gt;Code Project&lt;/a&gt;.   Here Emma Burrows provides a base template formatting this XML.&lt;/p&gt; &lt;p&gt;Out of the box, we have a vanilla set of documentation.    Not bad, but not fancy, and it does not look like it flows with the rest of the application.   We have a blank slate ready to style:&lt;/p&gt; &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Adding-XML-Comments-to-you_95F1/image_4.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Adding-XML-Comments-to-you_95F1/image_thumb_1.png" width="736" height="400" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;For the most part, all  we really have to do is style the output.   In some cases, I added classes to the template to simplify matters.&lt;/p&gt; &lt;p&gt;I created the following classes:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;typeName  to Style the Types&lt;/li&gt; &lt;li&gt;summary to give consistent formatting to the summary sections in the documentation&lt;/li&gt; &lt;li&gt;memberType to separate the different member types such as properties, methods, events, etc&lt;/li&gt; &lt;li&gt;memberName to separate the individual members&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Adding the class to the template is straightforward.   You just find where the corresponding element is being created.   Emma has already done most of the heavy lifting for us.&lt;/p&gt; &lt;p&gt;So this code:&lt;/p&gt; 
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;  &lt;span class="rem"&gt;&amp;lt;!-- Display the type's name and information --&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;H2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="$MemberName"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;H2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:apply-templates&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
]]&gt;&lt;/style&gt;

&lt;p&gt;become this:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;  &lt;span class="rem"&gt;&amp;lt;!-- Display the type's name and information --&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;H2&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt; &lt;span class="kwrd"&gt;="typeName"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:value-of&lt;/span&gt; &lt;span class="attr"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;="$MemberName"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;H2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;xsl:apply-templates&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Also if you wanted to change the tags being used, this is also a fairly trivial change as well.&lt;/p&gt;
&lt;p&gt;In honesty, the tags that Emma uses work well.   You don’t actually have to add the classes, but it does make it easier to style.&lt;/p&gt;
&lt;p&gt;Inside your application, there are a couple of things you will need to do to wire all of this together:&lt;/p&gt;
&lt;p&gt;Fist, add an extension method similar to &lt;a href="http://weblogs.asp.net/jigardesai/archive/2008/02/08/xslt-transformation-in-asp-net-mvc-framework.aspx" target="_blank"&gt;Jigar Desia's RenderXML&lt;/a&gt;.   This method makes it easy to associate an XmlDocument and an XSLT template.&lt;/p&gt;
&lt;p&gt;Mine looks like this:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RenderXML&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;  ViewPage&amp;lt;T&amp;gt; page, &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    XmlDocument xmlDocument, &lt;span class="kwrd"&gt;string&lt;/span&gt; xsltPath,&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; xslArgParams)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    var context = page.Html.ViewContext;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    var xslArgs = &lt;span class="kwrd"&gt;new&lt;/span&gt; XsltArgumentList();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (xslArgParams != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt; key &lt;span class="kwrd"&gt;in&lt;/span&gt; xslArgParams.Keys)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            xslArgs.AddParam(key, &lt;span class="kwrd"&gt;null&lt;/span&gt;, xslArgParams[key]);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    var t = &lt;span class="kwrd"&gt;new&lt;/span&gt; XslCompiledTransform();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    t.Load(xsltPath);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    t.Transform(xmlDocument, xslArgs,&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                context.HttpContext.Response.Output);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Next I defined a CodeDocumnentationViewModel&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CodeDocumentationViewModel
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; XmlDocument Code { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; IList&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; AvailableFiles { get; set; }
}&lt;/pre&gt;
&lt;p&gt;
&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
]]&gt;&lt;/style&gt;
This will provide an XmlDocument for the file currently selected as well as list of all available XML files
&lt;p&gt;Inside the View, this is all we need to do display the formatted documentation:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (Model.Code != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt; = &lt;span class="kwrd"&gt;"codeComments"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;.RenderXML(Model.Code,&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;                       Server.MapPath(&lt;span class="str"&gt;"/Documentation/CodeComments/documentation.xsl"&lt;/span&gt;), &lt;span class="kwrd"&gt;null&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;  &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;img&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="../../Content/images/CodeComments.png"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;  &lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;  &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt; &lt;/pre&gt;&lt;pre&gt;If we don’t have a valid XmlDocument, we will simply display a place holder picture, otherwise, we will call the RenderXML.&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;&lt;pre&gt;The other thing left to do is to add a display listing out the available files.&lt;/pre&gt;
&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h1&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="ui-widget-header"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Available Files&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h1&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt; = &lt;span class="kwrd"&gt;"ui-widget"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var file &lt;span class="kwrd"&gt;in&lt;/span&gt; Model.AvailableFiles  )&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;  &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt; &lt;span class="kwrd"&gt;="ui-state-default"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;= Html.ActionLink(file, &lt;span class="str"&gt;"ShowCode"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; {fileName= file}) &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;  &lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;} &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In the end, I think that the format looks pretty good.   What do you think?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Adding-XML-Comments-to-you_95F1/code_2.png"&gt;&lt;img title="code" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="code" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Adding-XML-Comments-to-you_95F1/code_thumb.png" width="729" height="409" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152274.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/03/01/exporting--xml-comments-to-your-application.aspx</guid>
            <pubDate>Fri, 01 Mar 2013 17:07:00 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/03/01/exporting--xml-comments-to-your-application.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152274.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152274.aspx</trackback:ping>
        </item>
        <item>
            <title>Adding SQL Doc Documentation to your Project</title>
            <category>Red Gate</category>
            <category>Documentation</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/02/28/adding-sql-doc-documentation-to-you-project.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/02/28/adding-sql-doc-documentation-to-you-project.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/02/28/adding-sql-doc-documentation-to-you-project.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In a recent &lt;a href="http://geekswithblogs.net/nharrison/archive/2013/02/15/do-you-sql-doc-from-red-gate.aspx" target="_blank"&gt;blog post&lt;/a&gt;, we talked about using &lt;a href="http://www.red-gate.com/products/sql-development/sql-doc/" target="_blank"&gt;SQL Doc&lt;/a&gt; to stream line documenting your database.    This tool makes it a lot easier to put the documentation close to the source so that it is more likely to stay current.&lt;/p&gt;  &lt;p&gt;Another problem with documentation like this though is its visibility.   If you squirrel it away on a file server somewhere, it is easily forgotten.   Again the key is to keep it closer to the source or at least where it will be the most relevant. &lt;/p&gt;  &lt;p&gt;So I decided to add the outputted documentation to the application using the database.     This keeps in more in the mind of the folks supporting and maintaining the application itself.   Of course, you would also want to make sure to make this accessible only to the folks who can use this information and who should be using it.    This would of course be a treasure trove for a hacker and intimidating to a casual user.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Now this part is largely personal preference, the default look for the generated HTML documentation looks rather pedestrian:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/33b7d2bd3a6b_7A96/db_4.png"&gt;&lt;img title="db" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="db" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/33b7d2bd3a6b_7A96/db_thumb_1.png" width="774" height="453" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It doesn’t match the look of the rest of the site, plus there are some details that I don’t really want to include such as the properties and the SQL Script.&lt;/p&gt;  &lt;p&gt;In looking at the generated HTML, we discover a couple of nice features baked into the HTML.&lt;/p&gt;  &lt;p&gt;First off in the Style folder there is a Master.css file that we can edit to change the look incorporating the colors and styles from the rest of the site so that it looks like the documentation flows with everything else.&lt;/p&gt;  &lt;p&gt;Matching the fonts, colors, and backgrounds from the rest of my site, we get a look like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/33b7d2bd3a6b_7A96/dbStyled_2.png"&gt;&lt;img title="dbStyled" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="dbStyled" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/33b7d2bd3a6b_7A96/dbStyled_thumb.png" width="762" height="447" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Since I am using the jQuery UI start theme in my site, this looks consistent.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The next couple of things that I want to do is remove the navigation links at the top, the Properties table, and the SQL Script.&lt;/p&gt;  &lt;p&gt;The SQL Script and the QuickLinks are relativly easy.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;.sqlScript
{
   display:none;
}&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;along with:

&lt;p&gt; &lt;/p&gt;

&lt;pre class="csharpcode"&gt;.QuickLinks
{
   display:none;
}&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;will remove these components.

&lt;p&gt;Getting rid of the Properties Section is a bit tougher.&lt;/p&gt;

&lt;p&gt;To get rid of the section title, we need this little trick:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;a[name=&lt;span class="str"&gt;"properties"&lt;/span&gt;]
{
   display:none;
}&lt;/pre&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt; &lt;/p&gt;







&lt;p&gt;Finally to embed this content in my application, I use an IFrame.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;iframe&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt; = &lt;span class="kwrd"&gt;"../../Documentation/ghenghis/index.html"&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt; = &lt;span class="kwrd"&gt;"db"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;iframe&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;And a little jQuery to keep the height of the iframe looking right:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&amp;lt;script&amp;gt;
    $(window).resize(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {
        $(&lt;span class="str"&gt;"#db"&lt;/span&gt;).height($(window).height() - ($(&lt;span class="str"&gt;"#db"&lt;/span&gt;).position().top + $(&lt;span class="str"&gt;"#main"&lt;/span&gt;).position().top));
    });
    $(window).resize();
&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;I think that the final effect looks pretty good.&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/33b7d2bd3a6b_7A96/dbFinal_2.png"&gt;&lt;img title="dbFinal" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="dbFinal" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/33b7d2bd3a6b_7A96/dbFinal_thumb.png" width="761" height="445" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152266.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/02/28/adding-sql-doc-documentation-to-you-project.aspx</guid>
            <pubDate>Thu, 28 Feb 2013 16:22:52 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/02/28/adding-sql-doc-documentation-to-you-project.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152266.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152266.aspx</trackback:ping>
        </item>
        <item>
            <title>Do You Dream in LINQ?</title>
            <category>LINQ</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/02/28/do-you-dream-in-linq.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/02/28/do-you-dream-in-linq.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/02/28/do-you-dream-in-linq.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;New article on &lt;a href="https://www.simple-talk.com/" target="_blank"&gt;Simple Talk&lt;/a&gt; exploring various ways to build &lt;a href="https://www.simple-talk.com/dotnet/.net-framework/dynamic-linq-queries-with-expression-trees/" target="_blank"&gt;dynamic queries with LINQ&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Some of the examples are fairly straight forward, but in the end, I step you through creating complex queries from scratch using reflection and Expression Trees.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Expression Trees are the neglected corner of DotNet voodoo.   Hopefully this will shed some light on this “scary topic”.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Hit the comments and tell me how you dream in LINQ&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152261.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/02/28/do-you-dream-in-linq.aspx</guid>
            <pubDate>Thu, 28 Feb 2013 13:38:44 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/02/28/do-you-dream-in-linq.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152261.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152261.aspx</trackback:ping>
        </item>
        <item>
            <title>Reviewing Syncfusion: jQuery Succinctly</title>
            <category>Book Reviews</category>
            <category>jQuery</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/02/25/reviewing-syncfusion-jquery-succinctly.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/02/25/reviewing-syncfusion-jquery-succinctly.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/02/25/reviewing-syncfusion-jquery-succinctly.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The nice folks at Syncfusion reached out to me last week to tell me a little bit about their &lt;a href="http://www.syncfusion.com/resources/techportal/ebooks" target="_blank"&gt;Succinctly&lt;/a&gt; series of books.   As they describe the concept, their goal is take 500+ pages of content and distill it down to 100 pages of essentials.&lt;/p&gt;  &lt;p&gt;I was intrigued but apprehensive with visions of “For Dummies” books running through my head.&lt;/p&gt;  &lt;p&gt;So I looked through their offerings and decide to check out a topic that I am already somewhat familiar with.   I downloaded &lt;a href="http://www.syncfusion.com/resources/techportal/ebooks/jquery" target="_blank"&gt;jQuery Succinctly&lt;/a&gt; to examine.&lt;/p&gt;  &lt;p&gt;I was pleasantly surprised.  The author is none other than Cody Lindley who definitely has street cred for knowing his jQuery.    I also liked that you can download it for the Kinle&lt;/p&gt;  &lt;p&gt;This is not another take on “For Dummies”   There are no annoying cartoons, there is no pandering, there is not trudging through elementary concepts that you should already know before considering a topic like jQuery.&lt;/p&gt;  &lt;p&gt;While jQuery is a massive pervasive topic, the author distills it down nicely by following a couple of conventions that I greatly appreciate.&lt;/p&gt;  &lt;p&gt;First, he doesn’t waste time reminding you what a function is, what a variable is, what html is, etc.     He assumes that you already know how to  build a web application and that you now want to know the basics of jQuery.   This is very refreshing.   In his own words: &lt;/p&gt; &lt;blockquote&gt;  &lt;p&gt;This book is intended for three types of readers. The first is someone who has read introductory material on jQuery and is looking for the next logical step. The second type of reader is a JavaScript developer, already versed in another library, now trying to quickly learn jQuery. The third reader is I, the author. I crafted this book to be used as my own personal reference point for jQuery concepts. This is exactly the type of book I wish every JavaScript library had available.&lt;/p&gt; &lt;cite&gt;Cody Lindley&lt;/cite&gt; &lt;/blockquote&gt;  &lt;p&gt;Second, he takes the perspective; that the text is secondary to the sample code.   He expects you to examine the code samples closely; &lt;quote&gt;“It is my opinion that a code example is actually worth a thousand words.”&lt;/quote&gt;&lt;/p&gt;  &lt;p&gt;There are many times while reading this book that I would skip over the brief surrounding text and only read the code examples.&lt;/p&gt;  &lt;p&gt;He adds comments in line that explain the expected output.   This really is worth a thousand words.    You can imagine how much text would be needed to explain this simple example.&lt;/p&gt;  &lt;div&gt;   &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;! &lt;/span&gt;&lt;span style="color: maroon"&gt;DOCTYPE &lt;/span&gt;&lt;span style="color: red"&gt;html &lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;html &lt;/span&gt;&lt;span style="color: red"&gt;lang&lt;/span&gt;&lt;span style="color: blue"&gt;=" en"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;body&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=" parent2"&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=" parent1"&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=" parent0"&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=" start"&amp;gt;
                &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=" &lt;a href="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&amp;quot;&amp;gt;"&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&amp;gt;
&lt;/a&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;        &lt;/span&gt;(&lt;span style="color: blue"&gt;function &lt;/span&gt;($) {
            &lt;span style="color: #006400"&gt;// Alerts "parent0" x4 
            &lt;/span&gt;alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parent().attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parents(&lt;span style="color: maroon"&gt;'# parent0'&lt;/span&gt;).attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parents()[0].id);
            &lt;span style="color: #006400"&gt;// Gets actual DOM element 
            &lt;/span&gt;alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).closest(&lt;span style="color: maroon"&gt;'# parent0'&lt;/span&gt;).attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            &lt;span style="color: #006400"&gt;// Alerts "parent1" x4 
            &lt;/span&gt;alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parent().parent().attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parents(&lt;span style="color: maroon"&gt;'#parent1'&lt;/span&gt;).attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parents()[1].id); &lt;span style="color: #006400"&gt;// Gets actual DOM element
            &lt;/span&gt;alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).closest(&lt;span style="color: maroon"&gt;'# parent1'&lt;/span&gt;).attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            &lt;span style="color: #006400"&gt;// Alerts "parent2" x4
            &lt;/span&gt;alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parent().parent().parent().attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parents(&lt;span style="color: maroon"&gt;'#parent2'&lt;/span&gt;).attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
            alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).parents()[2].id);
            &lt;span style="color: #006400"&gt;//Gets actual DOM element 
            &lt;/span&gt;alert($(&lt;span style="color: maroon"&gt;'#start'&lt;/span&gt;).closest(&lt;span style="color: maroon"&gt;'#parent2'&lt;/span&gt;).attr(&lt;span style="color: maroon"&gt;' id'&lt;/span&gt;));
        })(jQuery);
    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;body&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;html&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;He doesn’t waste time trying to explain why you might want to do something like add a class to every image on the page.   Instead he shows several different  ways to work such magic.&lt;/p&gt;

&lt;p&gt;If you are already familiar with JavaScript, html, css, and now want to learn jQuery without having to hash through a bunch of stuff that you already know, this is the book for you.&lt;/p&gt;

&lt;p&gt;If you are looking for an introduction to web programming, this is not going to give you what you need, and you will be disappointed.   Cut your teeth on a couple of other introductory books first and then come back.   If you want introductory books on a particular topic, hit the comments and I can give you my two cents worth.&lt;/p&gt;

&lt;p&gt;As the author mentions in the introduction, he designed it to be used as his own personal reference for jQuery concepts.   So, unlike many other introductory texts, this one you will want to keep handy for quick reference after the initial read.&lt;/p&gt;

&lt;p&gt;Next, I think that I will read about up Pdf.   &lt;a href="http://www.syncfusion.com/resources/techportal/ebooks/pdf" target="_blank"&gt;http://www.syncfusion.com/resources/techportal/ebooks/pdf&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152222.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/02/25/reviewing-syncfusion-jquery-succinctly.aspx</guid>
            <pubDate>Mon, 25 Feb 2013 17:53:10 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/02/25/reviewing-syncfusion-jquery-succinctly.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152222.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152222.aspx</trackback:ping>
        </item>
        <item>
            <title>Book Review of Under the Hood of .Net Memory Management</title>
            <category>Book Reviews</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/02/22/book-review-of-under-the-hood-of-.net-memory-management.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/02/22/book-review-of-under-the-hood-of-.net-memory-management.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/02/22/book-review-of-under-the-hood-of-.net-memory-management.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="float: right"&gt;   &lt;p&gt;I don’t really like to toot my own horn, but I am not above shining the light on someone doing it for me.&lt;/p&gt;    &lt;p&gt;Ein Gedanke has written a wonderful review of the book that I co wrote.&lt;a href="http://blog.fabse.net/2012/11/20/book-finished-under-the-hood-of-dotnet-memory-management/"&gt;http://blog.fabse.net/2012/11/20/book-finished-under-the-hood-of-dotnet-memory-management/&lt;/a&gt;&lt;/p&gt;    &lt;p&gt; &lt;/p&gt;    &lt;p&gt;I thoroughly enjoyed reading his review.&lt;/p&gt;    &lt;p&gt;After reading his review, feel free to wander over to Amazon and see how you can get a copy for yourself  &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Book-Review-of-Und.Net-Memory-Management_CF19/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt; &lt;/div&gt; &lt;a href="http://www.amazon.com/Under-Hood-NET-Memory-Management/dp/1906434751/ref=sr_1_1?ie=UTF8&amp;amp;qid=1361562539&amp;amp;sr=8-1&amp;amp;keywords=under+the+hood+of+.net+memory+management"&gt;&lt;img style="float: left" src="http://ecx.images-amazon.com/images/I/51n2Seg1W8L._SL500_AA300_.jpg" /&gt;&lt;/a&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152199.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/02/22/book-review-of-under-the-hood-of-.net-memory-management.aspx</guid>
            <pubDate>Fri, 22 Feb 2013 19:58:37 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/02/22/book-review-of-under-the-hood-of-.net-memory-management.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152199.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152199.aspx</trackback:ping>
        </item>
        <item>
            <title>Do You Use SQL Doc from Red Gate?</title>
            <category>Documentation</category>
            <category>Red Gate</category>
            <link>http://geekswithblogs.net/nharrison/archive/2013/02/15/do-you-sql-doc-from-red-gate.aspx</link>
            <description>&lt;p&gt;Originally posted on: &lt;a href='http://geekswithblogs.net/nharrison/archive/2013/02/15/do-you-sql-doc-from-red-gate.aspx'&gt;http://geekswithblogs.net/nharrison/archive/2013/02/15/do-you-sql-doc-from-red-gate.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Do you have a database?   Then you should be using SQL Doc!  &lt;a title="http://www.red-gate.com/products/sql-development/sql-doc/" href="http://www.red-gate.com/products/sql-development/sql-doc/"&gt;http://www.red-gate.com/products/sql-development/sql-doc/&lt;/a&gt;&lt;/p&gt; &lt;style&gt;&lt;![CDATA[

img {
background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px; -moz-box-shadow: 3px 3px 10px #000; -webkit-box-shadow: 3px 3px 10px #000
}]]&gt;&lt;/style&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;SQL Doc scans the data dictionary and associated metadata to produce the documentation for your database.    You can output this documentation in several different formats depending on your needs:  &lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_2.png"&gt;&lt;img title="image" border="0" alt="image" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_thumb.png" width="541" height="281" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;You can also explicitly pick and chose which components to include and save these selections in a project file to make it easy to refresh the documentation:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_thumb_1.png" width="376" height="328" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now for the kicker, you can easily update the metadata for the objects that you are documenting.   Tables, columns, Views, Stored Procedures, Parameters, Indexes all have extended metadata where you can enter a comment.   &lt;/p&gt;  &lt;p&gt;If you have entered such comments, they will be incorporated into the resulting documentation.    &lt;/p&gt;  &lt;p&gt;This is nice because this metadata is not necessarily easy to get to, and it is cumbersome to update in Management Studio.    This is where SQL Doc truly shines.&lt;/p&gt;  &lt;p&gt;When reviewing the documentation created for a table, you can easily update this metadata.   &lt;/p&gt;  &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_thumb_2.png" width="788" height="161" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Simply click on the Edit button and then type away to your heart’s content.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://gwb.blob.core.windows.net/nharrison/Windows-Live-Writer/Do-You-SQL-Doc-from-Red-Gate_CFE3/image_thumb_3.png" width="670" height="357" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Instead of hitting Update Database, click Next or Previous and move through the columns.   Once you have entered all of the comments that you want for this table, hit the Update Database button and all of your comments will be added to the database and incorporated into the documentation.&lt;/p&gt;  &lt;p&gt;This is a huge advantage compared to what you would have to do in Management Studio.&lt;/p&gt;  &lt;p&gt;As much as I like this tool, and I do there are still a few things missing:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;We really need spell checker in the edit box.&lt;/li&gt;    &lt;li&gt;Be nice to draw attention to components that are not yet documented.&lt;/li&gt;    &lt;li&gt;There are some documentation that the tool should be able to figure out and add on its own.    I should never have to write a comment that a field is part of a foreign key or a primary key.   I should not have to list out &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The other problem that I have is that I wished I had more control over the generated output.    It would be nice if the HTML was structured with rebranding in mine or if you could associate a style sheet with the generated output.     Never fear though, we can easily add the style sheet our selves af2ter the fact and in future blogs, we may explore how you can rebrand this output to meet our needs with style sheets and maybe a little bit of jquery.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/nharrison/aggbug/152112.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nick Harrison</dc:creator>
            <guid>http://geekswithblogs.net/nharrison/archive/2013/02/15/do-you-sql-doc-from-red-gate.aspx</guid>
            <pubDate>Fri, 15 Feb 2013 20:28:08 GMT</pubDate>
            <comments>http://geekswithblogs.net/nharrison/archive/2013/02/15/do-you-sql-doc-from-red-gate.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/nharrison/comments/commentRss/152112.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/nharrison/services/trackbacks/152112.aspx</trackback:ping>
        </item>
    </channel>
</rss>