<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:at="http://www.sixapart.com/ns/at"
    xmlns:icbm="http://postneo.com/icbm"
    xmlns:rvw="http://purl.org/NET/RVW/0.2/"
    xmlns:media="http://search.yahoo.com/mrss">
    <channel>
        <title>Tin Nguyen Trong’s blog</title>
        <link>http://tintn.vox.com/library/posts/page/1/</link>
        <description>The Rails way</description>
        <language>en</language>
        <generator>Vox</generator>
        <lastBuildDate>Sat, 31 Oct 2009 02:04:09 -0700</lastBuildDate>
        <copyright>Copyright 2009</copyright>
        <docs>http://blogs.law.harvard.edu/tech/rss</docs>  
 
        <item>
            <title>Writting JQuery plugin</title>
            <link>http://tintn.vox.com/library/post/writting-jquery-plugin.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/writting-jquery-plugin.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/writting-jquery-plugin.html?_c=feed-rss-full</guid> 
            <pubDate>Sat, 31 Oct 2009 02:04:09 -0700</pubDate>         
            
            <description>    &lt;h4&gt;I figured out the solution of Alias $ in plugin code (I mean that if the user would like to use prototype and JQuery, they use noConflict and how does my plugin work?), I try to build my own JQuery plugin, hope it will come true soon&lt;/h4&gt;&lt;p&gt;&lt;br /&gt;&lt;h4&gt;Custom Alias in plugin code &lt;/h4&gt;
&lt;p&gt;The trick is to define all plugin code inside a function and execute this function immediately. The construct looks like this:
&lt;/p&gt;
&lt;pre&gt;(function() {&lt;br /&gt;  // put plugin code here&lt;br /&gt;  var xyz; // xyz is NOT a global variable, it is only visible inside this function&lt;br /&gt;})(); // execute the function immediately!&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;The additional parentheses are necessary! You can&amp;#39;t execute an anonymous function without them.
&lt;/p&gt;&lt;p&gt;Ok, now to the fun part:
&lt;/p&gt;
&lt;pre&gt;(function($) {&lt;br /&gt;  // plugin code here, use $ as much as you like&lt;br /&gt;  // This is my anwser&lt;br /&gt;})(jQuery);&lt;br /&gt;&lt;/pre&gt;
 &lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/writting-jquery-plugin.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e01240b7205eb860e?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>What is a Credit Card Gateway?</title>
            <link>http://tintn.vox.com/library/post/what-is-a-credit-card-gateway.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/what-is-a-credit-card-gateway.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/what-is-a-credit-card-gateway.html?_c=feed-rss-full</guid> 
            <pubDate>Wed, 05 Aug 2009 02:26:29 -0700</pubDate>         
            
            <description>    &lt;p&gt;I found the answer at&amp;#160; http://www.wisegeek.com/what-is-a-credit-card-gateway.htm, and hope it is useful for someone who read this article&amp;#160; :D&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;mContent&quot;&gt;&lt;p&gt;A &lt;a href=&quot;http://www.wisegeek.com/what-is-a-credit-card.htm&quot;&gt;credit card&lt;/a&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;gateway&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; is one element of a suite of e-&lt;a href=&quot;http://www.wisegeek.com/what-is-commerce.htm&quot;&gt;commerce&lt;/a&gt;
software packages that when incorporated into a website, allow for
online shoppers to pay for goods and services with VISA, MasterCard,
Discover, American Express or ATM &lt;a href=&quot;http://www.wisegeek.com/what-is-a-debit-card.htm&quot;&gt;debit card&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To purchase items online, visitors add products to a virtual
&amp;quot;shopping cart&amp;quot; that holds item(s) while calculating a running tab of
charges. The shopping cart is provided by the host&amp;#39;s &lt;a href=&quot;http://www.wisegeek.com/what-is-e-commerce.htm&quot;&gt;e-commerce&lt;/a&gt;
bundle which can run anywhere from $50 - $100 per month, or more
depending on features. The customer clicks a &amp;quot;checkout&amp;quot; or &amp;quot;buy&amp;quot; button
when shopping is complete, and is transferred to a page generated by a
secure server. This server houses the &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;credit&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;card&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;gateway&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;. All data passed between the secure server and the customer&amp;#39;s &lt;a href=&quot;http://www.wisegeek.com/what-is-a-computer.htm&quot;&gt;computer&lt;/a&gt; is &lt;a href=&quot;http://www.wisegeek.com/what-is-encryption.htm&quot;&gt;encrypted&lt;/a&gt;
en route and only decrypts at the destination point. Before negotiation
starts, the secure server passes a certificate of authenticity to the
customer&amp;#39;s browser to verify its legitimacy and identity. If there are
any problems with the certificate, the browser alerts the customer not
to continue with the transaction.&lt;/p&gt;

&lt;p&gt;Assuming this &amp;quot;handshake&amp;quot; goes well, the customer then supplies name, address and &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;credit&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;card&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
information and clicks &amp;quot;send&amp;quot; or &amp;quot;submit&amp;quot;. The information is encrypted
by the browser then sent to the secure server and decrypted upon
arrival. The software protocols in the &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;credit&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;card&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;gateway&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; use the information provided to check for availability of funds and to make sure the &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;credit&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;yellowFade&quot;&gt;&lt;span&gt;&lt;span class=&quot;yellowFadeInnerSpan&quot; style=&quot;position: relative;&quot;&gt;card&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
is not expired, lost or stolen. This takes only seconds. When the
transaction is approved a receipt is generated for the customer, and
the funds are transferred to the vendor&amp;#39;s bank account.&lt;/p&gt;&lt;/span&gt;&lt;br /&gt; &lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/what-is-a-credit-card-gateway.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e01101682d65b860c?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>Rails Cache Stores</title>
            <link>http://tintn.vox.com/library/post/rails-cache-stores.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/rails-cache-stores.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/rails-cache-stores.html?_c=feed-rss-full</guid> 
            <pubDate>Sun, 28 Jun 2009 22:36:00 -0700</pubDate>         
            
            <description>    &lt;p&gt;Rails (as of 2.1) provides different stores for the cached data created by action and
fragment caches. Page caches are always stored on disk.&lt;/p&gt;
&lt;p&gt;Rails 2.1 and above provide ActiveSupport::Cache::Store which can be used to
cache strings. Some cache store implementations, like MemoryStore, are able to
cache arbitrary Ruby objects, but don’t count on every cache store to be able
to do that.&lt;/p&gt;
&lt;p&gt;The default cache stores provided with Rails include:&lt;/p&gt;
&lt;p&gt;1) ActiveSupport::Cache::MemoryStore: A cache store implementation which stores
everything into memory in the same process. If you’re running multiple Ruby on
Rails server processes (which is the case if you’re using mongrel_cluster or
Phusion Passenger), then this means that your Rails server process instances
won’t be able to share cache data with each other. If your application never
performs manual cache item expiry (e.g. when you‘re using generational cache
keys), then using &lt;tt&gt;MemoryStore&lt;/tt&gt; is ok. Otherwise, consider carefully whether you
should be using this cache store.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;MemoryStore&lt;/tt&gt;is not only able to store strings, but also arbitrary Ruby objects.
&lt;tt&gt;MemoryStore&lt;/tt&gt;is not thread-safe. Use &lt;tt&gt;SynchronizedMemoryStore&lt;/tt&gt; instead if you
&lt;p&gt;need thread-safety.&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store =&lt;span class=&quot;symbol&quot;&gt; :memory_store&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;2) ActiveSupport::Cache::FileStore: Cached data is stored on the disk. This is
the default store and the default path for this store is: /tmp/cache. Works
well for all types of environments and allows all processes running from the
same application directory to access the cached content. If /tmp/cache does not
exist, the default store becomes MemoryStore.&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store =&lt;span class=&quot;symbol&quot;&gt; :file_store&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&amp;quot;/path/to/cache/directory&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;3) ActiveSupport::Cache::DRbStore: Cached data is stored in a separate shared
DRb process that all servers communicate with. This works for all environments
and only keeps one cache around for all processes, but requires that you run
and manage a separate DRb process.&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store =&lt;span class=&quot;symbol&quot;&gt; :drb_store&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&amp;quot;druby://localhost:9192&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;4) MemCached store: Works like DRbStore, but uses Danga’s MemCache instead.
Rails uses the bundled memcached-client gem by default. This is currently the
most popular cache store for production websites.&lt;/p&gt;
&lt;p&gt;Special features:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Clustering and load balancing. One can specify multiple memcached servers,
   and MemCacheStore will load balance between all available servers. If a
   server goes down, then MemCacheStore will ignore it until it goes back
   online.&lt;/li&gt;&lt;li&gt;Time-based expiry support. See &lt;tt&gt;write&lt;/tt&gt; and the &lt;tt&gt;:expires_in&lt;/tt&gt; option.&lt;/li&gt;&lt;li&gt;Per-request in memory cache for all communication with the MemCache server(s).&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;It also accepts a hash of additional options:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;tt&gt;:namespace&lt;/tt&gt;- specifies a string that will automatically be prepended to keys when accessing the memcached store.&lt;/li&gt;&lt;li&gt;&lt;tt&gt;:readonly&lt;/tt&gt;- a boolean value that when set to true will make the store read-only, with an error raised on any attempt to write.&lt;/li&gt;&lt;li&gt;&lt;tt&gt;:multithread&lt;/tt&gt;
– a boolean value that adds thread safety to read/write operations – it
is unlikely you’ll need to use this option as the Rails threadsafe!
method offers the same functionality.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The read and write methods of the MemCacheStore accept an options hash too.
When reading you can specify &lt;tt&gt;:raw =&amp;gt; true&lt;/tt&gt; to prevent the object being
marshaled
(by default this is false which means the raw value in the cache is passed to
&lt;tt&gt;Marshal.load&lt;/tt&gt; before being returned to you.)&lt;/p&gt;
&lt;p&gt;When writing to the cache it is also possible to specify &lt;tt&gt;:raw =&amp;gt; true&lt;/tt&gt;. This means
that the value is not passed to &lt;tt&gt;Marshal.dump&lt;/tt&gt; before being stored in the cache (by
default this is false).&lt;/p&gt;
&lt;p&gt;The write method also accepts an &lt;tt&gt;:unless_exist&lt;/tt&gt; flag which determines whether
the memcached add (when true) or set (when false) method is used to store the
item in the cache and an &lt;tt&gt;:expires_in&lt;/tt&gt; option that specifies the time-to-live
for the cached item in seconds.&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store =&lt;span class=&quot;symbol&quot;&gt; :mem_cache_store&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;5) ActiveSupport::Cache::SynchronizedMemoryStore: Like ActiveSupport::Cache::MemoryStore but thread-safe.&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store =&lt;span class=&quot;symbol&quot;&gt; :synchronized_memory_store&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;6) ActiveSupport::Cache::CompressedMemCacheStore: Works just like the regular
MemCacheStore but uses GZip to decompress/compress on read/write.&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store =&lt;span class=&quot;symbol&quot;&gt; :compressed_mem_cache_store&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;7) Custom store: You can define your own cache store (new in Rails 2.1)&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
ActionController::Base.cache_store = MyOwnStore.new&lt;span class=&quot;brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;parameter&amp;quot;&lt;/span&gt;&lt;span class=&quot;brackets&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;note&quot;&gt;&lt;p&gt;&lt;tt&gt;config.cache_store&lt;/tt&gt; can be used in place of&lt;/p&gt;&lt;/div&gt;
&lt;tt&gt;ActionController::Base.cache_store&lt;/tt&gt;in the &lt;tt&gt;Rails::Initializer.run&lt;/tt&gt; block in
&lt;p&gt;environment.rb.&lt;/p&gt;
&lt;p&gt;In addition to all of this, Rails also adds the &lt;tt&gt;ActiveRecord::Base#cache_key&lt;/tt&gt;
method that generates a key using the class name, id and updated_at timestamp
(if available).&lt;/p&gt;
&lt;p&gt;An example:&lt;/p&gt;
&lt;div class=&quot;code_container&quot;&gt;&lt;code class=&quot;ruby&quot;&gt;
Rails.cache.read&lt;span class=&quot;brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;city&amp;quot;&lt;/span&gt;&lt;span class=&quot;brackets&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;comment&quot;&gt;# =&amp;gt; nil&lt;/span&gt;
Rails.cache.write&lt;span class=&quot;brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;city&amp;quot;&lt;/span&gt;, &lt;span class=&quot;string&quot;&gt;&amp;quot;Duckburgh&amp;quot;&lt;/span&gt;&lt;span class=&quot;brackets&quot;&gt;)&lt;/span&gt;
Rails.cache.read&lt;span class=&quot;brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;city&amp;quot;&lt;/span&gt;&lt;span class=&quot;brackets&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;comment&quot;&gt;# =&amp;gt; &amp;quot;Duckburgh&amp;quot;&lt;br /&gt;&lt;br /&gt;ref http://guides.rubyonrails.org/caching_with_rails.html&lt;br /&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/div&gt; &lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/rails-cache-stores.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011016699e96860c?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>5 Annoying Things Freelancers Do to Destroy their Business</title>
            <link>http://tintn.vox.com/library/post/5-annoying-things-freelancers-do-to-destroy-their-business.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/5-annoying-things-freelancers-do-to-destroy-their-business.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/5-annoying-things-freelancers-do-to-destroy-their-business.html?_c=feed-rss-full</guid> 
            <pubDate>Tue, 09 Jun 2009 23:02:06 -0700</pubDate>         
            
            <description>    &lt;p&gt;I have been working with freelancers throughout my career and
recently, thanks to services like oDesk, I find myself doing it more
often.&amp;#160; So you might think that I am happy with what I get, at least in
general.&amp;#160; Well, one of the reasons I continue to stay engaged is my
high tolerance for pain – I am prepared to go through piles of hay to
find that needle.&amp;#160; And I have to tell you, looking for freelancers is
very much like digging for gold – you literally have to go through tons
of dirt to find it.&lt;/p&gt;
&lt;p&gt;Interestingly enough many freelancers who have skills, knowledge and
maybe even talent often torpedo themselves, aggressively sabotage their
chances of getting customers right in the begging of the process.&amp;#160; They
make simple yet lethal mistakes that turn off clients before they got
the chance to learn about freelancer’s ingenuity.&amp;#160; Below are some of
those mistakes:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Not reading my post before you reply to it.&amp;#160; Your three page long
template proposal will get you in a recycle been faster than anything
else.&amp;#160; At least adjust your opening statement, show me that you read
the post…&lt;/li&gt;&lt;li&gt;Not using proper grammar and spelling.&amp;#160; English is my second
language and still work in progress; I still straggle with grammar
myself, yet many responses I see push that envelope way too far.&amp;#160;
Grammatically poor introduction screams in my face “Communicating with
this freelancer will be a real pain!” Spelling mistakes are even worse
– how can I entrust my project to someone who doesn’t even make an
effort to turn on a spellchecker?&lt;/li&gt;&lt;li&gt;Talking with me like I am a teenager.&amp;#160; Your slang (especially when
combined with ESL marvels) comes across as complete lack of
intelligence and class.&amp;#160; By the way, spellchecker is not likely to
recognize your “gonna”, “wanna”, “gimme”, take a hint.&lt;/li&gt;&lt;li&gt;Being excessively polite.&amp;#160; Your culture and language might require
twenty minutes of praise and compliments before you get to business but
I am an American, cut to the chase guy.&amp;#160; More so, being overly polite
and using somewhat unusual forms will telegraph a wrong image, your
mentioning my “ultimate wisdom” only makes me think of a snake oil
salesman.&lt;/li&gt;&lt;li&gt;Not being punctual / prepared for your interview.&amp;#160; I think of
proposal / interview stage as a “honeymoon” in a relationship with a
freelancer, it all goes downhill from there.&amp;#160; Late for your Skype call?
Having troubles finding your headset? Can’t introduce yourself? Chances
are that’s the last time you’ll hear from me.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Don’t think I’m done here: I am only getting warmed up; it’s just my
500 word limit coming up.&amp;#160; I guess will continue in my blog.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Nick Krym is a technology professional with over 25 years in the IT industry, and the author of the &lt;a href=&quot;http://pragmaticoutsourcing.com/&quot; target=&quot;_blank&quot;&gt;Pragmatic Outsourcing&lt;/a&gt;&lt;/em&gt; blog.&lt;/p&gt;     &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/5-annoying-things-freelancers-do-to-destroy-their-business.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011016151a22860b?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>Git and Heroku</title>
            <link>http://tintn.vox.com/library/post/git-and-heroku.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/git-and-heroku.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/git-and-heroku.html?_c=feed-rss-full</guid> 
            <pubDate>Mon, 25 May 2009 09:35:55 -0700</pubDate>         
            
            <description>    
    
    
    

    
    
    
&lt;div at:enclosure=&quot;asset&quot; at:xid=&quot;6a0100a8055e8b000e0110168b3e0f860d&quot; at:format=&quot;large&quot; at:align=&quot;center&quot;
    class=&quot;enclosure enclosure-center enclosure-large photo-enclosure&quot; 
     style=&quot;text-align: center;&quot;&gt;
&lt;div class=&quot;enclosure-inner&quot;
    
        style=&quot;padding: 9px; border: 1px solid; width: px; margin: 10px auto;&quot;
    &gt;
    &lt;div class=&quot;enclosure-list&quot;&gt;
        &lt;div class=&quot;enclosure-item photo-asset last&quot;&gt;
    
            &lt;div class=&quot;enclosure-image&quot;&gt;
        
                &lt;a href=&quot;http://tintn.vox.com/library/photo/6a0100a8055e8b000e0110168b3e0f860d.html&quot;&gt;&lt;img src=&quot;http://a7.vox.com/6a0100a8055e8b000e0110168b3e0f860d-320pi&quot; alt=&quot;Heroku&quot; title=&quot;Heroku&quot; /&gt;&lt;/a&gt;
        
            &lt;/div&gt;
            &lt;div class=&quot;enclosure-meta&quot;&gt;
                &lt;div class=&quot;enclosure-asset-name&quot;&gt;&lt;a href=&quot;http://tintn.vox.com/library/photo/6a0100a8055e8b000e0110168b3e0f860d.html&quot; title=&quot;Heroku&quot;&gt;Heroku&lt;/a&gt;&lt;/div&gt;
            &lt;/div&gt;
    
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;!-- end enclosure --&gt;

 &lt;div&gt;See my post at http://cntt.tv/nodes/show/517&lt;br /&gt;&lt;/div&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/git-and-heroku.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011016506502860c?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>    
        </item> 
 
        <item>
            <title>Crazy</title>
            <link>http://tintn.vox.com/library/post/crazy.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/crazy.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/crazy.html?_c=feed-rss-full</guid> 
            <pubDate>Thu, 14 May 2009 09:31:14 -0700</pubDate>         
            
            <description>    &lt;p&gt;:(( After dig deeper to use Rails Engines &amp;amp; login_engine. I read this note&lt;/p&gt;&lt;h2&gt;Ruby on Rails 2.3 Release Notes&lt;/h2&gt;
&lt;p&gt;Rails 2.3 delivers a variety of new and improved features, including
pervasive Rack integration, &lt;strong&gt;&lt;span style=&quot;color: #cc0000&quot;&gt;refreshed support for Rails Engines&lt;/span&gt;&lt;/strong&gt;, nested
transactions for Active Record, dynamic and default scopes, unified
rendering, more efficient routing, application templates, and quiet
backtraces. This list covers the major upgrades, but doesn’t include
every little bug fix and change. If you want to see everything, check
out the &lt;a href=&quot;http://github.com/rails/rails/commits/master&quot;&gt;list of commits&lt;/a&gt; in the main Rails repository on GitHub or review the &lt;tt&gt;CHANGELOG&lt;/tt&gt; files for the individual Rails components.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;=&amp;gt; rails engines plugin is out&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/crazy.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011017c4c35b860e?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>cattr_accessor &amp; attr_accessor</title>
            <link>http://tintn.vox.com/library/post/cattr_accessor-attr_accessor.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/cattr_accessor-attr_accessor.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/cattr_accessor-attr_accessor.html?_c=feed-rss-full</guid> 
            <pubDate>Tue, 12 May 2009 19:50:18 -0700</pubDate>         
            
            <description>    &lt;p&gt;
This defines &lt;tt&gt;attr_accessors&lt;/tt&gt; at a class level instead of instance
level.
&lt;/p&gt;
&lt;pre&gt;  &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;span class=&quot;class&quot;&gt;Foo&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;ident&quot;&gt;&lt;a href=&quot;http://apidock.com/rails/Class/cattr_accessor&quot;&gt;cattr_accessor&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;symbol&quot;&gt;:greeting&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class=&quot;constant&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;
This could be compared to, but is &lt;strong&gt;not&lt;/strong&gt; the same as doing this:
&lt;/p&gt;
&lt;pre&gt;  &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;span class=&quot;class&quot;&gt;Bar&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;self&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;ident&quot;&gt;attr_accessor&lt;/span&gt; &lt;span class=&quot;symbol&quot;&gt;:greeting&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;keyword&quot;&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class=&quot;constant&quot;&gt;Bar&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;
The difference might not be apparent at first, but &lt;a href=&quot;http://apidock.com/rails/Class/cattr_accessor&quot;&gt;cattr_accessor&lt;/a&gt; will make the
accessor &lt;a href=&quot;http://apidock.com/rails/Class/inherited&quot;&gt;inherited&lt;/a&gt; to the instances:
&lt;/p&gt;
&lt;pre&gt;  &lt;span class=&quot;constant&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;#=&amp;gt; &amp;quot;Hello&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;constant&quot;&gt;Bar&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;# NoMethodError: undefined method `greeting&amp;#39; for #&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;
This inheritance is also not copy-on-write in case you assumed that:
&lt;/p&gt;
&lt;pre&gt;  &lt;span class=&quot;constant&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt;  &lt;span class=&quot;comment&quot;&gt;#=&amp;gt; &amp;quot;Hello&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;ident&quot;&gt;foo1&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;foo2&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;constant&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;new&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class=&quot;ident&quot;&gt;foo1&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Hi!&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span class=&quot;constant&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt;  &lt;span class=&quot;comment&quot;&gt;#=&amp;gt; &amp;quot;Hi!&amp;quot;&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;ident&quot;&gt;foo2&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;greeting&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;#=&amp;gt; &amp;quot;Hi!&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;
This makes it possible to share common state (queues, semaphores, etc.),
configuration (max value, etc.) or temporary values through this.
&lt;/p&gt;     &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/cattr_accessor-attr_accessor.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011017c3f7ae860e?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>Lonely man -- FourSpots.com</title>
            <link>http://tintn.vox.com/library/post/lonely-man----fourspotscom.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/lonely-man----fourspotscom.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/lonely-man----fourspotscom.html?_c=feed-rss-full</guid> 
            <pubDate>Mon, 27 Apr 2009 03:27:58 -0700</pubDate>         
            
            <description>    
    
    
    

    
    
    
&lt;div at:enclosure=&quot;asset&quot; at:xid=&quot;6a0100a8055e8b000e0110181cf84f860f&quot; at:format=&quot;extra-large&quot; at:align=&quot;center&quot;
    class=&quot;enclosure enclosure-center enclosure-extra-large photo-enclosure&quot; 
     style=&quot;text-align: center;&quot;&gt;
&lt;div class=&quot;enclosure-inner&quot;
    
        style=&quot;padding: 9px; border: 1px solid; width: px; margin: 10px auto;&quot;
    &gt;
    &lt;div class=&quot;enclosure-list&quot;&gt;
        &lt;div class=&quot;enclosure-item photo-asset last&quot;&gt;
    
            &lt;div class=&quot;enclosure-image&quot;&gt;
        
                &lt;a href=&quot;http://tintn.vox.com/library/photo/6a0100a8055e8b000e0110181cf84f860f.html&quot;&gt;&lt;img src=&quot;http://a7.vox.com/6a0100a8055e8b000e0110181cf84f860f-500pi&quot; alt=&quot;FireShot Pro capture #26 - &#39;Fourspots __ Welcome&#39; - 75_127_81_13_3000&quot; title=&quot;FireShot Pro capture #26 - &#39;Fourspots __ Welcome&#39; - 75_127_81_13_3000&quot; /&gt;&lt;/a&gt;
        
            &lt;/div&gt;
            &lt;div class=&quot;enclosure-meta&quot;&gt;
                &lt;div class=&quot;enclosure-asset-name&quot;&gt;&lt;a href=&quot;http://tintn.vox.com/library/photo/6a0100a8055e8b000e0110181cf84f860f.html&quot; title=&quot;FireShot Pro capture #26 - &#39;Fourspots __ Welcome&#39; - 75_127_81_13_3000&quot;&gt;FireShot Pro capture #26 - &#39;Fourspots __ Welcome&#39; - 75_127_81_13_3000&lt;/a&gt;&lt;/div&gt;
            &lt;/div&gt;
    
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;!-- end enclosure --&gt;
&lt;p&gt;
Becomes tired with fourspots.com &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/lonely-man----fourspotscom.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011017bdf878860e?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>    
        </item> 
 
        <item>
            <title>Rails Best Practices, Tips and Tricks</title>
            <link>http://tintn.vox.com/library/post/rails-best-practices-tips-and-tricks.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/rails-best-practices-tips-and-tricks.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/rails-best-practices-tips-and-tricks.html?_c=feed-rss-full</guid> 
            <pubDate>Thu, 02 Apr 2009 23:20:06 -0700</pubDate>         
            
            <description>    &lt;p&gt;Rails is a young framework, I thought it would be helpful to write
up what I consider best practices when coding with it both for my new
coworkers and the web at large. Here’s my current draft. Feel free to
critique and comment. I’m very open to suggestions.&lt;h3&gt;Testing&lt;/h3&gt;

&lt;p&gt;This is &lt;strong&gt;absolutely essential&lt;/strong&gt;. Rails makes writing
unit and functional tests incredibly easy and testing should be
employed at all times. Positive and negative testing should be
employed: the first to verify that the application does what it is
supposed to when the proper variables are passed to the correct action
and then second to verify that when incorrect variables are passed the
prefered behavior occurs.&lt;/p&gt;

&lt;h4&gt;Unit Testing&lt;/h4&gt;

&lt;p&gt;As a general rule, unit testing should test any validation in models as well as any added methods in those models. &lt;/p&gt;

&lt;p&gt;For example, if I have a &lt;code&gt;User&lt;/code&gt; model which &lt;code&gt;validates_presence_of&lt;/code&gt; first_name and last_name fields as well as a method &lt;code&gt;fullname&lt;/code&gt; which combines the two, I might have test cases &lt;code&gt;test_validates_names&lt;/code&gt; and &lt;code&gt;test_fullname&lt;/code&gt; which would test that the model worked as it was intended to.&lt;/p&gt;

&lt;h4&gt;Functional Testing&lt;/h4&gt;

&lt;p&gt;Functional testing is used to test controllers. As a rule, there
should be atleast one testcase for each action and positive and
negative testing should be employed. This means that if I have an
action &lt;code&gt;create&lt;/code&gt; in my &lt;code&gt;PostsController&lt;/code&gt; then there should be  &lt;code&gt;test_create&lt;/code&gt; and &lt;code&gt;test_bad_create&lt;/code&gt;
methods defined in my functional tests which do positive and negative
testing. This does not mean there should be only two tests for each
action. If there are exceptional cases beyond a simple good and bad,
proper testing should cover those cases.&lt;/p&gt;

&lt;h4&gt;Helpful Reading&lt;/h4&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://manuals.rubyonrails.com/read/book/5&quot;&gt;A Guide To Testing The Rails&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Agile Web Development With Rails Chapter 12&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;Migrations&lt;/h3&gt;

&lt;p&gt;Migrations mean never having to say you’re sorry because you nuked
the database. They allow for database agnostic schemas which means you
can develop locally on SQLite and deploy on MySQL without a problem.
They’re cleaner (and easier) than writing your own schemas custom and
should be used whenever possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NEVER EVER EVER modify schema.rb. It is a reflection of the
database. Migrations should be used to move this forward. If you don’t
use migrations and instead modify schema.rb, things will break and
people will be unhappy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: You should always run svn update before generating a
migration so you don’t have prefix collisions (two number 4s for
example).&lt;/p&gt;

&lt;h4&gt;Helpful Reading&lt;/h4&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://glu.ttono.us/articles/2005/10/27/the-joy-of-migrations&quot;&gt;The Joy of Migrations&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://jamis.jamisbuck.org/articles/2005/09/27/getting-started-with-activerecord-migrations&quot;&gt;Getting Started With ActiveRecord Migrations&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;SQLite&lt;/h3&gt;

&lt;p&gt;SQLite is an SQL engine which runs in a single file rather than a
server. It is (in general) as fast or faster than MySQL and is
excellent for development and testing. In fact, it is possible to run a
database completely out of memory which speeds up tests significantly.
With the advent of migrations, it makes sense to use SQLite for testing
as there is no extra work to deploy on MySQL.&lt;/p&gt;

&lt;h3&gt;DRY: Don’t Repeat Yourself&lt;/h3&gt;

&lt;p&gt;The main idea of DRY is that if code which is repeated is extracted
to a helper or function, you only have one place to look for (and edit)
your code if and when something goes wrong. If you find that similar
code is used in several places, you may want to look into extracting
that code to a helper function or partial.&lt;/p&gt;

&lt;h4&gt;Helpful Reading&lt;/h4&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://api.rubyonrails.org/classes/ActionController/Base.html#M000178&quot;&gt;Rendering partials in the Rails API&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Refactoring by Martin Fowler&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;Naming Conventions&lt;/h3&gt;

&lt;p&gt;Don’t use abbreviations, especially in database column names. It
should be immediately obvious what the column is for (or atleast what
the name means) when looking at the name. These are not the days of C,
we don’t need to conserve space with our variable names. Additionally,
Rails error handling automatically knows how to “humanize” column
names, so when you use a well described name you get to work less on
outputting errors.&lt;/p&gt;

&lt;p&gt;If names are too long, try to think of another word or phrase that means the same thing, but is immediately obvious.&lt;/p&gt;

&lt;h3&gt;Source Control (Subversion)&lt;/h3&gt;

&lt;p&gt;Some sort of source control should be used at all times. This allows
for easy roll back if something goes wrong as well as the ability to
refer back to old code if needed. Rails has certain files which should
not be included in a source control repository, so please refer to the &lt;a href=&quot;http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion&quot;&gt;wiki page&lt;/a&gt; when preparing the initial import.&lt;/p&gt;

&lt;h4&gt;Helpful Reading&lt;/h4&gt;

&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion&quot;&gt;How To Use Rails With Subversion&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;h3&gt;Authentication Systems&lt;/h3&gt;

&lt;p&gt;Several authentication modules have been written for Rails, but some are better at some things and some are better than others.&lt;/p&gt;

&lt;h4&gt;acts_as_authenticated&lt;/h4&gt;

&lt;p&gt;This should be the prefered authentication plugin. It is easily installed via &lt;code&gt;script/plugin&lt;/code&gt;,
is easily extendible and can handle all issues of the other
authentication modules. Additionally, the testing code is excellent
which makes it easy to modify.&lt;/p&gt;

&lt;h4&gt;login_generator&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;login_generator&lt;/code&gt; is the original login generator gem
written by Tobias Luetke. The downside is that there is a bug which
scrambles the password if you save an already existing user. It should
not be used for this reason. It is replaced and superceded by
acts_as_authenticated.&lt;/p&gt;

&lt;h4&gt;SaltedHashLoginGenerator&lt;/h4&gt;

&lt;p&gt;This was a first attempt at created a salted login generator which
could reset passwords and do activation. It has since been extracted
into login_engine. It is in general bloated and hard to modify. It
should be avoided.&lt;/p&gt;

&lt;h4&gt;login_engine&lt;/h4&gt;

&lt;p&gt;login_engine is the extraction of SaltedHashLoginGenerator, and as
such, has the disadvantages that SaltedHash has. Additionally, it uses
the Rails Engines system which is designed for drop in use. In general,
applications need customization. If you need more than simple
modification of an authentication system, this should be avoided.&lt;/p&gt;

&lt;h3&gt;On Scaffolding&lt;/h3&gt;

&lt;p&gt;Scaffolding can be a time saver or a crutch. When using scaffolding,
make sure to understand exactly what the code is doing and why. Once
that happens you can generally write the code faster without using
scaffolding as there are almost always changes to each section that
scaffolding provides.&lt;/p&gt;

&lt;h3&gt;Suggested Reading (in General)&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;The Pragmatic Programmer by Dave Thomas and Andy Hunt&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Refactoring by Martin Fowler&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Agile Web Development with Rails by Dave Thomas and David Heinemeier Hannson&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Programming Ruby by Dave Thomas, with Chad Fowler and Andy Hunt&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;Ref: http://glu.ttono.us/articles/2006/02/06/rails-best-practices-tips-and-tricks&lt;br /&gt; &lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/rails-best-practices-tips-and-tricks.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e011017b73890860e?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
 
        <item>
            <title>Rubies and Gems: UUID</title>
            <link>http://tintn.vox.com/library/post/rubies-and-gems-uuid.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Nguyễn Trọng Tín)</author>
            <comments>http://tintn.vox.com/library/post/rubies-and-gems-uuid.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://tintn.vox.com/library/post/rubies-and-gems-uuid.html?_c=feed-rss-full</guid> 
            <pubDate>Fri, 13 Mar 2009 09:12:28 -0700</pubDate>         
            
            <description>    &lt;h2&gt;&lt;a href=&quot;http://blog.simplificator.com/2007/10/24/rubies-and-gems-uuid/&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link: Rubies and Gems: UUID&quot;&gt;Rubies and Gems: UUID&lt;/a&gt;&lt;/h2&gt;

			
				&lt;p&gt;Often your application needs some form of UUID. For example for &amp;quot;Secret URLs&amp;quot; or  &lt;a href=&quot;http://livsey.org/2006/6/30/persistent-logins-in-rails/&quot;&gt;Persistent Logins&lt;/a&gt;. I found the &lt;a href=&quot;http://rubyforge.org/projects/uuidtools/&quot;&gt;uuidtools&lt;/a&gt; to be very useful for this task. It allows you to create various forms of UUIDs (i.e. MD5, SHA1, Timestamp or Random).&lt;/p&gt;
&lt;p&gt;Get the gem
&lt;/p&gt;&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lcode-1&quot;&gt;&lt;a href=&quot;http://blog.simplificator.com/2007/10/24/rubies-and-gems-uuid/#&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;CODE:&lt;/span&gt;
&lt;div id=&quot;code-1&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ol&gt;&lt;li style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);&quot;&gt;
&lt;div style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal;&quot;&gt;sudo gem install uuidtools &lt;/div&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And generate UUIDs
&lt;/p&gt;&lt;div class=&quot;igBar&quot;&gt;&lt;span id=&quot;lruby-2&quot;&gt;&lt;a href=&quot;http://blog.simplificator.com/2007/10/24/rubies-and-gems-uuid/#&quot;&gt;PLAIN TEXT&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;syntax_hilite&quot;&gt;&lt;span class=&quot;langName&quot;&gt;RUBY:&lt;/span&gt;
&lt;div id=&quot;ruby-2&quot;&gt;
&lt;div class=&quot;ruby&quot;&gt;
&lt;ol&gt;&lt;li style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);&quot;&gt;
&lt;div style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal;&quot;&gt;UUID.&lt;span style=&quot;color: rgb(153, 0, 204);&quot;&gt;random_create&lt;/span&gt;.&lt;span style=&quot;color: rgb(153, 0, 204);&quot;&gt;to_s&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;&lt;li style=&quot;font-weight: bold; color: rgb(38, 83, 106);&quot;&gt;
&lt;div style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal;&quot;&gt;&amp;#160;&lt;/div&gt;
&lt;/li&gt;&lt;li style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal; font-style: normal; color: rgb(58, 106, 139);&quot;&gt;
&lt;div style=&quot;font-family: &amp;#39;Courier New&amp;#39;,Courier,monospace; font-weight: normal;&quot;&gt;UUID.&lt;span style=&quot;color: rgb(153, 0, 204);&quot;&gt;timestamp_create&lt;/span&gt;.&lt;span style=&quot;color: rgb(153, 0, 204);&quot;&gt;to_s&lt;/span&gt; &lt;/div&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;and thats all there is about it.&lt;/p&gt;
&lt;p&gt;Resources:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.ietf.org/rfc/rfc4122.txt&quot;&gt;RFC 4122&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://uuidtools.rubyforge.org/&quot;&gt;uuidtools API&lt;/a&gt;&lt;/p&gt;

				
				
					&lt;p&gt;&lt;small&gt;ref http://blog.simplificator.com/2007/10/24/rubies-and-gems-uuid/&lt;br /&gt;&lt;/small&gt; &lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://tintn.vox.com/library/post/rubies-and-gems-uuid.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a0100a8055e8b000e01101635b552860c?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description>   
        </item> 
    </channel>
</rss>

