<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><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>Taswar Bhatti Blog</title>
	
	<link>http://taswar.zeytinsoft.com</link>
	<description>The synonyms of software simplicity</description>
	<lastBuildDate>Thu, 15 Dec 2011 17:20:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TaswarBhattiBlog" /><feedburner:info uri="taswarbhattiblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Eclipse Indigo hangs on splash screen workspace</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/uzyqr_F-QYc/</link>
		<comments>http://taswar.zeytinsoft.com/2011/12/15/eclipse-indigo-hangs-on-splash-screen-workspace/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 17:20:41 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1206</guid>
		<description><![CDATA[So today I came in to work and saw that my wonderful windows machine was restarted due to Windows Update, and yesterday I was working on some java stuff and did not close out my eclipse, thank god that I do regular code check-in Anyways tried to relaunch eclipse and it kept hanging on workspace. [...]]]></description>
			<content:encoded><![CDATA[<p>So today I came in to work and saw that my wonderful windows machine was restarted due to Windows Update, and yesterday I was working on some java stuff and did not close out my eclipse, thank god that I do regular code check-in <img src='http://taswar.zeytinsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyways tried to relaunch eclipse and it kept hanging on workspace.</p>
<p>To fix that I had to go into my workspace folder C:\workspace\.metadata\.plugins</p>
<p>Then I copied the org.eclipse.core.resources to a backup directory and deleted it from the plugins folder.</p>
<p>I restarted Eclipse and then did a File->Import->Existing Project into Workspace and browse my workspace/project directory</p>
<p>And voila I was back in action <img src='http://taswar.zeytinsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F12%2F15%2Feclipse-indigo-hangs-on-splash-screen-workspace%2F&amp;title=Eclipse%20Indigo%20hangs%20on%20splash%20screen%20workspace" id="wpa2a_2"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/uzyqr_F-QYc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/12/15/eclipse-indigo-hangs-on-splash-screen-workspace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/12/15/eclipse-indigo-hangs-on-splash-screen-workspace/</feedburner:origLink></item>
		<item>
		<title>Driving Technical Change Book Review</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/w0apYhTE2y8/</link>
		<comments>http://taswar.zeytinsoft.com/2011/10/30/driving-technical-change-book-review/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 20:13:21 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[book review]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1198</guid>
		<description><![CDATA[Have wanted to post the review of this book for a while, which I read somewhere beginning of this year. This book does a very good job in classification of the &#8220;typical&#8221; stereotypes of people in IT. - The Uninformed - The Herd - The Cynic - The Burned - The Time Crunched - The [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://taswar.zeytinsoft.com/wp-content/uploads/2011/10/DTC.jpg"><img src="http://taswar.zeytinsoft.com/wp-content/uploads/2011/10/DTC.jpg" alt="Driving Technical Change Book cover" title="Driving Technical Change" width="300" height="300" class="alignleft size-full wp-image-1200" /></a><br />
Have wanted to post the review of this book for a while, which I read somewhere beginning of this year.<br />
This book does a very good job in classification of the &#8220;typical&#8221; stereotypes of people in IT.<br />
- The Uninformed<br />
- The Herd<br />
- The Cynic<br />
- The Burned<br />
- The Time Crunched<br />
- The Boss<br />
- The Irrational </p>
<p>After the first section we go into what kind of techniques we can use to drive technical changes.<br />
- Gain Expertise<br />
- Deliver Your Message<br />
- Demonstrate Your Technique<br />
- Propose Compromise<br />
- Create Trust<br />
- Get Publicity<br />
- Focus on Synergy<br />
- Build a Bridge<br />
- Create Something Compelling</p>
<p>Lastly the author goes into Strategies one can use to drive technical changes<br />
- Simple, Not Easy<br />
- Ignore the Irrational<br />
- Target the Willing<br />
- Harness the Converted<br />
- Sway Management</p>
<p>The book is a short read with only 125 pages, it is a good read but at the same time one should always remember there are people whom you have to deal with that are emotional, and us human&#8217;s are not predictable, the classification helps but if we really want to drive the change we have to be the change agent. I would recommend this book for a beginner who wishes to drive technical changes.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F10%2F30%2Fdriving-technical-change-book-review%2F&amp;title=Driving%20Technical%20Change%20Book%20Review" id="wpa2a_4"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/w0apYhTE2y8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/10/30/driving-technical-change-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/10/30/driving-technical-change-book-review/</feedburner:origLink></item>
		<item>
		<title>JRuby install and build eventmachine from github</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/15yv9q7EHYA/</link>
		<comments>http://taswar.zeytinsoft.com/2011/10/21/jruby-install-and-build-eventmachine-from-github/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 03:53:09 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[eventmachine]]></category>
		<category><![CDATA[Jruby]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1193</guid>
		<description><![CDATA[Have been giving eventmachine a try but I do have issues with it thus wanted to try out the beta version on github. Here is how you get it to install on your local machine. - First clone the repo - Build the gem - Install the java version ?View Code BASH1 2 3 4 [...]]]></description>
			<content:encoded><![CDATA[<p>Have been giving eventmachine a try but I do have issues with it thus wanted to try out the beta version on github.</p>
<p>Here is how you get it to install on your local machine.<br />
- First clone the repo<br />
- Build the gem<br />
- Install the java version</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1193code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11932"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p1193code2"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>eventmachine<span style="color: #000000; font-weight: bold;">/</span>eventmachine
$ <span style="color: #7a0874; font-weight: bold;">cd</span> eventmachine
$ jruby <span style="color: #660033;">-S</span> gem build eventmachine.gemspec
In this step you might be missing some gems, I was missing yard and rake-compiler
$ jruby <span style="color: #660033;">-S</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> yard
$ jruby <span style="color: #660033;">-S</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rake-compiler
$ <span style="color: #000000; font-weight: bold;">/</span>c<span style="color: #000000; font-weight: bold;">/</span>jruby-1.6.4<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake java gem
 Once the build is <span style="color: #000000; font-weight: bold;">done</span> use the pkg version
$ jruby <span style="color: #660033;">-S</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> pkg<span style="color: #000000; font-weight: bold;">/</span>eventmachine-1.0.0.beta-<span style="color: #000000;">4</span>.java.gem</pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F10%2F21%2Fjruby-install-and-build-eventmachine-from-github%2F&amp;title=JRuby%20install%20and%20build%20eventmachine%20from%20github" id="wpa2a_6"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/15yv9q7EHYA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/10/21/jruby-install-and-build-eventmachine-from-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/10/21/jruby-install-and-build-eventmachine-from-github/</feedburner:origLink></item>
		<item>
		<title>ERROR: While executing gem … (NameError) uninitialized constant Psych::Syck</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/C4ZhimyS8GQ/</link>
		<comments>http://taswar.zeytinsoft.com/2011/10/16/error-while-executing-gem-nameerror-uninitialized-constant-psychsyck/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 02:04:25 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[goliath]]></category>
		<category><![CDATA[Jruby]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1186</guid>
		<description><![CDATA[What the ???? I was wanting to try out goliath.io (Goliath: Non-blocking, Ruby 1.9 Web Server) for more info look at http://www.igvita.com/2011/03/08/goliath-non-blocking-ruby-19-web-server/ In any case I was not able to get it to install on JRuby so went and get me 1.9.2 MRI. Once installed MRI 1.9.2, I went into the gem dir to gem [...]]]></description>
			<content:encoded><![CDATA[<p>What the ????<br />
I was wanting to try out goliath.io (Goliath: Non-blocking, Ruby 1.9 Web Server) for more info look at <a href="http://www.igvita.com/2011/03/08/goliath-non-blocking-ruby-19-web-server/" title="http://www.igvita.com/2011/03/08/goliath-non-blocking-ruby-19-web-server/">http://www.igvita.com/2011/03/08/goliath-non-blocking-ruby-19-web-server/</a></p>
<p>In any case I was not able to get it to install on JRuby so went and get me 1.9.2 MRI.</p>
<p>Once installed MRI 1.9.2, I went into the gem dir to gem install goliath and guess what this message pops up.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1186code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11866"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1186code6"><pre class="bash" style="font-family:monospace;">ERROR: While executing gem ... <span style="color: #7a0874; font-weight: bold;">&#40;</span>NameError<span style="color: #7a0874; font-weight: bold;">&#41;</span>
uninitialized constant Psych::Syck</pre></td></tr></table></div>

<p>Really helpful (scarcasim) , then what I had to do to fix this was update my gem</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1186code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11867"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1186code7"><pre class="bash" style="font-family:monospace;">gem update <span style="color: #660033;">--system</span></pre></td></tr></table></div>

<p>After doing so I was able to</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1186code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11868"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1186code8"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> goliath</pre></td></tr></table></div>

<p>Now its time to try out goliath, wish me luck and if anyone knows how to install it with Jruby please let me know cuz jgem install goliath didnt work for me.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F10%2F16%2Ferror-while-executing-gem-nameerror-uninitialized-constant-psychsyck%2F&amp;title=ERROR%3A%20While%20executing%20gem%20%26%238230%3B%20%28NameError%29%20uninitialized%20constant%20Psych%3A%3ASyck" id="wpa2a_8"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/C4ZhimyS8GQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/10/16/error-while-executing-gem-nameerror-uninitialized-constant-psychsyck/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/10/16/error-while-executing-gem-nameerror-uninitialized-constant-psychsyck/</feedburner:origLink></item>
		<item>
		<title>Command Pattern with Notification Event Delegates</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/0fJjKlzV6Gw/</link>
		<comments>http://taswar.zeytinsoft.com/2011/09/19/command-pattern-with-notification-event-delegates/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 19:33:20 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1176</guid>
		<description><![CDATA[Here is a nice little code I did recently, where the Command Pattern is used with a notification observer like pattern. First of the Command Pattern, a simple interface for task with an execute method ?View Code CSHARP1 2 3 4 5 6 7 public interface ITask &#123; /// &#60;summary&#62; /// Execute the task /// [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a nice little code I did recently, where the Command Pattern is used with a notification observer like pattern.</p>
<p>First of the Command Pattern, a simple interface for task with an execute method</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1176code14'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117614"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p1176code14"><pre class="csharp" style="font-family:monospace;"> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> ITask
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Execute the task</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #6666cc; font-weight: bold;">void</span> Execute<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Then the notification interface, with 2 methods, one when it started and one when its complete and the event delegate</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1176code15'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117615"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code" id="p1176code15"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">/// Notification interface</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> INotify
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Process has start</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #6666cc; font-weight: bold;">void</span> ProcessStart<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Process is Complete</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #6666cc; font-weight: bold;">void</span> ProcessComplete<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> NotifyEventArgs <span style="color: #008000;">:</span> EventArgs
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">enum</span> NotificationStatus
        <span style="color: #008000;">&#123;</span>
            START,
            COMPLETE,
            ERROR
        <span style="color: #008000;">&#125;</span> <span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> NotifyEventArgs<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> notficationText, NotificationStatus status<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            NotifcationText <span style="color: #008000;">=</span> notficationText<span style="color: #008000;">;</span>
            Status <span style="color: #008000;">=</span> status<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Status of notification</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> NotificationStatus Status <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">private</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Text to notify</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> NotifcationText <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> <span style="color: #0600FF; font-weight: bold;">private</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Now the class that implements the interface, I used an abstract class so that I can just use a subclass to implement the simple task I wish to have</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1176code16'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117616"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
</pre></td><td class="code" id="p1176code16"><pre class="csharp" style="font-family:monospace;"> <span style="color: #0600FF; font-weight: bold;">public</span> abstract <span style="color: #6666cc; font-weight: bold;">class</span> AbstractTask <span style="color: #008000;">:</span> ITask, INotify
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Event for notification</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">event</span> EventHandler<span style="color: #008000;">&lt;</span>NotifyEventArgs<span style="color: #008000;">&gt;</span> NotificationChanged<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Task to execute</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Execute<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">try</span>
            <span style="color: #008000;">&#123;</span>
                ProcessStart<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                ProcessingTask<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                ProcessComplete<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception e<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                 LogException<span style="color: #008000;">&#40;</span>e<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// When task is started call notification</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> ProcessStart<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>NotificationChanged <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
&nbsp;
            NotificationChanged<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> NotifyEventArgs<span style="color: #008000;">&#40;</span>NotificationText, NotifyEventArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">NotificationStatus</span><span style="color: #008000;">.</span><span style="color: #0000FF;">START</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// When task is complete call notification</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> ProcessComplete<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>NotificationChanged <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
&nbsp;
            NotificationChanged<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> NotifyEventArgs<span style="color: #008000;">&#40;</span>NotificationText, NotifyEventArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">NotificationStatus</span><span style="color: #008000;">.</span><span style="color: #0000FF;">COMPLETE</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Log the exception</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;e&quot;&gt;&lt;/param&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> LogException<span style="color: #008000;">&#40;</span>Exception e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>NotificationChanged <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
                NotificationChanged<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> NotifyEventArgs<span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, NotifyEventArgs<span style="color: #008000;">.</span><span style="color: #0000FF;">NotificationStatus</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ERROR</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>          
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Text to display for notification</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">string</span> NotificationText <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Process task for inheriting class</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> abstract <span style="color: #6666cc; font-weight: bold;">void</span> ProcessingTask<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Now I can write a simple class that inherits from AbstractTask like this</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1176code17'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117617"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p1176code17"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> HelloTask<span style="color: #008000;">:</span> AbstractTask 
<span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> HelloTask<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            NotificationText <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Hello Task&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> ProcessingTask<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>  
              Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
         <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Now to consume the task</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1176code18'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117618"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p1176code18"><pre class="csharp" style="font-family:monospace;">&nbsp;
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span> 
<span style="color: #008000;">&#123;</span>
       AbstractTask task <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> HelloTask<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
       task<span style="color: #008000;">.</span><span style="color: #0000FF;">NotificationChanged</span> <span style="color: #008000;">+=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> EventHandler<span style="color: #008000;">&lt;</span>NotifyEventArgs<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span>NotifyAction<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
       task<span style="color: #008000;">.</span><span style="color: #0000FF;">Execute</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> NotifyAction<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> source, NotifyEventArgs args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
       Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span>args<span style="color: #008000;">.</span><span style="color: #0000FF;">NotificationText</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>This is more or less the simple form of creating a command pattern to run task that includes a notification to send back. It makes sense to have multiple task like creating users and running database scripts etc etc. This allows one to have flexible design and  have an IEnumerable&lt;AbstractTask&gt; and run through each one with an execute method.</p>
<p>Hope this helps <img src='http://taswar.zeytinsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Happy coding.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F09%2F19%2Fcommand-pattern-with-notification-event-delegates%2F&amp;title=Command%20Pattern%20with%20Notification%20Event%20Delegates" id="wpa2a_10"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/0fJjKlzV6Gw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/09/19/command-pattern-with-notification-event-delegates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/09/19/command-pattern-with-notification-event-delegates/</feedburner:origLink></item>
		<item>
		<title>Disable browser cache in asp mvc</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/blcuxiZjZpE/</link>
		<comments>http://taswar.zeytinsoft.com/2011/07/29/disable-browser-cache-in-asp-mvc/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 16:44:15 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[ASP .NET]]></category>
		<category><![CDATA[aspmvc]]></category>
		<category><![CDATA[asp mvc]]></category>
		<category><![CDATA[browser cache]]></category>
		<category><![CDATA[pragma cache]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1171</guid>
		<description><![CDATA[Here is a simple trick on how to disable browser cache in your asp .net mvc application with an attribute. If you have a base controller just add this to your base and all your request would have Pragma No-Cache ?View Code CSHARP1 2 3 4 5 6 7 8 9 10 11 12 13 [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple trick on how to disable browser cache in your asp .net mvc application with an attribute.<br />
If you have a base controller just add this to your base and all your request would have Pragma No-Cache</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1171code21'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117121"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code" id="p1171code21"><pre class="csharp" style="font-family:monospace;"> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> NoCacheAttribute <span style="color: #008000;">:</span> ActionFilterAttribute
    <span style="color: #008000;">&#123;</span>        
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnResultExecuting<span style="color: #008000;">&#40;</span>ResultExecutingContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>filterContext <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">throw</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> ArgumentNullException<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;filterContext&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            var cache <span style="color: #008000;">=</span> GetCache<span style="color: #008000;">&#40;</span>filterContext<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            cache<span style="color: #008000;">.</span><span style="color: #0000FF;">SetExpires</span><span style="color: #008000;">&#40;</span>DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">UtcNow</span><span style="color: #008000;">.</span><span style="color: #0000FF;">AddDays</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            cache<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValidUntilExpires</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            cache<span style="color: #008000;">.</span><span style="color: #0000FF;">SetRevalidation</span><span style="color: #008000;">&#40;</span>HttpCacheRevalidation<span style="color: #008000;">.</span><span style="color: #0000FF;">AllCaches</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            cache<span style="color: #008000;">.</span><span style="color: #0000FF;">SetCacheability</span><span style="color: #008000;">&#40;</span>HttpCacheability<span style="color: #008000;">.</span><span style="color: #0000FF;">NoCache</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            cache<span style="color: #008000;">.</span><span style="color: #0000FF;">SetNoStore</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OnResultExecuting</span><span style="color: #008000;">&#40;</span>filterContext<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Get the reponse cache</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;filterContext&quot;&gt;&lt;/param&gt;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;returns&gt;&lt;/returns&gt;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">virtual</span> HttpCachePolicyBase GetCache<span style="color: #008000;">&#40;</span>ResultExecutingContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> filterContext<span style="color: #008000;">.</span><span style="color: #0000FF;">HttpContext</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Response</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
     <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Simply add this to your base controller, and you are done <img src='http://taswar.zeytinsoft.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1171code22'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117122"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1171code22"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>NoCache<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> BaseController<span style="color: #008000;">:</span> Controller</pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F07%2F29%2Fdisable-browser-cache-in-asp-mvc%2F&amp;title=Disable%20browser%20cache%20in%20asp%20mvc" id="wpa2a_12"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/blcuxiZjZpE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/07/29/disable-browser-cache-in-asp-mvc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/07/29/disable-browser-cache-in-asp-mvc/</feedburner:origLink></item>
		<item>
		<title>Enable https on ASP.NET MVC 2 &amp; 3, through Filters and web.config</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/C8Anu_3tHjw/</link>
		<comments>http://taswar.zeytinsoft.com/2011/07/26/enable-ssl-on-asp-net-mvc-2-3-through-filters-and-web-config/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 17:15:44 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[ASP .NET]]></category>
		<category><![CDATA[aspmvc]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[asp .net mvc]]></category>
		<category><![CDATA[mvc filter]]></category>
		<category><![CDATA[ssl filters]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1155</guid>
		<description><![CDATA[To enable SSL on asp.net mvc, one can use the [RequireHttps] attribute on the base controller if you are using a base controller ?View Code CSHARP1 2 &#91;RequireHttps&#93; public class BaseController: Controller But what if you want to give an option to the installer or the client to enable it in web.config, the easy way [...]]]></description>
			<content:encoded><![CDATA[<p>To enable <strong>SSL</strong> on <strong>asp.net mvc</strong>,  one can use the <strong>[RequireHttps</strong>] attribute on the base controller if you are using a base controller</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1155code29'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115529"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1155code29"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>RequireHttps<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> BaseController<span style="color: #008000;">:</span> Controller</pre></td></tr></table></div>

<p>But what if you want to give an option to the installer or the client to enable it in <strong>web.config</strong>, the easy way to do it for asp mvc2 is to create your own property like code below: (Please note: I am using protected virtual to override stuff for testing, its not one of the best things but it works in breaking dependency and its quick, so that I dont have to mock httpcontext, configuration manager etc etc, I could use an IoC but would make it more complicated for the reader but feel free to use one)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1155code30'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115530"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code" id="p1155code30"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">namespace</span> MyWebMvc<span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> MyRequireSslAttribute <span style="color: #008000;">:</span> RequireHttpsAttribute
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">string</span> EnableSslKey <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;EnableSSL&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnAuthorization<span style="color: #008000;">&#40;</span>AuthorizationContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>filterContext <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
                <span style="color: #0600FF; font-weight: bold;">throw</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> ArgumentException<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;filterContext&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>IsHttpContextNull<span style="color: #008000;">&#40;</span>filterContext<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&amp;&amp;</span> <span style="color: #008000;">!</span>IsEnableSsl<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            BaseOnAuthorization<span style="color: #008000;">&#40;</span>filterContext<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>            
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">virtual</span> <span style="color: #6666cc; font-weight: bold;">void</span> BaseOnAuthorization<span style="color: #008000;">&#40;</span>AuthorizationContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OnAuthorization</span><span style="color: #008000;">&#40;</span>filterContext<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">virtual</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsHttpContextNull<span style="color: #008000;">&#40;</span>AuthorizationContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> filterContext<span style="color: #008000;">.</span><span style="color: #0000FF;">HttpContext</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">virtual</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsEnableSsl<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var enableSsl <span style="color: #008000;">=</span> HttpRuntime<span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Get</span><span style="color: #008000;">&#40;</span>EnableSslKey<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>enableSsl <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                var configEnableSsl <span style="color: #008000;">=</span> ConfigurationManager<span style="color: #008000;">.</span><span style="color: #0000FF;">AppSettings</span><span style="color: #008000;">&#91;</span>EnableSslKey<span style="color: #008000;">&#93;</span> <span style="color: #008000;">??</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #008000;">&#40;</span>configEnableSsl<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    HttpRuntime<span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Insert</span><span style="color: #008000;">&#40;</span>EnableSslKey, <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>configEnableSsl<span style="color: #008000;">.</span><span style="color: #0000FF;">ToLower</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;true&quot;</span><span style="color: #008000;">&#41;</span>
                <span style="color: #008000;">&#123;</span>
                    HttpRuntime<span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Insert</span><span style="color: #008000;">&#40;</span>EnableSslKey, <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
                <span style="color: #008000;">&#125;</span>
&nbsp;
                HttpRuntime<span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Insert</span><span style="color: #008000;">&#40;</span>EnableSslKey, <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            var isEnableSsl <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
            <span style="color: #6666cc; font-weight: bold;">bool</span><span style="color: #008000;">.</span><span style="color: #0000FF;">TryParse</span><span style="color: #008000;">&#40;</span>enableSsl<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0600FF; font-weight: bold;">out</span> isEnableSsl<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>            
&nbsp;
            <span style="color: #0600FF; font-weight: bold;">return</span> isEnableSsl<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Here is the unit test for it, I am using a stub class to override the things I want for testing</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1155code31'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115531"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre></td><td class="code" id="p1155code31"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.Mvc</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">NUnit.Framework</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">MyWebMvc.Attributes</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> MyWebMvc<span style="color: #008000;">.</span><span style="color: #0000FF;">Tests</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #008000;">&#91;</span>TestFixture<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> MyRequireSslAttributeTests
    <span style="color: #008000;">&#123;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
        <span style="color: #008000;">&#91;</span>ExpectedException<span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span>ArgumentException<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnAuthorization_ThrowException_WhenFilterIsNull<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var attr <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> MyRequireSslAttribute<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            attr<span style="color: #008000;">.</span><span style="color: #0000FF;">OnAuthorization</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnAuthorization_IsEnableFalse_BaseValidationWasNotCalled<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var attr <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StubMyRequireSslAttribute <span style="color: #008000;">&#123;</span>EnableSsl <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span>, HttpContextBool <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            var context <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> AuthorizationContext<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>         
&nbsp;
            attr<span style="color: #008000;">.</span><span style="color: #0000FF;">OnAuthorization</span><span style="color: #008000;">&#40;</span>context<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">That</span><span style="color: #008000;">&#40;</span>attr<span style="color: #008000;">.</span><span style="color: #0000FF;">BaseWasCalled</span>, <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">Is</span></a><span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">False</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnAuthorization_HttpContextNullTrue_BaseValidationWasCalled<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var attr <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StubMyRequireSslAttribute <span style="color: #008000;">&#123;</span> EnableSsl <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span>, HttpContextBool <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            var context <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> AuthorizationContext<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            attr<span style="color: #008000;">.</span><span style="color: #0000FF;">OnAuthorization</span><span style="color: #008000;">&#40;</span>context<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">That</span><span style="color: #008000;">&#40;</span>attr<span style="color: #008000;">.</span><span style="color: #0000FF;">BaseWasCalled</span>, <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">Is</span></a><span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">True</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnAuthorization_HttpContextNullTrueIsEnableTrue_BaseValidationWasCalled<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var attr <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StubMyRequireSslAttribute <span style="color: #008000;">&#123;</span> EnableSsl <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span>, HttpContextBool <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            var context <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> AuthorizationContext<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            attr<span style="color: #008000;">.</span><span style="color: #0000FF;">OnAuthorization</span><span style="color: #008000;">&#40;</span>context<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">That</span><span style="color: #008000;">&#40;</span>attr<span style="color: #008000;">.</span><span style="color: #0000FF;">BaseWasCalled</span>, <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">Is</span></a><span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">True</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnAuthorization_IsEnableTrue_BaseValidationIsCalled<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var attr <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StubMyRequireSslAttribute <span style="color: #008000;">&#123;</span> EnableSsl <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span>, HttpContextBool <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            var context <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> AuthorizationContext<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            attr<span style="color: #008000;">.</span><span style="color: #0000FF;">OnAuthorization</span><span style="color: #008000;">&#40;</span>context<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">That</span><span style="color: #008000;">&#40;</span>attr<span style="color: #008000;">.</span><span style="color: #0000FF;">BaseWasCalled</span>, <a href="http://www.google.com/search?q=is+msdn.microsoft.com"><span style="color: #008000;">Is</span></a><span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">True</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> StubMyRequireSslAttribute <span style="color: #008000;">:</span> MyRequireSslAttribute
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">bool</span> EnableSsl <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">bool</span> HttpContextBool <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">bool</span> BaseWasCalled <span style="color: #008000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsHttpContextNull<span style="color: #008000;">&#40;</span>AuthorizationContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> HttpContextBool<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsEnableSsl<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> EnableSsl<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> BaseOnAuthorization<span style="color: #008000;">&#40;</span>AuthorizationContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            BaseWasCalled <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Now in your <strong>web.config</strong> you can add a key value pair like</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1155code32'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115532"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1155code32"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;EnableSSL&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>And last if you are using <strong>Asp.Net Mvc3</strong> life is way easier, one can just use in their <strong>Global.ascx</strong> file to add the filter</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1155code33'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115533"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p1155code33"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> RegisterGlobalFilters<span style="color: #008000;">&#40;</span>GlobalFilterCollection filters<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
&nbsp;
     <span style="color: #008080; font-style: italic;">//get configuration and add the attribute if needed</span>
    filters<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> MyRequireHttpsAttribute<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> 
&nbsp;
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Lastly you would add it to your BaseController</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1155code34'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115534"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1155code34"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>MyRequireSsl<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> BaseController<span style="color: #008000;">:</span> Controller</pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F07%2F26%2Fenable-ssl-on-asp-net-mvc-2-3-through-filters-and-web-config%2F&amp;title=Enable%20https%20on%20ASP.NET%20MVC%202%20%26%23038%3B%203%2C%20through%20Filters%20and%20web.config" id="wpa2a_14"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/C8Anu_3tHjw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/07/26/enable-ssl-on-asp-net-mvc-2-3-through-filters-and-web-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/07/26/enable-ssl-on-asp-net-mvc-2-3-through-filters-and-web-config/</feedburner:origLink></item>
		<item>
		<title>Jquery: dropdown.val(‘selected’, ‘selected’) does not work anymore.</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/F195oxLfBBE/</link>
		<comments>http://taswar.zeytinsoft.com/2011/07/25/jquery-dropdown-valselected-selected-does-not-work-anymore/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 18:17:18 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1150</guid>
		<description><![CDATA[Was debugging some code that was broken due to jquery 1.6 update, and found this call. ?View Code JAVASCRIPT1 $&#40;&#34;#dropDownSelect option[text=&#34; + myText +&#34;]&#34;&#41;.attr&#40;&#34;selected&#34;,&#34;selected&#34;&#41; ; Not working anymore but a simple fix of changing it to ?View Code JAVASCRIPT1 $&#40;&#34;#dropDownSelect option[text=&#34; + myText +&#34;]&#34;&#41;.prop&#40;&#34;selected&#34;,true&#41; ; This does the trick, for more on prop take a [...]]]></description>
			<content:encoded><![CDATA[<p>Was debugging some code that was broken due to jquery 1.6 update, and found this call.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1150code37'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115037"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1150code37"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#dropDownSelect option[text=&quot;</span> <span style="color: #339933;">+</span> myText <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Not working anymore but a simple fix of changing it to</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1150code38'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p115038"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1150code38"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#dropDownSelect option[text=&quot;</span> <span style="color: #339933;">+</span> myText <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prop</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This does the trick, for more on prop take a look at the api of jquery <a href="http://api.jquery.com/prop/" title="http://api.jquery.com/prop/">http://api.jquery.com/prop/</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F07%2F25%2Fjquery-dropdown-valselected-selected-does-not-work-anymore%2F&amp;title=Jquery%3A%20dropdown.val%28%26%238216%3Bselected%26%238217%3B%2C%20%26%238216%3Bselected%26%238217%3B%29%20does%20not%20work%20anymore." id="wpa2a_16"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/F195oxLfBBE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/07/25/jquery-dropdown-valselected-selected-does-not-work-anymore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/07/25/jquery-dropdown-valselected-selected-does-not-work-anymore/</feedburner:origLink></item>
		<item>
		<title>Building an installer and displaying Data Link Properties Dialog Box for connection string</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/Rt03uu0ovaA/</link>
		<comments>http://taswar.zeytinsoft.com/2011/07/20/building-an-installer-and-displaying-data-link-properties-dialog-box-for-connection-string/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 13:32:55 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1140</guid>
		<description><![CDATA[So was hacking a new installer and wanted to display the data link properties dialog, for building a connection string. Here is what I have found out by playing with it. One has to add the reference to ADODB.DLL (from .NET reference) and Microsoft OLE DB Service Component 1.0 Type Library from the COM tab [...]]]></description>
			<content:encoded><![CDATA[<p>So was hacking a new installer and wanted to display the data link properties dialog, for building a connection string.<br />
Here is what I have found out by playing with it.<br />
One has to add the reference to ADODB.DLL (from .NET reference) and Microsoft OLE DB Service Component 1.0 Type Library from the COM tab in your visual studio reference tab.</p>
<p>Here is some sample code, assuming that you have a button and a textbox on the screen.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1140code40'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p114040"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code" id="p1140code40"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">ADODB</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.Win32</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> ConnectionStringStep <span style="color: #008000;">:</span> Form
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">string</span> MSSQL_PROVIDER <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Provider=SQLOLEDB.1&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">string</span> ORACLE_PROVIDER <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Provider=MSDAORA.1&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">string</span> MSSQL <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;MSSQL&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ConnectionStringStep<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            InitializeComponent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">string</span> DataBaseType<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
			<span style="color: #008080; font-style: italic;">//get the data from some previous screen or some kind of storage</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> MyStorage<span style="color: #008000;">.</span><span style="color: #0000FF;">GetProperty</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;DATABASE_TYPE&quot;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">??</span> <span style="color: #666666;">&quot;MSSQL&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> button1_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var dataBaseType <span style="color: #008000;">=</span> DataBaseType<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            var adodbConnection <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Connection
                                      <span style="color: #008000;">&#123;</span>
                                          ConnectionString <span style="color: #008000;">=</span> dataBaseType <span style="color: #008000;">==</span> MSSQL <span style="color: #008000;">?</span> MSSQL_PROVIDER <span style="color: #008000;">:</span> ORACLE_PROVIDER
                                      <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #6666cc; font-weight: bold;">object</span> connection <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span><span style="color: #008000;">&#41;</span> adodbConnection<span style="color: #008000;">;</span>
&nbsp;
            var dialog <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> MSDASC<span style="color: #008000;">.</span><span style="color: #0000FF;">DataLinks</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            dialog<span style="color: #008000;">.</span><span style="color: #0000FF;">PromptEdit</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">ref</span> connection<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            connectionTextBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> adodbConnection<span style="color: #008000;">.</span><span style="color: #0000FF;">ConnectionString</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>And here is how it looks like<br />
<a href="http://taswar.zeytinsoft.com/wp-content/uploads/2011/07/connectionbuilder.png"><img src="http://taswar.zeytinsoft.com/wp-content/uploads/2011/07/connectionbuilder.png" alt="" title="connectionbuilder" width="512" height="395" class="alignleft size-full wp-image-1141" /></a></p>
<p>Once a user clicks on build, the Data Link Properties Shows up.</p>
<p><a href="http://taswar.zeytinsoft.com/wp-content/uploads/2011/07/dlp.png"><img src="http://taswar.zeytinsoft.com/wp-content/uploads/2011/07/dlp.png" alt="Data Link Properties Dialog" title="dlp" width="377" height="473" class="alignleft size-full wp-image-1142" /></a></p>
<p>Also note: that I am providing some default into the connection, since if you do not provide <strong>&#8220;Provider=SQLOLEDB.1&#8243; </strong> then the default is just OLE database not the MSSQL database option.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F07%2F20%2Fbuilding-an-installer-and-displaying-data-link-properties-dialog-box-for-connection-string%2F&amp;title=Building%20an%20installer%20and%20displaying%20Data%20Link%20Properties%20Dialog%20Box%20for%20connection%20string" id="wpa2a_18"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/Rt03uu0ovaA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/07/20/building-an-installer-and-displaying-data-link-properties-dialog-box-for-connection-string/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/07/20/building-an-installer-and-displaying-data-link-properties-dialog-box-for-connection-string/</feedburner:origLink></item>
		<item>
		<title>RubyMine 3.1.1 running in 64bit JVM on Windows 7</title>
		<link>http://feedproxy.google.com/~r/TaswarBhattiBlog/~3/SwumweEus3Y/</link>
		<comments>http://taswar.zeytinsoft.com/2011/04/20/rubymine-3-1-1-running-in-64bit-jvm-on-windows-7/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 04:08:46 +0000</pubDate>
		<dc:creator>taswar</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://taswar.zeytinsoft.com/?p=1135</guid>
		<description><![CDATA[In order to run Rubymine under a 64bit jvm one needs to run the IDE from the bat file. In the bat file which is located at C:\Program Files (x86)\JetBrains\RubyMine 3.1.1\bin add this line SET RUBYMINE_JDK=%ProgramFiles%/Java/jdk1.6.0_25 and remove the IF statements ::IF &#8220;%RUBYMINE_JDK%&#8221; == &#8220;&#8221; SET RUBYMINE_JDK=%JDK_HOME% ::IF &#8220;%RUBYMINE_JDK%&#8221; == &#8220;&#8221; goto error Run the [...]]]></description>
			<content:encoded><![CDATA[<p>In order to run Rubymine under a 64bit jvm one needs to run the IDE from the bat file.</p>
<p>In the bat file which is located at C:\Program Files (x86)\JetBrains\RubyMine 3.1.1\bin add this line</p>
<p>SET RUBYMINE_JDK=%ProgramFiles%/Java/jdk1.6.0_25</p>
<p>and remove the IF statements<br />
::IF &#8220;%RUBYMINE_JDK%&#8221; == &#8220;&#8221; SET RUBYMINE_JDK=%JDK_HOME%<br />
::IF &#8220;%RUBYMINE_JDK%&#8221; == &#8220;&#8221; goto error</p>
<p>Run the rubymine.bat file voila 64bit jvm.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftaswar.zeytinsoft.com%2F2011%2F04%2F20%2Frubymine-3-1-1-running-in-64bit-jvm-on-windows-7%2F&amp;title=RubyMine%203.1.1%20running%20in%2064bit%20JVM%20on%20Windows%207" id="wpa2a_20"><img src="http://taswar.zeytinsoft.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><img src="http://feeds.feedburner.com/~r/TaswarBhattiBlog/~4/SwumweEus3Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://taswar.zeytinsoft.com/2011/04/20/rubymine-3-1-1-running-in-64bit-jvm-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://taswar.zeytinsoft.com/2011/04/20/rubymine-3-1-1-running-in-64bit-jvm-on-windows-7/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.172 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-07 07:56:45 -->

