<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>A Quantum Immortal</title>
	
	<link>http://ripper234.com</link>
	<description>Stuff Ron Gross Finds Interesting</description>
	<lastBuildDate>Thu, 18 Feb 2010 16:14:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AQuantumImmortal" /><feedburner:info uri="aquantumimmortal" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>ALT.NET #3</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/y4inzunNuHU/</link>
		<comments>http://ripper234.com/p/alt-net-3/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 16:14:11 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1251</guid>
		<description><![CDATA[The third Alt .Net convention will take place on 26/03 (planning on 25/03).
Read about my impressions from last time, and come register on Facebook. I will not be attending this year because of a ski trip, but you are all encouraged to come.


Related posts:ALT.NET Israel Tools #1
Israeli Developers Community Conference 2009
Interactive RSS



Related posts:<ol><li><a href='http://ripper234.com/p/alt-net-israel-tools-1/' rel='bookmark' title='Permanent Link: ALT.NET Israel Tools #1'>ALT.NET Israel Tools #1</a></li>
<li><a href='http://ripper234.com/p/israeli-developers-community-conference-2009/' rel='bookmark' title='Permanent Link: Israeli Developers Community Conference 2009'>Israeli Developers Community Conference 2009</a></li>
<li><a href='http://ripper234.com/p/interactive-rss/' rel='bookmark' title='Permanent Link: Interactive RSS'>Interactive RSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The third Alt .Net convention will take place on 26/03 (planning on 25/03).</p>
<p>Read about <a href="http://ripper234.com/p/altnet-2nd-conference/">my impressions from last time</a>, and come <a href="http://www.facebook.com/event.php?eid=313954738555">register on Facebook</a>. I will not be attending this year because of a ski trip, but you are all encouraged to come.</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/alt-net-israel-tools-1/' rel='bookmark' title='Permanent Link: ALT.NET Israel Tools #1'>ALT.NET Israel Tools #1</a></li>
<li><a href='http://ripper234.com/p/israeli-developers-community-conference-2009/' rel='bookmark' title='Permanent Link: Israeli Developers Community Conference 2009'>Israeli Developers Community Conference 2009</a></li>
<li><a href='http://ripper234.com/p/interactive-rss/' rel='bookmark' title='Permanent Link: Interactive RSS'>Interactive RSS</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/y4inzunNuHU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/alt-net-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/alt-net-3/</feedburner:origLink></item>
		<item>
		<title>An open source StackOverflow clone by a n00b web dev</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/vp2X2YQ4NS8/</link>
		<comments>http://ripper234.com/p/open-source-stackoverflow-clone-by-a-n00b-webdev/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 21:34:17 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stackoverflow]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1232</guid>
		<description><![CDATA[I wanted to share a small learning exercise I underwent recently. I decided to learn how to build a website, and share the experience here. Lacking an original idea at the moment, I decided to create yet another StackOverflow clone – not original, but a good exercise nonetheless. The code for the project is hosted [...]


Related posts:<ol><li><a href='http://ripper234.com/p/whys-is-open-source-so-hard/' rel='bookmark' title='Permanent Link: Whys is Open Source so hard?'>Whys is Open Source so hard?</a></li>
<li><a href='http://ripper234.com/p/a-survey-of-open-apis/' rel='bookmark' title='Permanent Link: A survey of open APIs'>A survey of open APIs</a></li>
<li><a href='http://ripper234.com/p/stackoverflowcom/' rel='bookmark' title='Permanent Link: Stackoverflow.com'>Stackoverflow.com</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I wanted to share a small learning exercise I underwent recently. I decided to learn how to build a website, and share the experience here. Lacking an original idea at the moment, I decided to create yet another <a href="https://stackoverflow.com/">StackOverflow</a> clone – not original, but a good exercise nonetheless. The code for the project is <a href="http://github.com/ripper234/Stack-Underflow">hosted at GitHub</a>, although I don’t have a live showcase up at the moment. Yes, I am aware a google search reveals an existing open source SO clone called <a href="http://ra-ajax.org/stacked-an-open-source-implementation-of-stackoverflow-com.blog">Stacked</a> &#8211; I thought building one from scratch might teach me more than reading someone else&#8217;s code base (I could be wrong, but this is how I wanted to roll).</p>
<h3>Day 1</h3>
<p>The choice of database engine was easy: The one database I had any experience with was <a href="http://www.mysql.com/">mysql</a>, and being open source, free and easy to work with, I went with it. Next, an ORM library. After some digging, I’ve decided to go with <a href="http://en.wikipedia.org/wiki/NHibernate">NHibernate</a> + <a href="http://www.castleproject.org/activerecord/index.html">Castle ActiveRecord</a>. ActiveRecord is great for easily mapping simple classes and relations, and NHibernate to complement it in ‘advanced queries’. I don’t get any LINQ magic from these ORMs, which is a pity. I then proceeded to create a solution and some projects, added NUnit as a test framework, and setup <a href="http://www.castleproject.org/container/index.html">Castle MicroKernel</a> as an IOC framework.</p>
<p>I tried to found <a href="http://stackoverflow.com/questions/1991071/continuous-integration-for-a-small-net-open-source-project">an open hosted source CI server</a>, but didn’t find anything that worked. Oh well, not essential for now.</p>
<h3>Day 2</h3>
<p>Before proceeding any further, I had to choose a source control provider. If this were a production project I would probably have gone with <a href="http://subversion.tigris.org/">SVN</a> hosted on <a href="http://code.google.com/">Google Code</a>. However, <a href="http://www.kenegozi.com/blog/">Ken</a> told me about <a href="http://git-scm.com/">Git</a> long ago, and I thought this was a good chance to experience it. So, on to <a href="http://github.com/ripper234/Stack-Underflow">GitHub</a>. Opening the project was a no brainer, but finding a decent client was more challenging. I had some fun learning about Git’s private keys, and configuring <a href="http://code.google.com/p/tortoisegit/">TortoiseGit</a> (I tried <a href="http://code.google.com/p/gitextensions/">GitExtensions</a>, but it doesn’t support Visual Studio 2010 beta 2 yet). Overall, TortoiseGit gets the job done, after some tweaking and .gitignore files.</p>
<p>Git’s distributed source control model is interesting and worth a try.</p>
<p>I created the User, Question &amp; Vote tables, learned about <a href="http://www.castleproject.org/ActiveRecord/documentation/v1rc1/usersguide/pks.html#relations">composite keys in AR</a>, and wrote my first NH query:</p>
<p>GetVoteCount &#8211; &#8220;SELECT Vote, COUNT(*) FROM &#8221; + VotesTableName + &#8221; WHERE PostId = :postId GROUP BY vote&#8221;</p>
<p>I currently don’t have any caching on the vote count – am simply storing the votes as relations between users and questions, and counting them on the fly.</p>
<h3>Day 3</h3>
<p>I would like to implement full features, not write the entire DAL first and then the application logic. So, it’s time to start learning about web development. At work people are using Monorail, but after reading <a href="http://stackoverflow.com/questions/290088/asp-net-mvc-vs-castle-monorail">this question</a> I decided to try out ASP.Net MVC instead. So, I read <a href="http://www.asp.net/learn/mvc/tutorial-21-cs.aspx ">a basic tutorial</a> and starting coding. Some things I learned:</p>
<ol>
<li>I finally got the meaning of Global.asax.cs – it’s simply the ‘main’ of the web application.</li>
<li>By default, ASP.Net MVC creates the controllers by itself and does not support IOC. <a href="http://consultingblogs.emc.com/matthall/archive/2009/03/25/asp-net-mvc-with-castle-windsor.aspx ">Fixed</a> (remember to setup the Controller’s lifestyle as LifeStyle.PerWebRequest).</li>
<li>Some Asp.Net MVC basics:
<ol>
<li>Use &lt;%= … %&gt; to write to the output stream (that gets sent as the HTML), and &lt;% %&gt; to simply execute code.</li>
<li>Use Html.RenderAction() to create links to other pages (~= Actions)</li>
<li>Your pages are butt ugly without tweaking the CSS</li>
</ol>
</li>
</ol>
<p><img style="display: inline; border: 0px;" title="image" src="http://ripper234.com/wp-content/uploads/2010/02/su1.png" border="0" alt="image" width="791" height="431" /></p>
<h3>Day 4</h3>
<ul>
<li>I quickly caught myself duplicating code, and turned to learn about <a href="http://highoncoding.com/Articles/638_Understanding_Partial_Views_in_ASP_NET_MVC_Application.aspx">Partial Views</a>, which are reusable View pieces.</li>
<li>I realized that having my model entities derive from <a href="http://www.castleproject.org/activerecord/documentation/trunk/manual/aroperationsdocs/Generated_ActiveRecordBase.html">ActiveRecordBase</a> is damn ugly, because it makes my entire application dependant on AR even if I was using repositories to access the data. I switched the repositories to using <a href="http://api.castleproject.org/html/T_Castle_ActiveRecord_ActiveRecordMediator_1.htm">ActiveRecordMediator</a> instead.</li>
<li>The magic that is ReturnUrl – an extra request parameter that controllers use to return you to your original page after you login.</li>
<li>An interesting usage for <a href="http://msdn.microsoft.com/en-us/library/bb397696.aspx">anonymous object creation syntax</a> in C#, to pass query parameters: new { ReturnUrl = “foo”}</li>
<li>I decide to create a base class for all my controllers – UserAwareController. This was needed because every controller needs to access the current user, so I put all this logic in the UserAwareController base class.</li>
<li>Since every View needs the User to render, I created a Model base class that contains the current user. I’m not sure if this is the best way to go here, but it worked (what are your recommended best practices to store the user data?)</li>
<li>I implemented OpenID login using <a href="http://www.dotnetopenauth.net/">DotNetOpenAuth</a>, and it was quite a breeze. No need to store user credentials, just store his public open id and let other websites handle the authentication for you.</li>
</ul>
<p><img style="display: inline; border: 0px;" title="image" src="http://ripper234.com/wp-content/uploads/2010/02/su2.png" border="0" alt="image" width="701" height="524" /></p>
<h3>Day 5</h3>
<p>After allowing users to login and post questions, the next thing I wanted to implement was voting. So far all the code was server-side, but voting requires javascript because when a user votes you don’t want to refresh the page, but rather just change the vote icon. So:</p>
<ul>
<li>I learned about <a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery">jquery basics</a> and wrote events to handle clicking the voting buttons.</li>
<li>Sent the vote information to a dedicated controller using <a href="http://www.json.org/">JSON</a>. The way JSON requests translate to controller methods is really seamless.</li>
<li>Initially I had an ‘AddVote’ method, but quickly switched to ‘UpdateVote’, which makes more sense.</li>
<li>Some css tweaks to make the cursor change to a pointer while on the voting buttons</li>
</ul>
<p><img style="display: inline; border: 0px;" title="image" src="http://ripper234.com/wp-content/uploads/2010/02/su3.png" border="0" alt="image" width="731" height="541" /></p>
<h3>Day 6</h3>
<ul>
<li>I finally had to cache vote count on questions &amp; answers. The total vote count / score of a question has to be indexed, because we’ll have pages that get the ‘hottest posts’, and so keeping the User-Question vote relation is not enough.</li>
<li>So far, all my entities were strictly mapped to database rows. Now, I had to create a new ‘rich entity’ that contained a post and the current users’ vote on this post.</li>
<li>Finding myself duplicating logic between questions &amp; answers, I create a Post base class and factored the entities and repositories to work on abstract posts.</li>
</ul>
<p><img style="display: inline; border: 0px;" title="image" src="http://ripper234.com/wp-content/uploads/2010/02/su4.png" border="0" alt="image" width="731" height="646" /></p>
<p>This is it for now. I hope I didn’t make too many glaring mistakes in the process. As I mentioned, the <a href="http://github.com/ripper234/Stack-Underflow">code is available at GitHub</a> &#8211; if you’re interested in helping develop it or have any questions, please let me know.</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/whys-is-open-source-so-hard/' rel='bookmark' title='Permanent Link: Whys is Open Source so hard?'>Whys is Open Source so hard?</a></li>
<li><a href='http://ripper234.com/p/a-survey-of-open-apis/' rel='bookmark' title='Permanent Link: A survey of open APIs'>A survey of open APIs</a></li>
<li><a href='http://ripper234.com/p/stackoverflowcom/' rel='bookmark' title='Permanent Link: Stackoverflow.com'>Stackoverflow.com</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/vp2X2YQ4NS8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/open-source-stackoverflow-clone-by-a-n00b-webdev/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/open-source-stackoverflow-clone-by-a-n00b-webdev/</feedburner:origLink></item>
		<item>
		<title>Cancelor – a java task cancelation service</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/HIUKfC4evWw/</link>
		<comments>http://ripper234.com/p/cancelor-a-java-task-cancelation-servic/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 00:48:55 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cancelation]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Threading]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1217</guid>
		<description><![CDATA[Lately I need to support task cancellation in a Java process I&#8217;m working on. The straightforward options I know to implement this are:

Thread.interrupt() &#8211; the caller interrupts the worker thread (either directly or using Future.cancel()). Some say this is an erroneous approach, but I still haven&#8217;t figured out why. However, it is buggy on some recent versions [...]


Related posts:<ol><li><a href='http://ripper234.com/p/dont-switch-your-lock-object-mid-lock/' rel='bookmark' title='Permanent Link: Don&#8217;t switch your lock object mid-lock'>Don&#8217;t switch your lock object mid-lock</a></li>
<li><a href='http://ripper234.com/p/java-is-less-magical-than-c/' rel='bookmark' title='Permanent Link: Java is less magical than C#'>Java is less magical than C#</a></li>
<li><a href='http://ripper234.com/p/msbuild-fxcopsolution-task/' rel='bookmark' title='Permanent Link: MSBuild FxCopSolution Task'>MSBuild FxCopSolution Task</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Lately I need to support task cancellation in a Java process I&#8217;m working on. The straightforward options I know to implement this are:</p>
<ol>
<li><a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#interrupt()">Thread.interrupt()</a> &#8211; the caller interrupts the worker thread (either directly or using <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Future.html#cancel(boolean)">Future.cancel()</a>). <a href="http://blog.ktorium.com/">Some</a> say this is an erroneous approach, but I still <a href="http://stackoverflow.com/questions/2020992/is-thread-interrupt-evil">haven&#8217;t figured out why</a>. However, it is <a href="http://stackoverflow.com/questions/2012259/thread-isinterrupted-doesnt-work-thread-interrupted-does">buggy</a> on some recent versions on the JDK, and it is a bit fragile (what if the worker threads create worker threads that also need to be canceled?).</li>
<li>Passing some object (AtomicBoolean?) down to every object you would like to support cancellation. These objects will check the value of this boolean, and should stop if it is false. They can pass the boolean to other objects / tasks. While this works, this boolean cannot be injected, and so must be manually passed along the call stack.</li>
</ol>
<p>If you want the advantages of the second method, but don&#8217;t want to break IOC, here&#8217;s how:</p>
<p>First, the usage:</p>
<p>The listener object adds a dependency on ICancelor</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Foo <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> Foo<span style="color: #009900;">&#40;</span>ICancelor cancelor<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">cancelor</span> <span style="color: #339933;">=</span> cancelor<span style="color: #339933;">;</span>
    ...
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It then checks the cancellation state every now and then:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cancelor.<span style="color: #006633;">wasTaskCanceled</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;TakeOverTheWorld&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span></pre></div></div>

<p>The top-level thread that wishes to cancel a task simply calls</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">cancelor.<span style="color: #006633;">cancelTask</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;TakeOverTheWorld&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And whenever a task is started, you should call</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">cancelor.<span style="color: #006633;">resetTask</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;TakeOverTheWorld&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I&#8217;ll admit using strings for task names is a bit ugly, but this is not a terrible price to pay, assuming you have a few core tasks you intend to support. All that remains is the cancellation service itself:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * A cancellation service.
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> ICancelor <span style="color: #009900;">&#123;</span>
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Resets a task to &quot;Not canceled&quot; state
     */</span>
    <span style="color: #000066; font-weight: bold;">void</span> resetTask<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Returns true iff the a cancelTask was called, and no resetTask was called afterwards.
     */</span>
    <span style="color: #000066; font-weight: bold;">boolean</span> wasTaskCanceled<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Cancel a task
     */</span>
    <span style="color: #000066; font-weight: bold;">void</span> cancelTask<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Cancelor <span style="color: #000000; font-weight: bold;">implements</span> ICancelor <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> ConcurrentHashMap tasks <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ConcurrentHashMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> resetTask<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        tasks.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>name, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> wasTaskCanceled<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">Boolean</span> value <span style="color: #339933;">=</span> tasks.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> value <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;</span> value<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> cancelTask<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        tasks.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>name, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Because we rely on task names, there is an assumption here that all classes that play in the cancellation game belong to the same task semantically. If a class is a common class that doesn&#8217;t belong to a single task or flow, this approach does not work &#8211; in fact, I cannot think of an approach that will work in this case with dependency injection. The common class has to accept the cancellation signal somehow, it must either get an boolean explicit and not from the IOC container, or must check its interrupted state (or some other thread-local state) itself. Any smart ideas on how to solve this problem?</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/dont-switch-your-lock-object-mid-lock/' rel='bookmark' title='Permanent Link: Don&#8217;t switch your lock object mid-lock'>Don&#8217;t switch your lock object mid-lock</a></li>
<li><a href='http://ripper234.com/p/java-is-less-magical-than-c/' rel='bookmark' title='Permanent Link: Java is less magical than C#'>Java is less magical than C#</a></li>
<li><a href='http://ripper234.com/p/msbuild-fxcopsolution-task/' rel='bookmark' title='Permanent Link: MSBuild FxCopSolution Task'>MSBuild FxCopSolution Task</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/HIUKfC4evWw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/cancelor-a-java-task-cancelation-servic/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/cancelor-a-java-task-cancelation-servic/</feedburner:origLink></item>
		<item>
		<title>ALT.NET Israel Tools #1</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/t8GsI3dzfnY/</link>
		<comments>http://ripper234.com/p/alt-net-israel-tools-1/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 17:00:38 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[alt.net]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1215</guid>
		<description><![CDATA[Come hear about .Net tools in a &#8220;no bullshit&#8221; evening (more details here).


Related posts:A few blogging tools
Something I Wrote Once



Related posts:<ol><li><a href='http://ripper234.com/p/a-few-blogging-tools/' rel='bookmark' title='Permanent Link: A few blogging tools'>A few blogging tools</a></li>
<li><a href='http://ripper234.com/p/something-i-wrote-once/' rel='bookmark' title='Permanent Link: Something I Wrote Once'>Something I Wrote Once</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Come hear about .Net tools in a &#8220;no bullshit&#8221; evening (<a href="http://www.facebook.com/event.php?eid=247710842255">more details here</a>).</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/a-few-blogging-tools/' rel='bookmark' title='Permanent Link: A few blogging tools'>A few blogging tools</a></li>
<li><a href='http://ripper234.com/p/something-i-wrote-once/' rel='bookmark' title='Permanent Link: Something I Wrote Once'>Something I Wrote Once</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/t8GsI3dzfnY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/alt-net-israel-tools-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/alt-net-israel-tools-1/</feedburner:origLink></item>
		<item>
		<title>Playing around with PLINQ and IO-bound tasks</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/sv8TrE15teQ/</link>
		<comments>http://ripper234.com/p/playing-around-with-plinq-and-io-bound-tasks/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 22:04:07 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[PLINQ]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Threading]]></category>
		<category><![CDATA[TPL]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1192</guid>
		<description><![CDATA[

   function hide(id){
      document.getElementById(id).style.display = 'none';
   }    
   function show(id){
      document.getElementById(id).style.display = '';
   }
   function spoilerhide(){
      for (i=0;i


Related posts:<ol><li><a href='http://ripper234.com/p/playing-with-a-few-readerwriterlocks-in-net/' rel='bookmark' title='Permanent Link: Playing with a few ReaderWriterLocks in .Net'>Playing with a few ReaderWriterLocks in .Net</a></li>
<li><a href='http://ripper234.com/p/ant-intellij-tasks/' rel='bookmark' title='Permanent Link: Ant-IntelliJ-Tasks'>Ant-IntelliJ-Tasks</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>
<script>
   function hide(id){
      document.getElementById(id).style.display = 'none';
   }    
   function show(id){
      document.getElementById(id).style.display = '';
   }
   function spoilerhide(){
      for (i=0;i<document.getElementsByTagName('div').length;i++) {
         if (document.getElementsByTagName('div')[i].class == 'spoiler') {
            document.getElementsByTagName('div')[i].style.color = '#0000FF';
         }
      }
   }
   function spoilershow(){
      for (i=0;i<document.getElementsByTagName('div').length;i++) {
         if (document.getElementsByTagName('div')[i].class == 'spoiler') {
            document.getElementsByTagName('div')[i].style.color = '#FF0000';
         }
      }
   }
</script>
<br />
I recently <a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx">downloaded</a> Visual Studio 2010 beta, and took the chance to play with <a href="http://en.wikipedia.org/wiki/Parallel_Extensions">PLINQ</a>. PLINQ, for those of you in the dark ages of .Net Framework 2.0, is parallel LINQ &#8211; an extension to the famous query language that makes it easy to write parallel code (essential to programming in the 21th century, <a href="http://en.wikipedia.org/wiki/Moore's_law#Transistor_count_versus_computing_performance">in the age of the many-core</a>).</p>
<p>A code sample, as usual, is the best demonstration:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">int</span> CountPrimes<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">int</span><span style="color: #008000;">&gt;</span> input<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">return</span> input.<span style="color: #0000FF;">AsParallel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>IsPrime<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">bool</span> IsPrime<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> n<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">2</span><span style="color: #008000;">;</span> i<span style="color: #008000;">*</span>i <span style="color: #008000;">&lt;</span> n<span style="color: #008000;">;</span> <span style="color: #008000;">++</span>i<span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>n <span style="color: #008000;">%</span> i <span style="color: #008000;">==</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
            <span style="color: #0600FF;">return</span> false<span style="color: #008000;">;</span>
    <span style="color: #0600FF;">return</span> true<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This code sample, regardless of using an inefficient primality test, is fully parallel. PLINQ will utilize all your cores when running the above code, and I didn&#8217;t have to use any locks, queues, threadpools or any of the more complex tools of the trade. Just tell PLINQ &#8220;AsParallel()&#8221;, and it works.</p>
<p>I hit some gotcha when I tried to compare the parallel performance with the sequential one. Do you spot the problem in the following code?</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> CountPrimesTest<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">int</span><span style="color: #008000;">&gt;</span> input<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">// parallel benchmark </span>
    var timer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Stopwatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    timer.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    CountPrimes<span style="color: #000000;">&#40;</span>input.<span style="color: #0000FF;">AsParallel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    timer.<span style="color: #0000FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Counted primes in parallel took &quot;</span> <span style="color: #008000;">+</span> timer.<span style="color: #0000FF;">Elapsed</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">// sequential benchmark</span>
    timer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Stopwatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    timer.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    CountPrimes<span style="color: #000000;">&#40;</span>input<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    timer.<span style="color: #0000FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Counted primes sequentially took &quot;</span> <span style="color: #008000;">+</span> timer.<span style="color: #0000FF;">Elapsed</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<div id="div1">
<input type="button" onClick="hide('div1'); show('div2'); spoilershow();" value="Ooh, tell me please!">
</div>
<div id="div2" style="display:none;">
<input type="button" onClick="show('div1'); hide('div2'); spoilerhide();" value="I'm sorry I looked"><br/><br />
    As <a href="http://stackoverflow.com/questions/1812615/how-exactly-does-asparallel-work">StackOverflow told me</a>, PLINQ cares about the static type of the sequence, not the dynamic type. When input is cast to IEnumerable&lt;T&gt;, it loses the original intent, and is not parallelized by LINQ.
</div>
<p><br/></p>
<p>This is all fine and dandy when the task at hand is CPU bound, but works pretty miserabbly when your task is IO bound, like downloading a bunch of web pages. Next, I simulated some IO-bound tasks (I used Sleep() to emulate IO &#8211; basically not using a lot of CPU for every task):</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>ThreadStatic<span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> Random _random<span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> FindInterestingDomains<span style="color: #000000;">&#40;</span>IEnumerable<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> urls<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">// select all the domains of the interesting URLs</span>
    <span style="color: #0600FF;">return</span> urls.<span style="color: #0000FF;">AsParallel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>SexFilter<span style="color: #000000;">&#41;</span>.
                <span style="color: #0000FF;">Select</span><span style="color: #000000;">&#40;</span>url <span style="color: #008000;">=&gt;</span> <span style="color: #008000;">new</span> Uri<span style="color: #000000;">&#40;</span>url<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Host</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">bool</span> SexFilter<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> url<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_random <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
        _random <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Random<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">// simulate a download</span>
    Thread.<span style="color: #0000FF;">Sleep</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1000</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    var html <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&lt;html&gt;&quot;</span> <span style="color: #008000;">+</span> _random.<span style="color: #0000FF;">Next</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;&lt;/html&gt;&quot;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF;">return</span> html.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;69&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Testing this with a list of 10 URLs took 5 seconds, meaning LINQ again spun only two cores, which is the number of cores on my machine. This really sucks for IO bound tasks, because most of the time the threads are idle, waiting on IO. Let&#8217;s see if we can speed this up:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Use WithDegreeOfParallelism to specify the number of threads to run</span>
<span style="color: #0600FF;">return</span> urls.<span style="color: #0000FF;">AsParallel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">WithDegreeOfParallelism</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">10</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>SexFilter<span style="color: #000000;">&#41;</span>.
              <span style="color: #0000FF;">Select</span><span style="color: #000000;">&#40;</span>url <span style="color: #008000;">=&gt;</span> <span style="color: #008000;">new</span> Uri<span style="color: #000000;">&#40;</span>url<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Host</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>This appeared not to work at first, because WithDegreeOfParallelism is just a recommendation or upper bound. You can ask PLINQ nicely to run with ten threads, but it will only allocate two if it so chooses. This is yet another example of C# being <a href="http://ripper234.com/p/java-is-less-magical-than-c/">more magical than Java</a> &#8211; compared to Java&#8217;s rich <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ExecutorService.html">ExecutorService</a>, PLINQ offers less fine grained control.</p>
<p>However, further testing revealed the damage is not so horrible. This is what happened when I put the above code in a while(true):</p>
<pre>
Tested 10 URLs in 00:00:05.0576333
Tested 10 URLs in 00:00:03.0018617
Tested 10 URLs in 00:00:03.0013939
Tested 10 URLs in 00:00:03.0013175
Tested 10 URLs in 00:00:04.0018983
Tested 10 URLs in 00:00:03.0024044
Tested 10 URLs in 00:00:01.0004407
Tested 10 URLs in 00:00:01.0007645
Tested 10 URLs in 00:00:01.0007280
Tested 10 URLs in 00:00:01.0003358
Tested 10 URLs in 00:00:01.0003347
Tested 10 URLs in 00:00:01.0002470
</pre>
<p>After some trial and error, PLINQ found that the optimal number of threads needed to run this task under its concurrency guidelines is ten. I imagine that if at some point in the future the optimal number of threads change, it will adapt.</p>
<p>P.S.<br />
If you found this interesting, wait till you read about <a href="http://research.microsoft.com/en-us/projects/DryadLINQ/">DryadLINQ</a> &#8211; it&#8217;s LINQ taken to the extreme, run over a cluster of computers.</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/playing-with-a-few-readerwriterlocks-in-net/' rel='bookmark' title='Permanent Link: Playing with a few ReaderWriterLocks in .Net'>Playing with a few ReaderWriterLocks in .Net</a></li>
<li><a href='http://ripper234.com/p/ant-intellij-tasks/' rel='bookmark' title='Permanent Link: Ant-IntelliJ-Tasks'>Ant-IntelliJ-Tasks</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/sv8TrE15teQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/playing-around-with-plinq-and-io-bound-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/playing-around-with-plinq-and-io-bound-tasks/</feedburner:origLink></item>
		<item>
		<title>Ant-IntelliJ-Tasks</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/si3NAFZnAY0/</link>
		<comments>http://ripper234.com/p/ant-intellij-tasks/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 05:59:38 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ant-intellij-tasks]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[IntelliJ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tomer Gabel]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1188</guid>
		<description><![CDATA[I&#8217;ve posted a lot lately,  but I think this post is well deserved. Tomer has recently finished an open source project he&#8217;s been working on for quite some time &#8211; ant-intellij-tasks. It is an ant task that takes an intellij-format project structures, builds and tests it. We have been using it for the past two months [...]


Related posts:<ol><li><a href='http://ripper234.com/p/knuth-and-the-city-teamcity/' rel='bookmark' title='Permanent Link: Knuth and The City (TeamCity!)'>Knuth and The City (TeamCity!)</a></li>
<li><a href='http://ripper234.com/p/disable-resharper-c-3-syntax/' rel='bookmark' title='Permanent Link: Disable Resharper C# 3 syntax'>Disable Resharper C# 3 syntax</a></li>
<li><a href='http://ripper234.com/p/thrift-win32-binary/' rel='bookmark' title='Permanent Link: Thrift win32 binary'>Thrift win32 binary</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://ripper234.com/p/met-community-emerging/">posted</a> <a href="http://ripper234.com/p/trying-out-the-stackexchange-platform/">a lot</a> <a href="http://ripper234.com/p/so-this-is-what-an-empty-stackoverflow-looks-like/">lately</a>,  but I think this post is well deserved. <a href="http://tomergabel.com/">Tomer</a> has recently <a href="http://www.tomergabel.com/AnnouncingAntintellijtasks.aspx">finished</a> an open source project he&#8217;s been working on for quite some time &#8211; <a href="http://code.google.com/p/ant-intellij-tasks/">ant-intellij-tasks</a>. It is an ant task that takes an intellij-format project structures, builds and tests it. <a href="http://delver.com">We</a> have been using it for the past two months or so, and I must say it has brought great joy to <a href="http://en.wikipedia.org/wiki/Continuous_integration">the CI</a>. Before that, we used to maintain two separate sets of files &#8211; IntelliJ project files, because that&#8217;s our IDE of choice, and Eclipse files, because &#8230; that&#8217;s how the build system worked. Many a times the build broke because one did not apply a change to the eclipse file, and &#8220;it all <a href="http://www.buildsonmymachine.com/">worked on his machine</a>&#8220;. No more (we still have broken builds, but usually not because of compilation errors).</p>
<p>In related news, JetBrains recently <a href="http://blogs.jetbrains.com/idea/2009/10/intellij-idea-open-sourced/">open-sourced IntelliJ</a> itself. Tomer&#8217;s work is still worth while, simply because there is no other tool we know of that does what it does &#8211; however the code there might use some refactoring now that he can simply use portions of the IntelliJ codebase. If you want to help, go on to the <a href="http://code.google.com/p/ant-intellij-tasks/">project homepage</a>.</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/knuth-and-the-city-teamcity/' rel='bookmark' title='Permanent Link: Knuth and The City (TeamCity!)'>Knuth and The City (TeamCity!)</a></li>
<li><a href='http://ripper234.com/p/disable-resharper-c-3-syntax/' rel='bookmark' title='Permanent Link: Disable Resharper C# 3 syntax'>Disable Resharper C# 3 syntax</a></li>
<li><a href='http://ripper234.com/p/thrift-win32-binary/' rel='bookmark' title='Permanent Link: Thrift win32 binary'>Thrift win32 binary</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/si3NAFZnAY0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/ant-intellij-tasks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/ant-intellij-tasks/</feedburner:origLink></item>
		<item>
		<title>There’s a (meta) community emerging</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/FaWaIqzXrqk/</link>
		<comments>http://ripper234.com/p/met-community-emerging/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:52:11 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[draw3cards]]></category>
		<category><![CDATA[StackExchange]]></category>
		<category><![CDATA[Stackoverflow]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1183</guid>
		<description><![CDATA[As you probably know, I joined the new wave and got my own Stack Exchange site. It&#8217;s really amazing how many different SE sites are emerging so rapidly. There&#8217;s a strong sense of (meta) community with most of the site owners heavily participating in discussions on meta stackexchange.
There is some overlap between different sites, but most sites [...]


Related posts:<ol><li><a href='http://ripper234.com/p/trying-out-the-stackexchange-platform/' rel='bookmark' title='Permanent Link: Trying out the StackExchange platform'>Trying out the StackExchange platform</a></li>
<li><a href='http://ripper234.com/p/fake-sites/' rel='bookmark' title='Permanent Link: Fake Sites'>Fake Sites</a></li>
<li><a href='http://ripper234.com/p/stackoverflow-overflow/' rel='bookmark' title='Permanent Link: StackOverflow Overflow'>StackOverflow Overflow</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As you <a href="http://ripper234.com/p/trying-out-the-stackexchange-platform/">probably know</a>, I joined the new wave and got my own <a href="http://draw3cards.com/">Stack Exchange site</a>. It&#8217;s really amazing how many <a href="http://meta.stackexchange.com/questions/4/list-of-stackexchange-sites">different SE sites</a> are emerging so rapidly. There&#8217;s a strong sense of (meta) community with most of the site owners heavily participating in <a href="http://meta.stackexchange.com/questions/1287/google-still-hasnt-indexed-my-site-and-its-webmasters-tools-says-ses-robots-tx">discussions</a> <a href="http://meta.stackexchange.com/questions/1316/share-the-knowledge-top-tips-list">on</a> <a href="http://meta.stackexchange.com/questions/643/what-should-i-customize-before-i-launch-my-site">meta stackexchange</a>.</p>
<p>There is some <a href="http://meta.stackexchange.com/questions/1180/the-elephant-in-the-room-many-of-us-have-started-sites-on-exactly-the-same-topi">overlap between different sites</a>, but most sites I&#8217;ve seen are <a href="http://moms4mom.com/">original</a> and <a href="http://mathoverflow.net/">useful</a>. The owner/s of <a href="http://epicadvice.com/">one SE site</a> have been nice enough to post links to other SE sites, including <a href="http://draw3cards.com/">Draw3Cards</a>, at the top of their homepage!</p>
<p>Today I convinced a friend at work to open his own website, and I think you should to &#8211; before all the good ones are taken. Come and <a href="http://beta.stackexchange.com/sign-up/">join us</a>, it&#8217;s really that easy.</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/trying-out-the-stackexchange-platform/' rel='bookmark' title='Permanent Link: Trying out the StackExchange platform'>Trying out the StackExchange platform</a></li>
<li><a href='http://ripper234.com/p/fake-sites/' rel='bookmark' title='Permanent Link: Fake Sites'>Fake Sites</a></li>
<li><a href='http://ripper234.com/p/stackoverflow-overflow/' rel='bookmark' title='Permanent Link: StackOverflow Overflow'>StackOverflow Overflow</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/FaWaIqzXrqk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/met-community-emerging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/met-community-emerging/</feedburner:origLink></item>
		<item>
		<title>Trying out the StackExchange platform</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/OSawn8dMRdQ/</link>
		<comments>http://ripper234.com/p/trying-out-the-stackexchange-platform/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 19:29:38 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[draw3cards]]></category>
		<category><![CDATA[Magic]]></category>
		<category><![CDATA[Stackoverflow]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1176</guid>
		<description><![CDATA[For the last couple of days I&#8217;ve been obsessing over a new toy. Jeol &#38; Jeff, the powers behind StackOverflow, have launched a public beta of StackExchange &#8211; a platform for hosting Q&#38;A sites. Browsing the list of stack exchange sites, I saw several more and less successful sites, including:

The (already-profiting) site on World of [...]


Related posts:<ol><li><a href='http://ripper234.com/p/met-community-emerging/' rel='bookmark' title='Permanent Link: There&#8217;s a (meta) community emerging'>There&#8217;s a (meta) community emerging</a></li>
<li><a href='http://ripper234.com/p/stackoverflowcom/' rel='bookmark' title='Permanent Link: Stackoverflow.com'>Stackoverflow.com</a></li>
<li><a href='http://ripper234.com/p/fake-sites/' rel='bookmark' title='Permanent Link: Fake Sites'>Fake Sites</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For the last couple of days I&#8217;ve been obsessing over <a href="http://draw3cards.com">a new toy</a>. Jeol &amp; Jeff, the powers behind <a href="http://stackoverflow.com">StackOverflow</a>, have launched a public beta of <a href="http://stackexchange.com">StackExchange</a> &#8211; a platform for hosting Q&amp;A sites. Browsing the <a href="http://meta.stackexchange.com/questions/4">list of stack exchange sites</a>, I saw several more and less successful sites, including:</p>
<ul>
<li>The (<a href="http://meta.stackexchange.com/questions/1008/early-se-sites-hows-it-going-with-adsense">already-profiting</a>) <a href="http://epicadvice.com/">site on World of Warcraft</a> (and site has barely been online for 2 weeks!)</li>
<li>AskSci, in which <a href="http://ripper234.com/p/so-this-is-what-an-empty-stackoverflow-looks-like/">I&#8217;ve been made moderator</a>, but has been rather desolate since</li>
<li><a href="http://ripper234.com/p/so-this-is-what-an-empty-stackoverflow-looks-like/"></a>And <a href="http://mathoverflow.net/">MathOverflow</a>, which seem to be already useful</li>
</ul>
<p>I decided to try and open <a href="http://draw3cards.com">my own site, about Magic: The Gathering</a>. The setup itself was rather easy. I:</p>
<ul>
<li>Bought a domain and set it up, with <a href="http://meta.stackexchange.com/questions/1689/guide-for-dummies-on-configuring-my-own-se-site-at-foo-com">some help</a></li>
<li>Seeded the site with some <a href="http://draw3cards.com/questions/3/how-does-hypnotic-specter-work-in-two-headed-giant-games">questions and answers</a></li>
<li>Tweaked the color scheme, logo and favicon (thanks Eran)</li>
<li>Got some friends to <a href="http://draw3cards.com/questions/1/how-to-draft-an-aggro-deck">help out</a> (though so far they&#8217;ve only posted answers, not questions)</li>
<li>Setup Google Analytics, and noticed incoming search traffic <a href="http://meta.stackexchange.com/questions/1844/how-much-time-are-search-visitors-staying-on-your-site">only stayed for 42 seconds on the site</a></li>
<li>Opened a small AdWords campaign, paying 1.5$ a day to test the water.</li>
<li>Post the site on this blog, of course.</li>
</ul>
<p>Now what remains to be seen is whether the site can accumulate the needed critical mass. For now, the site is in beta, meaning I don&#8217;t have to pay anything to keep it running (except time and effort). <a href="http://meta.stackexchange.com/questions/1614/how-long-will-stackexchange-be-in-beta">When the beta is over</a>, the cost will be $129 a month, which is quite challenging to make using adsense.</p>
<p>Keep your fingers crossed for me <img src='http://ripper234.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>P.S.</strong></p>
<p><span style="text-decoration: line-through;">Just got a</span> $100 coupon for AdWords by visiting Google Webmasters Tools &#8211; how cool is that? In a second look, it appears the coupon was lying in my Webmasters Tools inbox for two months now, just waiting for the perfect opportunity.</p>
<p>I also forgot to mention opening <a href="http://draw3cards.uservoice.com/">a uservoice forum</a> (+ adding the widget to my site).</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/met-community-emerging/' rel='bookmark' title='Permanent Link: There&#8217;s a (meta) community emerging'>There&#8217;s a (meta) community emerging</a></li>
<li><a href='http://ripper234.com/p/stackoverflowcom/' rel='bookmark' title='Permanent Link: Stackoverflow.com'>Stackoverflow.com</a></li>
<li><a href='http://ripper234.com/p/fake-sites/' rel='bookmark' title='Permanent Link: Fake Sites'>Fake Sites</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/OSawn8dMRdQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/trying-out-the-stackexchange-platform/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/trying-out-the-stackexchange-platform/</feedburner:origLink></item>
		<item>
		<title>Zendikar draft walkthrough (mono-red)</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/AJo_uq6wAAk/</link>
		<comments>http://ripper234.com/p/zendikar-draft-walkthrough-mono-red/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 00:05:29 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1170</guid>
		<description><![CDATA[Chcek out my recent draft walkthrough on monored Zendikar.


Related posts:A lucky Alara Reborn walkthrough (Esper)
Alara Reborn Draft Walkthrough &#8211; 5-Color Naya
Magic draft walkthrough creator



Related posts:<ol><li><a href='http://ripper234.com/p/a-lucky-alara-reborn-walkthrough-esper/' rel='bookmark' title='Permanent Link: A lucky Alara Reborn walkthrough (Esper)'>A lucky Alara Reborn walkthrough (Esper)</a></li>
<li><a href='http://ripper234.com/p/alara-reborn-draft-walkthrough-5-color-naya/' rel='bookmark' title='Permanent Link: Alara Reborn Draft Walkthrough &#8211; 5-Color Naya'>Alara Reborn Draft Walkthrough &#8211; 5-Color Naya</a></li>
<li><a href='http://ripper234.com/p/magic-draft-walkthrough-creator/' rel='bookmark' title='Permanent Link: Magic draft walkthrough creator'>Magic draft walkthrough creator</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Chcek out my recent draft walkthrough on <a href="http://ripper234.com/magic/dr/">monored Zendikar</a>.</p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/a-lucky-alara-reborn-walkthrough-esper/' rel='bookmark' title='Permanent Link: A lucky Alara Reborn walkthrough (Esper)'>A lucky Alara Reborn walkthrough (Esper)</a></li>
<li><a href='http://ripper234.com/p/alara-reborn-draft-walkthrough-5-color-naya/' rel='bookmark' title='Permanent Link: Alara Reborn Draft Walkthrough &#8211; 5-Color Naya'>Alara Reborn Draft Walkthrough &#8211; 5-Color Naya</a></li>
<li><a href='http://ripper234.com/p/magic-draft-walkthrough-creator/' rel='bookmark' title='Permanent Link: Magic draft walkthrough creator'>Magic draft walkthrough creator</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/AJo_uq6wAAk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/zendikar-draft-walkthrough-mono-red/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/zendikar-draft-walkthrough-mono-red/</feedburner:origLink></item>
		<item>
		<title>So this is what an empty StackOverflow looks like</title>
		<link>http://feedproxy.google.com/~r/AQuantumImmortal/~3/Hm0yGCLcEXw/</link>
		<comments>http://ripper234.com/p/so-this-is-what-an-empty-stackoverflow-looks-like/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 12:07:24 +0000</pubDate>
		<dc:creator>ripper234</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ask Science]]></category>
		<category><![CDATA[Stackoverflow]]></category>

		<guid isPermaLink="false">http://ripper234.com/?p=1155</guid>
		<description><![CDATA[Well, I said this would happen.
StackOverflow&#8217;s flood gates are open, and there are many new sites based on the stackoverflow engine.
One of those that I think has great potential is Ask Science, though at the moment it&#8217;s rather desolate:



Related posts:StackOverflow Overflow
Stackoverflow.com
An open source StackOverflow clone by a n00b web dev



Related posts:<ol><li><a href='http://ripper234.com/p/stackoverflow-overflow/' rel='bookmark' title='Permanent Link: StackOverflow Overflow'>StackOverflow Overflow</a></li>
<li><a href='http://ripper234.com/p/stackoverflowcom/' rel='bookmark' title='Permanent Link: Stackoverflow.com'>Stackoverflow.com</a></li>
<li><a href='http://ripper234.com/p/open-source-stackoverflow-clone-by-a-n00b-webdev/' rel='bookmark' title='Permanent Link: An open source StackOverflow clone by a n00b web dev'>An open source StackOverflow clone by a n00b web dev</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Well, <a href="http://ripper234.com/p/stackoverflow-overflow/">I said</a> this would happen.</p>
<p>StackOverflow&#8217;s flood gates are open, and there are <a href="http://meta.stackexchange.com/questions/4/list-of-stackexchange-sites">many new sites</a> based on the stackoverflow engine.</p>
<p>One of those that I think has great potential is <a href="http://asksci.com/">Ask Science</a>, though at the moment it&#8217;s rather desolate:<br />
<img src="http://img63.imageshack.us/img63/5676/asksci.png" alt="asksci" title="asksci" width="1001" height="753" class="alignnone size-full wp-image-1156" /></p>


<p>Related posts:<ol><li><a href='http://ripper234.com/p/stackoverflow-overflow/' rel='bookmark' title='Permanent Link: StackOverflow Overflow'>StackOverflow Overflow</a></li>
<li><a href='http://ripper234.com/p/stackoverflowcom/' rel='bookmark' title='Permanent Link: Stackoverflow.com'>Stackoverflow.com</a></li>
<li><a href='http://ripper234.com/p/open-source-stackoverflow-clone-by-a-n00b-webdev/' rel='bookmark' title='Permanent Link: An open source StackOverflow clone by a n00b web dev'>An open source StackOverflow clone by a n00b web dev</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/AQuantumImmortal/~4/Hm0yGCLcEXw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ripper234.com/p/so-this-is-what-an-empty-stackoverflow-looks-like/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://ripper234.com/p/so-this-is-what-an-empty-stackoverflow-looks-like/</feedburner:origLink></item>
	</channel>
</rss>
