<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ruchit Surati&#039;s blog</title>
	<atom:link href="http://www.ruchitsurati.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ruchitsurati.net</link>
	<description>thoughts and ideas of a .net developer</description>
	<lastBuildDate>Sat, 31 Jul 2010 07:04:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>understanding ‘using’ block in C#</title>
		<link>http://www.ruchitsurati.net/index.php/2010/07/28/understanding-%e2%80%98using%e2%80%99-block-in-c/</link>
		<comments>http://www.ruchitsurati.net/index.php/2010/07/28/understanding-%e2%80%98using%e2%80%99-block-in-c/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 16:46:47 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[net-framework]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/?p=422</guid>
		<description><![CDATA[using block in C# comes very handly while dealing with disposable objects. Disposable objects are those objects that can explicitly release the resources they use when called to dispose. As we know .Net garbage collection is non-deterministic so you can&#8217;t predict when exactly the object will be garbage collected. Many times we need to make [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">using block in C# comes very handly while dealing with <em>disposable</em> objects. Disposable objects are those objects that can explicitly release the resources they use when called to dispose. As we know .Net garbage collection is non-deterministic so you can&#8217;t predict when exactly the object will be garbage collected. Many times we need to make sure the object is disposed along with all the resources it uses immediately after the purpose is served. This becomes possible with using block. <em>using </em>block in C# lets you deal with <em>disposable</em> objects effectively. But how does it work ? <strong>How does using block ensure the object is immediately disposed after the scope of the using block?</strong></p>
<p style="text-align: justify;">Lets look at what MSDN has to say. As per the msdn</p>
<blockquote style="text-align: justify;"><p><em>using</em> block Defines a scope, outside of which an object or objects will be disposed.</p></blockquote>
<p style="text-align: justify; clear: both;"><em>The using statement allows the programmer to specify when objects that use resources should release them. The object provided to the using  statement must implement the IDisposable  interface. This interface provides the Dispose  method, which should release the object&#8217;s resources.</em></p>
<p style="text-align: justify;">Surprisingly even MSDN does not clarify how does this happen under the hood. It only says the object has to implement <em>IDisposable </em>interface that provides <em>Dispose </em>method on the object implementing the interface.  So to dispose the object it will need to call the Dispose method on the object which will cleanup and release the resources used by the object.</p>
<p style="text-align: justify;">This led me to write some code and analyze the generated IL where I found the answers. Have a look at this code. I&#8217;ve written a class <em>Car </em>and made it <em>IDisposable </em>so that I can club its&#8217; lifetime with <em>using</em> block.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlogSamples
{
    public class Car : IDisposable
    {
        public Car(int id)
        {
            this.Id = id;
        }

        public int Id { get; set; }

        public void Run()
        {
            Console.WriteLine(&quot;Car {0} is running.&quot;, this.Id.ToString());
        }

        #region IDisposable Members

        public void Dispose()
        {
            Console.WriteLine(&quot;Releasing resources used by Car object : &quot; + this.Id.ToString());
        }

        #endregion
    }
}
</pre>
<p style="text-align: justify;">Here&#8217;s my client-code. A sample ConsoleApplication that uses the Car object within the using block.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlogSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            using (Car myCar = new Car(1))
            {
                myCar.Run();
            }
        }
    }
}
</pre>
<p style="text-align: justify;">The output was obvious. Immediately after the using block the Dispose method of the Car object is called. Note that there are no signs of Dispose() method being called explicitly, still the method is called. Lets look at the generated IL.</p>
<pre class="brush: csharp;">
.method private hidebysig static void  Main(string[] args) cil managed
{
  .entrypoint
  // Code size       37 (0x25)
  .maxstack  2
  .locals init ([0] class BlogSamples.Car myCar,
           [1] bool CS$4$0000)
  IL_0000:  nop
  IL_0001:  ldc.i4.1
  IL_0002:  newobj     instance void BlogSamples.Car::.ctor(int32)
  IL_0007:  stloc.0
  .try
  {
    IL_0008:  nop
    IL_0009:  ldloc.0
    IL_000a:  callvirt   instance void BlogSamples.Car::Run()
    IL_000f:  nop
    IL_0010:  nop
    IL_0011:  leave.s    IL_0023
  }  // end .try
  finally
  {
    IL_0013:  ldloc.0
    IL_0014:  ldnull
    IL_0015:  ceq
    IL_0017:  stloc.1
    IL_0018:  ldloc.1
    IL_0019:  brtrue.s   IL_0022
    IL_001b:  ldloc.0
    IL_001c:  callvirt   instance void [mscorlib]System.IDisposable::Dispose()
    IL_0021:  nop
    IL_0022:  endfinally
  }  // end handler
  IL_0023:  nop
  IL_0024:  ret
} // end of method Program::Main
</pre>
<p style="text-align: justify;">Do you spot that compiler has introduced <em>try/finally</em> block and replaced it with <em>using </em>block. But why did compiler do that ? Lets observe the code and attempt to write similar C# code for better understanding. After careful analysis and reverse-engineering the equivalent C# code would look something as following.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlogSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            //Declare myCar object with FullName of the type as seen in IL.
            BlogSamples.Car myCar;

            //Instantiate the object by calling the constructor, matching the flow of IL.
            myCar = new Car(1);

            try
            {
                myCar.Run();
            }
            finally
            {
                if(myCar != null)
                    myCar.Dispose();
            }
        }
    }
}
</pre>
<p style="text-align: justify;">Above code is very clear. All it does is replace the code within the using block into the try block and calls the Dispose() method of the object in the finally block. As we all know, the code written in finally block gets executed in any situation even in case of any handled or un-handled exception. And this is how the using block ensures that the objects used with the using block are disposed for sure.</p>
<blockquote><p>In fact using block is just a syntactic sugar for this pattern of code.</p></blockquote>
<p style="text-align: justify; clear: both;">
<p>Some of you might wonder, how does the generated IL of the new reverse-engineered code look like. The IL of the reverse-engineered looks like this.</p>
<pre class="brush: csharp;">
.method private hidebysig static void  Main(string[] args) cil managed
{
  .entrypoint
  // Code size       31 (0x1f)
  .maxstack  2
  .locals init ([0] class BlogSamples.Car myCar)
  IL_0000:  nop
  IL_0001:  ldc.i4.1
  IL_0002:  newobj     instance void BlogSamples.Car::.ctor(int32)
  IL_0007:  stloc.0
  .try
  {
    IL_0008:  nop
    IL_0009:  ldloc.0
    IL_000a:  callvirt   instance void BlogSamples.Car::Run()
    IL_000f:  nop
    IL_0010:  nop
    IL_0011:  leave.s    IL_001d
  }  // end .try
  finally
  {
    IL_0013:  nop
    IL_0014:  ldloc.0
    IL_0015:  callvirt   instance void BlogSamples.Car::Dispose()
    IL_001a:  nop
    IL_001b:  nop
    IL_001c:  endfinally
  }  // end handler
  IL_001d:  nop
  IL_001e:  ret
} // end of method Program::Main
</pre>
<blockquote><p>Needless to mention that the IL in both the cases is identical to each other which proves the point that the using block is nothing but a syntactic sugar.</p></blockquote>
<p style="text-align: justify; clear: both;"><strong>You might ask what if the constructor throws an exception.</strong> In this case the control would not move forward and never enter the proceeding try block. The object myCar still remains null. However you can wrap the using block in a try/catch block as shown below and handle the situation gracefully.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlogSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                using (Car myCar = new Car(1))
                {
                    myCar.Run();
                }
            }
            catch
            {
                //Handle the situation gracefully.
            }
        }
    }
}
</pre>
<blockquote><p>But why C# designers did not wrap object construction within the try block.</p></blockquote>
<p style="text-align: justify; clear: both;">
The reason is simple. If you wrap both declaration and instantiation within the try block then <strong>the object would be out of scope for the proceeding finally block</strong> and the code will not compile at because, for finally block the object hardly exists. If you only wrap the construction in the try block and keep declaration before the try block, even in that case the it will not compile since it finds <strong>use of an unassigned variable which is not allowed in C#</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2010/07/28/understanding-%e2%80%98using%e2%80%99-block-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Decorator Pattern with C#</title>
		<link>http://www.ruchitsurati.net/index.php/2010/07/23/decorator-pattern-with-c/</link>
		<comments>http://www.ruchitsurati.net/index.php/2010/07/23/decorator-pattern-with-c/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 17:34:47 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[design-patterns]]></category>
		<category><![CDATA[ooad]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/?p=431</guid>
		<description><![CDATA[Decorator pattern achieves a single objective of dynamically adding responsibilities to any object. Consider a case of a pizza shop. In the pizza shop they will sale a few pizza varieties and have toppings that customers can order additionally on top of a pizza. Customer can order a pizza and add as many as toppings [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>Decorator pattern achieves a single objective of dynamically adding  responsibilities to any object.</strong></p></blockquote>
<p style="text-align: justify;">Consider a case of a pizza shop. In the pizza shop they will sale a few pizza varieties and have toppings that customers can order additionally on top of a pizza. Customer can order a pizza and add as many as toppings on the pizza. The cost of the ordered pizza will have to be calculated with pizza and all additional toppings. Now imagine a situation wherein if the pizza shop has to provide prices for each combination of pizza and topping. Even if there are four basic pizzas and 8 different toppings, the application would go crazy maintaining all concrete combination of pizzas and toppings. It is impractical to keep all combination in the menu. You&#8217;ll do enough to lose the customer when you expect him to go through such a long menu and do humongous brain-job.</p>
<p style="text-align: justify;">Here comes the decorator pattern.</p>
<p style="text-align: justify;">As per the decorator pattern, you will implement toppings as decorators and pizzas will be decorated by those toppings&#8217; decorators. Practically each customer would want toppings of his desire and final bill-amount will be composed of the base pizzas and additionally ordered toppings. Each topping decorator would know about the pizzas that it is decorating and it&#8217;s price. </p>
<p style="text-align: justify;">Here&#8217;s a code-example of explanation above.</p>
<pre class="brush: csharp;">

//All your pizzas will inherit from this BasePizza class to identify themselves as pizzas.
public abstract class BasePizza
{
    protected double myPrice;

    //This method will return the price of the pizza object.
    public virtual double GetPrice()
    {
        return this.myPrice;
    }
}

//All toppings will inherit from this ToppingsDecorator class to be able to be added to any pizza in the pizza-shop.
public abstract class ToppingsDecorator : BasePizza
{
    //Each topping will need to know to which pizza it is being added to.
    protected BasePizza pizza;
    public ToppingsDecorator(BasePizza pizzaToDecorate)
    {
        this.pizza = pizzaToDecorate;
    }

    //This method will return cumulative price of both pizza and the topping.
    public override double GetPrice()
    {
        return (this.pizza.GetPrice() + this.myPrice);
    }
}

class Program
{
    [STAThread]
    static void Main()
    {
        //Client-code

        //First - order your base pizza. We'll add toppings onto this pizza.
        Margherita pizza = new Margherita();
        Console.WriteLine(&quot;Plain Margherita: &quot; + pizza.GetPrice().ToString());

        //Add extra cheese.
        ExtraCheeseTopping moreCheese = new ExtraCheeseTopping(pizza);

        //Add some more cheese and make it double extra cheese.
        ExtraCheeseTopping someMoreCheese = new ExtraCheeseTopping(moreCheese);
        Console.WriteLine(&quot;Plain Margherita with double extra cheese: &quot; + someMoreCheese.GetPrice().ToString());

        //Like mushrroms ? Add that too.
        MushroomTopping moreMushroom = new MushroomTopping(someMoreCheese);
        Console.WriteLine(&quot;Plain Margherita with double extra cheese with mushroom: &quot; + moreMushroom.GetPrice().ToString());

        //Throw in some Jalapeno and make it sour and spicy.
        JalapenoToping moreJalapeno = new JalapenoToping(moreMushroom);

        //Add here's your final pizza.
        Console.WriteLine(&quot;Plain Margherita with double extra cheese with mushroom with Jalapeno: &quot; + moreJalapeno.GetPrice().ToString());

    }
}

public class Margherita : BasePizza
{
    public Margherita()
    {
        this.myPrice = 6.99;
    }
}

public class Gourmet : BasePizza
{
    public Gourmet()
    {
        this.myPrice = 7.49;
    }
}

public class ExtraCheeseTopping : ToppingsDecorator
{
    public ExtraCheeseTopping(BasePizza pizzaToDecorate)
        : base(pizzaToDecorate)
    {
        this.myPrice = 0.99;
    }
}

public class MushroomTopping : ToppingsDecorator
{
    public MushroomTopping(BasePizza pizzaToDecorate)
        : base(pizzaToDecorate)
    {
        this.myPrice = 1.49;
    }
}

public class JalapenoToping : ToppingsDecorator
{
    public JalapenoToping(BasePizza pizzaToDecorate)
        : base(pizzaToDecorate)
    {
        this.myPrice = 1.49;
    }
}
</pre>
<p>
Note that, <strong>GetPrice()</strong> method of Topping object would return cumulative price of both pizza and the topping.
</p>
<p><img src="http://ruchitsurati.net/myfiles/decorator.png" alt="alt text" /></p>
<p>
<script type="text/javascript"><!--
google_ad_client = "pub-3020293614675538";
/* 300x250, created 14-July-2010 */
google_ad_slot = "4146580937";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2010/07/23/decorator-pattern-with-c/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sealed classes as Generic type-constraints</title>
		<link>http://www.ruchitsurati.net/index.php/2010/07/07/sealed-classes-as-generic-constraints/</link>
		<comments>http://www.ruchitsurati.net/index.php/2010/07/07/sealed-classes-as-generic-constraints/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 14:23:08 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[generics]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/?p=348</guid>
		<description><![CDATA[We make heavy use of generics in our projects. Generics are really great deal when it comes to run-time polymorphism. Recently, one of my colleague came up with an idea to use a sealed class as generic type constraint. He wrote a sample code that looks like this. public sealed class MySealedClass { public MySealedClass() [...]]]></description>
			<content:encoded><![CDATA[<p>We make heavy use of generics in our projects. Generics are really great deal when it comes to run-time polymorphism. Recently, one of my colleague came up with an idea to use a sealed class as generic type constraint. He wrote a sample code that looks like this.</p>
<pre class="brush: csharp; highlight: [1,7];">
public sealed class MySealedClass
{
    public MySealedClass() { }
}

public class MyGeneric&lt;T&gt;
        where T : MySealedClass
{
    public MyGeneric() { }
}
</pre>
<p style="text-align: justify;">Surprisingly, Above code gives following compile error.</p>
<p class="message notice" style="text-align: justify;">&#8216;MySealedClass&#8217; is not a valid constraint. A type used as a constraint must be an interface, a non-sealed class or a type parameter.</p>
<p style="text-align: justify;">That was strange. We never observed such behavior before. Code was absolutely correct and it seemed like language designers had intentionally put this constraint to not allow sealed classed as generic constraints. But what must be the reason behind this ? Finally we had our thoughts in place and found the fact why it is so.</p>
<p style="text-align: justify;">To understand, why sealed classes are not allowed to be generic type constraints, let us assume that sealed classes are allowed to be type constraints to generics. With this assumption the code above is valid and compiles successfully. Now lets write some client-code that would use this generic.</p>
<pre class="brush: csharp;">
//create and instantiate an object of type MyGeneric
MyGeneric&lt;MySealedClass&gt; objGeneric = new MyGeneric&lt;MySealedClass&gt;();
</pre>
<p style="text-align: justify;">Fair enough, this looks ok.</p>
<p style="text-align: justify;">Now lets check what other types we can pass to MyGeneric type-argument at runtime. By defination, it has to be MySealedClass itself or any type that inherits from MySealedClass.</p>
<p style="text-align: justify;">But won&#8217;t MySealedClass be the only valid type-argument for MyGeneric since MySealedClass cannot be inherited further and there will be no class that inherits from MySealedClass ? Doesn&#8217;t this defeat the whole idea of putting MySealedClass in type constraint to MyGeneric, since there&#8217;ll be no other valid-type argument except MySealedClass itself ? If MySealedClass is going to be the only valid type for MyGeneric, then  there&#8217;s no point in  defining MyGeneric as generic at all. Can&#8217;t we simply code against the type MySealedClass ?</p>
<p style="text-align: justify;">We could finally realize the reason why language designers of  C# didn&#8217;t allow sealed classes as generic type-argument. quite enlightening.</p>
<p style="text-align: justify;">While doing this we also came to realize why static classes are also not allowed to be generic type-constraints, though it&#8217;s very much obvious that static classes can never ever be generic type constraints. We found our answer in the compiled IL, where the <strong>static classes are marked as both abstract and sealed. Abstract since they cannot be instantiated and sealed since they cannot be inherited, hence cannot be generic type-constraints. </strong>In general only those types can be generic type-constraints which can have inheritance hierarchy below them, this includes interfaces, any non-sealed abstract or concrete classes.</p>
<p>
<script type="text/javascript"><!--
google_ad_client = "pub-3020293614675538";
/* 300x250, created 14-July-2010 */
google_ad_slot = "4146580937";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2010/07/07/sealed-classes-as-generic-constraints/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Developer Rockstars</title>
		<link>http://www.ruchitsurati.net/index.php/2010/01/24/developer-rockstars/</link>
		<comments>http://www.ruchitsurati.net/index.php/2010/01/24/developer-rockstars/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 13:59:27 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://localhost/Hybrid-WP/?p=13</guid>
		<description><![CDATA[Meet passionate developers over serious technical sessions and discussions. Action packed experience with geeks and nerds. Explore best practices in development and checkout latest tools and cutting edge development technologies. All under one roof.]]></description>
			<content:encoded><![CDATA[<p>Nothing here. Goto Tech-Talk page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2010/01/24/developer-rockstars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet another Shopping Cart for Classic ASP</title>
		<link>http://www.ruchitsurati.net/index.php/2008/08/29/yet-another-shopping-cart-for-classic-asp/</link>
		<comments>http://www.ruchitsurati.net/index.php/2008/08/29/yet-another-shopping-cart-for-classic-asp/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 23:58:02 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[classic-asp]]></category>
		<category><![CDATA[shopping-cart]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/post.aspx?id=8072637a-6c4c-4efd-b278-8db22e421374</guid>
		<description><![CDATA[Like my previous Paging component, I wrote this shopping cart component during my classic ASP days. Nothing was so easily feasible in classic ASP. Complex applications needed to be developed as COM components and the DLL required to be registered on the deployment platform. Ahhh, we all can imagine the pain. This is a very [...]]]></description>
			<content:encoded><![CDATA[<p>Like my previous Paging component, I wrote this shopping cart component during my classic ASP days. Nothing was so easily feasible in classic ASP. Complex applications needed to be developed as COM components and the DLL required to be registered on the deployment platform. Ahhh, we all can imagine the pain.</p>
<p>This is a very light-weight Session-driven shopping cart written in VBScript. You can download the Shopping Cart from <a title="Shopping Cart Demo" href="http://ruchitsurati.net/CodeBase/CCart/CartManager.asp" target="_blank">here</a> and plug-n-play in your classic ASP applications.</p>
<p><a title="Shopping Cart Demo" rel="tag" href="http://demo.ruchitsurati.net/CodeBase/CCart/CartManager.asp" target="_blank">Shopping Cart Demo</a></p>
<p><a title="Download Shopping Cart Component" rel="enclosure" href="http://demo.ruchitsurati.net/CodeBase/CCart/ShoppingCart.zip" target="_blank">Download Shopping Cart Example with Source (8KB</a>)</p>
<p><strong>Screen-Shots</strong></p>
<p>Shopping-Cart</p>
<p><a href="http://ruchitsurati.net/myfiles/classic-asp-cart.jpg"><img style="border: 0px;" src="http://ruchitsurati.net/myfiles/classic-asp-cart.jpg" border="0" alt="shopping cart" width="534" height="205" /></a></p>
<p>Shopping-Cart Statistics</p>
<p><a href="http://ruchitsurati.net/myfiles/classic-asp-cart-2.jpg"><img style="border: 0px;" src="http://ruchitsurati.net/myfiles/classic-asp-cart-2.jpg" border="0" alt="shopping-cart stats" width="501" height="222" /></a></p>
<p>The example code includes the basic operations of shopping cart to let you understand how to add/update/delete items in cart. The unique key to any item in cart is the product-code or item-code. If an item or product is being added to cart and if any item in cart with same product/item-code already exists then the quantity of the item in cart will be increased by 1.</p>
<p>You also have option for cart statistics which you can use on every page to display the current cart stats. You can modify the look and feel the way you want as per your page layout and structure.</p>
<p>Thanks.</p>
<p>Ruchit S.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2008/08/29/yet-another-shopping-cart-for-classic-asp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nice Video on Environment safety</title>
		<link>http://www.ruchitsurati.net/index.php/2008/05/04/nice-video-on-environment-safety/</link>
		<comments>http://www.ruchitsurati.net/index.php/2008/05/04/nice-video-on-environment-safety/#comments</comments>
		<pubDate>Sun, 04 May 2008 23:17:53 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[environment-safety]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/post.aspx?id=f12fb0f8-9a90-4905-b458-8679d4a51193</guid>
		<description><![CDATA[I saw this video clip on the internet last night and liked it a lot. It&#8217;s fun but conveys a great message. Have look at it, it&#8217;s worth watching once. Don&#8217;t use Plastic Bag. Don&#8217;t use plastic bags anymore! Ruchit S.]]></description>
			<content:encoded><![CDATA[<p>I saw this video clip on the internet last night and liked it a lot. It&#8217;s fun but conveys a great message. Have look at it, it&#8217;s worth watching once.</p>
</p>
<div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:aa2585c1-587d-4075-8e81-833a25207f9a" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<div><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/51r4lNX2tUQ"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/51r4lNX2tUQ" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></div>
<p><label style="font-size:.8em;">Don&#8217;t use Plastic Bag.</label></div>
</p>
<p>Don&#8217;t use plastic bags anymore!</p>
<p>Ruchit S.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2008/05/04/nice-video-on-environment-safety/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Presentations at tops-int on .Net</title>
		<link>http://www.ruchitsurati.net/index.php/2008/04/23/my-presentations-at-tops-int-on-net/</link>
		<comments>http://www.ruchitsurati.net/index.php/2008/04/23/my-presentations-at-tops-int-on-net/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 09:50:29 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[net-framework]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/post.aspx?id=eb40d488-d919-451b-ac77-c6af81b20503</guid>
		<description><![CDATA[Sharing and gaining, knowledge and information has always been my passion. I just love this. Sometimes you get to talk to unbelievably talented people and it just makes your day. I have been attending sessions on different technology topics and development platforms for a long time now. It always worth doing so. More you do [...]]]></description>
			<content:encoded><![CDATA[<p>Sharing and gaining, knowledge and information has always been my passion. I just love this. Sometimes you get to talk to unbelievably talented people and it just makes your day. I have been attending sessions on different technology topics and development platforms for a long time now. It always worth doing so. More you do more you get hungry for. After all its a hungry mind out there in all of us. </p>
<p>You always help the next generation by sharing and giving whatever they need with whatever you can deliver. I got an opportunity to deliver a session on .net fundamentals last week at a good company out here. They wanted me to take a session on .net fundamentals and basics. Definitely, I opted for that. Believe me though I&#8217;ve been working on that platform for a long while now, to comprehend the contents in a presentation and a session of two hours was quite a challenging task. After putting lot of efforts, I could some how managed to do that. </p>
<p>It started out well, and eventually I dragged it towards an endless discussion which everybody just enjoyed it. We discussed in detail on CTS, CLS and many more issues. I inspired them to ask questions be it silly or meaningful, but they must ask. I had to gain them the confidence for working on .net platform since some of them were just college pass-outs and freshers hence. </p>
<p>With that note, I&#8217;m publishing my presentation on this blog which I showcased in the event. Hope it might help some one out there!</p>
<p>Topics: <strong>Microsoft .Net Fundamentals and Basics</strong></p>
<p><a href="http://www.ruchitsurati.net/myfiles/Prez-Office2003.zip" target="_blank">Download Office 2003 Format</a></p>
<p><a href="http://www.ruchitsurati.net/myfiles/Prez-Office2007.zip" target="_blank">Download Office 2007 Format (preferable)</a></p>
<p>&#160;</p>
<p>Ruchit S.    </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2008/04/23/my-presentations-at-tops-int-on-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Coolite &#8211; ExtJs For ASP.NET 2.0</title>
		<link>http://www.ruchitsurati.net/index.php/2008/04/23/coolite-extjs-for-asp-net-2-0/</link>
		<comments>http://www.ruchitsurati.net/index.php/2008/04/23/coolite-extjs-for-asp-net-2-0/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 01:44:27 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[extjs]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/post.aspx?id=0ad46792-1234-4eba-96bd-a7a5d7c175eb</guid>
		<description><![CDATA[A marriage of server-side and client-side frameworks. For all ASP.NET developers, the great news is that the very reach js framework for building RIA is now bound into a set of ASP.NET web controls.&#160; Coolite Toolkit is an Ext official suite of ASP.NET Web Controls based on the Ext JavaScript Framework. Coolite, Inc. collaborates with [...]]]></description>
			<content:encoded><![CDATA[<p> <br />
<blockquote>A marriage of server-side and client-side frameworks. </p></blockquote>
<p> 
<p>For all ASP.NET developers, the great news is that the very reach js framework for building RIA is now bound into a set of ASP.NET web controls.&nbsp; Coolite Toolkit is an Ext official suite of ASP.NET Web Controls based on the Ext JavaScript Framework. Coolite, Inc. collaborates with ExtJS, LLC. The suite of web controls are (being) built with a focus on bringing full Visual Studio Design-Time support to the Ext JavaScript Framework. </p>
<p>You can visit the ExtJs examples page <a href="http://www.extjs.com/deploy/dev/examples/samples.html" target="_blank">here</a> to experience the capabilities of ExtJs. As you read this, Coolite is at version 0.4 and ships with these controls.</p>
<table style="width: 400px" cellspacing="2" cellpadding="2" width="400" border="0">
<tbody>
<tr>
<td valign="top" width="200"><strong>Rich Blocks</strong></td>
<td valign="top" width="200"><strong>Form Controls</strong></td>
</tr>
<tr>
<td valign="top" width="200"> 
<ul>
<li>TabPanel
<li>Panel
<li>Window
<li>AjaxLoad
<li>Specialized ScriptManager
<li>ScriptContainer
<li>Store </li>
</ul>
</td>
<td valign="top" width="200"> 
<ul>
<li>Button
<li>Calendar
<li>Checkox
<li>DatePicker
<li>FieldSet
<li>HtmlEditor
<li>NumberTextBox
<li>RadioButton
<li>TextArea
<li>TextBox </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>&nbsp; <br />Developers using Coolite Toolkit benefit from features including: </p>
<ul>
<li>Powerful integration of the Ext JavaScript Framework.
<li>Full Design-Time support in Microsoft Visual Studio 2005 &amp; 2008 and Visual Web Developer 2005 &amp; 2008.
<li>Drag-and-drop ease of use.
<li>Current support for Window, Panel and a many Form Controls including DatePicker, Calendar and HtmlEditor.
<li>New Controls being added weekly.
<li>Dual Licensed (LGPL 3.0 and Coolite Commercial License).
<li>Professional support options available shortly. </li>
</ul>
<p>You can just refer the Assembly in your <strong>\bin</strong> folder of website and additionally stick the controls to appear on your toolbox. You can check out the ExtJs Coolite ASP.NET Server Controls examples <a href="http://www.coolite.com/examples/" target="_blank">here</a> and say wow!
<p>Check out some more stunning examples here..</p>
<p><a href="http://sandbox.coolite.com/ViewPort.aspx" target="_blank">here</a> , <a href="http://www.coolite.com/examples/tabpanel/fixed-height-with-options.aspx" target="_blank">here</a> and <a href="http://sandbox.coolite.com/SimpleLayout.aspx" target="_blank">here</a>.</p>
<p>Happy Programming!</p>
<p>Ruchit S. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2008/04/23/coolite-extjs-for-asp-net-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Web Server &#8211; An Apache port to Symbian Platform</title>
		<link>http://www.ruchitsurati.net/index.php/2008/01/29/mobile-web-server-an-apache-port-to-symbian-platform/</link>
		<comments>http://www.ruchitsurati.net/index.php/2008/01/29/mobile-web-server-an-apache-port-to-symbian-platform/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 05:52:25 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mobile-application]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[web-server]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/post.aspx?id=2fd0998a-19b0-4c0b-b80c-c22f8b189155</guid>
		<description><![CDATA[Yes, you&#8217;ve got it right. The first ever HTTP web server for mobiles and it does all you can expect, in fact it does more then what you expect. Nokia Beta Labs has come up with a Web Server for Mobile phones. The first working prototype was deployed in October, 2007 and I&#8217;ve been chasing [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, you&#8217;ve got it right. The first ever HTTP web server for mobiles and it does all you can expect, in fact it does more then what you expect. Nokia Beta Labs has come up with a Web Server for Mobile phones. The first working prototype was deployed in October, 2007 and I&#8217;ve been chasing the project for every bit of it so far. Currently you have the version 1.2 Beta released on their <a title="Mobile Web Server - Official Web-site" href="http://mymobilesite.net/" target="_blank">web-site</a>. Basically, it&#8217;s an Apache port to Symbian platform and the web-server is deployed as a Symbian application which comes as a SIS file package.</p>
<p>I will blog about this as a series of posts, with this being the Part I itself. In this post, I will have you installed your first working mobile web server and provide you with features and functions. Later parts will include the architecture, how it works, the application areas and will try to elaborate more useful information and details on the web-server. So, here we go..</p>
<h3>Getting Started:</h3>
<p>To start with it, you must register and you can do so by filling up the form at this <a title="Mobile Web Server Registration" href="https://secure.mymobilesite.net/register/" target="_blank">location</a>. You must choose a valid and available Sub-Domain name for making your cell-phone uniquely reachable on the internet. Like mine is <strong>ruchit</strong>.mymobilesite.net and you can hit to the web-server running on my cell-phone by typing this URL in any web-browser, anywhere in the world. So, please choose a good name as well. The web-server can host CGI applications on py60 (Python for S60), static HTML web-pages and it comes with pre-bundled application with basic services which you can access at your URL, which in my case is <a href="http://ruchit.mymobilesite.net">http://ruchit.mymobilesite.net</a> , as I said earlier. Once you&#8217;ve reserved a unique location on the web for your Cell-Phone + Web-Server, you can download the web-server and install it on your cell-phone. You can download the server from <a title="Mobile Web Server - Download" href="http://mymobilesite.net/download/" target="_blank">here</a>. You can use Nokia PC suite to install the server application. After installation, your application menu should display with the icon of the server like this..</p>
<p><a href="http://www.ruchitsurati.net/myfiles/mobile-web-server.jpg"><img style="border: 0px;" src="http://www.ruchitsurati.net/myfiles/mobile-web-server.jpg" border="0" alt="webservericon" /></a></p>
<p>Now, start the application by clicking on the icon and you should see the main application menu. Now, our objective is to let the server know is identity by binding it to the respective URL, in my case as you know it&#8217;d be <a href="http://ruchit.mymobilesite.net">http://ruchit.mymobilesite.net</a>. When you run it for the first time, it will detect it as fresh installation and will prompt you to punch in the most basic details to let itself bind it to a unique Internet location. You can download the <a title="Mobile Web Server - User Guide" href="http://mymobilesite.net/files/MobileWebServer_UG_en_v12.pdf" target="_blank">User Manual</a> from the web-site in order to complete the installation and play around with it in more details. Once you&#8217;ve started the server successfully you should see this screen on your mobile.</p>
<p><a href="http://www.ruchitsurati.net/myfiles/mobile-web-server-2.jpg"><img style="border: 0px;" src="http://www.ruchitsurati.net/myfiles/mobile-web-server-2.jpg" border="0" alt="webserver1" /></a></p>
<p>And yes, Symbian S60 2nd and 3rd edition phones have multitasking capabilities, so you can let this server be running in background continue working as normal. Phone like N95 and higher E series phones, have floating point units, which makes it a breeze.</p>
<h3>Features and Functions:</h3>
<p>You/Anybody can access your Web-Server by typing the associated unique URL, you gained as part of your registration process. You can have administrator logging into your cell-phone or you can entertain guest users as well. They will have following features accessible.</p>
<p><strong>Camera:</strong> The person logged in can access your camera. The person can take pictures by clicking a single button and he can watch it straight on the browser and he can save that picture on local desktop. He can&#8217;t have the video streaming as this way beyond the scope of possibilities, demanding good amount of resources. Yes, you can think of real good ideas to tap on this feature. Like, you can so immediate sharing or remote cam kind of solution.</p>
<p><strong>Web Chat:</strong> You can chat with the cell-phone owner in real time with his approval. It supports some smileys  too.</p>
<p><strong>Messaging:</strong> You can send a single message to the cell-phone owner like a quick-drop message for owner&#8217;s information or for any other important stuff.</p>
<p><strong>Calendar:</strong> You can access person&#8217;s calendar entries right in the browser. You can manipulate them if you&#8217;ve enough rights or you can add one. How about adding your birth-day in your friends mobile without his knowledge and check back his expressions, thinking when reminded, &#8220;Hey, I never did it!&#8221;</p>
<p><strong>Phone Log:</strong> You can access owner&#8217;s Dialed Calls&#8217; Logs, Received Calls&#8217; Logs and Missed Calls&#8217; Logs in real time.</p>
<p><strong>Presence:</strong> You can view cell-phone&#8217;s status and availability information, on which the web-server is running. You can learn, if an active call is ongoing or what&#8217;s battery level of the server phone or even the data bearer of the web-server, either EDGE, 3G or WLAN.</p>
<p><strong>Send SMS:</strong> You can send an SMS to any-other cell-phone number from the web. This will be charged into owner&#8217;s telco. account.</p>
<p><strong>GuestBook:</strong> You can fill up the guest book of the owner, if you like.</p>
<p><strong>Contacts:</strong> You can access owner&#8217;s phone book on the web and manipulate, If you&#8217;ve got enough rights. How about checking a number you need without bothering your friend by asking, &#8220;Hey, do you have this guy&#8217;s number?&#8221;.</p>
<p><strong>Gallery:</strong> You will have access to owner&#8217;s pictures album both on phone memory and external memory facilities.</p>
<p>Well, there are more other exciting features like blogging, contact me and etc. You can check out and download the latest version at <a href="http://www.mymobilesite.net">http://www.mymobilesite.net</a>. Feel free to comment or write to me on my email <a href="mailto:ruchit@ruchitsurati.net">ruchit@ruchitsurati.net</a>. Please mark the subject as &#8216;<strong>Mobile Web Server</strong>&#8216;. More information on Mobile Web Server will follow this post in later posts. Till then Cheers!</p>
<p>Get Ready for the next generation of connected applications. It&#8217;s not that shallow as it seems. There&#8217;s lot more to it.</p>
<p>- Ruchit S.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2008/01/29/mobile-web-server-an-apache-port-to-symbian-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Live messenger, Straight in your Blog &#8211; A smart and Free Live-Chat solution.</title>
		<link>http://www.ruchitsurati.net/index.php/2008/01/25/windows-live-messenger-straight-in-your-blog-a-smart-and-free-live-chat-solution/</link>
		<comments>http://www.ruchitsurati.net/index.php/2008/01/25/windows-live-messenger-straight-in-your-blog-a-smart-and-free-live-chat-solution/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 18:57:19 +0000</pubDate>
		<dc:creator>Ruchit</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[windows-live]]></category>

		<guid isPermaLink="false">http://www.ruchitsurati.net/post.aspx?id=47c8293d-13b3-47b8-b962-fe4ce26a8314</guid>
		<description><![CDATA[Recently, Windows Live team at Microsoft has released a light-weight, web page control for Windows Live messenger. Once plugged into your website&#8217;s page, visitor&#8217;s can spot if you&#8217;re online and no matter they have a LiveID or not, they can start a live chat session if you&#8217;re online in your Windows Live messenger at your [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, Windows Live team at Microsoft has released a light-weight, web page control for Windows Live messenger. Once plugged into your website&#8217;s page, visitor&#8217;s can spot if you&#8217;re online and no matter they have a LiveID or not, they can start a live chat session if you&#8217;re online in your Windows Live messenger at your local desk or workstation. Like, I&#8217;ve put the control/gadget in my blog post, you can also have one in your blog or website. Yes, it is a real good alternate for your Live Chat Solution, quite amazing, right !!!</p>
<p align="center">
<p><iframe style="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; width: 300px; border-bottom: black 1px solid; height: 300px" src="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=24f226172ef6427d@apps.messenger.live.com&amp;mkt=en-US&amp;useTheme=true&amp;foreColor=333333&amp;backColor=DCF2E5&amp;linkColor=333333&amp;borderColor=8ED4AB&amp;buttonForeColor=2C0034&amp;buttonBackColor=CFE9D9&amp;buttonBorderColor=8ED4AB&amp;buttonDisabledColor=CFE9D9&amp;headerForeColor=006629&amp;headerBackColor=92D6AE&amp;menuForeColor=006629&amp;menuBackColor=FFFFFF&amp;chatForeColor=333333&amp;chatBackColor=F4FBF7&amp;chatDisabledColor=F6F6F6&amp;chatErrorColor=760502&amp;chatLabelColor=6E6C6C" frameborder="0" width="300" height="300"></iframe></p>
<p align="center">&nbsp;</p>
<p align="left">My Windows Live IM Gadget code.</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.4%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 51px; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">iframe</span> <span style="color: #ff0000">src</span><span style="color: #0000ff">="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=24f226172ef6427d@apps.messenger.live.com&amp;mkt=en-US&amp;useTheme=true&amp;foreColor=333333&amp;backColor=DCF2E5&amp;linkColor=333333&amp;borderColor=8ED4AB&amp;buttonForeColor=2C0034&amp;buttonBackColor=CFE9D9&amp;buttonBorderColor=8ED4AB&amp;buttonDisabledColor=CFE9D9&amp;headerForeColor=006629&amp;headerBackColor=92D6AE&amp;menuForeColor=006629&amp;menuBackColor=FFFFFF&amp;chatForeColor=333333&amp;chatBackColor=F4FBF7&amp;chatDisabledColor=F6F6F6&amp;chatErrorColor=760502&amp;chatLabelColor=6E6C6C"</span> <span style="color: #ff0000">width</span><span style="color: #0000ff">="300"</span> <span style="color: #ff0000">height</span><span style="color: #0000ff">="300"</span> <span style="color: #ff0000">style</span><span style="color: #0000ff">="border: solid 1px black; width: 300px; height: 300px;"</span> <span style="color: #ff0000">frameborder</span><span style="color: #0000ff">="0"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">iframe</span><span style="color: #0000ff">&gt;</span></pre>
</div>
</div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p align="left">My Windows Live IM Button Gadget code.</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">script</span> <span style="color: #ff0000">type</span><span style="color: #0000ff">="text/javascript"</span> <span style="color: #ff0000">src</span><span style="color: #0000ff">="http://settings.messenger.live.com/controls/1.0/PresenceButton.js"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">script</span><span style="color: #0000ff">&gt;</span>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span>&nbsp; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span> &lt;div</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>   id=<span style="color: #006080">"Microsoft_Live_Messenger_PresenceButton_24f226172ef6427d"</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>   msgr:width=<span style="color: #006080">"100"</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>   msgr:backColor=<span style="color: #006080">"#92D6AE"</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>   msgr:altBackColor=<span style="color: #006080">"#FFFFFF"</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>   msgr:foreColor=<span style="color: #006080">"#424542"</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>   msgr:conversationUrl=<span style="color: #006080">"http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=24f226172ef6427d@apps.messenger.live.com&amp;mkt=en-US&amp;useTheme=true&amp;foreColor=333333&amp;backColor=DCF2E5&amp;linkColor=333333&amp;borderColor=8ED4AB&amp;buttonForeColor=2C0034&amp;buttonBackColor=CFE9D9&amp;buttonBorderColor=8ED4AB&amp;buttonDisabledColor=CFE9D9&amp;headerForeColor=006629&amp;headerBackColor=92D6AE&amp;menuForeColor=006629&amp;menuBackColor=FFFFFF&amp;chatForeColor=333333&amp;chatBackColor=F4FBF7&amp;chatDisabledColor=F6F6F6&amp;chatErrorColor=760502&amp;chatLabelColor=6E6C6C"</span>&gt;&lt;/div&gt;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span> &lt;script type=<span style="color: #006080">"text/javascript"</span> src=<span style="color: #006080">"http://messenger.services.live.com/users/24f226172ef6427d@apps.messenger.live.com/presence?mkt=en-US&amp;cb=Microsoft_Live_Messenger_PresenceButton_onPresence"</span>&gt;</pre>
<p><span style="color: #0000ff">&lt;/</span><span style="color: #800000">script</span><span style="color: #0000ff">&gt;</span></pre>
</div>
</div>
<p align="left">&nbsp;<br />Now, This is how you do it in your web-site or blog..</p>
<p align="left">You can visit this link and get the snippet which you shall put in desired part of your web page. Apart from the IM Control, you&#8217;ve got options for putting IM button or IM status Icon. You can find my IM button in Left-bar area.</p>
<blockquote>
<p align="left"><a title="http://settings.messenger.live.com/Applications/CreateHtml.aspx" href="http://settings.messenger.live.com/Applications/CreateHtml.aspx">http://settings.messenger.live.com/Applications/CreateHtml.aspx</a></p>
</blockquote>
<p align="left">The next thing, is to authorize your messenger status to be displayed on web pages. This is as simple as it gets. You can do so on this link.</p>
<blockquote>
<p align="left"><a title="http://settings.messenger.live.com/Applications/WebSettings.aspx" href="http://settings.messenger.live.com/Applications/WebSettings.aspx">http://settings.messenger.live.com/Applications/WebSettings.aspx</a></p>
</blockquote>
<p align="left">That&#8217;s it, Now you can run/view this page in your web browser. Surprised!</p>
<p align="left">Note that, You&#8217;ll end up having a dumb and non-working messenger gadget in your web page if you&#8217;ve not done the authorization.</p>
<p align="left">This gadget has been built upon using Script# framework from Nikhil Kothari from Microsoft. You can visit the project page <a title="Script# Project" href="http://projects.nikhilk.net/Projects/ScriptSharp.aspx" target="_blank">here</a>. Script# is a C# based development platform which when compiled generates JavaScript code instead of IL. Sounds cool, right? Well, it&#8217;s more than that. You can visit the project page and get started with Script#.</p>
<p align="left">&nbsp;</p>
<p align="left">Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruchitsurati.net/index.php/2008/01/25/windows-live-messenger-straight-in-your-blog-a-smart-and-free-live-chat-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
