<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4911618396957689392</id><updated>2012-01-20T09:02:10.138-08:00</updated><category term='nordoc nori ruby gems'/><category term='bundler install/update slow'/><category term='unobtrusive'/><category term='flex file upload'/><category term='javascript'/><category term='uninstall mysql osx'/><category term='rails3 console inspect routes'/><category term='big data analytics ruby conf 2011'/><category term='Rails'/><category term='fileupload'/><category term='adding routes rails3 controller spec rspec2'/><category term='multipart form post'/><category term='Concurrency'/><category term='automation testing'/><category term='ruby form upload'/><category term='no fixtures'/><category term='rails sqlserver tiny_tds mac osx'/><category term='rspec'/><category term='sudo su'/><category term='EventMachine'/><category term='Ruby Fibers'/><category term='factory_girl'/><category term='active record'/><category term='mongodb phillytech'/><category term='devise extended controllers rails3 rspec2'/><category term='table sorter at edge'/><category term='sql server freetds Adaptive Server error'/><category term='javascript org chart organization'/><category term='Rails 3'/><category term='capistrano extension'/><category term='Marketing'/><category term='Flex'/><category term='rubygems bundler marshal short'/><category term='Watir'/><category term='Asynchronous'/><category term='heroku git'/><category term='highcharts waterfall bubble charts jquery javascript'/><category term='actionscript'/><category term='Github'/><category term='plugins'/><category term='url_encrypt'/><category term='arel'/><category term='extra_sanitize'/><title type='text'>RubyizednRailified</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-6307949244370792255</id><published>2012-01-20T09:02:00.000-08:00</published><updated>2012-01-20T09:02:10.144-08:00</updated><title type='text'>Invalid gemspec in” and “Illformed requirement”</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;If you have to solve the problem:&lt;br /&gt;&lt;script src="https://gist.github.com/1648360.js"&gt; &lt;/script&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-6307949244370792255?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/6307949244370792255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=6307949244370792255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6307949244370792255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6307949244370792255'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2012/01/invalid-gemspec-in-and-illformed.html' title='Invalid gemspec in” and “Illformed requirement”'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-5283575298495632155</id><published>2011-12-13T20:53:00.000-08:00</published><updated>2011-12-13T20:53:16.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sudo su'/><title type='text'>sudo: cd: command not found</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Ever tried this:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1475288.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Weird isn't it ?&lt;br /&gt;I checked the "/etc/sudoers" and everything looked normal:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="background-color: #0b5394; color: #cfe2f3;"&gt;toamitkumar &amp;nbsp; ALL = (ALL) NOPASSWD: ALL&lt;/span&gt;&lt;/blockquote&gt;I have sudo access - which means I have access to everything (thats what my understanding was)&lt;br /&gt;Well, I was wrong.&lt;br /&gt;&lt;br /&gt;After thinking for a while I felt - 'cd' is not a program, it is built-in for bash shell. So, I had to do:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #0b5394; color: #cfe2f3;"&gt;sudo -s&lt;/span&gt; or &lt;span class="Apple-style-span" style="background-color: #0b5394; color: #cfe2f3;"&gt;sudo su&lt;/span&gt; or &lt;span class="Apple-style-span" style="background-color: #0b5394; color: #cfe2f3;"&gt;sudo bash&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and then 'cd'.&lt;br /&gt;&lt;br /&gt;But be careful, that will open a shell for 'root' user.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-5283575298495632155?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/5283575298495632155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=5283575298495632155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5283575298495632155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5283575298495632155'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/12/sudo-cd-command-not-found.html' title='sudo: cd: command not found'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-7012557668591792546</id><published>2011-11-29T19:07:00.000-08:00</published><updated>2011-11-29T21:21:07.547-08:00</updated><title type='text'>RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="Apple-style-span" style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;Came across this weird error:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #eeeecc; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: x-small;"&gt;&lt;script src="https://gist.github.com/1406558.js"&gt; &lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #eeeecc; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;br /&gt;This had happened because I had&amp;nbsp;&lt;b&gt;RSpec 1&lt;/b&gt;&amp;nbsp;way of including spec_helper (in old files):&lt;/div&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')&lt;/div&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;And the other way (in my new files):&lt;/div&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="background-color: #eeeecc; color: #333333; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;"&gt;require 'spec_helper'&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Synching them fixed it :))&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-7012557668591792546?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/7012557668591792546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=7012557668591792546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7012557668591792546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7012557668591792546'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/11/rspeccoreconfigurationmustbeconfiguredb.html' title='RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-305467978895489138</id><published>2011-11-26T15:23:00.000-08:00</published><updated>2011-11-26T15:23:13.221-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='heroku git'/><title type='text'>!  No such app as radiant-cloud-8241. (Heruko)</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While pushing my rails application on heroku I stumbled across a weird error.&lt;br /&gt;&lt;br /&gt;Here are the steps:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1396478.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;To look into details of the error, lets dig deep. Below are the steps I followed to resolve the issue.&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/1396489.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-305467978895489138?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/305467978895489138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=305467978895489138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/305467978895489138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/305467978895489138'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/11/no-such-app-as-radiant-cloud-8241.html' title='!  No such app as radiant-cloud-8241. (Heruko)'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-2733090968140502451</id><published>2011-10-30T20:14:00.000-07:00</published><updated>2011-10-30T20:14:23.639-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='big data analytics ruby conf 2011'/><title type='text'>Ruby Conf'11 Video</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://1.gvt0.com/vi/DaSqQlEZdA0/0.jpg"&gt;&lt;param name="movie" value="http://www.youtube.com/v/DaSqQlEZdA0&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266"  src="http://www.youtube.com/v/DaSqQlEZdA0&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-2733090968140502451?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/2733090968140502451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=2733090968140502451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/2733090968140502451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/2733090968140502451'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/10/ruby-conf11-video.html' title='Ruby Conf&apos;11 Video'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-224765799301955994</id><published>2011-09-30T21:09:00.000-07:00</published><updated>2011-09-30T21:09:57.136-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='big data analytics ruby conf 2011'/><title type='text'>Big Data Enterprisey Analytics and Ruby</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My Ruby Conf 2011 presentation:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;At speakerdeck:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;script src="http://speakerdeck.com/embed/4e868e826ea0ae0050000461.js?size=preview"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;or at slideshare&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="__ss_9487098" style="width: 425px;"&gt; &lt;strong style="display: block; margin: 12px 0 4px;"&gt;&lt;a href="http://www.slideshare.net/toamitkumar/ruby-conf11-9487098" target="_blank" title="Ruby conf'11"&gt;Ruby conf'11&lt;/a&gt;&lt;/strong&gt; &lt;iframe frameborder="0" height="355" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/9487098" width="425"&gt;&lt;/iframe&gt; &lt;div style="padding: 5px 0 12px;"&gt; View more &lt;a href="http://www.slideshare.net/" target="_blank"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/toamitkumar" target="_blank"&gt;toamitkumar&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-224765799301955994?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/224765799301955994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=224765799301955994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/224765799301955994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/224765799301955994'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/09/big-data-enterprisey-analytics-and-ruby.html' title='Big Data Enterprisey Analytics and Ruby'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-8258353975601817725</id><published>2011-09-16T21:40:00.000-07:00</published><updated>2011-09-16T21:40:01.511-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript org chart organization'/><title type='text'>Building JS Org Chart</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Just released code to create inverted Organization Chart --&amp;gt; &lt;a href="https://github.com/toamitkumar/org_chart"&gt;library here&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-7sJnpZ8oLuk/TnQinEEzY6I/AAAAAAAAEUg/EXK8uIv7qr0/s1600/org_chart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://3.bp.blogspot.com/-7sJnpZ8oLuk/TnQinEEzY6I/AAAAAAAAEUg/EXK8uIv7qr0/s320/org_chart.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/--nZN6XEAV2g/TnQiphNYGVI/AAAAAAAAEUk/--YFeDW9gB0/s1600/org_chart_menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://3.bp.blogspot.com/--nZN6XEAV2g/TnQiphNYGVI/AAAAAAAAEUk/--YFeDW9gB0/s320/org_chart_menu.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-8258353975601817725?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/8258353975601817725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=8258353975601817725' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/8258353975601817725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/8258353975601817725'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/09/building-js-org-chart.html' title='Building JS Org Chart'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-7sJnpZ8oLuk/TnQinEEzY6I/AAAAAAAAEUg/EXK8uIv7qr0/s72-c/org_chart.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-657156609519397427</id><published>2011-05-15T18:30:00.000-07:00</published><updated>2011-05-15T18:30:05.595-07:00</updated><title type='text'>Stacked waterfall charts in highcharts</title><content type='html'>Check out how to generate &lt;a href="https://github.com/toamitkumar/Stacked-Waterfall/tree/master/stacked-waterfall"&gt;stacked waterfall&lt;/a&gt; charts using highchart js library.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-8Q4QPAhF5Hg/TdAXjYgR0cI/AAAAAAAAEQQ/efqhetfKFXQ/s1600/stacked-waterfall.png" imageanchor="1" style=""&gt;&lt;img border="0" height="154" width="320" src="http://1.bp.blogspot.com/-8Q4QPAhF5Hg/TdAXjYgR0cI/AAAAAAAAEQQ/efqhetfKFXQ/s320/stacked-waterfall.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-657156609519397427?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/657156609519397427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=657156609519397427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/657156609519397427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/657156609519397427'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/stacked-waterfall-charts-in-highcharts.html' title='Stacked waterfall charts in highcharts'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-8Q4QPAhF5Hg/TdAXjYgR0cI/AAAAAAAAEQQ/efqhetfKFXQ/s72-c/stacked-waterfall.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-2411790131724846747</id><published>2011-05-14T09:20:00.000-07:00</published><updated>2011-06-20T19:59:25.899-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='highcharts waterfall bubble charts jquery javascript'/><title type='text'>Waterfall chart with Line Connectors</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Update: the chart extension has evolved to produce waterfall charts with bubbles superimposed:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-6UUyOzBdl5g/TgAI2XGjkxI/AAAAAAAAERI/bmnDUjVy2mU/s1600/waterfall.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="142" src="http://4.bp.blogspot.com/-6UUyOzBdl5g/TgAI2XGjkxI/AAAAAAAAERI/bmnDUjVy2mU/s320/waterfall.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Just committed JS extension to create Waterfall charts&lt;br /&gt;&lt;br /&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-w_hamR6mawo/Tc6q2eiTbBI/AAAAAAAAEQM/9QCE2sKqJwY/s1600/watrefall.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="157" src="http://2.bp.blogspot.com/-w_hamR6mawo/Tc6q2eiTbBI/AAAAAAAAEQM/9QCE2sKqJwY/s320/watrefall.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;Look at &lt;a href="https://github.com/toamitkumar/waterfall-charts"&gt;here for details&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-2411790131724846747?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/2411790131724846747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=2411790131724846747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/2411790131724846747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/2411790131724846747'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/waterfall-chart-with-line-connectors.html' title='Waterfall chart with Line Connectors'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-6UUyOzBdl5g/TgAI2XGjkxI/AAAAAAAAERI/bmnDUjVy2mU/s72-c/waterfall.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-6084386281185604864</id><published>2011-05-08T20:40:00.000-07:00</published><updated>2011-05-08T20:40:56.764-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nordoc nori ruby gems'/><title type='text'>Install rubygems without rdoc/ri</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;If you ever want to disable generating rdoc and ri when you install a ruby gem:&lt;br /&gt;&lt;br /&gt;Add this to your &lt;b&gt;~/.gemrc&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: #ead1dc; color: #660000; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;install: --no-rdoc --no-ri&lt;/b&gt;&lt;/div&gt;&lt;div style="background-color: #ead1dc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;&lt;span style="color: #660000;"&gt;update: --no-rdoc --no-ri&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-6084386281185604864?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/6084386281185604864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=6084386281185604864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6084386281185604864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6084386281185604864'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/install-rubygems-without-rdocri.html' title='Install rubygems without rdoc/ri'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-5701473396796117430</id><published>2011-05-04T13:28:00.000-07:00</published><updated>2011-05-04T13:28:06.594-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mongodb phillytech'/><title type='text'>Micro-Blogging Solution for the Enterprise</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My slides @ &lt;a href="http://www.10gen.com/conferences/mongophilly2011"&gt;MongoDB Conf in Philadelphia&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="__ss_7742499" style="width: 425px;"&gt; &lt;strong style="display: block; margin: 12px 0 4px;"&gt;&lt;a href="http://www.slideshare.net/toamitkumar/microblogging-for-the-enterprise-mongodb" title="Micro-Blogging for The Enterprise (MongoDB)"&gt;Micro-Blogging for The Enterprise (MongoDB)&lt;/a&gt;&lt;/strong&gt; &lt;iframe frameborder="0" height="355" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/7742499" width="425"&gt;&lt;/iframe&gt; &lt;div style="padding: 5px 0 12px;"&gt; View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/toamitkumar"&gt;toamitkumar&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-5701473396796117430?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/5701473396796117430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=5701473396796117430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5701473396796117430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5701473396796117430'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/micro-blogging-solution-for-enterprise.html' title='Micro-Blogging Solution for the Enterprise'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-9133225333041557694</id><published>2011-05-04T08:04:00.000-07:00</published><updated>2011-05-04T08:05:20.130-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='devise extended controllers rails3 rspec2'/><title type='text'>Testing Extended Devise Controllers</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="https://github.com/plataformatec/devise"&gt;Devise&lt;/a&gt; has become the&amp;nbsp;de-facto library if you ever need Authentication. Tonnes of pluggable components which you can easily enable/disable.&lt;br /&gt;For our application we had to reset session and easiest and cleanest way to do was to extend the devise - SessionsController:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/955331.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;For testing this piece:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/955340.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;With smiling face I ran the spec buuuuuuttttttttttttttttt arrrrggghhhh:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;AbstractController::ActionNotFound&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Checking the devise filters helped with some direction:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/955364.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Have fun !!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-9133225333041557694?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/9133225333041557694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=9133225333041557694' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/9133225333041557694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/9133225333041557694'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/testing-extended-devise-controllers.html' title='Testing Extended Devise Controllers'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>2</thr:total><georss:featurename>Manhattan, NY 10022, USA</georss:featurename><georss:point>40.7565068 -73.9668408</georss:point><georss:box>40.7496868 -73.9765648 40.763326799999994 -73.9571168</georss:box></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-4780852871201390898</id><published>2011-05-04T07:35:00.000-07:00</published><updated>2011-05-04T07:35:20.892-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adding routes rails3 controller spec rspec2'/><title type='text'>Adding routes to rails3 - rspec2 (controller tests)</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was working on migrating an existing Rails 2 app to Rails 3. And I came across a weird issue. All my controller specs started to fail with error - route not found even though all my routes were in place.&lt;br /&gt;&lt;br /&gt;After some more reading in the rails routing module - found it overwrites the routes if you open the block and pass on extra routes&lt;br /&gt;&lt;script src="https://gist.github.com/955308.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Hope this will save few hours of your development :))&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-4780852871201390898?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/4780852871201390898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=4780852871201390898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4780852871201390898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4780852871201390898'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/adding-routes-to-rails3-rspec2.html' title='Adding routes to rails3 - rspec2 (controller tests)'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-8416644584870892439</id><published>2011-05-02T12:36:00.000-07:00</published><updated>2011-05-02T12:36:22.762-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails3 console inspect routes'/><title type='text'>Inspect Rails 3 routes in "console"</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;script src="https://gist.github.com/952211.js"&gt; &lt;/script&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-8416644584870892439?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/8416644584870892439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=8416644584870892439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/8416644584870892439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/8416644584870892439'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/inspect-rails-3-routes-in-console.html' title='Inspect Rails 3 routes in &quot;console&quot;'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-1518465066629179901</id><published>2011-05-02T08:44:00.000-07:00</published><updated>2011-05-02T08:44:53.620-07:00</updated><title type='text'>Rails 3 and Controller Callbacks - demystified</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I wanted to quickly check the callbacks that my controller has in my new Rails 3 application. With more abstraction in Rails 3 (AbstractController) - the easiest way I found was:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/951803.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Other ways to do ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-1518465066629179901?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/1518465066629179901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=1518465066629179901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/1518465066629179901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/1518465066629179901'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/05/rails-3-and-controller-callbacks.html' title='Rails 3 and Controller Callbacks - demystified'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-63116305287677910</id><published>2011-04-29T11:42:00.000-07:00</published><updated>2011-04-29T11:43:21.773-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server freetds Adaptive Server error'/><title type='text'>[freetds] tsql Unable to connect: Adaptive Server is unavailable or does not exist</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Today I was trying to connect to SQL Server from my OSx Mac and I was getting "&lt;b&gt;Unable to connect: Adaptive Server is unavailable or does not exist&lt;/b&gt;".&lt;br /&gt;&lt;br /&gt;I was able to connect to another sql server in the same farm from laptop.&lt;br /&gt;&lt;br /&gt;Found out by default --&amp;gt; TCP connectivity is disabled for SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Microsoft SQL Server 2008 R2 &amp;gt; Configuration Tools &amp;gt; SQL Server Configuration Manager &amp;gt; SQL Server Network Configuration &amp;gt; Protocols for MSSQLSERVER&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Protocol Name: TCP/IP (Enable)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Thats all :))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-63116305287677910?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/63116305287677910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=63116305287677910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/63116305287677910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/63116305287677910'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/04/freetds-tsql-unable-to-connect-adaptive.html' title='[freetds] tsql Unable to connect: Adaptive Server is unavailable or does not exist'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-1015231114618189170</id><published>2011-04-18T11:11:00.000-07:00</published><updated>2011-04-18T11:11:05.473-07:00</updated><title type='text'>Recursively delete .svn directories - Linux</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;script src="https://gist.github.com/925831.js"&gt; &lt;/script&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-1015231114618189170?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/1015231114618189170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=1015231114618189170' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/1015231114618189170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/1015231114618189170'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/04/recursively-delete-svn-directories.html' title='Recursively delete .svn directories - Linux'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-5379447709672276451</id><published>2011-04-11T21:25:00.000-07:00</published><updated>2011-04-15T21:35:39.383-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails sqlserver tiny_tds mac osx'/><title type='text'>Connecting to SQL Server from Linux/Suse/Snow Leopard</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="http://www.engineyard.com/blog/author/kencollins/"&gt;Ken Collins&lt;/a&gt; from EngineYard released &lt;a href="https://github.com/rails-sqlserver/tiny_tds"&gt;TinyTds&lt;/a&gt;, a ruby gem that uses dblib to connect to MS SQL server. It has no hassles of managing ODBC connection. &amp;nbsp;Read the &lt;a href="http://www.engineyard.com/blog/2011/modern-sql-server-rails/"&gt;blog&lt;/a&gt; for detailed explanation.&lt;br /&gt;&lt;br /&gt;Before TinyTDS:&lt;br /&gt;&lt;br /&gt;The steps for setting libraries to connect to MS SQL on *nix environment. Follow the steps religiously to succeed.&lt;br /&gt;&lt;script src="https://gist.github.com/914901.js"&gt; &lt;/script&gt; &lt;br /&gt;&lt;br /&gt;Enter TinyTDS:&lt;br /&gt;&lt;br /&gt;TinyTDS helps ODBC-less connection which means no pain of installing all the ODBC libraries.&lt;br /&gt;&amp;nbsp;It took a min to set-up the connection using the steps.&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/914923.js"&gt; &lt;/script&gt; &lt;br /&gt;&lt;br /&gt;Goodies: Steps on Mac OSx Snow Leopard&lt;br /&gt;&lt;script src="https://gist.github.com/914928.js"&gt; &lt;/script&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-5379447709672276451?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/5379447709672276451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=5379447709672276451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5379447709672276451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5379447709672276451'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/04/connecting-to-sql-server-from.html' title='Connecting to SQL Server from Linux/Suse/Snow Leopard'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-924904136112255021</id><published>2011-04-10T13:13:00.000-07:00</published><updated>2011-04-18T11:15:55.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='capistrano extension'/><title type='text'>Extending "Capistrano" to prompt for password when connecting to multiple servers</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;We have been using "&lt;a href="https://github.com/capistrano/capistrano"&gt;Capistrano&lt;/a&gt;" to automate the deployment of our Rails apps. Capistrano is very&amp;nbsp; powerful helps to execute any command on the remote machines. It has before/after "callback" hooks that helps to execute commands your application might depend on before running "cap deploy".&lt;br /&gt;&lt;br /&gt;Capistrano assumes all the remote machines have the same credentials. Imagine you want to run commands on different remote machines each having different credentials.&lt;br /&gt;&lt;br /&gt;Added a small extension for capistrano to prompt for password again when connecting to another server.&lt;br /&gt;&lt;script src="https://gist.github.com/912666.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Drop the code in your &lt;span style="color: #660000;"&gt;Rails.root/lib&lt;/span&gt; directory.&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/925850.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;You will have to add:&lt;br /&gt;&lt;script src="https://gist.github.com/912692.js"&gt; &lt;/script&gt;&lt;br /&gt;in you recipes to force capistrano to prompt.&lt;br /&gt;&lt;br /&gt;Bonus: Create ssh public keys and enjoy password-less deployment. &lt;br /&gt;&lt;br /&gt;Next step: fork capistrano to add method for connecting to multiple servers&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-924904136112255021?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/924904136112255021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=924904136112255021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/924904136112255021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/924904136112255021'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/04/extending-capistrano-to-prompt-for.html' title='Extending &quot;Capistrano&quot; to prompt for password when connecting to multiple servers'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-7131569294126333369</id><published>2011-04-04T08:12:00.000-07:00</published><updated>2011-04-04T21:01:43.647-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='arel'/><category scheme='http://www.blogger.com/atom/ns#' term='active record'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails 3'/><title type='text'>Binding Variables in ARel</title><content type='html'>Just wanted to quickly share the awesome new ActiveRecord Relational Algebra. I am sure there are many others but this one is a gem.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For long conditions like these:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Post.where("(body like ? OR subject like ?) AND comment_count &amp;gt; ? AND created_at &amp;gt; ?", criteria, criteria, 5, 3.days.ago)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It becomes really difficult to match the order of parameters. &lt;/div&gt;&lt;div&gt;Welcome to ARel, the same query can be written as:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Post.where("(body like :criteria OR subject like :criteria) AND comment_count &amp;gt; :count AND created_at &amp;gt; created_date", :criteria =&amp;gt; criteria, :count =&amp;gt; 5, :created_date =&amp;gt; 3.days.ago)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;See the binding variables in place of hard to remember question marks. It is important to note, in case the same variable is repeated multiple times, passing the variable once is sufficient. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;More goodies to come !!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-7131569294126333369?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/7131569294126333369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=7131569294126333369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7131569294126333369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7131569294126333369'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/04/binding-variables-in-activerecord.html' title='Binding Variables in ARel'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-6248934231929005251</id><published>2011-03-31T20:23:00.000-07:00</published><updated>2011-03-31T21:50:58.141-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bundler install/update slow'/><title type='text'>pathetically slow "bundle install"</title><content type='html'>&lt;div&gt;Run the 'bundle install' command on your terminal and wait for bundler to install the gems. It is pathetically slow.&lt;br /&gt;&lt;br /&gt;It appears that RubyGems is slow. This is because of how Rubygems manages index of gems . It has 3 indexes:&lt;br /&gt;1) Index of new version of the gem&lt;br /&gt;2) Index of all the versions&lt;br /&gt;3) Index of pre release&lt;br /&gt;&lt;br /&gt;Doing "gem install &lt;gem_name&gt;, fetches the index of the latest version of the gem. Apparently, bundler downloads #2, all the indexes. These indexes are gzipped and Marshal'd array of gem name, version and platform. Parsing this huge array is the first spot of slow down.&lt;br /&gt;&lt;br /&gt;Now as we know bundler has intelligent algorithm for dependency management, which means when we do "bundle install", it will install all dependencies of the gem. This is achieved via .gemspec file which bundler downloads unzips and "UnMarshal's".   &lt;br /&gt;&lt;br /&gt;To reduce the slowness there few options, lets explore them:&lt;br /&gt;1) "bundle pack" the .gems inside vendor/cache - force bundler to install from local cache then going across the wire&lt;br /&gt;2) have your gems in "Gemfile" to be locked to a version or use &lt;a href="http://docs.rubygems.org/read/chapter/7"&gt;PessimisticVersionConstraint&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I have used a combination of both and found substantial improvement in the time taken by "bundle install/update".&lt;br /&gt;&lt;br /&gt;There are few other options like - &lt;a href="http://mirrorbrain.org/"&gt;MirrorBrain&lt;/a&gt;,  &lt;a href="https://github.com/rubygems/rubygems-mirror"&gt;rubygems-mirror&lt;/a&gt;, &lt;a href="https://github.com/lg/murder"&gt;murder&lt;/a&gt; etc. Keeping a watch on &lt;a href="http://groups.google.com/group/gemcutter"&gt;gemcutter&lt;/a&gt; mailing list for better ways of doing this.&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; line-height: 22px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/gem_name&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-6248934231929005251?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/6248934231929005251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=6248934231929005251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6248934231929005251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6248934231929005251'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/03/pathetically-slow-bundle-install.html' title='pathetically slow &quot;bundle install&quot;'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3434363728001995267</id><published>2011-03-31T17:47:00.000-07:00</published><updated>2011-03-31T18:04:34.717-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rubygems bundler marshal short'/><title type='text'>marshal data too short - rubygems error</title><content type='html'>Today while doing "bundle update" my server started to throw weird error.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-M1WZl2i5Tok/TZUiGI191kI/AAAAAAAAEO0/5mOIfPcDQ1Q/s1600/bundler.jpg"&gt;&lt;img style="cursor: pointer; width: 399px; height: 70px;" src="http://1.bp.blogspot.com/-M1WZl2i5Tok/TZUiGI191kI/AAAAAAAAEO0/5mOIfPcDQ1Q/s320/bundler.jpg" alt="" id="BLOGGER_PHOTO_ID_5590412001298732610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Somehow I was not able to relate it to bundler and doing&lt;br /&gt;&lt;br /&gt;  # gem update&lt;br /&gt;  updating installed gems&lt;br /&gt;  ERROR:  While executing gem … (ArgumentError)&lt;br /&gt;    marshal data too short&lt;br /&gt;&lt;br /&gt;explained that gem specs on the server is corrupted. I still need to figure out the reason why that happened in first place.&lt;br /&gt;&lt;br /&gt;This error kept popping up – no matter what commands I wanted to run with rubygems (update, update –system, install…)&lt;br /&gt;&lt;br /&gt;Googling did not give any solution on this topic. I had a feeling it is messing with ~/.gems directory - and found out to be true.&lt;br /&gt;I deleted all entries inside the ~/.gems directory. I had to just just reinstall all my gems.&lt;br /&gt;&lt;br /&gt;Any better ways to solve this problem ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3434363728001995267?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3434363728001995267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3434363728001995267' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3434363728001995267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3434363728001995267'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/03/marshal-data-too-short-rubygems-error.html' title='marshal data too short - rubygems error'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-M1WZl2i5Tok/TZUiGI191kI/AAAAAAAAEO0/5mOIfPcDQ1Q/s72-c/bundler.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3644676724421796188</id><published>2011-03-25T11:24:00.000-07:00</published><updated>2011-03-31T17:47:20.610-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uninstall mysql osx'/><title type='text'>If at all you need to Uninstall MySQL 5.5 from OSx</title><content type='html'>https://gist.github.com/887350&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3644676724421796188?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3644676724421796188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3644676724421796188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3644676724421796188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3644676724421796188'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/03/if-at-all-you-need-to-uninstall-mysql.html' title='If at all you need to Uninstall MySQL 5.5 from OSx'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-1217385398319916009</id><published>2011-03-23T20:32:00.000-07:00</published><updated>2011-03-23T20:38:02.687-07:00</updated><title type='text'>uninitialized constant Mysql::Error - OSx snow leopard</title><content type='html'>You will run into this issue if you are using:&lt;br /&gt;&lt;br /&gt;Mysql -&gt; 5.5.x&lt;br /&gt;&lt;br /&gt;rake db:create --trace&lt;br /&gt;(in /Users/toamitkumar/development/rails_apps/mongotimeline)&lt;br /&gt;** Invoke db:create (first_time)&lt;br /&gt;** Invoke db:load_config (first_time)&lt;br /&gt;** Invoke rails_env (first_time)&lt;br /&gt;** Execute rails_env&lt;br /&gt;** Execute db:load_config&lt;br /&gt;** Execute db:create&lt;br /&gt;rake aborted!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;uninitialized constant Mysql::Error&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;spent 2 hours to figure out the issue is with 64 bit architecture on OSx. It is not able to find dynamic library libmysqlclient. Making the following entry in .bashrc file and then installing the mysql gem again solved the problem.&lt;br /&gt;&lt;br /&gt;&lt;pre class="default prettyprint"&gt;&lt;code&gt;&lt;span class="kwd"&gt;export&lt;/span&gt;&lt;span class="pln"&gt; DYLD_LIBRARY_PATH&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="str"&gt;"/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class="pln"&gt;$ sudo env ARCHFLAGS&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="str"&gt;"-arch x86_64"&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;$ gem install &lt;/span&gt;&lt;span class="pun"&gt;--&lt;/span&gt;&lt;span class="kwd"&gt;no&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="pln"&gt;rdoc &lt;/span&gt;&lt;span class="pun"&gt;--&lt;/span&gt;&lt;span class="kwd"&gt;no&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="pln"&gt;ri mysql &lt;/span&gt;&lt;span class="pun"&gt;--&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;--&lt;/span&gt;&lt;span class="kwd"&gt;with&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="pln"&gt;mysql&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="pln"&gt;config&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="str"&gt;/usr/&lt;/span&gt;&lt;span class="kwd"&gt;local&lt;/span&gt;&lt;span class="pun"&gt;/&lt;/span&gt;&lt;span class="pln"&gt;mysql&lt;/span&gt;&lt;span class="pun"&gt;/&lt;/span&gt;&lt;span class="pln"&gt;bin&lt;/span&gt;&lt;span class="pun"&gt;/&lt;/span&gt;&lt;span class="pln"&gt;mysql_config&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Rock on !!&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-1217385398319916009?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/1217385398319916009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=1217385398319916009' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/1217385398319916009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/1217385398319916009'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/03/uninitialized-constant-mysqlerror-osx.html' title='uninitialized constant Mysql::Error - OSx snow leopard'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-4151588243590245889</id><published>2011-03-18T15:00:00.000-07:00</published><updated>2011-03-18T15:34:46.901-07:00</updated><title type='text'></title><content type='html'>&lt;a href="http://gembundler.com/"&gt;Bundler&lt;/a&gt; is a great tool which helps to manage your application dependencies. It is very simple to use,  just drop it and you are good to go with one command -&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;bundle install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check out: http://gembundler.com/, if you care.&lt;br /&gt;&lt;br /&gt;The problem occurs when it fails to install a gem. It does not have a way to show the trace of stack calls like rake --trace.&lt;br /&gt;&lt;br /&gt;Let me tell you the problem - I was moving a Rails 2.3.9 project to use bundler. The application is using libxml-ruby for XML parsing (yes I know nokogiri fans - @tenderlove did a wonderful job).&lt;br /&gt;&lt;br /&gt;The Gemfile entry:&lt;br /&gt;&lt;br /&gt;gem 'libxml-ruby'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ bundle install&lt;br /&gt;&lt;br /&gt;and bundler tries to install the native extension (dependencies on zlib, libxml, iconv). I downloaded all the .dll's and copied them to Devkit.&lt;br /&gt;&lt;br /&gt;$ bundle install&lt;br /&gt;&lt;br /&gt;The same failure.&lt;br /&gt;&lt;br /&gt;The nice bundle.config command:&lt;br /&gt;&lt;br /&gt;$ bundle config build.libxml-ruby &lt;span style="color: rgb(255, 0, 0);"&gt;-- --with-zlib-dir=/path/to/zlib --with-zlib-include=/path/to/zlib/include --with-zlib-lib=/path/to/zlib/lib --with-iconv-dir=/path/to/iconv --with-iconv-lib=/path/to/iconv/lib --with-iconv-include=/path/to/iconv/include --with-xml2-dir=/path/to/libxml --with-xml2-lib=/path/to/libxml/lib --with-xml2-include=/path/to/libxml/include&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$ bundle install&lt;br /&gt;&lt;br /&gt;and I started to see the gem building, and then NOOOOO, version mismatch of the DLLs. I spent hours figuring out which are the compatible versions.&lt;br /&gt;&lt;br /&gt;And then,&lt;br /&gt;&lt;br /&gt;@&lt;a href="http://niranjansarade.blogspot.com/"&gt;niranjan&lt;/a&gt; suggested: &lt;a href="https://gist.github.com/876972"&gt;this entry&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;$ bundle install&lt;br /&gt;&lt;br /&gt;all worked, sweet !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-4151588243590245889?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/4151588243590245889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=4151588243590245889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4151588243590245889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4151588243590245889'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/03/bundler-bundle-install-check-out.html' title=''/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3880883235775473559</id><published>2011-02-14T19:50:00.000-08:00</published><updated>2011-04-10T15:56:14.789-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Concurrency'/><category scheme='http://www.blogger.com/atom/ns#' term='EventMachine'/><category scheme='http://www.blogger.com/atom/ns#' term='Asynchronous'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby Fibers'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Concurrency with Fibers and EventMachine</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Concurrency in Rails&lt;/span&gt; - a bug that bit me few weeks back. This led me to read in detail about "&lt;a href="http://en.wikipedia.org/wiki/Reactor_pattern"&gt;Reactor Pattern&lt;/a&gt;" (EventMachine, Twisted, Node.js) and making requests asynchronous.&lt;br /&gt;&lt;br /&gt;Let me take a step back and tell ya what made me read all this.&lt;br /&gt;Think about if, you had to solve a problem of making multiple service calls to complete a response. Doing this sequentially is "old" architecture, where you did not care much about performance. One can definitely argue, why not cache the beast !&lt;br /&gt;Well,&lt;br /&gt;&lt;ul&gt;&lt;li&gt;what if the data is dynamic&lt;/li&gt;&lt;li&gt;what if I care more about CPU Utilization. &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Every service requires I/O and everyone knows I/O is blocking. So, while waiting for the request to complete, CPU sits idle doing nothing. It could have fired another service call. This is more easy to say then to solve . This is where evented programming becomes very helpful. Consider all service calls as events which you can register for callbacks. You fire them all together and wait for them to complete. But now these events (ruby threads) compete for CPU cycle (yeah for obvious reasons - green thread). The threads are preempted by OS and there is no way you can control this.&lt;br /&gt;&lt;br /&gt;Ruby 1.9 introduced this powerful concept of Fibers - of creating code blocks which can be paused and resumed by application developer.  So, we can control when to pause and resume the execution ?? yeah&lt;br /&gt;Moreover they are cheap to spin off new as compared to threads.&lt;br /&gt;&lt;br /&gt;So, to achieve concurrency, we can fire fibers as events, each fiber responding back to callbacks.&lt;br /&gt;All sweet !!&lt;br /&gt;&lt;br /&gt;Wrote a nice Rails app -&gt; &lt;a href="https://github.com/toamitkumar/fibered-rails"&gt;fibered-rails&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Going to talk about this in our TCS Rails Conf'11 on 02/17/2011 - see the talk &lt;a href="http://slidesha.re/hAacX7"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="width:425px" id="__ss_6927565"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/toamitkumar/fibered-rails-6927565" title="Fibered rails"&gt;Fibered rails&lt;/a&gt;&lt;/strong&gt; &lt;iframe src="http://www.slideshare.net/slideshow/embed_code/6927565" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"&gt;&lt;/iframe&gt; &lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/toamitkumar"&gt;toamitkumar&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3880883235775473559?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3880883235775473559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3880883235775473559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3880883235775473559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3880883235775473559'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2011/02/concurrency-with-fibers-and.html' title='Concurrency with Fibers and EventMachine'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-4225080614600328045</id><published>2010-02-10T21:33:00.000-08:00</published><updated>2010-02-10T21:37:39.360-08:00</updated><title type='text'>Google goes BUZZing !!</title><content type='html'>Google steps into the world of micro-blogging ....&lt;br /&gt;Rest of the micro-blogging players hide out...&lt;br /&gt;&lt;br /&gt;Wanna try -&gt; &lt;a href="http://www.google.com/buzz"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;See the &lt;a href="http://www.youtube.com/watch?v=yi50KlsCBio"&gt;video&lt;/a&gt; to help yourself...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-4225080614600328045?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/4225080614600328045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=4225080614600328045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4225080614600328045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4225080614600328045'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2010/02/google-goes-buzzing.html' title='Google goes BUZZing !!'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-6909376501999577082</id><published>2010-02-10T20:42:00.000-08:00</published><updated>2010-02-10T21:29:17.246-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby form upload'/><category scheme='http://www.blogger.com/atom/ns#' term='multipart form post'/><title type='text'>Multipart form data post through ruby script</title><content type='html'>Well its been long I blogged but better late than never... :)))&lt;br /&gt;Been busy with projects, visit to India etc etc ... I can come up with a long list of excuses but none of them will be procrastinating ... hehehe&lt;br /&gt;&lt;br /&gt;I forced my self out of hibernation to blog about a recent (strange ??) problem I faced.&lt;br /&gt;In one of my projects, I came across a fairly common requirement to upload a file (multipart form-data post)  through a ruby script. Pretty simple huhhh!&lt;br /&gt;&lt;br /&gt;Unfortunately I was stumped to find that &lt;span style="font-style: italic; color: rgb(153, 0, 0);"&gt;net/http&lt;/span&gt; library does not support it (still dont believe it!!). The documentation is very poor and it took me sometime to figure out &lt;span style="font-style: italic; color: rgb(153, 0, 0);"&gt;net/http&lt;/span&gt; treats them all as string. CRAP !!!.&lt;br /&gt;&lt;br /&gt;Some nice libraries eg: &lt;a href="http://github.com/adamwiggins/rest-client/tree/master"&gt;rest_client&lt;/a&gt;, &lt;a href="http://gemcutter.org/gems/httpclient"&gt;httpclient&lt;/a&gt;, &lt;a href="http://curb.rubyforge.org/"&gt;curb&lt;/a&gt; etc.. do a decent job in terms of posting the file, but they all mess with either creating incorrect &lt;a href="http://www.w3.org/TR/html401/interact/forms.html"&gt;boundaries&lt;/a&gt; for multi-part form or mess with &lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"&gt;content_length&lt;/a&gt; header of form-post&lt;br /&gt;&lt;br /&gt;My requirement was to make http post call (multipart form data post) to Domino server. The domino app was very particular about content_length header, which is where I faced the biggest hurdle in using them.&lt;br /&gt;&lt;br /&gt;Left with no choice, rolled up my sweet multipart form post.&lt;br /&gt;&lt;br /&gt;Sharing with you all &lt;a href="http://github.com/toamitkumar/ruby-multipart-post"&gt;ruby-multipart-post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;How to use ==&gt; &lt;a href="http://github.com/toamitkumar/ruby-multipart-post/blob/master/README.rdoc"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Any feedback, most welcome ...&lt;br /&gt;&lt;br /&gt;Enjoy !!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-6909376501999577082?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/6909376501999577082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=6909376501999577082' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6909376501999577082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/6909376501999577082'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2010/02/multipart-form-data-post-through-ruby.html' title='Multipart form data post through ruby script'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3915346488685715167</id><published>2009-07-21T19:42:00.000-07:00</published><updated>2009-07-21T19:46:57.568-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Marketing'/><title type='text'>A non-ruby post about marketing tips</title><content type='html'>Goggling about some Ruby thing, I came across a nice article on Marketing Tips. I was forced to share these beautiful thoughts ....&lt;br /&gt;&lt;br /&gt;http://www.webdesignerdepot.com/2009/07/9-marketing-tips-from-a-six-year-olds-lemonade-stand/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3915346488685715167?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3915346488685715167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3915346488685715167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3915346488685715167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3915346488685715167'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/07/non-ruby-post-about-marketing-tips.html' title='A non-ruby post about marketing tips'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-7880118853906537609</id><published>2009-07-01T10:36:00.001-07:00</published><updated>2009-07-15T10:56:58.764-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Github'/><title type='text'>Installing Rails plugin from Github on Windows</title><content type='html'>One more pain when coding on windows (as if I was born using Unix/Linux etc ;)))... but try installing a plugin -&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;ruby script/plugin install git://github.com/toamitkumar/extra_sanitize.git&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and it will fail with an empty folder.&lt;br /&gt;&lt;br /&gt;After googling found a way -&gt; &lt;a href="http://jamie.ideasasylum.com/2008/08/installing-rails-plugins-with-git-on-windows/"&gt;here&lt;/a&gt; which suggests using &lt;span style="color: rgb(204, 0, 0);"&gt;http&lt;/span&gt; instead of &lt;span style="color: rgb(204, 0, 0);"&gt;git&lt;/span&gt; protocol.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;ruby script/plugin install http://github.com/toamitkumar/extra_sanitize.git&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well this also failed with an empty folder. After hours of struggling found adding a trailing forward slash to the url did the trick.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;ruby script/plugin install http://github.com/toamitkumar/extra_sanitize.git&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It works now....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-7880118853906537609?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/7880118853906537609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=7880118853906537609' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7880118853906537609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7880118853906537609'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/07/installing-rails-plugin-from-github-on.html' title='Installing Rails plugin from Github on Windows'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-5556720583460682303</id><published>2009-06-20T10:38:00.000-07:00</published><updated>2009-07-15T10:57:28.880-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='extra_sanitize'/><title type='text'>Extra Sanitize your models</title><content type='html'>We have been using &lt;a href="http://github.com/look/xss_terminate/tree/master"&gt;xss_sanitize&lt;/a&gt;, which is nicely bundled plugin. You drop it in your Rails application and rest the plugin takes care of protecting from XSS attacks. In our project, we found issues dealing with other special characters like -&gt; microsoft single-double quotes, asterisk, percentage, tilda, angular brackets, question mark etc.&lt;br /&gt;&lt;br /&gt;These characters cause extra pain to handle when they appear in urls. You have to encode/decode them. Rolled out a simple but effective plugin. It does nothing but puts an extra layer of sanitization on top of xss_terminate. Yes it is independent of xss_terminate and you can just use it.&lt;br /&gt;&lt;br /&gt;Check the &lt;a href="http://github.com/toamitkumar/extra_sanitize/tree/master"&gt;project page&lt;/a&gt; for usage.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-5556720583460682303?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/5556720583460682303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=5556720583460682303' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5556720583460682303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5556720583460682303'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/06/extra-sanitize-your-models.html' title='Extra Sanitize your models'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-9196394829459423131</id><published>2009-06-16T19:48:00.000-07:00</published><updated>2009-07-15T10:58:15.676-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='no fixtures'/><category scheme='http://www.blogger.com/atom/ns#' term='factory_girl'/><title type='text'>Factory Girl - fixtures replacement for focussed and readable tests</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Why Factory Girl&lt;/span&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Fixtures separates the data we are testing with actual behavior&lt;/li&gt;&lt;li&gt;Makes tests brittle and you have to look at fixture files to understand the tests, which is certainly not the intent for the tests&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Its painful to have fixtures maintained for each model&lt;/li&gt;&lt;li&gt;You have to keep switching between files to see what fixtures there are, always struggling with dependencies and conflicts&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;How to get started&lt;/span&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;gem install thoughtbot-factory_girl --source http://gems.github.com&lt;/li&gt;&lt;li&gt;Add the following code to your test environment file ---&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;config.gem "thoughtbot-factory_girl", :lib =&gt; "factory_girl", :source =&gt; http://gems.github.com&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Add &lt;span style="color: rgb(153, 0, 0);"&gt;test/factories.rb&lt;/span&gt; if using UnitTesting framework or &lt;span style="color: rgb(153, 0, 0);"&gt;spec/factories.rb&lt;/span&gt; if using Rspec framework. It will be automatically loaded if defined at this location&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Ryan Bates has an excellent screencast @ http://railscasts.com/episodes/158-factories-not-fixtures&lt;/li&gt;&lt;li&gt;Excellent &lt;a href="http://rdoc.info/projects/thoughtbot/factory_girl"&gt;documentation&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-9196394829459423131?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/9196394829459423131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=9196394829459423131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/9196394829459423131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/9196394829459423131'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/06/factory-girl-fixtures-replacement-for.html' title='Factory Girl - fixtures replacement for focussed and readable tests'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-8963481358773332734</id><published>2009-06-06T21:45:00.000-07:00</published><updated>2009-07-15T10:58:36.442-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Github'/><title type='text'>GitHub - growing Social Network for Programmers</title><content type='html'>&lt;a href="http://github.com/" mce_href="http://github.com/"&gt;GitHub&lt;/a&gt; is  Public Open Source &lt;a href="http://git-scm.com/" mce_href="http://git-scm.com/"&gt;Git&lt;/a&gt; repository that's being called "Social  Network" for programmers. Lets understand Git first. &lt;p&gt;&lt;a href="http://git-scm.com/" mce_href="http://git-scm.com/"&gt;Git&lt;/a&gt; is a  &lt;strong&gt;&lt;a href="http://en.wikipedia.org/wiki/Distributed_computing" mce_href="http://en.wikipedia.org/wiki/Distributed_computing"&gt;distributed&lt;/a&gt;  version control system&lt;/strong&gt; co-developed by Linus Torvalds that has speed  and efficiency. Git does away with the idea of a central repository. In Git  every user has a complete copy of the repository data stored locally which makes  accessibility easy and fast even when the n/w is disconnected. This seems  radical to the concept of Subversion or other VCS (Version Control Systems) we  have been using where the central repo has complete history (which makes it slow  and inefficient). Git users have to &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-push.html" mce_href="http://www.kernel.org/pub/software/scm/git/docs/git-push.html"&gt;push&lt;/a&gt;  and &lt;a href="http://www.kernel.org/pub/software/scm/git-core/docs/git-fetch.html" mce_href="http://www.kernel.org/pub/software/scm/git-core/docs/git-fetch.html"&gt;fetch&lt;/a&gt;  changes with each other. If any repository is lost due to system failure only  the changes which were unique to that repository are lost. Once that system  comes up it does push/fetch to update/get the changes. Git is extermely fast for  all operations (except push and fetch), &lt;em&gt;perform a diff, view file history,  commit changes, merge braches, obtain any other revision of file, switch  branches&lt;/em&gt; etc.&lt;/p&gt; &lt;p&gt;GitHub uses Git as a core technology while extending its basic ideas into the  direction of social networking and publication. Everything you do with your  source code on GitHub becomes a Web resource, complete with its own URL. Github  is a pay service but it also offers &lt;a href="http://github.com/plans" mce_href="http://github.com/plans"&gt;free package&lt;/a&gt; which are suitable for many  open source projects. GitHub really comes together for most users when you start  talking about the social features. Every user and project has a profile. For ex:  &lt;a href="http://github.com/toamitkumar" mce_href="http://github.com/toamitkumar"&gt;Amit Kumar&lt;/a&gt; (its me) is my profile  page and &lt;a href="http://github.com/rails/rails/tree/master" mce_href="http://github.com/rails/rails/tree/master"&gt;Ruby on Rails&lt;/a&gt; is  project profile page. The project profile page keeps track of progress and  participation. Both users and projects profile page also have public activity  feeds which display activity on public projects such as commits, comments,  forks, etc. Users can follow specific developers or projects to keep tabs on the  activity.&lt;/p&gt; &lt;p&gt;&lt;a href="http://github.com/guides/home" mce_href="http://github.com/guides/home"&gt;Getting started&lt;/a&gt; with github is very  easy. The &lt;a href="http://github.com/guides/git-screencasts" mce_href="http://github.com/guides/git-screencasts"&gt;screencasts&lt;/a&gt; and &lt;a href="http://github.com/guides/git-podcasts" mce_href="http://github.com/guides/git-podcasts"&gt;podcasts&lt;/a&gt; are wonderful  resources. Getting git and github on &lt;a href="http://github.com/guides/using-git-and-github-for-the-windows-for-newbies" mce_href="http://github.com/guides/using-git-and-github-for-the-windows-for-newbies"&gt;windows&lt;/a&gt;  is a little timetaking but with &lt;a href="http://github.com/guides/using-git-and-github-for-the-windows-for-newbies" mce_href="http://github.com/guides/using-git-and-github-for-the-windows-for-newbies"&gt;msysgit&lt;/a&gt;  latest version has made life easy. Github provides a beautiful of the master code and all the forks. &lt;/p&gt;&lt;img src="http://2.bp.blogspot.com/_81RQieHf_9w/SitGhwjlpsI/AAAAAAAABuo/ETPS9nOTslE/s320/github-fork.JPG" /&gt;&lt;br /&gt;&lt;p&gt;It lets you see everyone else  who’s cloned a particular repo, and what changes they have made. The big benefit  is that this prevents you from re-inventing the wheel when you see that someone  is already working on the same feature you’re trying to submit. Instead of going  and doing your own thing, you fork off of them and work with them. You might  even fork off of a grandchild of the original project just because it has some  feature that you need. It’s like the long tail of open source..you no longer  have to wait for the original author to implement your obscure changes. Just  find what you want out there and work with it. The reciprocal benefit of this,  of course, is that the original author can actually watch your changes as you’re  making them. Instead of some disjointed patches, he sees your commits as you add  them to your own line and can follow your progress visually. At some point, if  the author likes your work he can merge your branch back into his code. And  GitHub will show this on the network, so everyone else who is following the  project can benefit. They’ve made it easy to notify the author that you have  some good changes as well, with the pull request.&lt;/p&gt; &lt;p&gt;Github is growing everyday. &lt;a href="http://en.wikipedia.org/wiki/GitHub" mce_href="http://en.wikipedia.org/wiki/GitHub"&gt;Statistics&lt;/a&gt; say after being  launched in Feb' 08, in one year of being online it accumulated 46, 000 public  repos.&lt;/p&gt; &lt;p&gt;Enjoy collaborating your project on github !!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-8963481358773332734?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/8963481358773332734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=8963481358773332734' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/8963481358773332734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/8963481358773332734'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/06/github-growing-social-network-for.html' title='GitHub - growing Social Network for Programmers'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_81RQieHf_9w/SitGhwjlpsI/AAAAAAAABuo/ETPS9nOTslE/s72-c/github-fork.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3716912462067741819</id><published>2009-05-28T19:04:00.000-07:00</published><updated>2009-07-15T10:59:08.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rspec'/><category scheme='http://www.blogger.com/atom/ns#' term='automation testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Watir'/><title type='text'>Playing with Watir - File Upload/Download component</title><content type='html'>In my last post I talked about &lt;a href="http://rubyizednrailified.blogspot.com/2009/05/playing-with-watir.html"&gt;WATIR integration with Rspec&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In our project, we had excel report download component. The challenge with Watir was to be able to download the excel file, save it and validate data against DB. Thanks to &lt;a href="http://wiki.openqa.org/display/%7Edbrown"&gt;David Brown&lt;/a&gt; for his &lt;a href="http://wiki.openqa.org/display/WTR/Excel+interface+class"&gt;Excel Interface class library&lt;/a&gt; which is easy to implement. Next thing was to be able to save the file at any given location (always). None of the &lt;a href="http://wiki.openqa.org/display/WTR/File+Downloads"&gt;documented&lt;/a&gt; steps worked. The autoit dll supported by Watir was at the rescue. &lt;a href="http://www.autoitscript.com/autoit3/docs/intro/au3spy.htm"&gt;Au3Info.exe&lt;/a&gt; helps to identify IE control IDs. The following code snippet explains the rest:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_81RQieHf_9w/Sh9D0RRbboI/AAAAAAAABuY/9SAwYh94-2k/s1600-h/file_download.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 85px;" src="http://2.bp.blogspot.com/_81RQieHf_9w/Sh9D0RRbboI/AAAAAAAABuY/9SAwYh94-2k/s320/file_download.jpg" alt="" id="BLOGGER_PHOTO_ID_5341062248353459842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After conquering file download, next was file upload. It was much easier coz &lt;a href="http://www.autoitscript.com/autoit3/docs/intro/au3spy.htm"&gt;Au3Info.exe&lt;/a&gt; was always their to figure IE control IDs. Using &lt;a href="http://www.autoitscript.com/autoit3/docs/functions/"&gt;AutoIt documentation&lt;/a&gt; simplified it further.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_81RQieHf_9w/Sh9DvMTExiI/AAAAAAAABuQ/2-TDwQoppvs/s1600-h/file_upload.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 57px;" src="http://2.bp.blogspot.com/_81RQieHf_9w/Sh9DvMTExiI/AAAAAAAABuQ/2-TDwQoppvs/s320/file_upload.jpg" alt="" id="BLOGGER_PHOTO_ID_5341062161118840354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;WATIR rocks !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3716912462067741819?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3716912462067741819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3716912462067741819' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3716912462067741819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3716912462067741819'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/05/playing-with-watir-file-uploaddownload.html' title='Playing with Watir - File Upload/Download component'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_81RQieHf_9w/Sh9D0RRbboI/AAAAAAAABuY/9SAwYh94-2k/s72-c/file_download.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-7170945517505908029</id><published>2009-05-27T07:41:00.000-07:00</published><updated>2009-07-15T10:59:22.654-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='active record'/><title type='text'>Read only models in ActiveRecord</title><content type='html'>I was working in one of my project, where we were required to connect to 2 databases.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First we had access to do CRUD&lt;/li&gt;&lt;li&gt;Second we were only supposed to READ&lt;/li&gt;&lt;/ol&gt;For the second DB we wanted to raise exception from Rails, if somebody by accident tried to create/edit. ActiveRecord has this attribute as part of all models already called &lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002305"&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;@readonly&lt;/span&gt;&lt;/a&gt;. There are definitely few challenges. Here is what I did:&lt;br /&gt;&lt;br /&gt;The sweet model:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_81RQieHf_9w/Sh1rPsSu13I/AAAAAAAABtw/rUdgbpYl-1c/s1600-h/person_model.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 107px;" src="http://4.bp.blogspot.com/_81RQieHf_9w/Sh1rPsSu13I/AAAAAAAABtw/rUdgbpYl-1c/s320/person_model.jpg" alt="" id="BLOGGER_PHOTO_ID_5340542650463213426" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If somebody tries to add a record:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_81RQieHf_9w/Sh1rbePn_2I/AAAAAAAABt4/KnyS-9te4sg/s1600-h/create_person.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 49px;" src="http://4.bp.blogspot.com/_81RQieHf_9w/Sh1rbePn_2I/AAAAAAAABt4/KnyS-9te4sg/s320/create_person.jpg" alt="" id="BLOGGER_PHOTO_ID_5340542852850515810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If someone tries destroy&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_81RQieHf_9w/Sh1roqKRxII/AAAAAAAABuA/AzSlpeOEuhQ/s1600-h/destroy_person.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 26px;" src="http://3.bp.blogspot.com/_81RQieHf_9w/Sh1roqKRxII/AAAAAAAABuA/AzSlpeOEuhQ/s320/destroy_person.jpg" alt="" id="BLOGGER_PHOTO_ID_5340543079387612290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What if someone uses delete&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_81RQieHf_9w/Sh1r3s4hF6I/AAAAAAAABuI/nSK1qIXBIE0/s1600-h/delete_person.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 90px;" src="http://3.bp.blogspot.com/_81RQieHf_9w/Sh1r3s4hF6I/AAAAAAAABuI/nSK1qIXBIE0/s320/delete_person.jpg" alt="" id="BLOGGER_PHOTO_ID_5340543337816463266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Rest in peace !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-7170945517505908029?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/7170945517505908029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=7170945517505908029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7170945517505908029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/7170945517505908029'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/05/read-only-models-in-activerecord.html' title='Read only models in ActiveRecord'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_81RQieHf_9w/Sh1rPsSu13I/AAAAAAAABtw/rUdgbpYl-1c/s72-c/person_model.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3708084762517612555</id><published>2009-05-25T16:32:00.000-07:00</published><updated>2009-07-15T10:59:35.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='automation testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Watir'/><title type='text'>Playing with Watir</title><content type='html'>Past few days I have been playing with using &lt;a href="http://wtr.rubyforge.org/documentation.html"&gt;Watir&lt;/a&gt; in my current project. I bet it has been fun. Watir gives this awesome power for automated testing. Many would argue why not Selenium for that matter. There were few challenges using Selenium:&lt;br /&gt;&lt;table style="width: 381px; height: 374px;" border="4"&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;td  style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Feature&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Watir/Watij&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Selenium&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Frames and popup support&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Easy&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Has problems&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;API for database connectivity&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Easy&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Doesnt have API support&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Multi language (non-ascii character)support&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Easy&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;No&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Recorder&lt;/span&gt;&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Only for FF&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Integration with &lt;a href="http://rspec.info/"&gt;Rspec&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Easy to create a test suite. See example below&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Cross domain support&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Yes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;No&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Ajaxified responses&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Yes&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Difficult&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;One of the fun part was attaching your browser instance to your IRB. The examples &lt;a href="http://wiki.openqa.org/display/WTR/IRB"&gt;here&lt;/a&gt; is self sufficient explanation. If not, then watir-console is theie for rescue.&lt;br /&gt;&lt;br /&gt;Not to forget the Excel Interface Class, which we used to download an excel report (as part of our project) and match the values against DB records.&lt;br /&gt;&lt;br /&gt;The rspec task to run the tests as a suite and also lets you connect to environment specific database:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;desc "Run all watir tests "&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;namespace :spec do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  Spec::Rake::SpecTask.new(:watir) do |t|&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    ENV["WATIR_ENV"] = ENV['env'] ? "#{ENV['env']}" : "development"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    t.spec_files = FileList['test/integration/watir/*_spec.rb']&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;    t.spec_opts = ["-fh &gt; public/watir_results.html"]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;  end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From the command prompt you could run:&lt;br /&gt;&lt;br /&gt;&gt;&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;rake spec:watir&lt;/span&gt; (runs and connects against development database)&lt;br /&gt;&gt;&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;rake spec:watir env=qa&lt;/span&gt; (runs and connects against qa database)&lt;br /&gt;&lt;br /&gt;Lately, a lot of progress has been made on &lt;a href="http://watir-recorder.openqa.org/"&gt;Watir Recorder&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3708084762517612555?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3708084762517612555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3708084762517612555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3708084762517612555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3708084762517612555'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/05/playing-with-watir.html' title='Playing with Watir'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-882862348649299440</id><published>2009-02-12T21:31:00.001-08:00</published><updated>2009-07-15T10:59:54.307-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='unobtrusive'/><title type='text'>Unobtrusive Javascript -&gt; a new paradigm in Javascript Programming Language</title><content type='html'>Current buzzword in the world of Javascript is &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript" title="Unobtrusive Javascript"&gt;unobtrusiveness&lt;/a&gt;&lt;/em&gt;. People who use it frequently make their website accessible, or they want to develop their project using &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Progressive_enhancement"&gt;Progressive Enhancement&lt;/a&gt;&lt;/em&gt;. Lets start by understading each term to make sense by being &lt;em&gt;unobtrusive&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/em&gt; in javascript means &lt;span style="font-size:100%;"&gt;that as many people as possible will have access to the content or functionality of the page even if the Javascript implementation in their browsing device is lacking or nonexistent. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;&lt;em&gt;Progressive Enhacement&lt;/em&gt;&lt;/strong&gt;, is a methodology for building web pages using graceful degradation model - &lt;span style="font-size:100%;"&gt;the intent of making advanced content fail without breaking the rest of the website for less sophisticated browsers. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;In simple terms being unobtrusive is to segregate behavior from structure and  presentation in a HTML document.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_81RQieHf_9w/SZUGz63N7EI/AAAAAAAABoE/ArTVt0av5Qw/s1600-h/web_content_layer.JPG"&gt;&lt;img style="cursor: pointer; width: 320px; height: 142px;" src="http://4.bp.blogspot.com/_81RQieHf_9w/SZUGz63N7EI/AAAAAAAABoE/ArTVt0av5Qw/s320/web_content_layer.JPG" alt="" id="BLOGGER_PHOTO_ID_5302151625342577730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Following unobtrusiveness pattern the code stays clean, easier to read, and more maintainable.&lt;br /&gt;&lt;br /&gt;You people might be thinking what sense or non-sense I am talking about. Lets try and understand it with the simplest example. Lets say we have to create an anchor tag, onclick of which a javascript will be fired to add an item. We are used to writing code like this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;a href="javascript:addItem();" mce_href="javascript:addItem();"&amp;gt;Hit Me!&amp;lt;/a&amp;gt;&lt;/span&gt; ----&amp;gt; &lt;strong&gt;WORST&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;If  javascript is disabled nothing will happen.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;a href="#" onclick="addItem();"&amp;gt;Hit Me!&amp;lt;/a&amp;gt;   &lt;/span&gt;---&amp;gt; &lt;strong&gt;JUST as bad&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;Using inline event handlers is not inherently inaccessible but the href attribute doesn’t lead anywhere so the end result is the same as in the first example.&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&amp;lt;a href="/add_item" onclick="addItem();"&amp;gt;Hit Me!&amp;lt;/a&amp;gt;   &lt;/span&gt;--&amp;gt; &lt;strong&gt;BETTER&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;/strong&gt;Now we have a real target for the anchor, so the link is already fully accessible assuming that the &lt;span style=";font-family:Bitstream Vera Sans Mono,Bitstream Vera Sans Mono;font-size:85%;"  &gt;&lt;span style=";font-family:Bitstream Vera Sans Mono,Bitstream Vera Sans Mono;font-size:85%;"  &gt;add_item &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;URL provides the same functionality as the &lt;/span&gt;&lt;span style=";font-family:Bitstream Vera Sans Mono,Bitstream Vera Sans Mono;font-size:85%;"  &gt;&lt;span style=";font-family:Bitstream Vera Sans Mono,Bitstream Vera Sans Mono;font-size:85%;"  &gt;addItem &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Javascript function does. However, the code is still a mixture of behavior (javascript code) and structure (the HTML).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&amp;lt;a href="/add_item" id="item_link"&amp;gt;Hit Me!&amp;lt;/a&amp;gt;&lt;/span&gt;  +   &lt;span style="color: rgb(51, 51, 255);"&gt;$(‘item_link’).click(function() { addItem();});&lt;/span&gt; (&lt;em&gt;when using Prototype&lt;/em&gt;) &lt;span style="color: rgb(51, 51, 255);"&gt;$('#item_link').click(function() {addItem()}); &lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;em&gt;when using jQuery&lt;/em&gt;) --&amp;gt; &lt;strong&gt;&lt;em&gt;BEST&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now the HTML file takes care of the structure (just as it should), and the behavioral logic is separated into a separate Javascript file. This is both accessible and unobtrusive.&lt;br /&gt;&lt;br /&gt;Welcome to the world of &lt;a href="http://jquery.com/" title="jQuery"&gt;jQuery &lt;/a&gt;one of the most unobtrusive style of Javascript library. One would argue even Prototype is the same. But having used both I can figure out the difference. To list a few:&lt;ul&gt;&lt;li&gt;jQuery has no IE memory leaks&lt;br /&gt;&lt;/li&gt;&lt;li&gt;jQuery supports almost all browser I can call name of (many of the features of prototpe does not work in IE eg: inline-editing)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Method chaining - all native jQuery method support chaining i.e. they return &lt;em&gt;self&lt;/em&gt;. eg: $("div.fadeMeAndThenRemove").fadeOut().addClass("removed");&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;jQuery is being widely used -&amp;gt; Google, mozilla.org, &lt;strong&gt;wordpress.org&lt;/strong&gt;, DELL, digg, NBC, drupal etc... are few names who have moved to using jQuery.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Enjoy being unobtrusive !!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-882862348649299440?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/882862348649299440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=882862348649299440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/882862348649299440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/882862348649299440'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/02/unobtrusive-javascript-new-paradigm-in.html' title='Unobtrusive Javascript -&amp;gt; a new paradigm in Javascript Programming Language'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_81RQieHf_9w/SZUGz63N7EI/AAAAAAAABoE/ArTVt0av5Qw/s72-c/web_content_layer.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-4480399680747356523</id><published>2009-01-07T14:03:00.000-08:00</published><updated>2009-06-16T20:49:10.903-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='table sorter at edge'/><title type='text'>Lightweight Javascript Table Sorter using Prototype</title><content type='html'>The Javascript tablesorter is built on top of Prototype library. The library gives the dynamic feature of row formatting, maintain the sort order of the table on dynamic addition/deletion of a row, default sort order when the page loads, keep one or more columns unsortable, make multiple tables sortable on the same page etc.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_81RQieHf_9w/SWU9hljtshI/AAAAAAAABmM/gAaqYK4OE20/s1600-h/table_sorter.jpeg"&gt;&lt;img style="cursor: pointer; width: 272px; height: 210px;" src="http://3.bp.blogspot.com/_81RQieHf_9w/SWU9hljtshI/AAAAAAAABmM/gAaqYK4OE20/s320/table_sorter.jpeg" alt="" id="BLOGGER_PHOTO_ID_5288700984643400210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Usage:&lt;br /&gt;&lt;br /&gt;* The table should have an id attribute&lt;br /&gt;* It should have thead &gt; tr &gt; th as headers.&lt;br /&gt;* It should have tbody &gt; tr &gt; td as body.&lt;br /&gt;* thead &gt; tr &gt; th[class="integer"] will make the column int sort&lt;br /&gt;* thead &gt; tr &gt; th[class="date"] will make the column date sort&lt;br /&gt;* thead &gt; tr &gt; th[class="float"] will make the column float sort&lt;br /&gt;* thead &gt; tr &gt; th[class=""] will make the column string sort&lt;br /&gt;* thead &gt; tr &gt; th[class="nosort"] will make the column unsortable&lt;br /&gt;* thead &gt; tr &gt; th[class="sort-asc"] will make the column default sort on page load&lt;br /&gt;* sorterId = TableSortObserver.sortableTables[table_id];&lt;br /&gt;sorterId.resort(sorterId.sortIndex, sorterId.sortOrder);&lt;br /&gt;This will resort the table after dynamic addition/deletion of a row. It will    retain the last sort column.&lt;br /&gt;&lt;br /&gt;Initialize:&lt;br /&gt;&lt;br /&gt;* TableSortObserver.bindEventsToTableRow(table_id)&lt;br /&gt;&lt;br /&gt;The TableSortObserver retains all the sortable tables registered on the page. The sorter has been tesetd on IE 5/6, FF 2/3, Chrome, Safari.&lt;br /&gt;&lt;br /&gt;Update: &lt;a href="http://github.com/toamitkumar/dynamic-javascript-sort-with-prototype/tree/master"&gt;Source code&lt;/a&gt; on github&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-4480399680747356523?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/4480399680747356523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=4480399680747356523' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4480399680747356523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/4480399680747356523'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/01/lightweight-javascript-table-sorter.html' title='Lightweight Javascript Table Sorter using Prototype'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_81RQieHf_9w/SWU9hljtshI/AAAAAAAABmM/gAaqYK4OE20/s72-c/table_sorter.jpeg' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-5268964155757527718</id><published>2009-01-07T12:19:00.000-08:00</published><updated>2009-07-15T11:00:28.948-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex file upload'/><category scheme='http://www.blogger.com/atom/ns#' term='fileupload'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Flex + Rails = Flexible Rails -&gt; Rich Internet Applications</title><content type='html'>The wave started in 2007 when Simeon Bateman presented Building Rich Internet Applications with Flex and Ruby on Rails @ &lt;a href="http://conferences.oreillynet.com/cs/railseurope2007/view/e_sess/14234"&gt;Rails Euro Conf&lt;/a&gt;. Both Rails and Flex are two great tools to quickly develop nice looking and compelling applications.&lt;br /&gt;&lt;br /&gt;For those who don't know Rails -&gt; Type Ruby on Rails on google and the &lt;a href="http://rubyonrails.org/"&gt;result&lt;/a&gt; will overwhelm you :)&lt;br /&gt;&lt;br /&gt;Quick introduction to &lt;a href="http://labs.adobe.com/wiki/index.php/Flex_3"&gt;Flex&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt; * Flex is cross platform development framework for creating RIAs, Desktop applications&lt;br /&gt; * It is component based. Coding is done in MXML (Macromedia XML), ActionScript 3 (Object Oriented, Strongly type)&lt;br /&gt; * Flex Builder and SDK are used for design and code view&lt;br /&gt; * Flex 3 framework is Open Source&lt;br /&gt; * Compiles in swf file which runs in Flash Player ref in HTML page&lt;br /&gt; * Support RESTful API&lt;br /&gt;&lt;br /&gt;A typical communication that happens between Rails and Flex component:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_81RQieHf_9w/SWUOkyv9DLI/AAAAAAAABl4/4V2Tgx2smJg/s1600-h/flexnrails.JPG"&gt;&lt;img style="cursor: pointer; width: 320px; height: 295px;" src="http://4.bp.blogspot.com/_81RQieHf_9w/SWUOkyv9DLI/AAAAAAAABl4/4V2Tgx2smJg/s320/flexnrails.JPG" alt="" id="BLOGGER_PHOTO_ID_5288649362677501106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Worldwide ubiquity of &lt;a href="http://www.adobe.com/products/player_census/flashplayer/version_penetration.html"&gt;Adobe Flash Player&lt;/a&gt; 9 Sept-08 -&gt; 89.4%.&lt;br /&gt;&lt;br /&gt;Recently published book by &lt;a href="http://manning.com/armstrong/"&gt;Peter Armstrong&lt;/a&gt; (Manning Publication co.), explains the seamless integration through RESTful APIs. Another &lt;a href="http://www.amazon.com/Flex-Rails-Building-Applications-Developers/dp/0321543378"&gt;one&lt;/a&gt; is talks about why Flex is better than using Javascript and CSS.&lt;br /&gt;&lt;br /&gt;In our project we were looking for a component to bulk upload documents (always painful). Flex gave the power to bulk upload documents and integration with Rails was pretty straightforward. &lt;a href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html#browse%28%29"&gt;browse()&lt;/a&gt; and &lt;a href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html#upload%28%29"&gt;upload()&lt;/a&gt; method of &lt;a href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html#FileReference%28%29"&gt;FileReference&lt;/a&gt; class does the whole magic.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Wanna Test the Flex Component ?&lt;/span&gt;&lt;br /&gt;For geeks who like to test every piece of code they write Flex 3 provides &lt;a href="http://code.google.com/p/as3flexunitlib/"&gt;FlexUnit&lt;/a&gt;, a unit testing framework for Flex and ActionScript 3.0 which mimics JUnit and comes with graphical test runner.&lt;br /&gt;&lt;br /&gt;The beautiful flex component:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_81RQieHf_9w/SWUO6ClCmcI/AAAAAAAABmA/ih7H0MwaR5Q/s1600-h/flex.JPG"&gt;&lt;img style="cursor: pointer; width: 320px; height: 102px;" src="http://2.bp.blogspot.com/_81RQieHf_9w/SWUO6ClCmcI/AAAAAAAABmA/ih7H0MwaR5Q/s320/flex.JPG" alt="" id="BLOGGER_PHOTO_ID_5288649727703947714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Wanna try the power of Rails combined with the flexibility of Flex ??&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Code to come shortly&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-5268964155757527718?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/5268964155757527718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=5268964155757527718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5268964155757527718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5268964155757527718'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2009/01/flex-rails-flexible-rails-rich-internet.html' title='Flex + Rails = Flexible Rails -&amp;gt; Rich Internet Applications'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_81RQieHf_9w/SWUOkyv9DLI/AAAAAAAABl4/4V2Tgx2smJg/s72-c/flexnrails.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-5673870250345103246</id><published>2008-12-02T18:32:00.000-08:00</published><updated>2008-12-02T20:27:38.371-08:00</updated><title type='text'>URLEncrypt rolled out as plugin on Github</title><content type='html'>In my last &lt;a href="http://rubyizednrailified.blogspot.com/2008/07/encryptingdecrypting-primary-key.html"&gt;post&lt;/a&gt; I talked about encrypting RESTful urls when we have to expose primary key in the URL. The plugin is generic and exposes handy methods.&lt;br /&gt;&lt;br /&gt;Repository:&lt;br /&gt;http://github.com/toamitkumar/url_encrypt/tree/master&lt;br /&gt;&lt;br /&gt;Installation:&lt;br /&gt;.scirpt/plugin install git://github.com/toamitkumar/url_encrypt.git&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;&lt;pre&gt;Add the following line to your environment.rb file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-weight: bold;"&gt;UrlEncrypt.encryptors("abcdefghijklmnop", "mnbkjhkhkhkhkhkjhkjh") &lt;/span&gt;&lt;br /&gt;#so that KEY and IV for Cipher encryption are different&lt;br /&gt;&lt;br /&gt;OR&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-weight: bold;"&gt;UrlEncrypt.encryptors("abcdefghijklmnop") &lt;/span&gt;&lt;br /&gt;# so that KEY and IV for Cipher encryption are same&lt;br /&gt;&lt;br /&gt;OR&lt;br /&gt;&lt;br /&gt;NOTHING&lt;br /&gt;&lt;br /&gt;Inside your model add the line:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;class Book &lt; &lt;/span&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;ActiveRecord::Base&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;  column :id, :integer&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;  column :title, :string&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;  &lt;span style="font-weight: bold;"&gt;encrypted :with =&gt; :title&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;end&lt;br /&gt;&lt;br /&gt;You have handy methods:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="text-align: left; color: rgb(204, 204, 204);"&gt;&lt;pre&gt;Book.find_by_encrypted_title('encrypted string')&lt;br /&gt;&lt;br /&gt;Book.find_by_encrypted_title('encrypted string',&lt;br /&gt;  :conditions =&gt; ["any other condition can go here"])&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Next step: To roll out the plugin as JRuby.&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-5673870250345103246?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/5673870250345103246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=5673870250345103246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5673870250345103246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/5673870250345103246'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2008/12/urlencrypt-rolled-as-plugin-on-github.html' title='URLEncrypt rolled out as plugin on Github'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-988037919822410384</id><published>2008-10-08T09:20:00.000-07:00</published><updated>2008-10-08T09:35:36.817-07:00</updated><title type='text'>Undefined method "updated?"</title><content type='html'>&lt;span style="font-family:verdana;"&gt;I was juggling around to find out the cause. I kept on getting error:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;NoMethodError (undefined method `updated?' for #&lt;person:0x42b64e4&gt;): /vendor/rails/activerecord/lib/active_record/attribute_methods.rb:251:in `method_missing' /vendor/rails/activerecord/lib/active_record/associations.rb:907:in `belongs_to_before_save_for_person' /vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `send' /vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `evaluate_method' /vendor/rails/activesupport/lib/active_support/callbacks.rb:161:in `call' /vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run' /vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each' /vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send' /vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run' /vendor/rails/activesupport/lib/active_support/callbacks.rb:272:in `run_callbacks' /vendor/rails/activerecord/lib/active_record/callbacks.rb:298:in `callback' /vendor/rails/activerecord/lib/active_record/callbacks.rb:206:in `create_or_update' /vendor/rails/activerecord/lib/active_record/base.rb:2200:in `save_without_validation' /vendor/rails/activerecord/lib/active_record/validations.rb:901:in `save_without_dirty' /vendor/rails/activerecord/lib/active_record/dirty.rb:75:in `save_without_transactions'&lt;/span&gt;&lt;/person:0x42b64e4&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;I have 2 models Person and Rate with&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#6633ff;"&gt;&lt;span style="font-family:Verdana;"&gt;class Person&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&amp;nbsp;&amp;nbsp;has_many :rates&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;class Rate&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&amp;nbsp;&amp;nbsp;belongs_to :person&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;?xml:namespace prefix = person /&gt;&lt;person:0x42b64e4&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;On create/update of person or rate, I kept on getting the error. After deep digging I found the cause of the issue.&lt;br /&gt;&lt;br /&gt;In my Rate model, I was creating a @person object. The association (belongs_to, has_many etc..) calls before_save callback for associated model. Since I created a new @person object in my Rate class, it was calling 'updated?' for new object and hence NoMethodError.&lt;br /&gt;&lt;br /&gt;I renamed the @person object and resolved the issue.&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/person:0x42b64e4&gt;&lt;person:0x42b64e4&gt;&lt;br /&gt;&lt;/person:0x42b64e4&gt;&lt;person:0x42b64e4&gt;&lt;/person:0x42b64e4&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-988037919822410384?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/988037919822410384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=988037919822410384' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/988037919822410384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/988037919822410384'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2008/10/undefined-method-updated.html' title='Undefined method &quot;updated?&quot;'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-3730253785358310252</id><published>2008-07-29T20:05:00.000-07:00</published><updated>2009-07-15T11:00:48.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='url_encrypt'/><title type='text'>Encrypting/Decrypting primary key appearing in the URL</title><content type='html'>I paid a small cost for being RESTful.&lt;br /&gt;&lt;br /&gt;As RESTful suggests, the GET request will always have the primary key in the URL like: http://somesite.com/somecontroller/123/edit&lt;br /&gt;&lt;br /&gt;In the app we have role based access and only admins have access to edit. We made sure that the application is protected and only admins can update an existing record. The so called Security had a different perspective. They were not willing to expose the id(=123). The solution was to encrypt the id.&lt;br /&gt;&lt;br /&gt;I came across a good blog &lt;a href="http://jroller.com/obie/entry/seo_optimization_of_urls_in"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Following the same concept:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I added a &lt;span style="color: rgb(255, 153, 255);"&gt;EncryptDecryptHelper &lt;/span&gt;module inside my lib directory. The module has 2 methods.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;encrypt &lt;/span&gt;-&gt; used &lt;span style="color: rgb(255, 153, 255);"&gt;OpenSSl Cipher RC4&lt;/span&gt; digest and Base64 encoding of the string for an  already defined KEY and IV&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;decrypt &lt;/span&gt;-&gt; used the same KEY and IV to decode the string&lt;/li&gt;&lt;li&gt;Included the module inside my model and over-ride &lt;span style="font-style: italic; color: rgb(255, 153, 255);"&gt;to_param&lt;/span&gt; to encrypt the primary key.&lt;/li&gt;&lt;li&gt;Added a before filter method on the application controller to decrypt the primary key.Made sure we are passing objects instead of id while creating links eg:-&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;   Do:&lt;/li&gt;&lt;/ul&gt;                    &lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(255, 153, 255); font-style: italic;"&gt;&lt;%= link_to 'city', :controller=&gt;'cities',:action=&gt;'show',:id =&gt; @city %&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;                      Instead of:&lt;br /&gt;&lt;br /&gt;                   &lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(153, 51, 153); font-style: italic;"&gt;&lt;%= link_to 'city', :controller=&gt;'cities',:action=&gt;'show',:id =&gt; @city.id %&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The security team is happy now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-3730253785358310252?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/3730253785358310252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=3730253785358310252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3730253785358310252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/3730253785358310252'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2008/07/encryptingdecrypting-primary-key.html' title='Encrypting/Decrypting primary key appearing in the URL'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4911618396957689392.post-407282426594855045</id><published>2008-07-06T18:04:00.000-07:00</published><updated>2008-07-06T18:46:55.092-07:00</updated><title type='text'>Remove rake tasks</title><content type='html'>Ever tried over-riding rake task ?&lt;br /&gt;&lt;br /&gt;I tried to over-ride and I found that the default always gets called after your implementaion.&lt;br /&gt;&lt;br /&gt;Here is what I tried doing:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;namespace :db do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;namespace :test do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;task :prepare do |t|&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;puts "Skipping Preparing database for Oracle"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But the default &lt;span style="color: rgb(204, 102, 204);"&gt;db:test:prepare&lt;/span&gt; was always getting called.&lt;br /&gt;&lt;br /&gt;To solve the probelm:&lt;br /&gt;&lt;br /&gt;Inside your Rakefile just below you require the rake modules put the following code.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;Rake::TaskManager.class_eval do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;def remove_task(task_name)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@tasks.delete(task_name.to_s)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;def remove_task(task_name)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&amp;nbsp;&amp;nbsp;Rake.application.remove_task(task_name)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;remove_task 'db:test:prepare'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204); font-style: italic;"&gt;namespace :db do&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(204, 102, 204); font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;namespace :test do    &lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(204, 102, 204); font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;task :prepare do |t|&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: rgb(204, 102, 204); font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;puts "Skipping Preparing database for Oracle"&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: rgb(204, 102, 204); font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(204, 102, 204); font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;&lt;span style="font-style: italic;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Voila, the italicized code to override the default rake tasks worked.&lt;br /&gt;&lt;br /&gt;Hope this helps !!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4911618396957689392-407282426594855045?l=rubyizednrailified.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyizednrailified.blogspot.com/feeds/407282426594855045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4911618396957689392&amp;postID=407282426594855045' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/407282426594855045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4911618396957689392/posts/default/407282426594855045'/><link rel='alternate' type='text/html' href='http://rubyizednrailified.blogspot.com/2008/07/remove-rake-tasks.html' title='Remove rake tasks'/><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/07178616519676182700</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-y0zGSn2u1n0/TYPV0DrPbTI/AAAAAAAAEN8/R5E540e3RF0/s220/n778403622_2856068_5656569.jpg'/></author><thr:total>6</thr:total></entry></feed>
