<?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>Ruby Fleebie &#187; Easy reading</title>
	<atom:link href="http://www.rubyfleebie.com/category/easy-reading/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubyfleebie.com</link>
	<description>Because programming should be fun</description>
	<lastBuildDate>Tue, 29 Jun 2010 16:12:52 +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>Ruby 1.9 made me remember how I hate the concept of encodings</title>
		<link>http://www.rubyfleebie.com/ruby-1-9-made-me-remember-how-i-hate-the-concept-of-encodings/</link>
		<comments>http://www.rubyfleebie.com/ruby-1-9-made-me-remember-how-i-hate-the-concept-of-encodings/#comments</comments>
		<pubDate>Thu, 13 May 2010 12:11:00 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/?p=137</guid>
		<description><![CDATA[Update: You can follow the discussion on Hacker news

I guess I won&#8217;t make a lot of friends by saying this but my first impression with Ruby 1.9 was awful. Since we had to configure a new server, we thought it was the perfect occasion to install ruby 1.9 and see how our current web applications [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> <em>You can follow the discussion on <a href="http://news.ycombinator.com/item?id=1344195">Hacker news</a><br />
</em><br />
I guess I won&#8217;t make a lot of friends by saying this but my first impression with Ruby 1.9 was awful. Since we had to configure a new server, we thought it was the perfect occasion to install ruby 1.9 and see how our current web applications behave. I can&#8217;t comment on any new features about 1.9 because we got bored after a while and decided to switch back to 1.8.</p>
<p>There is one huge problem with 1.9 and it is how it manages encodings. Sure every ruby fanatics will tell you that it is &#8220;cleaner&#8221;, &#8220;more robust&#8221;,  &#8220;safer&#8221;,  &#8220;clever&#8221; or whatever&#8230; but it breaks working applications! So in my book this is a problem. I know it is just normal to refactor some aspects of your code when a new version of a programming language comes out but&#8230; this? All this pain for what, encodings? What&#8217;s the benefit already? No seriously tell me because I wake up every morning having to remember what they are, what purpose they serve and why application developers still have to worry about them after all those years. What I know however is that with 1.8 you could mix different encodings in the same string instance and the worst that could happen was some weird looking characters in  the resulting web page. But ruby 1.9 makes things different, it throws an exception in your face. Here is a <a href="http://yehudakatz.com/2010/05/05/ruby-1-9-encodings-a-primer-and-the-solution-for-rails/">great article</a> that explains what is happening with string encodings in 1.9.  Beware though, although this article is saying that there is a solution, it is an <em>hypothetical</em> solution. Here is the excerpt :</p>
<blockquote><p><em>Even better, Ruby already has a mechanism that is mostly designed for this purpose. In Ruby 1.9, setting Encoding.default_internal  tells Ruby to encode all Strings crossing the barrier via its IO system into that preferred encoding. <strong>All we’d need, then, is for maintainers of database drivers to honor this convention as well.</strong></em> </p></blockquote>
<p>So, unless I&#8217;m just not getting something (which is highly possible because encodings always confuse the heck out of me), there is no real solution other than to wait for database driver developers to honor the Encoding.default_internal setting of ruby 1.9.</p>
<p><strong>A small rant about encodings</strong><br />
I dream of a world without war or hunger and where I don&#8217;t have to care about character encodings when I&#8217;m programming! Why on earth do we have all those different encodings in 2010? Why not making a huge encoding table UTF-16384 containing every single character in the universe so we can forget about this crazy concept of different encodings and pretend that it never existed? Would a big fat and unique encoding table cause huge performance issues everywhere? I might be mistaken but I really doubt it would. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/ruby-1-9-made-me-remember-how-i-hate-the-concept-of-encodings/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>5 Plugins Or Gems You Could Not Live Without</title>
		<link>http://www.rubyfleebie.com/5-plugins-or-gems-you-could-not-live-without/</link>
		<comments>http://www.rubyfleebie.com/5-plugins-or-gems-you-could-not-live-without/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 14:50:51 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/5-plugins-or-gems-you-could-not-live-without/</guid>
		<description><![CDATA[Hello everyone,
For the past few months this blog has been pretty much dead. I could give you tons of excuses as for why it has been so but that&#8217;s all they would be, mere excuses! And I assure you that you would not find any of them very convincing.
I received several comments recently telling me [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone,</p>
<p>For the past few months this blog has been pretty much dead. I could give you tons of excuses as for why it has been so but that&#8217;s all they would be, mere excuses! And I assure you that you would not find any of them very convincing.</p>
<p>I received several comments recently telling me that you liked my blog and asking me when I plan writing again and believe me, it always goes straight to my heart. For some time now I am in the expectation that most of you will give up on me and remove this blog from your list forever but for some reason&#8230; you don&#8217;t! </p>
<p>Since I am a bit rusty at writing blog posts, I chose the easy way : a numbered list of Rails Gems/Plugins that I like. Hmmm, I know&#8230; it&#8217;s soooooo 2007! But, interesting nonetheless. If you don&#8217;t mind, I&#8217;d like that you share in the comment section the plugins that you like the most as well. Perhaps this post could become a reference to discover great plugins. Oh btw, from now on I will use the terms plugins and gems like they were the same thing.</p>
<ol>
<li><a href="http://github.com/thoughtbot/paperclip">Paperclip</a> by Thoughtbot
<p><em>Very easy to install &#038; configure. I use it for thumbnails generation and it works wonder.</em> </p>
</li>
<li><a href="http://github.com/perfectline/locale_routing">locale_routing</a> by Perfectline
<p><em>If you are developing a multilingual app/website (with I18n), don&#8217;t miss this simple plugin. It auto inserts the locale in the url without messing with your routes. </em></p>
</li>
<li><a href="http://freelancing-god.github.com/ts/en/">thinking-sphinx</a> by freelancing-gods
<p><em>A fast and reliable free-text search solution for your rails apps, using the Sphinx daemon.  The only thing that is really unfortunate with sphinx is that is doesn&#8217;t index new database records <strong>live</strong> out of the box. Instead you have to build the index manually or setup a cronjob at a given interval. The workaround is to use delta indexes with the delayed-job plugin but it forces you to have a rake task always running on your server. I had so much problems with the rake task getting killed for no apparent reason that I decided that live indexing was not so important. Instead I have a cronjob running every X hours that rebuild the index from scratch</em></p>
</li>
<li><a href="http://wiki.github.com/mislav/will_paginate/">will_paginate</a> by mislav
<p><em>I guess we all know and use this one but I had to put it in my list anyway. It is such a great and easy to use pagination plugin.</em></p>
</li>
<li><a href="http://github.com/rubyist/aasm">acts_as_state_machine</a> by rubyist</li>
<p><em>This one I use all the time. Everytime an activerecord object can be in more than a single &#8220;state&#8221; (enabled, hidden, locked, whatever)&#8230; think about using it!</em></p>
</ol>
<p>That&#8217;s it! Now, it&#8217;s your turn : what is your own top 5 list?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/5-plugins-or-gems-you-could-not-live-without/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>simplyglobal : A simple globalization plugin for Rails</title>
		<link>http://www.rubyfleebie.com/simplyglobal-a-simple-globalization-plugin-for-rails/</link>
		<comments>http://www.rubyfleebie.com/simplyglobal-a-simple-globalization-plugin-for-rails/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 18:38:58 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/simplyglobal-a-simple-globalization-plugin-for-rails/</guid>
		<description><![CDATA[   simplyglobal : A simple globalization plugin for Rails
The following is a guest post from Dan Simard
Sometimes, you have to reinvent the wheel. It&#8217;s really sad to say and you will probably hate me for saying that (and I know that you&#8217;ll do because I hate myself for it). I&#8217;ve written a new [...]]]></description>
			<content:encoded><![CDATA[<h1>   simplyglobal : A simple globalization plugin for Rails</h1>
<p><strong>The following is a guest post from Dan Simard</strong></p>
<p>Sometimes, you have to reinvent the wheel. It&#8217;s really sad to say and you will probably hate me for saying that (and I know that you&#8217;ll do because I hate myself for it). I&#8217;ve written <strong>a new globalization plugin for Rails</strong>.</p>
<h3>   Why did I reinvented the wheel?</h3>
<p>I searched and tried a lot of <a href="http://agilewebdevelopment.com/plugins/search?search=global" title="other globalisation plugins">other globalisation plugins</a>&#8230; and I really tried them. I spent hours with <a href="http://agilewebdevelopment.com/plugins/globalize" title="Globalize">Globalize</a>. It was just too much. I tried the <a href="http://rubyforge.org/projects/gettextlocalize/" title="gettext_Localize">gettext_Localize</a> that works with the <a href="http://www.gnu.org/software/gettext/" title="Gettext">good ol&#8217; gettext</a> command. Fuck it. Too complicated. It just didn&#8217;t fit my needs at all.</p>
<p>All I wanted was a wheel that you can put a wood-pole in the middle and then it could start spinning. I made one.</p>
<p>You can go on the <a href="http://code.google.com/p/simplyglobal/" title="simplyglobal project homepage">simplyglobal project homepage</a> to learn on to <a href="http://code.google.com/p/simplyglobal/wiki/Install" title="install it">install it</a> and <a href="http://code.google.com/p/simplyglobal/wiki/How" title="use it">use it</a>.</p>
<p>In fact, this is not really a globalization plugin because there&#8217;s no localization handling or anything that can look like it. The name should have been <strong>simplytranslated</strong> but I already created the project with the name <em>simplyglobal</em> and it was an hassle to change it.</p>
<h3>       How to install</h3>
<p><strong>1.</strong> Execute <em>./script/plugin install <a href="http://simplyglobal.googlecode.com/svn/trunk/simplyglobal" rel="nofollow">http://simplyglobal.googlecode.com/svn/trunk/simplyglobal</a></em><br />
<strong>2.</strong> Create a file named <em>simplyglobal.rb</em> in the <em>config/initializers</em> directory<br />
<strong>3.</strong> In <em>simplyglobal.rb</em>, create hashes of language<br />
Add the language hashes to the objectYou will end up with a file named <em>simplyglobal.rb</em> that looks like this :</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#7b0303; font-style:normal;">#français</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">fr = <span style="color:#3a27c9; font-weight:bold;">&#123;</span>    <span style="color:#996600;">&quot;hi&quot;</span> =&gt; <span style="color:#996600;">&quot;bonjour&quot;</span>,    <span style="color:#996600;">&quot;welcome&quot;</span> =&gt; <span style="color:#996600;">&quot;bienvenue&quot;</span>  <span style="color:#3a27c9; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#7b0303; font-style:normal;"># espanol</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">es = <span style="color:#3a27c9; font-weight:bold;">&#123;</span>    <span style="color:#996600;">&quot;hi&quot;</span> =&gt; <span style="color:#996600;">&quot;hola&quot;</span>,    <span style="color:#996600;">&quot;welcome&quot;</span> =&gt; <span style="color:#996600;">&quot;bienvenida&quot;</span><span style="color:#3a27c9; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">add_language_hash</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:fr, fr<span style="color:#3a27c9; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">add_language_hash</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:es, es<span style="color:#3a27c9; font-weight:bold;">&#41;</span></div>
</li>
</ol>
</div>
<p>In <strong>development</strong>, this file will be loaded every request. In <strong>production</strong>, it is loaded once.</p>
<h3>       How to use it with strings</h3>
<p>After you <a href="http://code.google.com/p/simplyglobal/wiki/Install" title="installed it">installed it</a>, you can use it in these various ways.</p>
<p>SimplyGlobal adds a <strong>t()</strong> method to all string objects that will return the translated string. Example, if you have defined a language hash that looks like this (<strong>note</strong> : normally, the languages hash are defined in <em>config/initializers/simplyglobal.rb</em> but I put it inline for the sake of the example) :</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">fr = <span style="color:#3a27c9; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;hi&quot;</span> =&gt; <span style="color:#996600;">&quot;bonjour&quot;</span><span style="color:#3a27c9; font-weight:bold;">&#125;</span> <span style="color:#7b0303; font-style:normal;"># Create the language hash</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">add_language_hash</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:fr, fr<span style="color:#3a27c9; font-weight:bold;">&#41;</span> <span style="color:#7b0303; font-style:normal;"># Add the language hash to simplyglobal</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">locale</span> = :fr <span style="color:#7b0303; font-style:normal;"># Assigns the locale to use</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#996600;">&quot;hi&quot;</span>.<span style="color:#3a27c9;">t</span> <span style="color:#7b0303; font-style:normal;"># returns &quot;bonjour&quot;</span></div>
</li>
</ol>
</div>
<p>As simple as that!</p>
<p>You can use it like the <a href="http://www.ruby-doc.org/core/classes/String.html#M000785" title="% method">% method</a> of the String class.</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">fr = <span style="color:#3a27c9; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;hi %s%d&quot;</span> =&gt; <span style="color:#996600;">&quot;bonjour %s%d&quot;</span><span style="color:#3a27c9; font-weight:bold;">&#125;</span> <span style="color:#7b0303; font-style:normal;"># Create the language hash</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">add_language_hash</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:fr, fr<span style="color:#3a27c9; font-weight:bold;">&#41;</span> <span style="color:#7b0303; font-style:normal;"># Add the language hash to simplyglobal</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">locale</span> = :fr <span style="color:#7b0303; font-style:normal;"># Assigns the locale to use</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#996600;">&quot;hi&quot;</span>.<span style="color:#3a27c9;">t</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Johnny&quot;</span>, <span style="color:#3a27c9;">5</span><span style="color:#3a27c9; font-weight:bold;">&#41;</span> <span style="color:#7b0303; font-style:normal;"># returns &quot;bonjour Johnny5&quot;</span></div>
</li>
</ol>
</div>
<p>You can also return all translations for a word. That is a special feature developed only for Frank.</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">add_language_hash</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:fr, <span style="color:#3a27c9; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;hi&quot;</span> =&gt; <span style="color:#996600;">&quot;bonjour&quot;</span><span style="color:#3a27c9; font-weight:bold;">&#125;</span><span style="color:#3a27c9; font-weight:bold;">&#41;</span> <span style="color:#7b0303; font-style:normal;"># Add the french language hash</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">SimplyGlobal.<span style="color:#3a27c9;">add_language_hash</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:es, <span style="color:#3a27c9; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;hi&quot;</span> =&gt; <span style="color:#996600;">&quot;hola&quot;</span><span style="color:#3a27c9; font-weight:bold;">&#125;</span><span style="color:#3a27c9; font-weight:bold;">&#41;</span> <span style="color:#7b0303; font-style:normal;"># Add the spanish language hash</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#996600;">&quot;hi&quot;</span>.<span style="color:#3a27c9;">t</span><span style="color:#3a27c9; font-weight:bold;">&#40;</span>:all<span style="color:#3a27c9; font-weight:bold;">&#41;</span> <span style="color:#7b0303; font-style:normal;"># returns a hash : {:fr =&gt; &quot;bonjour&quot;, :es =&gt; &quot;hola&quot;}</span></div>
</li>
</ol>
</div>
<h3>       Using it with views</h3>
<p>Just create a view ending with <strong>_fr</strong> and simplyglobal will use it.</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#3a27c9; font-weight:normal;">def</span> index</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; SimplyGlobal.<span style="color:#3a27c9;">locale</span> = :fr</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#7b0303; font-style:normal;"># Will try to render index_fr.html.erb</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#7b0303; font-style:normal;"># rather than index.html.erb</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
</ol>
</div>
<p>It also works for the partial.</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&lt;%= render :partial =&gt; &quot;info&quot; %&gt;</div>
</li>
</ol>
</div>
<p>will try to render <strong>_info_fr.html.erb</strong> rather than <strong>_info.html.erb</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/simplyglobal-a-simple-globalization-plugin-for-rails/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>XMPP4r 0.4 has been released</title>
		<link>http://www.rubyfleebie.com/xmpp4r-04-has-been-released/</link>
		<comments>http://www.rubyfleebie.com/xmpp4r-04-has-been-released/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 13:54:25 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/xmpp4r-04-has-been-released/</guid>
		<description><![CDATA[It&#8217;s been a while since the latest release of XMPP4r. I was starting to think that the development for this great library had been stopped.
Fortunately, version 0.4 has been released on August 5th 2008. We&#8217;re going to try this new version internally and eventually use it for TimmyOnTime. I am personnally hoping for less memory [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since the latest release of <a href="http://home.gna.org/xmpp4r/">XMPP4r</a>. I was starting to think that the development for this great library had been stopped.</p>
<p>Fortunately, version 0.4 has been released on August 5th 2008. We&#8217;re going to try this new version internally and eventually use it for TimmyOnTime. I am personnally hoping for less memory consumption, more speed and more stability. This new version highlights are : </p>
<ol>
<li>The beginning of ruby 1.9 support</li>
<li>Refactoring of error classes (I&#8217;m really looking forward to this)</li>
</ol>
<p>Here is the full changelog :</p>
<p>XMPP4R 0.4 (05/08/2008)<br />
=======================<br />
* Initial support for Ruby 1.9 (see README_ruby19.txt)<br />
* Complete PubSub API Change &#8211; more logical and better for<br />
  childclasses, support for collection node creation<br />
* a Helper to assist with XEP-0115 Entity Capabilities<br />
* SASL anonymous support<br />
* File transfer fixes<br />
* MUC room configuration fixes<br />
* initial support for XEP-0118 User Tune<br />
* fix for an xmlrpc exception-during-serialisation bug, which would cause<br />
  a hang<br />
* Support auto-gem generation on GitHub with improved and DRY&#8217;er RakeFile and<br />
  gemspec.<br />
* Add support for the old SSL protocol (needed to connect to GTalk)<br />
* Changed API for Client, Component, Connection, Stream to remove<br />
  need for antiquated &#8216;threaded&#8217; param in the initializer.<br />
* Use a Logger instance instead of directly writing to stdout<br />
* Re-factored &#038; consolidated Error classes.  See xmpp4r/errors.rb for all<br />
  custom errors that can be caught.  All inherit from Jabber::Error which<br />
  itself inherits from Ruby&#8217;s StandardError. This is a first step in<br />
  re-factoring errors.  The next step will be to convert all &#8216;raise&#8217; calls to<br />
  raise a custom Jabber::Error or one of its children instead of anonymous<br />
  RuntimeErrors.  This allows much more granularity in catching and handling<br />
  errors later.<br />
  If you were catching Jabber::ErrorException before you should probably<br />
  change that in your code to now catch Jabber::Error if you want to<br />
  catch everything or one of the custom children of Jabber::Error defined in<br />
  &#8216;lib/xmpp4r/errors.rb&#8217;.  Additionally, the Error class which encapsulated<br />
  the xmpp error response, has been renamed to ErrorResponse to reflect its<br />
  real usage.  This free&#8217;s up &#8216;Jabber::Error&#8217; for use as our base Error class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/xmpp4r-04-has-been-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Komodo Edit : A great editor for dynamic languages</title>
		<link>http://www.rubyfleebie.com/komodo-edit-a-great-editor-for-dynamic-languages/</link>
		<comments>http://www.rubyfleebie.com/komodo-edit-a-great-editor-for-dynamic-languages/#comments</comments>
		<pubDate>Mon, 26 May 2008 21:17:40 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/komodo-edit-a-great-editor-for-dynamic-languages/</guid>
		<description><![CDATA[Being a Linux/Ubuntu user, i cannot use the praised Textmate editor to develop ruby applications. I tried a lot of editors, some of them being very good ones, but in the end I always end up using gedit.
gedit is great&#8230; but it is rather limited features-wise. Recently I have tried Komodo Edit and I can [...]]]></description>
			<content:encoded><![CDATA[<p>Being a Linux/Ubuntu user, i cannot use the praised <a href="http://macromates.com/">Textmate</a> editor to develop ruby applications. I tried a lot of editors, some of them being very good ones, but in the end I always end up using <a href="http://www.gnome.org/projects/gedit/">gedit</a>.</p>
<p>gedit is great&#8230; but it is rather limited features-wise. Recently I have tried <a href="http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml">Komodo Edit</a> and I can say that this is <strong>the best RubyOnRails editor available on Linux</strong>. It has a lot of features (autocomplete, tons of supported languages, macros, color schemes, etc) but somehow it is still light and minimalist.</p>
<p>Komodo Edit is also available on Mac and Windows</p>
<p><img src="http://www.rubyfleebie.com/wp-content/uploads/2008/05/komodo.png" width="600" alt="Komodo screenshot" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/komodo-edit-a-great-editor-for-dynamic-languages/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger, you&#8217;re my hero</title>
		<link>http://www.rubyfleebie.com/phusion-passenger-youre-my-hero/</link>
		<comments>http://www.rubyfleebie.com/phusion-passenger-youre-my-hero/#comments</comments>
		<pubDate>Fri, 23 May 2008 00:11:03 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/phusion-passenger-youre-my-hero/</guid>
		<description><![CDATA[I feel so weird. Maybe it&#8217;s just the side-effects of eating that old, pinky-brown colored and talking piece of raw meat that was sitting in the corner of my kitchen since a month or two&#8230; but as strange as it may sound, I think it&#8217;s something else.
I think it is something related to Rails that [...]]]></description>
			<content:encoded><![CDATA[<p>I feel so weird. Maybe it&#8217;s just the side-effects of eating that old, pinky-brown colored and talking piece of raw meat that was sitting in the corner of my kitchen since a month or two&#8230; but as strange as it may sound, I think it&#8217;s something else.</p>
<p>I think it is something related to Rails that makes me so excited. I just tried deploying a rails application with <a href="http://modrails.com">Phusion Passenger</a> (aka mod_rails)&#8230; and I am still shocked. Rails deployment has finally becomes a breeze! At the time I am writing this, I still have this exaggerated dumb smile in my face expressing my satisfaction&#8230; and I am alone in my house.</p>
<p>#UPDATE : I removed the smiling pig image that was put here to &#8220;express my satisfaction&#8221;. I removed it because it was not funny and it made me look like someone who is not funny&#8230; which is something I am not comfortable with. Now that I have removed the image of the smiling pig, I expect to receive my first comment (and tons of others) for this blog post. For those who liked the smiling pig, you can find it <a href="http://www.rubyfleebie.com/wp-content/uploads/2008/05/Pig_Smile.jpg">here</a> and pretend it is funny.</p>
<p>Ok enough stupidities, <a href="http://www.modrails.com/">Phusion Passenger</a> is great. It is built to work with the Apache web server. No port configuration, no complicated vhost configuration, you upload your stuff and guess what? It works. Well, almost&#8230; to restart your rails application you just have to <em>touch</em> tmp/restart.txt. If you&#8217;re using capistrano, it means that you only have to do something like that :</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">namespace :deploy <span style="color:#3a27c9; font-weight:normal;">do</span>&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; task :restart, :roles =&gt; :app <span style="color:#3a27c9; font-weight:normal;">do</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; run <span style="color:#996600;">&quot;touch #{current_path}/tmp/restart.txt&quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
</ol>
</div>
<p><strong>And what about the vhost configuration?</strong><br />
<code><br />
&lt;VirtualHost *:80&gt;<br />
  ServerName yourdomain.com<br />
  ServerAlias www.yourdomain.com<br />
  DocumentRoot /home/you/apps/yourapp/current/public<br />
&lt;/VirtualHost&gt;<br />
</code><br />
I didn&#8217;t have time to play with all the settings and read the documentation&#8230; but I have the feeling that this thing is the light, try it!</p>
<p><code><br />
gem install passenger<br />
passenger-install-apache2-module<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/phusion-passenger-youre-my-hero/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Railers Need To Stop Not Caring About The Database</title>
		<link>http://www.rubyfleebie.com/railers-need-to-stop-not-caring-about-the-database/</link>
		<comments>http://www.rubyfleebie.com/railers-need-to-stop-not-caring-about-the-database/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 14:36:38 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/railers-need-to-stop-not-caring-about-the-database/</guid>
		<description><![CDATA[For many of us, databases are no fun&#8230; surely not as fun as ActiveRecord or Rails in general. Every railers I know love the &#8220;dot notation&#8221; offered by ActiveRecord associations immensely&#8230;  while refering to the vast majority of raw SQL queries as &#8220;Some ugly non-sense gibberish that we would all prefer not know the [...]]]></description>
			<content:encoded><![CDATA[<p>For many of us, databases are no fun&#8230; surely not as fun as ActiveRecord or Rails in general. Every railers I know love the &#8220;dot notation&#8221; offered by ActiveRecord associations immensely&#8230;  while refering to the vast majority of raw SQL queries as &#8220;Some ugly non-sense gibberish that we would all prefer not know the existence&#8221;.</p>
<p>Our hate towards the SQL language and databases is not a valid excuse to not assume our responsabilities as application developers. Recently I was working on a Rails plugin when the sentiment of being incompetent struck my body exactly like the lightning strikes an adventurous golfer who happily plays golf during a thunderstorm.</p>
<p>It all happened when I had a query that was generating a lot of results&#8230; and was slow as hell to process&#8230; even though I was using the :include option for Eager Loading.</p>
<p>@stuff = ParentStuff.find(:all, :include => :child_stuff, :order => &#8220;created_at DESC&#8221;)</p>
<p>Then, in my view, I had something like :</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">@stuff.<span style="color:#3a27c9;">each</span> <span style="color:#3a27c9; font-weight:normal;">do</span> |parent_stuff|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; bla bla bla &lt;%=parent_stuff.<span style="color:#3a27c9;">name</span>%&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; parent_stuff.<span style="color:#3a27c9;">child_stuff</span>.<span style="color:#3a27c9;">each</span> <span style="color:#3a27c9; font-weight:normal;">do</span> |stuff|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp;bla bla bla &lt;%=stuff.<span style="color:#3a27c9;">title</span>%&gt;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
</ol>
</div>
<p>It was awfully slow! I started looking at the logs and saw this typical monstruous sql query. Look at it&#8230; you  have to look at it. I know you don&#8217;t want to&#8230; but it won&#8217;t go away :</p>
<p>SELECT parent_stuff.`id` AS t0_r0, parent_stuff.`field1` AS t0_r1, parent_stuff.`field2` AS t0_r2, parent_stuff.`field3` AS t0_r3, parent_stuff.`field4` AS t0_r4, child_stuff.`id` AS t1_r0, child_stuff.`field5` AS t1_r1, child_stuff.`field6` AS t1_r2, child_stuff.`field7` AS t1_r3, child_stuff.`field8` AS t1_r4, child_stuff.`field9` AS t1_r5, child_stuff.`field10` AS t1_r6, child_stuff.`field11` AS t1_r7 FROM parent_stuff LEFT OUTER JOIN child_stuff ON child_stuff.the_foreign_key = parent_stuff.id WHERE (parent_stuff.created_at >= &#8216;2008-04-24 00:00:00&#8242; AND parent_stuff.created_at <= '2008-04-24 09:44:56') ORDER BY parent_stuff.created_at</p>
<p>What's the problem with this? It's just one query... cannot take that much time. I thought it was a "Rails problem" until I ran the query directly in a MySql web interface. It took the same amount of time, meaning that the problem was within the query itself. Oh sh**... it was a database problem! Like many Rails Developers, my database skills are, while not inexistant, inadequate. </p>
<p> I tried to figure out what could be the problem with this query. I replaced every LEFT OUTER JOIN with INNER JOIN and Boom! the query executed in less than half a second. </p>
<p>My urgent desire of leaving the MySql web interface made me go back to my Rails code. I then tried some stupid random stuff like : </p>
<p>@stuff = ParentStuff.find(:all, :include => :child_stuff, :joins => &#8220;INNER JOIN child_stuff ON child_stuff.parent_stuff_id=id&#8221; :order => &#8220;created_at DESC&#8221;) but the slow LEFT OUTER JOINs remain in the query instead of being replace by the faster INNER JOIN. Then, I learned that in Rails 2.0, you could do Eager Loading with INNER JOIN by passing an association name to the :joins option, like that :</p>
<p>@stuff = ParentStuff.find(:all, :joins => :child_stuff, :order => &#8220;created_at DESC&#8221;)</p>
<p>Problem is I was working on a plugin&#8230; and I&#8217;d like it to be compatible with older versions of Rails. So I did what I was scared of doing since the beginning : Going to some MySql forums to read the advice of some DBA&#8217;s &#8230;</p>
<p>Then I found the answer to my problem&#8230; and this answer proved me that I needed to stop playing blindly with ActiveRecord like if the backend database was none of my business&#8230;. because it is. The answer is so obvious&#8230; but given the fact that I never wanted to care about databases since Rails exists, I didn&#8217;t think about it :</p>
<p><strong>Answer : Add an index to the foreign key in the child table!</strong></p>
<p>This is just one case that shows the dangers of not being aware of what&#8217;s going on in the database. It&#8217;s sad, but you cannot blindly let ActiveRecord manage everything that is Database related for you. It&#8217;s only a question of being in control of the entire application&#8230; and the relational database is a part of it.</p>
<p><strong>UPDATE</strong><br />
This post has kind of <a href="http://www.railway.at/articles/2008/04/24/database-agnostic-database-ignorant">turned against me</a>. The only thing I wanted to say with this article is that ActiveRecord needs our supervision&#8230; not that I am a moron who can&#8217;t understand databases. I know what joins are, I know what indexes are&#8230; but in most situations I don&#8217;t have to &#8220;care&#8221; about them with ActiveRecord. Sorry but I felt the need to defend myself about this issue :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/railers-need-to-stop-not-caring-about-the-database/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Rubyize this : 6th edition</title>
		<link>http://www.rubyfleebie.com/rubyize-this-6th-edition/</link>
		<comments>http://www.rubyfleebie.com/rubyize-this-6th-edition/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 00:21:05 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/rubyize-this-6th-edition/</guid>
		<description><![CDATA[Oh, my&#8230; God.
What is this? First post in a century? What&#8217;s going on here Fleebie? Our beloved readers are going to stop respecting us, and for good reasons.
For those who care, I am not dead, I am not sick&#8230; I am just working like crazy on Azanka, the company I started with Dan recently.
Ok now [...]]]></description>
			<content:encoded><![CDATA[<p>Oh, my&#8230; God.</p>
<p>What is this? First post in a century? What&#8217;s going on here Fleebie? Our beloved readers are going to stop respecting us, and for good reasons.</p>
<p>For those who care, I am not dead, I am not sick&#8230; I am just working like crazy on <a href="http://www.azankatech.com/en">Azanka</a>, the company I started with Dan recently.</p>
<p>Ok now it&#8217;s time for a brand new edition of Rubyize this. Let&#8217;s get the ball rolling. Hold on&#8230; I&#8217;m going to google images to get a picture of a ball rolling.</p>
<p><img src='http://www.rubyfleebie.com/wp-content/uploads/2008/04/364421257_8cad73e64f.jpg' alt='364421257_8cad73e64f.jpg' /></p>
<p>Hmm&#8230; I&#8217;m afraid this isn&#8217;t going to roll at all</p>
<p>Anyway, consider this :</p>
<p>I am an old and unhappy programmer from the late eighties and you secretly watch me coding the following lines :</p>
<div class="ch_code_container" style="font-family: monospace;">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#3a27c9; font-weight:normal;">class</span> VotingSystem&nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#7b0303; font-style:normal;">#Hello, I am Rodger the old and unhappy programmer. the variable nbrOfVotes is an array of 2 dimensions. The first dimension contains the number of votes for the answer &quot;YES, IT SUCKS&quot;&#8230; and the other dimension contain the number of votes for the answer &quot;NO, IT DOESN&#8217;T SUCK&quot;. In the near future there will be other possible answers&#8230; but I don&#8217;t care! I retire in 2 days!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; @@nbrOfVotes = <span style="color:#7b0303; font-weight:bold;">Array</span>.<span style="color:#3a27c9;">new</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; </div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#7b0303; font-style:normal;">#The users who sent their vote arrive in this very top secret method!! (I retire in 2 days!)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#3a27c9; font-weight:normal;">def</span> receiveAVote<span style="color:#3a27c9; font-weight:bold;">&#40;</span>theVote<span style="color:#3a27c9; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">if</span> theVote == <span style="color:#996600;">&quot;YES, IT SUCKS&quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp;@@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> = <span style="color:#3a27c9;">0</span> <span style="color:#3a27c9; font-weight:normal;">if</span> @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span>.<span style="color:#3a27c9; font-weight:bold;">nil</span>?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp;@@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> = @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> + <span style="color:#3a27c9;">1</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">if</span> theVote == <span style="color:#996600;">&quot;NO, IT DOESN&#8217;T SUCK&quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> = <span style="color:#3a27c9;">0</span> <span style="color:#3a27c9; font-weight:normal;">if</span> @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span>.<span style="color:#3a27c9; font-weight:bold;">nil</span>?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> = @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> + <span style="color:#3a27c9;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">else</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#7b0303; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;THIS IS NOT A VALID ANSWER YOU MORON&#8230; btw i retire in 2 days!&quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#7b0303; font-style:normal;">#This is the function that compile ALL the votes&#8230; I retire in 2 days!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#3a27c9; font-weight:normal;">def</span> compileAllTheVotes</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">for</span> i <span style="color:#3a27c9; font-weight:normal;">in</span> <span style="color:#3a27c9; font-weight:bold;">&#40;</span><span style="color:#3a27c9;">0</span>..<span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">if</span> i == <span style="color:#3a27c9;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> = <span style="color:#3a27c9;">0</span> <span style="color:#3a27c9; font-weight:normal;">if</span> @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span>.<span style="color:#3a27c9; font-weight:bold;">nil</span>?</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#7b0303; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;HERE IS THE NUMBER OF VOTES FOR &#8216;YES IT SUCKS&#8217; : &quot;</span> + @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">0</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span>.<span style="color:#3a27c9;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">if</span> i == <span style="color:#3a27c9;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span> = <span style="color:#3a27c9;">0</span> <span style="color:#3a27c9; font-weight:normal;">if</span> @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span>.<span style="color:#3a27c9; font-weight:bold;">nil</span>?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#7b0303; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;HERE IS THE NUMBER OF VOTES FOR &#8216;NO IT DOESN&#8217;T SUCKS&#8217; : &quot;</span> + @@nbrOfVotes<span style="color:#3a27c9; font-weight:bold;">&#91;</span><span style="color:#3a27c9;">1</span><span style="color:#3a27c9; font-weight:bold;">&#93;</span>.<span style="color:#3a27c9;">to_s</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; &nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp; <span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;"><span style="color:#3a27c9; font-weight:normal;">end</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Trebuchet MS', Arial, Verdana; font-weight: normal;">&nbsp;</div>
</li>
</ol>
</div>
<p>Bring the light to this man who retires in 2 days</p>
<p><a href="http://refactormycode.com/codes/283-rubyize-this-6th-edition">Refactor this on RMC!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/rubyize-this-6th-edition/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Oh the weather outside is frightful</title>
		<link>http://www.rubyfleebie.com/oh-the-weather-outside-is-frightful/</link>
		<comments>http://www.rubyfleebie.com/oh-the-weather-outside-is-frightful/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 12:44:49 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/oh-the-weather-outside-is-frightful/</guid>
		<description><![CDATA[I really would have like to finish part 2 of IM Integration with XMPP4r before Christmas but I wasn&#8217;t able to make it, sorry. I didn&#8217;t want to rush it neither and it would have been stupid to do so.
I just want to wish you a merry Christmas. Have a good time with your loved [...]]]></description>
			<content:encoded><![CDATA[<p>I really would have like to finish part 2 of <a href="http://www.rubyfleebie.com/im-integration-with-xmpp4r/">IM Integration with XMPP4r</a> before Christmas but I wasn&#8217;t able to make it, sorry. I didn&#8217;t want to rush it neither and it would have been stupid to do so.</p>
<p>I just want to wish you a merry Christmas. Have a good time with your loved ones. That&#8217;s it! I&#8217;m ending this post by showing you my 2 favorite Christmas songs. What are yours?</p>
<p>#1 : This <em>Jingle Bells</em> interpretation by Frank Sinatra is simply incredible. Too bad it&#8217;s just the beginning of the song&#8230; could not find the full version on youtube. I love those J-I-N-G-L-E BELLS, Oh!</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/OjPzbpNun3M&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/OjPzbpNun3M&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p>#2 : Let it snow by Frank Sinatra</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/F8BH4M9V1N8&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/F8BH4M9V1N8&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/oh-the-weather-outside-is-frightful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tell me where my things are, Mrs. Pratt!</title>
		<link>http://www.rubyfleebie.com/tell-me-where-my-things-are-mrs-pratt/</link>
		<comments>http://www.rubyfleebie.com/tell-me-where-my-things-are-mrs-pratt/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 20:17:31 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Easy reading]]></category>

		<guid isPermaLink="false">http://www.rubyfleebie.com/tell-me-where-my-things-are-mrs-pratt/</guid>
		<description><![CDATA[I&#8217;m proud to present you my latest project : Mrs. Pratt !
Who is Mrs. Pratt?
Mrs. Pratt is a super woman who will help you remember where you things are!

The idea is simple : You tell Mrs. Pratt whenever you lend something to someone. Say for example that you lent your Bing Crosby Christmas album to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to present you my latest project : <a href="http://www.mrspratt.com">Mrs. Pratt</a> !</p>
<h3>Who is Mrs. Pratt?</h3>
<p>Mrs. Pratt is a super woman who will help you remember where you things are!</p>
<p>
The idea is simple : You tell Mrs. Pratt whenever you lend something to someone. Say for example that you lent your Bing Crosby Christmas album to Georges, you just have to tell Mrs. Pratt about it, like that :
</p>
<p><img src="http://blog.francoislamontagne.com/wp-content/uploads/2007/12/ss1.PNG" alt="" /></p>
<h3>Developed with RoR and uses xmpp4r for IM integration</h3>
<p>
Once again, this is a project I created with RubyOnRails. I also used the ruby library Xmpp4r which is the object of an <a href="http://www.rubyfleebie.com/im-integration-with-xmpp4r/">ongoing serie of articles</a> on RubyFleebie.
</p>
<p>There is also a really simple <a href="http://www.mrspratt.com/api">API</a> available for developers who would like to integrate Mrs. Pratt with their own appliaction.</p>
<p>
That&#8217;s it! I hope you will like the idea. If you do, please be kind enough to send me your comments/suggestions/rants about the project at <a href="mailto:contact@mrspratt.com">contact@mrspratt.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rubyfleebie.com/tell-me-where-my-things-are-mrs-pratt/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
