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

<channel>
	<title>jBlog &#187; Joel</title>
	<atom:link href="http://www.blog.wordaligned.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.wordaligned.com</link>
	<description>//TODO: add tagline</description>
	<lastBuildDate>Fri, 19 Feb 2010 15:31:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>concurrency models in jruby using jetlang&#8230;</title>
		<link>http://www.blog.wordaligned.com/2010/02/17/concurrency-models-in-jruby-using-jetlang/</link>
		<comments>http://www.blog.wordaligned.com/2010/02/17/concurrency-models-in-jruby-using-jetlang/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 00:37:04 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[jretlang]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[mailbox]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.blog.wordaligned.com/?p=29</guid>
		<description><![CDATA[Note: This is in response to a post I saw the other morning on #dev-test-ops called &#8220;Jruby + Jetlang =&#62; Awesome Message Passing Concurrency&#8220;, written by Sai Venkatarishan.
As Sai&#8217;s post states, jetlang (or if you&#8217;re in C#, retlang) makes for awesome message passing concurrency. I have become familiar with jetlang/retlang in my past few years [...]]]></description>
			<content:encoded><![CDATA[<p>Note: This is in response to a post I saw the other morning on #dev-test-ops called &#8220;<a href="http://developer-in-test.blogspot.com/2010/02/jruby-jetlang-awesome-message-passing.html" target="_blank">Jruby + Jetlang =&gt; Awesome Message Passing Concurrency</a>&#8220;, written by Sai Venkatarishan.</p>
<p>As Sai&#8217;s post states, jetlang (or if you&#8217;re in C#, retlang) makes for awesome message passing concurrency. I have become familiar with jetlang/retlang in my past few years of working at <a href="http://drw.com" target="_blank">DRW Trading</a>; many times writing code very similar to that within the examples provided by Sai but in C#. However, over the past few months my team has started using jruby more frequently so naturally we used jetlang as stated in Sai&#8217;s post. Shortly after adopting jruby as our JVM based language we started using jetlang via a gem written by Gareth Reeves, called <a href="http://github.com/reevesg/jretlang">jretlang</a>, which provides the benefits of jetlang in jruby with less of the ceremony. To illustrate this, I&#8217;ve rewritten Sai&#8217;s first example using jretlang as opposed to jetlang. You&#8217;ll see that essentially all it does is clean up some of the setup of the file.</p>
<pre class="brush: ruby;">
require &quot;rubygems&quot;
require &quot;jretlang&quot;

class Arnie
  def initialize
    @channel = JRL::Channel.new
    @consumer = JRL::Fiber.new
  end

  def start
    @consumer.start
    @channel.subscribe_on_fiber( @consumer ) do |message|
      case message
      when &quot;The End&quot;
        puts &quot;I will be back...&quot;
        @consumer.dispose
        @consumer.join
      when &quot;Terminate&quot;
       puts &quot;Hastala vista baby!!!&quot;
      else
       puts &quot;You are terminated******&quot;
      end
    end
  end

  def ^(message)
    @channel.publish(message)
  end
end

terminator = Arnie.new
terminator.start
terminator ^ &quot;Terminate&quot;
terminator ^ &quot;Buy me ice cream&quot;
terminator ^ &quot;The End&quot;
terminator ^ &quot;Terminate&quot; #Will not puts anything, as you've stopped the fiber
</pre>
<p>Now upon seeing this, it does not really seem to need the channel for the message passing. Typically we&#8217;ll use channels when the object publishing a message and the object(s) receiving the message are distinct and don&#8217;t know about each other. Notice I used &#8220;(s)&#8221; on object, this is because the publisher does not need to worry itself with he details of how many objects, if any, are subscribed on its channel.  This is commonly referred to as a <a href="http://en.wikipedia.org/wiki/Process_calculus">process calculi</a> approach of concurrency. The Actor-model approach, which Sai speaks of,  is more about an object having a reference to another object, their actor, which will act on the delivery of a message to its inbox. Jetlang/Retlang&#8217;s fibers support this concept without having the overhead of a channel. Fibers contain an execute method that can simply execute a lambda on that fiber. Using this concept, we can clean this example up even more and move to a truer actor-model based approach.</p>
<pre class="brush: ruby;">

require &quot;rubygems&quot;
require &quot;jretlang&quot;

class Arnie
  def initialize
    @consumer = JRL::Fiber.new
  end

  def start
    @consumer.start
  end

  def ^(message)
    @consumer.execute do
      case message
      when &quot;The End&quot;
        puts &quot;I will be back...&quot;
        @consumer.dispose
        @consumer.join
      when &quot;Terminate&quot;
        puts &quot;Hastala vista baby!!!&quot;
      else
        puts &quot;You are terminated******&quot;
      end
    end
  end
end

terminator = Arnie.new
terminator.start
terminator ^ &quot;Terminate&quot;
terminator ^ &quot;Buy me ice cream&quot;
terminator ^ &quot;The End&quot;
terminator ^ &quot;Terminate&quot; #Will not puts, fiber has been disposed
</pre>
<p>Having used jetlang/retlang as my main source of concurrency for a while, I&#8217;ve seen myself writing very similar code to that above every time I introduce a new thread (fiber). But when I look at the class above I think, what really is the main job of the class? I find the answer in the body of the fiber&#8217;s execute. It is the only thing that differs from Arnie to any other class that has similar functionality, say JohnConner. After putting up with implementing this duplication for far too long, my co-worker Pat Farley and I  decided that we were tired of wasting our &#8220;valuable&#8221; time and effort typing most of this over and over again. This lead us to create  <a href="http://github.com/joelash/mailbox" target="_blank">mailbox</a> (see <a href="http://www.klankboomklang.com/2009/10/31/ruby-in-a-multicore-world/" target="_blank">Pat&#8217;s blog post</a>), a gem to help remove most of the structural redundancies involved in jruby concurrency models using jetlang. So, using mailbox our example code becomes:</p>
<pre class="brush: ruby;">
require &quot;rubygems&quot;
require &quot;mailbox&quot;

class Arnie
  include Mailbox

  mailslot
  def ^(message)
    case message
    when &quot;The End&quot;
      puts &quot;I will be back...&quot;
      # cannot dispose from here
    when &quot;Terminate&quot;
      puts &quot;Hastala vista baby!!!&quot;
    else
      puts &quot;You are terminated******&quot;
    end
  end
end

terminator = Arnie.new
terminator ^ &quot;Terminate&quot;
terminator ^ &quot;Buy me ice cream&quot;
terminator ^ &quot;The End&quot;
terminator ^ &quot;Terminate&quot; # THIS STILL PRINTS
</pre>
<p>This separates the message handling logic from how the object achieves actor-model based concurrency. In addition to actor-model based concurrency, mailbox supports the use of channels, but this example is better shown without channels.</p>
<p>All the above code is available on <a href="http://gist.github.com/305954" target="_blank">github as a gist</a>. I&#8217;ll try later this week to do the ping-pong example using mailbox and put it up either as a Gist or just an example in Mailbox; please look in the comments for another link to the ping-pong example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.wordaligned.com/2010/02/17/concurrency-models-in-jruby-using-jetlang/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning Photoshop Foo</title>
		<link>http://www.blog.wordaligned.com/2009/12/17/learning-photoshop-foo/</link>
		<comments>http://www.blog.wordaligned.com/2009/12/17/learning-photoshop-foo/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 02:12:43 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.blog.wordaligned.com/?p=25</guid>
		<description><![CDATA[So last night after speaking with one of my friends, Andy, who is big into ruby on rails and has developed his own website, Piggy Back Me, I decided it was time that I learned how do some graphic design of my own. I too am planning on writing a website for fun and want [...]]]></description>
			<content:encoded><![CDATA[<p>So last night after speaking with one of my friends, Andy, who is big into ruby on rails and has developed his own website, <a href="http://www.piggybackme.com">Piggy Back Me</a>, I decided it was time that I learned how do some graphic design of my own. I too am planning on writing a website for fun and want to have some good icons and logos on it and since I&#8217;m not made of money and don&#8217;t really know too many people that are good, why not learn?</p>
<p>Andy pointed me to a good site that had <a href="http://ow.ly/Miup">49 different photoshop tutorials</a>, after digging though there for a while I came across <a href="http://www.tutorial9.net/category/photoshop/">Tutorial9</a> and spent a few hours playing with one of the tutorials on there.  Here&#8217;s what I&#8217;ve got to show for it:</p>
<div id="attachment_26" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-26 " title="Notepad" src="http://www.blog.wordaligned.com/wp-content/uploads/2009/12/Notepad.png" alt="Notepad image created from Tutorial9 tutorial on photoshop." width="550" height="367" /><p class="wp-caption-text">Notepad image created from Tutorial9 tutorial on photoshop.</p></div>
<p>My thoughts on this tutorial: While what I produced it pretty sweet looking in my opinion, I really didn&#8217;t learn a whole lot, save how to use the Pen Tool when it&#8217;s set to you Bezier Paths. The tutorial was very laid out step-by-step and didn&#8217;t explain the reasoning behind a lot of it. That being said, I&#8217;m going to continue one with more Tutorial9 tutorials because I think after a few I&#8217;ll start to pick things up and should know enough to get my hands dirty with a simple logo or button image for my upcoming site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.wordaligned.com/2009/12/17/learning-photoshop-foo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QCon &#8211; Tutorials Day 1</title>
		<link>http://www.blog.wordaligned.com/2009/11/17/qcon-tutorials-day-1/</link>
		<comments>http://www.blog.wordaligned.com/2009/11/17/qcon-tutorials-day-1/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 02:19:28 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[qcon]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://www.blog.wordaligned.com/?p=19</guid>
		<description><![CDATA[Monday was the first day of the QCon conference in San Francisco. I spent the day in two separate tutorials. The morning tutorial was &#8216;Doing TDD as if you meant it&#8217; which was taught by Joshua Kerievsky of Industrial Logic. The afternoon tutorial was supposed to be &#8216;Cloud Computing&#8217; with Stuart Charlton, however he was [...]]]></description>
			<content:encoded><![CDATA[<p>Monday was the first day of the QCon conference in San Francisco. I spent the day in two separate tutorials. The morning tutorial was &#8216;Doing TDD as if you meant it&#8217; which was taught by Joshua Kerievsky of <a href="www.industriallogic.com">Industrial Logic</a>. The afternoon tutorial was supposed to be &#8216;Cloud Computing&#8217; with Stuart Charlton, however he was unable to make it due to medical reason, so it turned out to be a question and answer session on all things Agile and XP with Joshua Kerievsky.</p>
<p>Joshua spoke a lot on the agile process and what it takes to <strong>design</strong> software which is reliable, release frequently and most importantly constantly adds value to your &#8220;customer&#8221; with almost every release (I put &#8220;customer&#8221; in quotes because some people think that they may not have customers because their software isn&#8217;t being sold. However, that&#8217;s not what defines the customer, the end user of your software is your user). The way that they do this is decide after a release what customer requests they are going to release that week and when they&#8217;ll be able to release them that week. This can lead to release your software to production more than once some weeks and none some weeks. This can certainly have positive side effects, especially in your release process.</p>
<p>If your team releases using a manual or only semi-automated process, most likely frequent releases are not a luxury for you. My team at DRW has yet to master a fully automated release process, but it is a vision that we are working towards with every release. There are many tools that can be used to do this (and frankly I only know of the ones that we&#8217;ve used at some point in time). Which tool you use doesn&#8217;t matter, what matters is that you put the effort into an automated release.</p>
<p>The last major thing regarding frequent releases that Joshua mentioned during his tutorials was what their ultimate vision. The ultimate vision for Industrial Logic, and probably for many followers of agile, is a continuous release. Ideally they would like that have the setup that whenever someone committed to their repository, the continuous incremental build would run and then if successful a release would automatically occur. While this would involve many more infrastructure changes than just an automated release it may be a thing to consider. I have not yet given it much thought, since it was a concept I began thinking about roughly 24 hours ago, but I can see where there might be advantages to it.</p>
<p>All in all, I enjoyed my tutorials with Joshua and thank him for imparting his knowledge on me and the rest of us here at QCon &#8211; San Francisco 2009. I look forward to the rest of the week here and if anyone has good comments to add on this, please let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.wordaligned.com/2009/11/17/qcon-tutorials-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>oops</title>
		<link>http://www.blog.wordaligned.com/2009/06/09/oops/</link>
		<comments>http://www.blog.wordaligned.com/2009/06/09/oops/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 03:59:28 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.blog.wordaligned.com/?p=3</guid>
		<description><![CDATA[Learned the hard-way that rm -rf ./* is a horrible idea. I accidently deleted everything on wordAligned.com. Please bare with me as I slowly fix things.
]]></description>
			<content:encoded><![CDATA[<p>Learned the hard-way that rm -rf ./* is a horrible idea. I accidently deleted everything on wordAligned.com. Please bare with me as I slowly fix things.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.wordaligned.com/2009/06/09/oops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Knowledge Sharing</title>
		<link>http://www.blog.wordaligned.com/2009/05/03/knowledge-sharing/</link>
		<comments>http://www.blog.wordaligned.com/2009/05/03/knowledge-sharing/#comments</comments>
		<pubDate>Mon, 04 May 2009 02:08:51 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.blog.wordaligned.com/?p=17</guid>
		<description><![CDATA[Something that has been bugging me most of the weekend revolves around sharing knowledge, whether it be about a current system, why a particular decision was made or anything else that comes up.
So I would currently classify myself closer to the n00b end of the spectrum of professional software engineers, especially when it comes to [...]]]></description>
			<content:encoded><![CDATA[<p>Something that has been bugging me most of the weekend revolves around sharing knowledge, whether it be about a current system, why a particular decision was made or anything else that comes up.</p>
<p>So I would currently classify myself closer to the n00b end of the spectrum of professional software engineers, especially when it comes to designing systems that are accurate, reliable, fail safe and fast (not just fast but get &amp;lt; 100 ms). This being said I look forward to the conversation with my colleagues, who fall more at the &#8220;I&#8217;m a badass&#8221; side of the spectrum, on pretty much any task or at least story that I am working on. Not because they &#8220;are always right&#8221; but because there is a high probability that whatever it is I&#8217;m working on, they&#8217;ve encountered a similar situation in one of their numerous previous projects. By using their previous experiences I can reach the best solution quicker and *hopefully* with less bugs. At the same time my ideas may just be the new &#8220;fresh&#8221; ideas that they may not have thought of before.</p>
<p>Anyways, getting back to the point. I&#8217;ve recently seen/heard that many companies, yes including mine at times, can hamper the under valued but essential flow of information between two members on the same team, two teams or even two non-competing companies. Most of the times this is not an intentional act that hinder the sharing of knowledge but rather an inadvertent one. At work we utilize many different technologies to open up the necessary channels for sharing within the company (paired programming, forums, chat rooms, brown bag lunches, etc) however this doesn&#8217;t seem to be the best solution. But what is a better solution? Why don&#8217;t these methods work?</p>
<p>Honestly, I wish I knew. The one thing I do know is that these require a willingness to participate by both the giver and receiver. As most of us are probably aware it is easy to say that you want to and are willing to do what is necessary to share information with your peers, but when it comes down to it the eagerness fades and things go back to the usual, only seeking out information from our friends and those we believe have the information we desire. Something needs to change!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.wordaligned.com/2009/05/03/knowledge-sharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

