<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
  <title>Spiragram - Home</title>
  <id>tag:blog.spiragram.com,2008:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  
  <link href="http://blog.spiragram.com/" rel="alternate" type="text/html" />
  <updated>2008-09-05T08:19:54Z</updated>
  <link rel="self" href="http://feeds.feedburner.com/spiragram" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>tiendung</name>
    </author>
    <id>tag:blog.spiragram.com,2008-09-05:4906</id>
    <published>2008-09-05T08:00:00Z</published>
    <updated>2008-09-05T08:19:54Z</updated>
    <category term="Jason" />
    <category term="Tien Dung" />
    <link href="http://blog.spiragram.com/2008/9/5/acts_as_dictionary-rails-plugin" rel="alternate" type="text/html" />
    <title>acts_as_dictionary Rails plugin</title>
<content type="html">
            A Rails plug-in created by Jason to treat any ActiveRecord's string field as a dictionary to do word suggesting &amp;amp; spelling checking. I helped to replace &lt;a href="http://rubyforge.org/projects/hunspell/"&gt;buggy hunspell gem&lt;/a&gt; with our own Ruby Hunspell binding.&lt;br /&gt;
&lt;br /&gt;
As far as I know, Hunspell is the best open source spelling checking library. It is used by Firefox 3, Google Chrome, and Open Office. I also found Hunspell is easier to use than Aspell.&lt;br /&gt;
&lt;br /&gt;
Get the plug-in at &lt;a href="http://github.com/tiendung/acts_as_dictionary/tree/master"&gt;http://github.com/tiendung/acts_as_dictionary/tree/master&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
ActsAsDictionary&lt;br /&gt;
================&lt;br /&gt;
&lt;br /&gt;
ActsAsDictionary creates Hunspell (http://hunspell.sourceforge.net/) dictionaries using data from ActiveRecord models 
and provides class methods to access these dictionaries.&lt;br /&gt;
&lt;br /&gt;
Pre-requisites&lt;br /&gt;
==============&lt;br /&gt;
&lt;br /&gt;
This plugin requires the Hunspell library and RubyInline gem.&lt;br /&gt;
&lt;br /&gt;
To install Hunspell:&lt;br /&gt;
  &lt;br /&gt;
  curl -O http://nchc.dl.sourceforge.net/sourceforge/hunspell/hunspell-1.2.7.tar.gz&lt;br /&gt;
  tar -zxvf hunspell-1.2.7.tar.gz&lt;br /&gt;
  cd hunspell-1.2.7&lt;br /&gt;
  ./configure&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
  &lt;br /&gt;
To install RubyInline:&lt;br /&gt;
&lt;br /&gt;
  gem install RubyInline&lt;br /&gt;
&lt;br /&gt;    
Setup&lt;br /&gt;
=====&lt;br /&gt;
&lt;br /&gt;
Within a model, define the column you want to work with:&lt;br /&gt;
&lt;br /&gt;
  class Klass &amp;lt; ActiveRecord::Base&lt;br /&gt;
    acts_as_dictionary :checks =&gt; :name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Or, if you want to create dictionaries using two or more columns&lt;br /&gt;
&lt;br /&gt;
  class Klass &amp;lt; ActiveRecord::Base&lt;br /&gt;
    acts_as_dictionary :checks =&gt; [:name, :type]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Once done, you can proceed to generate basic Hunspell dictionary files with:&lt;br /&gt;
&lt;br /&gt;
  rake dict:generate&lt;br /&gt;
&lt;br /&gt;
In the above example, the following files will be generated:&lt;br /&gt;
&lt;br /&gt;
  #{Rails.root}/dict/klass_names.aff&lt;br /&gt;
  #{Rails.root}/dict/klass_names.dic&lt;br /&gt;
  #{Rails.root}/dict/klass_types.aff&lt;br /&gt;
  #{Rails.root}/dict/klass_types.dic&lt;br /&gt;
  &lt;br /&gt;
Each pair of these files (*.aff and *.dic) are Hunspell dictionary definition files  which you can further configure if 
needed (see http://sourceforge.net/docman/display_doc.php?docid=29374&amp;group_id=143754).&lt;br /&gt;
&lt;br /&gt;
Note that if manually configure the files, running the dict:generate Rake task again will override your manual 
configurations.&lt;br /&gt;
&lt;br /&gt;
Usage&lt;br /&gt;
=====&lt;br /&gt;
&lt;br /&gt;
With this plugin, the following dynamic class methods are available (replace * with a column name you have specified to 
check):&lt;br /&gt;
&lt;br /&gt;
  &gt;&gt; Klass.find_by_*_with_spell_check("Naem")&lt;br /&gt;
  =&gt; #&amp;lt;klass 1 id:&gt;&lt;br /&gt;
  &lt;br /&gt;
  &gt;&gt; Klass.suggest_*("Naem")&lt;br /&gt;
  =&gt; ["Name", "Name2"]&lt;br /&gt;
  &lt;br /&gt;
  &gt;&gt; Klass.check_*("Name")&lt;br /&gt;
  =&gt; true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tien Dung&lt;br /&gt;
&lt;a href="http://free-and-happy.blogspot.com/"&gt;http://free-and-happy.blogspot.com/&lt;/a&gt;&lt;br /&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>tiendung</name>
    </author>
    <id>tag:blog.spiragram.com,2007-10-10:433</id>
    <published>2007-10-10T15:07:00Z</published>
    <updated>2008-09-06T03:37:05Z</updated>
    <category term="Tien Dung" />
    <link href="http://blog.spiragram.com/2007/10/10/javascript-open-my-eyes-1" rel="alternate" type="text/html" />
    <title>JavaScript open my eyes (1)</title>
<content type="html">
            &lt;p&gt;Don’t be fool by the title, it’s used to attract readers like you. This series is about programming in general. But wait, I’ll talk about JavaScript later because it’s true that JavaScript is cool and it has changed my programming point of view.&lt;/p&gt;


	&lt;p&gt;Before know JavaScript, I lived in the world of produce and object-oriented language like Pascal, C/C++ and never know what programming is. In high school, I was taught algorithms before programming languages, just used languages as tools to implement algorithms. Fist and second years in university, I was taught a lot of math before knowing that math is the most important foundation of programming. I wondered why I had to learn math, I were there to be a developer (and I forgot math very soon). Two years later, they taught me about software engineering, database, AI … without showing me how programs actually implemented and run in a computer. As time go by, I write more and more programs and still don’t know about programming. May be this the reason why Vietnam do not have talent programmers. Singapore is better. I found some interesting programming courses at &lt;span class="caps"&gt;NUS&lt;/span&gt; like&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;CS1101S&lt;/span&gt;: Programming Methodology (with Scheme)&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;CS2104&lt;/span&gt;: Programming Language Concepts&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;CS3212&lt;/span&gt;: Programming Languages&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;CS4212&lt;/span&gt;: Compiler Design&lt;/p&gt;


	&lt;p&gt;But most of other courses related to Java and some courses force student using Java (or not encourage using other languages) to do assignments. For most students in &lt;span class="caps"&gt;NUS&lt;/span&gt;, Java is their language of choice. May be I’m lucky that I know only C and little C++ when I came to &lt;span class="caps"&gt;NUS&lt;/span&gt; and I hated Java at the first sight because it dismisses the main() function and force me to write a class, then create an object just to write a pure object-oriented “hello world” program (I used Java once to do assignments).&lt;/p&gt;


	&lt;p&gt;Then I tried some dynamic programming languages: Python, Ruby (on Rails) and JavaScript. I didn’t plan to learn JavaScript in order to create web apps because I thought I can do sexy Ajax things via &lt;span class="caps"&gt;RJS&lt;/span&gt; in Rails. But everything is not as expected. In my first project, I have to generate &lt;span class="caps"&gt;DOM&lt;/span&gt; elements from data in &lt;span class="caps"&gt;JSON&lt;/span&gt; format and &lt;span class="caps"&gt;RJS&lt;/span&gt; didn’t help much. I had to use JavaScript and started to learn the language. Ok, it’s just another languages, just learn the syntax and done. My first book is Pro JavaScript by John Resig (the creator of jQuery). He taught me how different JavaScript is from traditional object-oriented programming languages and the private and privileged techniques of Crockford to make object-oriented JavaScript more powerful. These techniques looked very strange, I never saw them before. I stopped reading and try to implement it in my first project, I also used jQuery to handle Ajax calls, &lt;span class="caps"&gt;DOM&lt;/span&gt; … (John mentioned jQuery in his book, of course). Then Crockford JavaScript videos keep my eyes opening (wider and wider) ...&lt;/p&gt;


	&lt;p&gt;Tien Dung&lt;/p&gt;


	&lt;p&gt;http://free-and-happy.blogspot.com&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>hongkiat</name>
    </author>
    <id>tag:blog.spiragram.com,2007-09-11:60</id>
    <published>2007-09-11T01:30:00Z</published>
    <updated>2007-09-11T09:41:44Z</updated>
    <category term="hongkiat" />
    <link href="http://blog.spiragram.com/2007/9/11/when-you-hit-a-block" rel="alternate" type="text/html" />
    <title>When you hit a block...</title>
<content type="html">
            &lt;img src="http://blog.spiragram.com/assets/2007/9/11/iSeeThru-small.jpg" alt="imac transparent"&gt;
&lt;p&gt;Go redo creative you seen &lt;a href="http://www.flickr.com/photos/w00kie/sets/180637/show/"&gt;elsewhere&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>chardy</name>
    </author>
    <id>tag:blog.spiragram.com,2007-09-06:56</id>
    <published>2007-09-06T16:12:00Z</published>
    <updated>2007-09-07T00:13:48Z</updated>
    <category term="Chardy" />
    <link href="http://blog.spiragram.com/2007/9/6/finally-launch" rel="alternate" type="text/html" />
    <title>Finally Launch!</title>
<content type="html">
            &lt;img src="http://blog.spiragram.com/assets/2007/9/7/exploit-tech.jpg" /&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-31:53</id>
    <published>2007-08-31T04:01:00Z</published>
    <updated>2007-08-31T04:06:43Z</updated>
    <category term="Daniel" />
    <link href="http://blog.spiragram.com/2007/8/31/convention-over-configuration-the-smarter-choice" rel="alternate" type="text/html" />
    <title>Convention over configuration - the smarter choice</title>
<content type="html">
            &lt;p&gt;I was debugging a Java legacy system and found out that the error was due to configuration. Yeah.. I forgot to change the configuration that maps to the database and I cost me 1 day to debug!. I guess I’m too used to rails way of doing things now. Convention over configuration, definitely the smarter choice!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>jeff</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-29:51</id>
    <published>2007-08-29T10:41:00Z</published>
    <updated>2007-08-29T10:46:32Z</updated>
    <link href="http://blog.spiragram.com/2007/8/29/if-you-re-feeling-hungry-in-the-office" rel="alternate" type="text/html" />
    <title>if you're feeling hungry in the office</title>
<content type="html">
            &lt;p&gt;just pick up some crackers from out the box just after main door, leave on serviette on hot Macbook (near-left corner is recom ;)), leave to simmer… eat after 5.minutes!!!&lt;/p&gt;


	&lt;p&gt;a cool new way to use your new Macbook… ;)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>jeff</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-22:46</id>
    <published>2007-08-22T06:30:00Z</published>
    <updated>2007-08-22T06:34:15Z</updated>
    <link href="http://blog.spiragram.com/2007/8/22/i-m-not-a-bird-so-i-don-t-twitter" rel="alternate" type="text/html" />
    <title>I'm not a bird, so I don't twitter</title>
<content type="html">
            &lt;p&gt;more (techie humour) at &lt;a href="http://rubbedcode.com/blog/2007/08/22/im-not-a-bird-so-i-dont-twitter/"&gt;rubbedcode.com&lt;/a&gt;...&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>jeff</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-20:45</id>
    <published>2007-08-20T10:29:00Z</published>
    <updated>2007-08-22T06:30:11Z</updated>
    <link href="http://blog.spiragram.com/2007/8/20/salary-management" rel="alternate" type="text/html" />
    <title>on salary management</title>
<content type="html">
            &lt;p&gt;"You're the highest paid, but..."&lt;/p&gt;

&lt;p&gt;&lt;img title="a humorous look on salary management from Dilbert" src="http://blog.spiragram.com/assets/2007/8/20/salary_management_-_2007-08-20_-_dilbert2916590070820.gif" /&gt;&lt;/p&gt;

&lt;p&gt;Interesting cycle, isn't it? ;P&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Edit: Oh, and btw, this has nothing to do with Spiragram, ok? ;P I just thought to inject some humour into what is ordinarily a rather "dry" and "serious" blog...&lt;/em&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>tiendung</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-17:43</id>
    <published>2007-08-17T02:01:00Z</published>
    <updated>2008-09-06T03:41:01Z</updated>
    <category term="Tien Dung" />
    <link href="http://blog.spiragram.com/2007/8/17/just-a-point-of-view" rel="alternate" type="text/html" />
    <title>To err is human</title>
<content type="html">
            &lt;p&gt;People always make mistakes.
We are all wrong 99% of the time.
The winner is the one who realize self-mistakes sooner and fix them faster than others.&lt;/p&gt;


	&lt;p&gt;So don’t be too proud of yourself, be realistic:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;admit that you can make mistakes&lt;/li&gt;
		&lt;li&gt;don’t afraid of making mistakes&lt;/li&gt;
		&lt;li&gt;welcome mistakes come soon (through experiments)&lt;/li&gt;
		&lt;li&gt;don’t blame others’ mistakes&lt;/li&gt;
		&lt;li&gt;fix them as soon as possible&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Tien Dung.&lt;/p&gt;


	&lt;p&gt;http://free-and-happy.blogspot.com/&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>jeff</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-12:39</id>
    <published>2007-08-12T17:14:00Z</published>
    <updated>2007-08-12T17:23:03Z</updated>
    <link href="http://blog.spiragram.com/2007/8/12/mysql-heads-up-enterprise-source-will-no-longer-be-available" rel="alternate" type="text/html" />
    <title>MySQL heads-up!!!: Enterprise source tarballs will no longer be freely available</title>
<content type="html">
            &lt;p&gt;It’s been quite confusing reading all the various reports about the issue – but suffice to say that the Enterprise sources will still be available via BitKeeper! I’m just not too sure how this will work out for the Community Version, though! Seems like (and &lt;a href="http://www.bytebot.net/blog/"&gt;Colin Charles&lt;/a&gt; reads this the same way as me) the Community Version is going to take a step back where bug fixes are concerned, 
since &lt;a href="http://www.planetmysql.org/kaj/?p=123"&gt;according to Kaj Arnö&lt;/a&gt; (MySQL VP Community Relations), bug fixes are only going to be added to the Community Version of MySQL when the next version gets released (which should be like every 3 months)...&lt;/p&gt;


	&lt;p&gt;So if you’re using Community, no &lt;a href="http://www.mysql.com/products/enterprise/server.html"&gt;emergency hot fixes&lt;/a&gt;, and no timely bug fixes for you!!! The sources for Enterprise, though, will still continue to be available via BitKeeper (watch the &lt;a href="http://www.linux.com/feature/118489"&gt;linux.com video interview&lt;/a&gt; &lt;em&gt;(although there was a point in time during the interview [05:59ff.], where it seemed like this might not be the case)&lt;/em&gt;). This will probably have to be the way to go if you want access to all those hot fixes and bug fixes… That is, until (and if) &lt;a href="http://www.mysql.com/company/"&gt;MySQL AB&lt;/a&gt; decides to close off access to that too…&lt;/p&gt;


	&lt;p&gt;But fear not?!! The &lt;span class="caps"&gt;GPL&lt;/span&gt; &lt;em&gt;does&lt;/em&gt; allow for customers to redistribute the source code, and as luck would have it, there seem to be 2 willing providers of that service already (mirror.provenscaling.com, and dorsalsource.org)...&lt;/p&gt;


	&lt;p&gt;One persistent point raised in &lt;a href="http://www.linux.com/feature/118489"&gt;the Linux.com video interview&lt;/a&gt; bugs me though – is the &lt;a href="http://www.mysql.com/products/which-edition.html#community"&gt;Community Version&lt;/a&gt; (as Zack Urlocker, MySQL VP Marketing, says) not going to be any much different in terms of features from the Enterprise version? My my, but how MySQL AB’s official literature &lt;a href="http://www.mysql.com/products/which-edition.html#community"&gt;says otherwise&lt;/a&gt;... Or does the “experimental features” bit refer only to alpha, beta versions of MySQL Community – and not the GA versions???? Are we looking at a marketing message based off of mysql.com that is designed to push people off into buying into the Enterprise edge?&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;A Side Note:&lt;/strong&gt;&lt;br /&gt;
Reading Mike Kruckenberg (&lt;a href="http://www.bytebot.net/blog/archives/2007/08/08/is-mysql-really-taking-a-step-away-from-the-open-source-model"&gt;“well-respected community member”&lt;/a&gt;) ’s &lt;a href="http://mike.kruckenberg.com/archives/2007/08/mysql-takes-another-step-away-from-open-source.html"&gt;perspectives on the issue&lt;/a&gt; was interesting – although I cringe at the fact that he does not yet get “it” (the stand of the &lt;a href="http://www.fsf.org/" title="Free Software Foundation; MySQL is licensed under the GPL, and so we do have to drag the FSF in!!!"&gt;&lt;span class="caps"&gt;FSF&lt;/span&gt;&lt;/a&gt; with regards to the meaning of the word “free”). &lt;a href="http://www.gnu.org/philosophy/selling.html"&gt;Yes, you can sell&lt;/a&gt; &lt;a href="http://www.gnu.org/philosophy/free-sw.html" title="also covered in the FSF's main page!!!"&gt;free software&lt;/a&gt;, dude – the “free” in “free software” is about the liberty, not about the price!!!! The &lt;span class="caps"&gt;FSF&lt;/span&gt; has never been about the free price of the software – it has only really been about the &lt;em&gt;freedom&lt;/em&gt; of the software…&lt;/p&gt;


To quote from &lt;a href="http://www.gnu.org/philosophy/free-sw.html"&gt;http://www.gnu.org/philosophy/free-sw.html&lt;/a&gt; (&lt;a href="http://www.fsf.org/licensing/essays/selling.html"&gt;alternatively&lt;/a&gt;) -
&lt;blockquote&gt;Freedom is the issue, the whole issue, and the only issue.&lt;/blockquote&gt;

	&lt;p&gt;&lt;strong&gt;(And Back from the Side Note):&lt;/strong&gt;&lt;br /&gt;
So, what will this mean for Spiragram and its projects/clients? Nothing much really, I guess, above what other users of MySQL will be facing as well with this announcement. The only thing that has changed is, since we now have one &lt;a href="http://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt; pusher &lt;a href="http://blog.spiragram.com/2007/7/27/liberation"&gt;on board&lt;/a&gt; (in the form of me), we may yet see more PostgreSQL deployments yet! We shall see… :)&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>shoop</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-12:40</id>
    <published>2007-08-12T17:00:00Z</published>
    <updated>2007-08-12T17:01:26Z</updated>
    <category term="Shoop" />
    <link href="http://blog.spiragram.com/2007/8/12/the-words-are-big-enough-but" rel="alternate" type="text/html" />
    <title>The words are big enough but ...</title>
<content type="html">
            &lt;p&gt;&lt;img src="http://blog.spiragram.com/assets/2007/8/12/DSC00128.JPG" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;My astigmatism is fine, but there is just no way in hell I can remember the &lt;span class="caps"&gt;URL&lt;/span&gt;, Bausch &amp; Lomb.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>tiendung</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-10:38</id>
    <published>2007-08-10T08:13:00Z</published>
    <updated>2008-09-06T03:42:03Z</updated>
    <category term="Tien Dung" />
    <link href="http://blog.spiragram.com/2007/8/10/fun-with-javascript-chainability" rel="alternate" type="text/html" />
    <title>fun with JavaScript Chainability</title>
<content type="html">
            &lt;p&gt;want to show all string properties of an object in JavaScript?&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
function showAllStringPropertiesOf( object ) {
  for (var property in object) {
    if (typeof object[property] == "string") {
       console.log(property, ":", object[property]);
    }
  }
}

var object1 = {
      name: "Spiragram",
      address: "87 Beach Road",
      vision: "Spiragram will liberate, lead and inspire programmers to realize their full potential ..." 
    },
    object2 = {
      name: "Tien Dung",
      age: 26,
      saySomething: function () { alert("hello from " + this.name); }
     };

showAllStringPropertiesOf(object1);
showAllStringPropertiesOf(object2);
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;is it nice if we do not have to duplicate the function name? We can write:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
forEach([object1, object2], showAllStringPropertiesOf );
 &lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;where forEach is a funtion:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
function forEach( a, fn ) {
  var i, l = a.length;
  for (var i = 0; i &amp;lt; l; i++)
    fn(a[i]);
};
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;is there a better way (because we have only two objects)?
The answer is making the function chainable by adding a return itself command to the end of the function.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
function showAllStringPropertiesOf ( ... ) {
  ...
  ...
  return arguments.callee;
}
&lt;/code&gt;
&lt;/pre&gt;

now we can call:
&lt;pre&gt;
&lt;code&gt;
showAllStringPropertiesOf( object1 )( object2 )
&lt;/code&gt;
&lt;/pre&gt;

still want to make it more readable?
Let make more fun with “and” keyword.
&lt;pre&gt;
&lt;code&gt;
showAllStringPropertiesOf( object1 ).and ( object2 );
&lt;/code&gt;
&lt;/pre&gt;
by adding some code below
&lt;pre&gt;
&lt;code&gt;
function showAllStringPropertiesOf ( ... ) {
  ...
  ...
  return addAndMagicTo(arguments.callee);
}

function addAndMagicTo( fn ) {
  fn.and = fn;
  return fn;
}
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Tien Dung&lt;/p&gt;


	&lt;p&gt;http://free-and-happy.blogspot.com/&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>daniel</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-08:34</id>
    <published>2007-08-08T07:34:00Z</published>
    <updated>2007-09-15T14:37:34Z</updated>
    <category term="Daniel" />
    <link href="http://blog.spiragram.com/2007/8/8/do-you-mean" rel="alternate" type="text/html" />
    <title>Using raspell with your own custom dictionary</title>
<content type="html">
            &lt;p&gt;A good search engine should be smart enough to detect spelling errors and provide suggestions. For example if you misspelled a word when using Google search, it will ask &lt;strong&gt;Do you mean:...&lt;/strong&gt;. It will be cool to have such feature for our own search engine. So I started to explore possible solutions what works will rails and came upon this blog post by &lt;a href="http://blog.evanweaver.com/articles/2007/03/10/add-gud-spelning-to-ur-railz-app-or-wharever"&gt;Evan Weaver&lt;/a&gt;. He has implemented a ruby gem &lt;a href="http://blog.evanweaver.com/files/doc/fauna/raspell/files/README.html"&gt;raspell&lt;/a&gt; to interface with &lt;a href="http://aspell.net"&gt;Aspell&lt;/a&gt;. That sounds like a good solution and I decided to check it out.&lt;/p&gt;


	&lt;h3&gt;1. Installing Aspell&lt;/h3&gt;


	&lt;p&gt;As mentioned in Evan’s post to install Aspell just type the following command from terminal:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sudo port install aspell aspell-dict-en
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;This will install both the aspell library and aspell English dictionary.&lt;/p&gt;


	&lt;h3&gt;2. Install raspell&lt;/h3&gt;


	&lt;p&gt;This is straight forward.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sudo gem install raspell -- --with-opt-dir=/opt/local
&lt;/code&gt;
&lt;/pre&gt;

	&lt;h3&gt;3. Setting up your own dictionary&lt;/h3&gt;


	&lt;p&gt;For my case I needed aspell to check against my own custom dictionary. I create a text file containing the list of words with each word on a new line save it as wordlist. e.g.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
John
Simon
Mae
Tim
Louis
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Then run it with the following command.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
aspell --lang=en create master ./en_SG-name.rws &amp;lt; wordlist
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Note that for the language option I’m using ‘en’ which is the standard code for English. If you are generating a word list in other languages you will have to change lang option accordingly. The name of the output file is important because Aspell only pick up dictionary file in a certain naming format. The dictionary file should start with the language code then follow by a country code which is optional. For my case I have chosen SG because I do not want to override the default en dictionaries from Aspell. The ‘name’ after the ’-’ is actually the jargon. So if you are generating a word list of street names in US you might want to name you dictionary as en_US-street.rws. Once you have generated the dictionary you will have to place it in Aspell default dictionary directory.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sudo mv en_SG-name.rws /opt/local/share/aspell/
&lt;/code&gt;
&lt;/pre&gt;

Because Aspell will only look for dictionaries with .multi file extension in the default directory. I’ll need to create a en_SG-name.multi file for my new dictionary 
&lt;pre&gt;
&lt;code&gt;
sudo vi /opt/local/share/aspell/en_SG-name.multi
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;and add the following line.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
add en_SG-name.rws
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;You can add multiple dictionary to this file. If you needed the common English dictionary together with your custom one. Just add it accordingly.&lt;/p&gt;


	&lt;h3&gt;4. Using your own dictionary in ruby.&lt;/h3&gt;


	&lt;p&gt;Finally to use the dictionary I have just created.&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
require 'rubygems'
require 'raspell'

sp = Aspell.new('en_SG', 'name')
sp.suggest('Mea')
=&amp;gt; ["Mae"]
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;The first parameter is the language part of the file name and the second is the jargon. So if you have named your dictionary as en_US-street.multi then you will need to initialize it with&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
sp = Aspell.new('en_US', 'street')
&lt;/code&gt;
&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>tiendung</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-07:37</id>
    <published>2007-08-07T08:10:00Z</published>
    <updated>2007-08-17T02:09:42Z</updated>
    <category term="Tien Dung" />
    <link href="http://blog.spiragram.com/2007/8/7/my-first-task-at-spiragram" rel="alternate" type="text/html" />
    <title>My first task at Spiragram</title>
<content type="html">
            T1) Setting a server&lt;br /&gt;
T2) Implement a simple feature&lt;br /&gt;
T3) Adding data to a website&lt;br /&gt;
T4) Reading xxx pages of the Top Secret Methodology Book&lt;br /&gt;
&lt;br /&gt;
Which Tx == true ?&lt;br /&gt;
Anybody can guest ?&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
The correct answer is:&lt;br /&gt;
&lt;br /&gt;
(T1 || T2 || T3 || T4 == false)&lt;br /&gt;
&lt;br /&gt;
Let me tell you my first task is get used to a brand new MacBook :)))&lt;br /&gt;
&lt;br /&gt;
Actually, my first task (I assign to myself) is to understand and catch up with other team members as soon as possible. Working at Spiragram is like a dream, everyday working with people who share the same vision, read the same books and ... at the same toilet too :) I will try my best to keep this dream last forever.&lt;br /&gt;
&lt;br /&gt;
Tien Dung
          </content>  </entry>
  <entry xml:base="http://blog.spiragram.com/">
    <author>
      <name>shoop</name>
    </author>
    <id>tag:blog.spiragram.com,2007-08-06:36</id>
    <published>2007-08-06T17:10:00Z</published>
    <updated>2007-08-06T17:12:21Z</updated>
    <category term="Shoop" />
    <link href="http://blog.spiragram.com/2007/8/6/it-s-about-the-ride-for-christ-s-sake" rel="alternate" type="text/html" />
    <title>It's about the Ride, for Christ's sake.</title>
<content type="html">
            &lt;p&gt;
From &lt;a href="http://www.shooperman.com/2007/8/6/it-s-about-the-ride-for-christ-s-sake"&gt;www.shooperman.com&lt;/a&gt;:
&lt;/p&gt;

&lt;blockquote&gt;
It's always the same story with you, huh, pal?&lt;br /&gt;
You did this one movie a hundred years ago.&lt;br /&gt;
From then on, you thought your were better than everybody else.&lt;br /&gt;
Why don't you let go?&lt;br /&gt;
Move on with your life.&lt;br /&gt;
It's not about what happened in the past...&lt;br /&gt;
or what you think might happen in the future.&lt;br /&gt;
It's about the ride, for Christ's sake.&lt;br /&gt;
There's no point going through all this crap...&lt;br /&gt;
if you're not gonna enjoy the ride.&lt;br /&gt;
And you know what?&lt;br /&gt;
When you least expect it, 
something great might come along&lt;br /&gt;
something even better than you ever planned.&lt;br /&gt;
&lt;/blockquote&gt;
          </content>  </entry>
</feed>
