<?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-26100023</id><updated>2012-02-01T01:00:31.786+05:30</updated><category term='ruby'/><category term='send'/><category term='xml'/><category term='yahoo'/><category term='basic'/><category term='How to use Capistrano'/><category term='dtd'/><category term='mongrel'/><category term='html'/><category term='validations'/><category term='Rails'/><category term='object'/><category term='ror'/><category term='64bit'/><category term='mp3info'/><category term='UJS'/><category term='xslt'/><category term='xhtml'/><category term='error'/><category term='learn'/><category term='ide'/><category term='RJS'/><category term='google'/><category term='patch'/><title type='text'>Impossible is Impossible</title><subtitle type='html'>Imagination is more important than knowledge.

Dont try to solve problems by using the same kind of thinking you used when you created them.

If you are failing to plan,
you are planning to fail.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-26100023.post-8165811472488471337</id><published>2009-08-31T23:13:00.000+05:30</published><updated>2009-08-31T23:17:56.214+05:30</updated><title type='text'>creating images from unicode text using rmagick</title><content type='html'>To create images from the unicode text, we can use the "encoding" method for the Draw object. &lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;require "RMagick"&lt;br /&gt;&lt;br /&gt;def show_textimg&lt;br /&gt; bg = Magick::Image.new(120,20){self.background_color = "#9E9E9E"}&lt;br /&gt; text = Magick::Draw.new&lt;br /&gt; text.encoding = "Unicode"&lt;br /&gt; text.text(23,14,"ドの半角⇔全角")&lt;br /&gt; text.draw(bg)&lt;br /&gt; bg.write "#{RAILS_ROOT}/public/images/text.jpg"&lt;br /&gt;end&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-8165811472488471337?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/8165811472488471337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=8165811472488471337' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/8165811472488471337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/8165811472488471337'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2009/08/creating-images-from-unicode-text-using.html' title='creating images from unicode text using rmagick'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-8957743964066187893</id><published>2008-01-28T14:58:00.000+05:30</published><updated>2008-01-28T15:03:24.876+05:30</updated><title type='text'>Top Ten Mistakes in Web Design</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Top Ten Mistakes in Web Design&lt;/span&gt;  &lt;blockquote style="background-color: rgb(255, 255, 221);"&gt; &lt;strong&gt;Summary:&lt;/strong&gt;&lt;br /&gt;The ten most egregious offenses against users. Web design disasters and HTML horrors are legion, though many usability atrocities are less common than they used to be. &lt;/blockquote&gt;  &lt;p&gt; &lt;img src="http://www.useit.com/alertbox/20021223_02_mistake.gif" style="float: right; padding-left: 2ex; padding-top: 3ex; padding-bottom: 4ex;" alt="Cartoon - Man searching for 'Honalulu' and getting no results. - Woman: 'Oh, forget it. Let's just go visit my mother in Fargo.'" height="449" width="340" /&gt;  &lt;/p&gt;&lt;h2&gt;1. Bad Search&lt;/h2&gt;Overly literal search engines reduce usability in that they're unable to handle typos, plurals, hyphens, and other variants of the query terms. Such search engines are &lt;a href="http://www.useit.com/alertbox/20020428.html" title="Alertbox: Usability for Senior Citizens" class="old"&gt;particularly difficult for elderly users&lt;/a&gt;, but they hurt everybody. &lt;p&gt; A related problem is when search engines prioritize results purely on the basis of how many query terms they contain, rather than on each document's importance. Much better if your search engine calls out "best bets" at the top of the list -- especially for important queries, such as the names of your products. &lt;/p&gt;&lt;p&gt; Search is the user's lifeline when navigation fails. Even though advanced search can sometimes help, &lt;a href="http://www.useit.com/alertbox/20010513.html" title="Alertbox: Search: Visible and Simple" class="old"&gt;simple search usually works best&lt;/a&gt;, and search should be presented as a simple box, since that's what users are looking for.  &lt;/p&gt;&lt;h2&gt;2. PDF Files for Online Reading&lt;/h2&gt;Users hate coming across a PDF file while browsing, because it breaks their flow. Even simple things like printing or saving documents are difficult because standard browser commands don't work. Layouts are often optimized for a sheet of paper, which rarely matches the size of the user's browser window. Bye-bye smooth scrolling. Hello tiny fonts. &lt;p&gt; Worst of all, PDF is an undifferentiated blob of content that's hard to navigate. &lt;/p&gt;&lt;p&gt;PDF is great for printing and for distributing manuals and other big documents that need to be printed. Reserve it for this purpose and convert any information that needs to be browsed or read on the screen into real web pages. &lt;/p&gt;&lt;p&gt; &lt;span class="cssSmallGray"&gt;&gt;&lt;/span&gt; Detailed discussion of why &lt;a href="http://www.useit.com/alertbox/20030714.html" title="Alertbox: PDF: Unfit for Human Consumption"&gt;PDF is bad for online reading&lt;/a&gt;  &lt;/p&gt;&lt;h2&gt;3. Not Changing the Color of Visited Links&lt;/h2&gt;A good grasp of past navigation helps you understand your current location, since it's the culmination of your journey. Knowing your past and present locations in turn makes it easier to decide where to go next. Links are a key factor in this navigation process. Users can exclude links that proved fruitless in their earlier visits. Conversely, they might revisit links they found helpful in the past. &lt;p&gt; Most important, knowing which pages they've already visited frees users from unintentionally revisiting the same pages over and over again. &lt;/p&gt;&lt;p&gt;These benefits only accrue under one important assumption: that users can tell the difference between visited and unvisited links because the site shows them in different colors. When visited links don't change color, users exhibit more navigational disorientation in usability testing and unintentionally revisit the same pages repeatedly. &lt;/p&gt;&lt;p&gt; &lt;span class="cssSmallGray"&gt;&gt;&lt;/span&gt; &lt;a href="http://www.useit.com/alertbox/20040503.html" title="Alertbox: Change the Color of Visited Links"&gt;Usability implications of changing link colors&lt;/a&gt;&lt;br /&gt;&lt;span class="cssSmallGray"&gt;&gt;&lt;/span&gt; &lt;a href="http://www.useit.com/alertbox/20040510.html" title="Alertbox: Guidelines for Visualizing Links"&gt;Guidelines for showing links&lt;/a&gt;   &lt;img src="http://www.useit.com/alertbox/20021223_05_mistake.gif" alt="Cartoon - guy being crushed under wordy 'terms and conditions' legalese" style="float: right; padding-left: 2ex; padding-top: 3ex; padding-bottom: 4ex;" height="450" width="340" /&gt;  &lt;/p&gt;&lt;h2&gt;4. Non-Scannable Text&lt;/h2&gt;  A wall of text is deadly for an interactive experience. Intimidating. Boring. Painful to read. &lt;p&gt; &lt;a href="http://www.useit.com/papers/webwriting/" title="Research on writing for the Web based on how people read online" class="old"&gt;Write for online&lt;/a&gt;, not print. To draw users into the text and support scannability, use well-documented tricks: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;subheads &lt;/li&gt;&lt;li&gt;bulleted lists &lt;/li&gt;&lt;li&gt;&lt;strong&gt;highlighted keywords&lt;/strong&gt; &lt;/li&gt;&lt;li&gt;short paragraphs &lt;/li&gt;&lt;li&gt;the inverted pyramid &lt;/li&gt;&lt;li&gt;a simple writing style, and  &lt;/li&gt;&lt;li&gt;de-fluffed language devoid of marketese. &lt;/li&gt;&lt;/ul&gt;  &lt;p&gt; &lt;span class="cssSmallGray"&gt;&gt;&lt;/span&gt; &lt;a href="http://www.useit.com/alertbox/reading_pattern.html" title="Alertbox: F-Shaped Pattern For Reading Web Content"&gt;Eyetracking of reading patterns&lt;/a&gt;   &lt;/p&gt;&lt;h2&gt;5. Fixed Font Size&lt;/h2&gt; CSS style sheets unfortunately give websites the power to disable a Web browser's "change font size" button and specify a fixed font size. About 95% of the time, this fixed size is &lt;em&gt;tiny&lt;/em&gt;, reducing readability significantly for most people over the age of 40. &lt;p&gt; Respect the user's preferences and let them &lt;a href="http://www.useit.com/alertbox/20020819.html" title="Alertbox: Let Users Control Font Size" class="old"&gt;resize text&lt;/a&gt; as needed. Also, specify font sizes in relative terms -- not as an absolute number of pixels.   &lt;/p&gt;&lt;h2&gt;6. Page Titles With Low Search Engine Visibility&lt;/h2&gt; Search is the most important way users discover websites. Search is also one of the most important ways users find their way around individual websites. The humble page title is your main tool to attract new visitors from search listings and to help your existing users to locate the specific pages that they need. &lt;p&gt;&lt;title&gt; tag and is almost always used as the clickable headline for listings on search engine result pages (SERP). Search engines typically show the first 66 characters or so of the title, so it's truly &lt;/title&gt;The page title is contained within the HTML &lt;a href="http://www.useit.com/alertbox/980906.html" title="Alertbox: Microcontent - How to Write Headlines, Page Titles, and Subject Lines" class="old"&gt;microcontent&lt;/a&gt;.  &lt;/p&gt;&lt;p&gt; Page titles are also used as the default entry in the Favorites when users bookmark a site. For your homepage, begin the with the company name, followed by a brief description of the site. Don't start with words like "The" or "Welcome to" unless you want to be alphabetized under "T" or "W." &lt;/p&gt;&lt;p&gt;For other pages than the homepage, start the title with a few of the most salient information-carrying words that describe the specifics of what users will find on that page. Since the page title is used as the window title in the browser, it's also used as the label for that window in the taskbar under Windows, meaning that advanced users will move between multiple windows under the guidance of the first one or two words of each page title. If all your page titles start with the same words, you have severely reduced usability for your multi-windowing users. &lt;/p&gt;&lt;p&gt; &lt;a href="http://www.useit.com/alertbox/20010722.html" title="Alertbox: Tagline Blues: What's the Site About?"&gt;Taglines on homepages&lt;/a&gt; are a related subject: they also need to be short and quickly communicate the purpose of the site.  &lt;/p&gt;&lt;h2&gt;7. Anything That Looks Like an Advertisement&lt;/h2&gt;  &lt;strong&gt;Selective attention&lt;/strong&gt; is very powerful, and Web users have learned to stop paying attention to any ads that get in the way of their goal-driven navigation. (The main exception being &lt;a href="http://www.useit.com/alertbox/20030428.html" title="Alertbox: Will Plain-Text Ads Continue to Rule?"&gt;text-only search-engine ads&lt;/a&gt;.) &lt;p&gt; Unfortunately, users also &lt;a href="http://www.useit.com/alertbox/fancy-formatting.html" title="Alertbox: Fancy Formatting, Fancy Words = Looks Like a Promotion = Ignored" class="old"&gt;ignore legitimate design elements that look like&lt;/a&gt; prevalent forms of advertising. After all, when you &lt;em&gt;ignore&lt;/em&gt; something, you don't study it in detail to find out what it is. &lt;/p&gt;&lt;p&gt; Therefore, it is best to avoid any designs that look like advertisements. The exact implications of this guideline will vary with new forms of ads;  currently follow these rules: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.useit.com/alertbox/banner-blindness.html" title="Alertbox: Banner Blindness - Old and New Findings" class="old"&gt;&lt;strong&gt;banner blindness&lt;/strong&gt;&lt;/a&gt; means that users never fixate their eyes on anything that looks like a banner ad due to  shape or position on the page &lt;/li&gt;&lt;li&gt;&lt;strong&gt;animation avoidance&lt;/strong&gt; makes users ignore areas with blinking or flashing text or other aggressive animations &lt;/li&gt;&lt;li&gt;&lt;strong&gt;pop-up purges&lt;/strong&gt; mean that users close pop-up windoids before they have even fully rendered; sometimes with great viciousness (a sort of getting-back-at-GeoCities triumph). &lt;/li&gt;&lt;/ul&gt;   &lt;h2&gt;8. Violating Design Conventions&lt;/h2&gt;  &lt;strong&gt;Consistency&lt;/strong&gt; is one of the most powerful usability  principles: when things always behave the same, users don't have to worry about what will happen. Instead, they &lt;em&gt;know&lt;/em&gt; what will happen based on earlier experience. Every time you release an apple over Sir  Isaac Newton, it will drop on his head. That's &lt;em&gt;good&lt;/em&gt;.  &lt;p&gt; The more users' expectations prove right, the more they will feel in control  of the system and the more they will like it. And the more the system breaks users' expectations, the more they will feel insecure. Oops, maybe if I let go of this apple, it will turn into a tomato and jump a mile into the sky. &lt;/p&gt;&lt;p&gt; &lt;strong&gt;Jakob's Law of the Web User Experience&lt;/strong&gt; states that "users spend most of their time on &lt;em&gt;other&lt;/em&gt; websites." &lt;/p&gt;&lt;p&gt; This means that they form their expectations for your site based on what's commonly done on most other sites. If you deviate, your site will be harder to use and users will leave. &lt;/p&gt;&lt;h2&gt;9. Opening New Browser Windows&lt;/h2&gt;  Opening up new browser windows is like a vacuum cleaner sales person who starts a visit by emptying an ash tray on the customer's carpet. Don't pollute my screen with any more windows, thanks (particularly since current operating systems have miserable window management). &lt;p&gt; Designers open new browser windows on the theory that it keeps users on their site. But even disregarding the &lt;strong&gt;user-hostile message implied in taking over the user's machine&lt;/strong&gt;, the strategy is self-defeating since it disables the &lt;em&gt;Back&lt;/em&gt; button which is the normal way users return to previous sites. Users often don't notice that a new window has opened, especially if they  are using a small monitor where the windows are maximized to fill up the  screen. So a user who tries to return to the origin will be confused by a grayed out &lt;em&gt;Back&lt;/em&gt; button. &lt;/p&gt;&lt;p&gt;Links that don't behave as expected undermine users' understanding of their own system. A link should be a simple hypertext reference that replaces the current page with new content. Users hate unwarranted pop-up windows. When they want the destination to appear in a new page, they can use their browser's "open in new window" command -- assuming, of course, that the link is not a piece of code that interferes with the browser’s standard behavior. &lt;img src="http://www.useit.com/alertbox/20021223_01_mistake.gif" style="float: right; padding-left: 2ex; padding-top: 3ex; padding-bottom: 4ex;" alt="Cartoon - woman (at car  dealership): 'How much is it with automatic transmission?' - sleazy salesman: 'I'll give you a hint - it's an EVEN number...'" height="450" width="340" /&gt;  &lt;/p&gt;&lt;h2&gt;10. Not Answering Users' Questions&lt;/h2&gt;Users are highly goal-driven on the Web. They visit sites because there's something they want to accomplish -- maybe even buy your product. The ultimate failure of a website is to fail to provide the information users are looking for. &lt;p&gt;Sometimes the answer is simply not there and you lose the sale because users have to assume that your product or service doesn't meet their needs if you don't tell them the specifics. Other times the specifics are buried under a thick layer of marketese and bland slogans. Since users don't have time to read everything, such hidden info might almost as well not be there. &lt;/p&gt;&lt;p&gt; The worst example of not answering users' questions is to &lt;strong&gt;avoid listing the price&lt;/strong&gt; of products and services.  No B2C ecommerce site would make this mistake, but it's rife in &lt;a href="http://www.useit.com/alertbox/b2b.html" title="Alertbox: Business-to-business website usability" class="old"&gt;B2B&lt;/a&gt;, where most "enterprise solutions" are presented so that you can't tell whether they are suited for 100 people or 100,000 people. Price is the most specific piece of info customers use to understand the nature of an offering, and not providing it makes people feel lost and reduces their understanding of a product line. We have miles of videotape of users asking &lt;em&gt;"Where's the price?"&lt;/em&gt; while tearing their hair out. &lt;/p&gt;&lt;p&gt; Even B2C sites often make the associated mistake of forgetting prices in product lists, such as &lt;a href="http://www.nngroup.com/reports/ecommerce/categorypages.html" title="Nielsen Norman Group report: 28 Design Guidelines for Category Pages on e-commerce sites" class="old"&gt;category pages&lt;/a&gt; or &lt;a href="http://www.nngroup.com/reports/ecommerce/search.html" title="Nielsen Norman Group report: 29 Design Guidelines for Search" class="old"&gt;search results&lt;/a&gt;. Knowing the price is key in both situations; it lets users differentiate among products and click through to the most relevant ones.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Source : http://www.useit.com/alertbox/9605.html&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-8957743964066187893?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/8957743964066187893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=8957743964066187893' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/8957743964066187893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/8957743964066187893'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2008/01/top-ten-mistakes-in-web-design.html' title='Top Ten Mistakes in Web Design'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2528869318912931162</id><published>2008-01-04T11:55:00.000+05:30</published><updated>2008-01-04T11:56:34.259+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='send'/><title type='text'>'send' in Ruby</title><content type='html'>&lt;h4&gt;send&lt;/h4&gt; &lt;p&gt; Calling a method when method name is stored as a string object in a variable i.e. you can not see which method to call. &lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;strong&gt;example 1&lt;/strong&gt;&lt;br /&gt;when method name is simply stored as a String object &lt;/p&gt; &lt;div&gt; &lt;ol&gt;&lt;li&gt;class C     &lt;/li&gt;&lt;li&gt;   def wish  &lt;/li&gt;&lt;li&gt;     p "hello world"  &lt;/li&gt;&lt;li&gt;   end  &lt;/li&gt;&lt;li&gt; end  &lt;/li&gt;&lt;li&gt; a = "wish"  &lt;/li&gt;&lt;li&gt; c  = C.new   &lt;/li&gt;&lt;li&gt; c.send(a)  &lt;/li&gt;&lt;/ol&gt; &lt;/div&gt; &lt;p&gt; &lt;strong&gt;example 2&lt;/strong&gt;&lt;br /&gt;making set method at runtime &lt;/p&gt; &lt;div&gt; &lt;ol&gt;&lt;li&gt;class C  &lt;/li&gt;&lt;li&gt;  attr_accessor :name  &lt;/li&gt;&lt;li&gt;end  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;c = C.new  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;a = "name"  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;c.send(a + "=", "Arun")  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;p c.send(a)  &lt;/li&gt;&lt;/ol&gt; &lt;/div&gt; &lt;p&gt; &lt;strong&gt;example 3&lt;/strong&gt;&lt;br /&gt;this is interesting, when attribute name itself is &lt;strong&gt;send&lt;/strong&gt; &lt;/p&gt; &lt;div&gt; &lt;ol&gt;&lt;li&gt;class C  &lt;/li&gt;&lt;li&gt;  attr_accessor :send  &lt;/li&gt;&lt;li&gt;end  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;c = C.new  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;a = "send"  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;c.__send__(a + "=", "Arun")  &lt;/li&gt;&lt;li&gt;  &lt;br /&gt;&lt;/li&gt;&lt;li&gt;p c.__send__(a) # =&gt; Arun  &lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-2528869318912931162?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2528869318912931162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2528869318912931162' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2528869318912931162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2528869318912931162'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2008/01/send-in-ruby.html' title='&apos;send&apos; in Ruby'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-7047469737063881804</id><published>2007-11-29T15:10:00.001+05:30</published><updated>2007-11-29T15:10:48.047+05:30</updated><title type='text'>Difference between Strings and Symbols in Ruby</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:130%;"&gt;&lt;span style="font-size: 14pt;"&gt;Symbols  have two nice properties compared to strings which can save you memory and &lt;span class="caps"&gt;CPU&lt;/span&gt; time:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;h4&gt;&lt;b&gt;&lt;span style="font-family:Times New Roman;font-size:100%;color:blue;"&gt;&lt;span style="font-size: 12pt; color: blue;"&gt;Memory&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;For every  unique string value, there is a unique symbol object. Three strings with the  same value can use up to three times the memory of three symbols with the same  value. This is because those three symbols are actually the same  object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p "blah".object_id #=&gt; -605600196&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p "blah".object_id #=&gt; -605618816&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p "blah".object_id #=&gt; -605637168&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p :blah.object_id #=&gt; 4071694&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p :blah.object_id #=&gt; 4071694&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p :blah.object_id #=&gt; 4071694&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p "blah".to_sym.object_id #=&gt; 4071694&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p "blah".to_sym.object_id #=&gt; 4071694&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;p "blah".to_sym.object_id #=&gt; 4071694&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;b&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-weight: bold; font-size: 10pt;"&gt;I think now you can understand&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;b&gt;&lt;span style="font-weight: bold;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Symbol  objects are created on-demand behind the scenes for new unique string values.  Once a symbol exists for a particular string value, it will continue to be used  for that value rather than creating more symbols for  it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Of course,  this has a disadvantage: Ruby keeps symbols around forever (well, until the end  of your program anyway), in case they are needed  again.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;That’s fine  if the number of unique symbols is relatively small and you expect to keep  reusing them. However, if you have an unlimited number of string values, and/or  you only use each one briefly (for example, lines arriving on an input stream),  symbols are not the tool for you. You’ll just use up all your  memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;h4&gt;&lt;span class="caps"&gt;&lt;b&gt;&lt;span style="font-family:Times New Roman;font-size:100%;color:blue;"&gt;&lt;span style="font-size: 12pt; color: blue;"&gt;CPU&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="color: blue;"&gt; Time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Testing two  symbol values for equality (or non-equality) is faster than testing two string  values for equality, because Ruby only needs to do a single test. Checking two  strings for equality is more complicated; every individual character in the  string has to be checked until a difference is  found.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;As noted  above, each unique string value has an associated symbol. This means that  checking whether two symbols have the same string value or not is as simple as  checking whether they are the same object or not.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;One  comparison:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;:Worcestershire == :Worcestershire&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Easy peasy.  They’re the same object, so they’re equal.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Sixteen  comparisons:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;"Worcestershire" == "Worcestershire"&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;With  strings, Ruby has to dig into the objects to check their contents. Since in this  case they’re different string objects with the same length, it’s got to check  all fourteen characters in each string to make sure that they really are  equal.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;However,  what symbols &lt;em&gt;&lt;i&gt;&lt;span style="font-family:Times New Roman;"&gt;don’t&lt;/span&gt;&lt;/i&gt;&lt;/em&gt; give you  is lexical comparison. You can do &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;"foo" &gt; "bar"&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;, but  not &lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;:foo  &gt; :bar&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;. They’re digested. Their original string values  are a memory which can be resurrected only via &lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;Symbol#to_s&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;h4&gt;&lt;b&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;The  Right Tool for the Job&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;If you have  a modest number of unique string values that you want to use over and over, and  will mostly be using them as-is (i.e. not concatenating them, uppercasing them,  etc….), then symbols are the right tool for you.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Method  names (such as those given to &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;Module#attr_reader&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;, or  &lt;code&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="font-size: 10pt;"&gt;Object#send&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;) are a good example of  this; in fact, &lt;span style="color:blue;"&gt;&lt;span style="color: blue;"&gt;Ruby uses symbols  internally to remember method, variable, and constant  names.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;&lt;span style="font-size: 12pt;"&gt;Otherwise,  stick with strings. Strings are not that much slower than symbols, and many  times the extra limitations of symbols aren’t worth  it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-7047469737063881804?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/7047469737063881804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=7047469737063881804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7047469737063881804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7047469737063881804'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/11/difference-between-strings-and-symbols.html' title='Difference between Strings and Symbols in Ruby'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-5471399628015896681</id><published>2007-11-14T10:07:00.000+05:30</published><updated>2007-11-14T11:25:48.870+05:30</updated><title type='text'>Rails 2.0 -  Preview Release</title><content type='html'>Its time to feel the Real Power of Rails.&lt;br /&gt;The Rails 2.0 preview version is just released.&lt;br /&gt;&lt;br /&gt;I've listed down some of the important updates of Rails 2.0 here&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Action Pack - Multiview&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Rails 2.0, the format of the template is separated from its rendering engine. So show.rhtml now becomes show.html.erb, which is the template that’ll be rendered by default for a show action that has declared format.html in its respond_to. And you can now have something like show.csv.erb, which targets text/csv, but also uses the default &lt;span class="caps"&gt;ERB&lt;/span&gt; renderer.    &lt;p&gt;So the new format for templates is action.format.renderer. A few examples:&lt;/p&gt;    &lt;ul&gt;&lt;li&gt;show.erb: same show template for all formats&lt;/li&gt;&lt;li&gt;index.atom.builder: uses the Builder format, previously known as rxml, to render an index action for the application/atom+xml mime type&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Action Pack: Record identification&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Piggy-backing off the new drive for resources are a number of simplifications for controller and view methods that deal with URLs. We’ve added a number of conventions for turning model classes into resource routes on the fly. Examples:&lt;/p&gt;   &lt;pre&gt;&lt;code&gt;&lt;br /&gt;# person is a Person object, which by convention will&lt;br /&gt;# be mapped to person_url for lookup&lt;br /&gt;redirect_to(person)&lt;br /&gt;link_to(person.name, person)&lt;br /&gt;form_for(person)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Action Pack: &lt;span class="caps"&gt;HTTP&lt;/span&gt; Loving&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;New module is added in Rails 2.0 to work with &lt;span class="caps"&gt;HTTP&lt;/span&gt; Basic Authentication, which turns out to be a great way to do &lt;span class="caps"&gt;API&lt;/span&gt; authentication over &lt;span class="caps"&gt;SSL&lt;/span&gt;. It’s terribly simple to use. Here’s an example (there are more in ActionController::HttpAuthentication):&lt;/p&gt;   &lt;pre&gt;&lt;code&gt;&lt;br /&gt;class PostsController &lt; password = "dhh" except =""&gt; [ :index ]&lt;br /&gt;&lt;br /&gt;  def index&lt;br /&gt;    render :text =&gt; "Everyone can see me!"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def edit&lt;br /&gt;    render :text =&gt; "I'm only accessible if you know the password"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  private&lt;br /&gt;    def authenticate&lt;br /&gt;      authenticate_or_request_with_http_basic do |user_name, password|&lt;br /&gt;        user_name == USER_NAME &amp;amp;&amp;amp; password == PASSWORD&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Active Record: Sexy migrations&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;There’s a new alternative format for declaring migrations in a slightly more efficient format. Before you’d write:&lt;/p&gt;    &lt;pre&gt;&lt;code&gt;create_table :people do |t|&lt;br /&gt;t.column, "account_id",  :integer&lt;br /&gt;t.column, "first_name",  :string, :null =&gt; false&lt;br /&gt;t.column, "last_name",   :string, :null =&gt; false&lt;br /&gt;t.column, "description", :text&lt;br /&gt;t.column, "created_at",  :datetime&lt;br /&gt;t.column, "updated_at",  :datetime&lt;br /&gt;end&lt;/code&gt;&lt;/pre&gt;    &lt;p&gt;Now you can write:&lt;/p&gt;    &lt;pre&gt;&lt;code&gt;create_table :people do |t|&lt;br /&gt;t.integer :account_id&lt;br /&gt;t.string  :first_name, :last_name, :null =&gt; false&lt;br /&gt;t.text    :description&lt;br /&gt;t.timestamps&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;And hundreds upon hundreds of other improvements&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;We’ve got literally hundreds of bug fixes, tweaks, and feature enhancements crammed into Rails 2.0. All this coming off the work of tons of eager contributors working tirelessly to improve the framework in small, but important ways.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;So how do I upgrade?&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;If you want to move your application to Rails 2.0, you should first move it to Rails 1.2.3. That’ll include deprecation warnings for most everything we yanked out in 2.0. So if your application runs fine on 1.2.3 with no deprecation warnings, there’s a good chance that it’ll run straight up on 2.0. Of course, if you’re using, say, pagination, you’ll need to install the classic_pagination plugin. If you’re using Oracle, you’ll need to install the activerecord-oracle-adapter gem. And so on and so forth for all the extractions.&lt;/p&gt;    &lt;p&gt;To install the preview release through gems, do:&lt;/p&gt;    &lt;pre&gt;&lt;code&gt;gem install rails --source http://gems.rubyonrails.org&lt;/code&gt;&lt;/pre&gt;    &lt;p&gt;To try it from an &lt;span class="caps"&gt;SVN&lt;/span&gt; tag, use:&lt;/p&gt;    &lt;pre&gt;&lt;code&gt;rake rails:freeze:edge TAG=rel_2-0-0_PR&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Thanks to &lt;/span&gt;&lt;/code&gt;David Heinemeier Hansson&lt;code&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt; and the &lt;/span&gt;&lt;/code&gt;core team of committers and hundreds of open-source contributors&lt;code&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&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/26100023-5471399628015896681?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/5471399628015896681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=5471399628015896681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5471399628015896681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5471399628015896681'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/11/rails-20-preview-release.html' title='Rails 2.0 -  Preview Release'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2759944605440539954</id><published>2007-10-08T10:27:00.000+05:30</published><updated>2007-10-08T10:36:10.599+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='ide'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Another IDE for Rails - NetBeans 6.0 Beta</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_bT7-x4Ar0l8/Rwm6jssEK_I/AAAAAAAAACE/GNENBtKv3f0/s1600-h/netbeans6.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp1.blogger.com/_bT7-x4Ar0l8/Rwm6jssEK_I/AAAAAAAAACE/GNENBtKv3f0/s400/netbeans6.jpg" alt="" id="BLOGGER_PHOTO_ID_5118827573937449970" border="0" /&gt;&lt;/a&gt;NetBeans is an open-source IDE written in Java (somewhat like Eclipse, but not the same), and version 6.0 is the first with a Ruby-specific edition that focuses solidly on the things that Ruby and Ruby on Rails developers need. The NetBeans team have just released the first beta version. &lt;p&gt;NetBeans is a free IDE. You can create Ruby and Rails projects, run Ruby files, configure interpreters (MRI and JRuby), install Gems graphically, run tests, run RSpecs, debug Ruby code, run Rails apps, and so on, all from the IDE.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can download it from &lt;a href="http://bits.netbeans.org/download/6_0/beta1/latest/"&gt;here&lt;/a&gt; . &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-2759944605440539954?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2759944605440539954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2759944605440539954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2759944605440539954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2759944605440539954'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/10/another-ide-for-rails-netbeans-60-beta.html' title='Another IDE for Rails - NetBeans 6.0 Beta'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_bT7-x4Ar0l8/Rwm6jssEK_I/AAAAAAAAACE/GNENBtKv3f0/s72-c/netbeans6.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2591768588079331496</id><published>2007-08-12T08:21:00.000+05:30</published><updated>2007-08-12T08:36:22.765+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='object'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='validations'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Rails Validations</title><content type='html'>Validation is nothing but a set of methods to ensure the integrity of information in the database. It forms a minimum standard that all records must meet before they can be saved.&lt;br /&gt;&lt;p&gt;Validation takes place &lt;strong&gt;before a model is saved&lt;/strong&gt;. If the model being saved doesn’t meet its validation requirements, it will &lt;span class="caps"&gt;NOT&lt;/span&gt; be saved to the database. Attempts to &lt;code&gt;save&lt;/code&gt; an invalid model return false. This allows for the “if-save” convention:&lt;/p&gt;   &lt;pre&gt;if @object.save&lt;br /&gt;# object was valid and saved&lt;br /&gt;..&lt;br /&gt;else&lt;br /&gt;# object was invalid, not saved&lt;br /&gt;..&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;You can trigger validation &lt;strong&gt;manually&lt;/strong&gt; by calling the models &lt;code&gt;validate&lt;/code&gt; method.&lt;/p&gt;   &lt;pre&gt;@object.validate&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;But likely more useful would be to call &lt;code&gt;valid?&lt;/code&gt;, which runs &lt;code&gt;validate&lt;/code&gt; then returns true or false.&lt;/p&gt;   &lt;pre&gt;if @object.valid?&lt;br /&gt;...&lt;/pre&gt;   &lt;h3&gt;Avoiding validation&lt;/h3&gt;    &lt;p&gt;You can skip validation by passing &lt;code&gt;false&lt;/code&gt; to &lt;code&gt;save&lt;/code&gt;.&lt;/p&gt;   &lt;pre&gt;@object.save(false)&lt;br /&gt;&lt;br /&gt;Similarly whenever "update_attribute" method is used, the validation for the&lt;br /&gt;corresponding object is skipped. But if you use "update_attibutes" method,&lt;br /&gt;It will trigger the validation methods for that object.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Skipping validtion may result (obviously) in invalid data being&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;recorded to the database.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;Validation in Controllers:&lt;/h3&gt;When a model is validated, any validation errors will be collected in the models &lt;code&gt;errors&lt;/code&gt; object.&lt;br /&gt;you can use validation methods for an object in the controller class itself by just inspecting the object ( conditions ), and adding the errors to that object like this&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;@object.errors.add(:attribute,"#{error_messages}")&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&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/26100023-2591768588079331496?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2591768588079331496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2591768588079331496' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2591768588079331496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2591768588079331496'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/08/rails-validations.html' title='Rails Validations'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2657250303272179161</id><published>2007-07-19T21:56:00.000+05:30</published><updated>2007-07-19T22:17:43.729+05:30</updated><title type='text'>Compression in RMagick</title><content type='html'>Whenever you upload an image, and resize it using rmagick library, it will do the resize operation with default compression techniques. Sometimes the user may upload images which are directly from digital cameras, these images contain lots of metadata including color profiles. Anyway We don’t need any of these color profile information in the resized images :)&lt;br /&gt;&lt;br /&gt;You can remove those color profiles from your images using the RMagick method called &lt;span style="font-weight: bold;"&gt;"delete_profile" &lt;/span&gt;(an instance method of Image class in RMagick library).&lt;br /&gt;&lt;br /&gt;or You can use the method  "&lt;span style="font-weight: bold;"&gt;profile!("*", nil)" &lt;/span&gt;to delete all the color profiles.&lt;br /&gt;&lt;br /&gt;you have to use the above methods like this&lt;br /&gt;&lt;br /&gt;    &lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span class="arg"&gt;image&lt;/span&gt;.delete_profile(&lt;span class="arg"&gt;profile_name&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;if you put a specific profile name like "IPTC" or "ICC", it will delete the specified profile.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;if you use &lt;span style="font-weight: bold;"&gt;image.delete_profile("*"), &lt;/span&gt;it will delete all the profiles.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span class="arg"&gt;image&lt;/span&gt;.profile!(&lt;span class="arg"&gt;"*", nil&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;This will remove all the profiles of the images.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;Note : &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;RMagick does not automatically remove profiles when     resizing images. If you are trying to make your JPEG thumbnail     images as small as possible, use &lt;code style="font-weight: bold;"&gt;profile!&lt;/code&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;to     remove any profiles from the image as well.&lt;/p&gt;&lt;br /&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-weight: normal;"&gt;And there is one more method called &lt;/span&gt;"strip!" &lt;span style="font-weight: normal;font-size:100%;" &gt;strips an image of all profiles and     comments.&lt;/span&gt;&lt;/p&gt;      &lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span class="arg"&gt;image&lt;/span&gt;.strip!&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-weight: normal;font-size:100%;" &gt;&lt;span style="font-style: italic;"&gt;This will &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Strip an image of all profiles and     comments.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-weight: normal;font-size:100%;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-2657250303272179161?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2657250303272179161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2657250303272179161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2657250303272179161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2657250303272179161'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/07/compression-in-rmagick.html' title='Compression in RMagick'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-5597928689461711090</id><published>2007-06-29T03:59:00.000+05:30</published><updated>2007-06-29T04:19:23.965+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='RJS'/><category scheme='http://www.blogger.com/atom/ns#' term='UJS'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>UJS for Rails</title><content type='html'>&lt;h1&gt;&lt;span style="font-size:130%;"&gt;&lt;span class="tagline"&gt;Unobtrusive Javascript for Ruby On Rails&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/h1&gt;&lt;span style="font-family:times new roman;"&gt;UJS for Rails makes it easy to apply behaviour to your page. Simply specify the element(s) of your page that you want the behaviour to apply to using CSS-style selectors and the event that you want to trigger the behaviour, and the Javascript that you want to run. In addition, you can write your behaviours using RJS-style Ruby to Javascript proxies.&lt;/span&gt;&lt;br /&gt;&lt;h3&gt;Installation&lt;/h3&gt;    &lt;p  style="font-family:times new roman;"&gt;You can install the &lt;span class="caps"&gt;UJS&lt;/span&gt; plugin from our Subversion repository with Rails’ plugin script:&lt;/p&gt;   &lt;pre&gt;&lt;code class="shell"&gt;&lt;span style="font-size:85%;"&gt;ruby script/plugin install http://source.ujs4rails.com/current/unobtrusive_javascript&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family:times new roman;"&gt;After Installing the plugin, run the following command&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;code class="shell"&gt;rake unobtrusive_javascript:install&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;&lt;br /&gt;If  "&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;lowpro.js" is copied to your system means, installation is perfect...otherwise&lt;br /&gt;please do the installation again :)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family:times new roman;"&gt;Once you’ve confirmed that lowpro.js is installed, the final&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;installation step is to open your routes.rb file and add the following&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;line into the &lt;/span&gt;&lt;code style="font-family: times new roman;" class="ruby"&gt;Routes.draw&lt;/code&gt;&lt;span style="font-family:times new roman;"&gt; block&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code class="ruby"&gt;ActionController::Routes.draw &lt;span class="keywords"&gt;do&lt;/span&gt; |map|&lt;br /&gt;UJS::routes&lt;br /&gt;&lt;span class="comment"&gt;# your routes here.&lt;/span&gt;&lt;br /&gt;&lt;span class="keywords"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3&gt;Including The Scripts&lt;/h3&gt;&lt;span style="font-family:times new roman;"&gt;Simply use &lt;/span&gt;&lt;code style="font-family: times new roman;" class="ruby"&gt;javascript_include_tag&lt;/code&gt;&lt;span style="font-family:times new roman;"&gt; to add the &lt;/span&gt;&lt;span class="caps"  style="font-family:times new roman;"&gt;UJS&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt; scripts into the document’s &lt;/span&gt;&lt;code style="font-family: times new roman;" class="html"&gt;head&lt;/code&gt;&lt;span style="font-family:times new roman;"&gt; tag as shown:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;%= javascript_include_tag &lt;span class="string"&gt;'prototype'&lt;/span&gt;, :unobtrusive %&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family:times new roman;"&gt;You can safely use &lt;/span&gt;&lt;code style="font-family: times new roman;" class="ruby"&gt;:defaults&lt;/code&gt;&lt;span style="font-family:times new roman;"&gt; and &lt;/span&gt;&lt;code style="font-family: times new roman;" class="html"&gt;:unobtrusive&lt;/code&gt;&lt;span style="font-family:times new roman;"&gt; together in the same &lt;/span&gt;&lt;code style="font-family: times new roman;" class="ruby"&gt;javascript_include_tag&lt;/code&gt;&lt;span style="font-family:times new roman;"&gt; call.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Applying Behaviours&lt;/span&gt;&lt;br /&gt;&lt;h4&gt;&lt;code class="ruby"&gt;apply_behaviour&lt;span class="brackets"&gt;(&lt;/span&gt;css_selector, javascript, options={}&lt;span class="brackets"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/h4&gt;&lt;span style="font-family: times new roman;font-size:100%;" &gt;The first argument of apply_behaviours is an event:Selectors style selector that specifies both the &lt;/span&gt;&lt;span style="font-family: times new roman;font-size:100%;" class="caps" &gt;CSS&lt;/span&gt;&lt;span style="font-family: times new roman;font-size:100%;" &gt; selector for the elements to target and the event to attach the behaviour to in this format: &lt;code class="no-highlight"&gt;css_selector:event&lt;/code&gt;&lt;/span&gt;    &lt;p style="font-family: times new roman;font-family:times new roman;" &gt;&lt;span style="font-size:100%;"&gt;The second argument is the behavior to apply. Pass a string to specify the JavaScript code to execute directly. There are two variables available to the behaviour JavaScript. In the JavaScript code, &lt;code class="javascript"&gt;&lt;span class="keywords"&gt;this&lt;/span&gt;&lt;/code&gt; refers to the triggering element and &lt;code class="javascript"&gt;event&lt;/code&gt; refers to the JavaScript event object.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family: times new roman;font-family:times new roman;font-size:100%;"  &gt;For Documentation, please refer this url -&lt;/span&gt;&lt;p  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: times new roman;"&gt; http://www.ujs4rails.com/resources/usage-documentation&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;&lt;strong&gt;Note:&lt;/strong&gt; UJS (and the lowpro extensions) requires at least Prototype 1.5.0 &lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;" class="caps"  &gt;RC0&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:100%;"  &gt;.&lt;/span&gt;&lt;pre&gt;&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/26100023-5597928689461711090?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/5597928689461711090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=5597928689461711090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5597928689461711090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5597928689461711090'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/06/ujs-for-rails.html' title='UJS for Rails'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2491907559088187977</id><published>2007-06-20T02:26:00.000+05:30</published><updated>2007-06-20T03:05:13.851+05:30</updated><title type='text'>finder_sql in HABTM</title><content type='html'>&lt;p&gt;Using this "finder_sql", you can override ActiveRecord's associations in your models. Use it to manually specify the association that should be returned.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Important Note:&lt;/span&gt; if you need to do any variable interpolation in the string , make sure to use single quotes instead of the usual doubles:&lt;/p&gt; &lt;div&gt;&lt;code&gt;has_many :books, :finder_sql =&gt; 'select * from books where author_id=#{id}'&lt;/code&gt;&lt;/div&gt; &lt;p&gt;When you use double quotes, the string interpolation happens immediately (when the class is first loaded), thus obtaining the object ID of the class in memory. Using single quotes, the interpolation occurs within the context of your object instance, which is what you're expecting.&lt;/p&gt;&lt;p&gt;Enjoy Agile Programming!!!&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-2491907559088187977?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2491907559088187977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2491907559088187977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2491907559088187977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2491907559088187977'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/06/findersql-in-habtm.html' title='finder_sql in HABTM'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-5665354113132492258</id><published>2007-06-12T23:46:00.000+05:30</published><updated>2007-06-12T23:53:45.411+05:30</updated><title type='text'>Safari for Windows</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://ajaxian.com/wp-content/images/safari3windows.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px;" src="http://ajaxian.com/wp-content/images/safari3windows.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Apple is releasing the public beta of &lt;a target="_blank" href="http://www.apple.com/safari/download/"&gt;Safari for Windows&lt;/a&gt; today.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Steve gave demos of Safari, claiming that it screams:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;ibench html performance: IE 4.6 sec, FF 3.7, Safari 2.2 seconds&lt;/li&gt;&lt;li&gt;javascript: IE 2.4 sec, FF 1.6, Safari 0.9 seconds&lt;/li&gt;&lt;/ul&gt;  &lt;br /&gt;Safari has always been the fastest browser on the Mac and now it’s the fastest browser on Windows, loading and drawing web pages up to twice as fast as Microsoft Internet Explorer 7 and up to 1.6 times faster than Mozilla Firefox 2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-5665354113132492258?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/5665354113132492258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=5665354113132492258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5665354113132492258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5665354113132492258'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/06/safari-for-windows.html' title='Safari for Windows'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-3400432988092387705</id><published>2007-06-11T22:16:00.000+05:30</published><updated>2007-06-11T23:26:15.178+05:30</updated><title type='text'>Google Gears</title><content type='html'>Google announced an early beta of &lt;a href="http://gears.google.com/"&gt;Gears&lt;/a&gt;, a &lt;em&gt;"browser extension that enables web applications to provide offline functionality using following JavaScript APIs:&lt;/em&gt; &lt;ul&gt;&lt;li&gt;&lt;em&gt;Store and serve application resources locally&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Store data locally in a fully-searchable relational database&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Run asynchronous Javascript to improve application responsiveness"&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt; Google Gears is an open source browser extension that lets developers create web applications that can run offline. Gears provides three key features: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;A local server, to cache and serve application resources (HTML, JavaScript, images, etc.) without needing to contact a server &lt;/li&gt;&lt;li&gt;A database, to store and access data from within the browser &lt;/li&gt;&lt;li&gt;A worker thread pool, to make web applications more responsive by performing expensive operations in the background &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Google Gears is currently an early-access developers' release. It is not yet intended for use by real users in production applications at this time.&lt;br /&gt;&lt;/p&gt;Google Gears extends browsers by making new APIs available to JavaScript code. Like all APIs, they must be used explicitly. To take advantage of the offline features provided by Google Gears, you'll need to add or change code in your web application.&lt;br /&gt;&lt;br /&gt;Only web sites that have been specifically designed to use Google Gears can take advantage of its offline capabilities.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-3400432988092387705?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/3400432988092387705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=3400432988092387705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3400432988092387705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3400432988092387705'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/06/google-gears.html' title='Google Gears'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-9113170135713780766</id><published>2007-06-01T22:48:00.000+05:30</published><updated>2007-06-01T22:56:10.003+05:30</updated><title type='text'>Rails Rake Tasks Reference</title><content type='html'>&lt;pre&gt;rake cache&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Clears all cached pages&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:bootstrap&lt;/span&gt;      &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Loads a schema.rb file into the database and then loads the initial database fixtures.&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:bootstrap&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:copy_default_theme&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Copy default theme to site theme&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:migrate&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Migrate the database through scripts in db/migrate. Target specific version with VERSION=x&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:schema&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:dump&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Create a db/schema.rb file that can be portably used against any DB supported by AR&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:schema&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:load&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Load a schema.rb file into the database&lt;br /&gt;&lt;/span&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:bootstrap&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:load&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Load initial database fixtures (in db/bootstrap/*.yml) into the current environment's database.  Load specific fixtures using FIXTURES=x,y&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:fixtures&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:load&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Load fixtures into the current environment's database.  Load specific fixtures using FIXTURES=x,y&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:sessions&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Clear the sessions table&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:sessions&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:create&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Creates a sessions table for use with CGI::Session::ActiveRecordStore&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:structure&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:dump&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Dump the database structure to a SQL file&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:test&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clone&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Recreate the test database from the current environment's database schema&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:test&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clone_structure&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Recreate the test databases from the development structure&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:test&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:prepare&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Prepare the test database and load the schema&lt;/span&gt;&lt;br /&gt;rake db&lt;span style="color: rgb(170, 102, 0);"&gt;:test&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:purge&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Empty the test database&lt;/span&gt;&lt;br /&gt;rake deploy&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Push the latest revision into production using the release manager&lt;/span&gt;&lt;br /&gt;rake diff_from_last_deploy&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Describe the differences between HEAD and the last production release&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:app&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Build the app HTML Files&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:clobber_app&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Remove rdoc products&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:clobber_plugins&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Remove plugin documentation&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:clobber_rails&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Remove rdoc products&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:plugins&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Generate documation for all installed plugins&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:rails&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Build the rails HTML Files&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:reapp&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Force a rebuild of the RDOC files&lt;/span&gt;&lt;br /&gt;rake doc&lt;span style="color: rgb(170, 102, 0);"&gt;:rerails&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Force a rebuild of the RDOC files&lt;/span&gt;&lt;br /&gt;rake edge&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# freeze rails edge&lt;/span&gt;&lt;br /&gt;rake log&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Truncates all *.log files in log/ to zero bytes&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:freeze&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:edge&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:freeze&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:gems&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Lock this application to the current gems (by unpacking them into vendor/rails)&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:unfreeze&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Unlock this application from freeze of gems or edge and return to a fluid use of system gems&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:update&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Update both configs, scripts and public/javascripts from Rails&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:update&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:configs&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Update config/boot.rb from your current rails install&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:update&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:javascripts&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Update your javascripts from your current rails install&lt;/span&gt;&lt;br /&gt;rake rails&lt;span style="color: rgb(170, 102, 0);"&gt;:update&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:scripts&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Add new scripts to the application script/ directory&lt;/span&gt;&lt;br /&gt;rake remote_exec&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Execute a specific action using the release manager&lt;/span&gt;&lt;br /&gt;rake rollback&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Rollback to the release before the current release in production&lt;/span&gt;&lt;br /&gt;rake show_deploy_tasks&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Enumerate all available deployment tasks&lt;/span&gt;&lt;br /&gt;rake stats&lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Report code statistics (KLOCs, etc) from the application&lt;/span&gt;&lt;br /&gt;rake test                           &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Test all units and functionals&lt;/span&gt;&lt;br /&gt;rake test&lt;span style="color: rgb(170, 102, 0);"&gt;:functionals&lt;/span&gt;                 &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Run tests for functionalsdb:test:prepare&lt;/span&gt;&lt;br /&gt;rake test&lt;span style="color: rgb(170, 102, 0);"&gt;:integration&lt;/span&gt;               &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Run tests for integrationdb:test:prepare&lt;/span&gt;&lt;br /&gt;rake test&lt;span style="color: rgb(170, 102, 0);"&gt;:plugins&lt;/span&gt;                     &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Run tests for pluginsenvironment&lt;/span&gt;&lt;br /&gt;rake test&lt;span style="color: rgb(170, 102, 0);"&gt;:recent&lt;/span&gt;                    &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Run tests for recentdb:test:prepare&lt;/span&gt;&lt;br /&gt;rake test&lt;span style="color: rgb(170, 102, 0);"&gt;:uncommitted&lt;/span&gt;                 &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Run tests for uncommitteddb:test:prepare&lt;/span&gt;&lt;br /&gt;rake test&lt;span style="color: rgb(170, 102, 0);"&gt;:units&lt;/span&gt;                     &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Run tests for unitsdb:test:prepare&lt;/span&gt;&lt;br /&gt;rake tmp&lt;span style="color: rgb(170, 102, 0);"&gt;:cache&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;                &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Clears all files and directories in tmp/cache&lt;/span&gt;&lt;br /&gt;rake tmp&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;                        &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Clear session, cache, and socket files from tmp/&lt;/span&gt;&lt;br /&gt;rake tmp&lt;span style="color: rgb(170, 102, 0);"&gt;:create&lt;/span&gt;                       &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Creates tmp directories for sessions, cache, and sockets&lt;/span&gt;&lt;br /&gt;rake tmp&lt;span style="color: rgb(170, 102, 0);"&gt;:pids&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;                   &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Clears all files in tmp/pids&lt;/span&gt;&lt;br /&gt;rake tmp&lt;span style="color: rgb(170, 102, 0);"&gt;:sessions&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;               &lt;span style="color: rgb(136, 136, 136);"&gt;&lt;br /&gt;# Clears all files in tmp/sessions&lt;/span&gt;&lt;br /&gt;rake tmp&lt;span style="color: rgb(170, 102, 0);"&gt;:sockets&lt;/span&gt;&lt;span style="color: rgb(170, 102, 0);"&gt;:clear&lt;/span&gt;              &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Clears all files in tmp/sockets&lt;/span&gt;&lt;br /&gt;rake update_dialog_helper           &lt;br /&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;# Copies the latest dialog.js to the application's public directory&lt;/span&gt;&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/26100023-9113170135713780766?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/9113170135713780766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=9113170135713780766' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/9113170135713780766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/9113170135713780766'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/06/rails-rake-tasks-reference.html' title='Rails Rake Tasks Reference'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-3797968227130724685</id><published>2007-05-25T08:59:00.000+05:30</published><updated>2007-05-25T09:03:46.918+05:30</updated><title type='text'>Why FLEX?</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Reasons  made  me to choose FLEX :&lt;/b&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;i.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                   &lt;/span&gt;&lt;/span&gt;look and feel of a desktop application. Because there is no page reload.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;ii.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                  &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Reduction in Server Load and Network Bandwidth&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.5in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;iii.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;                &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Common Deployment Environment&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Some or all of the presentation tier of a flex application runs in flash player itself. It runs in the Client side which means “ no application server processing resources are spent for data formatting”.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;By Off loading the presentation logic to the client side flash player, and eliminating the need for frequent page refreshes. Flex applications minimizes the network traffic and server load.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Common Deployment Environment:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Flex applications execute on flash players which are platform independent, so customer do not need to install any custom client software. Also flash player runs consistently in all browsers and platforms. So you don’t have to worry about the problems like inconsistent behaviors in different client environments.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-3797968227130724685?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/3797968227130724685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=3797968227130724685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3797968227130724685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3797968227130724685'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/05/why-flex.html' title='Why FLEX?'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-7027510472235335453</id><published>2007-05-25T08:58:00.000+05:30</published><updated>2007-05-25T08:59:23.070+05:30</updated><title type='text'>Flex - RPC</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Remote Procedure Call Services:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;RPC services let your flex application to interact with the remote servers to provide data to your application or for your application to send data to the server.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Using Flex SDK, you can access the remote data through web services like SOAP or normal HTTP services like GET or POST requests.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;For security, by default flash player doesn’t allow an application to access a remote data source from a domain other than the domain from which the application was served.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Therefore a remote server must either be in the same domain as the server hosting your application or the remote server must define a &lt;b style=""&gt;crossdomain.xml&lt;/b&gt; file.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Crossdomain.xml&lt;/b&gt; file is an xml file that provides access to swf&lt;span style=""&gt;  &lt;/span&gt;files from certain domains or from all domains.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-7027510472235335453?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/7027510472235335453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=7027510472235335453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7027510472235335453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7027510472235335453'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/05/flex-rpc.html' title='Flex - RPC'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-8416982402383557243</id><published>2007-05-25T08:56:00.000+05:30</published><updated>2007-05-25T08:58:18.269+05:30</updated><title type='text'>Flex - Power of RIA</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;What is flex?&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Flex is a development and runtime environment that you use to create rich internet applications that use adobe flash player 9.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Flex is an adobe technology.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Using flex, you can design, develop and deliver entirely new class of RIAs.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Flex lets the developers familiar with the server side technologies to build rich front end for applications.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;While executing in flash player, your flex application can interact with the server side functionality such as databases, web services, java objects (data models) and other server side services.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;In Flex, You use a standards based programming model to develop an application. So you have to describe the user interface and configure the user interface controls and define the data bindings.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Flex Application Development Methodology:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ol style="margin-top: 0in;" start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;Design&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Compile&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Run&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Design:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Design part consists of flex class libraries, MXML, Action Script, CSS and other imported files like images, swf files.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Compile:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;When compiling the application, all the source code will be converted in to Action script classes. So everything here is AS classes.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Run:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The final output is a SWF file where your application resides.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;You can embed this swf file into a normal html file to run your flex application.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-8416982402383557243?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/8416982402383557243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=8416982402383557243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/8416982402383557243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/8416982402383557243'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/05/flex-power-of-ria.html' title='Flex - Power of RIA'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2099103525392193133</id><published>2007-04-25T20:52:00.000+05:30</published><updated>2007-05-25T09:05:30.132+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to use Capistrano'/><title type='text'>How to use Capistrano</title><content type='html'>&lt;a href="http://undefinedrange.com/files/capistrano.png"&gt;&lt;img style="margin: 0px 10px 10px 0px; float: left; width: 200px;" alt="" src="http://undefinedrange.com/files/capistrano.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;Capistrano is a simple but a powerful deployment tool...&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To use Capistrano for deployment, please read the following lines&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;(Note : Instructions are given for ROR development. )&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;em&gt;1. Install Capistrano Gem&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;"gem install capistrano"&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;em&gt;2. Run this command from your local system&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;"cap --apply-to /path/to/your/app YourApplicationName"&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;em&gt;3. Execute the setup task&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;"rake remote:setup"&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;this command will setup the directory structure to deploy...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;em&gt;4. Execute the cold_deploy task&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;"rake remote:cold_deploy"&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;this command will run, deploy your application to the server...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now Your application will run&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Once you’ve finished the above, your server is ready to have new versions of your&lt;br /&gt;application deployed to it anytime you would like. All you need to do is commiting your changes into Subversion and then redeploy using the following command on your local computer&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;strong&gt;"rake remote:deploy"&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;em&gt;Capistrano OVER....&lt;/em&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;you can see "&lt;em&gt;how to write capistrano task&lt;/em&gt;" in coming posts.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&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/26100023-2099103525392193133?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2099103525392193133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2099103525392193133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2099103525392193133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2099103525392193133'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/04/how-to-use-capistrano.html' title='How to use Capistrano'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-6722047488774902691</id><published>2007-03-23T11:29:00.000+05:30</published><updated>2007-03-23T11:30:17.757+05:30</updated><title type='text'>Nice Web 2.0 App</title><content type='html'>check this link&lt;br /&gt;&lt;br /&gt;&lt;a href="http://color.slightlyblue.com/"&gt;http://color.slightlyblue.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-6722047488774902691?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/6722047488774902691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=6722047488774902691' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6722047488774902691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6722047488774902691'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/03/nice-web-20-app.html' title='Nice Web 2.0 App'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-1447244936528788679</id><published>2007-03-20T18:08:00.001+05:30</published><updated>2007-03-20T18:08:12.004+05:30</updated><title type='text'>Rails Ajax rating system (Part 1)</title><content type='html'>Adds rating capabilities to any ActiveRecord object. It has the ability to work with objects that have or don ’t special fields to keep a tally of the ratings and number of votes for each object. In addition it will by default use the User model as the rater object and keep the ratings per-user. It can be configured to use another class...&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;&lt;a href='http://www.rubynaut.net/articles/2007/03/18/rails_ajax_rating_system_part_1'&gt;read more&lt;/a&gt; | &lt;a href='http://digg.com/programming/Rails_Ajax_rating_system_Part_1_2'&gt;digg story&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-1447244936528788679?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/1447244936528788679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=1447244936528788679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/1447244936528788679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/1447244936528788679'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/03/rails-ajax-rating-system-part-1.html' title='Rails Ajax rating system (Part 1)'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-6607511027616186877</id><published>2007-02-28T10:44:00.001+05:30</published><updated>2007-02-28T10:44:31.279+05:30</updated><title type='text'>Validating  XHTML and CSS</title><content type='html'>Validating an XHTML document's content involves checking its markup against a DTD and reporting markup errors. You can validate HTML, XHTML, and CSS files by using the W3C's validator. It will allow you to validate files on the Internet or on your computer.&lt;br /&gt;&lt;br /&gt;The validator program will go through your coding, find any errors, and create a report. You can then "clean up" your coding and validate again. This service is free.&lt;br /&gt;&lt;br /&gt;http://validator.w3.org/&lt;br /&gt;&lt;br /&gt;You can also check your external CSS pages through the CSS validator ...&lt;br /&gt;&lt;br /&gt;http://jigsaw.w3.org/css-validator/&lt;br /&gt;&lt;br /&gt;Once validated as well formed coding, the bottom of the report page will show an icon image that you may display on your page such as the ones you see in the right side column of my site. Display it with pride!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-6607511027616186877?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/6607511027616186877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=6607511027616186877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6607511027616186877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6607511027616186877'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/validating-xhtml-and-css.html' title='Validating  XHTML and CSS'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-7126474953396204234</id><published>2007-02-28T10:41:00.000+05:30</published><updated>2007-02-28T10:42:53.931+05:30</updated><title type='text'>XHTML Doc Types</title><content type='html'>There are 3 Doctypes usable by an XHTML document. &lt;span style="font-weight:bold;"&gt;Strict, Transitional, and Frameset.&lt;/span&gt; The doctype is used when validating an XHTML document's content against a DTD and reporting markup errors. (The DOCTYPE lines below are broken in parts only to prevent the examples from being too wide for non-horizontal scrolling - you can keep it all on one line).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;XHTML 1.0 Strict&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets.&lt;br /&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;XHTML 1.0 Transitional&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use this when you need to take advantage of HTML's presentational features because many of your readers don't have the latest browsers that understand Cascading Style Sheets.&lt;br /&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;XHTML 1.0 Frameset&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use this when you want to use HTML Frames to partition the browser window into two or more frames.&lt;br /&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-7126474953396204234?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/7126474953396204234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=7126474953396204234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7126474953396204234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7126474953396204234'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/xhtml-doc-types.html' title='XHTML Doc Types'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2256216756894719081</id><published>2007-02-28T10:09:00.000+05:30</published><updated>2007-02-28T10:39:46.170+05:30</updated><title type='text'>Reserved Words in MYSQL</title><content type='html'>In MYSQL, There is a number of words that you cannot use for your table and column names. MySQL uses some specific words for command processing, so using them in your own coding may confuse things a bit.&lt;br /&gt;&lt;br /&gt;ADD  ALL  ALTER&lt;br /&gt;ANALYZE  AND  AS&lt;br /&gt;ASC  ASENSITIVE  AUTO_INCREMENT&lt;br /&gt;BDB  BEFORE  BERKELEYDB&lt;br /&gt;BETWEEN  BIGINT  BINARY&lt;br /&gt;BLOB  BOTH  BY&lt;br /&gt;CALL  CASCADE  CASE&lt;br /&gt;CHANGE  CHAR  CHARACTER&lt;br /&gt;CHECK  COLLATE  COLUMN&lt;br /&gt;COLUMNS  CONDITION  CONNECTION&lt;br /&gt;CONSTRAINT  CONTINUE  CREATE&lt;br /&gt;CROSS  CURRENT_DATE  CURRENT_TIME&lt;br /&gt;CURRENT_TIMESTAMP  CURSOR  DATABASE&lt;br /&gt;DATABASES  DAY_HOUR  DAY_MICROSECOND&lt;br /&gt;DAY_MINUTE  DAY_SECOND  DEC&lt;br /&gt;DECIMAL  DECLARE  DEFAULT&lt;br /&gt;DELAYED  DELETE  DESC&lt;br /&gt;DESCRIBE  DETERMINISTIC  DISTINCT&lt;br /&gt;DISTINCTROW  DIV  DOUBLE&lt;br /&gt;DROP  ELSE  ELSEIF&lt;br /&gt;ENCLOSED  ESCAPED  EXISTS&lt;br /&gt;EXIT  EXPLAIN  FALSE&lt;br /&gt;FETCH  FIELDS  FLOAT&lt;br /&gt;FOR  FORCE  FOREIGN&lt;br /&gt;FOUND  FRAC_SECOND  FROM&lt;br /&gt;FULLTEXT  GRANT  GROUP&lt;br /&gt;HAVING  HIGH_PRIORITY  HOUR_MICROSECOND&lt;br /&gt;HOUR_MINUTE  HOUR_SECOND  IF&lt;br /&gt;IGNORE  IN  INDEX&lt;br /&gt;INFILE  INNER  INNODB&lt;br /&gt;INOUT  INSENSITIVE  INSERT&lt;br /&gt;INT  INTEGER  INTERVAL&lt;br /&gt;INTO  IO_THREAD  IS&lt;br /&gt;ITERATE  JOIN  KEY&lt;br /&gt;KEYS  KILL  LEADING&lt;br /&gt;LEAVE  LEFT  LIKE&lt;br /&gt;LIMIT  LINES  LOAD&lt;br /&gt;LOCALTIME  LOCALTIMESTAMP  LOCK&lt;br /&gt;LONG  LONGBLOB  LONGTEXT&lt;br /&gt;LOOP  LOW_PRIORITY  MASTER_SERVER_ID&lt;br /&gt;MATCH  MEDIUMBLOB  MEDIUMINT&lt;br /&gt;MEDIUMTEXT  MIDDLEINT  MINUTE_MICROSECOND&lt;br /&gt;MINUTE_SECOND  MOD  NATURAL&lt;br /&gt;NOT  NO_WRITE_TO_BINLOG  NULL&lt;br /&gt;NUMERIC  ON  OPTIMIZE&lt;br /&gt;OPTION  OPTIONALLY  OR&lt;br /&gt;ORDER  OUT  OUTER&lt;br /&gt;OUTFILE  PRECISION  PRIMARY&lt;br /&gt;PRIVILEGES  PROCEDURE  PURGE&lt;br /&gt;READ  REAL  REFERENCES&lt;br /&gt;REGEXP  RENAME  REPEAT&lt;br /&gt;REPLACE  REQUIRE  RESTRICT&lt;br /&gt;RETURN  REVOKE  RIGHT&lt;br /&gt;RLIKE  SECOND_MICROSECOND  SELECT&lt;br /&gt;SENSITIVE  SEPARATOR  SET&lt;br /&gt;SHOW  SMALLINT  SOME&lt;br /&gt;SONAME  SPATIAL  SPECIFIC&lt;br /&gt;SQL  SQLEXCEPTION  SQLSTATE&lt;br /&gt;SQLWARNING  SQL_BIG_RESULT  SQL_CALC_FOUND_ROWS&lt;br /&gt;SQL_SMALL_RESULT  SQL_TSI_DAY  SQL_TSI_FRAC_SECOND&lt;br /&gt;SQL_TSI_HOUR  SQL_TSI_MINUTE  SQL_TSI_MONTH&lt;br /&gt;SQL_TSI_QUARTER  SQL_TSI_SECOND  SQL_TSI_WEEK&lt;br /&gt;SQL_TSI_YEAR  SSL  STARTING&lt;br /&gt;STRAIGHT_JOIN  STRIPED  TABLE&lt;br /&gt;TABLES  TERMINATED  THEN&lt;br /&gt;TIMESTAMPADD  TIMESTAMPDIFF  TINYBLOB&lt;br /&gt;TINYINT  TINYTEXT  TO&lt;br /&gt;TRAILING  TRUE  UNDO&lt;br /&gt;UNION  UNIQUE  UNLOCK&lt;br /&gt;UNSIGNED  UPDATE  USAGE&lt;br /&gt;USE  USER_RESOURCES  USING&lt;br /&gt;UTC_DATE  UTC_TIME  UTC_TIMESTAMP&lt;br /&gt;VALUES  VARBINARY  VARCHAR&lt;br /&gt;VARCHARACTER  VARYING  WHEN&lt;br /&gt;WHERE  WHILE  WITH&lt;br /&gt;WRITE  XOR  YEAR_MONTH&lt;br /&gt;ZEROFILL&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-2256216756894719081?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2256216756894719081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2256216756894719081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2256216756894719081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2256216756894719081'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/reserved-words-in-mysql.html' title='Reserved Words in MYSQL'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-7302619385105147453</id><published>2007-02-19T18:40:00.000+05:30</published><updated>2007-02-19T18:42:24.030+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='xhtml'/><category scheme='http://www.blogger.com/atom/ns#' term='dtd'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='basic'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='xslt'/><title type='text'>What is XML, DTD and XSLT?</title><content type='html'>All these letters, abbreviations, meanings and so forth. What do they all mean and how do we use them? Here are some basics breakdown :&lt;br /&gt;&lt;br /&gt;First we will start at the top. The VERY top. SGML stands for Standard Generalized Markup Language. Simply put, it is the very root coding of coding. HTML is an application of SGML.&lt;br /&gt;&lt;br /&gt;XML is a simplified subset of SGML. It stands for eXtensible Markup Language.&lt;br /&gt;&lt;br /&gt;DTD stands for Document Type Declaration. It is a set of instructions that states what tags are usable and what (re)action they create. Each browser has a DTD set in it's programming set by the browser companies. This is how some tags will work in only one type of browser or version. It has the tags stated in it's DTD. XML makes it possible to create unique tag sets by applying it's own DTD. This makes the DTD more compatable with more browsers.&lt;br /&gt;&lt;br /&gt;XSLT stands for eXtensible Stylesheet Language Transformation. It is a strong verions of CSS that formats the XML page for viewing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-7302619385105147453?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/7302619385105147453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=7302619385105147453' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7302619385105147453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/7302619385105147453'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/what-is-xml-dtd-and-xslt.html' title='What is XML, DTD and XSLT?'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-2174374147860746000</id><published>2007-02-19T18:39:00.000+05:30</published><updated>2007-02-19T18:40:12.378+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='xhtml'/><category scheme='http://www.blogger.com/atom/ns#' term='learn'/><category scheme='http://www.blogger.com/atom/ns#' term='dtd'/><category scheme='http://www.blogger.com/atom/ns#' term='yahoo'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>XHTML</title><content type='html'>What is XHTML?&lt;br /&gt;&lt;br /&gt;    * XHTML stands for eXtensible Hyper Text Markup Language.&lt;br /&gt;    * It is aimed to replace HTML.&lt;br /&gt;    * It is almost identical to HTML 4.01&lt;br /&gt;    * It is the reformulation of HTML 4.01 as an application of XML.&lt;br /&gt;    * It is a stricter, tidier version of HTML.&lt;br /&gt;&lt;br /&gt;XHTML 1.0 is the next level of coding as specified by the W3C.&lt;br /&gt;&lt;br /&gt;XHTML is a transition / combination of HTML and XML. To change from HTML to XHTML requires just a few changes in your coding styles. The main page to check out is CONVERTING but all the others provide valuable information about this coding technique as well.&lt;br /&gt;&lt;br /&gt;XHTML provides the framework for future extensions of HTML and aims to replace HTML in the future. Some resources refer to XHTML as HTML5.&lt;br /&gt;&lt;br /&gt;XHTML 1.0 became an official W3C recommendation on January 26, 2000. A W3C recommendation means that the specification is stable, that it has been reviewed by the W3C membership, and that the specification is now a Web standard.&lt;br /&gt;&lt;br /&gt;XHTML 1.0 is the first step toward a modular and extensible web environment based on XML (eXtensible Markup Language). It provides the bridge for web designers to use a future based coding and still be able to maintain compatibility with today's browsers.&lt;br /&gt;&lt;br /&gt;SGML stands for Standard Generalized Markup Language. Simply put, it is the very root coding of coding. HTML is an application of SGML. XML is a simplified subset of SGML.&lt;br /&gt;&lt;br /&gt;DTD stands for Document Type Declaration. It is a set of instructions that states what tags are usable and what (re)action they create. Each browser has a DTD set in it's programming set by the browser companies. This is how some tags will work in only one type of browser or version. It has the tags stated in it's DTD. XML makes it possible to create unique tag sets by applying it's own DTD. This makes the DTD more compatable with more browsers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-2174374147860746000?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/2174374147860746000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=2174374147860746000' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2174374147860746000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/2174374147860746000'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/xhtml.html' title='XHTML'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-5365841622768917629</id><published>2007-02-17T19:10:00.000+05:30</published><updated>2007-02-17T19:21:29.112+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='mp3info'/><category scheme='http://www.blogger.com/atom/ns#' term='64bit'/><category scheme='http://www.blogger.com/atom/ns#' term='patch'/><title type='text'>ruby-mp3info gem patch</title><content type='html'>IF you are using the gem "ruby-mp3info", it will work well in windows. but in linux, it wont. Coz mp3info will throw errors on 64 bit versions of Ruby.&lt;br /&gt;&lt;br /&gt;To clear this problem, you have to apply the following patch which allows mp3info to work on 64 bit versions of Ruby...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Remove the NumericBits module from extension_modules.rb.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Remove "head.extend(NumericBits)" from mp3info.rb&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Add this to the top of mp3info.rb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-class Bignum&lt;br /&gt;-   def bits(b, a)&lt;br /&gt;-      t = 0&lt;br /&gt;-      b.downto(a){ |i| t += t + self[i] }&lt;br /&gt;-      t&lt;br /&gt;-   end&lt;br /&gt;-end&lt;br /&gt;&lt;br /&gt;And the most important point is&lt;br /&gt;&lt;br /&gt;you have to include "rubygems" while including "mp3info"&lt;br /&gt;like this&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;require "rubygems"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;require "mp3info"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;otherwise it will throw "no such file to load" error....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-5365841622768917629?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/5365841622768917629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=5365841622768917629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5365841622768917629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5365841622768917629'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/ruby-mp3info-gem-patch.html' title='ruby-mp3info gem patch'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-6906168732238688448</id><published>2007-02-15T10:24:00.000+05:30</published><updated>2007-02-15T10:36:56.065+05:30</updated><title type='text'>Having trouble in installing gems???</title><content type='html'>Many Rails developers have faced problems installing gems with the updated RubyGems release. solution to this problem is given here...&lt;br /&gt;&lt;br /&gt;Problem:&lt;br /&gt;&lt;br /&gt;" gem update mysql Updating installed gems… ERROR: While executing gem … (NoMethodError) undefined   &lt;br /&gt;  method `refresh’ for #"&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;...you should remove your local source_cache file. This is the file that locally caches any gem metadata from the gem server to avoid having to re-download it every time you execute a gem command.&lt;br /&gt;&lt;br /&gt;To discover the location of this file on your system, run the following command:&lt;br /&gt;&lt;br /&gt;$ gem env&lt;br /&gt;RubyGems Environment:&lt;br /&gt;  - VERSION: 0.9.2 (0.9.2)&lt;br /&gt;  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8&lt;br /&gt;  - GEM PATH:&lt;br /&gt;     - /usr/local/lib/ruby/gems/1.8&lt;br /&gt;  - REMOTE SOURCES:&lt;br /&gt;     - http://gems.rubyforge.org&lt;br /&gt;&lt;br /&gt;The source_cache file should be in the path labeled by GEM PATH. Removing that file should clear up any related issues.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-6906168732238688448?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/6906168732238688448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=6906168732238688448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6906168732238688448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6906168732238688448'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/having-trouble-in-installing-gems.html' title='Having trouble in installing gems???'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-4029761974607884717</id><published>2007-02-06T13:55:00.000+05:30</published><updated>2007-02-06T17:11:00.798+05:30</updated><title type='text'>Form helper methods</title><content type='html'>&lt;h4 class="pudge-member-name"&gt;       &lt;tt&gt;       &lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#form" class="pudge-obj-link"&gt;form&lt;/a&gt;(url)&lt;/tt&gt;       &lt;a href="http://pylonshq.com/WebHelpers/webhelpers/rails/form_tag.py.html?f=8&amp;amp;l=32#8" title="View Source"&gt;...&lt;/a&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Starts a form tag that points the action to an url.     &lt;/p&gt;     &lt;p&gt;The url options should be given either as a string, or as a &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;url()&lt;/span&gt;&lt;/tt&gt; function. The method for the form defaults to POST.&lt;/p&gt; &lt;p&gt;Options:&lt;/p&gt; &lt;ul class="simple"&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;multipart&lt;/span&gt;&lt;/tt&gt; - If set to True, the enctype is set to "multipart/form-data".&lt;/li&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;method&lt;/span&gt;&lt;/tt&gt; - The method to use when submitting the form, usually either "get" or "post".&lt;/li&gt;&lt;/ul&gt;        &lt;/div&gt;      &lt;div class="pudge-member routine"&gt;     &lt;a name="start_form"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt; &lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#start_form" class="pudge-obj-link"&gt;start_form&lt;/a&gt;(url)&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Starts a form tag that points the action to an url.     &lt;/p&gt;     &lt;p&gt;The url options should be given either as a string, or as a &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;url()&lt;/span&gt;&lt;/tt&gt; function. The method for the form defaults to POST.&lt;/p&gt; &lt;p&gt;Options:&lt;/p&gt; &lt;ul class="simple"&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;multipart&lt;/span&gt;&lt;/tt&gt; - If set to True, the enctype is set to "multipart/form-data".&lt;/li&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;method&lt;/span&gt;&lt;/tt&gt; - The method to use when submitting the form, usually either "get" or "post".&lt;/li&gt;&lt;/ul&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="end_form"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt; &lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#end_form" class="pudge-obj-link"&gt;end_form&lt;/a&gt;()&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Outputs ""     &lt;/p&gt;             &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="select"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt; &lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#select" class="pudge-obj-link"&gt;select&lt;/a&gt;(name, option_tags='')&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a dropdown selection box     &lt;/p&gt;     &lt;p&gt;     &lt;tt class="docutils literal"&gt;     &lt;span class="pre"&gt;option_tags&lt;/span&gt;&lt;/tt&gt; is a string containing the option tags for the select box:&lt;/p&gt; &lt;pre class="literal-block"&gt;&gt;&gt;&gt; select("people", "George")&lt;br /&gt;&lt;select id="people" name="people"&gt;&lt;option&gt;George&lt;/option&gt;&lt;/select&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Options:&lt;/p&gt; &lt;ul class="simple"&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;multiple&lt;/span&gt;&lt;/tt&gt; - If set to true the selection will allow multiple choices.&lt;/li&gt;&lt;/ul&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="text_field"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#text_field" class="pudge-obj-link"&gt;text_field&lt;/a&gt;(name, value=None)&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a standard text field.     &lt;/p&gt;     &lt;p&gt;     &lt;tt class="docutils literal"&gt;     &lt;span class="pre"&gt;value&lt;/span&gt;&lt;/tt&gt; is a string that will the contents of the text field will be set to&lt;/p&gt; &lt;p&gt;Options:&lt;/p&gt; &lt;ul class="simple"&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;disabled&lt;/span&gt;&lt;/tt&gt; - If set to True, the user will not be able to use this input.&lt;/li&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;size&lt;/span&gt;&lt;/tt&gt; - The number of visible characters that will fit in the input.&lt;/li&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;maxlength&lt;/span&gt;&lt;/tt&gt; - The maximum number of characters that the browser will allow the user to enter.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Remaining keyword options will be standard HTML options for the tag.&lt;/p&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="hidden_field"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#hidden_field" class="pudge-obj-link"&gt;hidden_field&lt;/a&gt;(name, value=None)&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a hidden field     &lt;/p&gt;     &lt;p&gt;Takes the same options as text_field&lt;/p&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="file_field"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#file_field" class="pudge-obj-link"&gt;file_field&lt;/a&gt;(name, value=None)&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a file upload field.     &lt;/p&gt;     &lt;p&gt;If you are using file uploads then you will also need to set the multipart option for the form.&lt;/p&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="password_field"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#password_field" class="pudge-obj-link"&gt;password_field&lt;/a&gt;(name='password', value=None)&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a password field     &lt;/p&gt;     &lt;p&gt;Takes the same options as text_field&lt;/p&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="text_area"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#text_area" class="pudge-obj-link"&gt;text_area&lt;/a&gt;(name, content='')&lt;/tt&gt;      &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a text input area.     &lt;/p&gt;     &lt;p&gt;Options:&lt;/p&gt; &lt;ul class="simple"&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;size&lt;/span&gt;&lt;/tt&gt; - A string specifying the dimensions of the textarea.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Example:&lt;/p&gt; &lt;pre class="literal-block"&gt;&gt;&gt;&gt; text_area("body", '', size="25x10")&lt;br /&gt;&lt;textarea name="body" id="body" cols="25" rows="10"&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;/pre&gt;        &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="check_box"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#check_box" class="pudge-obj-link"&gt;check_box&lt;/a&gt;(name, value='1', checked=False)&lt;/tt&gt;     &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a check box.     &lt;/p&gt;             &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="radio_button"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#radio_button" class="pudge-obj-link"&gt;radio_button&lt;/a&gt;(name, value, checked=False)&lt;/tt&gt;      &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a radio button.     &lt;/p&gt;             &lt;/div&gt;   &lt;/div&gt;   &lt;div class="pudge-member routine"&gt;     &lt;a name="submit"&gt;     &lt;/a&gt;     &lt;h4 class="pudge-member-name"&gt;     &lt;span class="prefix"&gt;&lt;/span&gt;&lt;tt&gt;&lt;a href="http://pylonshq.com/WebHelpers/module-webhelpers.rails.form_tag.html#submit" class="pudge-obj-link"&gt;submit&lt;/a&gt;(value='Save changes', name='commit')&lt;/tt&gt;      &lt;/h4&gt;     &lt;div class="pudge-section rst"&gt;            &lt;p class="pudge-member-blurb"&gt;       Creates a submit button with the text &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;value&lt;/span&gt;&lt;/tt&gt; as the caption.     &lt;/p&gt;     &lt;p&gt;Options:&lt;/p&gt; &lt;ul class="simple"&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;confirm&lt;/span&gt;&lt;/tt&gt; - A confirm message displayed when the button is clicked.&lt;/li&gt;&lt;li&gt; &lt;tt class="docutils literal"&gt; &lt;span class="pre"&gt;disable_with&lt;/span&gt;&lt;/tt&gt; - The value to be used to rename a disabled version of the submit button.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If options contains a keyword pair with the key of "disable_with", then the value will be used to rename a disabled version of the submit button.&lt;/p&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/26100023-4029761974607884717?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/4029761974607884717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=4029761974607884717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/4029761974607884717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/4029761974607884717'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/02/form-helper-methods.html' title='Form helper methods'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-9201641179791599424</id><published>2007-01-25T13:37:00.000+05:30</published><updated>2007-01-25T13:41:18.984+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='mongrel'/><title type='text'>Mongrel 1.0.1</title><content type='html'>To coincide with Rails 1.2.1, Zed just made &lt;a href="http://mongrel.rubyforge.org/news.html"&gt;Mongrel 1.0.1 official&lt;/a&gt;.  He also points out that he started working on Mongrel around January, making it &lt;em&gt;around&lt;/em&gt; 1 year old too.&lt;br /&gt;i installed the new mongrel. it works well in local&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-9201641179791599424?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/9201641179791599424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=9201641179791599424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/9201641179791599424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/9201641179791599424'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/mongrel-10.html' title='Mongrel 1.0.1'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-1250920753953482842</id><published>2007-01-18T10:09:00.000+05:30</published><updated>2007-01-18T10:15:39.381+05:30</updated><title type='text'>Unicode in Rails application</title><content type='html'>To avoid Unicode related problems,  add the following line to the environment.rb file&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-weight: bold;"&gt;$KCODE = 'u'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and  add the following line to the database.yml file while&lt;br /&gt;establishing a database connection&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-weight: bold;"&gt;encoding: utf8&lt;br /&gt;&lt;br /&gt;In Rails 1.2 , Unicode hack is a built in feature&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-1250920753953482842?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/1250920753953482842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=1250920753953482842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/1250920753953482842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/1250920753953482842'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/unicode-in-rails-application.html' title='Unicode in Rails application'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-4479131569816883290</id><published>2007-01-12T17:56:00.000+05:30</published><updated>2007-01-12T18:03:06.913+05:30</updated><title type='text'>Install These Plugins</title><content type='html'>The Following search engine plugins  will be useful for a ROR developer&lt;br /&gt;&lt;br /&gt;Install These plugins in your firefox browser...&lt;br /&gt;&lt;br /&gt;&lt;img src="http://mycroft.mozdev.org/install.php/7260/koders.rb.png" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 7260 (koders.rb)" onclick="addEngine('koders.rb','png','Programming','7260');return false"&gt;Koders (Ruby)&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://www.koders.com/"&gt;koders.com&lt;/a&gt;&lt;!--n--&gt;) by Diogenes de Araujo&lt;br /&gt; &lt;img src="http://mycroft.mozdev.org/install.php/8134/raa.png" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 8134 (raa)" onclick="addEngine('raa','png','Programming','8134');return false"&gt;Ruby Application Archive&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://raa.ruby-lang.org/search.rhtml"&gt;raa.ruby-lang.org&lt;/a&gt;&lt;!--n--&gt;) by Shusaku Yokota&lt;br /&gt; &lt;img src="http://mycroft.mozdev.org/install.php/11303/ruby.png" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 11303 (ruby)" onclick="addEngine('ruby','png','Programming','11303');return false"&gt;Ruby Manual&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://www.rubymanual.org/doc/search"&gt;rubymanual.org&lt;/a&gt;&lt;!--n--&gt;) by Gregoire Lejeune&lt;br /&gt;  &lt;img src="http://mycroft.mozdev.org/install.php/7243/rubyonrails.gif" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 7243 (rubyonrails)" onclick="addEngine('rubyonrails','gif','Programming','7243');return false"&gt;Ruby on Rails&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://weblog.rubyonrails.org/"&gt;rubyonrails.org&lt;/a&gt;&lt;!--n--&gt;) by Kenn A. Thisted&lt;br /&gt;  &lt;img src="http://mycroft.mozdev.org/install.php/11304/rails.png" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 11304 (rails)" onclick="addEngine('rails','png','Programming','11304');return false"&gt;Ruby on Rails Manual&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://www.railsmanual.org/doc/search"&gt;railsmanual.org&lt;/a&gt;&lt;!--n--&gt;) by Gregoire Lejeune&lt;br /&gt;  &lt;img src="http://mycroft.mozdev.org/install.php/13652/rubycorner.png" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 13652 (rubycorner)" onclick="addEngine('rubycorner','png','Programming','13652');return false"&gt;RubyCorner&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://www.google.com/coop/cse?cx=010173420937670506482%3Ap-zcpeezuko"&gt;rubycorner.com&lt;/a&gt;&lt;!--n--&gt;) by Edgar González&lt;br /&gt;  &lt;img src="http://mycroft.mozdev.org/install.php/10718/rubyforge.gif" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 10718 (rubyforge)" onclick="addEngine('rubyforge','gif','Programming','10718');return false"&gt;RubyForge&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://www.rubyforge.net/search/"&gt;rubyforge.net&lt;/a&gt;&lt;!--n--&gt;) by Raghuraman Suraj&lt;br /&gt;  &lt;img src="http://mycroft.mozdev.org/install.php/8535/rubyonrailsapi.png" alt="Plugin Icon" height="16" width="16" /&gt; &lt;a href="http://mycroft.mozdev.org/jsreq.html" title="Ref: 8535 (rubyonrailsapi)" onclick="addEngine('rubyonrailsapi','png','Programming','8535');return false"&gt;RubyOnRails API&lt;/a&gt; &lt;img src="http://mycroft.mozdev.org/images/semi.png" alt="Semi" title="No sidebar results" height="16" width="16" /&gt; &lt;img src="http://mycroft.mozdev.org/images/flags/WW.png" alt="en-WW" title="en-WW" height="16" /&gt; (&lt;!--m--&gt;&lt;a href="http://api.rubyonrails.com/"&gt;api.rubyonrails.com&lt;/a&gt;&lt;!--n--&gt;) by Robert Gaal&lt;br /&gt;&lt;br /&gt;To download these plugins, click &lt;a href="http://mycroft.mozdev.org/download.html?name=ruby"&gt;http://mycroft.mozdev.org/download.html?name=ruby&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-4479131569816883290?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/4479131569816883290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=4479131569816883290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/4479131569816883290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/4479131569816883290'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/install-these-plugins.html' title='Install These Plugins'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-3507963681048673706</id><published>2007-01-10T09:04:00.000+05:30</published><updated>2007-01-10T09:38:03.029+05:30</updated><title type='text'>Ruby Enters Top 10 Programming Languages at TIOBE</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_bT7-x4Ar0l8/RaRiT-iHyPI/AAAAAAAAAAU/D5vEaSyetW8/s1600-h/ruby.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_bT7-x4Ar0l8/RaRiT-iHyPI/AAAAAAAAAAU/D5vEaSyetW8/s200/ruby.JPG" alt="" id="BLOGGER_PHOTO_ID_5018243980140726514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ruby Enters Top 10 programming Languages at TIOBE&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;It seems that one day &lt;span style="font-weight: bold;"&gt;ruby&lt;/span&gt; will defeat Python, Perl, PHP and other stuffs... coz you can observe that ruby has climbed steadily throughout the year 2006. and it also got the TIOBE's award of &lt;span style="font-weight: bold;"&gt;"Programming Language Of 2006". &lt;/span&gt;  &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;p&gt;TIOBE says:&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;We are glad to announce that Ruby has become "Programming Language of the Year 2006". Ruby has the highest popularity increase in a year of all programming languages (+2.15%). Runner up this year is JavaScript with +1.31%. Both languages are boosted by their corresponding frameworks, Ruby On Rails and Ajax. This might be a new trend. In the recent past it was necessary to have a large company behind the language to get it in the spotlight (Sun with Java, Microsoft with C#), but nowadays a killer app appears to be sufficient. Viral marketing via the Internet works!&lt;/p&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-3507963681048673706?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/3507963681048673706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=3507963681048673706' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3507963681048673706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3507963681048673706'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/ruby-enters-top-10-programming.html' title='Ruby Enters Top 10 Programming Languages at TIOBE'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_bT7-x4Ar0l8/RaRiT-iHyPI/AAAAAAAAAAU/D5vEaSyetW8/s72-c/ruby.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-1345409941190422796</id><published>2007-01-09T09:13:00.000+05:30</published><updated>2007-01-09T09:33:12.992+05:30</updated><title type='text'>Interesting Array Methods - Ruby on Rails</title><content type='html'>&lt;p&gt;&lt;strong&gt;1. to_sentence&lt;/strong&gt; (Array)&lt;/p&gt;    &lt;p&gt;Use to join elements of an array into a more English-friendly representation.&lt;/p&gt;   &lt;pre&gt;&gt;&gt; %w[Chris Mark Steven].to_sentence&lt;br /&gt;=&gt; "Chris, Mark, and Steven" &lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;You can pass it two options: &lt;span&gt;:connector&lt;/span&gt; and &lt;span&gt;skip_last_comma&lt;/span&gt;.  They work like a’this:&lt;/p&gt;   &lt;pre&gt;&gt;&gt; %w[Soap Mocha Chocolate].to_sentence(:connector =&gt; '&amp;')&lt;br /&gt;=&gt; "Soap, Mocha, &amp;amp; Chocolate"&lt;br /&gt;&gt;&gt; %w[Ratatat Interpol Beirut].to_sentence(:skip_last_comma =&gt; true)&lt;br /&gt;=&gt; "Ratatat, Interpol and Beirut" &lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt;2. to_param&lt;/strong&gt; (Array)&lt;/p&gt;    &lt;p&gt;This guy, in case you’re unawares, is the method Rails calls on any object when trying to figure out how the object should be represented in a &lt;span&gt;URL&lt;/span&gt;.&lt;/p&gt;    &lt;p&gt;For instance, on an &lt;span&gt;ActiveRecord::Base&lt;/span&gt; object:&lt;/p&gt;   &lt;pre&gt;&gt;&gt; user = User.find(:first)&lt;br /&gt;=&gt; #&lt;user:0x2905504&gt; &lt;br /&gt;&gt;&gt; helper.url_for :controller =&gt; 'users', :action =&gt; 'show', :id =&gt; user&lt;br /&gt;=&gt; "/users/1"&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;Now let’s say we override the &lt;span&gt;to_param&lt;/span&gt; instance method on &lt;span&gt;User&lt;/span&gt; to return &lt;span&gt;name&lt;/span&gt;:&lt;/p&gt;   &lt;pre&gt;&gt;&gt; user = User.find(:first)&lt;br /&gt;=&gt; #&lt;user:0x28fe31c&gt; &lt;br /&gt;&gt;&gt; helper.url_for :controller =&gt; 'users', :action =&gt; 'show', :id =&gt; user&lt;br /&gt;=&gt; "/users/chris"&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;Cool.  That said, the &lt;span&gt;Array&lt;/span&gt; version of &lt;span&gt;to_param&lt;/span&gt; joins elements with a &lt;span&gt;/&lt;/span&gt;.&lt;/p&gt;   &lt;pre&gt;&gt;&gt; helper.url_for :controller =&gt; 'users', :action =&gt; 'show', :id =&gt; %w[one two three]&lt;br /&gt;=&gt; "/users/one%2Ftwo%2Fthree"&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;(That’s escaped, of course.)  This is so you can easily send and deal with catch-all routes.  &lt;a target="_blank" href="http://railsforum.com/viewtopic.php?pid=3723"&gt;This thread&lt;/a&gt; on RailsForum goes into catch-all routes.  You may or may not find them useful.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;3. to_s&lt;/strong&gt; (Array)&lt;/p&gt;    &lt;p&gt;Sure, you know &lt;span&gt;Array&lt;/span&gt; has a &lt;span&gt;to_s&lt;/span&gt;, but did you know Rails overrides it to accept a format (&lt;span&gt;:db&lt;/span&gt;) parameter?  That’s right!  Check it out:&lt;/p&gt;   &lt;pre&gt;&gt;&gt; array_of_posts = Post.find(:all, :limit =&gt; 3)&lt;br /&gt;=&gt; [#&lt;post:0x28c1ef8&gt;, #&lt;post:0x28c1de0&gt;, #&lt;post:0x28c1d54&gt;]&lt;br /&gt;&gt;&gt; array_of_posts.to_s(:db)&lt;br /&gt;=&gt; "1,2,3"&lt;br /&gt;&gt;&gt; [].to_s&lt;br /&gt;=&gt; ""&lt;br /&gt;&gt;&gt; [].to_s(:db)&lt;br /&gt;=&gt; "null"&lt;br /&gt;&lt;/pre&gt;     &lt;p&gt;This really only works with &lt;span&gt;ActiveRecord&lt;/span&gt; objects, as Rails tries to call &lt;span&gt;#id&lt;/span&gt; on the elements of the array.  Unlike &lt;span&gt;Time&lt;/span&gt;, this &lt;span&gt;to_s&lt;/span&gt; currently doesn’t provide a hook for you to add more formats.  One day?  One day.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;4. to_xml&lt;/strong&gt; (Array)&lt;/p&gt;    &lt;p&gt;Another more-or-less &lt;span&gt;ActiveRecord&lt;/span&gt; specific extension, you may call &lt;span&gt;to_xml&lt;/span&gt; on an array when &lt;em&gt;all&lt;/em&gt; the elements of the array respond to &lt;span&gt;to_xml&lt;/span&gt;.  Like, you know, an array of &lt;span&gt;ActiveRecord&lt;/span&gt; objects.&lt;/p&gt;   &lt;pre&gt;&gt;&gt; puts array_of_posts.to_xml&lt;br /&gt;=&gt; "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;br /&gt;&lt;posts&gt;&lt;br /&gt; &lt;post&gt;&lt;br /&gt;   ... tons of xml ...&lt;br /&gt; &lt;/post&gt;&lt;br /&gt;&lt;/posts&gt; &lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;Pass in &lt;span&gt;:skip_instruct&lt;/span&gt; to omit the &lt;span&gt;&lt;?xml version…&lt;/span&gt; line.  You can also provide an &lt;span&gt;:indent&lt;/span&gt; option (default: 2), a &lt;span&gt;:builder&lt;/span&gt; option (you probably want to stick with the default of &lt;span&gt;Builder::XmlMarkup&lt;/span&gt;), a &lt;span&gt;:root&lt;/span&gt; option (defaults to the lowercase plural name of the class, &lt;span&gt;posts&lt;/span&gt; in this case), and a &lt;span&gt;children&lt;/span&gt; option (singular lowercase class—&lt;span&gt;post&lt;/span&gt; for me).&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;5. in_groups_of&lt;/strong&gt; (Array)&lt;/p&gt;    &lt;p&gt;The docs have this one covered pretty well: “&lt;em&gt;Iterate over an array in groups of a certain size, padding any remaining slots with specified value (&lt;span&gt;nil&lt;/span&gt; by default) unless it is &lt;span&gt;false&lt;/span&gt;.&lt;/em&gt;“&lt;/p&gt;    &lt;p&gt;And, three examples.  This is almost cheating.  But here:&lt;/p&gt;   &lt;pre&gt;&gt;&gt; %w[1 2 3 4 5 6 7].in_groups_of(3) { |g| p g }&lt;br /&gt;["1", "2", "3"]&lt;br /&gt;["4", "5", "6"]&lt;br /&gt;["7", nil, nil]&lt;br /&gt;&lt;br /&gt;&gt;&gt; %w[1 2 3].in_groups_of(2, ' ') { |g| p g }&lt;br /&gt;["1", "2"]&lt;br /&gt;["3", " "]&lt;br /&gt;&lt;br /&gt;&gt;&gt; %w[1 2 3].in_groups_of(2, false) { |g| p g }&lt;br /&gt;["1", "2"]&lt;br /&gt;["3"]&lt;br /&gt;&lt;br /&gt;&gt;&gt; %w[1 2 3 4 5 6 7].in_groups_of(3)&lt;br /&gt;=&gt; [["1", "2", "3"], ["4", "5", "6"], ["7", nil, nil]]&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt;6. split&lt;/strong&gt; (Array)&lt;/p&gt;    &lt;p&gt;Cuts up an array into smaller arrays in the same way &lt;span&gt;String.split&lt;/span&gt; cuts up a string into arrays. Can take a parameter (a value to cut on) or a block (where the result is what’s used for the cuttin’).&lt;/p&gt;   &lt;pre&gt;&gt;&gt; %w[Tom Jerry and Mickey and Pluto].split('and')&lt;br /&gt;=&gt; [["Tom", "Jerry"], ["Mickey"], ["Pluto"]] &lt;br /&gt;&gt;&gt; %w[Chris Mark Adam Tommy Martin Oliver].split { |name| name.first == 'M' }&lt;br /&gt;=&gt; [["Chris"], ["Adam", "Tommy"], ["Oliver"]]&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/26100023-1345409941190422796?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/1345409941190422796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=1345409941190422796' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/1345409941190422796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/1345409941190422796'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/interesting-array-methods-ruby-on-rails.html' title='Interesting Array Methods - Ruby on Rails'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-5047359466581194435</id><published>2007-01-09T09:05:00.000+05:30</published><updated>2007-01-09T09:12:04.697+05:30</updated><title type='text'>Stringy Shortcuts [ String Methods ] - Ruby on Rails</title><content type='html'>&lt;h3&gt;&lt;span style="font-size:85%;"&gt;Seven Satisfying Stringy Shortcuts&lt;/span&gt;&lt;br /&gt;&lt;/h3&gt;    &lt;p&gt;&lt;strong&gt;1: at&lt;/strong&gt; (String)&lt;/p&gt;       &lt;pre&gt;&gt;&gt; "Finally, something useful!".at(6)&lt;br /&gt;=&gt; "y"&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt; 2: from&lt;/strong&gt; and &lt;strong&gt;to&lt;/strong&gt; (String)&lt;/p&gt;       &lt;pre&gt;&gt;&gt; "Chris the Person".from(6)&lt;br /&gt;=&gt; "the Person"&lt;br /&gt;&gt;&gt; "Chris the Person".to(4)&lt;br /&gt;=&gt; "Chris"&lt;br /&gt;&lt;/pre&gt;       &lt;p&gt;&lt;strong&gt;3: first&lt;/strong&gt; and &lt;strong&gt;last&lt;/strong&gt; (String)&lt;/p&gt;       &lt;pre&gt;&gt;&gt; "Christmas Time".first&lt;br /&gt;=&gt; "C"&lt;br /&gt;&gt;&gt; "Christmas Time".first(5)&lt;br /&gt;=&gt; "Chris"&lt;br /&gt;&gt;&gt; "Christmas Time".last&lt;br /&gt;=&gt; "e"&lt;br /&gt;&gt;&gt; "Christmas Time".last(4)&lt;br /&gt;=&gt; "Time"&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt;4: each_char&lt;/strong&gt; (String)&lt;/p&gt;       &lt;pre&gt;&gt;&gt; "Snow".each_char { |i| print i.upcase }&lt;br /&gt;SNOW&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt;5: starts_with?&lt;/strong&gt; and &lt;strong&gt;ends_with?&lt;/strong&gt; (String)&lt;/p&gt;       &lt;pre&gt;&gt;&gt; "Peanut Butter".starts_with? 'Peanut'&lt;br /&gt;=&gt; true&lt;br /&gt;&gt;&gt; "Peanut Butter".ends_with? 'Nutter'&lt;br /&gt;=&gt; false&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt;6: to_time&lt;/strong&gt; and &lt;strong&gt;to_date&lt;/strong&gt; (String)&lt;/p&gt;       &lt;pre&gt;&gt;&gt; "1985-03-13".to_time&lt;br /&gt;=&gt; Wed Mar 13 00:00:00 UTC 1985&lt;br /&gt;&gt;&gt; "1985-03-13".to_date&lt;br /&gt;=&gt; #&lt;date:&gt;&lt;br /&gt;&lt;/date:&gt;&lt;/pre&gt;   &lt;p&gt;&lt;strong&gt;7: transformations!&lt;/strong&gt; (String)&lt;/p&gt;    &lt;p&gt;Use these Methods&lt;/p&gt;    &lt;p&gt;&lt;span&gt;pluralize&lt;/span&gt;, &lt;span&gt;singularize&lt;/span&gt;, &lt;span&gt;camelize&lt;/span&gt;, &lt;span&gt;titleize&lt;/span&gt;, &lt;span&gt;underscore&lt;/span&gt;, &lt;span&gt;dasherize&lt;/span&gt;, &lt;span&gt;demodulize&lt;/span&gt;, &lt;span&gt;tableize&lt;/span&gt;, &lt;span&gt;classify&lt;/span&gt;, &lt;span&gt;humanize&lt;/span&gt;, &lt;span&gt;foreign_key&lt;/span&gt;, and &lt;span&gt;constantize&lt;/span&gt;&lt;/p&gt;   &lt;pre&gt;&gt;&gt; "reindeer".pluralize&lt;br /&gt;=&gt; "reindeers"&lt;br /&gt;&gt;&gt; "elves".singularize&lt;br /&gt;=&gt; "elf"&lt;br /&gt;&gt;&gt; "christmas_carol".camelize&lt;br /&gt;=&gt; "ChristmasCarol"&lt;br /&gt;&gt;&gt; "christmas_carol".camelize(:lower)&lt;br /&gt;=&gt; "christmasCarol"&lt;br /&gt;&gt;&gt; "holiday_cheer".titleize&lt;br /&gt;=&gt; "Holiday Cheer"&lt;br /&gt;&gt;&gt; "AdventCalendar-2006".underscore&lt;br /&gt;=&gt; "advent_calendar_2006"&lt;br /&gt;&gt;&gt; "santa_Claus".dasherize&lt;br /&gt;=&gt; "santa-Claus"&lt;br /&gt;&gt;&gt; "Holiday::December::Christmas".demodulize&lt;br /&gt;=&gt; "Christmas"&lt;br /&gt;&gt;&gt; "SnowStorm".tableize&lt;br /&gt;=&gt; "snow_storms"&lt;br /&gt;&gt;&gt; "snow_storms".classify&lt;br /&gt;=&gt; "SnowStorm"&lt;br /&gt;&gt;&gt; "present_id".humanize&lt;br /&gt;=&gt; "Present"&lt;br /&gt;&gt;&gt; "Present".foreign_key&lt;br /&gt;=&gt; "present_id"&lt;br /&gt;&gt;&gt; "Cheer".constantize&lt;br /&gt;NameError: uninitialized constant Cheer&lt;br /&gt;&gt;&gt; "Christmas".constantize&lt;br /&gt;=&gt; Christmas&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/26100023-5047359466581194435?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/5047359466581194435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=5047359466581194435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5047359466581194435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/5047359466581194435'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/stringy-shortcuts-string-methods-ruby.html' title='Stringy Shortcuts [ String Methods ] - Ruby on Rails'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-3342057498450503143</id><published>2007-01-08T10:31:00.000+05:30</published><updated>2007-01-08T11:13:03.337+05:30</updated><title type='text'>Mod_Dosevasive in Apache</title><content type='html'>&lt;h4 style="font-weight: bold;" class="docSection2Title"&gt;&lt;span style="font-size:130%;"&gt;What Is &lt;span class="docEmphasis"&gt;Mod_Dosevasive?&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;tt&gt;Mod_Dosevasive&lt;/tt&gt; is an evasive&lt;a name="iddle2069"&gt;&lt;/a&gt;&lt;a name="iddle2070"&gt;&lt;/a&gt;&lt;a name="iddle2071"&gt;&lt;/a&gt; maneuvers module for Apache whose  purpose is to react to HTTP DoS and/or Brute Force attacks.&lt;br /&gt;An additional capability of the module is that it is also able to execute system  commands when DoS attacks are identified. This provides an interface to send  attacking IP addresses to other security applications such as local host-based  firewalls to block the offending IP address. &lt;tt&gt;Mod_Dosevasive&lt;/tt&gt; performs  well in both single-server attacks, as well as distributed attacks; however, as  with any DoS attack, the real concern is network bandwidth and processor/ RAM  usage.&lt;br /&gt;&lt;br /&gt;&lt;h4 style="font-weight: bold;" class="docSection2Title"&gt;&lt;span style="font-size:130%;"&gt;How Does &lt;span class="docEmphasis"&gt;Mod_Dosevasive&lt;/span&gt; Work?&lt;/span&gt;&lt;/h4&gt;&lt;a name="iddle2076"&gt;&lt;/a&gt;&lt;a name="iddle2077"&gt;&lt;/a&gt;&lt;a name="iddle2078"&gt;&lt;/a&gt;&lt;a name="iddle2079"&gt;&lt;/a&gt;&lt;tt&gt;Mod_Dosevasive&lt;/tt&gt; identifies  attacks&lt;a name="iddle2080"&gt;&lt;/a&gt;&lt;a name="iddle2081"&gt;&lt;/a&gt;&lt;a name="iddle2082"&gt;&lt;/a&gt; by  creating and using an internal dynamic hash table of IP Addresses to URIs pairs  based on the requests received. When a new request comes into Apache,  &lt;tt&gt;Mod_Dosevasive&lt;/tt&gt; will perform the following tasks: &lt;ul&gt;&lt;li&gt; &lt;p class="docList"&gt;The IP address of the client is checked in the temporary  blacklist of the hash table. If the IP address is listed, then the client is  denied access with a 403 Forbidden.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;If the client is not currently on the blacklist, then the IP  address of the client and the Universal Resource Identifier (URI) being  requested are hashed into a key. &lt;tt&gt;Mod_Dosevasive&lt;/tt&gt; will then check the  listener's hash table to verify if any of the same hashes exist. If it does, it  will then evaluate the total number of matched hashes and the timeframe that  they were requested in versus the thresholds specified in the  &lt;tt&gt;httpd.conf&lt;/tt&gt; file by the &lt;tt&gt;Mod_Dosevasive&lt;/tt&gt; directives.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;If the request does not get denied by the preceding check, then  just the IP address of the client is hashed into a key. The module will then  check the hash table in the same fashion as above. The only difference with this  check is that it doesn't factor in what URI the client is checking. It checks to  see if the client request number has gone above the threshold set for the entire  site per the time interval specified.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Configuration&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;you should add the following directives to your &lt;tt&gt;httpd.conf&lt;/tt&gt; file&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;" class="docEmphStrong"&gt;LoadModule dosevasive20_module modules/mod_dosevasive20.so&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-weight: bold;"&gt;&lt;ifmodule&gt;&lt;/ifmodule&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-&lt;/span&gt;&lt;ifmodule&gt;&lt;span style="font-weight: bold;"&gt;IfModule mod_dosevasive20.c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-    DOSHashTableSize    3097&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-    DOSPageCount        2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-    DOSSiteCount        50&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-    DOSPageInterval     1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-    DOSSiteInterval     1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-    DOSBlockingPeriod   10&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-/IfModule&lt;/span&gt;&lt;br /&gt;&lt;/ifmodule&gt;&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/26100023-3342057498450503143?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/3342057498450503143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=3342057498450503143' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3342057498450503143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3342057498450503143'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/moddosevasive-in-apache.html' title='Mod_Dosevasive in Apache'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-6507808223702385314</id><published>2007-01-06T10:19:00.000+05:30</published><updated>2007-01-06T10:45:01.325+05:30</updated><title type='text'>Routing  - Really Easy in Rails</title><content type='html'>&lt;span style="font-weight: bold;"&gt;wanna do complex routing in a simple way....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;you can make whatever you imagine for routing... its possible in rails.&lt;br /&gt;Using the rails routing feature, we can do that.&lt;br /&gt;&lt;br /&gt;the following eg code only routes when a code no is included in the URL&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;map.address  'address/:code', :controller =&gt; 'address',:action        =&gt; 'show',:code =&gt; /d{5}(-d{4})?/&lt;br /&gt;&lt;br /&gt;wanna more tips????????  click the following link &lt;/span&gt;&lt;a href="http://www.pinupgeek.com/2006/5/24/rails-routing-demystified"&gt;demystify the routing system in Ruby on Rails&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-6507808223702385314?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/6507808223702385314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=6507808223702385314' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6507808223702385314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/6507808223702385314'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/routing-really-easy-in-rails.html' title='Routing  - Really Easy in Rails'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-3821308256427217722</id><published>2007-01-04T10:43:00.000+05:30</published><updated>2007-01-06T10:45:51.377+05:30</updated><title type='text'>Avoid Exception for Model.find(id)</title><content type='html'>&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When doing a Model.find(id), an exception can be returned if the item with an id of 'id' doesn't exist. If you want to avoid this, use Model.&lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000862"&gt;exists?&lt;/a&gt;(id) first to get a true or false for whether that item exists or not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-3821308256427217722?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/3821308256427217722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=3821308256427217722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3821308256427217722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/3821308256427217722'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/avoid-exception-for-modelfindid.html' title='Avoid Exception for Model.find(id)'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-116773122150210108</id><published>2007-01-02T15:12:00.000+05:30</published><updated>2007-01-06T10:45:41.393+05:30</updated><title type='text'>Creating EXE using ruby</title><content type='html'>&lt;a href="http://www.erikveen.dds.nl/distributingrubyapplications/rails.html"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;http://www.erikveen.dds.nl/distributingrubyapplications/rails.html&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-116773122150210108?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/116773122150210108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=116773122150210108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/116773122150210108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/116773122150210108'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/creating-exe-using-ruby.html' title='Creating EXE using ruby'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-26100023.post-116772022845589077</id><published>2007-01-02T12:08:00.000+05:30</published><updated>2007-01-06T18:38:59.390+05:30</updated><title type='text'>Stop Google Web Accelerator in your Rails apps</title><content type='html'>Use the following code to stop Google Web Accelerator in your Rails apps&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre  style="font-weight: bold;font-family:times new roman;"&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;class &lt;/span&gt;&lt;span class="class"  style="font-size:130%;"&gt;ApplicationController&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="constant"  style="font-size:130%;"&gt;ActionController&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;::&lt;/span&gt;&lt;span class="constant"  style="font-size:130%;"&gt;Base&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;before_filter&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="symbol"  style="font-size:130%;"&gt;:disable_link_prefetching&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;private&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;def &lt;/span&gt;&lt;span class="method"  style="font-size:130%;"&gt;disable_link_prefetching&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;if&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;request&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;.&lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;env&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;["&lt;/span&gt;&lt;span class="string"  style="font-size:130%;"&gt;HTTP_X_MOZ&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"]&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;==&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"&lt;/span&gt;&lt;span class="string"  style="font-size:130%;"&gt;prefetch&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;logger&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;.&lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;debug&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"&lt;/span&gt;&lt;span class="string"  style="font-size:130%;"&gt;prefetch detected: sending 403 Forbidden&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span class="ident"  style="font-size:130%;"&gt;render_nothing&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"&lt;/span&gt;&lt;span class="string"  style="font-size:130%;"&gt;403 Forbidden&lt;/span&gt;&lt;span class="punct"  style="font-size:130%;"&gt;"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;      &lt;/span&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;return&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span class="constant"  style="font-size:130%;"&gt;false&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;end&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;end&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="keyword"  style="font-size:130%;"&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/26100023-116772022845589077?l=thinkingrails.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thinkingrails.blogspot.com/feeds/116772022845589077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=26100023&amp;postID=116772022845589077' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/116772022845589077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26100023/posts/default/116772022845589077'/><link rel='alternate' type='text/html' href='http://thinkingrails.blogspot.com/2007/01/stop-google-web-accelerator-in-your.html' title='Stop Google Web Accelerator in your Rails apps'/><author><name>Arunkumar</name><uri>http://www.blogger.com/profile/07970489828954417072</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://farm1.static.flickr.com/168/412226935_3cc33b3252_o_d.jpg'/></author><thr:total>1</thr:total></entry></feed>
