<?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-28193226</id><updated>2012-01-13T04:04:11.761-08:00</updated><category term='appendTemplate'/><title type='text'>C# Tutorial</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28193226.post-2883202089395176719</id><published>2011-11-02T08:19:00.000-07:00</published><updated>2011-11-02T10:20:45.803-07:00</updated><title type='text'>Linq - Select only latest revision</title><content type='html'>I'm doing a different approach to what I normally do on my new home page. I'm storing all my data with revisions. Update a photo or an article and it is stored in my database with a new revision.A simple entity might look something like this:&lt;pre class='brush: csharp'&gt;Person&lt;br /&gt;--&lt;br /&gt;int id&lt;br /&gt;int revision&lt;br /&gt;string name&lt;/pre&gt;Now, my challenge was to retrieve persons from my database, but only the latest revision. So I wrote myself some Linq that looks a bit like this:&lt;pre class='brush: csharp'&gt;public IEnumerable&amp;lt;Person&amp;gt; GetPersons()&lt;br /&gt;{&lt;br /&gt;    return  from person in Person.All()&lt;br /&gt;            group person by person.Id&lt;br /&gt;            into personGroup&lt;br /&gt;            from entity in personGroup&lt;br /&gt;            where entity.Revision == personGroup.Max(x =&gt; x.Revision)&lt;br /&gt;            select entity;&lt;br /&gt;}&lt;/pre&gt;And it returns a list of unique persons, but only the latest revision of each.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-2883202089395176719?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/2883202089395176719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=2883202089395176719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/2883202089395176719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/2883202089395176719'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/11/linq-select-only-latest-revision.html' title='Linq - Select only latest revision'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-103323358662590137</id><published>2011-10-27T03:54:00.000-07:00</published><updated>2011-10-27T03:54:30.458-07:00</updated><title type='text'>Unit testing with mock objects</title><content type='html'>This article is meant as a short tutorial on how to use an isolation framework. I prefer Moq for my .NET projects, but I'm sure there are other good alternatives out there. Moq can be pulled from NuGet. Simply add it to your test project and you're good to go.&lt;br /&gt;&lt;br /&gt;When do we use mocking? The answer is, we use mocking when we need to isolate a unit for testing. Let's say I have a method that pulls a resource from the internet, looks at it and returns a list of strings. What we want to test is how different inputs gives different results, not the actual operation of opening the web page and streaming data.&lt;br /&gt;&lt;br /&gt;I have some code ready and I will demonstrate how to write some tests for it. In the code below, I download and go through an xml document and look for nodes containing names:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;public List&amp;lt;string&amp;gt; FetchData(string url)&lt;br /&gt;{&lt;br /&gt;    // Get XmlDocument using WebClient&lt;br /&gt;    var document = new XmlDocument();&lt;br /&gt;    document.Load(new WebClient().OpenRead(url));&lt;br /&gt;           &lt;br /&gt;    // Go through the document and aggregate a list of strings&lt;br /&gt;    var list = new List&amp;lt;string&amp;gt;();&lt;br /&gt;    foreach (var node in document.GetElementsByTagName("name"))&lt;br /&gt;    {&lt;br /&gt;        list.Add(((XmlNode) node).InnerText);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return list;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Separate concerns&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Now, the first thing I have to do is to take out the code that talks to the internet. This way, I can inject different result data and see how it affects the output. I simply set up a wrapper for the WebClient, so that the rest of the code can be isolated for testing. Here's my wrapper class:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;public interface IWebClientWrapper&lt;br /&gt;{&lt;br /&gt;    XmlDocument FetchXml(string url);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Here's an implementation of my interface:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;public class WebClientWrapper : IWebClientWrapper&lt;br /&gt;{&lt;br /&gt;    public XmlDocument FetchXml(string url)&lt;br /&gt;    {&lt;br /&gt;        // Do stuff and return XmlDocument&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Now, I have a separate unit that speeks with the internet and a separate unit that interprets the results. I've set up the wrapper class with an interface so that it can be mocked for testing. Either that or its methods would have to be marked as virtual.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Prep the code&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;Next, in my web-fetch-thing-class, I set up a new property, WebClientWrapper. The property has the type IWebClientProxy. If it is not set, it will simply create a new instance. This pattern allows me to inject a custom instance of IWebClientProxy for testing.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;private IWebClientWrapper _webClientWrapper;&lt;br /&gt;public IWebClientWrapper WebClientWrapper&lt;br /&gt;{&lt;br /&gt;    get&lt;br /&gt;    {&lt;br /&gt;        if (_webClientWrapper == null)&lt;br /&gt;            _webClientWrapper = new WebClientWrapper();&lt;br /&gt;        return _webClientWrapper;&lt;br /&gt;    }&lt;br /&gt;    set { _webClientWrapper = value; }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;My FetchData method now looks like this:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;public List&amp;lt;string&amp;gt; FetchData(string url)&lt;br /&gt;{&lt;br /&gt;    // Get XmlDocument from the WebClient wrapper class&lt;br /&gt;    var document = WebClientWrapper.FetchXml(url);&lt;br /&gt;&lt;br /&gt;    // Go through the document and aggregate a list of strings&lt;br /&gt;    var list = new List&amp;lt;string&amp;gt;();&lt;br /&gt;    foreach (var node in document.GetElementsByTagName("name"))&lt;br /&gt;    {&lt;br /&gt;        list.Add(((XmlNode) node).InnerText);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return list;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Testing the code&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Let's take a look at the actual tests. I wanted to test how different results affects how my method aggregates a list of names. Let's start with some code:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;var webClientWrapper = new Mock&amp;lt;IWebClientWrapper&amp;gt;();&lt;br /&gt;webClientWrapper&lt;br /&gt;   .Setup(x =&gt; x.FetchXml(It.IsAny&amp;lt;string&amp;gt;()))&lt;br /&gt;   .Returns((XmlDocument)null);&lt;/pre&gt;&lt;br /&gt;In the snippet above, we've created a new instance of a Mock class of the type IWebClientWrapper. We've set up the method FetchXml(...) to take any input, so long as it is of the type String and we've stated that it should return null. Note how we have to do casting when we want to return null. This is because the Return(...) method has overloads, and we have to explicitly tell which one we are using.&lt;br /&gt;&lt;br /&gt;Next, have a look at how we inject the mock object. Remember how I made the WebClient wrapper into a property?&lt;br /&gt;&lt;pre class="brush: csharp"&gt;var webFetcher = new WebFetcher &lt;br /&gt;                 { &lt;br /&gt;                    WebClientWrapper = webClientWrapper.Object &lt;br /&gt;                 };&lt;/pre&gt;&lt;br /&gt;Now, I can excute my method, and see how it behaves. I actually want it to throw an exception if the WebClient returns null. Have a look at the full test:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;[TestMethod]&lt;br /&gt;[ExpectedException(typeof(Exception), AllowDerivedTypes = true)]&lt;br /&gt;public void WebFetcher_TestWithNullDocument_ShouldThrowException()&lt;br /&gt;{&lt;br /&gt;    // Setup&lt;br /&gt;    var webClientWrapper = new Mock&amp;lt;IWebClientWrapper&amp;gt;();&lt;br /&gt;    webClientWrapper.Setup(x =&gt; x.FetchXml(It.IsAny&amp;lt;string&amp;gt;())).Returns((XmlDocument)null);&lt;br /&gt;&lt;br /&gt;    var webFetcher = new WebFetcher &lt;br /&gt;                     { &lt;br /&gt;                        WebClientWrapper = webClientWrapper.Object &lt;br /&gt;                     };&lt;br /&gt;&lt;br /&gt;    // Execute&lt;br /&gt;    webFetcher.FetchData("http://www.somewhere.com/validUrl/");&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;I also want to see how the results are when we provide a valid xml document. Have a look at the following test:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;[TestMethod]&lt;br /&gt;public void WebFetcher_TestWithValidExampleData_ShouldReturnXmlDocument()&lt;br /&gt;{&lt;br /&gt;    // Setup&lt;br /&gt;    var document = new XmlDocument();&lt;br /&gt;    document.LoadXml("&amp;lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\"?&amp;gt;&amp;lt;names&amp;gt;&amp;lt;name&amp;gt;Brian&amp;lt;/name&amp;gt;&amp;lt;name&amp;gt;John&amp;lt;/name&amp;gt;&amp;lt;/names&amp;gt;");&lt;br /&gt;&lt;br /&gt;    var webClientWrapper = new Mock&amp;lt;IWebClientWrapper&amp;gt;();&lt;br /&gt;    webClientWrapper.Setup(x =&gt; x.FetchXml(It.IsAny&amp;lt;string&amp;gt;())).Returns(document);&lt;br /&gt;&lt;br /&gt;    var webFetcher = new WebFetcher &lt;br /&gt;                     { &lt;br /&gt;                        WebClientWrapper = webClientWrapper.Object &lt;br /&gt;                     };&lt;br /&gt;&lt;br /&gt;    // Execute&lt;br /&gt;    var list = webFetcher.FetchData("http://www.somewhere.com/validUrl/");&lt;br /&gt;&lt;br /&gt;    // Assert&lt;br /&gt;    Assert.IsNotNull(list);&lt;br /&gt;    Assert.IsInstanceOfType(list, typeof (List&lt;string&gt;));&lt;br /&gt;    Assert.IsTrue(list.Count != 0);&lt;br /&gt;    Assert.IsTrue(list.Contains("Brian"));&lt;br /&gt;    Assert.IsTrue(list.Contains("John"));&lt;br /&gt;}&lt;/pre&gt;&lt;br&gt;I will have to make some changes in my original code. At least now, It's more testable and I can see how different input data affects the output.&lt;br&gt;&lt;br&gt;The code is posted on Bitbucket if you want to have a look:&lt;br&gt;&lt;a href = "https://bitbucket.org/andersnygaard/webfetcherthingy/src"&gt;https://bitbucket.org/andersnygaard/webfetcherthingy/src&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-103323358662590137?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/103323358662590137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=103323358662590137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/103323358662590137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/103323358662590137'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/10/unit-testing-with-mock-objects.html' title='Unit testing with mock objects'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5739642221063626488</id><published>2011-07-22T05:52:00.000-07:00</published><updated>2011-07-22T06:02:42.676-07:00</updated><title type='text'>DOS on Dope - ASP.NET MVC the old school way</title><content type='html'>Would you like to combine old school DOS skills with modern day web frameworks? Then DOS on dope might be something for you. Everything is written in DOS .bat scripts. Yes, everything. Views and controllers are all familiar .bat scripts.&lt;br /&gt;&lt;br /&gt;I've set up a small home page with a single Index view under a Home controller as you would expect from a simple MVC application. Here's the source:&lt;br /&gt;&lt;pre class="brush:shell"&gt;@echo off&lt;br /&gt;call ..\..\Views\Shared\_header Web Page&lt;br /&gt;call ..\..\h\h1 Welcome to my web page&lt;br /&gt;&lt;br /&gt;echo [strong] This web page is under construction [/strong]&lt;br /&gt;&lt;br /&gt;echo.&lt;br /&gt;echo [blockquote]&lt;br /&gt;echo [ul]&lt;br /&gt;pushd %cd%&lt;br /&gt;cd ..&lt;br /&gt;FOR /F "delims=~" %%A IN (' DIR /B/a:d') DO (&lt;br /&gt; echo [li][a href='%%A/']%%A[/a][/li]&lt;br /&gt;)&lt;br /&gt;echo [/ul]&lt;br /&gt;echo [/blockquote]&lt;br /&gt;&lt;br /&gt;echo [table]&lt;br /&gt;echo [tr]&lt;br /&gt;echo [td]&lt;br /&gt;echo [img src = "Content/anders.jpeg" width = "150"][/img]&lt;br /&gt;echo [/td]&lt;br /&gt;echo [td width = "400" valign = "top"]&lt;br /&gt;echo Hi, I am Anders, and this is my web page. Feel free to browse around and explore my life and works.&lt;br /&gt;echo [br]&lt;br /&gt;echo [br]&lt;br /&gt;echo Be shure you head over to&lt;br /&gt;echo [a href = "http://dod.codeplex.com/"]http://dod.codeplex.com/[/a]&lt;br /&gt;echo where you can learn how to make your own web page&lt;br /&gt;echo [/td]&lt;br /&gt;echo [/tr]&lt;br /&gt;echo [/table]&lt;br /&gt;echo [blink][a href = "Content/index.bat.txt"]Forget Razor, check out this awesome MVC syntax[/a][blink]&lt;br /&gt;&lt;br /&gt;::echo [blockquote][pre]"C:\Temp\Blog\Controllers\Home\Index.bat"[/pre][/blockquote]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Nice, or what?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Links:&lt;br /&gt;&lt;a href="http://external2.webtop.no/dodblog/"&gt;http://external2.webtop.no/dodblog/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dod.codeplex.com/"&gt;http://dod.codeplex.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5739642221063626488?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5739642221063626488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5739642221063626488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5739642221063626488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5739642221063626488'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/07/dos-on-dope.html' title='DOS on Dope - ASP.NET MVC the old school way'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-3796353010228029795</id><published>2011-07-15T05:40:00.000-07:00</published><updated>2011-07-15T05:58:36.458-07:00</updated><title type='text'>Code kata challenge #2</title><content type='html'>I've been playing around with linq-like functionality as a code kata the last few days. I've simplified the my Where method and made a simple skip and take function. I can now do this without the actual linq namespace:&lt;br /&gt;&lt;br /&gt;&lt;pre class = "brush:csharp"&gt;var results = list&lt;br /&gt;    .Skip(2)&lt;br /&gt;    .Take(200)&lt;br /&gt;    .Where(x =&gt; x % 2 == 0);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;My Skip method:&lt;br /&gt;&lt;br /&gt;&lt;pre class = "brush:csharp"&gt;public static IEnumerable&amp;lt;T&amp;gt; Skip&amp;lt;T&amp;gt;(&lt;br /&gt;    this IEnumerable&amp;lt;T&amp;gt; list, int count)&lt;br /&gt;{&lt;br /&gt;    var enumerator = list.GetEnumerator();&lt;br /&gt;    for (var i = 0; i &amp;lt; count; i++)&lt;br /&gt;        enumerator.MoveNext();&lt;br /&gt;&lt;br /&gt;    while (enumerator.MoveNext())&lt;br /&gt;        yield return enumerator.Current;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;My Take method:&lt;br /&gt;&lt;br /&gt;&lt;pre class = "brush:csharp"&gt;public static IEnumerable&amp;lt;T&amp;gt; Take&amp;lt;T&amp;gt;(&lt;br /&gt;        this IEnumerable&amp;lt;T&amp;gt; list, int count)&lt;br /&gt;{&lt;br /&gt;    var enumerator = list.GetEnumerator();&lt;br /&gt;    enumerator.MoveNext();&lt;br /&gt;    for (var i = 0; i &amp;lt; count; i++)&lt;br /&gt;    {&lt;br /&gt;        yield return enumerator.Current;&lt;br /&gt;        enumerator.MoveNext();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;My Where method:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;public static IEnumerable&amp;lt;T&amp;gt; Where&amp;lt;T&amp;gt;(&lt;br /&gt;    this IEnumerable&amp;lt;T&amp;gt; list, Predicate&amp;lt;T&amp;gt; expression)&lt;br /&gt;{&lt;br /&gt;    foreach(var item in list)&lt;br /&gt;        if(expression(item))&lt;br /&gt;            yield return item;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's darned fast too. Delayed excecution rocks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-3796353010228029795?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/3796353010228029795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=3796353010228029795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/3796353010228029795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/3796353010228029795'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/07/code-kata-challenge-2.html' title='Code kata challenge #2'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-8991714561105842845</id><published>2011-07-12T23:22:00.000-07:00</published><updated>2011-07-15T05:59:08.386-07:00</updated><title type='text'>Code kata challenge</title><content type='html'>&lt;span style="font-style: italic;"&gt;Code kata&lt;/span&gt; is a term coined by Dave Thomas, author of several programming books. He suggest you do small exercises regularly in order to keep yourself fit as a programmer.&lt;br /&gt;&lt;br /&gt;No doubt, this can be usefull, but doing a small bank account example ten times over doesn't make you fully capable of writing financial applications. In the real world you are likely to meet real world challenges.&lt;br /&gt;&lt;br /&gt;Now, what I like are challenges that make me better at core features or work methods. I like challenges like "here's a set of tests, write the method that makes them all pass". If you're good at that, you we'll be better at working with unit tests (TDD in fact).&lt;br /&gt;&lt;br /&gt;After watching Justin Etheredge on Linq over at Tekpub, I've got an idea for a code kata. Recreate the Linq functions like Justin does in episode 1. Once you've got the hang of one, move to the next. That should keep you busy for the next month or so and you will be the master of new language features like  extension methods, collection initializers, delegates, anonymous delegates, and lambas.&lt;br /&gt;&lt;br /&gt;Here's how you might extend IEnumerable in order to implement a WHERE method:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;&lt;br /&gt;namespace Linq.Kata&lt;br /&gt;{&lt;br /&gt;    public static IEnumerable&amp;lt;T&amp;gt; Where&amp;lt;T&amp;gt;(&lt;br /&gt;        this IEnumerable&amp;lt;T&amp;gt; list, Predicate&amp;lt;T&amp;gt; expression)&lt;br /&gt;    {&lt;br /&gt;        foreach(var item in list)&lt;br /&gt;            if(expression(item))&lt;br /&gt;                yield return item;&lt;br /&gt;    }    &lt;br /&gt;}&lt;/pre&gt;This method extends IEnumerable&lt;t&gt; and takes a function delegate as parameter. We traverse the list and execute the delegate function on each item in the list. The method would be called like this:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;var integerlist = new int[] {1, 2, 3, 4, 5, 6};&lt;br /&gt;var integerResukts = integerlist.KataWhere(x =&amp;gt; x % 2 == 0);&lt;br /&gt;&lt;br /&gt;var stringList = new string[] {"anders", "christian"};&lt;br /&gt;var stringResults = stringList.KataWhere(x =&amp;gt; x == "anders");&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some links:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Kata Catalogue&lt;br /&gt;&lt;a href="http://codingdojo.org/cgi-bin/wiki.pl?KataCatalogue"&gt;http://codingdojo.org/cgi-bin/wiki.pl?KataCatalogue&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Mastering Linq @ Tekpub&lt;br /&gt;&lt;a href="http://tekpub.com/view/linq/1"&gt;http://tekpub.com/view/linq/1&lt;/a&gt;&lt;br /&gt;&lt;/t&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-8991714561105842845?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/8991714561105842845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=8991714561105842845' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/8991714561105842845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/8991714561105842845'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/07/code-kata-challenge.html' title='Code kata challenge'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-1195413011867940294</id><published>2011-06-29T00:05:00.000-07:00</published><updated>2011-06-29T00:17:45.062-07:00</updated><title type='text'>Scalable source control</title><content type='html'>I recently started a small pet project. Using ASP.NET MVC3 with EF Code First, I think I've managed to keep it all small and tidy. But, if you add a set of tests, a bit of advanced jQuery in the front end and a custom authentication service on top of that, it's time to add a source control system. Here's what I've done as my project has grown:&lt;br /&gt;&lt;br /&gt;- Day one, I placed my project in a Dropbox folder. That way, I could reach my project files from all my computers (and even my iPhone).&lt;br /&gt;&lt;br /&gt;- A few weeks later, when I first had to make some serious changes and needed a fallback, I created a Mercurial repository in my Dropbox folder and commited all my code. I've got a blogpost on that here: http://csharptutorial.blogspot.com/2011/06/using-dropbox-with-mercurial.html. Mercurial is a great source control system, because it doesn't require a server installation and your repository is copied to all locations where it's checked out.&lt;br /&gt;   &lt;br /&gt;- Now, I'm looking at moving my project over to BitBucket (http://bitbucket.org/) which is a free hosting service (up to five users I think). It allows you to share code and has an issue tracker system.&lt;br /&gt;&lt;br /&gt;A good alternative to Mercurial is Git, using github.com in stead of bitbucket.org. Both have a learning curve, but they both represent modern version control tools and is well worth having a look at.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-1195413011867940294?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/1195413011867940294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=1195413011867940294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/1195413011867940294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/1195413011867940294'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/06/scalable-source-control.html' title='Scalable source control'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-1419989474339193552</id><published>2011-06-09T11:09:00.000-07:00</published><updated>2011-06-09T12:28:24.728-07:00</updated><title type='text'>Using DropBox with Mercurial</title><content type='html'>Here's a short guide to setup a Mercurial repository in a DropBox folder. You'll need a DropBox account set up and Turtoise Hg installed.&lt;br /&gt;&lt;br /&gt;First, create a DropBox folder for your Hg repository. I've got a project called Places, so I created a directory ./Projects/HGRepositories/Places&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-E_HHAVy1IK8/TfERRUBHh-I/AAAAAAAAALo/a8G96F__eec/s1600/dropbox02.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 315px;" src="http://4.bp.blogspot.com/-E_HHAVy1IK8/TfERRUBHh-I/AAAAAAAAALo/a8G96F__eec/s400/dropbox02.png" alt="" id="BLOGGER_PHOTO_ID_5616289199436564450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Inside your project directory, right click anywhere, then go TortoiseHg-&amp;gt;Create Repository Here&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-g_P5lFEDykc/TfETz2y_Z7I/AAAAAAAAAL4/Nkvs3CBt87Y/s1600/dropbox03.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 314px;" src="http://2.bp.blogspot.com/-g_P5lFEDykc/TfETz2y_Z7I/AAAAAAAAAL4/Nkvs3CBt87Y/s400/dropbox03.png" alt="" id="BLOGGER_PHOTO_ID_5616291991911360434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Follow the instructions. The destination directory should be the same as the one with your project.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-1oGdkQgmSKk/TfEUCxCuC8I/AAAAAAAAAMA/5nS5pi-T2Is/s1600/dropbox04.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 316px;" src="http://1.bp.blogspot.com/-1oGdkQgmSKk/TfEUCxCuC8I/AAAAAAAAAMA/5nS5pi-T2Is/s400/dropbox04.png" alt="" id="BLOGGER_PHOTO_ID_5616292248064756674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After you've finished initializing your repository, you should have the .hg folder and the .hgignore file added to your directory.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-o53grkTQzHg/TfEUW7BOzBI/AAAAAAAAAMQ/qXYhJkVs4Ns/s1600/dropbox06.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 315px;" src="http://1.bp.blogspot.com/-o53grkTQzHg/TfEUW7BOzBI/AAAAAAAAAMQ/qXYhJkVs4Ns/s400/dropbox06.png" alt="" id="BLOGGER_PHOTO_ID_5616292594340252690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Set up the ignore list.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-FKWefNWM9Ao/TfEUdGwRWdI/AAAAAAAAAMY/GpqXRXtfSJQ/s1600/dropbox07.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 310px;" src="http://1.bp.blogspot.com/-FKWefNWM9Ao/TfEUdGwRWdI/AAAAAAAAAMY/GpqXRXtfSJQ/s400/dropbox07.png" alt="" id="BLOGGER_PHOTO_ID_5616292700569557458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Copy the entire project directory over to your DropBox directory&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-GpV8rol1jGM/TfEUNf-QnWI/AAAAAAAAAMI/SYX29Q5VGlo/s1600/dropbox05.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 249px;" src="http://1.bp.blogspot.com/-GpV8rol1jGM/TfEUNf-QnWI/AAAAAAAAAMI/SYX29Q5VGlo/s400/dropbox05.png" alt="" id="BLOGGER_PHOTO_ID_5616292432461208930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next, from your project directory, open the Hg Repository Explorer.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-Q2fWyvFfwBY/TfEUj306GkI/AAAAAAAAAMg/XodqHW6tqKY/s1600/dropbox08.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 314px;" src="http://1.bp.blogspot.com/-Q2fWyvFfwBY/TfEUj306GkI/AAAAAAAAAMg/XodqHW6tqKY/s400/dropbox08.png" alt="" id="BLOGGER_PHOTO_ID_5616292816821557826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From the Repository Explorer, Commit your project.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-kC59tzpwp1w/TfEUqW2VGNI/AAAAAAAAAMo/jhRbUan37v8/s1600/dropbox09.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 360px;" src="http://2.bp.blogspot.com/-kC59tzpwp1w/TfEUqW2VGNI/AAAAAAAAAMo/jhRbUan37v8/s400/dropbox09.png" alt="" id="BLOGGER_PHOTO_ID_5616292928228235474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-X91lo1v204k/TfEUxiMmNAI/AAAAAAAAAMw/6FaIh1gWQmY/s1600/dropbox10.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 360px;" src="http://4.bp.blogspot.com/-X91lo1v204k/TfEUxiMmNAI/AAAAAAAAAMw/6FaIh1gWQmY/s400/dropbox10.png" alt="" id="BLOGGER_PHOTO_ID_5616293051533505538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-ne65RsTj1Bw/TfEU3iL_7JI/AAAAAAAAAM4/i9IepxSXRNA/s1600/dropbox11.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 363px;" src="http://1.bp.blogspot.com/-ne65RsTj1Bw/TfEU3iL_7JI/AAAAAAAAAM4/i9IepxSXRNA/s400/dropbox11.png" alt="" id="BLOGGER_PHOTO_ID_5616293154610211986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, push your changesets to the DropBox repository.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-R35OzYgKdFk/TfEU-CHZyUI/AAAAAAAAANA/Af6F3ikyXJg/s1600/dropbox12.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 361px;" src="http://1.bp.blogspot.com/-R35OzYgKdFk/TfEU-CHZyUI/AAAAAAAAANA/Af6F3ikyXJg/s400/dropbox12.png" alt="" id="BLOGGER_PHOTO_ID_5616293266260085058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And there you go. Your repository now has backup and is available from any computer that has access to your DropBox folders. In order to check out at another computer. Create an empty folder. Inside it, right click and choose TortoiseHg-&amp;gt;Clone and clone the repository from the shared DropBox folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-1419989474339193552?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/1419989474339193552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=1419989474339193552' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/1419989474339193552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/1419989474339193552'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/06/using-dropbox-with-mercurial.html' title='Using DropBox with Mercurial'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-E_HHAVy1IK8/TfERRUBHh-I/AAAAAAAAALo/a8G96F__eec/s72-c/dropbox02.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-8301839518652718479</id><published>2011-01-26T01:21:00.000-08:00</published><updated>2011-01-26T12:35:21.672-08:00</updated><title type='text'>Using Razor views with Webforms master page</title><content type='html'>While the new Razor view enginge for ASP.NET MVC3 looks fantastic, I haven't been able to dive into it quite yet. I soon discovered that you cannot mix and match Razor views with your old Webforms master page. You could have two master pages, but ideally you don't want to write the same code and markup twice.&lt;br /&gt;&lt;br /&gt;Scott Hanselman presents a solution. "Can I mix Razor Views and WebForms Views in a single ASP.NET MVC application?", he asks. The answer is, "No, Yes, and Maybe, But It's Not Supported."&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx"&gt;Anyways, the solutions is found on his blog.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In order to get the page title to work properly, I've done the following:&lt;br /&gt;&lt;br /&gt;In the Controller:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;ViewBag._Title = "Admin";&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the RazorView.aspx:&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;%&lt;br /&gt;    if (ViewBag._Title != null)&lt;br /&gt;        Page.Title = ViewBag._Title;&lt;br /&gt;%&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-8301839518652718479?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/8301839518652718479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=8301839518652718479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/8301839518652718479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/8301839518652718479'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/01/using-razor-views-with-webforms-master.html' title='Using Razor views with Webforms master page'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5611379119136429555</id><published>2011-01-08T13:50:00.000-08:00</published><updated>2011-01-08T13:53:00.178-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='appendTemplate'/><title type='text'>jQuery.appendTemplate v 1.2.1</title><content type='html'>A minor release with updated demo example and minified javascript included is now released. Read more on the &lt;a href="http://plugins.jquery.com/project/appendTemplate"&gt;jQuery plugin website&lt;/a&gt; or check out the &lt;a href="http://csharptutorial.blogspot.com/search/label/appendTemplate"&gt;appendTemplate &lt;/a&gt;tag on this blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5611379119136429555?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5611379119136429555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5611379119136429555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5611379119136429555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5611379119136429555'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2011/01/jqueryappendtemplate-v-121.html' title='jQuery.appendTemplate v 1.2.1'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-7926885783161749290</id><published>2010-12-21T02:24:00.001-08:00</published><updated>2010-12-21T02:28:06.852-08:00</updated><title type='text'>New design</title><content type='html'>I've made a major upgrade on the blog today. Since I first started this blog, the template tools at blogger.com has become way more advanced and at the same time, way more easy. So enjoy and let me know if the new design is a total miss.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-7926885783161749290?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/7926885783161749290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=7926885783161749290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7926885783161749290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7926885783161749290'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/12/new-design.html' title='New design'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-7875448814266773972</id><published>2010-12-16T11:19:00.000-08:00</published><updated>2010-12-21T03:19:26.398-08:00</updated><title type='text'>HTML 5 Gelolocation</title><content type='html'>&lt;span style="font-weight: bold;"&gt;I wanted to make a simple application with the new HTML 5 geolocation  API. Since it's not yet supported by all browsers, it seemed like a good  idea to take a look at the &lt;a href="http://www.modernizr.com/"&gt;Modernizr&lt;/a&gt; script as well.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Modernizr  creates a javascript object containing tests for the new HTML5 tags.  This information can be used to provide the new and exciting features to  those who has a modern browser and an alternative to those who has an  old one. So called graceful degredation.&lt;br /&gt;&lt;br /&gt;Geolocation is supported by the following browsers:&lt;br /&gt;&lt;br /&gt;Firefox 3.5+&lt;br /&gt;Opera 10.6+&lt;br /&gt;Chrome 5+&lt;br /&gt;Safari 5+&lt;br /&gt;Internet Explorer 9+&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The example below first checks if geolocation is available, then tries to use it. The user will be prompted for permission to use the current location. If the user declines we have to have a failover for that as well.&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;// Check for geolocation support&lt;br /&gt;if (Modernizr.geolocation) {&lt;br /&gt;  navigator.geolocation.getCurrentPosition(function(position) {&lt;br /&gt;    // Success&lt;br /&gt;    $("#geolocation").text("Your position is: "&lt;br /&gt;      + position.coords.latitude + ", " &lt;br /&gt;      + position.coords.longitude);&lt;br /&gt;&lt;br /&gt;  }, function() {&lt;br /&gt;    // Failed&lt;br /&gt;    $("#geolocation").text("You declined to share location");&lt;br /&gt;  });&lt;br /&gt;}&lt;br /&gt;// Geolocation is not available&lt;br /&gt;else {&lt;br /&gt;  $("#geolocation").text("Geolocation is not available for your.");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;View the complete &lt;a href="http://www.ettsted.com/stuff/2010_12/geolocation"&gt;demo here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-7875448814266773972?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/7875448814266773972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=7875448814266773972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7875448814266773972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7875448814266773972'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/12/i-wanted-to-make-simple-application.html' title='HTML 5 Gelolocation'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5403327775915107862</id><published>2010-12-14T04:33:00.000-08:00</published><updated>2010-12-21T03:27:59.659-08:00</updated><title type='text'>10 tricks that will make your jQuery enabled site go faster</title><content type='html'>During the last few weeks, I've had the chance to go more in depth with jQyery and general site performance. I've found some techniques that makes my site go much faster. I don't know if they're all best practice, but this article is meant to at least give you some good ideas.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;$(document).ready(e) vs $(window).load(e)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The .ready(e) function fires when a dom element is ready. That's why we use it on the document element. When the document element is ready, the page is also, sort of. Actually the page is not ready until the window is fully loaded with images and other resources, but we're allowed to start manipulating the DOM at an earlier stage. I recomend doing your DOM manipulation, resizing, setup menus etc first and then start your ajax calls once the page is fully rendered.&lt;br /&gt;&lt;br /&gt;So put your design oriented code in the $(document).ready(e) function and your data oriented code in the $(window).load(e). That way, the page components come to place at an earlier stage and that creates the illusion of speed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Load JSON from string&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In order to avoid the extra cost of doing a page request you can  actually include JSON in the page as a string. For instance, I use a  jQuery framework to build my menu, but the page lags a bit while waiting  for the external scripts that loads the menu elements. I found that the  user experience is much faster if I include the menu items as a  javascript string at the bottom of the page. The main page will take  some milliseconds extra loading, but the menu lagging will dissapear. I  then set up the menu in the $(document).ready(e) function and set up the menu before the page data loads.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;var menuJSON = '[{....}]'&lt;br /&gt;$(document).ready(function () {&lt;br /&gt; var menuObject = $.parseJSON(menuJSON);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Store repositories in memory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you load JSON or XML from another script with ajax, keep the returned object in a variable in the window scope. That way, you can do live search and sort operations quickly without loading external resources again. I know some like to do sort in the database, but modern browsers can do it quite quick. It depends on the size of the dataset of course.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;var userRepository;&lt;br /&gt;$(window).load(function(){&lt;br /&gt; userRepository = $.ajax(....);&lt;br /&gt; doSomething(userRepository);&lt;br /&gt;});&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Setup events last&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can save a bit of loading time by adding events last. First layout, then data, and then events. Events aren't visible and we want the visible parts of your web site to load first, right? What you could do is to disable buttons until they're loaded with events. This example uses jQueryUI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;$(document).ready(function(){&lt;br /&gt; $(":button").button("disable");&lt;br /&gt;});&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and then, once an event has been added do all your button code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;(window).load(function(){&lt;br /&gt; $("#button").click(....);&lt;br /&gt; $("#button").button("enable");&lt;br /&gt; (...)&lt;br /&gt;});&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Unbind events&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you never unbind your events, you could potentially consume quite a lot of unnecessary memory. Even worse you could stack up double events and your click function or keypress trapper could be executed twice. In order to make sure that there's only one click funtion on a DOM element do the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;$("#button").unbind("click");&lt;br /&gt;$("#button").click(....);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;.empty() vs html("")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This one is related to the one above. If you write .html("") when you want to empty a div or a list, then there's no guarantee that the events assigned to the child DOM elements are unbound. The jQuery manual states:&lt;br /&gt;&lt;br /&gt;"To avoid memory leaks, jQuery removes other constructs such as data and  event handlers from the child elements before removing the elements  themselves."&lt;br /&gt;&lt;br /&gt;So, always use .empty() in stead of .html("")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Load your javascripts at bottom of the page&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The new best practice is to load CSS in the head and javascripts at the end of the body. It actually works. If you do, then the page will have read the rest of the page before starting to manipulate it. Hence it appears much faster.&lt;br /&gt;&lt;br /&gt;Since javascripts are getting quite heavy in size, it is actually better to let the page load divs and images before large chunks of javascripts. jQuery is just under 80 kb, jQueryUI another 200 kb and I bet you have a few other scripts as well. It all adds up and makes your site slower.&lt;br /&gt;&lt;br /&gt;Also, rumors has it that some web search engines only reads a certain amout of text before leaving for another page, and therefore you will be able to present more of the important stuff first.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Don't use a content delivery system&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Unless you run a site with tens of thousands of visitors daily or your bandwith costs are very hight, I see no reason to use a CDN. I think what they are trying to achieve is a caching effect. If your visitors allready have the recent jQuery framework cached from Google, they won't have to when they go to your site. But in my experience, CDNs are always a performance drag. They all tend to go slower than my on web hosting and that looses the whole meaning of using these services.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download the custom version of jQueryUI&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The full version of jQueryUi is just under 200kb in size. If you only use button functionallity, you only touch the tip of the iceberg. The custom version of jQueryUI which only holds the core funtionallity and the button package only takes about 13,9 kb. Do the maths, the custom version takes the jQueryUI from being the heaviest file you load on your page to being on of the smallest.&lt;br /&gt;&lt;br /&gt;This also explains a problem with using a CDN, since they only have the large version on their site (probably).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RTFM&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I mean it, are you familiar with the special selectors in jQuery? How about the .live(...) funtion? It's all in the jQuery documentation. Use it.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcsharptutorial.blogspot.com%2f2010%2f12%2f10-tricks-that-will-make-your-jquery.html"&gt;&lt;img src="http://www.blogger.com/http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fcsharptutorial.blogspot.com%252f2010%252f12%252f10-tricks-that-will-make-your-jquery.html" alt="kick it on DotNetKicks.com" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5403327775915107862?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5403327775915107862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5403327775915107862' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5403327775915107862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5403327775915107862'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/12/10-tricks-that-will-make-your-jquery.html' title='10 tricks that will make your jQuery enabled site go faster'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-6997823677591793806</id><published>2010-12-09T03:37:00.000-08:00</published><updated>2010-12-09T04:02:01.391-08:00</updated><title type='text'>The ad blocker mystery</title><content type='html'>I've just come to realize how important it is for me to run an ad blocker at work. First of all I don't like opening a web site and then start looking for the real content amongst the blinking ad banners. I just don't. And it seems to me that norwegian web sites are the worst. Try visiting &lt;a href="www.dinside.no"&gt;www.dinside.no&lt;/a&gt; without safety goggles and you'll se what I mean. That site is plain awfull sometimes. &lt;a href="www.digi.no"&gt;www.digi.no&lt;/a&gt; has som much ads that they don't even have room for a main article image.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Anyways&lt;/span&gt;&lt;br /&gt;We've had some problems with ad blockers blocking items on our web site, so today I've spent some time figuring out how they work. Turns out, there's nothing magical about them. They simply block content based on script naming. Consider these two scripts:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(102, 102, 102); font-weight: bold;"&gt;createNew.asp?id=1671&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;vs&lt;br /&gt;&lt;span style="font-family: courier new; color: rgb(102, 102, 102); font-weight: bold;"&gt;&lt;br /&gt;createNew.asp?id=1671&amp;amp;adName=myName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I load them both into an iframe after the page first has been rendered, but one of them is stopped. The last one actually gets blocked because of the querystring variable &lt;span style="font-weight: bold;"&gt;adName&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;&lt;br /&gt;Choose your names wisely. Our system actually is for making ads, so names containing ad*** seemed quite natural at one time. The guys over at Sitepoint has some articles on this topic and this one is worth a read:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.sitepoint.com/2009/05/27/file-naming-important/"&gt;http://blogs.sitepoint.com/2009/05/27/file-naming-important/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-6997823677591793806?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/6997823677591793806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=6997823677591793806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/6997823677591793806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/6997823677591793806'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/12/ad-blocker-mystery.html' title='The ad blocker mystery'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5344220496540080106</id><published>2010-11-11T06:06:00.000-08:00</published><updated>2010-11-11T06:09:25.636-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='appendTemplate'/><title type='text'>jQuery.appendTemplate v 1.2</title><content type='html'>Just released a new version of the jQuery.appendTemplate plugin. Fixed a cache issue and gained about 33% speed increase. Also, the plugins now loads in sync, which means the DOM update and callback function will work better together.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5344220496540080106?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5344220496540080106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5344220496540080106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5344220496540080106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5344220496540080106'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/11/jqueryappendtemplate-v-12.html' title='jQuery.appendTemplate v 1.2'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-7243429072726385472</id><published>2010-11-10T01:06:00.000-08:00</published><updated>2010-11-11T05:44:52.128-08:00</updated><title type='text'>Why the web will ultimately win</title><content type='html'>Ten years ago, I had a Palm Pilot. The Palm OS was a winner. It had a simple programming language (C-based, I think), a form application framework and a database. That's it. None or very few apps came with any graphics. Still, you could download tens of thousands of applications back then. Fart logs, excercise diarys, vinyl databases and so on.&lt;br /&gt;&lt;br /&gt;Ten years later there's three platforms covering that same market, iOS, Android and Windows Mobile. Nokia is eager to get back into the lead, and you still have Java for all of those old fashion mobile phones.&lt;br /&gt;&lt;br /&gt;So, if you write a sucessful fart log application on one of these platforms, odds are that you would like to expand onto another platform and you would have to fork your code in order to do so.&lt;br /&gt;&lt;br /&gt;My prediction is that the web will be the leading platform in a few years. Safari is big on iOS, Opera is taking the lead on other smart phones. Firefox is still in beta (alpha?) with their Fennec browser. Internet Explorer, I haven't tried on the new WinMo 7, but chances are that there will be a browser war on mobile units. And that's going to benefit all of us.&lt;br /&gt;&lt;br /&gt;New features will be hardware accellerated graphics and javascripts, localization, use of onboard camera and so on.&lt;br /&gt;&lt;br /&gt;I've even tried writing a small app using HTML+javascript myself. This is a port of one of my favourite iPhone apps, FloodIt. It may not be perfected quite yet, but it works. And for me, it's a great demo of a cross browser app that even runs smoothly on Windows and Mac. Try it yourself and think about it, it might just be the future.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ettsted.no/games/floodfill"&gt;http://www.ettsted.no/games/floodfill&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;EDIT: The game should work on IE 8, Firefox 3, Chrome 7, iPhone, Android and possibly WinMo 6.5 with Opera mini&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-7243429072726385472?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/7243429072726385472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=7243429072726385472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7243429072726385472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7243429072726385472'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/11/why-web-will-ultimately-win.html' title='Why the web will ultimately win'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5279251176806596391</id><published>2010-10-15T03:36:00.000-07:00</published><updated>2010-10-15T03:42:41.136-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='appendTemplate'/><title type='text'>jQuery.appendTemplate v 1.1</title><content type='html'>I've uploaded a new release to my jQuery appendTemplate plugin over at jQuery Plugins. The new version includes:&lt;br /&gt;&lt;br /&gt;- caching of templates&lt;br /&gt;- callback function&lt;br /&gt;&lt;br /&gt;Link:&lt;br /&gt;&lt;a href="http://plugins.jquery.com/project/appendTemplate"&gt;http://plugins.jquery.com/project/appendTemplate&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5279251176806596391?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5279251176806596391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5279251176806596391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5279251176806596391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5279251176806596391'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/10/jqueryappendtemplate-v-11.html' title='jQuery.appendTemplate v 1.1'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5223023179343836026</id><published>2010-10-12T06:45:00.000-07:00</published><updated>2010-12-21T03:28:54.799-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='appendTemplate'/><title type='text'>jQuery.appendTemplate(url, args[])</title><content type='html'>Appends a template from file onto an element.  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;" class="bold"&gt;url&lt;/span&gt;: template url&lt;br /&gt;      &lt;span style="font-weight: bold;" class="bold"&gt;args[]&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;:&lt;/span&gt; dynamic list of arguments that goes into the template  &lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;span style="font-size:130%;"&gt;Example code:&lt;/span&gt;&lt;/h3&gt;          &lt;br /&gt;&lt;pre class="brush: jscript"&gt;&lt;br /&gt;$(document).ready(function(){&lt;br /&gt;$.getJSON(&lt;br /&gt;  "data/data.json",&lt;br /&gt;  function(data){&lt;br /&gt;&lt;br /&gt;  $.each(data, function(i, item){&lt;br /&gt;    $("#myList").appendTemplate(&lt;br /&gt;      "templates/row.template",&lt;br /&gt;      item.url,&lt;br /&gt;      item.text);&lt;br /&gt;  });&lt;br /&gt;&lt;br /&gt;});         &lt;br /&gt;});&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;&lt;span style="font-size:130%;"&gt;So what does it do?&lt;/span&gt;&lt;/h3&gt;     &lt;p&gt;         The appendTemplate function loads a template from file and fills  it with the arguments you pass. Sort of like a string.format(args[])  function.     &lt;/p&gt;          &lt;h3&gt;&lt;span style="font-size:130%;"&gt;Author&lt;/span&gt;&lt;/h3&gt;     &lt;p&gt;         Written by Anders Nygaard. Fan or hate mail: anders.nygaard at googles mail service     &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ettsted.no/stuff/2010_10/appendTemplate/jquery.appendTemplate-1.0.zip"&gt;Download&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5223023179343836026?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5223023179343836026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5223023179343836026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5223023179343836026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5223023179343836026'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/10/jqueryappendtemplateurl-args.html' title='jQuery.appendTemplate(url, args[])'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5393300694743183977</id><published>2010-10-05T01:25:00.001-07:00</published><updated>2010-12-21T03:32:30.684-08:00</updated><title type='text'>On my wish list: Static extension methods</title><content type='html'>Ideally, I want to remove as much lambda expressions as possible out of my repository classes. Using Subsonic, I want to implement my own fluent methods which do not require any lambda in the implemented repository class at all.&lt;br /&gt;&lt;br /&gt;Now, please correct me if I'm wrong, but while you can make a generic extension class you can't really make static extension methods in c#? Code would be something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;&lt;br /&gt;public static class GeneralExtension{&lt;br /&gt;   public static T ById&lt;t&gt;(this T entity, int id) where T: IActiveRecord&lt;br /&gt;   {&lt;br /&gt;      return T.SingleOrDefaul(x=&gt;x.Id == id);&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And implementation would be something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class = "brush: csharp"&gt;&lt;br /&gt;public class TaskRepository : IScrumblrRepository&lt;br /&gt;{&lt;br /&gt;   public Task Get(int id)&lt;br /&gt;   {&lt;br /&gt;      return Task.ById(id);&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If I find a smooth way of doing this without the use of static extension methods, I'll let you know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5393300694743183977?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5393300694743183977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5393300694743183977' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5393300694743183977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5393300694743183977'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/10/on-my-wish-list-static-extension.html' title='On my wish list: Static extension methods'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-1263325800973951011</id><published>2010-07-15T01:27:00.000-07:00</published><updated>2010-07-15T01:58:30.965-07:00</updated><title type='text'>Oh my, another IE bug</title><content type='html'>You can spend all the time you want trying to make beautiful design, clever solutions with jQuery and CSS. It all works perfect in Firefox, Chrome and Opera. It even validates perfectly as XHTML strict with the W3C validators. And then, there's the time consuming monster called Internet Explorer.&lt;br /&gt;&lt;br /&gt;Today, I spend half an hour on a silly little bug I've never seen before. It turns out, Internet Explorer doesn't like empty &lt;span style="font-family:courier new;"&gt;select&lt;/span&gt; tags, which by the way is perfectly legal xhtml.&lt;br /&gt;&lt;br /&gt;If you don't add any options, IE will never interpret the closing &lt;span style="font-family:courier new;"&gt;select&lt;/span&gt; tag, and your content will never show. White screen of death.&lt;br /&gt;&lt;br /&gt;Firefox:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_i5y81qSv1zs/TD7NmbcTJdI/AAAAAAAAAKo/vI4lWFaK4Ds/s1600/ie_2.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 208px;" src="http://1.bp.blogspot.com/_i5y81qSv1zs/TD7NmbcTJdI/AAAAAAAAAKo/vI4lWFaK4Ds/s400/ie_2.jpg" alt="" id="BLOGGER_PHOTO_ID_5494054655523759570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Internet Explorer:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_i5y81qSv1zs/TD7NekhqohI/AAAAAAAAAKg/52cQ7p-xs3s/s1600/ie.jpg"&gt;&lt;img style="cursor: pointer; width: 400px; height: 205px;" src="http://1.bp.blogspot.com/_i5y81qSv1zs/TD7NekhqohI/AAAAAAAAAKg/52cQ7p-xs3s/s400/ie.jpg" alt="" id="BLOGGER_PHOTO_ID_5494054520523235858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Applies to:&lt;br /&gt;IE6, IE7, IE8&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-1263325800973951011?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/1263325800973951011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=1263325800973951011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/1263325800973951011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/1263325800973951011'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/07/oh-my-another-ie-bug.html' title='Oh my, another IE bug'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_i5y81qSv1zs/TD7NmbcTJdI/AAAAAAAAAKo/vI4lWFaK4Ds/s72-c/ie_2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-2327285529575940656</id><published>2010-05-12T06:07:00.000-07:00</published><updated>2010-05-12T06:20:30.516-07:00</updated><title type='text'>Testing Subsonic based projects</title><content type='html'>Testing Subsonic based projects is a breeze. No mock frameworks needed. All you have to do is add an app.config file and some mock objects righ into Subsonic. Have a look at the following:&lt;br /&gt;&lt;br /&gt;In the App.config file of my test project:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;connectionstrings&amp;gt;&lt;br /&gt;   &amp;lt;add name="VisenoConnection" connectionstring="Test"&amp;gt;&lt;br /&gt;   &amp;lt;/add&amp;gt;&lt;br /&gt;&amp;lt;/connectionstrings&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;My Setup method:&lt;br /&gt;&lt;pre&gt;[SetUp]&lt;br /&gt;public void StartTest()&lt;br /&gt;{&lt;br /&gt;    List&lt;VisenoCompany&gt; companies = new List&lt;VisenoCompany&gt;();&lt;br /&gt;    for (int i = 0; i &lt; 100; i++)&lt;br /&gt;    {&lt;br /&gt;        VisenoCompany company = new VisenoCompany();&lt;br /&gt;        company.Id = i;&lt;br /&gt;        company.Name = "webtop";&lt;br /&gt;        company.Address = "address";&lt;br /&gt;        companies.Add(company);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    companies[1].CompanyKey = "123";&lt;br /&gt;&lt;br /&gt;    VisenoCompany.Setup(companies);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;My test method:&lt;br /&gt;&lt;pre&gt;[Test]&lt;br /&gt;public void TestGetCompany()&lt;br /&gt;{&lt;br /&gt;CompanyRepository companyRepository = new CompanyRepository();&lt;br /&gt;VisenoCompany company = companyRepository.Get(1);&lt;br /&gt;Assert.That(company.Id == 1);&lt;br /&gt;Assert.That(company.CompanyKey == "123");&lt;br /&gt;Assert.That(company.Name == "webtop");&lt;br /&gt;(...)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Subsonic now uses memory in stead of database. In this case the repositories and generated classes are even in a different project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-2327285529575940656?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/2327285529575940656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=2327285529575940656' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/2327285529575940656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/2327285529575940656'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2010/05/testing-subsonic-based-projects.html' title='Testing Subsonic based projects'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5890915964461394468</id><published>2009-09-18T01:19:00.000-07:00</published><updated>2009-09-18T01:25:02.733-07:00</updated><title type='text'>Changing the Visual Studio start page feed to show news from Dotnetkicks</title><content type='html'>Open Visual Studio and navigate to &lt;span style="font-weight: bold;"&gt;Tools-Options-Environment-Startup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Change the start page news channel variable to&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;http://feeds.feedburner.com/dotnetkicks&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There you go, Dotnetkicks in the Visual Studio start page&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcsharptutorial.blogspot.com%2f2009%2f09%2fchanging-visual-studio-start-page-feed.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fcsharptutorial.blogspot.com%2f2009%2f09%2fchanging-visual-studio-start-page-feed.html" alt="kick it on DotNetKicks.com" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5890915964461394468?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5890915964461394468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5890915964461394468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5890915964461394468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5890915964461394468'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2009/09/changing-visual-studio-start-page-feed.html' title='Changing the Visual Studio start page feed to show news from Dotnetkicks'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-6783611014566004227</id><published>2009-02-10T00:07:00.000-08:00</published><updated>2009-02-10T00:21:21.242-08:00</updated><title type='text'>Save as Indesign .inx (CS2)</title><content type='html'>Ok, a bit off topic, but here's some thoughts on file formats and monopoly organisations.&lt;br /&gt;&lt;br /&gt;This week, we got Adobe CS4 Design Premium at work. We need this because designers send us Indesign documents made with Creative Suite 3 or 4 and we still use CS2. I took it for granted that Adobe incorporates backwards compatibility, but no. This is cut/pasted from Adobes web pages:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"To open the InDesign CS4 document in InDesign CS2, open the exported INX file in InDesign CS3, export to INX again, and then open the exported file in InDesign CS2. Make sure that all versions have been updated."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The past year, Microsoft have had to defend their file format policy, BUT, Microsoft Office IS compatible with older versions. You can even save to html and old formats back to Office 95. How Adobe gets away with their policy on this subject is not quite as apparent to me...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-6783611014566004227?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/6783611014566004227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=6783611014566004227' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/6783611014566004227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/6783611014566004227'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2009/02/save-as-indesign-inx-cs2.html' title='Save as Indesign .inx (CS2)'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-2713663915179637956</id><published>2008-04-01T01:05:00.001-07:00</published><updated>2008-04-01T01:06:23.360-07:00</updated><title type='text'>Luftguitar CMS released</title><content type='html'>&lt;span style="font-weight: bold;"&gt;The project &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Luftguitar CMS project is a great platform for small or medium sized web portals. It is made with simplicity in mind and at the same time it offers a great deal of flexibility when it comes to customization.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; The Goal &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The philosophy is that&lt;br /&gt;- most users don't like to manage user roles and frontpage layout, they want a simple system that just works.&lt;br /&gt;- most designers don't like javascript, they want simple html and css.&lt;br /&gt;- most developers don't like hacking old code, they want to make new cool features fast.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/luftguitarcms"&gt;http://sourceforge.net/projects/luftguitarcms&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-2713663915179637956?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/2713663915179637956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=2713663915179637956' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/2713663915179637956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/2713663915179637956'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2008/04/luftguitar-cms-released.html' title='Luftguitar CMS released'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-5220633672999526448</id><published>2007-10-07T03:36:00.001-07:00</published><updated>2007-10-07T04:46:54.968-07:00</updated><title type='text'>Including Unit Testing</title><content type='html'>It struck me as a great idea to include NUnit test in the next release of my SQLite query browser. If the program crashes or misbehaves, users can run the tests, find out why and either report to me or fix it themselves. Being one person and writing this program as a hobby, I don't have the capacity of testing that many different platforms and setups myself.&lt;br /&gt;&lt;br /&gt;Let me show you what I have in mind:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_i5y81qSv1zs/Rwi7Q0ZqvWI/AAAAAAAAAAg/sN6Z2cG4h1s/s1600-h/nunit1.jpg"&gt;&lt;img style="cursor: pointer; width: 410px; height: 475px;" src="http://bp3.blogger.com/_i5y81qSv1zs/Rwi7Q0ZqvWI/AAAAAAAAAAg/sN6Z2cG4h1s/s320/nunit1.jpg" alt="" id="BLOGGER_PHOTO_ID_5118546874125172066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The user clicks help-&gt; run tests from the toolstrip&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_i5y81qSv1zs/Rwi8A0ZqvXI/AAAAAAAAAAo/7hzWtAALaL4/s1600-h/nunit2.jpg"&gt;&lt;img style="cursor: pointer; width: 410px; height: 375px;" src="http://bp3.blogger.com/_i5y81qSv1zs/Rwi8A0ZqvXI/AAAAAAAAAAo/7hzWtAALaL4/s320/nunit2.jpg" alt="" id="BLOGGER_PHOTO_ID_5118547698758892914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;NUnit starts&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The NUnit licence says: "Permission is granted to anyone to use this software for any purpose, including   commercial applications, and to alter it and redistribute it freely (...)"&lt;br /&gt;&lt;br /&gt;I've included the entire NUnit bin directory and my test library dll in the project root and these few lines of code on the toolstrip onclick event:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;private void runTestsToolStripMenuItem_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Process nunit = new Process();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    nunit.StartInfo.FileName = Application.StartupPath + "\\nunit\\nunit.exe";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    nunit.StartInfo.Arguments = "SQLiteQHTest.dll /run";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    nunit.Start();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcsharptutorial.blogspot.com%2f2007%2f10%2fincluding-unit-testing.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fcsharptutorial.blogspot.com%2f2007%2f10%2fincluding-unit-testing.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-5220633672999526448?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/5220633672999526448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=5220633672999526448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5220633672999526448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/5220633672999526448'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2007/10/including-unit-testing.html' title='Including Unit Testing'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_i5y81qSv1zs/Rwi7Q0ZqvWI/AAAAAAAAAAg/sN6Z2cG4h1s/s72-c/nunit1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-7922555443550492344</id><published>2007-03-05T03:55:00.001-08:00</published><updated>2007-03-05T03:55:54.354-08:00</updated><title type='text'>Optimizing code using a stop watch</title><content type='html'>NET 2 has a stop watch, which sometimes comes in handy when it comes to identifying slow code and optimizing performance. The StopWatch object can be found under the System.Diagnostics namespace and contains methods Start() and Stop(). &lt;p&gt;In order to identify the time spent on excecuting a method, you could try something like this: &lt;/p&gt; &lt;pre&gt;System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();&lt;br /&gt;watch.Start();&lt;br /&gt;&lt;br /&gt;DoMyStuff();&lt;br /&gt;&lt;br /&gt;watch.Stop();&lt;br /&gt;WriteToScreen("Time spent: " + watch.Elapsed.ToString());&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;For instance, you can use this method to measure if you gain from creating indexes in your database layer or the time spent on sorting lists etc. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-7922555443550492344?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/7922555443550492344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=7922555443550492344' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7922555443550492344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/7922555443550492344'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2007/03/optimizing-code-using-stop-watch.html' title='Optimizing code using a stop watch'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-116515260114967681</id><published>2006-12-03T05:17:00.000-08:00</published><updated>2006-12-03T05:30:01.160-08:00</updated><title type='text'>SQLite GUI for Windows</title><content type='html'>I've made a small windows application for doing queries with SQLite 3.x databases which uses the  ADO.NET Data Provider for SQLite.&lt;br /&gt;&lt;br /&gt;SQLite is small file-based database format and resembles Microsoft's Access format. It's portable and unlike Access it has "normal" data types and secutity properties. It supports databases up to 2TB in size and its free to use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQLite can be found at:&lt;br /&gt;&lt;a href="http://www.sqlite.org/"&gt;http://www.sqlite.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The ADO.NET dataprovider can be downloaded from:&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/adodotnetsqlite"&gt;http://sourceforge.net/projects/adodotnetsqlite&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My little SQLite query application can be downloaded from:&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/sqlitequery"&gt;http://sourceforge.net/projects/sqlitequery&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-116515260114967681?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/116515260114967681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=116515260114967681' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/116515260114967681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/116515260114967681'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/12/sqlite-gui-for-windows.html' title='SQLite GUI for Windows'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-116488303095341567</id><published>2006-11-30T02:34:00.000-08:00</published><updated>2006-11-30T02:42:13.193-08:00</updated><title type='text'>Anthem.NET</title><content type='html'>&lt;span style="font-weight: bold;"&gt;I've been working with the Anthem package for a while and it still blows me away. Anthem.NET is a web project that does exactly what Microsoft should have done when they first started out with ASP.NET.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is Anthem?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Anthem is an open source project from web developer Jason Diamonds written in C#, Javascript and ASP.NET. The project contains numerous webcomponents pretty much like the ASP.NET framework except these controls are AJAX enabled.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How does it work?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Anthem relies heavily on callbacks in stead of postbacks. It uses Javascript to send the page wievstate to the .aspx page and does this AJAX-style in stead of refreshing the whole page on every component change. After callback, the Anthem components refreshes some of its inner html and values.&lt;br /&gt;&lt;br /&gt;The Anthem way of exchanging data to and from the server makes little or no inpact on the code behind or the ASP.NET script. As a programmer, you still write your codebehind and your html and use components as you would the .NET way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Is this something for me?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Anthem is still in an alpha stage. As with other open source projects and in the spirit of web 2.0, it could be stuck in beta mode for years to come. Documentation is also lacking or non-existant, so you better have some time available.&lt;br /&gt;&lt;br /&gt;Also, Anthem doesn't come right out of the box, as you have to create a solution, import the right project files, compile and import the .dll into the Visual Studio toolbox. Not that hard, but yes - it's one of those small time consuming tasks.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can find Anthem.NET on SourceForge and this adress:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://sourceforge.net/projects/anthem-dot-net"&gt;http://sourceforge.net/projects/anthem-dot-net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://csharptutorial.blogspot.com/2006/11/anthemnet.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://csharptutorial.blogspot.com/2006/11/anthemnet.html" alt="kick it on DotNetKicks.com" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-116488303095341567?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/116488303095341567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=116488303095341567' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/116488303095341567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/116488303095341567'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/11/anthemnet.html' title='Anthem.NET'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-116055783226112175</id><published>2006-10-11T01:56:00.000-07:00</published><updated>2010-12-21T03:41:53.694-08:00</updated><title type='text'>Reading xml fast</title><content type='html'>&lt;span style="font-family:arial;"&gt;Using the System.Diagnostics.StopWatch object, I've made an interesting experiment on how to read a 1mb xml file fast. For this experiment, I've made a small console application and for each of the different code examples, I then traverse the xml tree and write the values to the console. &lt;/span&gt;&lt;span style="font-family:arial;"&gt;Last, I've tried a smaller file 5kb in order to see if the result is the same when working with smaller files.&lt;br /&gt;&lt;br /&gt;The xml is quite simple and looks something like this:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;xml&lt;/li&gt;&lt;ul&gt;&lt;li&gt;entry&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;name&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;adress&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;            (...)&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;StreamReader&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For a reference, I've started off with a simple stream read:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:csharp"&gt;&lt;br /&gt;StreamReader reader = File.OpenText("c:\\testfile2.xml");&lt;br /&gt;string input = null;&lt;br /&gt;while ((input = reader.ReadLine()) != null)&lt;br /&gt;{&lt;br /&gt;  Console.WriteLine(input);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;And the result:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;watch.Elapsed = {00:00:02.3910558}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The result is pretty much as expected, about two seconds to read all of the lines an put them on the screen.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XMLReader&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next up is the xml reader. It traverses the xml straight forward and reads all of the nodes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:csharp"&gt;&lt;br /&gt;FileStream stream = new FileStream("c:\\testfile2.xml", FileMode.Open);&lt;br /&gt;XmlReader reader = new XmlTextReader(stream);&lt;br /&gt;while(reader.Read())&lt;br /&gt;{&lt;br /&gt;  Console.WriteLine(reader.Value);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;And the result:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;watch.Elapsed = {00:00:12.7904473}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;12 seconds is about as expected. There's some overhead with finding the xml nodes, but it all seem pretty much like expected. If we would try this experiment over the internet or a slower file network, I believe that the xml reader overhead would not be that visible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;XPath&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next, we try the xPath aproach:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:csharp"&gt;&lt;br /&gt;FileStream stream = new FileStream("c:\\testfile2.xml", FileMode.Open);&lt;br /&gt;XPathDocument document = new XPathDocument(stream);&lt;br /&gt;XPathNavigator navigator = document.CreateNavigator();&lt;br /&gt;XPathNodeIterator node = navigator.Select("xml/entry");&lt;br /&gt;for(...){...}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;And the result:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;watch.Elapsed = {00:03:29.5681325}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="color: rgb(0, 0, 0);font-family:arial;" &gt;I knew it would take some time, but this is not acceptable. XPath is still a kind of favourite as it makes it possible to navigate the xml tree in a absolutely beautiful way.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;DataSet&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:arial;font-size:100%;"  &gt;Next is the dataset approach.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:csharp"&gt;&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;ds.ReadXml("C:\\testfile2.xml");&lt;br /&gt;foreach (DataTable tbl in ds.Tables)&lt;br /&gt;{&lt;br /&gt;  foreach (DataRow dr in tbl.Rows)&lt;br /&gt;  {&lt;br /&gt;     for (...){...}&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;And the result:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;watch.Elapsed = {00:00:03.6352829}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;I'm a bit surprised. The dataset seems like the fastest way of traversing an xml file. Note that dataset navigation can be cumbersome when containing a lot of tables, like the one.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;A smaller xmlfile&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I've also tried the same aproaches to a 5kb xml file, here's the results and now it turns out XPath is the fastest method:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;FileStream:&lt;br /&gt;watch.Elapsed = {00:00:00.0144736}&lt;br /&gt;&lt;br /&gt;XMLReader:&lt;br /&gt;watch.Elapsed = {00:00:00.0302896}&lt;br /&gt;&lt;br /&gt;Xpath:&lt;br /&gt;watch.Elapsed = {00:00:00.0151563}&lt;br /&gt;&lt;br /&gt;Dataset:&lt;br /&gt;watch.Elapsed = {00:00:00.0225523}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://csharptutorial.blogspot.com/2006/10/reading-xml-fast.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://csharptutorial.blogspot.com/2006/10/reading-xml-fast.html" alt="kick it on DotNetKicks.com" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-116055783226112175?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/116055783226112175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=116055783226112175' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/116055783226112175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/116055783226112175'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/10/reading-xml-fast.html' title='Reading xml fast'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-115631993832831968</id><published>2006-08-23T00:54:00.000-07:00</published><updated>2006-08-23T00:58:58.340-07:00</updated><title type='text'>Supersimple GDI+ graphics acceleration</title><content type='html'>I wanted to learn Direct3D.. Actually, all I wanted was to experiment with a 2D scroller game, but I figured out from browsing the net that it would require me to have a look at the 3D library.&lt;br /&gt;I dind't have the time and forgot about it.&lt;br /&gt;&lt;br /&gt;A few months later I am making a HTPC type of software. Sure I use DirectX for audio, but it would be overkill to use Direct3D to write a few text strings and images onto the screen.&lt;br /&gt;&lt;br /&gt;In stead, I use GDI+, the good old Graphics object. It's flicker free and quite fast. As a demo, I did a remake of the classic Space Invaders game and it turned out to run quite smooth.&lt;br /&gt;&lt;br /&gt;Have a look at the following example, it should get you started:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;public class MainForm : Form&lt;br /&gt;{&lt;br /&gt;        private Graphics g;&lt;br /&gt;        private Bitmap backbuffer;&lt;br /&gt;   &lt;br /&gt;    public MainForm()&lt;br /&gt;    {&lt;br /&gt;        backbuffer = new Bitmap(this.Width, this.Height);&lt;br /&gt;            g = Graphics.FromImage(backbuffer);&lt;br /&gt;&lt;br /&gt;            // All painting will occur in the Paint event handler&lt;br /&gt;        this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |   &lt;br /&gt;                                                                              ControlStyles.OptimizedDoubleBuffer, true);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private void MainForm_Paint(object sender, PaintEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            g.Clear(Color.Black);&lt;br /&gt;       &lt;br /&gt;        // Draw stuff here&lt;br /&gt;&lt;br /&gt;        // Flip the backbuffer onto the screen&lt;br /&gt;            e.Graphics.DrawImage(backbuffer, new Point(0, 0));&lt;br /&gt;&lt;br /&gt;            // Draw graphics again&lt;br /&gt;        this.Invalidate(false)&lt;br /&gt;        }&lt;br /&gt;}   &lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-115631993832831968?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/115631993832831968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=115631993832831968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/115631993832831968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/115631993832831968'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/08/supersimple-gdi-graphics-acceleration.html' title='Supersimple GDI+ graphics acceleration'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-114805169289773945</id><published>2006-05-19T07:43:00.000-07:00</published><updated>2006-05-22T03:56:16.273-07:00</updated><title type='text'>Question mark: The ternary operator ?</title><content type='html'>&lt;img src="http://www.blogger.com/post-edit.do" style="display: none;" id="greasedLightboxPreload" /&gt;&lt;div style="display: none; position: absolute; top: 0pt; left: 0pt; z-index: 90; width: 100%; background-color: rgb(0, 0, 0); opacity: 0.8; cursor: pointer;" id="greasedLightboxOverlay"&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(68, 68, 68); padding: 10px; background: rgb(0, 0, 0) none repeat scroll 0% 50%; display: none; position: absolute; z-index: 100; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(170, 170, 170); -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; -moz-border-radius-bottomleft: 10px; font-family: Verdana; font-size: 11px;" id="greasedLightbox"&gt;&lt;img src="http://www.blogger.com/post-edit.do" style="border: medium none ; cursor: pointer;" id="greasedLightboxImage" /&gt;&lt;div style="padding: 10px 0pt; color: rgb(170, 170, 170);" id="greasedLightboxCaption"&gt;&lt;/div&gt;&lt;/div&gt;You want to write short blocks of code and you want to write readable code.  Usually, there's a fine line, as you don't want your code looking like the works of a l33t h4X0r script kid or a python minimalist.&lt;br /&gt;&lt;br /&gt;A fine way of both shortening and simplifying is if you use the question mark. It's called a ternary operator. With this, you can do conditional assignments on one line.&lt;br /&gt;&lt;br /&gt;Consider the following example (taken from Bresenhams line algorithm) :&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;  int ystep;&lt;br /&gt;  if(y0&amp;lt;y1)&lt;br /&gt;  {&lt;br /&gt;      ystep = 1;&lt;br /&gt;  }&lt;br /&gt;  else&lt;br /&gt;  {&lt;br /&gt;      ystep = -1;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The code above could be shortened to one line:&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;int ystep = y0 &amp;lt; y1 ? 1 : -1;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-align: center; line-height: 2em;" id="greasedLightboxLoading"&gt;&lt;img style="border: medium none ;" src="data:image/gif,GIF89a%80%00%80%00%A2%00%00%FF%FF%FF%DD%DD%DD%BB%BB%BB%99%99%99%00%00%FF%00%00%00%00%00%00%00%00%00%21%FF%0BNETSCAPE2.0%03%01%00%00%00%21%F9%04%05%05%00%04%00%2C%02%00%02%00%7C%00%7C%00%00%03%FFH%BA%DC%FE0%CA%06*%988%EB%CD%BB_%96%F5%8Ddibax%AEl%AB%A5%A2%2B%CF.%5C%D1x%3E%DA%97%EE%FF%12%1EpHT%08%8B%C8G%60%190%1DI%83%E8%20%F9a2K%CF%8FTJ%E5X%AD%A4lg%B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%DF%7E%FF%08%BC%F9%E9%F7_I%EDaW%12t%01%3EP%DE3%B3%B9g%DB%80%9A-%A8%20%84%8CAha%7C%90Q%A8%21%85%7Ea%B8%21%87%CE5%18%8C%88%E4%80%88%16%89%25%26%C8%A0%8A%19%A2%98%93%8B%11%B2%D8%21%8C1J%08%A0%89%9F%BC%97b%81%F8%C9x%A2%8F%F0%F1%D8%A3%8D%CA%E8%B8%23%91%2B%02%29%9C%92%232y%24%92%C6%A55%E4x%7E%E0H%9B%95%04%60%89%A1%22%5B%06%09%E5%8D4%9Aa%A4%97RNY%26%97X%D6x%E6%3ANv%91%A6%9ATr%D7%26%15of%19%26%99q%E6%28%A4%7Fs%929%E3Q%EE%7D%89%1Eiu%AAVhj%87%A2%96%E8i%8B%9A%D6%A8%A3%7B%AE%C6%27%A0%AE%24%00%00%21%F9%04%05%05%00%04%00%2C%0A%00%02%00W%000%00%00%03%FFH%BA%DC%FE0%BE%40%83%BC8%EB%3D%2B%E5%60%28J%9E7%9E%28WVi%EBv%EB%2B%BF%EB7%DFgm%E1%3C%A8%F7%23%81P%90%FA%A1%00H%40k8D%19G%C9%24%8A%C9%CC%D5N%D1%E8%89%DA%1C%3DCYi%90%2B%F4%5EEa%B1%88%DC%F5%9DAi%F5%9A-%FAn%E2%CA%14%9B%E8%8E%C1%E3.%7B%21v%19x%2F%82*o%1A%86%87%88%1A%84%12xy%8Dd%89%7E%8B%803%7B%7C%19%90%10%928%8E%18%9E%0F%8C%A1t%9D%8A%91%99%3C%A2%24%AA%11%A6%AD%A8%17%A4%0C%B2%B3%B4%11%B6%0A%A0%40%0A%AE0%25%18%B8%3D%9B%B5%B0%0D%BE%BF%C0%BA%10%97%B1%AC%10%03%D4%03%81%CE%C2%C4%D2%0F%D5%D5K%D8G%DB%0D%DD%E4z%952%E2%E3%E4%E5c%5C3%E9%0C%EB%F2%EDm%E8Y%18%F2%F3se%3CZ%19%F9%FA%98%09%04%18P%E0%2F%82%EB%0C2C%C8N%21%10%86%DD%1C%1E%84HMb%0F%8A%15-%F2%C0%A8%F1%13%22%C3%8E%0F%09%82%0C%99o%E4%C4%86%26IZK%A9%21%01%00%21%F9%04%05%05%00%04%00%2C%1F%00%02%00W%000%00%00%03%FFH%BA%DC%FEKH%01%AB%BD8%EB6%E7%FE%60%A8u%9Dh%9E%22%E9%A1l%5B%A9%92%2B%CF%04L%D1%F8i%E7%7C%B8%F7%A2%81p%C0%FA%9D%02%C8%40k8D%19E%C9%24%8A%C9%D4%C1%8EQ%A9%89%DA4%3DAYm%90%2B%F4%5E%A1a%E4%89%DC%05%7D5i%F1%98%9C%3A%83%E3K%B6%CF%BE%89%2B%F3tn%7Cpx.lD%1Fo%17%7E3%87%88%23%83%8B%8C%8Dz%1B%8A%15%93%94%95%19%97%0F%7E%7F4%87%96%91%98%859%A2%9C%A4%9E%A6%A7%9B%17%9D%0D%99%3C%A8%AF%AA%B1%AC%B3%B4%2F%B6%0B%9F%40%0B%BA%10%B0%0A%B2%40%8E%B5*%92%B8%C6%AE%C2%24%18%C5%BF%04%C1%0F%25%CAa.%00%DA%00%18%D4%28%D1%21%DB%DB%DD%812%CB%20%E2%E9%17%CD%2C%E7%1A%E9%F0%E4U8%D8%22%F0%F7%19%F39Q%26%F7%F8%D2%D2%FC%FD%03%D8C%E0%40%828%0C%C6C%C8C%A1%3A%86%09%1D%8E%83HC%E2D%8A3%2Cj%C3X%D1%14%22%C7%88%0A%3F%E6%08%29r%A4%C0%92%05%17%A2L%B9%D1D%02%00%21%F9%04%05%05%00%04%00%2C%3C%00%02%00B%00B%00%00%03%FEH4%3C%FA0%CAI%AB%9D%AD%DD%CD%7B%CD%99%27%8E%16%A8%91hj2i%3B%AE%8E%2Bo%F0l%7F%EB%ADG%B5%2B%FC%82%DD%A3%97%02%02%85%8B%5C%D1x%DC%11I%CC%A6%EE%29%8AJo%D4%8E%F5j%CBr%B6A%A1%F7%02F%26M%D0%ADy%5C%29%AF%95Z7%92%3D%91%CF%E1%1Bp%F8%8D%8E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D%938%BE%FF%9E%5E%0FH%CC%08%7D%C5%24%E5%88T%3A%1D%CC%E6sJ%88%E6%A8X%2B%96%AA%DDN%BB%5E%A5%F5%1AN%82%CB%C41%DA%1C%5D%B3%99%EEt%3B%0E%3C%D3i%EA%BB%CE%AE%8F%E5%FB3%7C%80%12%01%85%01%21%82%83%0E%86%86%20%89%8A%0B%8C%92%1Fs%90%10%92%98%1D%95%96%8B%98%99%1BG%9C%11%9E%9E%1CC%A2%A3%A4%9F%A8%26%AA%A5%AC%AD%AE%93%B0%24%B2%B3%B4%23%B6%8C%B8%B5%BA%85%BC%22%BE%BF%C0%21%C2%C4%C1%B6%C7%B9%AE%CA%CB%A4%CD%BD%B7%D0%CE%87%D3%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%C0%02%E4%E5%E6%E7%E8%E7%DC%E9%EC%ED%E6%DA%EE%F1%ED%D9%F2%F5%EA%D8%F6%F9%02%F4%FA%F5%F0%FD%EE%D6%01L%27%AE%A0%C1%83%08%13*%5C%C8%B0%A1%C3%87h%06H%1C%00q%C1%C4%8B%10%2Fj%A4%D8pP%A3F%86%1E7*%0C%E9%11%21%C9%92%07O%8A4%A8%F2%23%CB%96%13M%C2%94%98r%26%C7%970%13%CE%5C%98%93%E7I%87%24%2B%AE%ACH%00%23%D1%A3H%93*%5D%CA%B4%A9%D3%A7P%A3J%9DJ%B5%AA%D5%ABX%B3j%DD%CA%B5%AB%D7%AF%60%C3%16I%00%00%3B" /&gt;&lt;p style="margin: 0pt; padding: 25px 0pt 5px; font-size: 45px;"&gt;Loading Image&lt;/p&gt;&lt;p style="margin: 0pt; padding: 5px 0pt; font-weight: normal; font-size: 11px;"&gt;Click anywhere to cancel&lt;/p&gt;&lt;/div&gt;&lt;div style="border: medium none ; display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-size: 45px; font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-decoration: none; text-align: center;" id="greasedLightboxError"&gt;Image is Unavailable&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-114805169289773945?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/114805169289773945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=114805169289773945' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114805169289773945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114805169289773945'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/05/question-mark-ternary-operator.html' title='Question mark: The ternary operator ?'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-114778798275224283</id><published>2006-05-16T06:57:00.000-07:00</published><updated>2006-05-20T08:05:17.823-07:00</updated><title type='text'>Custom Exceptions</title><content type='html'>&lt;img src="http://www.blogger.com/post-edit.g?blogID=28193226&amp;postID=114778798275224283" style="display: none;" id="greasedLightboxPreload" /&gt;&lt;div style="display: none; position: absolute; top: 0pt; left: 0pt; z-index: 90; width: 100%; background-color: rgb(0, 0, 0); opacity: 0.8; cursor: pointer;" id="greasedLightboxOverlay"&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(68, 68, 68); padding: 10px; background: rgb(0, 0, 0) none repeat scroll 0% 50%; display: none; position: absolute; z-index: 100; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(170, 170, 170); -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; -moz-border-radius-bottomleft: 10px; font-family: Verdana; font-size: 11px;" id="greasedLightbox"&gt;&lt;img src="http://www.blogger.com/post-edit.g?blogID=28193226&amp;postID=114778798275224283" style="border: medium none ; cursor: pointer;" id="greasedLightboxImage" /&gt;&lt;div style="padding: 10px 0pt; color: rgb(170, 170, 170);" id="greasedLightboxCaption"&gt;&lt;/div&gt;&lt;/div&gt;Custom Exceptions&lt;br /&gt;&lt;br /&gt;Exceptions are your friends. &lt;a href="http://www.symphonious.net/2004/10/18/exceptions-are-your-friend-but-so-is-garbage-collection/"&gt;So is garbage collection&lt;/a&gt; :D Well, you shouldn't really ignore Exceptions, in stead, if you just learn yourself a little about them, your code could be easier to understand and easier to debug.&lt;br /&gt;&lt;br /&gt;Custom Exceptions allows you to make more narrow, specific Exceptions with customized messages. This often makes it easier to pinpoint where your application fails from a higher persepective. By using InnerExceptions, you can also track back the original error message.&lt;br /&gt;&lt;br /&gt;In the following example, I throw my own custom Exception object using the caught DataAdapterException as an InnerException.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt; myConnection.Open();&lt;br /&gt; myDataAdapter.Fill(ds_records);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch(Exception err)&lt;br /&gt;{&lt;br /&gt; throw new MyCustomException(&lt;br /&gt;              "Database error: Unable to fill dataset", err);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt; connection.Close();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now lets make the MyCustomException. First off, lets make a base class _ErrorException which inherits from the Exception class and write the following methods. We'll make the class Serializable, so that .NET is able to serialize the Exception. If the exception is ever &lt;a href="http://haacked.com/archive/2004/02/24/207.aspx"&gt;used in a remoting context&lt;/a&gt;, exceptions on the server are serialized and remoted back to the client proxy. These base constructors are called each time we create a new Exception.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[Serializable]&lt;br /&gt;public class _ErrorException : Exception&lt;br /&gt;{&lt;br /&gt;public string ErrorMessage&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;    return base.Message.ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public _ErrorException(string errorMessage)&lt;br /&gt;                   : base(errorMessage) {}&lt;br /&gt;&lt;br /&gt;public _ErrorException(string errorMessage, Exception innerEx)&lt;br /&gt;                   : base(errorMessage, innerEx) {}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;Now lets create a class MyCustomException which inherits from _ErrorException:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;public class MyCustomException : _ErrorException&lt;br /&gt;{&lt;br /&gt;public InternalErrorException(string errorMessage)&lt;br /&gt;                             : base(errorMessage) {}   &lt;br /&gt;&lt;br /&gt;public InternalErrorException(string errorMessage, Exception innerEx)&lt;br /&gt;                             : base(errorMessage, innerEx) {}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's about it. Now, from the business layer of my application, I can track back to the original DataAdapterException and its original error message, but also find out other places in the code affected by the error.&lt;br /&gt;&lt;div style="display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-align: center; line-height: 2em;" id="greasedLightboxLoading"&gt;&lt;img style="border: medium none ;" src="data:image/gif,GIF89a%80%00%80%00%A2%00%00%FF%FF%FF%DD%DD%DD%BB%BB%BB%99%99%99%00%00%FF%00%00%00%00%00%00%00%00%00%21%FF%0BNETSCAPE2.0%03%01%00%00%00%21%F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es8P%ED%24%26a%DF%1E2%13%EC%E4%1CUu%F7%06%12%D5wn%E0%C1%5D%0F%9FQ%1Cq%F2%83%3A1%3FO%F8Xzt%EA%C7%DB6%AFs%5D%EE%F4%95%D5%25%BEv%D1Z%7Cv%F0%BB%EB%05%CC%B8%DERz%99%BF%D5kd%11%91%C3y%F9%F3G%D4%2F%B1%DF%7E%FF%08%BC%F9%E9%F7_I%EDaW%12t%01%3EP%DE3%B3%B9g%DB%80%9A-%A8%20%84%8CAha%7C%90Q%A8%21%85%7Ea%B8%21%87%CE5%18%8C%88%E4%80%88%16%89%25%26%C8%A0%8A%19%A2%98%93%8B%11%B2%D8%21%8C1J%08%A0%89%9F%BC%97b%81%F8%C9x%A2%8F%F0%F1%D8%A3%8D%CA%E8%B8%23%91%2B%02%29%9C%92%232y%24%92%C6%A55%E4x%7E%E0H%9B%95%04%60%89%A1%22%5B%06%09%E5%8D4%9Aa%A4%97RNY%26%97X%D6x%E6%3ANv%91%A6%9ATr%D7%26%15of%19%26%99q%E6%28%A4%7Fs%929%E3Q%EE%7D%89%1Eiu%AAVhj%87%A2%96%E8i%8B%9A%D6%A8%A3%7B%AE%C6%27%A0%AE%24%00%00%21%F9%04%05%05%00%04%00%2C%0A%00%02%00W%000%00%00%03%FFH%BA%DC%FE0%BE%40%83%BC8%EB%3D%2B%E5%60%28J%9E7%9E%28WVi%EBv%EB%2B%BF%EB7%DFgm%E1%3C%A8%F7%23%81P%90%FA%A1%00H%40k8D%19G%C9%24%8A%C9%CC%D5N%D1%E8%89%DA%1C%3DCYi%90%2B%F4%5EEa%B1%88%DC%F5%9DAi%F5%9A-%FAn%E2%CA%14%9B%E8%8E%C1%E3.%7B%21v%19x%2F%82*o%1A%86%87%88%1A%84%12xy%8Dd%89%7E%8B%803%7B%7C%19%90%10%928%8E%18%9E%0F%8C%A1t%9D%8A%91%99%3C%A2%24%AA%11%A6%AD%A8%17%A4%0C%B2%B3%B4%11%B6%0A%A0%40%0A%AE0%25%18%B8%3D%9B%B5%B0%0D%BE%BF%C0%BA%10%97%B1%AC%10%03%D4%03%81%CE%C2%C4%D2%0F%D5%D5K%D8G%DB%0D%DD%E4z%952%E2%E3%E4%E5c%5C3%E9%0C%EB%F2%EDm%E8Y%18%F2%F3se%3CZ%19%F9%FA%98%09%04%18P%E0%2F%82%EB%0C2C%C8N%21%10%86%DD%1C%1E%84HMb%0F%8A%15-%F2%C0%A8%F1%13%22%C3%8E%0F%09%82%0C%99o%E4%C4%86%26IZK%A9%21%01%00%21%F9%04%05%05%00%04%00%2C%1F%00%02%00W%000%00%00%03%FFH%BA%DC%FEKH%01%AB%BD8%EB6%E7%FE%60%A8u%9Dh%9E%22%E9%A1l%5B%A9%92%2B%CF%04L%D1%F8i%E7%7C%B8%F7%A2%81p%C0%FA%9D%02%C8%40k8D%19E%C9%24%8A%C9%D4%C1%8EQ%A9%89%DA4%3DAYm%90%2B%F4%5E%A1a%E4%89%DC%05%7D5i%F1%98%9C%3A%83%E3K%B6%CF%BE%89%2B%F3tn%7Cpx.lD%1Fo%17%7E3%87%88%23%83%8B%8C%8Dz%1B%8A%15%93%94%95%19%97%0F%7E%7F4%87%96%91%98%859%A2%9C%A4%9E%A6%A7%9B%17%9D%0D%99%3C%A8%AF%AA%B1%AC%B3%B4%2F%B6%0B%9F%40%0B%BA%10%B0%0A%B2%40%8E%B5*%92%B8%C6%AE%C2%24%18%C5%BF%04%C1%0F%25%CAa.%00%DA%00%18%D4%28%D1%21%DB%DB%DD%812%CB%20%E2%E9%17%CD%2C%E7%1A%E9%F0%E4U8%D8%22%F0%F7%19%F39Q%26%F7%F8%D2%D2%FC%FD%03%D8C%E0%40%828%0C%C6C%C8C%A1%3A%86%09%1D%8E%83HC%E2D%8A3%2Cj%C3X%D1%14%22%C7%88%0A%3F%E6%08%29r%A4%C0%92%05%17%A2L%B9%D1D%02%00%21%F9%04%05%05%00%04%00%2C%3C%00%02%00B%00B%00%00%03%FEH4%3C%FA0%CAI%AB%9D%AD%DD%CD%7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E8%EFX%AE%22%F3%F4%D7%1D%F7%F8%ED%22%E3B%F4%0B%91O%9F%1BokR%144%E8%89%04%1B%85%FFF%BC%A9%E2l%14%C5%28%0B%2F%FE%C8%A8Q%13%07%C7%8E5%3E%82%84%21r%E4%8Bj%26%89%84K%A9%20%01%00%21%F9%04%05%05%00%04%00%2C%0A%00N%00W%000%00%00%03%FFH%BA%DC%0E%10%B8I%AB%BD8%B7%C8%B5%FF%E0%C7%8DRh%9E%219%A2lK%A9%A4%2B%B7%B0%3A%DF%60m%E3%3C%A6%C7%BD%E0%E4%B7%12%1A%17%C4%CEq%99%8C%2C%8FM%C8%13%DA%9CR%89%A7%806%20%1Cx%07%99dv%AB%ED%7D%BF%3E%1D%8AL%C6%9D%CF%97Z%8B%BDu%BF%BDi%25%8B%5E%BF%DD%D1qN.%7Ce%17%02%87%02%18%7FxV%04%84%5C%86%88%87%8A%8BV%8F%90%15%92%92%17%8B%8CK%8F%18%9A%88%94%7FO%97%A1%A2%89%9C%9D%9F%84%19%A9%AA%AB%A5F%A0%AF%A9%1A%ACB%B5%A8%A2%B8%95A%BB%BC%9A%1E%B98%A7%1A%B0%C4%C53%C1%C2%9B%CA%B3%CC%CD%91%BD%D0%D1%83%AE%1F%C9%1F%CB%7B%D9%DA%B7%20%DDc%7C%21%DB%DC%BF%DE%E5%E6%E1%E2%E9%26%C7%20%E7%E8%EF%20%D3%C8%ED%EE%D7%F6%EB%26%F3%FAo%D6%F4cW%CDD%3D%7EmP%FC%03%E8I%60%21%85%F9%0C%02jDm%18E%2B%0B%2F%0A%C9%A8%B1%12%07%C7%8E8%3E%82%9C%21r%A4%8C%82%26%8D%3C%E3%91%00%00%21%F9%04%05%05%00%04%00%2C%02%00%3C%00B%00B%00%00%03%F5H%04%DC%FE%F0%A9I%AB%BD%98%C6%CD%5D%FE%E0%D5%8D%5Ch%82d*%9D%AC%A5%BE%40%2BO%B0%3A%DF%F5x%EF%F9%B6%FF%C0%A0pH%2C%1A%8F%C8%A4r%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0%D0%E8%F5%F6%CB%F8%CC%F2%F7%F4%F9%FA%DB%D4%CD%D3wf%9F%86%04%00%21%F9%04%09%05%00%04%00%2C%02%00%02%00%7C%00%7C%00%00%03%FFH%BA%DC%FE0%CAI%AB%BD8%EB%CD%BB%FF%60%28%8Edi%9Eh%AA%AEl%EB%BEp%2C%CFt%0A%DC%40%AD%938%BE%FF%9E%5E%0FH%CC%08%7D%C5%24%E5%88T%3A%1D%CC%E6sJ%88%E6%A8X%2B%96%AA%DDN%BB%5E%A5%F5%1AN%82%CB%C41%DA%1C%5D%B3%99%EEt%3B%0E%3C%D3i%EA%BB%CE%AE%8F%E5%FB3%7C%80%12%01%85%01%21%82%83%0E%86%86%20%89%8A%0B%8C%92%1Fs%90%10%92%98%1D%95%96%8B%98%99%1BG%9C%11%9E%9E%1CC%A2%A3%A4%9F%A8%26%AA%A5%AC%AD%AE%93%B0%24%B2%B3%B4%23%B6%8C%B8%B5%BA%85%BC%22%BE%BF%C0%21%C2%C4%C1%B6%C7%B9%AE%CA%CB%A4%CD%BD%B7%D0%CE%87%D3%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%C0%02%E4%E5%E6%E7%E8%E7%DC%E9%EC%ED%E6%DA%EE%F1%ED%D9%F2%F5%EA%D8%F6%F9%02%F4%FA%F5%F0%FD%EE%D6%01L%27%AE%A0%C1%83%08%13*%5C%C8%B0%A1%C3%87h%06H%1C%00q%C1%C4%8B%10%2Fj%A4%D8pP%A3F%86%1E7*%0C%E9%11%21%C9%92%07O%8A4%A8%F2%23%CB%96%13M%C2%94%98r%26%C7%970%13%CE%5C%98%93%E7I%87%24%2B%AE%ACH%00%23%D1%A3H%93*%5D%CA%B4%A9%D3%A7P%A3J%9DJ%B5%AA%D5%ABX%B3j%DD%CA%B5%AB%D7%AF%60%C3%16I%00%00%3B" /&gt;&lt;p style="margin: 0pt; padding: 25px 0pt 5px; font-size: 45px;"&gt;Loading Image&lt;/p&gt;&lt;p style="margin: 0pt; padding: 5px 0pt; font-weight: normal; font-size: 11px;"&gt;Click anywhere to cancel&lt;/p&gt;&lt;/div&gt;&lt;div style="border: medium none ; display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-size: 45px; font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-decoration: none; text-align: center;" id="greasedLightboxError"&gt;Image is Unavailable&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-114778798275224283?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/114778798275224283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=114778798275224283' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114778798275224283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114778798275224283'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/05/custom-exceptions.html' title='Custom Exceptions'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-114777652959313101</id><published>2006-05-16T03:43:00.000-07:00</published><updated>2006-05-16T03:48:49.610-07:00</updated><title type='text'>Test-Driven Development (TDD)</title><content type='html'>&lt;img style="display: none;" id="greasedLightboxPreload" /&gt;&lt;div style="display: none; position: absolute; top: 0pt; left: 0pt; z-index: 90; width: 100%; background-color: rgb(0, 0, 0); opacity: 0.8; cursor: pointer;" id="greasedLightboxOverlay"&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(68, 68, 68); padding: 10px; background: rgb(0, 0, 0) none repeat scroll 0%; display: none; position: absolute; z-index: 100; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(170, 170, 170); -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; -moz-border-radius-bottomleft: 10px; font-family: Verdana; font-size: 11px;" id="greasedLightbox"&gt;&lt;img style="border: medium none ; cursor: pointer;" id="greasedLightboxImage" /&gt;&lt;div style="padding: 10px 0pt; color: rgb(170, 170, 170);" id="greasedLightboxCaption"&gt;&lt;/div&gt;&lt;/div&gt;TheCodeProject has a great article on Test-Driven Development in .NET. The article explains the  basics of TDD, the most common attributes, class setup and the NUnit GUI.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/dotnet/tdd_in_dotnet.asp"&gt;TheCodeProject:Test-Driven Developmen in .NET&lt;/a&gt;&lt;br /&gt;&lt;div style="display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-align: center; line-height: 2em;" id="greasedLightboxLoading"&gt;&lt;img style="border: medium none ;" src="data:image/gif,GIF89a%80%00%80%00%A2%00%00%FF%FF%FF%DD%DD%DD%BB%BB%BB%99%99%99%00%00%FF%00%00%00%00%00%00%00%00%00%21%FF%0BNETSCAPE2.0%03%01%00%00%00%21%F9%04%05%05%00%04%00%2C%02%00%02%00%7C%00%7C%00%00%03%FFH%BA%DC%FE0%CA%06*%988%EB%CD%BB_%96%F5%8Ddibax%AEl%AB%A5%A2%2B%CF.%5C%D1x%3E%DA%97%EE%FF%12%1EpHT%08%8B%C8G%60%190%1DI%83%E8%20%F9a2K%CF%8FTJ%E5X%AD%A4lg%BB%EDj%BE%D7%9D%0DJ%8E%9A3%E8%B4G%BCis%DF%93%B8%9CC%CF%D8%EFx%12zMsk%1E%7FS%81%18%83%850%87%7F%8Apz%8D%29%8Fv%91%92q%1D%7D%12%88%98%99%9A%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%C8%A0%8A%19%A2%98%93%8B%11%B2%D8%21%8C1J%08%A0%89%9F%BC%97b%81%F8%C9x%A2%8F%F0%F1%D8%A3%8D%CA%E8%B8%23%91%2B%02%29%9C%92%232y%24%92%C6%A55%E4x%7E%E0H%9B%95%04%60%89%A1%22%5B%06%09%E5%8D4%9Aa%A4%97RNY%26%97X%D6x%E6%3ANv%91%A6%9ATr%D7%26%15of%19%26%99q%E6%28%A4%7Fs%929%E3Q%EE%7D%89%1Eiu%AAVhj%87%A2%96%E8i%8B%9A%D6%A8%A3%7B%AE%C6%27%A0%AE%24%00%00%21%F9%04%05%05%00%04%00%2C%0A%00%02%00W%000%00%00%03%FFH%BA%DC%FE0%BE%40%83%BC8%EB%3D%2B%E5%60%28J%9E7%9E%28WVi%EBv%EB%2B%BF%EB7%DFgm%E1%3C%A8%F7%23%81P%90%FA%A1%00H%40k8D%19G%C9%24%8A%C9%CC%D5N%D1%E8%89%DA%1C%3DCYi%90%2B%F4%5EEa%B1%88%DC%F5%9DAi%F5%9A-%FAn%E2%CA%14%9B%E8%8E%C1%E3.%7B%21v%19x%2F%82*o%1A%86%87%88%1A%84%12xy%8Dd%89%7E%8B%803%7B%7C%19%90%10%928%8E%18%9E%0F%8C%A1t%9D%8A%91%99%3C%A2%24%AA%11%A6%AD%A8%17%A4%0C%B2%B3%B4%11%B6%0A%A0%40%0A%AE0%25%18%B8%3D%9B%B5%B0%0D%BE%BF%C0%BA%10%97%B1%AC%10%03%D4%03%81%CE%C2%C4%D2%0F%D5%D5K%D8G%DB%0D%DD%E4z%952%E2%E3%E4%E5c%5C3%E9%0C%EB%F2%EDm%E8Y%18%F2%F3se%3CZ%19%F9%FA%98%09%04%18P%E0%2F%82%EB%0C2C%C8N%21%10%86%DD%1C%1E%84HMb%0F%8A%15-%F2%C0%A8%F1%13%22%C3%8E%0F%09%82%0C%99o%E4%C4%86%26IZK%A9%21%01%00%21%F9%04%05%05%00%04%00%2C%1F%00%02%00W%000%00%00%03%FFH%BA%DC%FEKH%01%AB%BD8%EB6%E7%FE%60%A8u%9Dh%9E%22%E9%A1l%5B%A9%92%2B%CF%04L%D1%F8i%E7%7C%B8%F7%A2%81p%C0%FA%9D%02%C8%40k8D%19E%C9%24%8A%C9%D4%C1%8EQ%A9%89%DA4%3DAYm%90%2B%F4%5E%A1a%E4%89%DC%05%7D5i%F1%98%9C%3A%83%E3K%B6%CF%BE%89%2B%F3tn%7Cpx.lD%1Fo%17%7E3%87%88%23%83%8B%8C%8Dz%1B%8A%15%93%94%95%19%97%0F%7E%7F4%87%96%91%98%859%A2%9C%A4%9E%A6%A7%9B%17%9D%0D%99%3C%A8%AF%AA%B1%AC%B3%B4%2F%B6%0B%9F%40%0B%BA%10%B0%0A%B2%40%8E%B5*%92%B8%C6%AE%C2%24%18%C5%BF%04%C1%0F%25%CAa.%00%DA%00%18%D4%28%D1%21%DB%DB%DD%812%CB%20%E2%E9%17%CD%2C%E7%1A%E9%F0%E4U8%D8%22%F0%F7%19%F39Q%26%F7%F8%D2%D2%FC%FD%03%D8C%E0%40%828%0C%C6C%C8C%A1%3A%86%09%1D%8E%83HC%E2D%8A3%2Cj%C3X%D1%14%22%C7%88%0A%3F%E6%08%29r%A4%C0%92%05%17%A2L%B9%D1D%02%00%21%F9%04%05%05%00%04%00%2C%3C%00%02%00B%00B%00%00%03%FEH4%3C%FA0%CAI%AB%9D%AD%DD%CD%7B%CD%99%27%8E%16%A8%91hj2i%3B%AE%8E%2Bo%F0l%7F%EB%ADG%B5%2B%FC%82%DD%A3%97%02%02%85%8B%5C%D1x%DC%11I%CC%A6%EE%29%8AJo%D4%8E%F5j%CBr%B6A%A1%F7%02F%26M%D0%ADy%5C%29%AF%95Z7%92%3D%91%CF%E1%1Bp%F8%8D%8E%5B%CDCx%16v%7C%20%7EQ%80%81%7Ddj%89%0At%0Az%8E%8F%82u%8D%93%90%92%93%94%21%8C%7F%9B%8A1%83%97.%01%A6%01%3B%84%28%A7%A7%3A%A4%AB%AC%AC7%AF%22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3C%D3i%EA%BB%CE%AE%8F%E5%FB3%7C%80%12%01%85%01%21%82%83%0E%86%86%20%89%8A%0B%8C%92%1Fs%90%10%92%98%1D%95%96%8B%98%99%1BG%9C%11%9E%9E%1CC%A2%A3%A4%9F%A8%26%AA%A5%AC%AD%AE%93%B0%24%B2%B3%B4%23%B6%8C%B8%B5%BA%85%BC%22%BE%BF%C0%21%C2%C4%C1%B6%C7%B9%AE%CA%CB%A4%CD%BD%B7%D0%CE%87%D3%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%C0%02%E4%E5%E6%E7%E8%E7%DC%E9%EC%ED%E6%DA%EE%F1%ED%D9%F2%F5%EA%D8%F6%F9%02%F4%FA%F5%F0%FD%EE%D6%01L%27%AE%A0%C1%83%08%13*%5C%C8%B0%A1%C3%87h%06H%1C%00q%C1%C4%8B%10%2Fj%A4%D8pP%A3F%86%1E7*%0C%E9%11%21%C9%92%07O%8A4%A8%F2%23%CB%96%13M%C2%94%98r%26%C7%970%13%CE%5C%98%93%E7I%87%24%2B%AE%ACH%00%23%D1%A3H%93*%5D%CA%B4%A9%D3%A7P%A3J%9DJ%B5%AA%D5%ABX%B3j%DD%CA%B5%AB%D7%AF%60%C3%16I%00%00%3B" /&gt;&lt;p style="margin: 0pt; padding: 25px 0pt 5px; font-size: 45px;"&gt;Loading Image&lt;/p&gt;&lt;p style="margin: 0pt; padding: 5px 0pt; font-weight: normal; font-size: 11px;"&gt;Click anywhere to cancel&lt;/p&gt;&lt;/div&gt;&lt;div style="border: medium none ; display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-size: 45px; font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-decoration: none; text-align: center;" id="greasedLightboxError"&gt;Image is Unavailable&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-114777652959313101?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/114777652959313101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=114777652959313101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114777652959313101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114777652959313101'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/05/test-driven-development-tdd.html' title='Test-Driven Development (TDD)'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-114777287906976971</id><published>2006-05-16T02:30:00.000-07:00</published><updated>2006-05-16T02:48:13.950-07:00</updated><title type='text'>Managed Direct X tutorials</title><content type='html'>The massive amount of articles, downloads, webcasts and product sites on the MSDN network sometimes makes it a daunting task to find usefull information about a specific topic.&lt;br /&gt;&lt;br /&gt;Looking for resources on the latest managed Direct X, I didn't manage to find anything really usefull off the Direct X MSDN home page, but half an hour later, Google had directed me to these great tutorials:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/coding4fun/gamedevelopment/default.aspx"&gt;Microsoft: Code4fun&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/events/series/msdnvideodev.mspx"&gt;Microsoft: Video Game Development (webcasts)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Other resources:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pluralsight.com/wiki/default.aspx/Craig.DirectX/Direct3DTutorialIndex.html"&gt;Direct3 D Tutorial Index: Craig Andera's DirectX Wiki&lt;/a&gt;&lt;br /&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-114777287906976971?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/114777287906976971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=114777287906976971' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114777287906976971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114777287906976971'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/05/managed-direct-x-tutorials.html' title='Managed Direct X tutorials'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28193226.post-114777145424364824</id><published>2006-05-16T02:16:00.000-07:00</published><updated>2006-05-16T02:24:14.256-07:00</updated><title type='text'>Welcome to C# Tutorial</title><content type='html'>&lt;img style="display: none;" id="greasedLightboxPreload" /&gt;&lt;div style="display: none; position: absolute; top: 0pt; left: 0pt; z-index: 90; width: 100%; background-color: rgb(0, 0, 0); opacity: 0.8; cursor: pointer;" id="greasedLightboxOverlay"&gt;&lt;/div&gt;&lt;div style="border: 1px solid rgb(68, 68, 68); padding: 10px; background: rgb(0, 0, 0) none repeat scroll 0%; display: none; position: absolute; z-index: 100; text-align: center; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(170, 170, 170); -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; -moz-border-radius-bottomright: 10px; -moz-border-radius-bottomleft: 10px; font-family: Verdana; font-size: 11px;" id="greasedLightbox"&gt;&lt;img style="border: medium none ; cursor: pointer;" id="greasedLightboxImage" /&gt;&lt;div style="padding: 10px 0pt; color: rgb(170, 170, 170);" id="greasedLightboxCaption"&gt;&lt;/div&gt;&lt;/div&gt;Welcome to C# Tutorial. This is the workblog for Anders Nygaard, and hopefully a usefull resource blog for both you, the reader and myself. I'll start off with a low level of ambition, this is not going to be your complete resource for C#, but rather a collection of usefull tips and tricks that I stumble upon.&lt;br /&gt;&lt;br /&gt;Nuff said, back to work :D&lt;br /&gt;&lt;div style="display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-align: center; line-height: 2em;" id="greasedLightboxLoading"&gt;&lt;img style="border: medium none ;" src="data:image/gif,GIF89a%80%00%80%00%A2%00%00%FF%FF%FF%DD%DD%DD%BB%BB%BB%99%99%99%00%00%FF%00%00%00%00%00%00%00%00%00%21%FF%0BNETSCAPE2.0%03%01%00%00%00%21%F9%04%05%05%00%04%00%2C%02%00%02%00%7C%00%7C%00%00%03%FFH%BA%DC%FE0%CA%06*%988%EB%CD%BB_%96%F5%8Ddibax%AEl%AB%A5%A2%2B%CF.%5C%D1x%3E%DA%97%EE%FF%12%1EpHT%08%8B%C8G%60%190%1DI%83%E8%20%F9a2K%CF%8FTJ%E5X%AD%A4lg%BB%EDj%BE%D7%9D%0DJ%8E%9A3%E8%B4G%BCis%DF%93%B8%9CC%CF%D8%EFx%12zMsk%1E%7FS%81%18%83%850%87%7F%8Apz%8D%29%8Fv%91%92q%1D%7D%12%88%98%99%9A%1B%9C%10%88%89%9Fy%93%A2%86%1A%9E%A7%8B%8C%2F%AB%18%A5%AE%A0_%AA%8E%AC%90%B5%B6%60%19%A3%0D%AD%BC%AF%A1%28%B2%9D%BB%C3%C4h%BF%C7%A4%C9%CA%A8%A9A%CE%0E%B4%D1%BD%7B%10%C0%0A%C2%D8%D2%C5%DB%D5%0C%D7%DF%CB%B7%13%B9%C8%97x%02%EE%02%2B%B0%D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28%A4%7Fs%929%E3Q%EE%7D%89%1Eiu%AAVhj%87%A2%96%E8i%8B%9A%D6%A8%A3%7B%AE%C6%27%A0%AE%24%00%00%21%F9%04%05%05%00%04%00%2C%0A%00%02%00W%000%00%00%03%FFH%BA%DC%FE0%BE%40%83%BC8%EB%3D%2B%E5%60%28J%9E7%9E%28WVi%EBv%EB%2B%BF%EB7%DFgm%E1%3C%A8%F7%23%81P%90%FA%A1%00H%40k8D%19G%C9%24%8A%C9%CC%D5N%D1%E8%89%DA%1C%3DCYi%90%2B%F4%5EEa%B1%88%DC%F5%9DAi%F5%9A-%FAn%E2%CA%14%9B%E8%8E%C1%E3.%7B%21v%19x%2F%82*o%1A%86%87%88%1A%84%12xy%8Dd%89%7E%8B%803%7B%7C%19%90%10%928%8E%18%9E%0F%8C%A1t%9D%8A%91%99%3C%A2%24%AA%11%A6%AD%A8%17%A4%0C%B2%B3%B4%11%B6%0A%A0%40%0A%AE0%25%18%B8%3D%9B%B5%B0%0D%BE%BF%C0%BA%10%97%B1%AC%10%03%D4%03%81%CE%C2%C4%D2%0F%D5%D5K%D8G%DB%0D%DD%E4z%952%E2%E3%E4%E5c%5C3%E9%0C%EB%F2%EDm%E8Y%18%F2%F3se%3CZ%19%F9%FA%98%09%04%18P%E0%2F%82%EB%0C2C%C8N%21%10%86%DD%1C%1E%84HMb%0F%8A%15-%F2%C0%A8%F1%13%22%C3%8E%0F%09%82%0C%99o%E4%C4%86%26IZK%A9%21%01%00%21%F9%04%05%05%00%04%00%2C%1F%00%02%00W%000%00%00%03%FFH%BA%DC%FEKH%01%AB%BD8%EB6%E7%FE%60%A8u%9Dh%9E%22%E9%A1l%5B%A9%92%2B%CF%04L%D1%F8i%E7%7C%B8%F7%A2%81p%C0%FA%9D%02%C8%40k8D%19E%C9%24%8A%C9%D4%C1%8EQ%A9%89%DA4%3DAYm%90%2B%F4%5E%A1a%E4%89%DC%05%7D5i%F1%98%9C%3A%83%E3K%B6%CF%BE%89%2B%F3tn%7Cpx.lD%1Fo%17%7E3%87%88%23%83%8B%8C%8Dz%1B%8A%15%93%94%95%19%97%0F%7E%7F4%87%96%91%98%859%A2%9C%A4%9E%A6%A7%9B%17%9D%0D%99%3C%A8%AF%AA%B1%AC%B3%B4%2F%B6%0B%9F%40%0B%BA%10%B0%0A%B2%40%8E%B5*%92%B8%C6%AE%C2%24%18%C5%BF%04%C1%0F%25%CAa.%00%DA%00%18%D4%28%D1%21%DB%DB%DD%812%CB%20%E2%E9%17%CD%2C%E7%1A%E9%F0%E4U8%D8%22%F0%F7%19%F39Q%26%F7%F8%D2%D2%FC%FD%03%D8C%E0%40%828%0C%C6C%C8C%A1%3A%86%09%1D%8E%83HC%E2D%8A3%2Cj%C3X%D1%14%22%C7%88%0A%3F%E6%08%29r%A4%C0%92%05%17%A2L%B9%D1D%02%00%21%F9%04%05%05%00%04%00%2C%3C%00%02%00B%00B%00%00%03%FEH4%3C%FA0%CAI%AB%9D%AD%DD%CD%7B%CD%99%27%8E%16%A8%91hj2i%3B%AE%8E%2Bo%F0l%7F%EB%ADG%B5%2B%FC%82%DD%A3%97%02%02%85%8B%5C%D1x%DC%11I%CC%A6%EE%29%8AJo%D4%8E%F5j%CBr%B6A%A1%F7%02F%26M%D0%ADy%5C%29%AF%95Z7%92%3D%91%CF%E1%1Bp%F8%8D%8E%5B%CDCx%16v%7C%20%7EQ%80%81%7Ddj%89%0At%0Az%8E%8F%82u%8D%93%90%92%93%94%21%8C%7F%9B%8A1%83%97.%01%A6%01%3B%84%28%A7%A7%3A%A4%AB%AC%AC7%AF%22%B1%B6%AEL%29%B6%BB%A9%5C%1E%BB%BC%A0%1B%C0%C1%C2%15%C4%C5%C6%12%C8%B7%CA%14%CC%B1%CE%13%D0%B2%D2%11%D4%AD%D6%D7%D8%A8%DA%10%DC%DE%CB%D0%E1%D3%C8%E4%CF%C4%E7%C7%CD%EA%EB%A6%ED%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FA%00%FD%FE%FF%00%03%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0%CA7%EA%988%EB%CD%89%FD%5D%28%8E%CDg%5Ed%AAJ%A7%B9%BE%B0%D7%BAq%1D%CE%AD%ADkx%BE%FF%90%DE%09Ht%08i%C5%E4%11%94%2C.-M%E5%13%15%05N5%80%2C%E0%27%E8%0AFO%8CV%AB%F3z%C1%C7%C9x%5C3%9BIB%F5%3A%DBvwU8%C9%9C%1C%B3%9F%F1H%10%7Bt%13%01%86%01%18%7Ew%2BL%11%83%5B%85%87%86%89%8AQ%8F%90%11%92%92%13%8A%8BE%8F%18%9A%87%94%7EI%97%A1%A2%88%9C%9D%9F%83%19%A9%AA%AB%A5%40%A0%AF%A9%1A%AC%3F%B5%A8%A2%B8%95%3B%BB%BC%9A%1B%B95%A7%1A%B0%C4%C50%C1%C2%9B%CA%B3%CC%CD%91%BD%D0%D1%2B%D3%D4%C3%1C%CB%29%D9%DA%CF%DC%BF*%DF%12%C9%1D%DD%22%E5%E6%B7%21%E9%1C%C7%1D%E7%E8%EFX%AE%22%F3%F4%D7%1D%F7%F8%ED%22%E3B%F4%0B%91O%9F%1BokR%144%E8%89%04%1B%85%FFF%BC%A9%E2l%14%C5%28%0B%2F%FE%C8%A8Q%13%07%C7%8E5%3E%82%84%21r%E4%8Bj%26%89%84K%A9%20%01%00%21%F9%04%05%05%00%04%00%2C%0A%00N%00W%000%00%00%03%FFH%BA%DC%0E%10%B8I%AB%BD8%B7%C8%B5%FF%E0%C7%8DRh%9E%219%A2lK%A9%A4%2B%B7%B0%3A%DF%60m%E3%3C%A6%C7%BD%E0%E4%B7%12%1A%17%C4%CEq%99%8C%2C%8FM%C8%13%DA%9CR%89%A7%806%20%1Cx%07%99dv%AB%ED%7D%BF%3E%1D%8AL%C6%9D%CF%97Z%8B%BDu%BF%BDi%25%8B%5E%BF%DD%D1qN.%7Ce%17%02%87%02%18%7FxV%04%84%5C%86%88%87%8A%8BV%8F%90%15%92%92%17%8B%8CK%8F%18%9A%88%94%7FO%97%A1%A2%89%9C%9D%9F%84%19%A9%A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CA%CB%A4%CD%BD%B7%D0%CE%87%D3%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%C0%02%E4%E5%E6%E7%E8%E7%DC%E9%EC%ED%E6%DA%EE%F1%ED%D9%F2%F5%EA%D8%F6%F9%02%F4%FA%F5%F0%FD%EE%D6%01L%27%AE%A0%C1%83%08%13*%5C%C8%B0%A1%C3%87h%06H%1C%00q%C1%C4%8B%10%2Fj%A4%D8pP%A3F%86%1E7*%0C%E9%11%21%C9%92%07O%8A4%A8%F2%23%CB%96%13M%C2%94%98r%26%C7%970%13%CE%5C%98%93%E7I%87%24%2B%AE%ACH%00%23%D1%A3H%93*%5D%CA%B4%A9%D3%A7P%A3J%9DJ%B5%AA%D5%ABX%B3j%DD%CA%B5%AB%D7%AF%60%C3%16I%00%00%3B" /&gt;&lt;p style="margin: 0pt; padding: 25px 0pt 5px; font-size: 45px;"&gt;Loading Image&lt;/p&gt;&lt;p style="margin: 0pt; padding: 5px 0pt; font-weight: normal; font-size: 11px;"&gt;Click anywhere to cancel&lt;/p&gt;&lt;/div&gt;&lt;div style="border: medium none ; display: none; position: absolute; z-index: 150; color: rgb(255, 255, 255); font-size: 45px; font-weight: bold; font-family: &amp;quot;Trebuchet MS&amp;quot;,Tahoma,Arial; text-decoration: none; text-align: center;" id="greasedLightboxError"&gt;Image is Unavailable&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28193226-114777145424364824?l=csharptutorial.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptutorial.blogspot.com/feeds/114777145424364824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28193226&amp;postID=114777145424364824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114777145424364824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28193226/posts/default/114777145424364824'/><link rel='alternate' type='text/html' href='http://csharptutorial.blogspot.com/2006/05/welcome-to-c-tutorial.html' title='Welcome to C# Tutorial'/><author><name>Anders</name><uri>http://www.blogger.com/profile/02479610859338502727</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://static.flickr.com/55/142036206_562bbd1576.jpg'/></author><thr:total>0</thr:total></entry></feed>
