<?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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Xnot.org</title>
	
	<link>http://blog.xnot.org</link>
	<description>Where it all begins...</description>
	<pubDate>Mon, 13 Jul 2009 18:54:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Xnot" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>New Blog and post!</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/mzz9Otc15bc/</link>
		<comments>http://blog.xnot.org/2009/07/13/new-blog-and-post/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 18:54:15 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Erlang]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=83</guid>
		<description><![CDATA[Check out my new code blog: http://willcodeforfoo.com/ and the latest blog post about erlang and Makefiles to simply erlang development
]]></description>
			<content:encoded><![CDATA[<p>Check out my new code blog: http://willcodeforfoo.com/ and the latest blog post about erlang and Makefiles to simply erlang development</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2009/07/13/new-blog-and-post/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2009/07/13/new-blog-and-post/</feedburner:origLink></item>
		<item>
		<title>Ruby AND precedence</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/0CgHKbzohd4/</link>
		<comments>http://blog.xnot.org/2009/04/02/ruby-and-precedence/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 21:14:54 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=79</guid>
		<description><![CDATA[And you thought and was equal to &#038;&#038;
Have you ever looked at ruby code and said wow, this is so readable, I
can use
and
 instead of &#038;&#038;, how cool! Well, not
quite. There are differences and pretty important ones to consider.
Here, I&#8217;ll show you.
The most basic use of and:

	a = "b" and "c"
	puts a # => "b"
	a [...]]]></description>
			<content:encoded><![CDATA[<p>And you thought and was equal to &#038;&#038;</p>
<p>Have you ever looked at ruby code and said wow, this is so readable, I<br />
can use
<pre><code>and</code></pre>
<p> instead of &#038;&#038;, how cool! Well, not<br />
quite. There are differences and pretty important ones to consider.<br />
Here, I&#8217;ll show you.</p>
<p>The most basic use of and:</p>
<pre><code>
	a = "b" and "c"
	puts a # => "b"
	a = "b" &#038;&#038; "c"
	p a # => "c"
</code></pre>
<p>Notice the precedence issue? With
<pre><code>and</code></pre>
<p>, the<br />
precedence is on the left-hand side while
<pre><code>&#038;&#038;</code></pre>
<p>runs through the entire phrase.</p>
<p>Why is this important? And and &#038;&#038; phrases, in practice are generally<br />
used in if statements and this would cause a big issue with</p>
<pre><code>and</code></pre>
<p> statements. Why? (Example time)</p>
<pre><code>
	1 == 3 and true # false
	1 == 3 &#038;&#038; true  # false
	true and 5 == 2 # true
	true &#038;&#038; 5 == 2  # false
</code></pre>
<p>Did you catch that?</p>
<pre><code>
	true and 5 == 2 # true
</code></pre>
<p>It&#8217;s clearly not the logic you&#8217;d expect when you are using and&#8230; One<br />
more just to prove my point</p>
<pre><code>
	"hello" &#038;&#038; e = "world" 	# world + world
	"hello" and e = "world" # hello + world
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2009/04/02/ruby-and-precedence/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2009/04/02/ruby-and-precedence/</feedburner:origLink></item>
		<item>
		<title>AWS elastic Mapreduce</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/ldRrm9fZiIs/</link>
		<comments>http://blog.xnot.org/2009/04/02/aws-elastic-mapreduce/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 08:29:31 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[aws]]></category>

		<category><![CDATA[cloud]]></category>

		<category><![CDATA[cloud computing]]></category>

		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=77</guid>
		<description><![CDATA[Amazon Webservices (AWS) have just announced their Elastic Mapreduce webservice. With their massive architecture, cloud-monopoly (not quite) and the apparent ease of use of the service, the only way this can possibly fail is that the average consumer probably has no idea what mapreduce is&#8230; You can catch me playing it with later this week [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon Webservices (AWS) have just announced their <a href="http://aws.amazon.com/elasticmapreduce/">Elastic Mapreduce</a> webservice. With their massive architecture, cloud-monopoly (not quite) and the apparent ease of use of the service, the only way this can possibly fail is that the average consumer probably has no idea what mapreduce is&#8230; You can catch me playing it with later this week (after <a href="http://larubyconf.com/">http://larubyconf.com/</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2009/04/02/aws-elastic-mapreduce/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2009/04/02/aws-elastic-mapreduce/</feedburner:origLink></item>
		<item>
		<title>Happy Squared Day!</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/My31-F8UUXc/</link>
		<comments>http://blog.xnot.org/2009/03/03/happy-squared-day/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 18:22:14 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[math]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=75</guid>
		<description><![CDATA[Today is 3^2 = 9 day!
Math nerds celebrate
]]></description>
			<content:encoded><![CDATA[<p>Today is 3^2 = 9 day!</p>
<p>Math nerds celebrate</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2009/03/03/happy-squared-day/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2009/03/03/happy-squared-day/</feedburner:origLink></item>
		<item>
		<title>Easy configuration with Erlang</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/T6sgoR63aDM/</link>
		<comments>http://blog.xnot.org/2009/02/19/easy-configuration-with-erlang/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 02:30:39 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Erlang]]></category>

		<category><![CDATA[poolparty]]></category>

		<category><![CDATA[configuration]]></category>

		<category><![CDATA[poolparty internals]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=73</guid>
		<description><![CDATA[Erlang isn&#8217;t the easiest of languages to pass around a set of configuration. You can always write a gen_server to handle holding configuration for you, but why? That&#8217;s just another running process and what happens if it dies? You have to account for that, etc. 
I&#8217;ve been working on a framework stack in Erlang for a [...]]]></description>
			<content:encoded><![CDATA[<p>Erlang isn&#8217;t the easiest of languages to pass around a set of configuration. You can always write a gen_server to handle holding configuration for you, but why? That&#8217;s just another running process and what happens if it dies? You have to account for that, etc. </p>
<p>I&#8217;ve been working on a framework stack in Erlang for a current project of mine and I&#8217;m delighted to share it for posterity.</p>
<p>Introducing: <a href="http://github.com/auser/configerl/tree/master">Configerl</a>.</p>
<p>Configerl is my library I use for projects to pull out configuration. I&#8217;ll show you what I mean:</p>
<p>Say I have a list of tuples intended for configuration purposes, like so:</p>
<pre><code>
Config = [{port, 12345}, {name, "converse"}].
</code></pre>
<p>With configerl you can pull out and parse the different configurations easily:</p>
<pre><code>
config:parse(port, Config) => 12345.
</code></pre>
<p>What about getting with a default?</p>
<pre><code>
config:parse_or_default(port, Config, "ted").
</code></pre>
<p>Yes yes, nothing so grand about that, but what about if you want to merge configurations?</p>
<pre><code>
config:append([{port, 12345}, {name, "converse"}], [{friends, "whisper"}]).
</code></pre>
<p>What about updating configurations:</p>
<pre><code>
config:update({port, 54321}, Config).
</code></pre>
<p>How about removing a configuration:</p>
<pre><code>
config:delete(port, Config).
</code></pre>
<p>And now we get to the really fun stuff:</p>
<p>Fetching multiple keys</p>
<pre><code>
[Port, Name] = config:fetch([port, name], Config).
</code></pre>
<p>Fetching multiple keys with defaults</p>
<pre><code>
[Port, Name] = config:fetch_with_default([port, name], Config, [12345, "converse"]).
</code></pre>
<p>Fetching multiple keys with a default configuration</p>
<pre><code>
DefaultConfig = [{port, 12345}, {name, "whisper"}].
[Port, Name] = config:fetch_with_default_config([port, name], Config, DefaultConfig).
</code></pre>
<p>The project is still growing quite a bit and is fully tested up to this point. Please feel free to add to the library or do with what you please. </p>
<p>Awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2009/02/19/easy-configuration-with-erlang/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2009/02/19/easy-configuration-with-erlang/</feedburner:origLink></item>
		<item>
		<title>Hello AT&amp;T interactive</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/UMWdzG7nnYo/</link>
		<comments>http://blog.xnot.org/2009/01/14/hello-att-interactive/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 23:04:27 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[poolparty]]></category>

		<category><![CDATA[AT&amp;T]]></category>

		<category><![CDATA[career]]></category>

		<category><![CDATA[CitrusByte]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=65</guid>
		<description><![CDATA[Yes, I know it has been quite a while since I&#8217;ve written a post and for good reason. I&#8217;ve been quite busy.
Starting at the end of this month, I will be taking a new step in my programming career as a Lead Software Engineer at AT&#038;T Interactive&#8217;s R&#038;D department, continuing development on PoolParty.
CitrusByte has been [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I know it has been quite a while since I&#8217;ve written a post and for good reason. I&#8217;ve been quite busy.</p>
<p>Starting at the end of this <a href="http://www.timeanddate.com/calendar/monthly.html?year=2009&#038;month=1&#038;country=1">month</a>, I will be taking a new step in my programming career as a Lead Software Engineer at <a href="http://yellowpages.com/">AT&#038;T Interactive</a>&#8217;s R&#038;D department, continuing development on <a href="http://poolpartyrb.com">PoolParty</a>.</p>
<p><a href="http://citrusbyte.com/">CitrusByte</a> has been a great company to work with, the developers are super smart, the culture is fun and the work is dynamic. It was not an easy decision to make as I have thoroughly enjoyed my experience and I will miss working with the crew. </p>
<p>I look forward to continuing my work on PoolParty with <a href="http://yellowpages.com/">AT&#038;T Interactive</a> and will soon resume my blogging at regular intervals once again.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2009/01/14/hello-att-interactive/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2009/01/14/hello-att-interactive/</feedburner:origLink></item>
		<item>
		<title>Introducing Dslify!</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/Zlwgww5WyLM/</link>
		<comments>http://blog.xnot.org/2008/12/21/introducing-dslify/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 01:16:57 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[poolparty internals]]></category>

		<category><![CDATA[dsl]]></category>

		<category><![CDATA[dslify]]></category>

		<category><![CDATA[method missing]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=62</guid>
		<description><![CDATA[One of the earliest piece of functionality I started working on when I started working on PoolParty was the DSL syntax. Because I wanted the syntax to be light enough where simple inheritance would allow you to introduce new class types and parented models, I wanted to be able to give any method on any [...]]]></description>
			<content:encoded><![CDATA[<p>One of the earliest piece of functionality I started working on when I started working on <a href="http://poolpartyrb.com">PoolParty</a> was the DSL syntax. Because I wanted the syntax to be light enough where <a href="http://blog.xnot.org/2008/11/27/inherited-resourcing-and-the-power-of-subclassing/">simple inheritance</a> would allow you to introduce new class types and parented models, I wanted to be able to give any method on any object and be able to retrieve it later. The syntax, which looks something like:</p>
<pre><code>
cloud :name do
 instances 2..5
end
</code></pre>
<p>is so terse and readable, I&#8217;ve extracted the functionality into a <a href="http://github.com/auser/dslify/tree/master">gem</a>!</p>
<p>Now, you can add your own DSL syntax to any class by adding 1 line to your class! And, you get default syntaxes for free!</p>
<p>Let&#8217;s add one for a fake class that we can use to look up showtimes!</p>
<p>First, the class used to look like this:</p>
<pre><code>
class MovieFone
end
</code></pre>
<p>To add the DSL syntax, we add the 1 line:</p>
<pre><code>
class MovieFone
 include Dslify
end
</code></pre>
<p>Now, any method that is called on the class MovieFone that doesn&#8217;t exist, will be called on the instance. These methods and their attributes are all stored in a method called: __options (double underscores to avoid any collisions with user defined option methods). Now you can fetch any method called on your instance (with or without using =) on the options, or simply by calling the method. </p>
<p>Example? Of course!</p>
<pre><code>
class MovieFone
 include Dslify
end

mf = MovieFone.new
mf.movie "Can't buy me love"
mf.times 8.pm..10.pm

# Or, my preferred syntax:

class MovieFone
 def initialize(&#038;block)
  instance_eval block if block
 end
end

MovieFone.new do
 movie "Lucas"
 times 8.pm .. 10.pm
end
</code></pre>
<p>One neat feature that may not be apparent is that you can support different runtime methods with the same call, but only have to evaluate it at the runtime. For instance, say you want to give either a range of times (like above) or accept an array of times you are available:</p>
<pre><code>
mf.times = 8.pm, 10.pm, 12.am
</code></pre>
<p>Simple! When you setup the search method, the argument will be of the class type you send it! Cake!</p>
<p>Find the gem here: <a href="http://github.com/auser/dslify/tree/master"> http://github.com/auser/dslify/tree/master</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2008/12/21/introducing-dslify/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2008/12/21/introducing-dslify/</feedburner:origLink></item>
		<item>
		<title>Using Capistrano with EC2</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/M5X3IkG8fR8/</link>
		<comments>http://blog.xnot.org/2008/12/17/using-capistrano-with-ec2/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 23:23:35 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Capistrano]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ec2]]></category>

		<category><![CDATA[net/ssh]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=59</guid>
		<description><![CDATA[It  has long been known that capistrano is borked when using EC2 because it requires the public key. 
The work-around has been to download the public key from EC2 before running capistrano, a very ugly solution indeed. Well, after digging into the net-ssh source, it&#8217;s obvious that the public key was only used to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.clipclip.org/activity/view/1307/play-with-amazons-ec2">It </a> has <a href="http://niblets.wordpress.com/2007/02/12/capistrano-ec2-sitting-in-a-tree-k-i-s-s-i-n-g/">long</a> been <a href="http://ec2onrails.rubyforge.org/">known</a> that <a href="http://www.capify.org/">capistrano</a> is <a href="http://groups.google.com/group/ec2-on-rails-discuss/browse_thread/thread/842e632a39d3abc4">borked</a> when using <a href="http://aws.amazon.com/ec2">EC2</a> because it requires the public key. </p>
<p>The work-around has been to download the public key from EC2 before running capistrano, a very ugly solution indeed. Well, after digging into the net-ssh <a href="http://github.com/jamis/net-ssh/tree/master">source</a>, it&#8217;s obvious that the public key was only used to hold <a href="http://github.com/jamis/net-ssh/tree/master/lib/net/ssh/key_factory.rb#L73-83">identities</a> in a hash. Because net/ssh uses ruby&#8217;s <a href="http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/index.html">openssl library</a>, we can call the public key to be generated from the private key, rather than requiring it from the user!</p>
<p>So, without further ado, no longer do you need to snatch up the public key from your EC2 instance. The fork is located at: <a href="http://github.com/auser/net-ssh/tree/master">http://github.com/auser/net-ssh/tree/master</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2008/12/17/using-capistrano-with-ec2/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2008/12/17/using-capistrano-with-ec2/</feedburner:origLink></item>
		<item>
		<title>Git-style binaries</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/3Vx0o7FemNo/</link>
		<comments>http://blog.xnot.org/2008/12/16/git-style-binaries/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 11:20:35 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[poolparty]]></category>

		<category><![CDATA[poolparty internals]]></category>

		<category><![CDATA[cli]]></category>

		<category><![CDATA[command-line]]></category>

		<category><![CDATA[option parser]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=52</guid>
		<description><![CDATA[In this version of PoolParty internals, we&#8217;ll check out the git-style binaries used in PoolParty. Note, for this episode, I may move a little fast as there is a lot to cover. 
Git, if you don&#8217;t already know is a super sleek SCM (Source control management system). It gives you hundreds of binaries using the idiom: [...]]]></description>
			<content:encoded><![CDATA[<p>In this version of PoolParty internals, we&#8217;ll check out the git-style binaries used in PoolParty. Note, for this episode, I may move a little fast as there is a lot to cover. </p>
<p>Git, if you don&#8217;t already know is a super sleek SCM (Source control management system). It gives you hundreds of binaries using the idiom: git [action] options command&#8230; One big benefit to this is that all the binaries are self-contained, but function together. </p>
<p>With PoolParty, it makes sense to contain the binaries, both to enable quick development and to target the action the command-line method will be doing. This enables us to do cloud [action], such as cloud start and cloud ssh. How do we do this? Let&#8217;s dive in!</p>
<p>Opening poolparty/bin/cloud, we see the following</p>
<pre><code>
#!/usr/bin/env ruby
require "poolparty"
require "poolpartycl"

name = ARGV.select {|arg| arg
    if Binary.available_binaries_for("cloud").include?(arg) }.first

# Hiding methods here that strip out actions that aren't included
# in the PoolParty list of available command-line actions
# for brevity

# If no command is passed in, show help
new_args.push("-h") unless name

o = PoolParty::Optioner.new(new_args,
  {:extra_help => "Cloud actions\n#{Binary.list_binaries_for("cloud")}",
  :abstract => true}) do |opts, optioner|
  opts.on('-n cloudname', '--name name', 'Address this cloud')
    { |c| optioner.cloudname c }
end

program_name = "#{File.basename($0)}-#{name}"
program_location = File.join(Binary.binary_directory, program_name)

command_line = "#{program_location}"

# Run it from the command-line first
if Binary.available_binaries_for("cloud").include?(name)
  system command_line, *ARGV
else
  puts "Unknown poolparty binary: #{name}"
end
</code></pre>
<p>Phew, that&#8217;s a lot. It&#8217;s super simple, the first few lines are ensuring that the action is contained in the list of available actions. </p>
<p>These are gathered just by looking in the directory with the binaries that start with &#8220;cloud,&#8221; in this case:</p>
<pre><code>
Dir["#{binary_directory}/#{ty}-*"].map
 {|a| File.basename(a.gsub(/#{ty}-/, '')) }.sort
</code></pre>
<p>Moving on, the Optioner is a custom optsparser class that sits inside of PoolParty that gives PoolParty the ability to extend it&#8217;s own option parser. Not much to the class really, but I urge you to check out the class if you are interested on knowing how it works. </p>
<p>Finally, we are going to call the command! We have to rebuild the arguments sent in such that the arguments are parsed properly by the next binary that will consume them. We can use the splat operator so that when the optsparser reads them again, it&#8217;s as though the arguments were entered on the command-line. </p>
<p>Phew, that was quite a bit! As always, I urge you to check out PoolParty if you haven&#8217;t already. It&#8217;s pretty spiffy and super fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2008/12/16/git-style-binaries/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2008/12/16/git-style-binaries/</feedburner:origLink></item>
		<item>
		<title>Talk to your cloud directly with ruberl</title>
		<link>http://feedproxy.google.com/~r/Xnot/~3/uLQY1fW03H4/</link>
		<comments>http://blog.xnot.org/2008/12/04/ruberl-erlang-to-rubygem/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 01:54:13 +0000</pubDate>
		<dc:creator>Ari</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Erlang]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[poolparty]]></category>

		<category><![CDATA[poolparty internals]]></category>

		<category><![CDATA[gem]]></category>

		<guid isPermaLink="false">http://blog.xnot.org/?p=44</guid>
		<description><![CDATA[Want to communicate with your cloud quickly?
Easy! First, download the gem ruberl
gem install auser-ruberl

Now you just have to set host and port and you can communicate with your gen_tcp server (or, in PoolParty&#8217;s case, the messenger) with either messenger_send! or messenger_cast! like so:

require "ruberl"

class Test < Ruberl::Base
end

@t = Test.new("75.101.162.232", 7050)
loop do
  nodes = @t.messenger_send!("get_current_nodes")
 [...]]]></description>
			<content:encoded><![CDATA[<p>Want to communicate with your cloud quickly?</p>
<p>Easy! First, download the gem ruberl</p>
<pre><code>gem install auser-ruberl
</code></pre>
<p>Now you just have to set host and port and you can communicate with your gen_tcp server (or, in PoolParty&#8217;s case, the messenger) with either messenger_send! or messenger_cast! like so:</p>
<pre><code>
require "ruberl"

class Test < Ruberl::Base
end

@t = Test.new("75.101.162.232", 7050)
loop do
  nodes = @t.messenger_send!("get_current_nodes")
  load = @t.messenger_send!("get_current_load cpu").to_f
  puts "Load on nodes #{nodes}: #{load}"
  sleep(10)
end
</code></pre>
<p>Alternatively, you can just set the attr_accessors host and port within your class and do the same thing, for instance</p>
<pre><code>
class Test < Ruberl::Base
 ... # some more methods
 def get_load
  @host = "host"
  @port = "port"
  messenger_send!("get_current_load cpu")
 end
 ...
end
</code></pre>
<p>Stay tuned for more quick tips, internals and discussions!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnot.org/2008/12/04/ruberl-erlang-to-rubygem/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.xnot.org/2008/12/04/ruberl-erlang-to-rubygem/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.368 seconds --><!-- Cached page generated by WP-Super-Cache on 2009-07-19 00:34:00 -->
