<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7168012461497416647</id><updated>2011-11-28T02:09:13.027+01:00</updated><category term='dropdown'/><category term='EventLogTraceListener'/><category term='javascript'/><category term='DataTextFormatString'/><category term='html5'/><category term='window.open'/><category term='raycasting'/><category term='meta-characters'/><category term='treeview'/><category term='serialization'/><category term='tag extract'/><category term='endRequest'/><category term='print_r'/><category term='stribe.nl'/><category term='Tokenizer'/><category term='SparkViewEngine'/><category term='TraceListener'/><category term='ASP.NET'/><category term='AJAX.NET'/><category term='invalid argument'/><category term='ready'/><category term='stribe'/><category term='List.ForEach'/><category term='Xapian'/><category term='dbcc'/><category term='reseed'/><category term='CultureInfo'/><category term='sharepaste'/><category term='deserialize'/><category term='boetiek'/><category term='stupid IE'/><category term='clean string'/><category term='share'/><category term='add_endRequest'/><category term='mootools'/><category term='CurrentCulture'/><category term='select'/><category term='boetiek.nl'/><category term='paste'/><category term='ajax'/><category term='MVC2'/><category term='ScottGu'/><category term='onload'/><category term='C# csharp c-sharp .NET coding standards'/><category term='lambda'/><category term='removeoption'/><category term='options'/><category term='var_dump()'/><category term='C#'/><category term='jquery'/><category term='raycaster'/><category term='Format'/><category term='DateTime'/><category term='MCV'/><category term='sql'/><category term='Content Management'/><category term='var_dump'/><category term='escape'/><category term='TechSite'/><category term='.NET 4.0'/><category term='generics'/><category term='identity'/><category term='TextStreamTraceListener'/><category term='CMS'/><category term='VS2010'/><category term='NHibernate'/><category term='clipboard'/><category term='delegate'/><category term='json'/><category term='.NET'/><title type='text'>Ruud.Tech</title><subtitle type='html'>A blog for software engineers</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-2423599135596954998</id><published>2011-10-02T19:43:00.001+02:00</published><updated>2011-10-02T19:43:09.896+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='raycaster'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='raycasting'/><title type='text'>HTML5 / JavaScript raycaster demo</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/-FjicKM_Y-Jg/ToihLWOI-EI/AAAAAAAAAGA/HUb3cKmR1ac/s1600/raycaster.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="295" src="http://1.bp.blogspot.com/-FjicKM_Y-Jg/ToihLWOI-EI/AAAAAAAAAGA/HUb3cKmR1ac/s320/raycaster.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Lately I have been playing around with raycasting, a technique used for rendering 3D worlds, just for the fun of it.&lt;br /&gt;Once I had a working version in C#, I decided to port it to HTML5 (rendering on a canvas) as an exercise.&lt;br /&gt;It supports texture mapping and uses a simple lighting and shadow effect to make it feel a little more realistic.&lt;br /&gt;&lt;br /&gt;View the demo here:&amp;nbsp;&lt;a href="http://www.dottech.nl/raycaster/"&gt;http://www.dottech.nl/raycaster/&lt;/a&gt;&lt;br /&gt;It's best viewed in Chrome but it also works in Firefox and should work in IE9 (didn't test that).&lt;br /&gt;&lt;br /&gt;Source code is available on GitHub:&amp;nbsp;&lt;a href="http://github.com/Stribe/HTML5-Raycaster"&gt;http://github.com/Stribe/HTML5-Raycaster&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-2423599135596954998?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/2423599135596954998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2011/10/html5-javascript-raycaster-demo.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/2423599135596954998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/2423599135596954998'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2011/10/html5-javascript-raycaster-demo.html' title='HTML5 / JavaScript raycaster demo'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-FjicKM_Y-Jg/ToihLWOI-EI/AAAAAAAAAGA/HUb3cKmR1ac/s72-c/raycaster.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-1699649038717097441</id><published>2010-10-20T20:45:00.005+02:00</published><updated>2010-10-20T22:02:25.620+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stribe'/><category scheme='http://www.blogger.com/atom/ns#' term='stribe.nl'/><category scheme='http://www.blogger.com/atom/ns#' term='VS2010'/><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='SparkViewEngine'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='boetiek.nl'/><category scheme='http://www.blogger.com/atom/ns#' term='Xapian'/><category scheme='http://www.blogger.com/atom/ns#' term='boetiek'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC2'/><title type='text'>Stribe</title><content type='html'>It has been quiet on my blog for some time.&lt;br /&gt;That's because i've been busy with my biggest and most important project so far: Stribe.&lt;br /&gt;This article is meant to tell a little about project and the company behind it and moreover to shine some light on the technical details.&lt;br /&gt;&lt;br /&gt;Stribe is a company i started together with a good friend under the wing of my former employer Colours.&lt;br /&gt;In january i started the development on a platform for social shopping; a website that offers a huge catalog of products from lots of big webshops and allows users to create profiles showing what they like, sharing it with friends.&lt;br /&gt;Make wishlists while shopping for goods, compare prices between shops and tons of more functionality... that we eventually did not use in the end result... :P&lt;br /&gt;&lt;br /&gt;As it goes with these kind of projects, we have changed the concept along the way and eventually ended up with two very cool websites:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;a href="http://www.stribe.nl"&gt;Stribe.nl&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Offers discounts on online fashion for a huge amount of brands and webshops.&lt;br /&gt;We also organize "collective discount" actions where users receive a higher discount if more people sign up for the action.&lt;br /&gt;Users need to create a profile that reflect their brand and shop preference so that they will only receive updates for those discounts that are relevant for them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;a href="http://www.boetiek.nl"&gt;Boetiek.nl&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Is basicly an online catalog that hold all fashion products for over 25 webshops (and growing) which comes down to over a 100.000 products.&lt;br /&gt;It's an easy tool for those who are looking to buy fashion online and don't want to search through all those websites individually.&lt;br /&gt;&lt;br /&gt;Ok, so that's the functional (for us tech-geeks, boring) part of the story.&lt;br /&gt;What is behind these sites that makes this all possible?&lt;br /&gt;&lt;br /&gt;We use:&lt;br /&gt;- .NET 4.0 Framework, developing in Visual Studio 2010&lt;br /&gt;- C#, MVC 2, jQuery&lt;br /&gt;- MS-SQL 2010&lt;br /&gt;- &lt;a href="http://sparkviewengine.com/"&gt;Spark View Engine&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://xapian.org/"&gt;Xapian search engine&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://sourceforge.net/projects/nhibernate/files/NHibernate/"&gt;NHibernate&lt;/a&gt; (2.something i think)&lt;br /&gt;- &lt;a href="http://fluentnhibernate.org/"&gt;Fluent NHibernate&lt;/a&gt;&lt;br /&gt;- &lt;a href="nhlambdaextensions.googlecode.com/"&gt;NHibernate Lambda Extensions&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://www.nunit.org/"&gt;NUnit&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://umbraco.org/"&gt;Umbraco&lt;/a&gt; (for very basic content storage)&lt;br /&gt;- &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt; for sourcecontrol with &lt;a href="http://code.google.com/p/gitextensions/"&gt;GitExtensions&lt;/a&gt; as the client&lt;br /&gt;- &lt;a href="http://www.fogcreek.com/FogBugz/"&gt;FogBugz&lt;/a&gt; for issuetracking&lt;br /&gt;- &lt;a href="http://www.yourzine.nl"&gt;Yourzine's Footprint&lt;/a&gt; for outgoing mailings&lt;br /&gt;- a lot more of small helper utilities&lt;br /&gt;&lt;br /&gt;.NET 4.0 and MVC 2 were still in beta when we started.&lt;br /&gt;That's one big advantage of running your own project: you may decide to use techniques that are so new they are not even final released and there is no one there to stop you! :)&lt;br /&gt;Before the start i did not have any experience at all with MVC which made it even more exciting!&lt;br /&gt;&lt;br /&gt;I got to develop some pretty cool components during the project.&lt;br /&gt;First there is the whole custom site framework with connections to Umbraco to retrieve content (we did not use umbraco rendering, just for simple content storage) and of course connected to our SQL database (which at some point contained close to 100 tables).&lt;br /&gt;&lt;br /&gt;Then there is the Importer Tool, a tool that imports all product feeds from the webshops we offer in our catalog and adds them to our database.&lt;br /&gt;This also includes all related brands and product properties such as color, size, material, etc.&lt;br /&gt;As most shops offer the feed in their own format, each one needs to be converted to our own standard, then added to our database and finally each product needs to be placed in a category which was a huge challenge on it's own.&lt;br /&gt;&lt;br /&gt;Another interesting task was implementing the Xapian search engine that crashed when used in combination with 4.0 .NET framework.&lt;br /&gt;This had to be solved using WCF to isolate the search service from the rest of the solution.&lt;br /&gt;&lt;br /&gt;Last but not least, the automated build process.&lt;br /&gt;With one push of the button i can build the solution and generate a deployable output that can be dragged and dropped to the production server.&lt;br /&gt;It takes care of merging and minifying of css and javascripts and generating the correct configuration files for the production environment.&lt;br /&gt;&lt;br /&gt;I can go on like this for hours, but you get the point: it was a project full of challenges and also with all freedom to solve them.&lt;br /&gt;Every software engineer's wet dream 8-)&lt;br /&gt;&lt;br /&gt;We're currently running the sites on 2 loadbalanced Windows 2008 webservers and one dedicated SQL Server.&lt;br /&gt;There is 24h monitoring that alerts me immediately when any of the systems fail.&lt;br /&gt;I'm happy with the result so far and believe that we now have a steady base for future development.&lt;br /&gt;&lt;br /&gt;If i get more time and feel like writing, i would like to go more into the specifics of some of the sections and choices i've made.&lt;br /&gt;One subject that deserves some more attention is the Spark View Engine we used, which has a lot of potential (although i suspect that Razor might replace Spark alltogether in the future...)&lt;br /&gt;Also the Fluent NHibernate and Lambda Extension made things so much easier for us.&lt;br /&gt;Hopefully more about that in the future!&lt;br /&gt;&lt;br /&gt;For now, i'd like to invite you to check out the end result and see for yourself.&lt;br /&gt;If you have any questions, suggestions, free drinks or marriage proposals, feel free to reply!&lt;br /&gt;&lt;br /&gt;/BruuD&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-1699649038717097441?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/1699649038717097441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2010/10/stribe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/1699649038717097441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/1699649038717097441'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2010/10/stribe.html' title='Stribe'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-5328870845608384795</id><published>2010-01-25T21:10:00.007+01:00</published><updated>2010-01-26T10:12:34.934+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='tag extract'/><category scheme='http://www.blogger.com/atom/ns#' term='Tokenizer'/><title type='text'>Tokenizer / tag extraction method</title><content type='html'>I was in need for a method to extract a list of tokens from a given text.&lt;br /&gt;The list should not contain stopwords like "the, a, on, of, etc" or punctuation marks and needs to be sorted by most used token.&lt;br /&gt;This is what i came up with:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;public static class Tokenizer&lt;br /&gt;{&lt;br /&gt;  private class Token&lt;br /&gt;  {&lt;br /&gt;    public string Value { get; set; }&lt;br /&gt;    public int Count { get; set; }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /// &amp;lt;summary&amp;gt;&lt;br /&gt;  /// Tokenize a string and return tokens as list sorted by most occurances&lt;br /&gt;  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;  /// &amp;lt;param name="input"&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;  /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;  public static List&amp;lt;string&amp;gt; TokenizeString(string input)&lt;br /&gt;  {&lt;br /&gt;    string cleanText = String.Empty;&lt;br /&gt;&lt;br /&gt;    // Replace all non-alphanumeric characters with a space&lt;br /&gt;    new List&amp;lt;Char&amp;gt;(input.ToCharArray()).ForEach(c =&amp;gt; &lt;br /&gt;                                                cleanText += (Char.IsLetterOrDigit(c) || Char.IsWhiteSpace(c)) &lt;br /&gt;                                                ? c.ToString() &lt;br /&gt;                                                : " ");&lt;br /&gt;&lt;br /&gt;    // We want all tokens in lowercase&lt;br /&gt;    cleanText = cleanText.ToLower();&lt;br /&gt;&lt;br /&gt;    // Split input string on whitespaces&lt;br /&gt;    List&amp;lt;string&amp;gt; tokens = cleanText.Split(' ').ToList&amp;lt;string&amp;gt;();&lt;br /&gt;&lt;br /&gt;    // Remove stop words, whitespace and tokens shorter than 3 chars from token list&lt;br /&gt;    // NOTE: Configuration.StopWords is of type List&amp;lt;string&amp;gt; and contains the stopwords (loaded from a configuration file)&lt;br /&gt;    Configuration.StopWords.ForEach(stopWord =&amp;gt;&lt;br /&gt;                                    tokens.RemoveAll(token =&amp;gt;&lt;br /&gt;                                                     token == stopWord || String.IsNullOrWhiteSpace(token) || token.Length &amp;lt; 3));&lt;br /&gt;&lt;br /&gt;    // Copy the tokens to a new list&lt;br /&gt;    // Count how many times each token occurs and add it only once, so we have no double entries&lt;br /&gt;    List&amp;lt;Token&amp;gt; tokenList = new List&amp;lt;Token&amp;gt;();&lt;br /&gt;    tokens.ForEach(delegate(string t)&lt;br /&gt;    {&lt;br /&gt;      // Continue only if token does not exist in tokenList&lt;br /&gt;      if (!tokenList.Exists(e =&amp;gt; e.Value == t))&lt;br /&gt;      {&lt;br /&gt;        // Add token to list, including the count of how many times it occurred&lt;br /&gt;        tokenList.Add(new Token { Value = t, Count = tokens.Count&amp;lt;string&amp;gt;(c =&amp;gt; c == t) });&lt;br /&gt;      }&lt;br /&gt;    });&lt;br /&gt;&lt;br /&gt;    // Sort the list on occurrance count&lt;br /&gt;    tokenList.Sort(delegate(Token a, Token b)&lt;br /&gt;    {&lt;br /&gt;      return b.Count.CompareTo(a.Count);&lt;br /&gt;    });&lt;br /&gt;&lt;br /&gt;    // At this point we have a list with unique tokens, sorted by most occurrances&lt;br /&gt;    // We convert it back to a string list and return it&lt;br /&gt;    tokens = new List&amp;lt;string&amp;gt;();&lt;br /&gt;    tokenList.ForEach(t =&amp;gt; tokens.Add(t.Value));&lt;br /&gt;&lt;br /&gt;    return tokens;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is an example of it's usage:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;// Dummy input string&lt;br /&gt;string input = "Google-oprichters Larry Page en Sergey Brin willen af van hun gedeelde meerderheid aan aandelen van het bedrijf. Uit een bericht van de Amerikaanse beurswaakhond SEC willen de twee de komende vijf jaar tien miljoen van hun Google aandelen verkopen. Brin en Page, nu nog voor 59 procent eigenaar, bezitten dan nog maar 48 procent van de aandelen. Met de huidige koers levert dat hun in totaal 5,5 miljard euro op. De Google oprichters kiezen bewust voor een geleidelijke afbouw om de aandelen op de beurs niet teveel onder de druk te zetten. Ondanks de aandelenverkoop zullen Brin en Page nog aardig hun stempel op het beleid kunnen drukken. Naast henzelf zijn voor besluiten slechts krap twee procent van de overige aandeelhouders nodig.";&lt;br /&gt;&lt;br /&gt;List&amp;lt;string&amp;gt; tokens = Tokenizer.TokenizeString(input);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will result in 59 tokens with the first 5 being:&lt;br /&gt;&lt;em&gt;&lt;br /&gt;aandelen&lt;br /&gt;google&lt;br /&gt;brin&lt;br /&gt;nog&lt;br /&gt;procent&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;The list of stopwords that was loaded in Configuration.StopWords is: &lt;em&gt;aan,naar,dat,nu,de,om,den,onder,der,ons,des,onze,deze,ook,die,op,dit,over,door,een,te,enige,tegen,enkele,ten,enz,ter,etc,tot,haar,uit,het,hierin,hoe,vanaf,hun,ik,vol,inzake,voor,is,wat,je,wie,na,zijn,u,uw,met,naar,jij,hij,zij,zonder,en,van,amp&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Because i already had a list with dutch stopwords loaded, i have used a dutch text in the example (sorry english readers :)&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-5328870845608384795?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/5328870845608384795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2010/01/tokenizer-method.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5328870845608384795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5328870845608384795'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2010/01/tokenizer-method.html' title='Tokenizer / tag extraction method'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-3358487046754267083</id><published>2009-12-16T19:48:00.003+01:00</published><updated>2009-12-21T20:35:12.210+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# csharp c-sharp .NET coding standards'/><title type='text'>C# Coding Standards</title><content type='html'>I have always been very keen on coding standards and as believe that a strict standard is key to writing maintainable code.&lt;br /&gt;Today i stumbled upon a document that summarizes all the C# coding standards that i usually apply.&lt;br /&gt;Thanks to Lance Hunt for publishing this document!&lt;br /&gt;&lt;br /&gt;Get the document here: &lt;a href="http://weblogs.asp.net/lhunt/pages/CSharp-Coding-Standards-document.aspx" target="_blank"&gt;http://weblogs.asp.net/lhunt/pages/CSharp-Coding-Standards-document.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-3358487046754267083?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/3358487046754267083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/12/c-coding-standards.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3358487046754267083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3358487046754267083'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/12/c-coding-standards.html' title='C# Coding Standards'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-6493523134154599580</id><published>2009-11-03T11:16:00.007+01:00</published><updated>2009-11-11T17:01:52.815+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='MCV'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Learn ASP.NET MVC in 2 hours! An introduction to MVC.NET</title><content type='html'>There is a new sheriff in town and it's called ASP.NET MVC!&lt;br /&gt;This (fairly) new framework from Microsoft provides the possiblity to write applications that truely follow the MVC design pattern which allows clear separation of data, logic and user interface.&lt;br /&gt;That strict seperation results in better testibility and maintanability.&lt;br /&gt;I was very excited about this framework from the start, but didn't get into the details until now and i found that - once again - a blog series from &lt;a href="http://weblogs.asp.net/scottgu/"&gt;ScottGu&lt;/a&gt; is a very good start for those who want to learn to use ASP.NET MVC.&lt;br /&gt;&lt;br /&gt;So here we go: learn MVC.NET in 2 hours (depending on how fast you read of course)!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 1: ASP.NET MVC Framework&lt;/span&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx" target="_blank"&gt;http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 2: URL Routing&lt;/span&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx" target="_blank"&gt;http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 3: Passing ViewData from Controllers to Views&lt;/span&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx" target="_blank"&gt;http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 4: Handling Form Edit and Post Scenarios&lt;/span&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx" target="_blank"&gt;http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thank you Scott!&lt;br /&gt;&lt;br /&gt;And for those who can't get enough, there is more!&lt;br /&gt;The latest version - ASP.NET MVC 2.0 - is now available as preview and &lt;a href="http://bradwilson.typepad.com/"&gt;Brad Wilson&lt;/a&gt; wrote a blog series about one of the major new features in this release: Templates.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 1: Introduction&lt;/span&gt;&lt;br /&gt;&lt;a href="http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html" target="_blank"&gt;http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 2: ModelMetadata&lt;/span&gt;&lt;br /&gt;&lt;a href="http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html" target="_blank"&gt;http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 3: Default Templates&lt;/span&gt;&lt;br /&gt;&lt;a href="http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-3-default-templates.html" target="_blank"&gt;http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-3-default-templates.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 4: Custom Object Templates&lt;/span&gt;&lt;br /&gt;&lt;a href="http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-4-custom-object-templates.html" target="_blank"&gt;http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-4-custom-object-templates.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Part 5: Master Page Templates&lt;/span&gt;&lt;br /&gt;&lt;a href="http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-5-master-page-templates.html" target="_blank"&gt;http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-5-master-page-templates.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thank you Brad!&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-6493523134154599580?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/6493523134154599580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/11/learn-aspnet-mvc-in-2-hours.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/6493523134154599580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/6493523134154599580'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/11/learn-aspnet-mvc-in-2-hours.html' title='Learn ASP.NET MVC in 2 hours! An introduction to MVC.NET'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-8047632349116698532</id><published>2009-10-22T16:45:00.004+02:00</published><updated>2009-10-22T17:16:25.316+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EventLogTraceListener'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='TraceListener'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='TextStreamTraceListener'/><title type='text'>.NET trace log implementation with EventLog and TextStream support</title><content type='html'>When you are developing an application you want to be able to log what is happening in your code.&lt;div&gt;In .NET you can accomplish that with the use of TraceListeners.&lt;/div&gt;&lt;div&gt;You use the Trace class to write messages during the execution of your application.&lt;/div&gt;&lt;div&gt;While in debug mode, these messages will be displayed in the Visual Studio output console and forwarded to the configured tracelisteners.&lt;/div&gt;&lt;div&gt;The TraceListener can then write the message to a destination like an EventLog, Xml file or a textfile.&lt;/div&gt;&lt;div&gt;One cool thing about TraceListeners is that you can configure them in your App.config or Web.config, so you can control their settings after you have built the application.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think this is a great tool for implementing logging in your application, but the default implementation has a few setbacks:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1) TraceListeners intercept all trace messages and i would like to configure them so they intercept only those messages that have a specific priority level.&lt;/div&gt;&lt;div&gt;Eg. i want high priority messages to be logged in an eventlog and i want debug messages to be logged in a textfile.&lt;/div&gt;&lt;div&gt;So when i use a release build and something goes wrong, i can activate the TraceListener that writes debug info to a logfile and find out what is happening.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2) The EventLogTraceListener outputs to the Application log and i would like to have my events in a seperate log.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So to solve these problems i wrote my own tracelisteners.&lt;/div&gt;&lt;div&gt;It would be great if Microsoft was so kind to let us inherit from their default tracelistener implementations like EventLogTraceListener and TextStreamTraceListener, but for some reason they decided to seal these classes.&lt;/div&gt;&lt;div&gt;Therefore we have to inherit from the TraceListener class, do our custom stuff and pass the calls to an instance of, for example, EventLogTraceListener.&lt;br /&gt;I wrote two custom tracelisteners: CustomEventLogTraceListener and CustomTextStreamTraceListener.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my implementation i also wrote a CustomTrace class that acts as a wrapper for the Trace class and adds the possibility of specifying priority levels for trace messages.&lt;/div&gt;&lt;div&gt;The lowest priority is 1 and the highest is 9.&lt;/div&gt;&lt;div&gt;So instead of calling &lt;i&gt;Trace.TraceError("This is wrong") &lt;/i&gt;you can call &lt;i&gt;CustomTrace.TraceError("This is wrong", 9)&lt;/i&gt; which means this error is of priority level 9, so it is very important.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I created an example solution with the TraceListeners project and an example application.&lt;/div&gt;&lt;div&gt;It shows how to configure the listeners and how to send information (messages) to them.&lt;/div&gt;&lt;div&gt;You can download it here: &lt;a href="http://www.dottechdev.nl/downloads/CustomTraceListeners.zip"&gt;http://www.dottechdev.nl/downloads/CustomTraceListeners.zip&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I will be using this in all my .NET implementations from now on and i hope it comes in handy for you too!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/Ruud&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-8047632349116698532?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/8047632349116698532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/10/net-trace-log-implementation-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/8047632349116698532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/8047632349116698532'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/10/net-trace-log-implementation-with.html' title='.NET trace log implementation with EventLog and TextStream support'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-4351466916499922894</id><published>2009-10-21T23:33:00.003+02:00</published><updated>2009-10-22T20:46:30.788+02:00</updated><title type='text'>Maintenance</title><content type='html'>Downloads and code highlighting component are temporarily disabled.&lt;div&gt;They are all hosted on the DotTech domain which is offline for maintenance.&lt;/div&gt;&lt;div&gt;I try to have them back online this weekend.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;EDIT: Server is back up!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/Ruud&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-4351466916499922894?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/4351466916499922894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/10/maintenance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/4351466916499922894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/4351466916499922894'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/10/maintenance.html' title='Maintenance'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-2716538674555573461</id><published>2009-10-13T09:22:00.004+02:00</published><updated>2009-10-22T17:27:48.931+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='VS2010'/><category scheme='http://www.blogger.com/atom/ns#' term='ScottGu'/><title type='text'>ScottGu's VS2010 and .NET 4 Series</title><content type='html'>&lt;p&gt;I'd like to point out a nice series of blogposts from Scott Guthrie on Visual Studio 2010 and .NET 4.0&lt;br /&gt;For those of you who don't know Scott Gu (you are a rare breed): he runs the development teams for ASP.NET, CLR, IIS7, Windows Presentation Foundation and some other MS projects.&lt;/p&gt;&lt;p&gt;His blog series about VS2010 and .NET 4.0 is good reading material for those who want to be somewhat prepared when the software is released.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/25/clean-web-config-files-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/08/25/clean-web-config-files-vs-2010-and-net-4-0-series.aspx"&gt;Clean Web.Config Files&lt;/a&gt; (Posted Aug 25, 2009) &lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/26/starter-project-templates-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/08/26/starter-project-templates-vs-2010-and-net-4-0-series.aspx"&gt;Starter Project Templates&lt;/a&gt; (Posted August 26, 2009) &lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/27/multi-targeting-support-vs-2010-and-net-4-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/08/27/multi-targeting-support-vs-2010-and-net-4-series.aspx"&gt;Multi-targeting&lt;/a&gt; (Posted August 27th, 2009) &lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/31/multi-monitor-support-vs-2010-and-net-4-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/08/31/multi-monitor-support-vs-2010-and-net-4-series.aspx"&gt;Multiple Monitor Support&lt;/a&gt; (Posted August 31st, 2009) &lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/09/02/code-optimized-web-development-profile-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/09/02/code-optimized-web-development-profile-vs-2010-and-net-4-0-series.aspx"&gt;New Code Focused Web Profile Option&lt;/a&gt; (Posted September 2nd, 2009) &lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/09/04/asp-net-html-javascript-snippet-support-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/09/04/asp-net-html-javascript-snippet-support-vs-2010-and-net-4-0-series.aspx"&gt;HTML / ASP.NET / JavaScript Code Snippets&lt;/a&gt; (Posted September 4th, 2009)&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx"&gt;Auto-Start ASP.NET Applications&lt;/a&gt; (Posted September 15th, 2009)&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx"&gt;URL Routing with ASP.NET 4 Web Forms&lt;/a&gt; (Posted October 13th, 2009)&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx" target="_blank" mce_href="http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx"&gt;Searching and Navigating Code in VS 2010&lt;/a&gt; (Posted October 21st, 2009)&lt;/li&gt;&lt;/ul&gt;I will update this post when he publishes more articles.&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-2716538674555573461?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/2716538674555573461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/10/scottgus-vs2010-and-net-4-series.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/2716538674555573461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/2716538674555573461'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/10/scottgus-vs2010-and-net-4-series.html' title='ScottGu&apos;s VS2010 and .NET 4 Series'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-900484105341175871</id><published>2009-09-15T20:23:00.011+02:00</published><updated>2009-09-15T20:53:36.733+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clipboard'/><category scheme='http://www.blogger.com/atom/ns#' term='share'/><category scheme='http://www.blogger.com/atom/ns#' term='sharepaste'/><category scheme='http://www.blogger.com/atom/ns#' term='paste'/><title type='text'>Announcing SharePaste.com</title><content type='html'>I often found myself in the situation where i quickly want to save whatever is on my clipboard, for example while i'm working on some code and want to remove a section but might need it later.&lt;br /&gt;Sometimes i want to share whatever is on my clipboard, when i want feedback on it or when i want to send someone some code to help him out.&lt;br /&gt;&lt;br /&gt;Now, i thought it would be handy to have an online tool for this so that i can quickly paste some text, save it and access it by a short URL so that i can share it with others.&lt;br /&gt;For this reason i created &lt;a href="http://sharepaste.com"&gt;SharePaste&lt;/a&gt;, the easy way to save and share your clipboard contents.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sharepaste.com/"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 179px; height: 50px;" src="http://1.bp.blogspot.com/_izKeYoq46Fo/Sq_iXixJxiI/AAAAAAAAABI/4ivTtVcpGjU/s320/sharepaste_blogger.jpg" border="0" alt="SharePaste.com" id="BLOGGER_PHOTO_ID_5381768973828867618" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It provides you with a straight forward interface that allows you to paste and save your text within seconds.&lt;br /&gt;There is support for syntax highlighting and in the future you have the ability to register yourself to keep track of previous pastes.&lt;br /&gt;The tool is still in early beta and registration is not available yet, but it's already very usefull.&lt;br /&gt;&lt;br /&gt;Here is a short overview of SharePaste's features:&lt;br /&gt;- Save any text that is on your clipboard&lt;br /&gt;- Share your pastes using their unique, short URL&lt;br /&gt;- Access your saved pastes any time&lt;br /&gt;- Apply syntax highlighting to your pastes&lt;br /&gt;- Find your pastes back by searching on their tags (not yet implemented)&lt;br /&gt;- More features are coming!&lt;br /&gt;&lt;br /&gt;And here is one example of what a paste looks like: &lt;a href="http://sharepaste.com/p/giD3B7"&gt;http://sharepaste.com/p/giD3B7&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I hope you like it and find it as usefull as i do!&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-900484105341175871?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/900484105341175871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/09/announcing-sharepastecom.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/900484105341175871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/900484105341175871'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/09/announcing-sharepastecom.html' title='Announcing SharePaste.com'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_izKeYoq46Fo/Sq_iXixJxiI/AAAAAAAAABI/4ivTtVcpGjU/s72-c/sharepaste_blogger.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-6062036885939614028</id><published>2009-08-31T18:27:00.010+02:00</published><updated>2009-08-31T18:50:41.994+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataTextFormatString'/><category scheme='http://www.blogger.com/atom/ns#' term='CurrentCulture'/><category scheme='http://www.blogger.com/atom/ns#' term='DateTime'/><category scheme='http://www.blogger.com/atom/ns#' term='CultureInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Format'/><category scheme='http://www.blogger.com/atom/ns#' term='dropdown'/><title type='text'>Format DateTime in a dropdownlist (with different CultureInfo)</title><content type='html'>It turned out to be very easy, but it took me at least 30 minutes to figure out the easiest way to do it.&lt;br /&gt;So i figured it's worth a little blog post.&lt;br /&gt;&lt;br /&gt;The magic happens by using the DataTextFormatString property of the dropdownlist.&lt;br /&gt;But i didn't know how to format the date properly until i figured out i had to use {0}.&lt;br /&gt;Here is how to do it:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;// Create a list with dummy dates&lt;br /&gt;List&amp;lt;DateTime&amp;gt; dates = new List&amp;lt;DateTime&amp;gt;();&lt;br /&gt;for (double i = 1; i &lt;= 31; i++)&lt;br /&gt;{&lt;br /&gt;    dates.Add(DateTime.Now.AddDays(i));&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;// Specify the dateformat (e.g. outputs today as "31-08-2009 18:40")&lt;br /&gt;ddlMyDropdown.DataTextFormatString = "{0:dd-MM-yyyy hh:mm}";&lt;br /&gt; &lt;br /&gt;// Databinding&lt;br /&gt;ddlMyDropdown.DataSource = dates;&lt;br /&gt;ddlMyDropdown.DataBind();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that .NET uses the culture of the current thread to format the date.&lt;br /&gt;So if i used format {0:dd MMMM yyyy} which would output as "31 August 2009" and i want to write it out in another culture, let's say dutch (31 augustus 2009).&lt;br /&gt;Then i need to execute the following code before i perform the databinding:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;// Set current culture for current thread to dutch&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("nl-NL");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Hope this saves you some time googling for it ;)&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-6062036885939614028?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/6062036885939614028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/format-datetime-in-dropdownlist-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/6062036885939614028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/6062036885939614028'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/format-datetime-in-dropdownlist-with.html' title='Format DateTime in a dropdownlist (with different CultureInfo)'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-378737920703031668</id><published>2009-08-21T16:29:00.003+02:00</published><updated>2009-08-25T12:55:46.971+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='onload'/><category scheme='http://www.blogger.com/atom/ns#' term='ready'/><category scheme='http://www.blogger.com/atom/ns#' term='add_endRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='endRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX.NET'/><title type='text'>Call document OnLoad after an AJAX.NET request</title><content type='html'>When you use your own JavaScript combined with AJAX.NET, you might bump into the problem that your document OnLoad event is not fired after AJAX requests.&lt;br /&gt;This can be solved by using AJAX.NET's endRequest event.&lt;br /&gt;Please note that i use jQuery, so you will need that in order for this example to work.&lt;br /&gt;&lt;pre class="brush: js"&gt;&lt;br /&gt;var documentReady = function() {&lt;br /&gt;    // here you do all the stuff you would normally do in $(document).ready()&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;$(document).ready(documentReady);&lt;br /&gt; &lt;br /&gt;// This will call the documentReady() function every time an AJAX request is finished&lt;br /&gt;Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() {&lt;br /&gt;    documentReady();&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This can of course be used to call any function after an AJAX request.&lt;br /&gt;&lt;br /&gt;2009-08-25: I just found out that you can also use add_pageLoaded() instead of add_endRequest().&lt;br /&gt; &lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-378737920703031668?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/378737920703031668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/call-document-onload-after-ajaxnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/378737920703031668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/378737920703031668'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/call-document-onload-after-ajaxnet.html' title='Call document OnLoad after an AJAX.NET request'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-6684047960044675994</id><published>2009-08-20T08:16:00.016+02:00</published><updated>2009-08-21T15:55:39.854+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='options'/><category scheme='http://www.blogger.com/atom/ns#' term='removeoption'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='select'/><category scheme='http://www.blogger.com/atom/ns#' term='dropdown'/><title type='text'>jQuery removeOptionByValue plugin for dropdown list</title><content type='html'>I needed to remove an option with a specific value from a select element with JavaScript.&lt;br /&gt;It seems that jQuery lacks something like a removeOptionByValue() method.&lt;br /&gt;I tried to use a selector to remove one option, like this: $("#mySelect option[@value=ToBeRemoved]").remove() but that resulted in an error.&lt;br /&gt;So i wrote a little plugin for it.&lt;br /&gt;&lt;br /&gt;This is the example HTML:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;select id="ddlTest"&amp;gt; &lt;br /&gt;    &amp;lt;option value=""&amp;gt;- Please choose -&amp;lt;/option&amp;gt; &lt;br /&gt;    &amp;lt;option value="first"&amp;gt;First option&amp;lt;/option&amp;gt; &lt;br /&gt;    &amp;lt;option value="second"&amp;gt;Second option&amp;lt;/option&amp;gt; &lt;br /&gt;    &amp;lt;option value="third"&amp;gt;Third option&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;  &lt;br /&gt;&amp;lt;input id="btnTest" value="Test" type="button"&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We would like to remove the option with value "first" when the button is clicked.&lt;br /&gt;This is the javascript i wrote:&lt;br /&gt;&lt;pre class="brush:jscript"&gt;&lt;br /&gt;(function($) {&lt;br /&gt;    $.fn.removeOptionByValue = function(optionValue) {        &lt;br /&gt;        if ($(this).is("select")) {&lt;br /&gt;            var itemIndex = -1;&lt;br /&gt;            var dropdownId = $(this).attr("id");&lt;br /&gt;            &lt;br /&gt;            $("#" + dropdownId + " option").each(function() {&lt;br /&gt;                itemIndex++;&lt;br /&gt;                if ($(this).val() == optionValue) {&lt;br /&gt;                    $("#" + dropdownId)[0].remove(itemIndex);&lt;br /&gt;                }&lt;br /&gt;            });&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;})(jQuery);&lt;br /&gt; &lt;br /&gt;// Test if it works&lt;br /&gt;$("#btnTest").click(function() {&lt;br /&gt;    $("#ddlTest").removeOption("first");&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Download the solution as jQuery plugin here: &lt;a href="http://www.dottech.nl/jquery/jquery.removeoptionbyvalue.js"&gt;jquery.removeoptionbyvalue.js&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-6684047960044675994?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/6684047960044675994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/jquery-removeoption-plugin-for-dropdown.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/6684047960044675994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/6684047960044675994'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/jquery-removeoption-plugin-for-dropdown.html' title='jQuery removeOptionByValue plugin for dropdown list'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-4148561182870186391</id><published>2009-08-19T16:09:00.002+02:00</published><updated>2009-08-19T16:13:31.554+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='stupid IE'/><category scheme='http://www.blogger.com/atom/ns#' term='invalid argument'/><category scheme='http://www.blogger.com/atom/ns#' term='window.open'/><title type='text'>window.open resulting in "Invalid argument" error in IE</title><content type='html'>I kept getting an Invalid Argument error in IE while trying to execute window.open() in JavaScript.&lt;br /&gt;Appearantly in IE you cannot use spaces in the name you give to the window.&lt;br /&gt;&lt;br /&gt;So...&lt;br /&gt;&lt;br /&gt;&lt;em&gt;window.open("mypage.html", "&lt;strong&gt;my window name&lt;/strong&gt;");&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;...does not work, while...&lt;br /&gt;&lt;br /&gt;&lt;em&gt;window.open("mypage.html", "&lt;strong&gt;mywindowname&lt;/strong&gt;");&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;...works fine.&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-4148561182870186391?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/4148561182870186391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/windowopen-resulting-in-invalid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/4148561182870186391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/4148561182870186391'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/windowopen-resulting-in-invalid.html' title='window.open resulting in &quot;Invalid argument&quot; error in IE'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-3010003420643307136</id><published>2009-08-14T12:47:00.010+02:00</published><updated>2009-11-06T09:46:25.788+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='TechSite'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='CMS'/><category scheme='http://www.blogger.com/atom/ns#' term='Content Management'/><title type='text'>TechSite CMS</title><content type='html'>When i started dotTech i decided to write my own .NET based Content Management System.&lt;br /&gt;My goal was to expand my knowledge of .NET and to be able to offer my customers an easy-to-use content management solution.&lt;br /&gt;I think the result is a steady base for an easily expandable CMS with great possiblities.&lt;br /&gt;As interest towards this CMS grows, i decided to make a blog post about it. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_izKeYoq46Fo/SoVOBz-a9DI/AAAAAAAAABA/8zD1wEt5wzs/s1600-h/techsite.jpg"&gt;&lt;img style="float:right; margin:30px 0 10px 10px;cursor:pointer; cursor:hand;width: 302px; height: 320px;" src="http://1.bp.blogspot.com/_izKeYoq46Fo/SoVOBz-a9DI/AAAAAAAAABA/8zD1wEt5wzs/s320/techsite.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5369783923748041778" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;TechSite explained&lt;/strong&gt;&lt;br /&gt;The CMS is item-based and the user interface is build around a treeview that represents the website's content structure.&lt;br /&gt;From the tree the items can be added, changed, renamed, removed and moved.&lt;br /&gt;When adding an item, the user can choose between different item templates (for example, a product item or a news item).&lt;br /&gt;Item templates consist of regions (e.g. content, specifications) and regions constist of fields (see screenshot).&lt;br /&gt;Fields can be of different types, for example single line text, html text, image or a date.&lt;br /&gt;The current version contains 8 fieldtypes and these are very easy to expand.&lt;br /&gt;How the item templates are treated on the frontend depends on the implementation and is independent of the backend.&lt;br /&gt;That is one of the things i really like about this solution: i can provide the customer with a fully working backend before i start with the implementation of the frontend.&lt;br /&gt;&lt;br /&gt;A quick peek at the highlights and features:&lt;br /&gt;- Based on .NET 2.0&lt;br /&gt;- Support for all major browsers (IE6-8, FF2-3, Safari, Chrome)&lt;br /&gt;- Built on .NET DataProviders for future support of other databases&lt;br /&gt;- Uses MooTools for all clientside scripting&lt;br /&gt;- Integrated FCKEditor for user-friendly content editing&lt;br /&gt;- Supports friendly Urls&lt;br /&gt;- Provides an API for development of the frontend&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Future&lt;/strong&gt;&lt;br /&gt;TechSite's future development relies on the needs of my customers.&lt;br /&gt;The CMS is provided for free and the customer pays only for the implementation and for the development of custom features.&lt;br /&gt;So as the usage of TechSite expands, the possiblities grow with it.&lt;br /&gt;&lt;br /&gt;A few features that i expect to see in the future:&lt;br /&gt;- PHP connector to enable linux-based customers to use TechSite for their website&lt;br /&gt;- More advanced File Explorer&lt;br /&gt;- Out-of-the-box implementations&lt;br /&gt;- Multi-language support&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Demo&lt;/strong&gt;&lt;br /&gt;There is an online demo of the backend available here: &lt;a href="http://techsite.dottech.nl/techsite/default.aspx" target="_blank"&gt;http://techsite.dottech.nl/techsite/default.aspx&lt;/a&gt;.&lt;br /&gt;&lt;strong&gt;All the save actions (such as adding, updating, (re)moving) have been disabled for the demo!&lt;/strong&gt;&lt;br /&gt;The demo comes with a simple (unfinished) website which is available &lt;a href="http://techsite.dottech.nl/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;EDIT: Demo is temporarily offline due&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Last words&lt;/strong&gt;&lt;br /&gt;Like i said before, TechSite is a steady base for a CMS, but it's not yet a final product so keep that in mind while checking out the demo.&lt;br /&gt;I will keep track of TechSite's development here on my blog.&lt;br /&gt;Feel free to leave any comments or questions you have about TechSite here.&lt;br /&gt;&lt;br /&gt;If you would like to use TechSite for your own website, you can contact me by &lt;a href="mailto:info@dottech.nl"&gt;email&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-3010003420643307136?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/3010003420643307136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/techsite-cms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3010003420643307136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3010003420643307136'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/08/techsite-cms.html' title='TechSite CMS'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_izKeYoq46Fo/SoVOBz-a9DI/AAAAAAAAABA/8zD1wEt5wzs/s72-c/techsite.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-3922691854883497663</id><published>2009-07-29T23:19:00.008+02:00</published><updated>2011-10-02T19:30:18.813+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='mootools'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><category scheme='http://www.blogger.com/atom/ns#' term='treeview'/><title type='text'>JavaScript TreeView component using MooTools library</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_izKeYoq46Fo/SnC9SzQaTiI/AAAAAAAAAAw/ZZOdeiOuZZ8/s1600-h/treeviewdemo.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 158px; height: 200px;" src="http://4.bp.blogspot.com/_izKeYoq46Fo/SnC9SzQaTiI/AAAAAAAAAAw/ZZOdeiOuZZ8/s200/treeviewdemo.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5363995286892596770" /&gt;&lt;/a&gt;Some time ago i wrote this TreeView component using the MooTools javascript library.&lt;br /&gt;As far as i know there are not many treeviews around for MooTools, so i decided to put it up for grabs here.&lt;br /&gt;&lt;br /&gt;Key Features:&lt;br /&gt;- Load tree data from JSON file&lt;br /&gt;- Load child nodes on demand using AJAX&lt;br /&gt;- Select multiple nodes&lt;br /&gt;&lt;br /&gt;View the &lt;a href="http://www.dottech.nl/tree/index.html" target="_blank"&gt;demo here&lt;/a&gt;.&lt;br /&gt;Download DotTech Tree v1.0.1: &lt;a href="http://www.dottech.nl/tree/dottech.tree-1.0.1.zip"&gt;dottech.tree-1.0.1.zip&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;UPDATE: Unfortunately the code is not available at the moment (i lost it and didnt have time to search for it yet)&lt;br /&gt;&lt;br/&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-3922691854883497663?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/3922691854883497663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/javascript-treeview-component-using.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3922691854883497663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3922691854883497663'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/javascript-treeview-component-using.html' title='JavaScript TreeView component using MooTools library'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_izKeYoq46Fo/SnC9SzQaTiI/AAAAAAAAAAw/ZZOdeiOuZZ8/s72-c/treeviewdemo.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-1535097004707571768</id><published>2009-07-28T19:27:00.019+02:00</published><updated>2009-08-21T15:51:13.942+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='print_r'/><category scheme='http://www.blogger.com/atom/ns#' term='var_dump()'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='var_dump'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>PHP var_dump() method for C#</title><content type='html'>In PHP there is the var_dump() and print_r() function that displays the contents of an object.&lt;br /&gt;Sometimes i miss this functionality in ASP.NET, especially when you are working with large objects and don't want to step into your code every time.&lt;br /&gt;I came up with this method to list all the properties of a given object by name and value.&lt;br /&gt;It also lists any child properties recursively, until it reaches a certain level of recursion (in this case it stops after 5 recursions).&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Reflection;&lt;br /&gt;using System.Collections;&lt;br /&gt; &lt;br /&gt;public string var_dump(object obj, int recursion)&lt;br /&gt;{&lt;br /&gt;    StringBuilder result = new StringBuilder();&lt;br /&gt; &lt;br /&gt;    // Protect the method against endless recursion&lt;br /&gt;    if (recursion &lt; 5)&lt;br /&gt;    {&lt;br /&gt;        // Determine object type&lt;br /&gt;        Type t = obj.GetType();&lt;br /&gt; &lt;br /&gt;        // Get array with properties for this object&lt;br /&gt;        PropertyInfo[] properties = t.GetProperties();&lt;br /&gt; &lt;br /&gt;        foreach (PropertyInfo property in properties)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                // Get the property value&lt;br /&gt;                object value = property.GetValue(obj, null);&lt;br /&gt; &lt;br /&gt;                // Create indenting string to put in front of properties of a deeper level &lt;br /&gt;                // We'll need this when we display the property name and value&lt;br /&gt;                string indent = String.Empty;&lt;br /&gt;                string spaces = "|   ";&lt;br /&gt;                string trail = "|...";&lt;br /&gt;                 &lt;br /&gt;                if (recursion &gt; 0)&lt;br /&gt;                {&lt;br /&gt;                    indent = new StringBuilder(trail).Insert(0, spaces, recursion - 1).ToString();&lt;br /&gt;                }&lt;br /&gt; &lt;br /&gt;                if (value != null)&lt;br /&gt;                {&lt;br /&gt;                    // If the value is a string, add quotation marks&lt;br /&gt;                    string displayValue = value.ToString();&lt;br /&gt;                    if (value is string) displayValue = String.Concat('"', displayValue, '"');&lt;br /&gt; &lt;br /&gt;                    // Add property name and value to return string&lt;br /&gt;                    result.AppendFormat("{0}{1} = {2}\n", indent, property.Name, displayValue);&lt;br /&gt; &lt;br /&gt;                    try&lt;br /&gt;                    {&lt;br /&gt;                        if (!(value is ICollection))&lt;br /&gt;                        {&lt;br /&gt;                            // Call var_dump() again to list child properties&lt;br /&gt;                            // This throws an exception if the current property value &lt;br /&gt;                            // is of an unsupported type (eg. it has not properties)&lt;br /&gt;                            result.Append(var_dump(value, recursion + 1));&lt;br /&gt;                        }&lt;br /&gt;                        else&lt;br /&gt;                        {&lt;br /&gt;                            // 2009-07-29: added support for collections&lt;br /&gt;                            // The value is a collection (eg. it's an arraylist or generic list)&lt;br /&gt;                            // so loop through its elements and dump their properties&lt;br /&gt;                            int elementCount = 0;&lt;br /&gt;                            foreach (object element in ((ICollection)value))&lt;br /&gt;                            {&lt;br /&gt;                                string elementName = String.Format("{0}[{1}]", property.Name, elementCount);&lt;br /&gt;                                indent = new StringBuilder(trail).Insert(0, spaces, recursion).ToString();&lt;br /&gt; &lt;br /&gt;                                // Display the collection element name and type&lt;br /&gt;                                result.AppendFormat("{0}{1} = {2}\n", indent, elementName, element.ToString());&lt;br /&gt; &lt;br /&gt;                                // Display the child properties&lt;br /&gt;                                result.Append(var_dump(element, recursion + 2));&lt;br /&gt;                                elementCount++;&lt;br /&gt;                            }&lt;br /&gt; &lt;br /&gt;                            result.Append(var_dump(value, recursion + 1));&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                    catch { }&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    // Add empty (null) property to return string&lt;br /&gt;                    result.AppendFormat("{0}{1} = {2}\n", indent, property.Name, "null");&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch&lt;br /&gt;            {&lt;br /&gt;                // Some properties will throw an exception on property.GetValue() &lt;br /&gt;                // I don't know exactly why this happens, so for now i will ignore them...&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    return result.ToString();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For my example i used an object called Category, but this can be an instance of any class.&lt;br /&gt;Category has a few basic properties and one called Parent which holds another Category object (so we have child properties).&lt;br /&gt;I call the method like this:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;Category category = LoadCategory(123);&lt;br /&gt;Response.Write(var_dump(myObject, 0));  // Always start at recursion 0, &lt;br /&gt;                                        // you might want to add an override&lt;br /&gt;                                        // that sets this argument by default&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The output of this example is:&lt;br /&gt;&lt;pre name="code" class="js"&gt;&lt;br /&gt;CategoryId = 685&lt;br /&gt;ParentId = 287&lt;br /&gt;Name = "Beans"&lt;br /&gt;Description = ""&lt;br /&gt;Parent = MyProject.Data.Category&lt;br /&gt;|...CategoryId = 287&lt;br /&gt;|...ParentId = 174&lt;br /&gt;|...Name = "Cheap food"&lt;br /&gt;|...Description = ""&lt;br /&gt;|...Parent = MyProject.Data.Category&lt;br /&gt;|   |...CategoryId = 174&lt;br /&gt;|   |...ParentId = 173&lt;br /&gt;|   |...Name = "Food"&lt;br /&gt;|   |...Description = ""&lt;br /&gt;|   |...Parent = MyProject.Data.Category&lt;br /&gt;|   |   |...CategoryId = 173&lt;br /&gt;|   |   |...ParentId = 0&lt;br /&gt;|   |   |...Name = "Things to eat"&lt;br /&gt;|   |   |...Description = ""&lt;br /&gt;|   |   |...Parent = null&lt;br /&gt;|   |   |...Count = 0&lt;br /&gt;|   |...Count = 0&lt;br /&gt;|...Count = 13&lt;br /&gt;Count = 0&lt;br /&gt;TestList = System.Collections.Generic.List`1[MyProject.Data.Category]&lt;br /&gt;|...TestList[0] = MyProject.Data.Category&lt;br /&gt;|   |...CategoryId = 1&lt;br /&gt;|   |...ParentId = 0&lt;br /&gt;|   |...Name = "Bla"&lt;br /&gt;|   |...Description = ""&lt;br /&gt;|   |...Count = 0&lt;br /&gt;|...Count = 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's not exactly PHP's var_dump() method, but it works for me! :)&lt;br /&gt;I might expand it some day so it dumps array/list elements too and maybe add some XHTML formatting.&lt;br /&gt;&lt;br /&gt;Update on 29-07-2009:&lt;br /&gt;Added support for collection properties.&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-1535097004707571768?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/1535097004707571768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/php-vardump-method-for-c.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/1535097004707571768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/1535097004707571768'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/php-vardump-method-for-c.html' title='PHP var_dump() method for C#'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-5440039158698081264</id><published>2009-07-28T14:51:00.006+02:00</published><updated>2009-07-28T19:39:05.439+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='reseed'/><category scheme='http://www.blogger.com/atom/ns#' term='identity'/><category scheme='http://www.blogger.com/atom/ns#' term='dbcc'/><title type='text'>Reseed the identity column of a table in SQL Server</title><content type='html'>When you want the identity field of a table to be reset (start with id 1 again), execute the following SQL query:&lt;br /&gt;&lt;br /&gt;DBCC CHECKIDENT (tableName, reseed, 0) &lt;br /&gt;&lt;br /&gt;Where "tableName" is replaced by the name of your table and the 0 is the new seed.&lt;br /&gt;&lt;br /&gt;/Ruud&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-5440039158698081264?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/5440039158698081264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/reseed-identity-column-of-table-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5440039158698081264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5440039158698081264'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/reseed-identity-column-of-table-in-sql.html' title='Reseed the identity column of a table in SQL Server'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-5394738386558920407</id><published>2009-07-28T10:35:00.006+02:00</published><updated>2009-08-21T15:56:18.953+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta-characters'/><category scheme='http://www.blogger.com/atom/ns#' term='escape'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Target elements with ids that contain special characters using jQuery</title><content type='html'>Let's say you have some HTML elements with ids like this one:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;br /&gt;&amp;lt;div id="form~myform$div~mydiv[1]#value"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And you would like to target this element using jQuery.&lt;br /&gt;This will not work because of the special characters used in the element's id.&lt;br /&gt;If you execute the following jQuery:&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;$("div").each(function() {&lt;br /&gt;    var divId = this.id;&lt;br /&gt;    var jQueryFound = $('#' + this.id).length;&lt;br /&gt;        &lt;br /&gt;    alert("Div id is '" + divId + "' and jQuery found " + jQueryFound);&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The result is: Div id='form~myform$div~mydiv[1]#value' and jQuery found 0.&lt;br /&gt;JQuery cannot find the element id because it contains meta-characters that jQuery parses as part of the selector.&lt;br /&gt;To solve this problem i wrote a method which escapes the special characters so jQuery parses them as part of the id.&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;var jEscape = function(jquery) {&lt;br /&gt;    jquery = jquery.replace(new RegExp("\\$", "g"), "\\$");&lt;br /&gt;    jquery = jquery.replace(new RegExp("\~", "g"), "\\~");&lt;br /&gt;    jquery = jquery.replace(new RegExp("\\[", "g"), "\\[");&lt;br /&gt;    jquery = jquery.replace(new RegExp("\\]", "g"), "\\]");&lt;br /&gt;    jquery = jquery.replace(new RegExp("#", "g"), "\\#");&lt;br /&gt;    return jquery;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now execute the following code to see that it works:&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;$("div").each(function() {&lt;br /&gt;    var divId = this.id;&lt;br /&gt;    var escapedId = jEscape(this.id);&lt;br /&gt;    var jQueryFound = $('#' + escapedId).length;&lt;br /&gt;    &lt;br /&gt;    alert("Div id is '" + divId + "' which is escaped to '" + escapedId + "' and jQuery found " + jQueryFound);&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The result is: Div id is 'form~myform$div~mydiv[1]#value' which is escaped to 'form\~myform\$div\~mydiv\[1\]\#value' and jQuery found 1.&lt;br /&gt;&lt;br /&gt;If you want to escape all the possible jQuery meta-characters, expand the method to escape these: ;&amp;,.+*':"!^()=&gt;|/&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-5394738386558920407?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/5394738386558920407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/target-elements-with-ids-that-contain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5394738386558920407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5394738386558920407'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/target-elements-with-ids-that-contain.html' title='Target elements with ids that contain special characters using jQuery'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-5908671489922673019</id><published>2009-07-27T23:57:00.010+02:00</published><updated>2009-08-20T23:30:57.999+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='deserialize'/><category scheme='http://www.blogger.com/atom/ns#' term='generics'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Generic XML deserializer method</title><content type='html'>For one of my projects i needed to deserialize several XML files to objects of different data types.&lt;br /&gt;Therefore i wrote this generic deserialization method:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;public static T Deserialize&lt;T&gt;(XmlReader xmlReader, string rootElement)&lt;br /&gt;{&lt;br /&gt;    T result;&lt;br /&gt;&lt;br /&gt;    XmlRootAttribute root = new XmlRootAttribute(rootElement);&lt;br /&gt;    XmlSerializer xmlSerializer = new XmlSerializer(typeof(T), root);&lt;br /&gt;    result = (T)xmlSerializer.Deserialize(xmlReader);&lt;br /&gt;&lt;br /&gt;    return result;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;To use it, you first load your XML file into an XmlReader object and call the method like this:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;MyTargetType deserialized = Deserialize&lt;MyTargetType&gt;(xmlReader, "startnode");&lt;br /&gt;&lt;/pre&gt;(ignore the type name being upper case in my example, it's caused by the code highlighter)&lt;br /&gt;&lt;br /&gt;I will post some more later about how you can let your application use its configuration to decide what data type specific XML files should be deserialized to.&lt;br /&gt;This can be very usefull when you have an application that deserializes multiple XML feeds and you want the list of feeds to be configurable outside of the code.&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-5908671489922673019?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/5908671489922673019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/generic-xml-deserializer-method.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5908671489922673019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/5908671489922673019'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/generic-xml-deserializer-method.html' title='Generic XML deserializer method'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-434356757296514120</id><published>2009-07-27T22:10:00.018+02:00</published><updated>2009-10-29T20:24:50.019+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lambda'/><category scheme='http://www.blogger.com/atom/ns#' term='clean string'/><category scheme='http://www.blogger.com/atom/ns#' term='List.ForEach'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='delegate'/><title type='text'>Remove all non-letter characters from a string</title><content type='html'>&lt;strong&gt;Problem:&lt;/strong&gt; You have a string that may contain various special characters and you need it to contain only letters and digits.&lt;br /&gt;...and you don't want to use regular expressions ;-)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; There are problably a hundred ways to do this, but if you are using C# 3.0 or higher, there is a very quick solution that costs you just one line of code.&lt;br /&gt;First i will show the slightly larger version of the code snippet which explains the workings better:&lt;br /&gt;&lt;pre class="brush: c-sharp; auto-links: false"&gt;&lt;br /&gt;string dirtyString = "http://www.dottech.nl/#?this%20is%20dirty!";&lt;br /&gt;string cleanString = String.Empty;&lt;br /&gt;&lt;br /&gt;// Convert the string to a character array so we can load it into a List&lt;br /&gt;char[] dirtyChars = dirtyString.ToCharArray();&lt;br /&gt;&lt;br /&gt;// Create a character list and load the dirtyChars array&lt;br /&gt;List&amp;lt;Char&amp;gt; characters = new List(dirtyChars);&lt;br /&gt;&lt;br /&gt;// Use the List's ForEach method to iterate through the characters&lt;br /&gt;characters.ForEach(delegate(char c)&lt;br /&gt;{&lt;br /&gt;   if (Char.IsLetter(c))&lt;br /&gt;   {&lt;br /&gt;       cleanString += c.ToString();&lt;br /&gt;   }&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;return cleanString; // "httpwwwdottechnlthisisdirty"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, when i wrote this i figured it had to be a little more compact.&lt;br /&gt;So i used a &lt;a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" target="_blank"&gt;Lambda Expression&lt;/a&gt; which is a new feature in C# 3.0 and changed the ForEach line to this:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;characters.ForEach(c =&gt; cleanString += (Char.IsLetter(c)) ? c.ToString() : String.Empty);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And after some more compacting i ended up with the final snippet:&lt;br /&gt;&lt;pre class="brush: c-sharp"&gt;&lt;br /&gt;new List&amp;lt;Char&amp;gt;(dirtyString.ToCharArray()).ForEach(c =&gt; cleanString += (Char.IsLetter(c)) ? c.ToString() : String.Empty);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Although it might look complex to someone who sees that line of code for the first time, i still think it's a pretty maintainable line of code as long as you put some comments above it explaining how dirtyString is the input and cleanString the output.&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-434356757296514120?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/434356757296514120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/remove-all-non-letter-characters-from.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/434356757296514120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/434356757296514120'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/remove-all-non-letter-characters-from.html' title='Remove all non-letter characters from a string'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7168012461497416647.post-3131952421645846261</id><published>2009-07-27T21:41:00.007+02:00</published><updated>2009-07-28T10:29:52.552+02:00</updated><title type='text'>Welcome to Ruud.Tech, a blog for software engineers</title><content type='html'>Since i regularly stumble upon and come up with nifty code snippets and solutions which might be usefull for other software engineers, i have decided to start this blog and collect them here.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;/Ruud&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7168012461497416647-3131952421645846261?l=ruuddottech.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ruuddottech.blogspot.com/feeds/3131952421645846261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/blog-opening-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3131952421645846261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7168012461497416647/posts/default/3131952421645846261'/><link rel='alternate' type='text/html' href='http://ruuddottech.blogspot.com/2009/07/blog-opening-post.html' title='Welcome to Ruud.Tech, a blog for software engineers'/><author><name>Ruud</name><uri>http://www.blogger.com/profile/13374242341618330246</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_izKeYoq46Fo/Sm4YLDU-LeI/AAAAAAAAAAM/opIGJFZWHN0/S220/3621248.jpg'/></author><thr:total>0</thr:total></entry></feed>
