<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bugs Need Fix</title>
	<atom:link href="http://bugsneedfix.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bugsneedfix.wordpress.com</link>
	<description>programming.design.excerpts of my work.troubleshoot.symptoms.etc</description>
	<lastBuildDate>Sat, 23 Apr 2011 07:29:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bugsneedfix.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bugs Need Fix</title>
		<link>http://bugsneedfix.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bugsneedfix.wordpress.com/osd.xml" title="Bugs Need Fix" />
	<atom:link rel='hub' href='http://bugsneedfix.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Include/Extend in Ruby Modules</title>
		<link>http://bugsneedfix.wordpress.com/2011/04/23/includeextend-in-ruby-modules/</link>
		<comments>http://bugsneedfix.wordpress.com/2011/04/23/includeextend-in-ruby-modules/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 07:29:25 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=117</guid>
		<description><![CDATA[I have always confused my self when to use include or extend when mixin methos of a class. include() mixes methods into the instances of the base object. extend() mixes methods into the base object itself. For example, module Color def green "I'm green" end end By including Greeter into SomeClass, we make it so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=117&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have always confused my self when to use include or extend when mixin methos of a class.</p>
<p><tt>include()</tt> mixes methods into the instances of the base object.</p>
<p><tt>extend()</tt> mixes methods into the base object itself.</p>
<p>For example,</p>
<pre>module Color
  def green
    "I'm green"
  end
end</pre>
<p>By including <tt>Greeter</tt> into <tt>SomeClass</tt>, we make it so that we can now call <tt>hello()</tt> on instances of <tt>SomeClass</tt>.</p>
<pre>class SomeClass
  include Color
end

SomeClass.new.green #=&gt; "I'm green"</pre>
<p>Extending <tt>AnotherClass</tt> with <tt>Greeter</tt> would allow us to call the hello method directly at the class level, as in the example below.</p>
<pre>class AnotherClass
  extend Color
end

AnotherClass.green #=&gt; "I'm green"</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=117&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2011/04/23/includeextend-in-ruby-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby Version Manager</title>
		<link>http://bugsneedfix.wordpress.com/2009/10/23/ruby-version-manager/</link>
		<comments>http://bugsneedfix.wordpress.com/2009/10/23/ruby-version-manager/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 07:42:28 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby version manager]]></category>
		<category><![CDATA[ruby1.9.1]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=107</guid>
		<description><![CDATA[I&#8217;ve been meaning to start using ruby1.9 but always stuck at maintaining codes in production that depends on Ruby1.8.6. Fortunately, there&#8217;s this thing called Ruby Version Manager where you easily change between different rails version. I have nothing but praise for the guys who made life easier for us programmers to do our job better [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=107&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to start using ruby1.9 but always stuck at maintaining codes in production that depends on Ruby1.8.6. Fortunately, there&#8217;s this thing called Ruby Version Manager where you easily change between different rails version. I have nothing but praise for the guys who made life easier for us programmers to do our job better &amp; faster with RVM.</p>
<p>The only thing is you have to install your gems for each ruby version. It does make sense because there are quite a few gems that depends on different built. Installing gems are not that hard imho. So no issue there.</p>
<p>Now I can change between different ruby version as easy as this:</p>
<p>$ rvm 1.9.1 # For ruby 1.9.1</p>
<p>$ rvm 1.8.7</p>
<p>What&#8217;s excellent about this is the ruby version is sandbox in just that one terminal you&#8217;re using. It doesn&#8217;t interferes with your already *original ruby installation. * rvm calls is your ruby system. To revert back to your original ruby installation just do</p>
<p>$ rvm system</p>
<p>Or if you want to set a default ruby throughout your system. You can simply do so like this:</p>
<p>$ rvm 1.9.1 &#8211;default</p>
<p>If you haven&#8217;t tried it before, go try it. Don&#8217;t worry, it won&#8217;t mess up anything on your current ruby system</p>
<p><a href="http://rvm.beginrescueend.com/" target="_blank">Ruby Version Manager &#8211; http://rvm.beginrescueend.com/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=107&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2009/10/23/ruby-version-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Authlogic is Awesome</title>
		<link>http://bugsneedfix.wordpress.com/2009/10/22/authlogic-is-awesome/</link>
		<comments>http://bugsneedfix.wordpress.com/2009/10/22/authlogic-is-awesome/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 13:28:08 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[authlogic]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails rails template]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=109</guid>
		<description><![CDATA[Have been tinkering around with authlogic. The most I love about is its out-of-the-box functionality. I used to wrestle with restful_authentication to get certain things that I need. Not in anyway that I&#8217;m bashing it but seeing how easy authlogic I couldn&#8217;t believe why I didn&#8217;t use it sooner. I like it so much that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=109&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have been tinkering around with authlogic. The most I love about is its out-of-the-box functionality. I used to wrestle with restful_authentication to get certain things that I need. Not in anyway that I&#8217;m bashing it  but seeing how easy authlogic I couldn&#8217;t believe why I didn&#8217;t use it sooner.</p>
<p>I like it so much that I even made a rails template base on authlogic. This rails template has the usual basic signup/login/logout and I threw in some cucumber steps &amp; stories in it. Here it is in flesh &amp; bytes <a href="http://github.com/fadhlirahim/myrails-template/blob/master/template_authlogic.rb" target="_blank">http://github.com/fadhlirahim/myrails-template/blob/master/template_authlogic.rb</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=109&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2009/10/22/authlogic-is-awesome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Div&#8217;s does not wrap tr&#8217;s</title>
		<link>http://bugsneedfix.wordpress.com/2009/09/16/divs-does-not-wrap-trs/</link>
		<comments>http://bugsneedfix.wordpress.com/2009/09/16/divs-does-not-wrap-trs/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 14:50:12 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tr]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=102</guid>
		<description><![CDATA[I tried to update a HTML div elevement wrapping around a table row inside a table. I wasted 1 hour to find out why my ajax calls aren&#8217;t updating the right table row. Apparently it&#8217;s not valid HTML. The div will always be on top and then the table tag. A workaround that I found [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=102&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried to update a HTML div elevement wrapping around a table row inside a table.</p>
<p><pre class="brush: xml;">
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;Pomme&lt;/td&gt;
&lt;/tr&gt;
&lt;div id=&quot;placeholder&quot;&gt;
&lt;tr&gt;
&lt;td&gt;SomethingElse&lt;/td&gt;
&lt;/tr&gt;
&lt;/div&gt;
</pre></p>
<p>I wasted 1 hour to find out why my ajax calls aren&#8217;t updating the right table row.</p>
<p>Apparently it&#8217;s not valid HTML. The div will always be on top and then the table tag.</p>
<p>A workaround that I found to put a placeholder id inside a table is by using &lt;tbody&gt;. So simply substitute the div with a tbody tag and you&#8217;re done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=102&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2009/09/16/divs-does-not-wrap-trs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>My little contribution to a rails plugin (sort of)</title>
		<link>http://bugsneedfix.wordpress.com/2009/06/14/my-little-contribution-to-a-rails-plugin-sort-of/</link>
		<comments>http://bugsneedfix.wordpress.com/2009/06/14/my-little-contribution-to-a-rails-plugin-sort-of/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 16:03:42 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[weekly_builder]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=100</guid>
		<description><![CDATA[Getting your bug fix/code pulled into the main repo really gets you excited &#38; satisfied. I never thought it could give me this much sense of enjoyment. Check it out. http://github.com/dmix/weekly_builder/tree/master<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=100&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Getting your bug fix/code pulled into the main repo really gets you excited &amp; satisfied.</p>
<p>I never thought it could give me this much sense of enjoyment. Check it out.</p>
<p><a href="http://github.com/dmix/weekly_builder/tree/master" target="_blank">http://github.com/dmix/weekly_builder/tree/master</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=100&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2009/06/14/my-little-contribution-to-a-rails-plugin-sort-of/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Includes &amp; Eager Loading</title>
		<link>http://bugsneedfix.wordpress.com/2009/06/08/includes-eager-loading/</link>
		<comments>http://bugsneedfix.wordpress.com/2009/06/08/includes-eager-loading/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 14:27:04 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[eager loading]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=91</guid>
		<description><![CDATA[I&#8217;m figuring out something in my rails app.  I&#8217;m figuring out which one&#8217;s the worst: Eager loading 100 rows of data you don&#8217;t actually need at the moment or 10 queries giving 10 result set at once? Here&#8217;s the code to explain it. In the view, for each attendees, it&#8217;s calling a purchase record. Since [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=91&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m figuring out something in my rails app.  I&#8217;m figuring out which one&#8217;s the worst:</p>
<p>Eager loading 100 rows of data you don&#8217;t actually need at the moment</p>
<p>or</p>
<p>10 queries giving 10 result set at once?</p>
<p>Here&#8217;s the code to explain it.</p>
<p><code><strong> </strong></code></p>
<p><pre class="brush: ruby;">

@event = Event.find(params[:event_id])

@event_attendees = @event.attendees.paginate(:page =&gt; params[:page], :per_page =&gt; 10)

</pre></p>
<p>In the view, for each attendees, it&#8217;s calling a purchase record. Since I&#8217;m using will_paginate and setting 10 records per page, for every 10 record of attendees, there&#8217;s 10 queries for a purchase record. Here&#8217;s the following SQL that will be generated:</p>
<p><pre class="brush: sql;">
SELECT * FROM `attendees` WHERE (`attendees`.event_id = 4)

SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 1) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 2) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 3) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 4) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 5) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 6) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 7) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 8) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 9) LIMIT 1
SELECT * FROM `purchases` WHERE (purchasable_type = 'Attendee' and purchasable_id = 10) LIMIT 1

</pre></p>
<p>Clearly you can that see the above code creates a n + 1 problem.</p>
<p>So I tried to modified it using eager loading like the following:</p>
<p><pre class="brush: ruby;">
@event_attendees = @event.attendees.paginate(:include =&gt; :purchase, :page =&gt; params[:page], :per_page =&gt; 10)
</pre></p>
<p>Here&#8217;s the following SQL query generated:</p>
<p><pre class="brush: sql;">
SELECT * FROM `attendees` WHERE (`attendees`.event_id = 4)
SELECT `purchases`.* FROM `purchases` WHERE (`purchases`.`purchasable_id` IN (1,2,3,4..100) and `purchases`.`purchasable_type` = 'Attendee')
 # query is shorten for brevity
</pre></p>
<p>You can see that it&#8217;s using 1 query that fetches 100 rows of data. At first I thought that it will limit the eager loading with my will_paginate per page settings. But clearly for every page that I&#8217;m viewing, it&#8217;s calling that query hence returning 100 rows of data for each page I&#8217;m viewing.</p>
<p>At the moment I&#8217;m using the query without eager loading. Simply because I&#8217;m concern the app is fetching 100 rows that I don&#8217;t need at once. I have no idea how to limit an eager loading association base on will _paginate per_page. Or probably I could eager load once and keep in cache. Or does rails does that automatically?</p>
<p>Will investigate though. Oh well, back to work!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=91&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2009/06/08/includes-eager-loading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Routes Gotcha</title>
		<link>http://bugsneedfix.wordpress.com/2008/12/18/routes-gotcha/</link>
		<comments>http://bugsneedfix.wordpress.com/2008/12/18/routes-gotcha/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 01:52:05 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[rails routes]]></category>
		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=89</guid>
		<description><![CDATA[Something peculiar happened when I was doing something trivial. If you accidently named your restful route the following resource :roles instead of resources :roles When you point your app to /roles it won&#8217;t go to your index controller action but it will instead call your show action.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=89&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Something peculiar happened when I was doing something trivial.</p>
<p>If you accidently named your restful route the following</p>
<p>resource :roles instead of resource<strong>s</strong> :roles</p>
<p>When you point your app to /roles it won&#8217;t go to your index controller action but it will instead call your show action.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=89&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2008/12/18/routes-gotcha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>git svn can&#8217;t locate SVN/Core.pm</title>
		<link>http://bugsneedfix.wordpress.com/2008/12/07/git-svn-cant-locate-svncorepm/</link>
		<comments>http://bugsneedfix.wordpress.com/2008/12/07/git-svn-cant-locate-svncorepm/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 05:03:51 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[git-svn]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=85</guid>
		<description><![CDATA[I had a problem when running git svn command on my ubuntu. Can&#8217;t locate SVN/Core.pm in @INC It turns out all I had to do is install libsvn-perl.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=85&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a problem when running git svn command on my ubuntu.</p>
<p>Can&#8217;t locate SVN/Core.pm in @INC</p>
<p>It turns out all I had to do is install libsvn-perl.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=85&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2008/12/07/git-svn-cant-locate-svncorepm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Rebuilding Ferret Index</title>
		<link>http://bugsneedfix.wordpress.com/2008/11/20/rebuilding-ferret-index/</link>
		<comments>http://bugsneedfix.wordpress.com/2008/11/20/rebuilding-ferret-index/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 05:13:51 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[acts_as_ferret]]></category>
		<category><![CDATA[ferret]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=82</guid>
		<description><![CDATA[I had trouble reindexing the ferret index using the rake command (rake ferret:rebuild). I got this non-descriptive error regarding failing to rebuild it (Even in my development mode). So after googling for it, all one has to do is so simple. Go into your rails script/console and just type Model.rebuild_index And you&#8217;re done.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=82&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had trouble reindexing the ferret index using the rake command (rake ferret:rebuild). I got this non-descriptive error regarding failing to rebuild it (Even in my development mode). So after googling for it, all one has to do is so simple.</p>
<p>Go into your rails script/console and just type</p>
<p>Model.rebuild_index</p>
<p>And you&#8217;re done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=82&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2008/11/20/rebuilding-ferret-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
		<item>
		<title>Twitter Fuhrer</title>
		<link>http://bugsneedfix.wordpress.com/2008/08/17/twitter-fuhrer/</link>
		<comments>http://bugsneedfix.wordpress.com/2008/08/17/twitter-fuhrer/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 08:28:18 +0000</pubDate>
		<dc:creator>Fadhli</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://bugsneedfix.wordpress.com/?p=75</guid>
		<description><![CDATA[This is how people are upset about Twitter. http://iamrice.org/post/46208882/bullshit-hitler-twitters<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=75&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is how people are upset about Twitter.<br />
<a href="http://http://iamrice.org/post/46208882/bullshit-hitler-twitters"></p>
<p>http://iamrice.org/post/46208882/bullshit-hitler-twitters</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/bugsneedfix.wordpress.com/75/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/bugsneedfix.wordpress.com/75/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bugsneedfix.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bugsneedfix.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bugsneedfix.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bugsneedfix.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bugsneedfix.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bugsneedfix.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bugsneedfix.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bugsneedfix.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bugsneedfix.wordpress.com&amp;blog=3672990&amp;post=75&amp;subd=bugsneedfix&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bugsneedfix.wordpress.com/2008/08/17/twitter-fuhrer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6404b6d28932766fd6e65955d958c7f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Fadhli</media:title>
		</media:content>
	</item>
	</channel>
</rss>
