<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Tanzim Saqib on .NET discovery</title>
        <link>http://geekswithblogs.net/Saqib/Default.aspx</link>
        <description>Innovate. Create. Share.</description>
        <language>en</language>
        <copyright>Tanzim Saqib</copyright>
        <managingEditor>me@tanzimsaqib.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Tanzim Saqib on .NET discovery</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/Saqib/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>CallQueue: Implementing a Sequential Web Service Call Queue for AJAX application</title>
            <category>JavaScript</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax.aspx</link>
            <description>&lt;p&gt;In AJAX based applications its common that user might end up breaking your AJAX calls by clicking on numerous places in very short interval of time. Let us assume there is a page where there are several of hyperlinks which make WebService calls and do some stuffs on callback. If user clicks on five hyperlinks being impatient or may be just for fun, there will be five different WebService calls made. All of those calls had the same parameters or UI state while they were invoked. But on completion of one or more WebService calls it may happen that the UI state or data passed to the rest of the WebServices calls no longer exist or expired, thus will be result in inconsistent UI behaviour and/or invalid data. This is one of the important scenarios an AJAX developer should consider when he designs an application. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Specification      &lt;br /&gt;&lt;/strong&gt;To address the scenario, I would prefer implementing a Sequential WebService Calls Queue which will be able to schedule the tasks/WebService calls and help keeping UI and data consistent over the AJAX calls. We should achieve the following features from this queue:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Enqueue any WebService call anytime in the application. &lt;/li&gt;    &lt;li&gt;Dequeue any previously queued call regardless of currently executing call and location in the application. &lt;/li&gt;    &lt;li&gt;Each WebService call should have an identifier so that we can track the call and dequeue anytime later by SSQ.dq(call_id). &lt;/li&gt;    &lt;li&gt;Each call should have a timeout value which will determine the maximum amount of time we will consider for that particular call before we invoke the next call, after that we will remove from the queue. &lt;/li&gt;    &lt;li&gt;A timer will act as scheduler but will not run forever. It should run only when necessary. &lt;/li&gt;    &lt;li&gt;Each call should be able to declare its completion at any time by notifyCompleted, so that the scheduler timer will not wait for the prior task and should dequeue the next call. &lt;/li&gt;    &lt;li&gt;notifyCompleted should also be optional. The currently running call should automatically be dequeued from the scheduler queue after the timeout of its own. &lt;/li&gt;    &lt;li&gt;Each call should be able to mark as replaceIfExists so that if user`s any activity already enqueued this call, should be replaced by the current one. &lt;/li&gt;    &lt;li&gt;The queue instance should be exclusively available to the user and all over the page, meaning that the same queue class will be used to serve the functionality in one page per user basis. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;The Usage      &lt;br /&gt;&lt;/strong&gt;You should be able to use this library as follows:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Include GenericQueue.js and SequentialServiceQueue.js to your project &lt;/li&gt;    &lt;li&gt;Add the reference in the pages that you want them to be used &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;We will be naming the class as SequentialServiceQueue and in short SSQ. Let us have a look at the WebService calls in Service Queue fashion:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:fc2046a6-27d0-4752-a768-75c189e3c3e0" class="wlWriterSmartContent"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; id1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; SSQ.nq(&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;SomeMethod1&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #000000;"&gt;1000&lt;/span&gt;&lt;span style="color: #000000;"&gt;, 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() 
    {
        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Do some stuffs&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;        SomeWebService1.SomeMethod1(SomeParameters, onSomeMethodCallCompleted);
    });

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt; onSomeMethodCallCompleted(result)
{
    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Do stuffs&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    SSQ.notifyCompleted(id1);    
}

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; id2 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; SSQ.nq(&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;SomeMethod2&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #000000;"&gt;1000&lt;/span&gt;&lt;span style="color: #000000;"&gt;, 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() 
    {
        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Do some stuffs&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;        SomeWebService2.SomeMethod2(SomeParameters, 
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(result)
            {
                &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Do stuffs&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;                SSQ.notifyCompleted(id2);
            });
    });&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;You can not only queue WebService calls, but also regular JavaScript codeblock:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; width: 619px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:6d67a192-97a6-4b98-a8d5-a17decee5809" class="wlWriterSmartContent"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; service_id1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; SSQ.nq(&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;Service1&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #000000;"&gt;1000&lt;/span&gt;&lt;span style="color: #000000;"&gt;, 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() 
    {
        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Do some stuffs&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;        SSQ.notifyCompleted(service_id1);
    });&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The GenericQueue 
    &lt;br /&gt;&lt;/strong&gt;To accomplish the SequentialServiceQueue, first of all we should define an all purpose GenericQueue class which will able to handle any queue requirement out of the box. The queue is fairly simple, just like old Computer Science data structure class. Here are few of the functions from the class:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:3376f21b-d36c-474a-9973-b2befdf1374e" class="wlWriterSmartContent"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.nq &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(element) 
{
    array.push(element);
    &lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;rear;
}

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.dq &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() 
{
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; element &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; undefined;

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #000000;"&gt;!&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.is_empty()) 
    {
        element &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; array.shift();
        &lt;/span&gt;&lt;span style="color: #000000;"&gt;--&lt;/span&gt;&lt;span style="color: #000000;"&gt;rear;
    }

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; element;
}

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.for_each &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(func)
{
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; i &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;; i &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; rear; &lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;i)
        func(i, array[i]);
}

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.delete_at &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(index) 
{
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;delete&lt;/span&gt;&lt;span style="color: #000000;"&gt; array[index];

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; i &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; index;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;while&lt;/span&gt;&lt;span style="color: #000000;"&gt; (i &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; array.length) 
        array[i] &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; array[&lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;i];

    array &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; array.slice(&lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #000000;"&gt;--&lt;/span&gt;&lt;span style="color: #000000;"&gt;rear);
}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The SequentialServiceQueue&lt;/strong&gt; 

  &lt;br /&gt;The following is how this class starts. You will notice here that the timer_id is for our scheduler timer, running_task indicates the currently executing call, interval is a variable for the timer_id which you can determine as your wish. interval is the knob of how fast or slow you want the scheduler to run. queue as you can understand is an GenericQueue instance we have just created above. Note that the GenericQueue is not a static class rather its a instance class unlike the SSQ. You have also noticed that the ms_when_last_call_made and ms_elapsed_since_last_call are pretty self-describing. get_random_id is reponsible for preparing new id for the newly enqueued call.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:b4286d51-b175-49f5-8944-59bed7e1fd96" class="wlWriterSmartContent"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; SequentialServiceQueue &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;
{
    timer_id: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;,
    ms_when_last_call_made: &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;,          &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; milliseconds (readonly)&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    ms_elapsed_since_last_call: &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;,      &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; milliseconds (readonly)&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    running_task: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;,
    interval: &lt;/span&gt;&lt;span style="color: #000000;"&gt;10&lt;/span&gt;&lt;span style="color: #000000;"&gt;,                       &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; milliseconds&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    queue: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; GenericQueue(),

    get_random_id: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() {
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; min &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; max &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;10&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Date().getTime() &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; (Math.round((max &lt;/span&gt;&lt;span style="color: #000000;"&gt;-&lt;/span&gt;&lt;span style="color: #000000;"&gt; min) &lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #000000;"&gt; Math.random() &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; min));
    },&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;From the code below, as soon as any new call is enqueued, we check for if it is allowed to replace if already exists in the queue with the same name. If found any, we just update that, otherwise we create a brand new task and enqueue and start our updater which is the scheduler in our case.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ae7c30d7-43e7-4af0-8770-8f7883c4cc68" class="wlWriterSmartContent"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000;"&gt;nq: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(name, replaceIfExists, timeout, code) {
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; id &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.get_random_id();

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (replaceIfExists) {
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; isFound &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.queue.for_each(
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(index, element) {
                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (element &lt;/span&gt;&lt;span style="color: #000000;"&gt;!==&lt;/span&gt;&lt;span style="color: #000000;"&gt; undefined &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000;"&gt; element &lt;/span&gt;&lt;span style="color: #000000;"&gt;!==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;undefined&lt;/span&gt;&lt;span style="color: #000000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: #000000;"&gt; element.name &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; name) {
                    element.id &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; id;
                    element.replaceIfExists &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; replaceIfExists;
                    element.timeout &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; timeout;
                    element.code &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; code;
                    isFound &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
                }
            });
    }

    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Enqueue new task&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #000000;"&gt;!&lt;/span&gt;&lt;span style="color: #000000;"&gt;isFound &lt;/span&gt;&lt;span style="color: #000000;"&gt;||&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;!&lt;/span&gt;&lt;span style="color: #000000;"&gt;replaceIfExists) {
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.queue.nq(
            {
                id: id,
                name: name,
                replaceIfExists: replaceIfExists,
                timeout: timeout,
                code: code
            });
    }

    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; We have got new tasks, start the updater&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.startUpdater();

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; id;
},&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The following is the core part of the class which is the scheduler. Inside startUpdater, it executes the block of code in every interval we defined before. And inside the looping code, we check for if there is already any running task, if yes we check for the timeout whether it should make a good timeout or not. Otherwise we let it run as it was. However, if there is no running task at this moment, we dequeue a task and start executing the code and set a starting time for that to keep track of how long it is being running.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ca73c16b-189b-4e4e-8005-66e1353c8e9e" class="wlWriterSmartContent"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000;"&gt;detachTask: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(id) {
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.dq(id);
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.running_task &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.ms_when_last_call_made &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.ms_elapsed_since_last_call &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;;

    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; See if we are done with the queued tasks&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.queue.is_empty())
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.stopUpdater();
},

startUpdater: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() {
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; _self &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.timer_id &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;) {
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.timer_id &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; setInterval(
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() {
                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (_self.running_task &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;) {
                    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; We dont have any running task, lets make the first one&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;                    _self.running_task &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; _self.queue.dq();
                    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (_self.running_task &lt;/span&gt;&lt;span style="color: #000000;"&gt;!=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;) {
                        _self.ms_when_last_call_made &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Date().getTime();
                        _self.running_task.code();
                    }
                }
                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;else&lt;/span&gt;&lt;span style="color: #000000;"&gt; {
                    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; We have a running task already&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;                    _self.ms_elapsed_since_last_call &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Date().getTime() &lt;/span&gt;&lt;span style="color: #000000;"&gt;-&lt;/span&gt;&lt;span style="color: #000000;"&gt; _self.ms_when_last_call_made;

                    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Should the current task be skipped?&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;                    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (_self.ms_elapsed_since_last_call &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; _self.running_task.timeout)
                    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Time's up. leave the task alone. Let other tasks start executing.&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;                        _self.detachTask(_self.running_task.id);
                }
            }, _self.interval);
    }
},

stopUpdater: &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;() {
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.timer_id &lt;/span&gt;&lt;span style="color: #000000;"&gt;!=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;) {
        clearInterval(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.timer_id)
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.timer_id &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
    }

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;.queue &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; GenericQueue();
},&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;Keep an eye on my blog for continued development and improvements, and download CallQueue from: &lt;a href="http://code.msdn.microsoft.com/callqueue"&gt;http://code.msdn.microsoft.com/callqueue&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127221"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127221" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/127221.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax.aspx</guid>
            <pubDate>Wed, 19 Nov 2008 22:11:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/127221.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/11/19/callqueue-implementing-a-sequential-web-service-call-queue-for-ajax.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/127221.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/127221.aspx</trackback:ping>
        </item>
        <item>
            <title>My eye friendly Visual Studio dark theme</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/11/18/my-eye-friendly-visual-studio-dark-theme.aspx</link>
            <description>&lt;p&gt;I am not sure about how you guys feel about your IDE look &amp;amp; feel. First few years it was alright for me. However the more I used Visual Studio, the more I experienced problem with my eyes as well as monotony of the same old white background IDE. So, I made a dark theme of Visual Studio which stopped hurting my eyes again. I also tried to keep the syntax yet readable and make careful selection of colors so that important IDE benefits of syntax highlighting was not overlooked. I also tried to avoid absolutely black background, because that demands your eyes to have extra attention to the text since they were prepared to see nothing. So I choose deep navy blue so that it does not hurt your eyes as well as gives your eyes an impression that there may be few things on the screen to read. You may not find it friendly to your eyes, because I am kind of biased to Blue, since its my favorite. &lt;a target="_blank" href="http://tanzimsaqib.com/wp-content/uploads/2008/11/TanzimSaqib-DarkTheme.zip"&gt;You can download the theme from here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;C# View:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/MyeyefriendlyVisualStudiodarktheme_113D3/CSharp_4.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="CSharp" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/MyeyefriendlyVisualStudiodarktheme_113D3/CSharp_thumb_1.png" width="674" height="373" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;HTML View:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/MyeyefriendlyVisualStudiodarktheme_113D3/HTML_4.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="HTML" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/MyeyefriendlyVisualStudiodarktheme_113D3/HTML_thumb_1.png" width="675" height="390" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;XML View:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/MyeyefriendlyVisualStudiodarktheme_113D3/XML_4.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="XML" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/MyeyefriendlyVisualStudiodarktheme_113D3/XML_thumb_1.png" width="608" height="259" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Good thing about this theme is it only overrides your Text editor's Font and Color, all other settings of your Visual Studio will remain same. Before you apply this theme to your Visual Studio, you may want to export your current IDE settings, so that you can get back to your old one anytime. To export your current settings and look &amp;amp; feel, use Tools &amp;gt; Import &amp;amp; Export settings. Even if you forget to have a backup, you can reset your IDE settings through that Wizard and will get back Visual Studio factory settings. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127173"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127173" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/127173.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/11/18/my-eye-friendly-visual-studio-dark-theme.aspx</guid>
            <pubDate>Tue, 18 Nov 2008 16:09:05 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/127173.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/11/18/my-eye-friendly-visual-studio-dark-theme.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/127173.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/127173.aspx</trackback:ping>
        </item>
        <item>
            <title>Client Perspective of Windows Azure Services Platform</title>
            <category>.NET</category>
            <category>Azure</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/11/14/client-perspective-of-windows-azure-services-platform.aspx</link>
            <description>&lt;p&gt;Windows Azure was announced on PDC 2008 (Oct 27) and will hopefully be released mid next year. You probably already know about Azure by this time. If no, I would like to quote some from &lt;a target="_blank" href="http://www.azure.com"&gt;www.azure.com&lt;/a&gt; as intro: The Azure Services Platform is an internet-scale cloud computing and services platform hosted in Microsoft data centers. The Azure Services Platform provides a range of functionality to build applications that span from consumer web to enterprise scenarios and includes a cloud operating system and a set of developer services. Fully interoperable through the support of industry standards and web protocols such as REST and SOAP, you can use the Azure services individually or together, either to build new applications or to extend existing ones.&lt;/p&gt;  &lt;p&gt;Let us have a quick overview of the clients we usually use in our daily life, then we will explore the potential of Azure and what is waiting for us down to the road:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Windows Client&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Full capabilities, power, rich UI, high performance &lt;/li&gt;    &lt;li&gt;Ability to utilize local resources e.g. audio, camera. &lt;/li&gt;    &lt;li&gt;Capable of blending different hardware and software resulting in amazing applications &lt;/li&gt;    &lt;li&gt;Private data, reliable and fastest &lt;/li&gt;    &lt;li&gt;Personal, trusted and full control &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Web Client&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Data accessibility, availability &lt;/li&gt;    &lt;li&gt;Connect with devices, data services, friends &lt;/li&gt;    &lt;li&gt;Sociability, ability to share &lt;/li&gt;    &lt;li&gt;Interaction, collaboration, email, instant messaging &lt;/li&gt;    &lt;li&gt;Searchable &lt;/li&gt;    &lt;li&gt;Data security is questionable &lt;/li&gt;    &lt;li&gt;Open formats and standards for data exchange &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Mobile Client&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Low capability compared to regular PC horsepower &lt;/li&gt;    &lt;li&gt;Portable: palm reach &lt;/li&gt;    &lt;li&gt;Smart device while powered by web. e.g. Search for restaurants nearby &lt;/li&gt;    &lt;li&gt;Your 24/7 companion &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Smart Client&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Did we forget about Smart Clients? These applications are usually Windows Forms application which take all the advantages of Windows Client including offline storage, utilization of local resources as well as the goodness of internet connectivity. The Smart Client was coined few years ago, but for .NET developers all Windows Client is pretty much generally considered as Smart Clients. The idea behind Smart Client was to utilize full local computing capabilities and exploit the web's accessibility, availability and nature of openness through XML Web Services to developers build great software.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mesh&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;An important part of Live Services is Mesh, which enables developers to build application for consumer devices which are physically close to them. If you are at home you would be able to access through Windows Client, if you are on the go, you would be through Mobile Client, if you have Internet access only, you would be able to avail the service through Internet. Mesh allows us to get all those devices get connected, exchange data and stay synchronized. You can even add a Mac as device into Mesh to work with. Data communication among devices through Mesh is secured, since the data transferred between them are surely encrypted.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/image_6.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/image_thumb_2.png" width="459" height="270" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The following screenshots show how you can sync your local PC using Mesh and how your friends can share files or work on files you gave access them to:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/demo-howto-share-newpost_2.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="demo-howto-share-newpost" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/demo-howto-share-newpost_thumb.jpg" width="343" height="334" /&gt;&lt;/a&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/demo-howto-sync-addfolder_2.jpg"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="demo-howto-sync-addfolder" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/demo-howto-sync-addfolder_thumb.jpg" width="373" height="333" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Goodness of all Clients&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Windows Azure Services Platform is actually an array of technologies, consists of set of tools, and extremely scalable on demand powered by Microsoft datacenters and their ingenious virtualization technology. The core of this platform is to provide user with best experience taking the goodies of each client platform we use in our daily life. Combining the power of HTTP, XML, REST and WebServices Azure lets developers to build cloud enabled applications. The basic advantage of using open and standard protocol for communicating between clients is decreased dependency on the tools, languages or platform of the client. Client could be made by Ruby, Python or it could be in iPhone. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/image_3.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/7646c17f1155_1598/image_thumb.png" width="540" height="533" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Azure enables you to store your data in the cloud. No matter which client you used to work on your data, if you change your client, time-space, you will be able to get back to the same data once you worked on some other devices/OS.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why hosting cloud application with Microsoft?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Microsoft has 460 millions Live users to date backed up by hundreds of thousands of servers in their datacenters. How many times have you seen Microsoft's sites down? I have not seen many times in life. So, their ability to host, manage super scalable and high traffic websites is not questionable at all. Who else can be a better host of your next big application other than Microsoft?&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127019"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127019" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/127019.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/11/14/client-perspective-of-windows-azure-services-platform.aspx</guid>
            <pubDate>Fri, 14 Nov 2008 23:09:53 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/127019.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/11/14/client-perspective-of-windows-azure-services-platform.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/127019.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/127019.aspx</trackback:ping>
        </item>
        <item>
            <title>Cloudship: Membership Provider for the Cloud</title>
            <category>.NET</category>
            <category>Azure</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/11/14/cloudship-membership-provider-for-the-cloud.aspx</link>
            <description>&lt;p&gt;Planning to move to the Azure Cloud, but already tied to the Membership API? I have recently written an article on Windows Azure which guides you to build a complete Membership provider library which can be leveraged by existing application to link to Microsoft’s cloud platform Windows Azure with no friction. Goals of this project were to be able to use regular ASP.NET Login controls, existing Membership code e.g. Membersip.UpadateUser(), MembershipUser.ChangePassword().&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/CloudshipMembershipProviderfortheCloud_123C0/azure_inheritance_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="65" alt="azure_inheritance" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/CloudshipMembershipProviderfortheCloud_123C0/azure_inheritance_thumb.png" width="446" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Last, but not least one of the major goals was ease of use. No matter which suite of controls you use: ASP.NET AJAX or MVC, Cloudship can be leveraged as your Membership provider. To install it, into your existing application, simply: &lt;/p&gt;  &lt;p&gt;1. Reference the DLL    &lt;br /&gt;2. Insert few lines inside web.config     &lt;br /&gt;3. You are good to go &lt;/p&gt;  &lt;p&gt;In this article you will learn how to implement your own Membership API, thus you can start moving you application data to the Azure Cloud – the future of development and business with Microsoft. Here you go - &lt;a href="http://dotnetslackers.com/articles/aspnet/Azure-Cloudship-Membership-Provider-for-the-Cloud.aspx" target="_blank"&gt;Cloudship: Membership Provider for the Cloud&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127014"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=127014" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/127014.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/11/14/cloudship-membership-provider-for-the-cloud.aspx</guid>
            <pubDate>Fri, 14 Nov 2008 17:06:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/127014.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/11/14/cloudship-membership-provider-for-the-cloud.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/127014.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/127014.aspx</trackback:ping>
        </item>
        <item>
            <title>Building applications for Windows Azure</title>
            <category>.NET</category>
            <category>Azure</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/11/07/building-applications-for-windows-azure.aspx</link>
            <description>&lt;p&gt;Windows Azure is an upcoming operating system for the cloud from Microsoft, announced on October 27 at PDC. Windows Azure provides developers with on-demand compute and storage to host, scale, and manage Web applications on the Internet through Microsoft data centers. Azure goes beyond what other providers, such as Rackspace's Mosso or Amazon's EC2, offer. First, it will be available with a complete suite of tools and technologies for building your next big cloud application. Second, the Azure platform's goal is to support all developers and their choice of IDE, language, and technology; meaning that you can use your favorite tools for all kinds of development as well as Python, PHP, Ruby, Eclipse and so on. It supports popular standards and protocols including SOAP, REST, and XML. Using the Windows Azure tools, developers can build, debug, and deploy to Windows Azure directly from their existing development environment.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/BuildingapplicationsforWindowsAzure_100F/AzureTodolist_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="402" alt="AzureTodolist" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/BuildingapplicationsforWindowsAzure_100F/AzureTodolist_thumb_1.png" width="600" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I have written an article "&lt;a href="http://dotnetslackers.com/articles/aspnet/Building-applications-for-Windows-Azure.aspx" target="_blank"&gt;Building applications for Windows Azure&lt;/a&gt;" which will walk you through the steps to build an application from scratch on the recently released Windows Azure CTP, Microsoft’s answer to cloud computing. This application will let users add tasks into their Todolists and track them at a later time. The objective of this application is not to use any local data storage like SQL database. Instead, it will store and retrieve data from the cloud which means no matter which language/platform you write your application on, it will be able to access the data. For instance, if you would like to develop an iPhone application which will be able to play with your saved tasks on the go, you will be able to do so. Hope you will enjoy the article.&lt;/p&gt;  &lt;p&gt;Link: &lt;a href="http://dotnetslackers.com/articles/aspnet/Building-applications-for-Windows-Azure.aspx"&gt;http://dotnetslackers.com/articles/aspnet/Building-applications-for-Windows-Azure.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126839"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126839" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/126839.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/11/07/building-applications-for-windows-azure.aspx</guid>
            <pubDate>Fri, 07 Nov 2008 21:11:51 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/126839.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/11/07/building-applications-for-windows-azure.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/126839.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/126839.aspx</trackback:ping>
        </item>
        <item>
            <title>Fixing DevelopmentStorage's database cannot be found problem on Windows Azure</title>
            <category>.NET</category>
            <category>Azure</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure.aspx</link>
            <description>&lt;p&gt;This could be a common problem who are not using SQL Express. If you run an Azure application you may find it seeks for SQL Express instance in your machine if you do not have already. You may also find "An error occurred while processing this request." error due to this reason while you try creating tables from your models by StorageClient.TableStorage.CreateTablesFromModel. All you need to do is fire up Visual Studio and open the config file for DevelopmentStorage at C:\Program Files\Windows Azure SDK\v1.0\bin\DevelopmentStorage.exe.config. Now modify the connection string and the &lt;em&gt;dbServer&lt;/em&gt; attribute of the service tag for Table, and save.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:60e195b9-8fb7-4b65-9f23-724f7f136387" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: none;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;connectionStrings&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="DevelopmentStorageDbConnectionString"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;
         connectionString&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="Data Source=.\SQLEXPRESS;Initial Catalog=DevelopmentStorageDb;Integrated Security=True"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;
         providerName&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="System.Data.SqlClient"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;connectionStrings&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
  
  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;appSettings&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;    
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="ClientSettingsProvider.ServiceUri"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;=""&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;appSettings&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
  
  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;developmentStorageConfig&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;services&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;service &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="Blob"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;
               url&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="http://127.0.0.1:10000/"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;service &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="Queue"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;
               url&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="http://127.0.0.1:10001/"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;service &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;name&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="Table"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;
               url&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="http://127.0.0.1:10002/"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt;
               dbServer&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="localhost\SQLExpress"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;services&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    ...
&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;Restart Visual Studio and open up the Azure project again, now you should be able to run the DevelopmentStorage with the existing database installation of your PC.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126598"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126598" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/126598.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure.aspx</guid>
            <pubDate>Sat, 01 Nov 2008 14:00:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/126598.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/11/01/fixing-developmentstorages-database-cannot-be-found-problem-on-windows-azure.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/126598.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/126598.aspx</trackback:ping>
        </item>
        <item>
            <title>jQuery intellisense in Visual Studio</title>
            <category>JavaScript</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/10/28/jquery-intellisense-in-visual-studio.aspx</link>
            <description>&lt;p&gt;Those who are excited like me about the news of jQuery integration into Visual Studio, started adopting jQuery replacing ASP.NET AJAX Client side API. Microsoft also declared there will be a patch for Visual Studio which will support jQuery as well as intellisene for that. For the enthusiasts who just can't for it, here is the way how we can start developing using jQuery with full intellisense support inside Visual Studio 2008:&lt;/p&gt;  &lt;p&gt;1. Download &lt;a title="jquery-1.2.6-vsdoc.js" href="http://jqueryjs.googlecode.com/files/jquery-1.2.6-vsdoc.js"&gt;jquery-1.2.6-vsdoc.js&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Inside your JavaScript files, add a reference to it by placing the following line at the top of the JavaScript file:&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:75bfd113-eb5b-4d43-924d-27184b451c01" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;/ &amp;lt;reference path="jquery-1.2.6-vsdoc.js" /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;That's it. Enjoy!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126264"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126264" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/126264.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/10/28/jquery-intellisense-in-visual-studio.aspx</guid>
            <pubDate>Tue, 28 Oct 2008 14:21:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/126264.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/10/28/jquery-intellisense-in-visual-studio.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/126264.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/126264.aspx</trackback:ping>
        </item>
        <item>
            <title>Simple Form Validation - A Reflection based approach</title>
            <category>.NET</category>
            <category>C#</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/03/28/simple-form-validation---a-reflection-based-approach.aspx</link>
            <description>&lt;p&gt;Are you tired of placing multiple Validation controls on Form? If you are bored of following scenario like me, keep on reading the post:&lt;/p&gt; &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/53522d6d07ce_13B51/Validators_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="82" alt="Validators" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/53522d6d07ce_13B51/Validators_thumb.png" width="365" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;A simple Email address validation can consist of whether&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The field is empty  &lt;/li&gt;&lt;li&gt;Longer than limit  &lt;/li&gt;&lt;li&gt;Email address format is invalid  &lt;/li&gt;&lt;li&gt;Already in use&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Ordinary solution to this problem is placing multiple validation controls for a single TextBox. You can simply it by replacing all with a single Custom Validator. Our goal is to reduce amount of controls on the form to keep it simple. To do that, we would have to write code for Custom Validator that does it all. We also would like to write minimum code to validate the control without compromising manageability. Let us assume we would write the following code inside the ServerValidate of that control:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;protected void &lt;/span&gt;cvEmailAddress_ServerValidate(&lt;span style="color: blue"&gt;object &lt;/span&gt;source, &lt;span style="color: #2b91af"&gt;ServerValidateEventArgs &lt;/span&gt;args)
{
    &lt;span style="color: #2b91af"&gt;ValidationController&lt;/span&gt;.ValidateControl&amp;lt;&lt;span style="color: #2b91af"&gt;ProfileValidator&lt;/span&gt;&amp;gt;(cvEmailAddress, &lt;span style="color: #2b91af"&gt;ProfileValidator&lt;/span&gt;.&lt;span style="color: #2b91af"&gt;Fields&lt;/span&gt;.EmailAddress.ToString(), args);
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Let us declare a ValidationErrorResult object that contains error messages and text to display in the UI:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public sealed class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public string &lt;/span&gt;ErrorMessage { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
    &lt;span style="color: blue"&gt;public string &lt;/span&gt;Text { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;And an Attribute which would be used to tag a specific method which would be responsible for validation of particular control:&lt;/p&gt;&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;AttributeUsage&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;AttributeTargets&lt;/span&gt;.Method, Inherited = &lt;span style="color: blue"&gt;false&lt;/span&gt;, AllowMultiple = &lt;span style="color: blue"&gt;true&lt;/span&gt;)]
&lt;span style="color: blue"&gt;public sealed class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationMethodAttribute &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;Attribute
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public &lt;/span&gt;ValidationMethodAttribute(&lt;span style="color: blue"&gt;string &lt;/span&gt;fieldName)
    {
        &lt;span style="color: blue"&gt;this&lt;/span&gt;.FieldName = fieldName;
    }

    &lt;span style="color: blue"&gt;public string &lt;/span&gt;FieldName { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;private set&lt;/span&gt;; }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;If you are already familiar with Attirbute based programming, I hope you know the attribute of this piece of code is in fact &lt;span style="color: #2b91af"&gt;ValidationMethod&lt;/span&gt;. We will soon see how to use this. The following is the method that checks the value and make a list of &lt;span style="color: #2b91af"&gt;ValidationErrorResult &lt;/span&gt;that consists of which rules got failed. Notice that the &lt;span style="color: #2b91af"&gt;ValidationMethod&lt;/span&gt; attribute contains the field name of the object which determines no matter whatever your method name is, that field name helps Validation controller to find this method out for validation.&lt;/p&gt;&lt;pre class="code"&gt;[&lt;span style="color: #2b91af"&gt;ValidationMethod&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Email"&lt;/span&gt;)]
&lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;&amp;gt; ValidateEmail(&lt;span style="color: blue"&gt;object &lt;/span&gt;value)
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;email = value &lt;span style="color: blue"&gt;as string&lt;/span&gt;;
    &lt;span style="color: blue"&gt;var &lt;/span&gt;results = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;&amp;gt;();

    &lt;span style="color: green"&gt;// Blank
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;.IsNullOrEmpty(email))
        results.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;()
        {
            ErrorMessage = &lt;span style="color: #a31515"&gt;"You did not provide an Email Address."&lt;/span&gt;,
            Text = &lt;span style="color: #a31515"&gt;"Cannot be left blank"
        &lt;/span&gt;});

    &lt;span style="color: green"&gt;// Length 128
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(email.Length &amp;gt; 128)
        results.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;()
        {
            ErrorMessage = &lt;span style="color: #a31515"&gt;"You exceeded length limit."&lt;/span&gt;,
            Text = &lt;span style="color: #a31515"&gt;"Keep it less than 129 characters"
        &lt;/span&gt;});

    &lt;span style="color: green"&gt;// Valid Email Address
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(!&lt;span style="color: #2b91af"&gt;Regex&lt;/span&gt;.IsMatch(email, &lt;span style="color: #a31515"&gt;"^[\\w\\.\\-]+@[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]{1,})*(\\.[a-zA-Z]{2,3}){1,2}$"&lt;/span&gt;))
        results.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;()
        {
            ErrorMessage = &lt;span style="color: #a31515"&gt;"You provided an invalid Email Address."&lt;/span&gt;,
            Text = &lt;span style="color: #a31515"&gt;"Invalid Email Address"
        &lt;/span&gt;});

    &lt;span style="color: green"&gt;// Is Already In Use
    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(IsAlreadyInUse(email))
        results.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;()
        {
            ErrorMessage = &lt;span style="color: #a31515"&gt;"You provided an invalid Email Address."&lt;/span&gt;,
            Text = &lt;span style="color: #a31515"&gt;"Invalid Email Address"
        &lt;/span&gt;});

    &lt;span style="color: blue"&gt;return &lt;/span&gt;results;
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Here is the ValidationController which goes through the Validation class and looks for the method that has the attribute which validates the control's value.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ValidationController
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;&amp;gt; Validate&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;string &lt;/span&gt;fieldName, &lt;span style="color: blue"&gt;object &lt;/span&gt;value)
    {
        &lt;span style="color: blue"&gt;var &lt;/span&gt;results = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;&amp;gt;();
        &lt;span style="color: blue"&gt;var &lt;/span&gt;type = &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(T);
        &lt;span style="color: blue"&gt;var &lt;/span&gt;methods = type.GetMethods(BindingFlags.Static | BindingFlags.Public);

        &lt;span style="color: blue"&gt;var &lt;/span&gt;method = methods.Single&amp;lt;MethodInfo&amp;gt;(&lt;span style="color: blue"&gt;delegate&lt;/span&gt;(MethodInfo m)
        {
            &lt;span style="color: blue"&gt;return &lt;/span&gt;((&lt;span style="color: #2b91af"&gt;ValidationMethodAttribute&lt;/span&gt;[])m.GetCustomAttributes(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ValidationMethodAttribute&lt;/span&gt;), &lt;span style="color: blue"&gt;false&lt;/span&gt;))[0].FieldName == fieldName;
        });

        &lt;span style="color: blue"&gt;return &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ValidationErrorResult&lt;/span&gt;&amp;gt;)method.Invoke(&lt;span style="color: blue"&gt;null&lt;/span&gt;, &lt;span style="color: blue"&gt;new object&lt;/span&gt;[] { value });
    }

    &lt;span style="color: blue"&gt;public static void &lt;/span&gt;ValidateControl&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;CustomValidator &lt;/span&gt;validator, &lt;span style="color: blue"&gt;string &lt;/span&gt;fieldName, &lt;span style="color: #2b91af"&gt;ServerValidateEventArgs &lt;/span&gt;args)
    {
        &lt;span style="color: blue"&gt;var &lt;/span&gt;results = Validate&amp;lt;T&amp;gt;(fieldName, args.Value);

        &lt;span style="color: blue"&gt;if &lt;/span&gt;(!(args.IsValid = !(results.Count &amp;gt; 0)))
        {
            validator.ErrorMessage = results[0].ErrorMessage;
            validator.Text = results[0].Text;
        }
    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120892"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120892" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/120892.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/03/28/simple-form-validation---a-reflection-based-approach.aspx</guid>
            <pubDate>Fri, 28 Mar 2008 22:02:24 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/120892.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/03/28/simple-form-validation---a-reflection-based-approach.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/120892.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/120892.aspx</trackback:ping>
        </item>
        <item>
            <title>Use your personal blog with Windows Live Writer</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/03/02/use-your-personal-blog-with-windows-live-writer.aspx</link>
            <description>&lt;p&gt;I'm very glad to tell you that your ".NET Research" personal blog is compatible with &lt;a href="http://writer.live.com/" target="_blank"&gt;Windows Live Writer&lt;/a&gt;. You can compose, format, insert photos inside your posts offline and publish when you become online totally from this client without even opening the ".NET Research" site. Let us the steps to do this assuming you have properly installed Windows Live Writer.&lt;/p&gt; &lt;p&gt;Step 1. Run Windows Live Writer and Weblog &amp;gt; Add Weblog account..&lt;/p&gt; &lt;p&gt;Step 2. Choose another weblog service like the following screen and click Next:&lt;/p&gt; &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/UseyourpersonalblogwithWindowsLiveWriter_1CEC/Step2_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="270" alt="Step2" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/UseyourpersonalblogwithWindowsLiveWriter_1CEC/Step2_thumb.jpg" width="310" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Step 3. Now type &lt;a href="http://dotnetbd.org"&gt;http://dotnetbd.org&lt;/a&gt; as your Weblog Homepage URL, enter your credential like here I used as &lt;em&gt;admin&lt;/em&gt;:&lt;/p&gt; &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/UseyourpersonalblogwithWindowsLiveWriter_1CEC/Step3_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="271" alt="Step3" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/UseyourpersonalblogwithWindowsLiveWriter_1CEC/Step3_thumb.jpg" width="310" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Now Windows Live Writer will download some necessary files to work offline and will appear with a white blank screen for you to write your first post! That's it. These simple two steps will enable you to use this powerful tool to work with your ".NET Research" personal blog. Happy blogging!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120139"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120139" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/120139.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/03/02/use-your-personal-blog-with-windows-live-writer.aspx</guid>
            <pubDate>Mon, 03 Mar 2008 02:03:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/120139.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/03/02/use-your-personal-blog-with-windows-live-writer.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/120139.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/120139.aspx</trackback:ping>
        </item>
        <item>
            <title>LINQ to Flickr</title>
            <category>.NET</category>
            <category>C#</category>
            <category>LINQ</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/03/01/linq-to-flickr.aspx</link>
            <description>&lt;p&gt;One of my colleagues &lt;a href="http://weblogs.asp.net/mehfuzh"&gt;Mehfuz Hossain&lt;/a&gt; developed a wonderful open source project which allows you to query Flickr photos by LINQ, also lets you insert, delete photos directly to/from Flickr. You wonder how to extend LINQ in such an amazing way? It’s easy by writing your own custom LINQ provider, which was not-so-easy until he came up with another handy open source project named &lt;a href="http://www.codeplex.com/linqextender"&gt;LINQ Extender&lt;/a&gt;&lt;a href="http://www.codeplex.com/linqextender"&gt;&lt;/a&gt;. He did all the expression parsing stuff to ease our pain. Now you can make your own LINQ to Anything using this so easily.&lt;/p&gt; &lt;p&gt;For your heads up on LINQ extenders, here &lt;a href="http://dotnetslackers.com/articles/csharp/CreatingCustomLINQProviderUsingLinqExtender.aspx"&gt;he wrote an article&lt;/a&gt; and &lt;a href="http://www.codeplex.com/LINQFlickr"&gt;LINQ to Flickr&lt;/a&gt;, open source project is hosted at Codeplex.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120119"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120119" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/120119.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/03/01/linq-to-flickr.aspx</guid>
            <pubDate>Sun, 02 Mar 2008 04:08:11 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/120119.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/03/01/linq-to-flickr.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/120119.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/120119.aspx</trackback:ping>
        </item>
        <item>
            <title>A &amp;quot;transactional&amp;quot; generic DbHelper for LINQ to SQL</title>
            <category>.NET</category>
            <category>C#</category>
            <category>LINQ</category>
            <category>SQL</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/02/29/a-quottransactionalquot-generic-dbhelper-for-linq-to-sql.aspx</link>
            <description>&lt;p&gt;In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back to objects that you can work with in your own programming language. You may want to make a data access layer that separates the data operation from business layer like the following:&lt;/p&gt;&lt;pre&gt;DbHelper.Insert&amp;lt;Student&amp;gt;(
    new Student()
    {
        FirstName = “Tanzim”,
        LastName = “Saqib”,
        Email = “me@TanzimSaqib.com”,
        Website = “http://www.TanzimSaqib.com”&lt;/pre&gt;&lt;pre&gt;}, true);    // Use Transaction?&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;To make use of such transactional generic DbHelper, you might want to write a singeton DbHelper class like the following. You might notice that the class is singleton, it’s static and the DataContext is being used is private, and only initialized using the connection string if not yet.&lt;/p&gt;&lt;pre&gt;public static class DbHelper
{
    private const string CONNECTION_CONFIG_NAME = “StudentServerConnectionString”;

    private static StudentServerDataContext _StudentServerDataContext = null;

    public static StudentServerDataContext GetDataContext()
    {
        if(_StudentServerDataContext == null)
            _StudentServerDataContext = new StudentServerDataContext
                (ConfigurationManager.ConnectionStrings
                [CONNECTION_CONFIG_NAME].ConnectionString);

        return _StudentServerDataContext;
    }

    public static void CleanUp()
    {
        _StudentServerDataContext.Dispose();
        _StudentServerDataContext = null;
    }

    // … code edited to save space&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;On application wide error or on end you can dispose the context so CleanUp method is useful here. To implement an Insert method see the following. You will find I have used a TransactionScope which ensures that the transaction is taking place without any interruption. If there is really any error the scope.Complete() method never gets invoked. This is how it ensures that the code inside the TransactionScope is taking place as a transaction. It is available from .NET 2.0 framework.&lt;/p&gt;&lt;pre&gt;public static void Insert&amp;lt;T&amp;gt;(T t, bool isTransactional) where T : class
{
    if (isTransactional)
    {
        using (var scope = new TransactionScope())
        {
            Insert&amp;lt;T&amp;gt;(t);

            // On any Exception, Complete() method won’t be invoked.
            // So, the transaction will be automatically rollbacked.
            scope.Complete();
        }
    }
    else
        Insert&amp;lt;T&amp;gt;(t);
}

public static void Insert&amp;lt;T&amp;gt;(T t) where T : class
{
    using (var db = GetDataContext())
    {
        db.GetTable&amp;lt;T&amp;gt;().InsertOnSubmit(t);

        try
        {
            db.SubmitChanges();
        }
        catch (Exception e)
        {
            // TODO: log Exception
            throw e;
        }
    }
}&lt;/pre&gt;
&lt;p&gt;I did not show other methods as part of the CRUD implementation. The rest is left open for you to implement.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120075"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120075" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/120075.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/02/29/a-quottransactionalquot-generic-dbhelper-for-linq-to-sql.aspx</guid>
            <pubDate>Fri, 29 Feb 2008 14:29:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/120075.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/02/29/a-quottransactionalquot-generic-dbhelper-for-linq-to-sql.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/120075.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/120075.aspx</trackback:ping>
        </item>
        <item>
            <title>[New Article] 7 ways to do Performance Optimization of an ASP.NET 3.5 Web 2.0 portal</title>
            <link>http://geekswithblogs.net/Saqib/archive/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an.aspx</link>
            <description>&lt;p&gt;Web 2.0 applications are widely developed. These applications often work with third party contents, aggregate them, make various use of them and then make something useful and meaningful to the users. For the past few years, developers were also engaged with such endeavors and a lot of their websites have not addressed performance issues, thus resulting in an unpleasant experience to the users.&lt;/p&gt; &lt;p&gt;Performance is a vast area and great results can never be achieved by a silver bullet. &lt;a href="http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx" target="_blank"&gt;This article&lt;/a&gt; explores some of the key performance issues that can occur while developing a Web 2.0 portal using server side multithreading and caching. It also demonstrates model driven application development using Windows Workflow Foundation. &lt;/p&gt; &lt;p&gt;URL: &lt;a title="http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx" href="http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx"&gt;http://dotnetslackers.com/articles/aspnet/SevenWaysToDoPerformanceOptimizationOfAnASPNET35Web20Portal.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119292"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119292" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119292.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an.aspx</guid>
            <pubDate>Tue, 05 Feb 2008 17:27:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119292.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/02/05/new-article-7-ways-to-do-performance-optimization-of-an.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119292.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119292.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Avoid using Array.length in a loop</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-avoid-using-array.length-in-a-loop.aspx</link>
            <description>&lt;p&gt;In one of my earlier posts, I talked about DOM element accessing in a loop but forgot to talk about a very common, yet performance issue in AJAX. We often use code like the following:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;items = []; &lt;span style="color: green"&gt;// Suppose a very long array 
&lt;/span&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;items.length; ++i)
    ; &lt;span style="color: green"&gt;// Some actions&lt;/span&gt;&lt;/pre&gt;It can be a severe performance issue if the array is so large. JavaScript is an interpreted language, so when interpreter executes code line by line, every time it checks the condition inside the loop, you end up accessing the length property every time. Where it is applicable, if the contents of the array does not need to be changed during the loop's execution, there is no necessity to access the length property every time. Take out the length in a variable and use in every iteration: &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;items = []; &lt;span style="color: green"&gt;// Suppose a very long array 
&lt;/span&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;count = items.length;
&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
    ; &lt;span style="color: green"&gt;// Some actions&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119178"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119178" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119178.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-avoid-using-array.length-in-a-loop.aspx</guid>
            <pubDate>Thu, 10 Jan 2008 12:52:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119178.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-avoid-using-array.length-in-a-loop.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119178.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119178.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Careful with DOM element concatenation</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/02/05/asp.net-ajax-best-practices-careful-with-dom-element-concatenation.aspx</link>
            <description>&lt;p&gt;It's a very common bad practice. We often iterate through array, build HTML contents and keep on concatenating into certain DOM element. Every time you execute the block of code under the loop, you create the HTML markups, discover a div, access the innerHTML of a div, and for += operator you again discover the same div, access its innerHTML and concatenate it before assigning. &lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;pageLoad()
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;links = [&lt;span style="color: #a31515"&gt;"microsoft.com"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"tanzimsaqib.com"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"asp.net"&lt;/span&gt;];
    
    $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;).innerHTML = &lt;span style="color: #a31515"&gt;'The following are my favorite sites:'
    
    &lt;/span&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;links.length; ++i)
        $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;).innerHTML += &lt;span style="color: #a31515"&gt;'&amp;lt;a href="http://www.' &lt;/span&gt;+ links[i] + &lt;span style="color: #a31515"&gt;'"&amp;gt;http://www.' &lt;/span&gt;+ links[i] + &lt;span style="color: #a31515"&gt;'&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;'&lt;/span&gt;;
}  &lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;However, as you know accessing DOM element is one the costliest operation in JavaScript. So, it's wise to concatenate all HTML contents in a string and finally assign to the DOM element. That saves a lot of hard work for the browser.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;pageLoad()
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;links = [&lt;span style="color: #a31515"&gt;"microsoft.com"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"tanzimsaqib.com"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"asp.net"&lt;/span&gt;];
    &lt;span style="color: blue"&gt;var &lt;/span&gt;content = &lt;span style="color: #a31515"&gt;'The following are my favorite sites:'
    
    &lt;/span&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;links.length; ++i)
        content += &lt;span style="color: #a31515"&gt;'&amp;lt;a href="http://www.' &lt;/span&gt;+ links[i] + &lt;span style="color: #a31515"&gt;'"&amp;gt;http://www.' &lt;/span&gt;+ links[i] + &lt;span style="color: #a31515"&gt;'&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;'&lt;/span&gt;;
        
    $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;).innerHTML = content;
}  &lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119177"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119177" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119177.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/02/05/asp.net-ajax-best-practices-careful-with-dom-element-concatenation.aspx</guid>
            <pubDate>Tue, 05 Feb 2008 12:51:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119177.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/02/05/asp.net-ajax-best-practices-careful-with-dom-element-concatenation.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119177.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119177.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Use more &amp;quot;var&amp;quot;</title>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-use-more-quotvarquot.aspx</link>
            <description>&lt;p&gt;Less use of "var" can result into wrong calculation as well as mistake in logic control. And also JavaScript interpreter finds it hard to determine the scope of the variable if var is not used. Consider the following simple JavaScript code:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;pageLoad()
{
    i = 10;
    loop();
    alert(i);   &lt;span style="color: green"&gt;// here, i = 100
&lt;/span&gt;}

&lt;span style="color: blue"&gt;function &lt;/span&gt;loop()
{
    &lt;span style="color: blue"&gt;for&lt;/span&gt;(i=0; i&amp;lt;100; ++i)
    {
        &lt;span style="color: green"&gt;// Some actions
    &lt;/span&gt;}
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Here you see, the loop uses the variable i used before in pageLoad. So, it brings a wrong result. Unlike .NET code, in JavaScript variables can go along with the method calls. So, better not confuse the interpreter by using more "var" in your code:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;pageLoad()
{
    &lt;span style="color: blue"&gt;&lt;strong&gt;var&lt;/strong&gt; &lt;/span&gt;i = 10;
    loop();
    alert(i);   &lt;span style="color: green"&gt;// here, i = 10
&lt;/span&gt;}

&lt;span style="color: blue"&gt;function &lt;/span&gt;loop()
{
    &lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;&lt;strong&gt;var&lt;/strong&gt; &lt;/span&gt;i=0; i&amp;lt;100; ++i)
    {
        &lt;span style="color: green"&gt;// Some actions
    &lt;/span&gt;}
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119176"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119176" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119176.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-use-more-quotvarquot.aspx</guid>
            <pubDate>Thu, 10 Jan 2008 12:50:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119176.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-use-more-quotvarquot.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119176.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119176.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Introduce DOM elements and function caching</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/11/asp.net-ajax-best-practices-introduce-dom-elements-and-function-caching.aspx</link>
            <description>&lt;p&gt;&lt;/p&gt;We have seen DOM caching before and function delegation is also a kind of function caching. Take a look at the following snippet: &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
    $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;).appendChild(elements[i]); &lt;/pre&gt;As you can figure out the code is going to be something like: &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;divContent = $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;);
    
&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
    divContent.appendChild(elements[i]); &lt;/pre&gt;That is fine, but you can also cache browser function like &lt;code&gt;appendChild&lt;/code&gt;. So, the ultimate optimization will be like the following: &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;divContentAppendChild = $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;).appendChild;
    
&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
    divContentAppendChild(elements[i]);   &lt;/pre&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119175"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119175" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119175.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/11/asp.net-ajax-best-practices-introduce-dom-elements-and-function-caching.aspx</guid>
            <pubDate>Fri, 11 Jan 2008 12:48:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119175.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/11/asp.net-ajax-best-practices-introduce-dom-elements-and-function-caching.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119175.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119175.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Introduce function delegates</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/12/asp.net-ajax-best-practices-introduce-function-delegates.aspx</link>
            <description>&lt;p&gt;Take a look at the following loop. This loop calls a function in each iteration and the function does some stuffs. Can you think of any performance improvement idea?&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
    processElement(elements[i]);&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Well, for sufficiently large array, function delegates may result in significant performance improvement to the loop.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;delegate = processElement;
    
&lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
    delegate(elements[i]);&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;The reason behind performance improvement is, JavaScript interpreter will use the function as local variable and will not lookup in its scope chain for the function body in each iteration.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119174"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119174" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119174.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/12/asp.net-ajax-best-practices-introduce-function-delegates.aspx</guid>
            <pubDate>Sat, 12 Jan 2008 12:46:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119174.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/12/asp.net-ajax-best-practices-introduce-function-delegates.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119174.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119174.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Avoid String concatenation, use Array instead</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/15/asp.net-ajax-best-practices-avoid-string-concatenation-use-array-instead.aspx</link>
            <description>&lt;p&gt;Don't you think the following block of code has written keeping every possible good practice in mind? Any option for performance improvement?&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;pageLoad()
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;stringArray = &lt;span style="color: blue"&gt;new &lt;/span&gt;Array();
    
    &lt;span style="color: green"&gt;// Suppose there're a lot of strings in the array like:
    &lt;/span&gt;stringArray.push(&lt;span style="color: #a31515"&gt;'&amp;lt;div&amp;gt;'&lt;/span&gt;);
    stringArray.push(&lt;span style="color: #a31515"&gt;'some content'&lt;/span&gt;);
    stringArray.push(&lt;span style="color: #a31515"&gt;'&amp;lt;/div&amp;gt;'&lt;/span&gt;);
    
    &lt;span style="color: green"&gt;// ... code edited to save space
    
    &lt;/span&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;veryLongHtml = $get(&lt;span style="color: #a31515"&gt;'divContent'&lt;/span&gt;).innerHTML;
    &lt;span style="color: blue"&gt;var &lt;/span&gt;count = stringArray.length;
    
    &lt;span style="color: blue"&gt;for&lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;i=0; i&amp;lt;count; ++i)
        veryLongHtml += stringArray[i];    
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Well, as you see the &lt;code&gt;innerHTML &lt;/code&gt;of the div has been cached so that browser will not have to access the DOM every time while iterating through &lt;code&gt;stringArray&lt;/code&gt;, thus costlier DOM methods are being avoided. But, inside the body of the loop the JavaScript interpreter has to perform the following operation:&lt;/p&gt;&lt;pre class="code"&gt;veryLongHtml = veryLongHtml + stringArray[i];&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;And the veryLongHtml contains quite a large string which means in this operation the interpreter will have to retrieve the large string and then concatenate with the stringArray elements in every iteration. One very short yet efficient solution to this problem is using join method of the array like the following, instead of looping through the array:&lt;/p&gt;&lt;pre class="code"&gt;veryLongHtml = stringArray.join(&lt;span style="color: #a31515"&gt;''&lt;/span&gt;); &lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;However, this is very efficient than the one we were doing, since it joins the array with smaller strings which requires less memory.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119173"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119173" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119173.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/15/asp.net-ajax-best-practices-avoid-string-concatenation-use-array-instead.aspx</guid>
            <pubDate>Tue, 15 Jan 2008 12:44:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119173.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/15/asp.net-ajax-best-practices-avoid-string-concatenation-use-array-instead.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119173.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119173.aspx</trackback:ping>
        </item>
        <item>
            <title>Write your own DOM friendly extension methods for HtmlElement in Volta</title>
            <category>Volta</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/29/write-your-own-dom-friendly-extension-methods-for-htmlelement-in.aspx</link>
            <description>&lt;p&gt;I know there are &lt;strong&gt;GetById&lt;/strong&gt;, &lt;strong&gt;GetById&amp;lt;&amp;gt;&lt;/strong&gt; methods in Document object. But, I often miss a method that I feel should be in Volta, which iterates through its child nodes and find an element for me. Let us say, there is a HTML like the following:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="divContainer"&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;b&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Some text&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;b&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="firstDiv"&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;i&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Some more text&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;i&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;="secondDiv"&amp;gt;
        &lt;/span&gt;Okay, I gotta go now
    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;div &lt;/span&gt;&lt;span style="color: red"&gt;anyAttribute&lt;/span&gt;&lt;span style="color: blue"&gt;="anyValue"&amp;gt;
        &lt;/span&gt;Babye
    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;div&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;The most important thing is, I can not get the last div by Document.&lt;strong&gt;GetById&lt;/strong&gt;, because instead of id I chose &lt;strong&gt;anyAttribute&lt;/strong&gt;. So, I wrote my own extension method which can run into not only Div but also any &lt;strong&gt;HtmlElement&lt;/strong&gt;, and can find me the desired &lt;strong&gt;HtmlElement&lt;/strong&gt; inside the prior one with the &lt;strong&gt;anyAttribute&lt;/strong&gt; and &lt;strong&gt;anyValue&lt;/strong&gt;. To make my intention clear, I'd like to show how I'd like to use that extension method: &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;divContainer = Document.GetById&amp;lt;&lt;span style="color: #2b91af"&gt;Div&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"divContainer"&lt;/span&gt;);
&lt;span style="color: blue"&gt;var &lt;/span&gt;anyDiv = divContainer.Find&amp;lt;&lt;span style="color: #2b91af"&gt;Div&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"anyAttribute"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"anyValue"&lt;/span&gt;);

&lt;span style="color: blue"&gt;if&lt;/span&gt;(anyDiv != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
    anyDiv.InnerHtml += &lt;span style="color: #a31515"&gt;"guys!"&lt;/span&gt;;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;So, I'd like to call my extension method &lt;strong&gt;Find&amp;lt;&amp;gt;&lt;/strong&gt; which will take the type I'm looking for (in this case a Div) and that &lt;strong&gt;HtmlElement&lt;/strong&gt; should have an attribute "&lt;strong&gt;anyAttribute&lt;/strong&gt;" that contains "&lt;strong&gt;anyValue&lt;/strong&gt;". Here is how I make up the extension method: &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HtmlExtensions
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public static &lt;/span&gt;T Find&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;T parent, &lt;span style="color: blue"&gt;string &lt;/span&gt;attribute, &lt;span style="color: blue"&gt;string &lt;/span&gt;value)
        &lt;span style="color: blue"&gt;where &lt;/span&gt;T : &lt;span style="color: #2b91af"&gt;HtmlElement
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;var &lt;/span&gt;element = parent.FirstChild; 

        &lt;span style="color: blue"&gt;while&lt;/span&gt;(element != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
            &lt;span style="color: blue"&gt;if &lt;/span&gt;(element.IsProper&amp;lt;T&amp;gt;(attribute, value))
                &lt;span style="color: blue"&gt;return &lt;/span&gt;element &lt;span style="color: blue"&gt;as &lt;/span&gt;T;
            &lt;span style="color: blue"&gt;else
                &lt;/span&gt;element = element.NextSibling; 

        &lt;span style="color: blue"&gt;return null&lt;/span&gt;;
    }

    &lt;span style="color: blue"&gt;public static bool &lt;/span&gt;IsProper&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;DomNode &lt;/span&gt;element, &lt;span style="color: blue"&gt;string &lt;/span&gt;attribute, &lt;span style="color: blue"&gt;string &lt;/span&gt;value)
        &lt;span style="color: blue"&gt;where &lt;/span&gt;T : &lt;span style="color: #2b91af"&gt;HtmlElement
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(element.GetType() == &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(T) &amp;amp;&amp;amp;
            element.Attributes != &lt;span style="color: blue"&gt;null &lt;/span&gt;&amp;amp;&amp;amp;
            element.Attributes.GetNamedItem(attribute) != &lt;span style="color: blue"&gt;null &lt;/span&gt;&amp;amp;&amp;amp;
            element.Attributes.GetNamedItem(attribute).Value == value)

            &lt;span style="color: blue"&gt;return true&lt;/span&gt;;

        &lt;span style="color: blue"&gt;return false&lt;/span&gt;;
    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;This method can iterate only one depth. Multi depth implementation can be done by running a simple DFS which is left to you guys. Note one thing, I have called one extension method "&lt;strong&gt;IsProper&lt;/strong&gt;" inside another extension method, and there is no harm in it. So, this is how you can add your own extension methods to the &lt;strong&gt;HtmlElement&lt;/strong&gt;.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119172"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119172" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/119172.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/29/write-your-own-dom-friendly-extension-methods-for-htmlelement-in.aspx</guid>
            <pubDate>Tue, 29 Jan 2008 12:39:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/119172.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/29/write-your-own-dom-friendly-extension-methods-for-htmlelement-in.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/119172.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/119172.aspx</trackback:ping>
        </item>
        <item>
            <title>Appearing on Microsoft Volta team blog</title>
            <category>Volta</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/27/appearing-on-microsoft-volta-team-blog.aspx</link>
            <description>&lt;p&gt;Microsoft Volta team blogged about me and one of my articles: &lt;a href="http://labs.live.com/volta/blog/Volta+How+To+Flickr+Widget.aspx" target="_blank"&gt;http://labs.live.com/volta/blog/Volta+How+To+Flickr+Widget.aspx&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/AppearingonMicrosoftVoltateamblog_37C4/VoltaTeamBlog_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="193" alt="VoltaTeamBlog" src="http://geekswithblogs.net/images/geekswithblogs_net/Saqib/WindowsLiveWriter/AppearingonMicrosoftVoltateamblog_37C4/VoltaTeamBlog_thumb.png" width="563" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118950"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118950" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/118950.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/27/appearing-on-microsoft-volta-team-blog.aspx</guid>
            <pubDate>Sun, 27 Jan 2008 10:00:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/118950.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/27/appearing-on-microsoft-volta-team-blog.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/118950.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/118950.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Reduce scopes</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/06/asp.net-ajax-best-practices-reduce-scopes.aspx</link>
            <description>&lt;p&gt;It's not pretty common. But, if you ever encounter such code, be sure it's a very bad practice. Introducing more scopes is a performance issue for JavaScript interpreter. It adds a new scope in the ladder. See the following sample scope:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;pageLoad()
{
    scope1();
    &lt;span style="color: blue"&gt;function &lt;/span&gt;scope1()
    {
        alert(&lt;span style="color: #a31515"&gt;'scope1'&lt;/span&gt;);
        scope2();
        
        &lt;span style="color: blue"&gt;function &lt;/span&gt;scope2()
        {
            alert(&lt;span style="color: #a31515"&gt;'scope2'&lt;/span&gt;);
        }
    }
}    &lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Introducing more scopes enforces the interpreter to go through new more sections in the scope chain that it maintains for code execution. So, unnecessary scopes reduce performance and it's a bad design too.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118945"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118945" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/118945.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/06/asp.net-ajax-best-practices-reduce-scopes.aspx</guid>
            <pubDate>Mon, 07 Jan 2008 01:44:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/118945.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/06/asp.net-ajax-best-practices-reduce-scopes.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/118945.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/118945.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Problem with switch</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-problem-with-switch.aspx</link>
            <description>&lt;p&gt;Unlike .NET languages or any other compiler languages, JavaScript interpreter can not optimize switch block. Especially when switch statement is used with different types of data, it's a heavy operation for the browser due to conversion operations occur in consequences, it's an elegant way of decision branching though.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118944"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118944" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/118944.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-problem-with-switch.aspx</guid>
            <pubDate>Fri, 11 Jan 2008 01:26:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/118944.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/10/asp.net-ajax-best-practices-problem-with-switch.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/118944.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/118944.aspx</trackback:ping>
        </item>
        <item>
            <title>[New Article] ASP.NET AJAX Best Practices</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/27/new-article-asp.net-ajax-best-practices.aspx</link>
            <description>&lt;p&gt;While we develop AJAX applications, we often carelessly ignore giving up bad practices, which cause effects which are not so significantly visible when the site is not so large in volume. But, it’s often severe performance issue when it is the case for sites that make heavy use of AJAX technologies such as Pageflakes, NetVibes etc.  &lt;/p&gt;&lt;p&gt;There are so many AJAX widgets in one page that little memory leak issues combined may even result the site crash into very nasty “Operation aborted”. There are a lot of WebService calls, lot of iterations among collection so that inefficient coding in a whole lead to make site very heavy, browser eats up a lot of memory, requires very costly CPU cycles, and ultimately causes unsatisfactory user experience. In this article many of such issues are demonstrated in the context of ASP.NET AJAX.  &lt;/p&gt;&lt;p&gt;&lt;a title="http://www.codeproject.com/KB/ajax/AspNetAjaxBestPractices.aspx" href="http://www.codeproject.com/KB/ajax/AspNetAjaxBestPractices.aspx" target="_blank"&gt;http://www.codeproject.com/KB/ajax/AspNetAjaxBestPractices.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118943"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118943" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/118943.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/27/new-article-asp.net-ajax-best-practices.aspx</guid>
            <pubDate>Sun, 27 Jan 2008 07:21:33 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/118943.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/27/new-article-asp.net-ajax-best-practices.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/118943.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/118943.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Avoid getters, setters</title>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/08/asp.net-ajax-best-practices-avoid-getters-setters.aspx</link>
            <description>&lt;p&gt;Make minimum use of setters and getters if possible. Such accessors look like .NET like kind of beautiful properties, but these create new more scopes for JavaScript interpreter to deal with. If applicable, try directly setting/getting the private variable itself rather implementing methods for getters, setters.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118938"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118938" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/118938.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/08/asp.net-ajax-best-practices-avoid-getters-setters.aspx</guid>
            <pubDate>Tue, 08 Jan 2008 20:08:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/118938.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/08/asp.net-ajax-best-practices-avoid-getters-setters.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/118938.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/118938.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET AJAX Best Practices: Avoid using your own method while there is one</title>
            <category>JavaScript</category>
            <category>Performance</category>
            <link>http://geekswithblogs.net/Saqib/archive/2008/01/06/asp.net-ajax-best-practices-avoid-using-your-own-method-while.aspx</link>
            <description>&lt;p&gt;Avoid implementing your own getElementById method that will cause script to DOM marshalling overhead. Each time you traverse the DOM and look for certain HTML element requires the JavaScript interpreter to marshalling script to DOM. It's always better to use getElementById of document object. So, before you write a function, make sure similar functionality can be achieved from some other built-in functions.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118936"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118936" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Saqib/aggbug/118936.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tanzim Saqib</dc:creator>
            <guid>http://geekswithblogs.net/Saqib/archive/2008/01/06/asp.net-ajax-best-practices-avoid-using-your-own-method-while.aspx</guid>
            <pubDate>Sun, 06 Jan 2008 14:11:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Saqib/comments/118936.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Saqib/archive/2008/01/06/asp.net-ajax-best-practices-avoid-using-your-own-method-while.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Saqib/comments/commentRss/118936.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Saqib/services/trackbacks/118936.aspx</trackback:ping>
        </item>
    </channel>
</rss>