<?xml version="1.0" encoding="UTF-8"?>
<rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Omar AL Zabir on things you don't find easily</title>
	
	<link>http://omaralzabir.com</link>
	<description>Working hard to enrich millions of peoples' lives</description>
	<lastBuildDate>Thu, 12 Apr 2012 16:26:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/OmarAlZabirBlog" /><feedburner:info uri="omaralzabirblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Caching WCF javascript proxy on browser</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/lSmtpiKzcmI/</link>
		<comments>http://omaralzabir.com/caching-wcf-javascript-proxy-on-browser/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 14:53:34 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>WCF</category>

		<guid isPermaLink="false">http://omaralzabir.com/caching-wcf-javascript-proxy-on-browser/</guid>
		<description><![CDATA[When you use WCF services from Javascript, you have to generate the Javascript proxies by hitting the Service.svc/js. If you have five WCF services, then it means five javascripts to download. As browsers download javascripts synchronously, one after another, it adds latency to page load and slows down page rendering performance. Moreover, the same WCF [...]]]></description>
			<content:encoded><![CDATA[<p>When you use WCF services from Javascript, you have to generate the Javascript proxies by hitting the <code>Service.svc/js</code>. If you have five WCF services, then it means five javascripts to download. As browsers download javascripts synchronously, one after another, it adds latency to page load and slows down page rendering performance. Moreover, the same WCF service proxy is downloaded from every page, because the generated javascript file is not cached on browser. Here is a solution that will ensure the generated Javascript proxies are cached on browser and when there is a hit on the service, it will respond with HTTP 304 if the <code>Service.svc </code>file has not changed. </p>  <p>Here’s a Fiddler trace of a page that uses two WCF services.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2012/04/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2012/04/image_thumb.png" width="433" height="329" /></a></p>  <p>You can see there are two <code>/js</code> hits and they are sequential. Every visit to the same page, even with the same browser session results in making those two hits to <code>/js</code>. Second time when the same page is browsed:</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2012/04/image1.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2012/04/image_thumb1.png" width="326" height="172" /></a></p>  <p>You can see everything else is cached, except the WCF javascript proxies. They are never cached because the WCF javascript proxy generator does not produce the necessary caching headers to cache the files on browser. </p>  <p>Here’s an <code>HttpModule </code>for IIS and IIS Express which will intercept calls to WCF service proxy. It first checks if the service is changed since the cached version on the browser. If it has not changed then it will return HTTP 304 and not go through the service proxy generation process. Thus it saves some CPU on server. But if the request is for the first time and there’s no cached copy on browser, it will deliver the proxy and also emit the proper cache headers to cache the response on browser.</p>  <p><a href="http://www.codeproject.com/Articles/360437/Caching-WCF-javascript-proxy-on-browser">http://www.codeproject.com/Articles/360437/Caching-WCF-javascript-proxy-on-browser</a></p>  <p>Don’t forget to vote. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F&amp;title=Caching+WCF+javascript+proxy+on+browser" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F&amp;title=Caching+WCF+javascript+proxy+on+browser" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F&amp;title=Caching+WCF+javascript+proxy+on+browser" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F&amp;headline=Caching+WCF+javascript+proxy+on+browser" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Caching+WCF+javascript+proxy+on+browser&amp;url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Caching+WCF+javascript+proxy+on+browser&amp;u=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Caching+WCF+javascript+proxy+on+browser&amp;url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Caching+WCF+javascript+proxy+on+browser&amp;url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Caching+WCF+javascript+proxy+on+browser&amp;url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F&amp;title=Caching+WCF+javascript+proxy+on+browser&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fcaching-wcf-javascript-proxy-on-browser%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=lSmtpiKzcmI:A4g3V3pRDAw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=lSmtpiKzcmI:A4g3V3pRDAw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=lSmtpiKzcmI:A4g3V3pRDAw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=lSmtpiKzcmI:A4g3V3pRDAw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=lSmtpiKzcmI:A4g3V3pRDAw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=lSmtpiKzcmI:A4g3V3pRDAw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/lSmtpiKzcmI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/caching-wcf-javascript-proxy-on-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/caching-wcf-javascript-proxy-on-browser/</feedburner:origLink></item>
		<item>
		<title>Memory Stream Multiplexer–write and read from many threads simultaneously</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/1aHLLZmx5jI/</link>
		<comments>http://omaralzabir.com/memory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 15:42:21 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>.net</category>
		<category>performance</category>

		<guid isPermaLink="false">http://omaralzabir.com/memory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously/</guid>
		<description><![CDATA[Here’s an implementation of MemoryStream like buffer manager where one thread can write and many threads can read simultaneously. Each reading thread gets its own reader and can read from the shared stream on its own without blocking write operation or other parallel read operations. It supports blocking Read call so that reader threads can [...]]]></description>
			<content:encoded><![CDATA[<p>Here’s an implementation of <code>MemoryStream </code>like buffer manager where one thread can write and many threads can read simultaneously. Each reading thread gets its own reader and can read from the shared stream on its own without blocking write operation or other parallel read operations. It supports blocking Read call so that reader threads can call <code>Read(…)</code> and wait until some data is available, exactly the same way you would expect a <code>Stream </code>to behave. You can use this to read content from network or file in one thread and then get it read by one or more threads simultaneously. Readers do not block writing. As a result, both read and write happens concurrently. Handy for building http proxy where you are downloading a certain file and you have multiple clients asking for the same file at the same time. You can download it in one thread and let one or more client threads read from the same buffer exactly at the same time. You can also use this to read same file on disk from multiple clients at the same time. You can also use this to implement a server side cache where the same buffer is read by multiple clients at the same time. </p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2012/03/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2012/03/image_thumb.png" width="616" height="309" /></a></p>  <p>See the detail implementation here:</p>  <p><a href="http://www.codeproject.com/Articles/345105/Memory-Stream-Multiplexer-write-and-read-from-many">Memory Stream Multiplexer–write and read from many threads simultaneously</a></p>  <p>Don’t forget to vote. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F&amp;title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F&amp;title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F&amp;title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F&amp;headline=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously&amp;u=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F&amp;title=Memory+Stream+Multiplexer%26ndash%3Bwrite+and+read+from+many+threads+simultaneously&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fmemory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=1aHLLZmx5jI:ZuLBLwomVKA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=1aHLLZmx5jI:ZuLBLwomVKA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=1aHLLZmx5jI:ZuLBLwomVKA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=1aHLLZmx5jI:ZuLBLwomVKA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=1aHLLZmx5jI:ZuLBLwomVKA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=1aHLLZmx5jI:ZuLBLwomVKA:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/1aHLLZmx5jI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/memory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/memory-stream-multiplexerwrite-and-read-from-many-threads-simultaneously/</feedburner:origLink></item>
		<item>
		<title>ReadLine on Binary Stream</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/zQglRql1gIE/</link>
		<comments>http://omaralzabir.com/readline-on-binary-stream/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 16:50:11 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>

		<guid isPermaLink="false">http://omaralzabir.com/readline-on-binary-stream/</guid>
		<description><![CDATA[When you are reading data from a binary stream, like NetworkStream or FileStream and you need to read both binary chunks as well as read one text line at a time, you are on your own as BinaryReader nor Stream supports ReadLine. You can use StreamReader to do ReadLine, but it does not allow you [...]]]></description>
			<content:encoded><![CDATA[<p>When you are reading data from a binary stream, like NetworkStream or FileStream and you need to read both binary chunks as well as read one text line at a time, you are on your own as BinaryReader nor Stream supports ReadLine. You can use StreamReader to do ReadLine, but it does not allow you to read chunks of bytes. The Read(byte[], int, int) is not there on StreamReader. </p>  <p>Here’s an extension of BinaryReader for doing ReadLine over a binary stream. You can read both byte chunks, as well as read text lines at the same time. </p>  <pre class="brush: csharp" name="code">public class LineReader : BinaryReader
{
  private Encoding _encoding;
  private Decoder _decoder;

  const int bufferSize = 1024;
  private char[] _LineBuffer = new char[bufferSize];
    
  public LineReader(Stream stream, int bufferSize, Encoding encoding)
    : base(stream, encoding)
  {
    this._encoding = encoding;
    this._decoder = encoding.GetDecoder();
  }

  public string ReadLine()
  {
    int pos = 0;
    
    char[] buf = new char[2];

    StringBuilder stringBuffer = null;
    bool lineEndFound = false;

    while(base.Read(buf, 0, 2) &gt; 0)
    {
      if (buf[1] == '\r')
      {
        // grab buf[0]
        this._LineBuffer[pos++] = buf[0];
        // get the '\n'
        char ch = base.ReadChar();
        Debug.Assert(ch == '\n');

        lineEndFound = true;
      }
      else if (buf[0] == '\r')
      {
        lineEndFound = true;
      }          
      else
      {
        this._LineBuffer[pos] = buf[0];
        this._LineBuffer[pos+1] = buf[1];
        pos += 2;

        if (pos &gt;= bufferSize)
        {
          stringBuffer = new StringBuilder(bufferSize + 80);
          stringBuffer.Append(this._LineBuffer, 0, bufferSize);
          pos = 0;
        }
      }

      if (lineEndFound)
      {
        if (stringBuffer == null)
        {
          if (pos &gt; 0)
            return new string(this._LineBuffer, 0, pos);
          else
            return string.Empty;
        }
        else
        {
          if (pos &gt; 0)
            stringBuffer.Append(this._LineBuffer, 0, pos);
          return stringBuffer.ToString();
        }
      }
    }

    if (stringBuffer != null)
    {
      if (pos &gt; 0)
        stringBuffer.Append(this._LineBuffer, 0, pos);
      return stringBuffer.ToString();
    }
    else
    {
      if (pos &gt; 0)
        return new string(this._LineBuffer, 0, pos);
      else
        return null;
    }
  }

}</pre>

<p>Enjoy.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F&amp;title=ReadLine+on+Binary+Stream" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F&amp;title=ReadLine+on+Binary+Stream" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F&amp;title=ReadLine+on+Binary+Stream" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F&amp;headline=ReadLine+on+Binary+Stream" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=ReadLine+on+Binary+Stream&amp;url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=ReadLine+on+Binary+Stream&amp;u=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=ReadLine+on+Binary+Stream&amp;url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=ReadLine+on+Binary+Stream&amp;url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=ReadLine+on+Binary+Stream&amp;url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F&amp;title=ReadLine+on+Binary+Stream&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Freadline-on-binary-stream%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=zQglRql1gIE:mAX6VlDGHxE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=zQglRql1gIE:mAX6VlDGHxE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=zQglRql1gIE:mAX6VlDGHxE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=zQglRql1gIE:mAX6VlDGHxE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=zQglRql1gIE:mAX6VlDGHxE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=zQglRql1gIE:mAX6VlDGHxE:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/zQglRql1gIE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/readline-on-binary-stream/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/readline-on-binary-stream/</feedburner:origLink></item>
		<item>
		<title>Scaling ASP.NET websites from thousands to millions–LIDNUG</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/UpPUQqx71Rs/</link>
		<comments>http://omaralzabir.com/scaling-asp-net-websites-from-thousands-to-millionslidnug/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 16:52:00 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>production</category>

		<guid isPermaLink="false">http://omaralzabir.com/scaling-asp-net-websites-from-thousands-to-millionslidnug/</guid>
		<description><![CDATA[Here’s the recent presentation made on LIDNUG on scaling ASP.NET websites from thousands to millions of users. The action starts at 0:02:05.  Scaling ASP.NET websites from thousands to millions of users by Omar AL Zabir  Here’re the slides.  Scaling asp.net websites to millions of users ]]></description>
			<content:encoded><![CDATA[<p>Here’s the recent presentation made on LIDNUG on scaling ASP.NET websites from thousands to millions of users. The action starts at 0:02:05.</p>  <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:207ae8d5-9cc1-4246-85c6-13a438596d79" class="wlWriterEditableSmartContent"><div><object width="448" height="252"><param name="movie" value="http://www.youtube.com/v/wHdvL4irsiQ?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/wHdvL4irsiQ?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"></embed></object></div><div style="width:448px;clear:both;font-size:.8em">Scaling ASP.NET websites from thousands to millions of users by Omar AL Zabir</div></div>  <p>Here’re the slides.</p>  <div style="width: 425px" id="__ss_11418912"><strong style="margin: 12px 0px 4px; display: block"><a title="Scaling asp.net websites to millions of users" href="http://www.slideshare.net/oazabir/scaling-aspnet-websites-to-millions-of-users" target="_blank">Scaling asp.net websites to millions of users</a></strong> <iframe height="355" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/11418912" frameborder="0" width="425" marginwidth="0" scrolling="no"></iframe></div><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F&amp;title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F&amp;title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F&amp;title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F&amp;headline=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG&amp;url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG&amp;u=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG&amp;url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG&amp;url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG&amp;url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F&amp;title=Scaling+ASP.NET+websites+from+thousands+to+millions%26ndash%3BLIDNUG&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fscaling-asp-net-websites-from-thousands-to-millionslidnug%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=UpPUQqx71Rs:s-d5EKL5Usc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=UpPUQqx71Rs:s-d5EKL5Usc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=UpPUQqx71Rs:s-d5EKL5Usc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=UpPUQqx71Rs:s-d5EKL5Usc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=UpPUQqx71Rs:s-d5EKL5Usc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=UpPUQqx71Rs:s-d5EKL5Usc:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/UpPUQqx71Rs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/scaling-asp-net-websites-from-thousands-to-millionslidnug/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/scaling-asp-net-websites-from-thousands-to-millionslidnug/</feedburner:origLink></item>
		<item>
		<title>Browse internet faster and save power using a smart HOSTS file</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/FC8pTXiy0qg/</link>
		<comments>http://omaralzabir.com/browse-internet-faster-and-save-power-using-a-smart-hosts-file/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 13:01:00 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>performance</category>
		<category>windows7</category>

		<guid isPermaLink="false">http://omaralzabir.com/?p=479</guid>
		<description><![CDATA[Internet is full of flash ads nowadays that make page load slower, render slower and consumes more CPU, thus power. If you can browse without having any flash ads or in fact any ads loaded and without any of the tracking scripts &#8211; you can browse much faster, scroll through pages much smoother and have [...]]]></description>
			<content:encoded><![CDATA[<p>Internet is full of flash ads nowadays that make page load slower, render slower and consumes more CPU, thus power. If you can browse without having any flash ads or in fact any ads loaded and without any of the tracking scripts &#8211; you can browse much <strong>faster</strong>, scroll through pages much <strong>smoother</strong> and have <strong>more hours</strong> from your battery. Nowadays, most websites use scripts from various analytics sites that track your browsing habit, use IFRAME to load tracking and social networking widgets. All of these add considerable delay to page loading and make browser consume more CPU and bandwidth. If you can turn all of them off, browsing internet feels a lot smoother, faster and you get more work hours while running on battery. </p>  <p>Moreover, you don’t get distracted by the flashy ads and save your children and young family members from looking at foul things. </p>  <p>If we could get 10% of the total internet users (<a href="http://www.dailytelegraph.com.au/news/breaking-news/worldwide-internet-users-reaches-2bn/story-e6freuyi-1225995189350">2bn as of Jan 2011</a>) to save 10% CPU, power and bandwidth while browsing everyday, we could save mega watts of power everyday throughout the world!</p>  <p>Using this solution, you can <strong>prevent ads and tracking scripts, prevent malicious and porn websites. </strong></p>  <h3>How bad is it?</h3>  <p>Let’s take an example on a popular website. The red boxes are Flash Ads (read power suckers). </p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb.png" width="586" height="433" /></a></p>  <p>Once we disable all ads and tracking scripts, here’s how it looks:</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb1.png" width="590" height="430" /></a></p>  <p>Statistics:</p>  <table border="1" cellspacing="0" cellpadding="2"><tbody>     <tr>       <td valign="top" width="129">&#160;</td>        <td valign="top" width="52">Before </td>        <td valign="top" width="289">After</td>     </tr>      <tr>       <td valign="top" width="129">Total Requests</td>        <td valign="top" width="52">111</td>        <td valign="top" width="289">100</td>     </tr>      <tr>       <td valign="top" width="129">Total Download Size</td>        <td valign="top" width="52">1.2 MB</td>        <td valign="top" width="289">0.98 MB</td>     </tr>      <tr>       <td valign="top" width="129">Page load time</td>        <td valign="top" width="52">4.34s</td>        <td valign="top" width="289">3.64</td>     </tr>   </tbody></table>  <p>&#160;</p>  <p>Not just during page loading, while you are on the page, doing nothing, just reading, browser <strong>continuously consumes CPU</strong>. </p>  <p>Before:</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb2.png" width="488" height="112" /></a></p>  <p>After:</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb3.png" width="495" height="111" /></a></p>  <p>Before disabling the ads and tracking scripts, CPU is always around 20-25%. After disabling it is around 8-10%. The more CPU works, the more power it consumes. If you are running on battery, you can get at least 20% more time from your battery. If you have many tabs open all the time, you can save more.</p>  <h3>Here’s how to save CPU, bandwidth and power</h3>  <p>Go to this website and download the HOSTS file:</p>  <p><a href="http://winhelp2002.mvps.org/hosts.htm">http://winhelp2002.mvps.org/hosts.htm</a></p>  <p>Follow the instruction to put the HOSTS file in your <code>C:\Windows\System32\Drivers\etc</code> folder.</p>  <p>Now go to <strong>Start Menu</strong>, type <strong>Notepad </strong>but do not hit enter. Right click on Notepad and select <strong>Run As Administrator</strong>.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb4.png" width="271" height="174" /></a></p>  <p>Go to <strong>File menu</strong> and click <strong>Open</strong>.</p>  <p>Copy and paste this into the File Name and click OK.</p>  <p><code>c:\windows\system32\drivers\etc\HOSTS</code></p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image5.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb5.png" width="553" height="215" /></a></p>  <p>Now go to Edit menu and select <strong>Replace</strong>. Put <strong>127.0.0.1</strong> in Find box and put <strong>255.255.255.0</strong> in Replace box. Click <strong>Replace All</strong>.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb6.png" width="322" height="215" /></a></p>  <p>Once done, you need to type back <strong>127.0.0.1</strong> for the first entry <strong>localhost</strong>.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image7.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb7.png" width="245" height="65" /></a></p>  <p><strong>Remember, localhost cannot be 255.255.255.0.</strong></p>  <p>When you have done this correctly, it will look like this.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image8.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb8.png" width="388" height="162" /></a></p>  <p><strong>Save the file </strong>and exit Notepad.</p>  <p>Then go to <strong>Start</strong> menu and type: <code>services.msc</code></p>  <p>From the service list, double click on “<strong>DNS Client</strong>”.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image9.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb9.png" width="592" height="266" /></a></p>  <p>First click “<strong>Stop</strong>” to stop the service. </p>  <p>Then from the <strong>Startup Type</strong> dropdown, select <strong>Disabled</strong>. </p>  <p>Click OK.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/12/image10.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/12/image_thumb10.png" width="285" height="319" /></a></p>  <p>Close all your browsers and reopen them. I highly recommend restarting your PC. </p>  <p>You are ready to browse faster, smarter, cheaper!&#160; </p>  <p>I also highly recommend everyone to use OpenDNS. You can save yourself from getting into malicious sites and being ripped off your bank balance, property, spouse and children. Just go to <a href="http://www.opendns.com">www.opendns.com</a> and follow the instruction. It is the best thing happened on the internet after Wikipedia!</p>  <h3>How does the HOSTS file trick work?</h3>  <p>Here’s how internet works. You type <a href="http://www.something.com">www.something.com</a> and it goes and finds out what is the IP address for this domain. First Windows checks a file called HOSTS. If it is not defined there, it will ask the DNS Server configured for your network to give it the IP for the domain so that it can connect to the webserver. If you put fake IP in HOSTS file, Windows will hand over fake IP to the browser and browser will connect to the fake IP. Thus by putting an invalid IP, we prevent browser or any application running on your PC from reaching the ads, tracker, malicious and porn websites. </p>  <p>Don’t forget to share this with your friends and families!</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F&amp;title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F&amp;title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F&amp;title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F&amp;headline=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file&amp;u=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F&amp;title=Browse+internet+faster+and+save+power+using+a+smart+HOSTS+file&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fbrowse-internet-faster-and-save-power-using-a-smart-hosts-file%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FC8pTXiy0qg:uKyOFnjAgzM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FC8pTXiy0qg:uKyOFnjAgzM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=FC8pTXiy0qg:uKyOFnjAgzM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FC8pTXiy0qg:uKyOFnjAgzM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FC8pTXiy0qg:uKyOFnjAgzM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=FC8pTXiy0qg:uKyOFnjAgzM:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/FC8pTXiy0qg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/browse-internet-faster-and-save-power-using-a-smart-hosts-file/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/browse-internet-faster-and-save-power-using-a-smart-hosts-file/</feedburner:origLink></item>
		<item>
		<title>Get Dropthings license by donating to charity</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/FB5BtKuukYo/</link>
		<comments>http://omaralzabir.com/get-dropthings-license-by-donating-to-charity/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 16:41:16 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>

		<guid isPermaLink="false">http://omaralzabir.com/get-dropthings-license-by-donating-to-charity/</guid>
		<description><![CDATA[Now you no longer pay me for Dropthings license instead you donate the money to a charity and I will give you the license. In case you don’t know what Dropthings is, it is a Web 2.0 Personalizable Dashboard framework that you can use to build Web 2.0 personalizable websites and enterprise dashboards. It is [...]]]></description>
			<content:encoded><![CDATA[<p>Now you no longer pay me for Dropthings license instead you donate the money to a charity and I will give you the license. In case you don’t know what Dropthings is, it is a Web 2.0 Personalizable Dashboard framework that you can use to build Web 2.0 personalizable websites and enterprise dashboards. It is built using <strong>ASP.NET AJAX, jQuery, Silverlight, .NET 3.5, Entity Framework, SQL Server</strong>. It is in use in big companies like BT, Intel, Microsoft, Thomson Reuters; many government organizations like State Police, Canada Border Protection etc. Since it is a state of the art .NET 3.5 codebase, it is sometimes used as a starting point for an application with all the best practices already in place in order to build an N-tier web app using popular technologies, design patterns and testing methods. Dropthings helps you build web app utilizing extensive performance and scalability research that I have done to scale websites to millions of users. It also helps you build a codebase that is highly testable. It shows you how to test AJAX applications using automated test tools like WatiN. It has a business layer and a data access layer that is fully unit testable, nearly 100% test coverage and uses Inversion of Control pattern to the fullest. </p>  <p><img src="http://dropthings.googlecode.com/files/dropthings_demo.gif" /></p>  <p>You can find details about the Project here: <a href="http://code.google.com/p/dropthings/">http://code.google.com/p/dropthings/</a></p>  <p>There are two codeproject articles that show you how it was built, tested, deployed and the production challenges I had to overcome scaling this to millions of requests per day:</p>  <p><a href="http://www.codeproject.com/KB/ajax/MakingGoogleIG.aspx">Build Google IG like Portal in 7 days</a></p>  <p><a href="http://www.codeproject.com/KB/ajax/Web20Portal.aspx">Web 2.0 AJAX Portal using jQuery, ASP.NET 3.5, Silverlight, Linq to SQL, WF and Unity</a></p>  <p>Finally, there’s a book on it, that takes you from the initial idea to design, coding, testing, all the way to purchasing right production hardware, deployment and production troubleshooting. It is a complete end-to-end guide for a developer/startup CTO to take an idea from design to VC funded successful startup used by millions. I have captured many experiences I have learnt from my startup years at <a href="http://www.pageflakes.com">Pageflakes</a> that I co-founded and was the founding CTO.</p>  <p><a title="Building a Web 2.0 portal with ASP.NET 3.5" href="http://oreilly.com/catalog/9780596510503/"><img src="http://oreilly.com/catalog/covers/9780596510503_cat.gif" /></a></p>  <p><a title="Building a Web 2.0 Portal with ASP.NET 3.5" href="http://oreilly.com/catalog/9780596510503/">Building a Web 2.0 Portal with ASP.NET 3.5</a> from O‘Reilly.</p>  <p>Let’s build great web apps and save the world at the same time!</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F&amp;title=Get+Dropthings+license+by+donating+to+charity" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F&amp;title=Get+Dropthings+license+by+donating+to+charity" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F&amp;title=Get+Dropthings+license+by+donating+to+charity" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F&amp;headline=Get+Dropthings+license+by+donating+to+charity" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Get+Dropthings+license+by+donating+to+charity&amp;url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Get+Dropthings+license+by+donating+to+charity&amp;u=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Get+Dropthings+license+by+donating+to+charity&amp;url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Get+Dropthings+license+by+donating+to+charity&amp;url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Get+Dropthings+license+by+donating+to+charity&amp;url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F&amp;title=Get+Dropthings+license+by+donating+to+charity&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fget-dropthings-license-by-donating-to-charity%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FB5BtKuukYo:NqucBOCvKR8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FB5BtKuukYo:NqucBOCvKR8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=FB5BtKuukYo:NqucBOCvKR8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FB5BtKuukYo:NqucBOCvKR8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=FB5BtKuukYo:NqucBOCvKR8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=FB5BtKuukYo:NqucBOCvKR8:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/FB5BtKuukYo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/get-dropthings-license-by-donating-to-charity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/get-dropthings-license-by-donating-to-charity/</feedburner:origLink></item>
		<item>
		<title>MVP Open Day 2011 at Cambridge</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/gENKfMxvJwk/</link>
		<comments>http://omaralzabir.com/mvp-open-day-2011-at-cambridge/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 14:16:52 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>production</category>
		<category>talks</category>

		<guid isPermaLink="false">http://omaralzabir.com/mvp-open-day-2011-at-cambridge/</guid>
		<description><![CDATA[Microsoft Research arranged MVP Open Day 2011 at Cambridge on Oct 14, 2011. Beautiful university, made me feel like giving up my job and going back to study. Amazing research work going there, highly thought provoking. The session on DNA programming was out of the world. The most surprising thing I learnt that a 10cm [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft Research arranged MVP Open Day 2011 at Cambridge on Oct 14, 2011. Beautiful university, made me feel like giving up my job and going back to study. Amazing research work going there, highly thought provoking. The session on DNA programming was out of the world. The most surprising thing I learnt that a 10cm long DNA strand can hold 10TB worth digitally encoded data and cells are thousand times more robust computing system than silicon based chips. Moreover, cells are self-powered, super energy efficient micro processors, hundred years ahead of Intel processors.</p>  <p>Can’t wait for the day when we will be able to use C# to program DNA:</p>  <pre class="brush: csharp" name="code"><p>protected void CancerCell_Found(object body, CellEventArgs e)
{
  this.Attack(e.TargetCell);
}</p></pre>

<p>Here’s my presentation slide. Nothing NDA or DNA in this, feel free to distribute.</p>

<div style="width: 425px" id="__ss_9712387"><strong style="margin: 12px 0px 4px; display: block"><a title="10 performance and scalability secrets of ASP.NET websites" href="http://www.slideshare.net/oazabir/10-performance-and-scalability-secrets-of-aspnet-websites" target="_blank">10 performance and scalability secrets of ASP.NET websites</a></strong> <iframe height="355" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/9712387" frameborder="0" width="425" marginwidth="0" scrolling="no"></iframe></div><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F&amp;title=MVP+Open+Day+2011+at+Cambridge" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F&amp;title=MVP+Open+Day+2011+at+Cambridge" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F&amp;title=MVP+Open+Day+2011+at+Cambridge" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F&amp;headline=MVP+Open+Day+2011+at+Cambridge" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=MVP+Open+Day+2011+at+Cambridge&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=MVP+Open+Day+2011+at+Cambridge&amp;u=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=MVP+Open+Day+2011+at+Cambridge&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=MVP+Open+Day+2011+at+Cambridge&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=MVP+Open+Day+2011+at+Cambridge&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F&amp;title=MVP+Open+Day+2011+at+Cambridge&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fmvp-open-day-2011-at-cambridge%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=gENKfMxvJwk:KhQl4hKpzMk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=gENKfMxvJwk:KhQl4hKpzMk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=gENKfMxvJwk:KhQl4hKpzMk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=gENKfMxvJwk:KhQl4hKpzMk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=gENKfMxvJwk:KhQl4hKpzMk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=gENKfMxvJwk:KhQl4hKpzMk:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/gENKfMxvJwk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/mvp-open-day-2011-at-cambridge/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/mvp-open-day-2011-at-cambridge/</feedburner:origLink></item>
		<item>
		<title>Prevent ASP.NET cookies from being sent on every css, js, image request</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/D2q1047NX9Y/</link>
		<comments>http://omaralzabir.com/prevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 12:57:19 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>asp.net</category>
		<category>performance</category>

		<guid isPermaLink="false">http://omaralzabir.com/prevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request/</guid>
		<description><![CDATA[ASP.NET generates some large cookies if you are using ASP.NET membership provider. Especially if you are using the Anonymous provider, then a typical site will send the following cookies to every request when a user is logged in, whether the request is to a dynamic page or to any static resource:  .DBANON=w3kYczsH8Wvzs6MgryS4JYEF0N-8ZR6aLRSTU9KwVaGaydD6WwUHD7X9tN8vBgjgzKf3r3SJHusTYFjU85y   [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET generates some large cookies if you are using ASP.NET membership provider. Especially if you are using the Anonymous provider, then a typical site will send the following cookies to every request when a user is logged in, whether the request is to a dynamic page or to any static resource:</p>  <p><strong>.DBANON</strong>=w3kYczsH8Wvzs6MgryS4JYEF0N-8ZR6aLRSTU9KwVaGaydD6WwUHD7X9tN8vBgjgzKf3r3SJHusTYFjU85y     <br />YfnunyCeuExcZs895JK9Fk1HS68ksGwm3QpxnRZvpDBAfJKEUKee2OTlND0gi43qwwtIPLeY1;     <br /><strong>ASP.NET_SessionId</strong>=bmnbp155wilotk45gjhitoqg; <strong>DBAUTH12</strong>=2A848A8C200CB0E8E05C6EBA8059A0DBA228FC5F6EDD29401C249D2     <br />37812344C15B3C5C57D6B776037FAA8F14017880E57BDC14A7963C58B0A0B30229     <br />AF0123A6DF56601D814E75525E7DCA9AD4A0EF200832B39A1F35A5111092F0805B     <br />0A8CD3D2FD5E3AB6176893D86AFBEB68F7EA42BE61E89537DEAA3279F3B576D0C     <br />44BA00B9FA1D9DD3EE985F37B0A5A134ADC0EA9C548D</p>  <p>There are 517 bytes of worthless data being sent to every css, js and images from the browser to your webserver!</p>  <p>You might think 517 bytes is peanut. Do the math:</p>  <ul>   <li>Avg page has 40 requests to server. 40 x 517 bytes = 20 KB per page view. </li>    <li>1M page views = 20 GB </li>    <li>That’s 20GB of data getting uploaded to your server for just 1M page views. It does not take millions of users to produce 1M page views. Around 100k+ users using your site every day can produce 1M page views every day. </li> </ul>  <p>Here’s how to prevent this:</p>  <ul>   <li>Setup a new website and map a different subdomain to it. If your main site is <code>www.yoursite.com</code> then map <code>static.yoursite.com</code> to it. </li>    <li>Manually change all the <code>&lt;link&gt;, &lt;script&gt;, &lt;img&gt; css url(…) </code>and prefix each resource with <code>http://static.yoursite.com</code> </li>    <li>If you don’t want to do it manually, use <a title="Load static content from different domain" href="http://omaralzabir.com/loading_static_content_in_asp_net_pages_from_different_domain_for_faster_parallel_download/">this solution</a> I have done before. </li>    <li>Add a <code>Global.asax </code>and in the <code>EndRequest </code>do this trick:       <pre class="brush: csharp" name="code">HttpContext context = HttpContext.Current;
if (context.Request.Url.ToString.StartsWith(&quot;http://static.yoursite.com&quot;)
{
  List&lt;string&gt; cookiesToClear = new List&lt;string&gt;();
  foreach (string cookieName in context.Request.Cookies)
  {
    HttpCookie cookie = context.Request.Cookies[cookieName];
    cookiesToClear.Add(cookie.Name);
  }

  foreach (string name in cookiesToClear)
  {
    HttpCookie cookie = new HttpCookie(name, string.Empty);
    cookie.Expires = DateTime.Today.AddYears(-1);

    context.Response.Cookies.Set(cookie);
  }
}</pre>

    <p>This code reads all the cookies it receives from request and expires them so that browser does not send those cookies again. If by any chance ASP.NET cookies get injected into the <code>static.yoursite.com</code> domain, this code will take care of removing them. </p>
  </li>
</ul><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F&amp;title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F&amp;title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F&amp;title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F&amp;headline=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request&amp;url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request&amp;u=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request&amp;url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request&amp;url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request&amp;url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F&amp;title=Prevent+ASP.NET+cookies+from+being+sent+on+every+css%2C+js%2C+image+request&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fprevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=D2q1047NX9Y:6wVc-jIzgdo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=D2q1047NX9Y:6wVc-jIzgdo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=D2q1047NX9Y:6wVc-jIzgdo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=D2q1047NX9Y:6wVc-jIzgdo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=D2q1047NX9Y:6wVc-jIzgdo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=D2q1047NX9Y:6wVc-jIzgdo:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/D2q1047NX9Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/prevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/prevent-asp-net-cookies-from-being-sent-on-every-css-js-image-request/</feedburner:origLink></item>
		<item>
		<title>Tweaking WCF to build highly scalable async REST API</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/Mt3Hgf39PZ4/</link>
		<comments>http://omaralzabir.com/tweaking-wcf-to-build-highly-scalable-async-rest-api/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 16:57:00 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>performance</category>
		<category>WCF</category>

		<guid isPermaLink="false">http://omaralzabir.com/?p=481</guid>
		<description><![CDATA[At 9 AM in the morning, during the peak traffic for your business, you get an emergency call that the website you built is no more. It’s not responding to any request. Some people can see some page after waiting for long time but most can’t. So, you think it must be some slow query [...]]]></description>
			<content:encoded><![CDATA[<p>At 9 AM in the morning, during the peak traffic for your business, you get an emergency call that the website you built is no more. It’s not responding to any request. Some people can see some page after waiting for long time but most can’t. So, you think it must be some slow query or the database might need some tuning. You do the regular checks like looking at CPU and Disk on database server. You find nothing is wrong there. Then you suspect it must be webserver running slow. So, you check CPU and Disk on webservers. You find no problem there either. Both web servers and database servers have very low CPU and Disk usage. Then you suspect it must be the network. So, you try a large file copy from webserver to database server and vice versa. Nope, file copies perfectly fine, network has no problem. You also quickly check RAM usage on all servers but find RAM usage is perfectly fine. As the last resort, you run some diagnostics on Load Balancer, Firewall, and Switches but find everything to be in good shape. But your website is down. Looking at the performance counters on the webserver, you see a lot of requests getting queued, and there’s very high request execution time, and request wait time.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/07/image001.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image001" border="0" alt="image001" src="http://omaralzabir.com/wp-content/uploads/2011/07/image001_thumb.jpg" width="512" height="345" /></a></p>  <p>So, you do an IIS restart. Your websites comes back online for couple of minutes and then it goes down again. After doing restart several times you realize it’s not an infrastructure issue. You have some scalability issue in your code. All the good things you have <a href="http://msdn.microsoft.com/en-us/library/orm-9780596510503-01.aspx">read about scalability</a> and thought that those were fairy tales and they will never happen to you is now happening right in front of you. You realize you should have made your services async.</p>  <p>However, just converting your sync services to async mode does not solve the scalability problem. WCF has a bug due to which it cannot serve requests as fast as you would like it to. The thread pool it uses to handle the async calls cannot start threads as requests come in. It only adds a new thread to the pool every 500ms. As a result, you get slow rampup of threads:</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/07/image018.gif"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image018" border="0" alt="image018" src="http://omaralzabir.com/wp-content/uploads/2011/07/image018_thumb.gif" width="550" height="430" /></a></p>  <p>Read my article to learn details on how WCF works for async services and how to fix this bug to make your async services truly async and scale under heavy load.</p>  <p><a href="http://www.codeproject.com/KB/webservices/fixwcf_for_restapi.aspx">http://www.codeproject.com/KB/webservices/fixwcf_for_restapi.aspx</a></p>  <p>Don’t forget to vote.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F&amp;title=Tweaking+WCF+to+build+highly+scalable+async+REST+API" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F&amp;title=Tweaking+WCF+to+build+highly+scalable+async+REST+API" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F&amp;title=Tweaking+WCF+to+build+highly+scalable+async+REST+API" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F&amp;headline=Tweaking+WCF+to+build+highly+scalable+async+REST+API" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Tweaking+WCF+to+build+highly+scalable+async+REST+API&amp;url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Tweaking+WCF+to+build+highly+scalable+async+REST+API&amp;u=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Tweaking+WCF+to+build+highly+scalable+async+REST+API&amp;url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Tweaking+WCF+to+build+highly+scalable+async+REST+API&amp;url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Tweaking+WCF+to+build+highly+scalable+async+REST+API&amp;url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F&amp;title=Tweaking+WCF+to+build+highly+scalable+async+REST+API&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Ftweaking-wcf-to-build-highly-scalable-async-rest-api%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Mt3Hgf39PZ4:u2fXKwa5te0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Mt3Hgf39PZ4:u2fXKwa5te0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=Mt3Hgf39PZ4:u2fXKwa5te0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Mt3Hgf39PZ4:u2fXKwa5te0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Mt3Hgf39PZ4:u2fXKwa5te0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=Mt3Hgf39PZ4:u2fXKwa5te0:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/Mt3Hgf39PZ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/tweaking-wcf-to-build-highly-scalable-async-rest-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/tweaking-wcf-to-build-highly-scalable-async-rest-api/</feedburner:origLink></item>
		<item>
		<title>Build truly RESTful API and website using same ASP.NET MVC code</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/ByiSZwByUAI/</link>
		<comments>http://omaralzabir.com/build-truly-restful-api-and-website-using-same-asp-net-mvc-code/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 18:15:27 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>asp.net</category>
		<category>MVC</category>

		<guid isPermaLink="false">http://omaralzabir.com/?p=580</guid>
		<description><![CDATA[A truly RESTful API means you have unique URLs to uniquely represent entities and collections, and there is no verb/action on the URL. You cannot have URL like /Customers/Create or /Customers/John/Update, /Customers/John/Delete where the action is part of the URL that represents the entity. An URL can only represent the state of an entity, like [...]]]></description>
			<content:encoded><![CDATA[<p>A truly RESTful API means you have unique URLs to uniquely represent entities and collections, and there is no verb/action on the URL. You cannot have URL like <u>/Customers/Create </u>or <u>/Customers/John/Update</u>, <u>/Customers/John/Delete</u> where the action is part of the URL that represents the entity. An URL can only represent the state of an entity, like <u>/Customers/John</u> represents the state of John, a customer, and allow GET, POST, PUT, DELETE on that very URL to perform CRUD operations. Same goes for a collection where <u>/Customers</u> returns list of customers and a POST to that URL adds new customer(s). Usually we create separate controllers to deal with API part of the website but I will show you how you can create both RESTful website and API using the same controller code working over the exact same URL that a browser can use to browse through the website and a client application can perform CRUD operations on the entities. </p>  <p>I have tried Scott Gu’s examples on creating RESTful routes, this <a href="http://msdn.microsoft.com/en-us/magazine/dd943053.aspx">MSDN Magazine article</a>, Phil Haack’s <a href="http://haacked.com/archive/2009/08/17/rest-for-mvc.aspx">REST SDK for ASP.NET MVC</a>, and various other examples. But they have all made the same classic mistake &#8211; the action is part of the URL. You have to have URLs like <u>http://localhost:8082/MovieApp/Home/Edit/5?format=Xml</u> to edit a certain entity and define the format eg xml, that you need to support. They aren’t truly RESTful since the URL does not uniquely represent the state of an entity. The action is part of the URL. When you put the action on the URL, then it is straightforward to do it using ASP.NET MVC. Only when you take the action out of the URL and you have to support CRUD over the same URL, using three different formats – html, xml and json, it becomes tricky and you need some custom filters to do the job. It’s not very tricky though, you just need to keep in mind your controller actions are serving multiple formats and design your website in a certain way that makes it API friendly. You make the website URLs look like API URL.</p>  <p>The example code has a library of <u>ActionFilterAttribute</u> and <u>ValurProvider</u> that make it possible to serve and accept html, json and xml over the same URL. A regular browser gets html output, an AJAX call expecting json gets json response and an XmlHttp call gets xml response.</p>  <p>You might ask why not use WCF REST SDK? The idea is to reuse the same logic to retrieve models and emit html, json, xml all from the same code so that we do not have to duplicate logic in the website and then in the API. If we use WCF REST SDK, you have to create a WCF API layer that replicates the model handling logic in the controllers. </p>  <p>The example shown here offers the following RESTful URLs:</p>  <ul>   <li>/Customers – returns a list of customers. A POST to this URL adds a new customer. </li>    <li>/Customers/C0001 – returns details of the customer having id C001. Update and Delete supported on the same URL. </li>    <li>/Customers/C0001/Orders – returns the orders of the specified customer. Post to this adds new order to the customer. </li>    <li>/Customers/C0001/Orders/O0001 – returns a specific order and allows update and delete on the same URL. </li> </ul>  <p>All these URLs support GET, POST, PUT, DELETE. Users can browse to these URLs and get html page rendered. Client apps can make AJAX calls to these URLs to perform CRUD on these. Thus making a truly RESTful API and website.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/07/Customers.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Customers" border="0" alt="Customers" src="http://omaralzabir.com/wp-content/uploads/2011/07/Customers_thumb.png" width="500" height="624" /></a></p>  <p>They also support verbs over POST in case you don’t have PUT, DELETE allowed on your webserver or through firewalls. They are usually disabled by default in most webservers and firewalls due to security common practices. In that case you can use POST and pass the verb as query string. For ex, <u>/Customers/C0001?verb=Delete</u> to delete the customer. This does not break the RESTfulness since the URL <u>/Customers/C0001</u> is still uniquely identifying the entity. You are passing additional context on the URL. Query strings are also used to do filtering, sorting operations on REST URLs. For ex, <u>/Customers?filter=John&amp;sort=Location&amp;limit=100</u> tells the server to return a filtered, sorted, and paged collection of customers.</p>  <p>Read my CodeProject article for details:</p>  <p><a href="http://www.codeproject.com/KB/aspnet/aspnet_mvc_restapi.aspx">http://www.codeproject.com/KB/aspnet/aspnet_mvc_restapi.aspx</a></p>  <p>The source code is available here:</p>  <p><a href="http://code.msdn.microsoft.com/Build-truly-RESTful-API-194a6253">http://code.msdn.microsoft.com/Build-truly-RESTful-API-194a6253</a></p>  <p>Enjoy!</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F&amp;title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F&amp;title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F&amp;title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F&amp;headline=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code&amp;u=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F&amp;title=Build+truly+RESTful+API+and+website+using+same+ASP.NET+MVC+code&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fbuild-truly-restful-api-and-website-using-same-asp-net-mvc-code%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=ByiSZwByUAI:sOpriFfnrbI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=ByiSZwByUAI:sOpriFfnrbI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=ByiSZwByUAI:sOpriFfnrbI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=ByiSZwByUAI:sOpriFfnrbI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=ByiSZwByUAI:sOpriFfnrbI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=ByiSZwByUAI:sOpriFfnrbI:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/ByiSZwByUAI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/build-truly-restful-api-and-website-using-same-asp-net-mvc-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/build-truly-restful-api-and-website-using-same-asp-net-mvc-code/</feedburner:origLink></item>
		<item>
		<title>Automatic Javascript, CSS versioning to refresh browser cache</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/j0rT9-czQzQ/</link>
		<comments>http://omaralzabir.com/automatic-javascript-css-versioning-to-refresh-browser-cache/#comments</comments>
		<pubDate>Sun, 29 May 2011 09:06:00 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>asp.net</category>
		<category>performance</category>

		<guid isPermaLink="false">http://omaralzabir.com/?p=486</guid>
		<description><![CDATA[When you update javascript or css files that are already cached in users&#8217; browsers, most likely many users won’t get that for some time because of the caching at the browser or intermediate proxy(s). You need some way to force browser and proxy(s) to download latest files. There’s no way to do that effectively across [...]]]></description>
			<content:encoded><![CDATA[<p>When you update javascript or css files that are already <a title="Best use of caching in websites" href="http://omaralzabir.com/making_best_use_of_cache_for_high_performance_website/">cached in users&#8217; browsers</a>, most likely many users won’t get that for some time because of the caching at the browser or intermediate proxy(s). You need some way to force browser and proxy(s) to download latest files. There’s no way to do that effectively across all browsers and proxies from the webserver by manipulating cache headers unless you change the file name or you change the URL of the files by introducing some unique query string so that browsers/proxies interpret them as new files. Most web developers use the query string approach and use a version suffix to send the new file to the browser. For example,</p>  <pre class="brush: html">&lt;script src=&quot;someJs.js?v=1001&quot; &gt;&lt;/script&gt;
&lt;link href=&quot;someCss.css?v=2001&quot;&gt;&lt;/link&gt;</pre>

<p>In order to do this, developers have to go to all the html, aspx, ascx, master pages, find all references to static files that are changed, and then increase the version number. If you forget to do this on some page, that page may break because browser uses old cached script. So, it requires a lot of regression test effort to find out whether changing some css or js breaks something anywhere in the entire website.</p>

<p>Another approach is to run some build script that scans all files and updates the reference to the javascript and css files in each and every page in the website. But this approach does not work on dynamic pages where the javascript and css references are added at run-time, say using <code>ScriptManager</code>.</p>

<p>If you have no way to know what javascript and css will get added to the page at run-time, the only option is to analyze the page output at runtime and then change the javascript, css references on the fly.</p>

<p>Here’s an <code>HttpFilter </code>that can do that for you. This filter intercepts any ASPX hit and then it automatically appends the last modification date time of javascript and css files inside the emitted html. It does so without storing the whole generated html in memory nor doing any string operation because that will cause high memory and CPU consumption on webserver under high load. The code works with character buffers and response streams directly so that it’s as fast as possible. I have done enough load test to ensure even if you hit an aspx page million times per hour, it won’t add more than 50ms delay over each page response time.</p>

<p>First, you add set the filter called <code>StaticContentFilter </code>in the <code>Global.asax</code> file’s <code>Application_BeginRequest</code> event handler:</p>

<pre class="brush: csharp">Response.Filter = new Dropthings.Web.Util.StaticContentFilter(
    Response,
    relativePath =&gt;
      {
        if (Context.Cache[physicalPath] == null)
        {
          var physicalPath = Server.MapPath(relativePath);
          var version = &quot;?v=&quot; +
            new System.IO.FileInfo(physicalPath).LastWriteTime
            .ToString(&quot;yyyyMMddhhmmss&quot;);
          Context.Cache.Add(physicalPath, version, null,
            DateTime.Now.AddMinutes(1), TimeSpan.Zero,
            CacheItemPriority.Normal, null);
          Context.Cache[physicalPath] = version;
          return version;
        }
        else
        {
          return Context.Cache[physicalPath] as string;
        }
      },
    &quot;http://images.mydomain.com/&quot;,
    &quot;http://scripts.mydomain.com/&quot;,
    &quot;http://styles.mydomain.com/&quot;,
    baseUrl,
    applicationPath,
    folderPath);
}</pre>

<p>The only tricky part here is the delegate that is fired whenever the filter detects a script or css link and it asks you to return the version for the file. Whatever you return gets appended right after the original URL of the script or css. So, here the delegate is producing the version as <span style="text-decoration: underline">“?v=yyyyMMddhhmmss”</span> using the file’s last modified date time. It’s also caching the version for the file to make sure it does not make a File I/O request on each and every page view in order to get the file’s last modified date time.</p>

<p>For example, the following scripts and css in the html snippet:</p>

<pre class="brush: html">&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/jquery-1.4.1.min.js&quot; &gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/TestScript.js&quot; &gt;&lt;/script&gt;
&lt;link href=&quot;Styles/Stylesheet.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</pre>

<p>It will get emitted as:</p>

<pre class="brush: html">&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/jquery-1.4.1.min.js?v=20100319021342&quot; &gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/TestScript.js?v=20110522074353&quot; &gt;&lt;/script&gt;
&lt;link href=&quot;Styles/Stylesheet.css?v=20110522074829&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</pre>

<p>As you see there’s a query string generated with each of the file’s last modified date time. Good thing is you don’t have to worry about generating a sequential version number after changing a file. it will take the last modified date, which will change only when a file is changed.</p>

<p>The <code>HttpFilter </code>I will show you here can not only append version suffix, it can also prepend anything you want to add on image, css and link URLs. You can use this feature to load images from a different domain, or load scripts from a different domain and benefit from the parallel loading feature of browsers and increase the page load performance. For example, the following tags can have any URL prepended to them:</p>

<pre class="brush: html">&lt;script src=&quot;some.js&quot; &gt;&lt;/script&gt;
&lt;link href=&quot;some.css&quot; /&gt;
&lt;img src=&quot;some.png&quot; /&gt;</pre>

<p>They can be emitted as:</p>

<pre class="brush: html">&lt;script src=&quot;http://javascripts.mydomain.com/some.js&quot; &gt;&lt;/script&gt;
&lt;link href=&quot;http://styles.mydomain.com/some.css&quot; /&gt;
&lt;img src=&quot;http://images.mydomain.com/some.png&quot; /&gt;</pre>

<p>Loading javascripts, css and images from different domain can significantly improve your page load time since browsers can load only two files from a domain at a time. If you load javascripts, css and images from different subdomains and the page itself on www subdomain, you can load 8 files in parallel instead of only 2 files in parallel.</p>

<p>Read here to learn how this works:</p>

<p><a title="http://www.codeproject.com/KB/aspnet/autojscssversion.aspx" href="http://www.codeproject.com/KB/aspnet/autojscssversion.aspx">http://www.codeproject.com/KB/aspnet/autojscssversion.aspx</a></p>

<p>Appreciate your feedback.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F&amp;title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F&amp;title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F&amp;title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F&amp;headline=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache&amp;url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache&amp;u=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache&amp;url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache&amp;url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache&amp;url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F&amp;title=Automatic+Javascript%2C+CSS+versioning+to+refresh+browser+cache&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fautomatic-javascript-css-versioning-to-refresh-browser-cache%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=j0rT9-czQzQ:ffeZn_PiPwo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=j0rT9-czQzQ:ffeZn_PiPwo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=j0rT9-czQzQ:ffeZn_PiPwo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=j0rT9-czQzQ:ffeZn_PiPwo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=j0rT9-czQzQ:ffeZn_PiPwo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=j0rT9-czQzQ:ffeZn_PiPwo:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/j0rT9-czQzQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/automatic-javascript-css-versioning-to-refresh-browser-cache/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/automatic-javascript-css-versioning-to-refresh-browser-cache/</feedburner:origLink></item>
		<item>
		<title>WCF does not support compression out of the box, so fix it</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/_-FTZm-0fP8/</link>
		<comments>http://omaralzabir.com/wcf-does-not-support-compression-out-of-the-box-so-fix-it/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 22:46:37 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>IIS</category>
		<category>performance</category>
		<category>WCF</category>

		<guid isPermaLink="false">http://omaralzabir.com/wcf-does-not-support-compression-out-of-the-box-so-fix-it/</guid>
		<description><![CDATA[WCF service and client do not support HTTP Compression out of the box in .NET 3.5 even if you turn on Dynamic Compression in IIS 6 or 7. It has been fixed in .NET 4 but those who are stuck with .NET 3.5 for foreseeable future, you are out of luck.&#160; First of all, it’s [...]]]></description>
			<content:encoded><![CDATA[<p>WCF service and client do not support HTTP Compression out of the box in .NET 3.5 even if you turn on Dynamic Compression in IIS 6 or 7. It has been fixed in .NET 4 but those who are stuck with .NET 3.5 for foreseeable future, you are out of luck.&#160; First of all, it’s IIS fault that it does not enable http compression for SOAP messages even if you turn on Dynamic Compression in IIS 7. Secondly, it’s WCF’s fault that it does not send the Accept-Encoding: gzip, deflate header in http requests to the server, which tells IIS that the client supports compression. Thirdly, it’s again WCF fault that even if you make IIS to send back compressed response, WCF can’t process it since it does not know how to decompress it. So, you have to tweak IIS and System.Net factories to make compression work for WCF services. Compression is key for performance since it can dramatically reduce the data transfer from server to client and thus give significant performance improvement if you are exchanging medium to large data over WAN or internet.</p>  <p>There are two steps – first configure IIS, then configure System.Net. There’s no need to tweak anything in WCF like using some Message Interceptor to inject HTTP Headers as you find people trying to do <a href="http://social.msdn.microsoft.com/Forums/en/wcf/thread/133f644c-1b44-4688-ade6-7c3b067bfb59">here</a>, <a href="http://stackoverflow.com/questions/2713203/gzip-compression-with-wcf-hosted-on-iis7">here</a> and <a href="http://stackoverflow.com/questions/10006/what-is-the-easiest-way-to-add-compression-to-wcf-in-silverlight">here</a>. </p>  <h3>Configure IIS to support gzip on SOAP respones</h3>  <p>After you have enabled Dynamic Compression on IIS 7 <a href="http://blog.wassupy.com/2009/08/enabling-dynamic-http-compression-in.html">following the guide</a>, you need to add the following block in the <u>&lt;dynamicTypes&gt;</u> section of <u>applicationHost.config </u>file inside <u>C:\Windows\System32\inetsrv\config</u> folder. Be very careful about the space in <u>mimeType</u>. They need to be exactly the same as you find in response header of SOAP response generated by WCF services. </p>  <pre>&lt;add mimeType=&quot;application/soap+xml&quot; enabled=&quot;true&quot; /&gt;
&lt;add mimeType=&quot;application/soap+xml; charset=utf-8&quot; enabled=&quot;true&quot; /&gt;
&lt;add mimeType=&quot;application/soap+xml; charset=ISO-8895-1&quot; enabled=&quot;true&quot; /&gt;</pre>

<p>After adding the block, the config file will look like this:</p>

<p><a href="http://omaralzabir.com/wp-content/uploads/2011/02/image1.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/02/image_thumb1.png" width="595" height="144" /></a></p>

<p>For IIS 6, first you need to first <a href="http://omaralzabir.com/iis_6_compression___quickest_and_effective_way_to_do_it_for_asp_net_compression/">enable dynamic compression</a> and then allow the .svc extension so that IIS compresses responses from WCF services. </p>

<p>Next you need to make WCF send the <u>Accept-Encoding: gzip, deflate</u> header as part of request and then support decompressing a compressed response.</p>

<h3>Send proper request header in WCF requests</h3>

<p>You need to override the System.Net default <u>WebRequest</u> creator to create <u>HttpWebRequest</u> with compression turned on. First you create a class like this:</p>

<div id="codeSnippetWrapper">
  <pre id="codeSnippet" class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> CompressibleHttpRequestCreator : IWebRequestCreate<br />{<br />    <span class="kwrd">public</span> CompressibleHttpRequestCreator()<br />    {<br />    }<br /><br />    WebRequest IWebRequestCreate.Create(Uri uri)<br />    {<br />        HttpWebRequest httpWebRequest =<br />            Activator.CreateInstance(<span class="kwrd">typeof</span>(HttpWebRequest),<br />            BindingFlags.CreateInstance | BindingFlags.Public |<br />            BindingFlags.NonPublic | BindingFlags.Instance,<br />            <span class="kwrd">null</span>, <span class="kwrd">new</span> <span class="kwrd">object</span>[] { uri, <span class="kwrd">null</span> }, <span class="kwrd">null</span>) <span class="kwrd">as</span> HttpWebRequest;<br /><br />        <span class="kwrd">if</span> (httpWebRequest == <span class="kwrd">null</span>)<br />        {<br />            <span class="kwrd">return</span> <span class="kwrd">null</span>;<br />        }<br /><br />        httpWebRequest.AutomaticDecompression = DecompressionMethods.GZip |<br />            DecompressionMethods.Deflate;<br /><br />        <span class="kwrd">return</span> httpWebRequest;<br />    }<br />}</pre>

  <br /></div>

<p>Then on the WCF Client application’s app.config or web.config, you need to put this block inside system.net which tells system.net to use your factory instead of the default one. </p>

<div id="codeSnippetWrapper">
  <pre id="codeSnippet" class="csharpcode">&lt;system.net&gt;<br />  &lt;webRequestModules&gt;<br />    &lt;remove prefix=<span class="str">&quot;http:&quot;</span>/&gt;<br />    &lt;add prefix=<span class="str">&quot;http:&quot;</span> type=<span class="str">&quot;WcfHttpCompressionEnabler.CompressibleHttpRequestCreator, WcfHttpCompressionEnabler, <br />        Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&quot;</span> /&gt;<br />  &lt;/webRequestModules&gt;<br />&lt;/system.net&gt;</pre>

  <br /></div>

<p>That’s it.</p>

<p>I have uploaded <a href="http://code.msdn.microsoft.com/WCF-Compression-Example-9ffab49c">a sample project</a> which shows how all these works. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F&amp;title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F&amp;title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F&amp;title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F&amp;headline=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it&amp;u=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F&amp;title=WCF+does+not+support+compression+out+of+the+box%2C+so+fix+it&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fwcf-does-not-support-compression-out-of-the-box-so-fix-it%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_-FTZm-0fP8:IAPpubFk9Lc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_-FTZm-0fP8:IAPpubFk9Lc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=_-FTZm-0fP8:IAPpubFk9Lc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_-FTZm-0fP8:IAPpubFk9Lc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_-FTZm-0fP8:IAPpubFk9Lc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=_-FTZm-0fP8:IAPpubFk9Lc:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/_-FTZm-0fP8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/wcf-does-not-support-compression-out-of-the-box-so-fix-it/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/wcf-does-not-support-compression-out-of-the-box-so-fix-it/</feedburner:origLink></item>
		<item>
		<title>Safely deploying changes to production servers</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/Nx5wR83A-qE/</link>
		<comments>http://omaralzabir.com/safely-deploying-changes-to-production-servers/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 11:14:07 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>CodeProject</category>
		<category>Uncategorized</category>
		<category>asp.net</category>
		<category>IIS</category>
		<category>production</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/?p=497</guid>
		<description><![CDATA[When you deploy incremental changes on a production server, which is running and live all the time, you some times see error messages like “Compiler Error Message: The Type ‘XXX’ exists in both…”. Sometimes you find Application_Start event not firing although you shipped a new class, dll or web.config. Sometimes you find static variables not [...]]]></description>
			<content:encoded><![CDATA[<p>When you deploy incremental changes on a production server, which is running and live all the time, you some times see error messages like “Compiler Error Message: The Type ‘XXX’ exists in both…”. Sometimes you find Application_Start event not firing although you shipped a new class, dll or web.config. Sometimes you find static variables not getting initialized and so on. There are so many weird things happen on webservers when you incrementally deploy changes to the server and the server has been up and running for several weeks. So, I came up with a full proof house keeping steps that we always do whenever we deploy some incremental change to our websites. These steps ensure that the web sites are properly recycled , cached are cleared, all the data stored at Application level is initialized.</p>  <p>First of all you should have multiple web servers behind a load balancer. This way you can take one server out of the production traffic, do your deployment and house keeping tasks like restarting IIS, and then put it back. Then you can do it for the second server and so on. This ensures there’s no outage for customer. If you can do it reasonable fast, hopefully customers won’t notice discrepancy between the servers some having new code and some having old code. You should only do this when your changes aren’t drastic. For ex, you aren’t delivering a complete revamped UI. In that case, some users hitting server1 with latest UI will suddenly get a completely different experience and then on next page refresh, they might hit server2 with old code and get a totally different experience. This works for incremental non-dramatic changes only.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2011/02/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2011/02/image_thumb.png" width="596" height="215" /></a></p>  <p>During deployment you should follow these steps:</p>  <ul>   <li>Take server X out of load balancer so that it does not get any traffic. </li>    <li>Stop all your .NET windows services on the server. </li>    <li>Stop IIS. </li>    <li>Delete the Temporary ASP.NET folders of all .NET versions incase you have multiple .NET versions running. You can <a href="http://blogs.msdn.com/b/dougste/archive/2008/08/11/clearing-out-temporary-asp-net-files.aspx">follow this link</a>. </li>    <li>Deploy the changes. </li>    <li>Flush any distributed cache you have, for ex, Velocity or Memcached. </li>    <li>Start IIS. </li>    <li>Start your .NET windows services on the server. </li>    <li>Warm up all websites by hitting major URLs on the websites. You should have some automated script to do this. You can use tinyget to hit some major URLs, especially pages that take a lot of time to compile. Read my post on <a href="http://omaralzabir.com/keep-website-and-webservices-warm-with-zero-coding/">keeping websites warm</a> with zero coding. </li>    <li>Put server X back to load balancer so that it starts receiving traffic. </li> </ul>  <p>That’s it. It should give you a clean deployment and prevent unexpected errors. You should print these steps and hang on the desk of your deployment guys so that they never forget during deployment pressure.</p>  <p>Doing all these steps manually is risky. Under deployment time pressure, your production guys can make mistakes and screw up a server for good. So, I always prefer having a batch file that takes a server out and makes it ready for deploying code and then after the deployment is done, use another batch file to put the server back into load balancer traffic rotation after the server is warmed up.</p>  <p>Generally load balancers are configured to hit some page on your website and keep the server alive if that page returns a HTTP 200. If not, it assumes the server is dead and takes it our of rotation. For ex, say you have an alive.txt file on your website which is what load balancer is keeping an eye on. If it’s gone, the server is put out of the rotation. In that case, you can create some batch files that will take the server out, wait for couple of seconds to ensure the in-flight requests complete and then stop IIS, delete temporary ASP.NET files and make server ready to deploy stuff. Something like this:</p>  <pre name="code" class="brush: text;">serverout.bat
=====================
Ren alive.txt dead.txt
typeperf &quot;\ASP.NET Applications(__Total__)\Requests Executing&quot; -sc 30
iisreset /stop
rmdir /q /s &quot;C:\WINDOWS\Microsoft.NET\Framework64\v1.1.4322\Temporary ASP.NET Files&quot;
rmdir /q /s &quot;C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files&quot;
md &quot;C:\WINDOWS\Microsoft.NET\Framework64\v1.1.4322\Temporary ASP.NET Files&quot;
md &quot;C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files&quot;
xcacls &quot;C:\WINDOWS\Microsoft.NET\Framework64\v1.1.4322\Temporary ASP.NET Files&quot; /E /G MYMACHINE\IIS_WPG:F /Q
xcacls &quot;C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files&quot; /E /G MYMACHINE\IIS_WPG:F /Q</pre>

<p>Similarly you should have a batch file that starts IIS, warms up some pages, and then puts the server back into load balancer.</p>

<pre name="code" class="brush: text;">serverin.bat
============
SET TINYGET=C:\Program Files (x86)\IIS Resources\TinyGet\tinyget.exe
iisreset /start&quot;%TINYGET%&quot; -srv:localhost -uri:http://localhost/ -status:200
ren dead.txt alive.txt
typeperf &quot;\ASP.NET Applications(__Total__)\Requests Executing&quot; -sc 30</pre>

<p>Always try to automate this kind of admin chores. It’s difficult to do it right all the time manually under deployment pressure.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F&amp;title=Safely+deploying+changes+to+production+servers" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F&amp;title=Safely+deploying+changes+to+production+servers" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F&amp;title=Safely+deploying+changes+to+production+servers" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F&amp;headline=Safely+deploying+changes+to+production+servers" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Safely+deploying+changes+to+production+servers&amp;url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Safely+deploying+changes+to+production+servers&amp;u=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Safely+deploying+changes+to+production+servers&amp;url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Safely+deploying+changes+to+production+servers&amp;url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Safely+deploying+changes+to+production+servers&amp;url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F&amp;title=Safely+deploying+changes+to+production+servers&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fsafely-deploying-changes-to-production-servers%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Nx5wR83A-qE:8AyerbBbA7M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Nx5wR83A-qE:8AyerbBbA7M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=Nx5wR83A-qE:8AyerbBbA7M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Nx5wR83A-qE:8AyerbBbA7M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=Nx5wR83A-qE:8AyerbBbA7M:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=Nx5wR83A-qE:8AyerbBbA7M:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/Nx5wR83A-qE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/safely-deploying-changes-to-production-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/safely-deploying-changes-to-production-servers/</feedburner:origLink></item>
		<item>
		<title>Quick ways to boost performance and scalability of ASP.NET, WCF and Desktop Clients</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/P8dRbPX3fl4/</link>
		<comments>http://omaralzabir.com/quick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 20:48:49 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>Uncategorized</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>WCF</category>

		<guid isPermaLink="false">http://omaralzabir.com/quick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2/</guid>
		<description><![CDATA[There are some simple configuration changes that you can make on machine.config and IIS to give your web applications significant performance boost. These are simple harmless changes but makes a lot of difference in terms of scalability. By tweaking system.net changes, you can increase the number of parallel calls that can be made from the [...]]]></description>
			<content:encoded><![CDATA[<p>There are some simple configuration changes that you can make on machine.config and IIS to give your web applications significant performance boost. These are simple harmless changes but makes a lot of difference in terms of scalability. By tweaking system.net changes, you can increase the number of parallel calls that can be made from the services hosted on your servers as well as on desktop computers and thus increase scalability. By changing WCF throttling config you can increase number of simultaneous calls WCF can accept and thus make most use of your hardware power. By changing ASP.NET process model, you can increase number of concurrent requests that can be served by your website. And finally by turning on IIS caching and dynamic compression, you can dramatically increase the page download speed on browsers and and overall responsiveness of your applications.</p>
<p>Read the CodeProject article for more details.</p>
<p><a href="http://www.codeproject.com/KB/webservices/quickwins.aspx">http://www.codeproject.com/KB/webservices/quickwins.aspx</a></p>
<p><a href="http://www.codeproject.com/KB/webservices/quickwins.aspx"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://omaralzabir.com/wp-content/uploads/2010/12/image.png" border="0" alt="image" width="508" height="534" /></a></p>
<p>Please vote for me if you find the article useful.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F&amp;title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F&amp;title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F&amp;title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F&amp;headline=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients&amp;url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients&amp;u=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients&amp;url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients&amp;url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients&amp;url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F&amp;title=Quick+ways+to+boost+performance+and+scalability+of+ASP.NET%2C+WCF+and+Desktop+Clients&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fquick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=P8dRbPX3fl4:4thTDe9F5rI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=P8dRbPX3fl4:4thTDe9F5rI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=P8dRbPX3fl4:4thTDe9F5rI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=P8dRbPX3fl4:4thTDe9F5rI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=P8dRbPX3fl4:4thTDe9F5rI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=P8dRbPX3fl4:4thTDe9F5rI:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/P8dRbPX3fl4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/quick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/quick-ways-to-boost-performance-and-scalability-of-asp-net-wcf-and-desktop-clients-2/</feedburner:origLink></item>
		<item>
		<title>Dynamically set WCF Endpoint in Silverlight</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/_PpSQlenER4/</link>
		<comments>http://omaralzabir.com/dynamically-set-wcf-endpoint-in-silverlight/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 16:36:26 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>silverlight</category>
		<category>WCF</category>

		<guid isPermaLink="false">http://omaralzabir.com/dynamically-set-wcf-endpoint-in-silverlight/</guid>
		<description><![CDATA[When you add a WCF service reference to a Silverlight Application, it generates the ServiceReference.ClientConfig file where the URL of the WCF endpoint is defined. When you add the WCF service reference on a development computer, the endpoint URL is on localhost. But when you deploy the Silverlight client and the WCF service on a [...]]]></description>
			<content:encoded><![CDATA[<p>When you add a WCF service reference to a Silverlight Application, it generates the ServiceReference.ClientConfig file where the URL of the WCF endpoint is defined. When you add the WCF service reference on a development computer, the endpoint URL is on localhost. But when you deploy the Silverlight client and the WCF service on a production server, the endpoint URL no longer is on localhost instead on some domain. As a result, the Silverlight application fails to call the WCF services. You have to manually change the endpoint URL on the Silverlight config file to match the production URL before deploying live. Now if you are deploying the Silverlight application and the server side WCF service as a distributable application where customer install the service themselves on their own domain then you don’t know what will be the production URL. As a result, you can’t rely on the ServiceReference.ClientConfig. You have to dynamically find out on which domain the Silverlight application is running and what will be the endpoint URL of the WCF service. Here I will show you an approach to dynamically decide the endpoint URL.</p>  <p>First you add a typical service reference and generate a ServiceReference.ClientConfig that looks like this:</p>  <pre class="code"><span style="color: #efef8f">&lt;configuration&gt;
    &lt;system.serviceModel&gt;
        &lt;bindings&gt;
            &lt;basicHttpBinding&gt;
                &lt;binding </span><span style="color: #dfdfbf">name</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;BasicHttpBinding_ProxyService&quot; </span><span style="color: #dfdfbf">maxBufferSize</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;2147483647&quot;
                    </span><span style="color: #dfdfbf">maxReceivedMessageSize</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;2147483647&quot;</span><span style="color: #efef8f">&gt;
                    &lt;security </span><span style="color: #dfdfbf">mode</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;None&quot; </span><span style="color: #efef8f">/&gt;
                &lt;/binding&gt;
                &lt;binding </span><span style="color: #dfdfbf">name</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;BasicHttpBinding_WidgetService&quot; </span><span style="color: #dfdfbf">maxBufferSize</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;2147483647&quot;
                    </span><span style="color: #dfdfbf">maxReceivedMessageSize</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;2147483647&quot;</span><span style="color: #efef8f">&gt;
                    &lt;security </span><span style="color: #dfdfbf">mode</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;None&quot; </span><span style="color: #efef8f">/&gt; 
                &lt;/binding&gt;
            &lt;/basicHttpBinding&gt;
        &lt;/bindings&gt;
        &lt;client&gt;
            &lt;endpoint </span><span style="color: #dfdfbf">address</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;http://localhost:8000/Dropthings/API/Proxy.svc/pox&quot;
                </span><span style="color: #dfdfbf">binding</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;basicHttpBinding&quot; </span><span style="color: #dfdfbf">bindingConfiguration</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;BasicHttpBinding_ProxyService&quot;
                </span><span style="color: #dfdfbf">contract</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;DropthingsProxy.ProxyService&quot; </span><span style="color: #dfdfbf">name</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;BasicHttpBinding_ProxyService&quot; </span><span style="color: #efef8f">/&gt;
            &lt;endpoint </span><span style="color: #dfdfbf">address</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;http://localhost:8000/Dropthings/API/Widget.svc/pox&quot;
                </span><span style="color: #dfdfbf">binding</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;basicHttpBinding&quot; </span><span style="color: #dfdfbf">bindingConfiguration</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;BasicHttpBinding_WidgetService&quot;
                </span><span style="color: #dfdfbf">contract</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;DropthingsWidgetService.WidgetService&quot; </span><span style="color: #dfdfbf">name</span><span style="color: #efef8f">=</span><span style="color: #cc9393">&quot;BasicHttpBinding_WidgetService&quot; </span><span style="color: #efef8f">/&gt;
        &lt;/client&gt;
    &lt;/system.serviceModel&gt;
&lt;/configuration&gt;

</span></pre>

<p>As you see, all the URL are pointing to localhost, on my development environment. The Silverlight application now need to dynamically decide what URL the Silverlight app is running from and then resolve the endpoint URL dynamically.</p>

<p>I do this by creating a helper class that checks the URL of the Silverlight application and then decides what’s going to be the URL of the endpoint.</p>

<pre class="code"><span style="color: #eaeaac">public class </span><span style="color: #f0dfaf">DynamicEndpointHelper
</span><span style="color: #dcdccc">{
    </span><span style="color: #7f9f7f">// Put the development server site URL including the trailing slash
    // This should be same as what's set in the Dropthings web project's 
    // properties as the URL of the site in development server
    </span><span style="color: #eaeaac">private const string </span><span style="color: #dfdfbf">BaseUrl </span><span style="color: #dcdccc">= </span><span style="color: #c89191">&quot;http://localhost:8000/Dropthings/&quot;</span><span style="color: #dcdccc">;

    </span><span style="color: #eaeaac">public static string </span><span style="color: #dfdfbf">ResolveEndpointUrl</span><span style="color: #dcdccc">(</span><span style="color: #eaeaac">string </span><span style="color: #dfdfbf">endpointUrl</span><span style="color: #dcdccc">, </span><span style="color: #eaeaac">string </span><span style="color: #dfdfbf">xapPath</span><span style="color: #dcdccc">)
    {
        </span><span style="color: #eaeaac">string </span><span style="color: #dfdfbf">baseUrl </span><span style="color: #dcdccc">= </span><span style="color: #dfdfbf">xapPath</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Substring</span><span style="color: #dcdccc">(</span><span style="color: #8acccf">0</span><span style="color: #dcdccc">, </span><span style="color: #dfdfbf">xapPath</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">IndexOf</span><span style="color: #dcdccc">(</span><span style="color: #c89191">&quot;ClientBin&quot;</span><span style="color: #dcdccc">));
        </span><span style="color: #eaeaac">string </span><span style="color: #dfdfbf">relativeEndpointUrl </span><span style="color: #dcdccc">= </span><span style="color: #dfdfbf">endpointUrl</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Substring</span><span style="color: #dcdccc">(</span><span style="color: #dfdfbf">BaseUrl</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Length</span><span style="color: #dcdccc">);
        </span><span style="color: #eaeaac">string </span><span style="color: #dfdfbf">dynamicEndpointUrl </span><span style="color: #dcdccc">= </span><span style="color: #dfdfbf">baseUrl </span><span style="color: #dcdccc">+ </span><span style="color: #dfdfbf">relativeEndpointUrl</span><span style="color: #dcdccc">;
        </span><span style="color: #eaeaac">return </span><span style="color: #dfdfbf">dynamicEndpointUrl</span><span style="color: #dcdccc">;
    }
}

</span></pre>

<p>In the Silverlight app, I construct the Service Client this way:</p>

<pre class="code"><span style="color: #eaeaac">private </span><span style="color: #dfdfbf">DropthingsProxy</span><span style="color: #dcdccc">.</span><span style="color: #f0dfaf">ProxyServiceClient </span><span style="color: #dfdfbf">GetProxyService</span><span style="color: #dcdccc">()
{
    </span><span style="color: #dfdfbf">DropthingsProxy</span><span style="color: #dcdccc">.</span><span style="color: #f0dfaf">ProxyServiceClient </span><span style="color: #dfdfbf">service </span><span style="color: #dcdccc">= </span><span style="color: #eaeaac">new </span><span style="color: #dfdfbf">DropthingsProxy</span><span style="color: #dcdccc">.</span><span style="color: #f0dfaf">ProxyServiceClient</span><span style="color: #dcdccc">();
    </span><span style="color: #dfdfbf">service</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Endpoint</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Address </span><span style="color: #dcdccc">= </span><span style="color: #eaeaac">new </span><span style="color: #f0dfaf">EndpointAddress</span><span style="color: #dcdccc">(
        </span><span style="color: #f0dfaf">DynamicEndpointHelper</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">ResolveEndpointUrl</span><span style="color: #dcdccc">(</span><span style="color: #dfdfbf">service</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Endpoint</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Address</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Uri</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">ToString</span><span style="color: #dcdccc">(), 
        </span><span style="color: #f0dfaf">App</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Current</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Host</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">Source</span><span style="color: #dcdccc">.</span><span style="color: #dfdfbf">ToString</span><span style="color: #dcdccc">()));
    </span><span style="color: #eaeaac">return </span><span style="color: #dfdfbf">service</span><span style="color: #dcdccc">;
}
</span></pre>

<p>After creating the service client with default setting, it changes the endpoint URL to the currently running website’s URL. This solution works when the WCF services are exposed from the same web application. If you have the WCF services hosted on a different domain and you are making cross domain calls to the WCF service then this will not work. In that case, you will have to find out what’s the domain of the WCF service and then use that instead of localhost. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F&amp;title=Dynamically+set+WCF+Endpoint+in+Silverlight" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F&amp;title=Dynamically+set+WCF+Endpoint+in+Silverlight" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F&amp;title=Dynamically+set+WCF+Endpoint+in+Silverlight" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F&amp;headline=Dynamically+set+WCF+Endpoint+in+Silverlight" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Dynamically+set+WCF+Endpoint+in+Silverlight&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Dynamically+set+WCF+Endpoint+in+Silverlight&amp;u=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Dynamically+set+WCF+Endpoint+in+Silverlight&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Dynamically+set+WCF+Endpoint+in+Silverlight&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Dynamically+set+WCF+Endpoint+in+Silverlight&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F&amp;title=Dynamically+set+WCF+Endpoint+in+Silverlight&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fdynamically-set-wcf-endpoint-in-silverlight%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_PpSQlenER4:gwra4gYHrlQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_PpSQlenER4:gwra4gYHrlQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=_PpSQlenER4:gwra4gYHrlQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_PpSQlenER4:gwra4gYHrlQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=_PpSQlenER4:gwra4gYHrlQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=_PpSQlenER4:gwra4gYHrlQ:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/_PpSQlenER4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/dynamically-set-wcf-endpoint-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/dynamically-set-wcf-endpoint-in-silverlight/</feedburner:origLink></item>
		<item>
		<title>Ten Caching Mistakes that Break your App</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/4lraOzN8Ipc/</link>
		<comments>http://omaralzabir.com/ten-caching-mistakes-that-break-your-app/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 18:26:00 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/ten-caching-mistakes-that-break-your-app/</guid>
		<description><![CDATA[ 
Caching frequently used objects, that are expensive to fetch from the source, makes application perform faster under high load. It helps scale an application under concurrent requests. But some hard to notice mistakes can lead the application to suffer under high load, let alone making it perform better, especially when you are using distributed caching [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Caching frequently used objects, that are expensive to fetch from the source, makes application perform faster under high load. It helps scale an application under concurrent requests. But some hard to notice mistakes can lead the application to suffer under high load, let alone making it perform better, especially when you are using distributed caching where there’s separate cache server or cache application that stores the items. Moreover, code that works fine using in-memory cache can fail when the cache is made out-of-process. Here I will show you some common distributed caching mistakes that will help you make better decision when to cache and when not to cache.</p>
<p>Here are the top 10 mistakes I have seen:</p>
<ol>
<li>Relying on .NET’s default serializer. </li>
<li>Storing large objects in a single cache item. </li>
<li>Using cache to share objects between threads. </li>
<li>Assuming items will be in cache immediately after storing it. </li>
<li>Storing entire collection with nested objects. </li>
<li>Storing parent-child objects together and also separately. </li>
<li>Caching Configuration settings. </li>
<li>Caching Live Objects that has open handle to stream, file, registry, or network. </li>
<li>Storing same item using multiple keys. </li>
<li>Not updating or deleting items in cache after updating or deleting them on persistent storage. </li>
</ol>
<p>Let’s see what they are and how to avoid them.</p>
<p><a href="http://www.codeproject.com/KB/web-cache/cachingmistakes.aspx">http://www.codeproject.com/KB/web-cache/cachingmistakes.aspx</a></p>
<p>Please vote if you find this useful.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F&amp;title=Ten+Caching+Mistakes+that+Break+your+App" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F&amp;title=Ten+Caching+Mistakes+that+Break+your+App" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F&amp;title=Ten+Caching+Mistakes+that+Break+your+App" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F&amp;headline=Ten+Caching+Mistakes+that+Break+your+App" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Ten+Caching+Mistakes+that+Break+your+App&amp;url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Ten+Caching+Mistakes+that+Break+your+App&amp;u=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Ten+Caching+Mistakes+that+Break+your+App&amp;url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Ten+Caching+Mistakes+that+Break+your+App&amp;url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Ten+Caching+Mistakes+that+Break+your+App&amp;url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F&amp;title=Ten+Caching+Mistakes+that+Break+your+App&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Ften-caching-mistakes-that-break-your-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=4lraOzN8Ipc:Xtgrx0E1fPw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=4lraOzN8Ipc:Xtgrx0E1fPw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=4lraOzN8Ipc:Xtgrx0E1fPw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=4lraOzN8Ipc:Xtgrx0E1fPw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=4lraOzN8Ipc:Xtgrx0E1fPw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=4lraOzN8Ipc:Xtgrx0E1fPw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/4lraOzN8Ipc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/ten-caching-mistakes-that-break-your-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/ten-caching-mistakes-that-break-your-app/</feedburner:origLink></item>
		<item>
		<title>Dropthings now available from Microsoft/Web</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/I5cT7QyOlHc/</link>
		<comments>http://omaralzabir.com/dropthings-now-available-from-microsoftweb/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 11:15:52 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>dropthings</category>

		<guid isPermaLink="false">http://omaralzabir.com/dropthings-now-available-from-microsoftweb/</guid>
		<description><![CDATA[Dropthings is now available on Microsoft/Web. You can now install it using the Web Platform Installer. I will soon write an article how to make an installer that can install a ASP.NET website, a SQL Server database, setup web.config files, setup directory permissions (eg App_Data) etc. It wasn’t straightforward and I learnt some best practices [...]]]></description>
			<content:encoded><![CDATA[<p>Dropthings is now available on Microsoft/Web. You can now install it using the Web Platform Installer. I will soon write an article how to make an installer that can install a ASP.NET website, a SQL Server database, setup web.config files, setup directory permissions (eg App_Data) etc. It wasn’t straightforward and I learnt some best practices from the Microsoft/Web team. But for now, go ahead and download the app and build cool sites out of it.<a href="http://www.microsoft.com/web/gallery/Dropthings.aspx"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2010/09/image3.png" width="591" height="314" /></a></p>  <p><a href="http://www.microsoft.com/web/gallery/Dropthings.aspx">http://www.microsoft.com/web/gallery/Dropthings.aspx</a></p>  <p>Please vote for my app. It will help spread the open source effort.&#160; </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F&amp;title=Dropthings+now+available+from+Microsoft%2FWeb" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F&amp;title=Dropthings+now+available+from+Microsoft%2FWeb" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F&amp;title=Dropthings+now+available+from+Microsoft%2FWeb" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F&amp;headline=Dropthings+now+available+from+Microsoft%2FWeb" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Dropthings+now+available+from+Microsoft%2FWeb&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Dropthings+now+available+from+Microsoft%2FWeb&amp;u=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Dropthings+now+available+from+Microsoft%2FWeb&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Dropthings+now+available+from+Microsoft%2FWeb&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Dropthings+now+available+from+Microsoft%2FWeb&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F&amp;title=Dropthings+now+available+from+Microsoft%2FWeb&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fdropthings-now-available-from-microsoftweb%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=I5cT7QyOlHc:G10t2O8uw4k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=I5cT7QyOlHc:G10t2O8uw4k:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=I5cT7QyOlHc:G10t2O8uw4k:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=I5cT7QyOlHc:G10t2O8uw4k:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=I5cT7QyOlHc:G10t2O8uw4k:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=I5cT7QyOlHc:G10t2O8uw4k:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/I5cT7QyOlHc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/dropthings-now-available-from-microsoftweb/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/dropthings-now-available-from-microsoftweb/</feedburner:origLink></item>
		<item>
		<title>How to make screencasts in optimized animated GIF for free</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/xACALxobnto/</link>
		<comments>http://omaralzabir.com/how-to-make-screencasts-in-optimized-animated-gif-for-free/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 05:48:03 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>tips</category>
		<category>tools</category>

		<guid isPermaLink="false">http://omaralzabir.com/how-to-make-screencasts-in-optimized-animated-gif-for-free/</guid>
		<description><![CDATA[I have been using animated GIFs to show short screencasts in my blogs and articles. Animated GIF is supported by all browsers and supports virtually any website in the world where even Flash is blocked. A picture is worth a thousand words, and an animation is worth a thousand multiplied by [frames in animation] words. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using animated GIFs to show short screencasts in my blogs and articles. Animated GIF is supported by all browsers and supports virtually any website in the world where even Flash is blocked. A picture is worth a thousand words, and an animation is worth a thousand multiplied by [frames in animation] words. So, I have been looking for a complete free solution to capturing screencasts and then converting it to animated GIF and then heavily compressing it.</p>  <p>First use <a href="http://camstudio.org/">CamStudio</a> to capture the screenshot into an AVI. Before you capture, you need to set the CamStudio video recording setting to one frame per second, otherwise there will be too many frames in your animated GIF. You can set it so 2 or more frames per second if you are recording some frequent changes on the screen.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/09/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2010/09/image_thumb.png" width="380" height="368" /></a> </p>  <p>This will put one frame in animated GIF per second. Since animated GIF gets pretty large due to its lossless primitive compression, you need to put as little frames on it as possible. </p>  <p>Now you can record screenshot using CamStudio and save it in an AVI file.</p>  <p>Once you have the AVI file, you need to open the AVI using <a href="http://download.cnet.com/Microsoft-GIF-Animator/3000-18512_4-12053.html">Microsoft GIF animator</a>. </p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/09/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://omaralzabir.com/wp-content/uploads/2010/09/image_thumb1.png" width="375" height="447" /></a> </p>  <p>Then you need to click the “Select all” button and go to Image tab and put 100 on the Duration. This will set each frame delay to 1 second, exactly what you have set in the CamStudio Video Options. If you have set 2 frames per second in CamStudio, then you need to set 50 in Microsoft GIF Animator.</p>  <p>Now you can save the file as an animated GIF and use it wherever you like.</p>  <p>I would highly recommend you further optimize the animated GIF and eliminate duplicate frames and use some advanced compression. For this you can use the <a href="http://www.imagemagick.org/">ImageMagick</a> utility. You will find various ways to optimize animated GIF on <a href="http://www.imagemagick.org/Usage/anim_opt/">this page</a>. I just use the following command line and it gives me pretty good output:</p>  <div id="codeSnippetWrapper">   <pre id="codeSnippet" class="csharpcode">c:\Program Files (x86)\ImageMagick-6<span class="attr">.</span>6<span class="attr">.</span>3-Q16<span class="kwrd">&gt;</span>convert SourceImage<span class="attr">.</span>gif -layers OptimizePlus DestImage<span class="attr">.</span>gif</pre>

  <br /></div>
This optimizes animated GIFs pretty well. I have seen average 60% reduction on screen captures having white background and when there’s no translucent areas (eg Windows Vista/7 title bars). 

<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F&amp;title=How+to+make+screencasts+in+optimized+animated+GIF+for+free" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F&amp;title=How+to+make+screencasts+in+optimized+animated+GIF+for+free" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F&amp;title=How+to+make+screencasts+in+optimized+animated+GIF+for+free" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F&amp;headline=How+to+make+screencasts+in+optimized+animated+GIF+for+free" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=How+to+make+screencasts+in+optimized+animated+GIF+for+free&amp;url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=How+to+make+screencasts+in+optimized+animated+GIF+for+free&amp;u=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=How+to+make+screencasts+in+optimized+animated+GIF+for+free&amp;url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=How+to+make+screencasts+in+optimized+animated+GIF+for+free&amp;url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=How+to+make+screencasts+in+optimized+animated+GIF+for+free&amp;url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F&amp;title=How+to+make+screencasts+in+optimized+animated+GIF+for+free&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fhow-to-make-screencasts-in-optimized-animated-gif-for-free%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=xACALxobnto:NA7lE5YI7No:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=xACALxobnto:NA7lE5YI7No:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=xACALxobnto:NA7lE5YI7No:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=xACALxobnto:NA7lE5YI7No:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=xACALxobnto:NA7lE5YI7No:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=xACALxobnto:NA7lE5YI7No:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/xACALxobnto" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/how-to-make-screencasts-in-optimized-animated-gif-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/how-to-make-screencasts-in-optimized-animated-gif-for-free/</feedburner:origLink></item>
		<item>
		<title>Production Challenges of ASP.NET Website – recording of my talk</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/6sGRIe-8F8Q/</link>
		<comments>http://omaralzabir.com/production-challenges-of-asp-net-website-recording-of-my-talk/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 04:59:09 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>production</category>

		<guid isPermaLink="false">http://omaralzabir.com/production-challenges-of-asp-net-website-recording-of-my-talk/</guid>
		<description><![CDATA[“It works in my PC”, the common dialog from Developers. But on production CPU burns out, disks go crazy, your site stops responding every now and then, you have to frequently recycle application pool, or even restart windows to bring things back to normal for a while.  As your site grows from thousands to [...]]]></description>
			<content:encoded><![CDATA[<p>“It works in my PC”, the common dialog from Developers. But on production CPU burns out, disks go crazy, your site stops responding every now and then, you have to frequently recycle application pool, or even restart windows to bring things back to normal for a while.</p>  <p>As your site grows from thousands to millions of users, delivering new features and bug fixes becomes an increasingly complex process where you have to ensure the performance and stability of the site is not compromised. Let me tell you some stories from the trenches how I grew my hot startup Pageflakes (acquired by MySpace founder Brad Greenspan) from thousands to millions of visits within a year surviving through production software, hardware, process, people challenges and how you can avoid and solve them using my handy collection of articles and tools.</p>  <p>Watch the presentation I made in a LIDNUG session:</p>  <p><a href="http://www.lidnug.org/Archives.aspx">http://www.lidnug.org/Archives.aspx</a></p>  <p>Find the session with the title “Production Challenges of ASP.NET Website”.</p>  <p>Unfortunately they could not record the whole session. But whatever is there should be useful for you. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F&amp;title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F&amp;title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F&amp;title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F&amp;headline=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk&amp;url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk&amp;u=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk&amp;url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk&amp;url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk&amp;url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F&amp;title=Production+Challenges+of+ASP.NET+Website+%26ndash%3B+recording+of+my+talk&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fproduction-challenges-of-asp-net-website-recording-of-my-talk%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=6sGRIe-8F8Q:oqOyyKBqtTs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=6sGRIe-8F8Q:oqOyyKBqtTs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=6sGRIe-8F8Q:oqOyyKBqtTs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=6sGRIe-8F8Q:oqOyyKBqtTs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=6sGRIe-8F8Q:oqOyyKBqtTs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=6sGRIe-8F8Q:oqOyyKBqtTs:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/6sGRIe-8F8Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/production-challenges-of-asp-net-website-recording-of-my-talk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/production-challenges-of-asp-net-website-recording-of-my-talk/</feedburner:origLink></item>
		<item>
		<title>Building High Performance Queue in Database for storing Orders, Notifications, Tasks</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/KOCIXpsUlUc/</link>
		<comments>http://omaralzabir.com/building-high-performance-queue-in-database-for-storing-orders-notifications-tasks/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 07:05:36 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>performance</category>
		<category>sql server</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/building-high-performance-queue-in-database-for-storing-orders-notifications-tasks/</guid>
		<description><![CDATA[We have Queues everywhere. There are queues for asynchronously sending notifications like email and SMS in most websites. E-Commerce sites have queues for storing orders, processing and dispatching them. Factory Assembly line automation systems have queues for running tasks in parallel, in a certain order. Queue is a widely used data structure that sometimes have [...]]]></description>
			<content:encoded><![CDATA[<p>We have Queues everywhere. There are queues for asynchronously sending notifications like email and SMS in most websites. E-Commerce sites have queues for storing orders, processing and dispatching them. Factory Assembly line automation systems have queues for running tasks in parallel, in a certain order. Queue is a widely used data structure that sometimes have to be created in a database instead of using specialized queue technologies like MSMQ. Running a high performance and highly scalable queue using database technologies is a big challenge and it’s hard to maintain when the queue starts to get millions of rows queued and dequeued per day. Let me show you some common design mistakes made in designing Queue-like tables and how to get maximum performance and scalability from a queue implemented using simple database features. </p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/09/Queue.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Queue" border="0" alt="Queue" src="http://omaralzabir.com/wp-content/uploads/2010/09/Queue_thumb.png" width="549" height="472" /></a> </p>  <p>Let’s first identify the challenges you have in such queue tables:</p>  <ul>   <li>The table is both read and write. Thus queuing and dequeuing impact each other and cause lock contention, transaction deadlocks, IO timeouts etc under heavy load. </li>    <li>When multiple receivers try to read from the same queue, they randomly get duplicate items picked out of the queue, thus resulting in duplicate processing. You need to implement some kind of high performance row lock on the queue so that same item never gets picked up by concurrent receivers. </li>    <li>The Queue table needs to store rows in certain order and read in certain order, which is an index design challenge. It’s not always first in and first out. Sometimes Orders have higher priority and need to be processed regardless of when they are queued. </li>    <li>The Queue table needs to store serialized objects in XML or binary form, which becomes a storage and index rebuild challenge. You can’t rebuild index on the Queue table because it contains text and/or binary fields. Thus the tables keep getting slower and slower every day and eventually queries start timing out until you take a downtime and rebuild the indexes. </li>    <li>During dequeue, a batch of rows are selected, updated and then returned for processing. You have a “State” column that defines the state of the items. During dequeue, you select items of certain state. Now State only has a small set of values eg PENDING, PROCESSING, PROCESSED, ARCHIVED. As a result, you cannot create index on “State” column because that does not give you enough selectivity. There can be thousands of rows having the same state. As a result, any dequeue operation results in a clustered index scan that’s both CPU and IO intensive and produces lock contention. </li>    <li>During dequeue, you cannot just remove the rows from table because that causes fragmentation in the table. Moreover, you need to retry orders/jobs/notification N times&#160; incase they fail on first attempt. This means rows are stored for longer period, indexes keep growing and dequeue gets slower day by day. </li>    <li>You have to archive processed items from the Queue table to a different table or database, in order to keep the main Queue table small. That means moving large amount of rows of some particular status to another database. Such large data removal leaves the table highly defragmented causing poor queue/dequeue performance. </li>    <li>You have a 24&#215;7 business. You have no maintenance window where you can take a downtime and archive large number of rows. This means you have to continuously archive rows without affecting production queue-dequeue traffic. </li> </ul>  <p>If you have implemented such queue tables, you might have suffered from one or more of the above challenges. Let me give you some tips on how to overcome these challenges and how to design and maintain a high performance queue table.</p>  <p>Read the article for details:</p>  <p><a href="http://www.codeproject.com/KB/database/fastqueue.aspx">http://www.codeproject.com/KB/database/fastqueue.aspx</a></p>  <p>Please vote if you find this useful. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F&amp;title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F&amp;title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F&amp;title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F&amp;headline=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks&amp;u=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F&amp;title=Building+High+Performance+Queue+in+Database+for+storing+Orders%2C+Notifications%2C+Tasks&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fbuilding-high-performance-queue-in-database-for-storing-orders-notifications-tasks%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=KOCIXpsUlUc:mzDv5r_vO2I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=KOCIXpsUlUc:mzDv5r_vO2I:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=KOCIXpsUlUc:mzDv5r_vO2I:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=KOCIXpsUlUc:mzDv5r_vO2I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=KOCIXpsUlUc:mzDv5r_vO2I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=KOCIXpsUlUc:mzDv5r_vO2I:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/KOCIXpsUlUc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/building-high-performance-queue-in-database-for-storing-orders-notifications-tasks/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/building-high-performance-queue-in-database-for-storing-orders-notifications-tasks/</feedburner:origLink></item>
		<item>
		<title>Exporting normalized relational data from database to flat file format</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/afxv-ZXaaOU/</link>
		<comments>http://omaralzabir.com/exporting-normalized-relational-data-from-database-to-flat-file-format/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 17:09:19 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>sql server</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/exporting-normalized-relational-data-from-database-to-flat-file-format/</guid>
		<description><![CDATA[Sometimes you need to export relational normalized data into flat files where a single row comes from various tables. For example, say you want to export all customer records along with their work and home address, and primary phone number in a single row. But the address and contact information are coming from different tables [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to export relational normalized data into flat files where a single row comes from various tables. For example, say you want to export all customer records along with their work and home address, and primary phone number in a single row. But the address and contact information are coming from different tables and there can be multiple rows in those table for a single customer. Sometimes there can be no row available in address/phone table for a customer. In such a case, neither INNER JOIN, nor LEFT JOIN/OUTER JOIN will work. How do you do it?</p>  <p>Solution is to use OUTER APPLY.</p>  <p>Consider some tables like this:</p>  <p><strong>Customer</strong> Table</p>  <table border="1" cellspacing="0" cellpadding="3" width="300"><tbody>     <tr>       <td width="87"><strong>CustomerID</strong></td>        <td width="74"><strong>FirstName</strong></td>        <td width="74"><strong>LastName</strong></td>        <td width="63"><strong>DOB</strong></td>     </tr>      <tr>       <td width="87">1</td>        <td width="74">Scott</td>        <td width="74">Guthrie</td>        <td width="63">1/1/1950</td>     </tr>      <tr>       <td width="87">2</td>        <td width="74">Omar</td>        <td width="76">AL Zabir</td>        <td width="67">1/1/1982</td>     </tr>   </tbody></table>  <p><strong>Contact</strong> table</p>  <table border="1" cellspacing="0" cellpadding="3" width="345"><tbody>     <tr>       <td width="85"><strong>CustomerID</strong></td>        <td width="91"><strong>ContactType</strong></td>        <td width="96"><strong>ContactValue</strong></td>        <td width="71"><strong>IsPrimary</strong></td>     </tr>      <tr>       <td width="85">1</td>        <td width="91">WorkAddress</td>        <td width="96">Microsoft</td>        <td width="71">TRUE</td>     </tr>      <tr>       <td width="85">1</td>        <td width="91">HomeAddress</td>        <td width="96">Seattle</td>        <td width="71">FALSE</td>     </tr>      <tr>       <td width="85">1</td>        <td width="91">Phone</td>        <td width="96">345345345</td>        <td width="71">FALSE</td>     </tr>      <tr>       <td width="85">1</td>        <td width="91">Phone</td>        <td width="96">123123123</td>        <td width="71">TRUE</td>     </tr>      <tr>       <td width="85">2</td>        <td width="91">WorkAddress</td>        <td width="96">London</td>        <td width="71">TRUE</td>     </tr>      <tr>       <td width="85">2</td>        <td width="91">Phone</td>        <td width="96">1312123123</td>        <td width="71">FALSE</td>     </tr>   </tbody></table>  <p>We need to create a flat file export from this where the output needs to look like:</p>  <table border="1" cellspacing="0" cellpadding="3" width="596"><tbody>     <tr>       <td width="85"><strong><font size="1">CustomerID</font></strong></td>        <td width="72"><strong><font size="1">FirstName</font></strong></td>        <td width="72"><strong><font size="1">LastName</font></strong></td>        <td width="61"><strong><font size="1">DOB</font></strong></td>        <td width="99"><strong><font size="1">HomeAddress</font></strong></td>        <td width="97"><strong><font size="1">WorkAddress</font></strong></td>        <td width="99"><strong><font size="1">PrimaryPhone</font></strong></td>        <td width="9"><font size="1">IsPhonePrimary</font></td>     </tr>      <tr>       <td width="85"><font size="1">1</font></td>        <td width="72"><font size="1">Scott</font></td>        <td width="72"><font size="1">Guthrie</font></td>        <td width="61"><font size="1">1/1/1950</font></td>        <td width="99"><font size="1">Seattle</font></td>        <td width="97"><font size="1">Microsoft</font></td>        <td width="99"><font size="1">123123123</font></td>        <td width="9"><font size="1">Yes</font></td>     </tr>      <tr>       <td width="85"><font size="1">2</font></td>        <td width="72"><font size="1">Omar</font></td>        <td width="72"><font size="1">AL Zabir</font></td>        <td width="61"><font size="1">1/1/1982</font></td>        <td width="99"><font size="1">No Home Address</font></td>        <td width="97"><font size="1">London</font></td>        <td width="99"><font size="1">1312123123</font></td>        <td width="9"><font size="1">No</font></td>     </tr>   </tbody></table>  <p>There are some complex requirement in the output:</p>  <ul>   <li>If customer has multiple phone, then it needs to select the one which is flagged as primary. </li>    <li>If customer has no home address, then it needs to show “No home address” instead of NULL. </li>    <li>It needs to tell if the phone address we got is primary phone or not. </li> </ul>  <p>The query to generate this will be:</p>  <div id="codeSnippetWrapper">   <pre id="codeSnippet" class="csharpcode"><span class="kwrd">SELECT</span> <br />    c.CustomerID,<br />    c.FirstName,<br />    c.LastName,<br />    c.DOB,<br /><br />    <span class="str">'HomeAddress'</span> = <br />    <span class="kwrd">CASE</span> <br />        <span class="kwrd">WHEN</span> home.ContactValue <span class="kwrd">IS</span> <span class="kwrd">NULL</span> <span class="kwrd">THEN</span> <span class="str">'No Home Address'</span><br />        <span class="kwrd">ELSE</span> home.ContactValue<br />    <span class="kwrd">END</span>,<br />    <span class="kwrd">work</span>.ContactValue,<br />    phone.ContactValue <span class="kwrd">as</span> PrimaryPhone,<br />    <span class="str">'IsPhonePrimary'</span> = <br />    <span class="kwrd">CASE</span> <br />        <span class="kwrd">WHEN</span> phone.IsPrimary = 1 <span class="kwrd">THEN</span> <span class="str">'Yes'</span><br />        <span class="kwrd">ELSE</span> <span class="str">'No'</span><br />    <span class="kwrd">END</span><br /><span class="kwrd">FROM</span> Customer c<br /><br /><span class="kwrd">OUTER</span> APPLY (<br />    <span class="kwrd">SELECT</span> <span class="kwrd">TOP</span> 1 ContactValue <span class="kwrd">from</span> Contact <span class="kwrd">WHERE</span> CustomerID = c.CustomerID<br />    <span class="kwrd">AND</span> ContactType = <span class="str">'HomeAddress'</span><br />    <span class="kwrd">ORDER</span> <span class="kwrd">BY</span> IsPrimary <span class="kwrd">DESC</span><br />) <span class="kwrd">AS</span> home<br /><br /><span class="kwrd">OUTER</span> APPLY (<br />    <span class="kwrd">SELECT</span> <span class="kwrd">TOP</span> 1 ContactValue <span class="kwrd">from</span> Contact <span class="kwrd">WHERE</span> CustomerID = c.CustomerID<br />    <span class="kwrd">AND</span> ContactType = <span class="str">'WorkAddress'</span><br />    <span class="kwrd">ORDER</span> <span class="kwrd">BY</span> IsPrimary <span class="kwrd">DESC</span><br />) <span class="kwrd">AS</span> <span class="kwrd">work</span><br /><br /><span class="kwrd">OUTER</span> APPLY (<br />    <span class="kwrd">SELECT</span> <span class="kwrd">TOP</span> 1 ContactValue, IsPrimary <span class="kwrd">from</span> Contact <span class="kwrd">WHERE</span> CustomerID = c.CustomerID<br />    <span class="kwrd">AND</span> ContactType = <span class="str">'Phone'</span><br />    <span class="kwrd">ORDER</span> <span class="kwrd">BY</span> IsPrimary <span class="kwrd">DESC</span><br />) <span class="kwrd">AS</span> phone<br /></pre>

  <br /></div>

<p>All the tricks are in the OUTER APPLY blocks. OUTER APPLY selects the row that needs to appear as the value of the columns in the output after the customer table fields. </p>

<p>The primary address is selected by reverse ordering the rows selected from Contact table by IsPrimary field. Thus the rows having True comes first. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F&amp;title=Exporting+normalized+relational+data+from+database+to+flat+file+format" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F&amp;title=Exporting+normalized+relational+data+from+database+to+flat+file+format" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F&amp;title=Exporting+normalized+relational+data+from+database+to+flat+file+format" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F&amp;headline=Exporting+normalized+relational+data+from+database+to+flat+file+format" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Exporting+normalized+relational+data+from+database+to+flat+file+format&amp;url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Exporting+normalized+relational+data+from+database+to+flat+file+format&amp;u=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Exporting+normalized+relational+data+from+database+to+flat+file+format&amp;url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Exporting+normalized+relational+data+from+database+to+flat+file+format&amp;url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Exporting+normalized+relational+data+from+database+to+flat+file+format&amp;url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F&amp;title=Exporting+normalized+relational+data+from+database+to+flat+file+format&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fexporting-normalized-relational-data-from-database-to-flat-file-format%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=afxv-ZXaaOU:d39Z7OoyL2g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=afxv-ZXaaOU:d39Z7OoyL2g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=afxv-ZXaaOU:d39Z7OoyL2g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=afxv-ZXaaOU:d39Z7OoyL2g:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=afxv-ZXaaOU:d39Z7OoyL2g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=afxv-ZXaaOU:d39Z7OoyL2g:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/afxv-ZXaaOU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/exporting-normalized-relational-data-from-database-to-flat-file-format/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/exporting-normalized-relational-data-from-database-to-flat-file-format/</feedburner:origLink></item>
		<item>
		<title>Website diagnostics page to diagnose your ASP.NET website</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/cn87xOCuLXk/</link>
		<comments>http://omaralzabir.com/website-diagnostics-page-to-diagnose-your-asp-net-website/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 18:51:21 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net</category>
		<category>production</category>

		<guid isPermaLink="false">http://omaralzabir.com/website-diagnostics-page-to-diagnose-your-asp-net-website/</guid>
		<description><![CDATA[Whenever you change web.config file or deploy your website on a new environment, you have to try out many relevant features to confirm if the configuration changes or the environment is correct. Sometimes you have to run a smoke test on the website to confirm if the site is running fine. Moreover, if some external [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever you change web.config file or deploy your website on a new environment, you have to try out many relevant features to confirm if the configuration changes or the environment is correct. Sometimes you have to run a smoke test on the website to confirm if the site is running fine. Moreover, if some external database, webservice or network connectivity is down, it takes time to nail down exactly where the problem is. Having a self-diagnostics page on your website like the one you see on your printer can help identify exactly where’s the problem. Here’s a way how you can quickly create a simple self-diagnostics page in a single page without spending too much effort. This diagnostics page tests for common configuration settings like connection string, ASP.NET Membership configurations, SMTP settings, <u>&lt;appSettings&gt;</u> file paths and URLs items and some application specific settings to confirm if the changes are all correct.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/08/Diagnosticspage.gif"><img style="display: inline" title="Diagnostics page" alt="Diagnostics page" src="http://omaralzabir.com/wp-content/uploads/2010/08/Diagnosticspage_thumb.gif" width="668" height="432" /></a> </p>  <p></p>  <p></p>  <p>Read how to build such a diagnostics page:</p>  <p><a title="http://www.codeproject.com/KB/aspnet/selfdiagnostics.aspx" href="http://www.codeproject.com/KB/aspnet/selfdiagnostics.aspx">http://www.codeproject.com/KB/aspnet/selfdiagnostics.aspx</a></p>  <p>Vote for me if you find this useful.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F&amp;title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F&amp;title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F&amp;title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F&amp;headline=Website+diagnostics+page+to+diagnose+your+ASP.NET+website" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Website+diagnostics+page+to+diagnose+your+ASP.NET+website&amp;u=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F&amp;title=Website+diagnostics+page+to+diagnose+your+ASP.NET+website&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fwebsite-diagnostics-page-to-diagnose-your-asp-net-website%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=cn87xOCuLXk:bYBnngDbs18:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=cn87xOCuLXk:bYBnngDbs18:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=cn87xOCuLXk:bYBnngDbs18:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=cn87xOCuLXk:bYBnngDbs18:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=cn87xOCuLXk:bYBnngDbs18:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=cn87xOCuLXk:bYBnngDbs18:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/cn87xOCuLXk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/website-diagnostics-page-to-diagnose-your-asp-net-website/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/website-diagnostics-page-to-diagnose-your-asp-net-website/</feedburner:origLink></item>
		<item>
		<title>WatinN to automate browser and test sophisticated ASP.NET AJAX sites</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/l1rK9bCs7ew/</link>
		<comments>http://omaralzabir.com/watinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 15:49:11 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>asp.net ajax</category>
		<category>BDD</category>
		<category>TDD</category>
		<category>testing</category>

		<guid isPermaLink="false">http://omaralzabir.com/watinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites/</guid>
		<description><![CDATA[WatiN is a great .NET library for writing automated browser based tests that uses real browser to go to websites, perform actions and check for browser output. Combined with a unit test library like xUnit, you can use WatiN to perform automated regression tests on your websites and save many hours of manual testing every [...]]]></description>
			<content:encoded><![CDATA[<p>WatiN is a great .NET library for writing automated browser based tests that uses real browser to go to websites, perform actions and check for browser output. Combined with a unit test library like <a href="http://xunit.codeplex.com">xUnit</a>, you can use <a href="http://watin.sourceforge.net/">WatiN</a> to perform automated regression tests on your websites and save many hours of manual testing every release. Moreover, WatiN can be used to stress test Javascripts on the page as it can push the browser to perform operations repeatedly and measure how long it takes for Javascripts to run. Thus you can test your Javascripts for performance, rendering speed of your website and ensure the overall presentation is fast and smooth for users. </p>  <p>Read this article for details:</p>  <p><a href="http://www.codeproject.com/KB/aspnet/watinajaxtest.aspx">http://www.codeproject.com/KB/aspnet/watinajaxtest.aspx</a></p>  <p>I have written some extension methods for WatiN to help facilitate AJAX related tests, especially with ASP.NET UpdatePanel, jQuery and dealing with element positions. I will show you how to use these libraries to test sophisticated AJAX websites, like the one I have built &#8211; <a href="http://dropthings.omaralzabir.com/">Dropthings</a>, which is a widget powered ASP.NET AJAX portal using ASP.NET UpdatePanel, jQuery to create a Web 2.0 presentation. You can simulate and test UpdatePanel updates, AJAX calls and UI update and even drag &amp; drop of widgets!</p>  <p>You can see the implementation of automated tests in my <a href="http://code.google.com/p/dropthings">open source project</a> codebase.</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/08/TestControlAdapterOpt.gif"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="TestControlAdapterOpt" border="0" alt="TestControlAdapterOpt" src="http://omaralzabir.com/wp-content/uploads/2010/08/TestControlAdapterOpt_thumb.gif" width="668" height="432" /></a></p>  <p>Tests written using WatiN replaces the need for human driven tests and thus sheds significant time off your regular regression test suite. Moreover, it empowers developers with a way to quickly run regression tests whenever they need to, without waiting for human QA resource’s availability. When you hook it with xUnit like test frameworks and integrate with your continuous build, you can run UI tests automatically to test all the UI scenarios overnight after your nightly build and generate reports without requiring any manual intervention. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F&amp;title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F&amp;title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F&amp;title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F&amp;headline=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites&amp;u=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F&amp;title=WatinN+to+automate+browser+and+test+sophisticated+ASP.NET+AJAX+sites&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fwatinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=l1rK9bCs7ew:cfX1mt09UAM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=l1rK9bCs7ew:cfX1mt09UAM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=l1rK9bCs7ew:cfX1mt09UAM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=l1rK9bCs7ew:cfX1mt09UAM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=l1rK9bCs7ew:cfX1mt09UAM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=l1rK9bCs7ew:cfX1mt09UAM:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/l1rK9bCs7ew" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/watinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/watinn-to-automate-browser-and-test-sophisticated-asp-net-ajax-sites/</feedburner:origLink></item>
		<item>
		<title>User story is worthless, Behavior is what we need</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/O7XG0GCF9Sg/</link>
		<comments>http://omaralzabir.com/user-story-is-worthless-behavior-is-what-we-need/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 17:46:58 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Blog Posts</category>
		<category>BDD</category>
		<category>ideas</category>
		<category>TDD</category>
		<category>testing</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/user-story-is-worthless-behavior-is-what-we-need/</guid>
		<description><![CDATA[User Story is suitable for describing what user needs but not what user does and how system reacts to user actions within different contexts. It basically gives product team a way to quantify their output and let their boss know that they are doing their job. As a developer, you can’t write code from user [...]]]></description>
			<content:encoded><![CDATA[<p>User Story is suitable for describing what user needs but not what user does and how system reacts to user actions within different contexts. It basically gives product team a way to quantify their output and let their boss know that they are doing their job. As a developer, you can’t write code from user stories because you have no clue on what what is the sequence of user actions and system reactions, what are the validations, what APIs to call and so on. As a QA, you can’t test the software from user stories because it does not capture the context, the sequence of events, all possible system reactions. User stories add little value to dev lifecycle. It only helps product team understand how much work they have to do eventually and it helps finance team get a view on how much money people are talking about. But to UI designers, solution designers, developers, they are nothing but blobs of highly imprecise statements that leave room for hundreds of questions to be answered. The absence of “Context” and “Cause and Effect”, and the imprecise way of saying “As a&#8230;I want&#8230; so that&#8230;” leaves room for so many misinterpretations that there’s no way development team can produce software from just user stories without spending significant time all over again analysing the user stories. Software, and the universe eventually, is all about Cause and Effect. The Cause and Effect is not described in a user story.&#160; </p>  <p>Unlike user stories, the “Behavior” suggested by <a href="http://en.wikipedia.org/wiki/Behavior_Driven_Development">Behavior Driven Development (BDD)</a> is a much better approach because the format of a behavior (Given<em>context</em>, When <em>event</em>, Then <em>outcome</em>), when used correctly, lets you think in terms of sequence of events, where the context, event and outcome are captured for each and every action user or system does, and thus works as a definite spec for designing the UI and architecture. It follows the Cause and Effect model, thus can explain how the world (or your software) works. It can be so precise that sometimes a <em>behavior</em> work as guideline for a developer to write a single function! Not just the develoeprs, even the QA team can clearly capture what action they need to perform and how the system should respond. However, to get the real fruit out of <em>behaviors</em>, you need to to write them properly, following the right format. So, let me give you some examples on how you can write good <em>behaviors</em> for UI, business layer, services and even functions and thus eliminate repeated requirement analysis that usually happens throughout the user-story driven development lifecycle.</p>  <p>Read more about how user stories suck and if <em>behavior </em>is used throughout the development lifecycle, it can greatly reduce repeated requirement analysis effort and can make the communication between product, design, development and QA team much more effective:</p>  <p><a href="http://www.codeproject.com/KB/architecture/userstorysucks.aspx">http://www.codeproject.com/KB/architecture/userstorysucks.aspx</a>&#160; </p>  <p>If you like it, vote for it!</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F&amp;title=User+story+is+worthless%2C+Behavior+is+what+we+need" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F&amp;title=User+story+is+worthless%2C+Behavior+is+what+we+need" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F&amp;title=User+story+is+worthless%2C+Behavior+is+what+we+need" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F&amp;headline=User+story+is+worthless%2C+Behavior+is+what+we+need" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=User+story+is+worthless%2C+Behavior+is+what+we+need&amp;url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=User+story+is+worthless%2C+Behavior+is+what+we+need&amp;u=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=User+story+is+worthless%2C+Behavior+is+what+we+need&amp;url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=User+story+is+worthless%2C+Behavior+is+what+we+need&amp;url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=User+story+is+worthless%2C+Behavior+is+what+we+need&amp;url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F&amp;title=User+story+is+worthless%2C+Behavior+is+what+we+need&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fuser-story-is-worthless-behavior-is-what-we-need%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=O7XG0GCF9Sg:qhy2uDl2NnU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=O7XG0GCF9Sg:qhy2uDl2NnU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=O7XG0GCF9Sg:qhy2uDl2NnU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=O7XG0GCF9Sg:qhy2uDl2NnU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=O7XG0GCF9Sg:qhy2uDl2NnU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=O7XG0GCF9Sg:qhy2uDl2NnU:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/O7XG0GCF9Sg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/user-story-is-worthless-behavior-is-what-we-need/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/user-story-is-worthless-behavior-is-what-we-need/</feedburner:origLink></item>
		<item>
		<title>Finally! Entity Framework working in fully disconnected N-tier web app</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/aCJkqcMaAgI/</link>
		<comments>http://omaralzabir.com/finally-entity-framework-working-in-fully-disconnected-n-tier-web-app/#comments</comments>
		<pubDate>Tue, 18 May 2010 03:35:15 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Uncategorized</category>
		<category>.net</category>
		<category>C#</category>
		<category>linq</category>
		<category>TDD</category>
		<category>unit test</category>

		<guid isPermaLink="false">http://omaralzabir.com/finally-entity-framework-working-in-fully-disconnected-n-tier-web-app/</guid>
		<description><![CDATA[Entity Framework was supposed to solve the problem of Linq to SQL, which requires endless hacks to make it work in n-tier world. Not only did Entity Framework solve none of the L2S problems, but also it made it even more difficult to use and hack it for n-tier scenarios. It’s somehow half way between [...]]]></description>
			<content:encoded><![CDATA[<p>Entity Framework was supposed to solve the problem of Linq to SQL, which requires endless hacks to make it work in n-tier world. Not only did Entity Framework solve none of the L2S problems, but also it made it even more difficult to use and hack it for n-tier scenarios. It’s somehow half way between a fully disconnected ORM and a fully connected ORM like Linq to SQL. Some useful features of Linq to SQL are gone – like automatic deferred loading. If you try to do simple select with join, insert, update, delete in a disconnected architecture, you will realize not only you need to make fundamental changes from the top layer to the very bottom layer, but also endless hacks in basic CRUD operations. I will show you in this article how I have&#160; added custom CRUD functions on top of EF’s ObjectContext to make it finally work well in a fully disconnected N-tier web application (my open source Web 2.0 AJAX portal – <a href="http://dropthings.omaralzabir.com/">Dropthings</a>) and how I have produced a <strong>100% unit testable fully n-tier compliant data access layer</strong>following the repository pattern.</p>  <p><a href="http://www.codeproject.com/KB/linq/ef.aspx">http://www.codeproject.com/KB/linq/ef.aspx</a></p>  <p>In .NET 4.0, most of the problems are solved, but not all. So, you should read this article even if you are coding in .NET 4.0. Moreover, there’s enough insight here to help you troubleshoot EF related problems.</p>  <p>You might think “Why bother using EF when Linq to SQL is doing good enough for me.” Linq to SQL is not going to get any innovation from Microsoft anymore. Entity Framework is the future of persistence layer in .NET framework. All the innovations are happening in EF world only, which is frustrating. There’s a <a href="http://blogs.msdn.com/efdesign/">big jump on EF 4.0</a>. So, you should plan to migrate your L2S projects to EF soon.</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F&amp;title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F&amp;title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F&amp;title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F&amp;headline=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app&amp;url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app&amp;u=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app&amp;url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app&amp;url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app&amp;url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F&amp;title=Finally%21+Entity+Framework+working+in+fully+disconnected+N-tier+web+app&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Ffinally-entity-framework-working-in-fully-disconnected-n-tier-web-app%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=aCJkqcMaAgI:my0Q81_lWVc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=aCJkqcMaAgI:my0Q81_lWVc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=aCJkqcMaAgI:my0Q81_lWVc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=aCJkqcMaAgI:my0Q81_lWVc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=aCJkqcMaAgI:my0Q81_lWVc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=aCJkqcMaAgI:my0Q81_lWVc:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/aCJkqcMaAgI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/finally-entity-framework-working-in-fully-disconnected-n-tier-web-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/finally-entity-framework-working-in-fully-disconnected-n-tier-web-app/</feedburner:origLink></item>
		<item>
		<title>Munq is for web, Unity is for Enterprise</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/PbDHUQ-cce0/</link>
		<comments>http://omaralzabir.com/munq-is-for-web-unity-is-for-enterprise/#comments</comments>
		<pubDate>Sat, 15 May 2010 11:10:11 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Uncategorized</category>
		<category>asp.net</category>
		<category>performance</category>
		<category>production</category>

		<guid isPermaLink="false">http://omaralzabir.com/munq-is-for-web-unity-is-for-enterprise/</guid>
		<description><![CDATA[The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection. It’s a great library for facilitating Inversion of Control and the recent version supports AOP as well. However, when it comes to performance, it’s CPU hungry. In fact it’s so CPU hungry that it [...]]]></description>
			<content:encoded><![CDATA[<p>The Unity Application Block (<a href="http://unity.codeplex.com/">Unity</a>) is a lightweight extensible <a title="Dependency Injection Design Pattern" href="http://msdn.microsoft.com/en-us/magazine/cc163739.aspx">dependency injection</a> container with support for constructor, property, and method call injection. It’s a great library for facilitating <a title="Inversion of Control by Martin Fowler" href="http://martinfowler.com/articles/injection.html">Inversion of Control</a> and the recent version supports AOP as well. However, when it comes to performance, it’s CPU hungry. In fact it’s so CPU hungry that it makes it impossible to make it work at Internet Scale. I was investigating some CPU issue on a portal that gets around 3MM hits per day and I found unusually high CPU. Here’s why:</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/05/Unity_High_CPU.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Unity_High_CPU" border="0" alt="Unity_High_CPU" src="http://omaralzabir.com/wp-content/uploads/2010/05/Unity_High_CPU_thumb.png" width="600" height="563" /></a></p>  <p>I did some CPU profiling on my open source project Dropthings and found that the highest CPU is consumed by Unity’s <u>Resolve&lt;&gt;()</u>. There’s no funky use of Unity in the project. Straightforward <u>Register&lt;&gt;()</u> and <u>Resolve&lt;&gt;()</u>. But as you can see, <u>Resolve&lt;&gt;()</u> is consuming significantly high CPU even after the site is warm and has been running for a while. </p>  <p>Then I tried <a title="Munq Dependency Injection Container" href="http://munq.codeplex.com/">Munq</a>, which is a basic Dependency Injection Container. It has everything you will usually need in a regular project. It boasts to be the fastest DI out there. So, I converted all Unity code to Munq in Dropthings and did a CPU profile and Whala!</p>  <p><a href="http://omaralzabir.com/wp-content/uploads/2010/05/MunqMuchBetter.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="MunqMuchBetter" border="0" alt="MunqMuchBetter" src="http://omaralzabir.com/wp-content/uploads/2010/05/MunqMuchBetter_thumb.png" width="600" height="515" /></a> </p>  <p>&#160;</p>  <p>There’s no trace of any Munq calls anywhere. That proves Munq is a lot faster than Unity. </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F&amp;title=Munq+is+for+web%2C+Unity+is+for+Enterprise" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F&amp;title=Munq+is+for+web%2C+Unity+is+for+Enterprise" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F&amp;title=Munq+is+for+web%2C+Unity+is+for+Enterprise" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F&amp;headline=Munq+is+for+web%2C+Unity+is+for+Enterprise" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Munq+is+for+web%2C+Unity+is+for+Enterprise&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Munq+is+for+web%2C+Unity+is+for+Enterprise&amp;u=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Munq+is+for+web%2C+Unity+is+for+Enterprise&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Munq+is+for+web%2C+Unity+is+for+Enterprise&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Munq+is+for+web%2C+Unity+is+for+Enterprise&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F&amp;title=Munq+is+for+web%2C+Unity+is+for+Enterprise&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fmunq-is-for-web-unity-is-for-enterprise%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=PbDHUQ-cce0:DjqvlZpjT40:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=PbDHUQ-cce0:DjqvlZpjT40:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=PbDHUQ-cce0:DjqvlZpjT40:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=PbDHUQ-cce0:DjqvlZpjT40:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=PbDHUQ-cce0:DjqvlZpjT40:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=PbDHUQ-cce0:DjqvlZpjT40:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/PbDHUQ-cce0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/munq-is-for-web-unity-is-for-enterprise/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/munq-is-for-web-unity-is-for-enterprise/</feedburner:origLink></item>
		<item>
		<title>Keep website and webservices warm with zero coding</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/0359dS8R2QE/</link>
		<comments>http://omaralzabir.com/keep-website-and-webservices-warm-with-zero-coding/#comments</comments>
		<pubDate>Fri, 14 May 2010 18:00:02 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Uncategorized</category>
		<category>IIS</category>
		<category>performance</category>
		<category>production</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/keep-website-and-webservices-warm-with-zero-coding/</guid>
		<description><![CDATA[If you want to keep your websites or webservices warm and save user from seeing the long warm up time after an application pool recycle, or IIS restart or new code deployment or even windows restart, you can use the tinyget command line tool, that comes with IIS Resource Kit, to hit the site and [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to keep your websites or webservices warm and save user from seeing the long warm up time after an application pool recycle, or IIS restart or new code deployment or even windows restart, you can use the tinyget command line tool, that comes with IIS Resource Kit, to hit the site and services and keep them warm. Here’s how:</p>
<p>First get tinyget from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499">here</a>. Download and install the IIS 6.0 Resource Kit on some PC. Then copy the tinyget.exe from &#8220;C:\Program Files (x86)\IIS Resources\TinyGet\&#8221; to the server where your IIS 6.0 or IIS 7 is running.</p>
<p>Then create a batch file that will hit the pages and webservices. Something like this:</p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">SET TINYGET=C:\Program Files (x86)\IIS Resources\TinyGet\tinyget.exe

<span style="color: #006080;">"%TINYGET%"</span> -srv:dropthings.omaralzabir.com -uri:http://dropthings.omaralzabir.com/ -status:200<br /><span style="color: #006080;">"%TINYGET%"</span> -srv:dropthings.omaralzabir.com -uri:http://dropthings.omaralzabir.com/WidgetService.asmx?WSDL - status:200</pre>
<p>Save this in a batch file and run it as a scheduled task at some interval like 10 minutes and your website will always remain nice and warm.</p>
</div>
<p>First I am hitting the homepage to keep the webpage warm. Then I am hitting the webservice URL with ?WSDL parameter, which allows ASP.NET to compile the service if not already compiled and walk through all the operations and reflect on them and thus loading all related DLLs into memory and reducing the warmup time when hit.</p>
<p>Tinyget gets the servers name or IP in the –srv parameter and then the actual URI in the –uri. I have specified what’s the HTTP response code to expect in –status parameter. It ensures the site is alive and is returning http 200 code.</p>
<p>Besides just warming up a site, you can do some load test on the site. Tinyget can run in multiple threads and run loops to hit some URL. You can literally blow up a site with commands like this:</p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #006080;">"%TINYGET%"</span> -threads:30 -loop:100 -srv:google.com -uri:http://www.google.com/ -status:200</pre>
<p> </p>
</div>
<p>Tinyget is also pretty useful to run automated tests. You can record http posts in a text file and then use it to make http posts to some page. Then you can put matching clause to check for certain string in the output to ensure the correct response is given. Thus with some simple command line commands, you can warm up, do some transactions, validate the site is giving off correct response as well as run a load test to ensure the server performing well. Very cheap way to get a lot done.</p>
<p> </p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F&amp;title=Keep+website+and+webservices+warm+with+zero+coding" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F&amp;title=Keep+website+and+webservices+warm+with+zero+coding" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F&amp;title=Keep+website+and+webservices+warm+with+zero+coding" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F&amp;headline=Keep+website+and+webservices+warm+with+zero+coding" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Keep+website+and+webservices+warm+with+zero+coding&amp;url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Keep+website+and+webservices+warm+with+zero+coding&amp;u=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Keep+website+and+webservices+warm+with+zero+coding&amp;url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Keep+website+and+webservices+warm+with+zero+coding&amp;url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Keep+website+and+webservices+warm+with+zero+coding&amp;url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F&amp;title=Keep+website+and+webservices+warm+with+zero+coding&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fkeep-website-and-webservices-warm-with-zero-coding%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=0359dS8R2QE:8xBW6pYio5E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=0359dS8R2QE:8xBW6pYio5E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=0359dS8R2QE:8xBW6pYio5E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=0359dS8R2QE:8xBW6pYio5E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=0359dS8R2QE:8xBW6pYio5E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=0359dS8R2QE:8xBW6pYio5E:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/0359dS8R2QE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/keep-website-and-webservices-warm-with-zero-coding/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/keep-website-and-webservices-warm-with-zero-coding/</feedburner:origLink></item>
		<item>
		<title>Do not use “using” in WCF Client</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/62yNI441SvY/</link>
		<comments>http://omaralzabir.com/do-not-use-using-in-wcf-client/#comments</comments>
		<pubDate>Thu, 13 May 2010 17:29:45 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Uncategorized</category>
		<category>.net</category>
		<category>WCF</category>

		<guid isPermaLink="false">http://omaralzabir.com/do-not-use-using-in-wcf-client/</guid>
		<description><![CDATA[You know that any IDisposable object must be disposed using using. So, you have been using using to wrap WCF service’s ChannelFactory and Clients like this:     using(var client = new SomeClient()) {. ..}

  

Or, if you are doing it the hard and slow way (without really knowing why), then:


  [...]]]></description>
			<content:encoded><![CDATA[<p>You know that any <u>IDisposable</u> object must be disposed using <u>using</u>. So, you have been using <u>using</u> to wrap WCF service’s <u>ChannelFactory</u> and Clients like this:</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">using</span>(var client = <span style="color: #0000ff">new</span> SomeClient()) {<br /><br />. <br /><br />.<br /><br />.<br /><br />}<br /></pre>

  <br /></div>

<p>Or, if you are doing it the hard and slow way (without really knowing why), then:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">using</span>(var factory = <span style="color: #0000ff">new</span> ChannelFactory&lt;ISomeService&gt;()) {<br /><br />var channel= factory.CreateChannel();<br /><br />.<br /><br />.<br /><br />.<br /><br />}<br /></pre>

  <br /></div>

<p>That’s what we have all learnt in school right? We have learnt it wrong!</p>

<p>When there’s a network related error or the connection is broken, or the call is timed out before <u>Dispose</u> is called by the <u>using</u> keyword, then it results in the following exception when the <u>using</u> keyword tries to dispose the channel:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">failed: System.ServiceModel.CommunicationObjectFaultedException : <br />The communication <span style="color: #0000ff">object</span>, System.ServiceModel.Channels.ServiceChannel, <br />cannot be used <span style="color: #0000ff">for</span> communication because it <span style="color: #0000ff">is</span> <span style="color: #0000ff">in</span> the Faulted state.<br />    <br />    Server stack trace: <br />    at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)<br />    <br />    Exception rethrown at [0]: <br />    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br />    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)<br />    at System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)<br />    at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout)<br />    at System.ServiceModel.ClientBase`1.Close()<br />    at System.ServiceModel.ClientBase`1.System.IDisposable.Dispose()<br /><br /></pre>

  <br /></div>

<p>There are various reasons for which the underlying connection can be at broken state before the <u>using</u> block is completed and the <u>.Dispose()</u> is called. Common problems like network connection dropping, IIS doing an app pool recycle at that moment, some proxy sitting between you and the service dropping the connection for various reasons and so on. The point is, it might seem like a corner case, but it’s a likely corner case. If you are building a highly available client, you need to treat this properly before you go-live.</p>

<p>So, do NOT use <u>using</u> on WCF Channel/Client/ChannelFactory. Instead you need to use an alternative. Here’s what you can do:</p>

<p>First create an extension method.</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">class</span> WcfExtensions<br />{<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> Using&lt;T&gt;(<span style="color: #0000ff">this</span> T client, Action&lt;T&gt; work)<br />        <span style="color: #0000ff">where</span> T : ICommunicationObject<br />    {<br />        <span style="color: #0000ff">try</span><br />        {<br />            work(client);<br />            client.Close();<br />        }<br />        <span style="color: #0000ff">catch</span> (CommunicationException e)<br />        {<br />            client.Abort();<br />        }<br />        <span style="color: #0000ff">catch</span> (TimeoutException e)<br />        {<br />            client.Abort();<br />        }<br />        <span style="color: #0000ff">catch</span> (Exception e)<br />        {<br />            client.Abort();<br />            <span style="color: #0000ff">throw</span>;<br />        }<br />    }<br />}<br /><br /><br /></pre>

  <br /></div>

<p>Then use this instead of the <u>using</u> keyword:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">new</span> SomeClient().Using(channel =&gt; {<br />    channel.Login(username, password);<br />});<br /><br /></pre>

  <br /></div>

<p>Or if you are using <u>ChannelFactory</u> then:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">new</span> ChannelFactory&lt;ISomeService&gt;().Using(channel =&gt; {    <br />    channel.Login(username, password);<br />});</pre>

  <br /></div>
Enjoy!

<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F&amp;title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F&amp;title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F&amp;title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F&amp;headline=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client&amp;u=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F&amp;title=Do+not+use+%26ldquo%3Busing%26rdquo%3B+in+WCF+Client&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fdo-not-use-using-in-wcf-client%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=62yNI441SvY:Bvo3eW-wu4c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=62yNI441SvY:Bvo3eW-wu4c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=62yNI441SvY:Bvo3eW-wu4c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=62yNI441SvY:Bvo3eW-wu4c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=62yNI441SvY:Bvo3eW-wu4c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=62yNI441SvY:Bvo3eW-wu4c:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/62yNI441SvY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/do-not-use-using-in-wcf-client/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/do-not-use-using-in-wcf-client/</feedburner:origLink></item>
		<item>
		<title>Step by Step screencasts to do Behavior Driven Development on WCF and UI using xUnit</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/G_FfJW-pclA/</link>
		<comments>http://omaralzabir.com/step-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit/#comments</comments>
		<pubDate>Tue, 04 May 2010 10:06:24 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Uncategorized</category>
		<category>BDD</category>
		<category>TDD</category>
		<category>testing</category>
		<category>unit test</category>

		<guid isPermaLink="false">http://omaralzabir.com/step-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit/</guid>
		<description><![CDATA[For those who have missed my presentation, I am trying to encourage my team to get into Behavior Driven Development (BDD). So, I made two quick video tutorials to show how BDD can be done from early requirement collection stage to late integration tests. It explains breaking user stories into behaviors, and then developers and [...]]]></description>
			<content:encoded><![CDATA[<p>For those who have missed my presentation, I am trying to encourage my team to get into Behavior Driven Development (BDD). So, I made two quick video tutorials to show how BDD can be done from early requirement collection stage to late integration tests. It explains breaking user stories into behaviors, and then developers and test engineers taking the behavior specs and writing a WCF service and unit test for it, in parallel, and then eventually integrating the WCF service and doing the integration tests. It introduces how mocking is done using the Moq library. Moreover, it shows a way how you can write test once and do both unit and integration tests at the flip of a config setting.</p>  <p>Watch the screencast here:</p> <iframe height="289" src="http://player.vimeo.com/video/16017821" frameborder="0" width="601"></iframe>  <p>The next video tutorial is about doing BDD to do automated UI tests. It shows how test engineers can take behaviors and then write tests that tests a prototype UI in isolation (just like Service Contract) in order to ensure the prototype conforms to the expected behaviors, while developers can write the real code and build the real product in parallel. When the real stuff is done, the same test can test the real stuff and ensure the agreed behaviors are satisfied. I have used WatiN to automate UI and test UI for expected behaviors.</p> <iframe height="368" src="http://player.vimeo.com/video/15983454" frameborder="0" width="601"></iframe>  <p>&#160;</p>  <p>Hope you like it!</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F&amp;title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F&amp;title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F&amp;title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F&amp;headline=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit&amp;url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit&amp;u=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit&amp;url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit&amp;url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit&amp;url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F&amp;title=Step+by+Step+screencasts+to+do+Behavior+Driven+Development+on+WCF+and+UI+using+xUnit&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Fstep-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=G_FfJW-pclA:tFOBYF_qYBE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=G_FfJW-pclA:tFOBYF_qYBE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=G_FfJW-pclA:tFOBYF_qYBE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=G_FfJW-pclA:tFOBYF_qYBE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=G_FfJW-pclA:tFOBYF_qYBE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=G_FfJW-pclA:tFOBYF_qYBE:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/G_FfJW-pclA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/step-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>

<enclosure url="http://omaralzabir.com/wp-content/movies/watin/BDD%20WatiN%201.mp4" length="70006099" type="video/mpeg" />
		<feedburner:origLink>http://omaralzabir.com/step-by-step-screencasts-to-do-behavior-driven-development-on-wcf-and-ui-using-xunit/</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/OmarAlZabirBlog/~5/p7JHkvnIHwk/BDD%20WCF%201.mp4" length="78190825" type="video/mpeg" /><feedburner:origEnclosureLink>http://omaralzabir.com/wp-content/movies/wcf/BDD%20WCF%201.mp4</feedburner:origEnclosureLink></item>
		<item>
		<title>Rescue overdue offshore projects and convince management to use automated tests</title>
		<link>http://feedproxy.google.com/~r/OmarAlZabirBlog/~3/91EJVToJaSY/</link>
		<comments>http://omaralzabir.com/rescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests/#comments</comments>
		<pubDate>Tue, 04 May 2010 05:34:48 +0000</pubDate>
		<dc:creator>Omar AL Zabir</dc:creator>
				<category>Uncategorized</category>
		<category>BDD</category>
		<category>TDD</category>
		<category>testing</category>
		<category>tips</category>

		<guid isPermaLink="false">http://omaralzabir.com/rescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests/</guid>
		<description><![CDATA[I have published two articles on codeproject recently. One is a story where an offshore project was two months overdue, my friend who runs it was paying the team from his own pocket and he was drowning in ever increasing number of change requests and how we brainstormed together to come out of that situation. [...]]]></description>
			<content:encoded><![CDATA[<p>I have published two articles on codeproject recently. One is a story where an offshore project was two months overdue, my friend who runs it was paying the team from his own pocket and he was drowning in ever increasing number of change requests and how we brainstormed together to come out of that situation.</p>  <p><b><a href="http://www.codeproject.com/KB/tips/help.aspx">Tips and Tricks to rescue overdue projects</a></b></p>  <p>Next one is about convincing management to go for automated test and give developers extra time per sprint, at the cost of reduced productivity for couple of sprints. It’s hard to negotiate this with even dev leads, let alone managers. Whenever you tell them &#8211; there’s going to be less features/bug fixes delivered for next 3 or 4 sprints because we want to automate the tests and reduce manual QA effort; everyone gets furious and kicks you out of the meeting. Especially in a startup where every sprint is jam packed with new features and priority bug fixes to satisfy various stakeholders, including the VCs, it’s very hard to communicate the benefits of automated tests across the board. Let me tell you of a story of one of my startups where I had the pleasure to argue on this and came out victorious. </p>  <p><b><a href="http://www.codeproject.com/KB/tips/convince.aspx">How to convince developers and management to use automated test instead of manual test</a></b></p>  <p>If you like these, please vote for me!</p><div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F&amp;title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F&amp;title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F&amp;title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F&amp;headline=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests&amp;url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests&amp;u=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests&amp;url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests&amp;url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests&amp;url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F&amp;title=Rescue+overdue+offshore+projects+and+convince+management+to+use+automated+tests&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fomaralzabir.com%2Frescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests%2F" ><img class="lightsocial_img" src="http://omaralzabir.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=91EJVToJaSY:eSRyj_9JEB8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=91EJVToJaSY:eSRyj_9JEB8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=91EJVToJaSY:eSRyj_9JEB8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=91EJVToJaSY:eSRyj_9JEB8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?a=91EJVToJaSY:eSRyj_9JEB8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/OmarAlZabirBlog?i=91EJVToJaSY:eSRyj_9JEB8:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/OmarAlZabirBlog/~4/91EJVToJaSY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://omaralzabir.com/rescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://omaralzabir.com/rescue-overdue-offshore-projects-and-convince-management-to-use-automated-tests/</feedburner:origLink></item>
	</channel>
</rss>

