<?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>Admoo Labs &#187; Bugs and Fixes</title>
	<atom:link href="http://blog.admoolabs.com/category/bugs-and-fixes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.admoolabs.com</link>
	<description>Bringing fun back to the web.</description>
	<lastBuildDate>Sun, 07 Mar 2010 13:45:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Alphabar on Rails</title>
		<link>http://blog.admoolabs.com/alphabar-on-rails/</link>
		<comments>http://blog.admoolabs.com/alphabar-on-rails/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 02:26:16 +0000</pubDate>
		<dc:creator>Gerald Abrencillo</dc:creator>
				<category><![CDATA[Bugs and Fixes]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[alphabar]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=15</guid>
		<description><![CDATA[I am working on this little project right now using Ruby on Rails and I ran into some trouble with the alphabar plugin. First, alphabar uses the with_scope method which, since Rails 2.0 I believe, has been protected, giving me some errors since I froze my Rails version. I was able to overcome this obstacle [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on this little project right now using Ruby on Rails and I ran into some trouble with the alphabar plugin. First, alphabar uses the with_scope method which, since Rails 2.0 I believe, has been protected, giving me some errors since I froze my Rails version. I was able to overcome this obstacle by using the send method instead. Just change the last part of the find method of the plugin from:</p>
<pre><code>model.with_scope({:find =&amp;gt; {:conditions =&amp;gt; conditions}})
{model.find :all}</code></pre>
<p>to:</p>
<pre><code>model.send(:with_scope, {:find =&amp;gt; {:conditions =&amp;gt; conditions}})
{model.find :all}</code></pre>
<p>After I finally got that to work the plugin was very useful, although the alphabar was limited to letters and blank which is useful if you don&#8217;t need numbers. To accomodate numbers just add this to the alphabar helper:</p>
<pre><code>('0'..'9').to_a.each do |i|
slots &amp;lt;&amp;lt; i
end</code></pre>
<p>Theoretically it should work for any character but I haven&#8217;t tried it yet.</p>
<p>So there you have it. Hoepfully somebody having trouble with this plugin will find this post useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/alphabar-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nl2br in RoR</title>
		<link>http://blog.admoolabs.com/nl2br-in-ror/</link>
		<comments>http://blog.admoolabs.com/nl2br-in-ror/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 04:40:48 +0000</pubDate>
		<dc:creator>Gerald Abrencillo</dc:creator>
				<category><![CDATA[Bugs and Fixes]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[nl2br]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=10</guid>
		<description><![CDATA[I recently found out that line breaks are not recognized when displaying a large block of text on the view (e.g. a post body). In PHP this was handled by the nl2br method but I had no luck finding a similar function in RoR. So I did what any sane person would do, create one [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found out that line breaks are not recognized when displaying a large block of text on the view (e.g. a post body). In PHP this was handled by the nl2br method but I had no luck finding a similar function in RoR. So I did what any sane person would do, create one myself. I placed this method in our model to format a particular field but it seems a better choice to put it in a helper.</p>
<blockquote><p> def nl2br(text)</p>
<p>return  text.gsub(/\n/, &#8216;&lt;br/&gt;&#8217;)</p>
<p>end</p></blockquote>
<p>And there you have it, your very own nl2br method. Either you just found something really useful or I just wasted 2 minutes of your time. If anyone has a better solution or if I missed a function for this let us know by dropping a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/nl2br-in-ror/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Small But Terrible</title>
		<link>http://blog.admoolabs.com/small-but-terrible/</link>
		<comments>http://blog.admoolabs.com/small-but-terrible/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 23:47:28 +0000</pubDate>
		<dc:creator>Eumir Gaspar</dc:creator>
				<category><![CDATA[Bugs and Fixes]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=9</guid>
		<description><![CDATA[I&#8217;m pretty sure most of us have been in a situation where we have been trying to fix a bug for hours and finally seeing that there had just been some tiny typo or maybe even a commented line of code. I&#8217;ve been through a lot of those experiences before, especially when I was still [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pretty sure most of us have been in a situation where we have been trying to fix a bug for hours and finally seeing that there had just been some tiny typo or maybe even a commented line of code. I&#8217;ve been through a lot of those experiences before, especially when I was still learning to code, and most of the time, I just breathe out a huge sigh of relied or just plainly laugh at myself.</p>
<p>Reminiscing about those &#8216;good old days&#8217; could be fun too. Here&#8217;s some of those &#8216;what the hell/oh come on/I knew it was just a simple mistake!&#8217; scenarios that I have experienced or just know of:</p>
<ul>
<li> <strong>A missing/extra space, comma, or whatever character in your code. </strong>When this happens, it usually takes a while before you realize it because most of the time, you assume that what you typed was correct. Especially with missing spaces, it really is hard to tell. I have had one experience before in coding in Flash, where my fellow coder had 3 extra spaces after the instance name of a clip. No wonder we couldn&#8217;t access the variable!</li>
<li><strong>Unpopulated database.</strong> I think Bit had experienced this too, when he was launching the AnimoAteneo.com site. I have also experienced this recently, where I KNEW my code was correct, but the reason why it wasn&#8217;t printing out anything was because it didn&#8217;t select anything(I was trying to select events during a week, which was stored in database&#8230;and the problem was there were no events that week).</li>
<li><strong>The semi-colon of emptiness.</strong> There are rare times in the life of a programmer(especially ones that still use the ancient arts of Java and other compiled languages) when s/he encounters the&#8230;wait for it&#8230;semi-colon of emptiness(SFX: thunder crash). This is one of the most frustrating things that can happen to you: accidentally put a semi-colon after an if statement. Although it has been used deliberately for empty if statements, some still accidentally put a semi-colon after the if statement, which invariably makes it useless. And for that, we have to thank those other languages that don&#8217;t require a semi-colon.</li>
<li><strong>HTML entities.</strong> These guys are a nightmare, especially with a database involved. tick-marks or whatever you call it are often confused with apostrophes, tabs(nbsps) with spaces, long dashes with short dashes(sounds weird but it does happen), etc. It is a real pain especially when the program or database doesn&#8217;t complain about it and you just find out about it after they have wreaked havoc in whatever you were working on.</li>
<li><strong>Uncommented/commented lines of code.</strong> This happens especially when you are using the &#8220;try and try &#8217;til it works&#8221; approach in coding. This also happens when you are trying to debug your code and you forget to uncomment/comment some lines that subtly affect whatever your code was doing &#8211; like, say &#8211; assigning a static/hard-coded value to a variable.</li>
</ul>
<p>These are just some of the mistakes that we can encounter while coding and minimizing the chances of these happening can help in coding a lot faster and having more time dealing with bugs that matter.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/small-but-terrible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
