<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>Phnom Penh Developers</title>
      <description>Combined feed for developers in Phnom Penh, Cambodia</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=KPESBeqH3RGbUmNUpgt1Yg</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=KPESBeqH3RGbUmNUpgt1Yg&amp;_render=rss&amp;page=2"/>
      <pubDate>Mon, 13 Feb 2012 00:18:30 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>Build monodevelop on ubuntu 11.10</title>
         <link>http://chornsokun.wordpress.com/2011/11/11/build-monodevelop-on-ubuntu-11-10/</link>
         <description>Again? yes but this time I don&amp;#8217;t have to built mono runtine Ubuntu 11.10 packed with mono 2.10.5 which good enough since what I am after is dynamic. However monodevelop I got from Ubuntu Software Center (USC) is 2.6 and the official release is 2.8.x so I take my on my gut to try and [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=692&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=692</guid>
         <pubDate>Fri, 11 Nov 2011 16:12:59 +0000</pubDate>
         <content:encoded><![CDATA[<p>Again? yes but this time I don&#8217;t have to built mono runtine Ubuntu 11.10 packed with mono 2.10.5 which good enough since what I am after is dynamic.<br />
However monodevelop I got from Ubuntu Software Center (USC) is 2.6 and the official release is 2.8.x so I take my on my gut to try and built me an IDE ;)</p>
<p>This time it much easier what I have to do is get latest copy of the source code from github.com</p>
<p>&gt; git clone git://github.com/mono/monodevelop.git</p>
<p>Then install build dependent by issuing this command</p>
<p>&gt; sudo apt-get build-dep monodevelop</p>
<p>I don&#8217;t know why mono-gmcs was not install as part of the previous command (if you know why please comment) for now I have to install another package</p>
<p>&gt; sudo apt-get install mono-gmcs</p>
<p>and then I&#8217;m ready to</p>
<p>&gt; ./configure<br />
&gt; sudo make &amp;&amp; make run</p>
<p>&gt; monodevelop</p>
<p>BOOM !</p>
<p><a rel="nofollow" target="_blank" href="http://chornsokun.files.wordpress.com/2011/11/monodevelop-2-8-2-git.png"><img class="alignnone size-full wp-image-695" title="monodevelop-2.8.2-git" src="http://chornsokun.files.wordpress.com/2011/11/monodevelop-2-8-2-git.png?w=700" alt=""/></a></p>
<pre>MonoDevelop 2.8.2
Installation UUID: b220bfc2-57c6-4b94-840e-ff6c6477632d
Runtime:
	Mono 2.10.5 (Debian 2.10.5-1) (64-bit)
	GTK 2.24.6
	GTK# (2.12.0.0)
Build information:
	Git revision: e047f99f6df7b5c801102c03f903d4dd722b2989-dirty
	Build date: 2011-11-11 15:03:47+0000

Thanks to mono packaging team, you guy rock!</pre>
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/692/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/692/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/692/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/692/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/692/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/692/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/692/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=692&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
         <media:content medium="image" url="http://chornsokun.files.wordpress.com/2011/11/monodevelop-2-8-2-git.png">
            <media:title type="html">monodevelop-2.8.2-git</media:title>
         </media:content>
      </item>
      <item>
         <title>My new url to my blog</title>
         <link>http://samneang-ngeth.blogspot.com/2011/08/my-new-url-to-my-blog.html</link>
         <description>I just changed my url to be the one bellow, please refer blog list of mine to the new address bellow:
&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://samnang-cheng.blogspot.com&quot;&gt;http://samnang-cheng.blogspohttp://www.blogger.com/img/blank.gift.com&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5395142823522975216-8510059455645174245?l=samneang-ngeth.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (samnang)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5395142823522975216.post-8510059455645174245</guid>
         <pubDate>Thu, 01 Sep 2011 03:52:00 +0000</pubDate>
      </item>
      <item>
         <title>LINQ 101 .NET Reflection</title>
         <link>http://chornsokun.wordpress.com/2011/05/07/linq-101-net-reflection/</link>
         <description>In this post I am going over three points listed bellow: What is .NET Reflection? Cut short it refer to a set of API built-in .NET Framework, which give you a greate power to load and manipulate type within assembly (.dll) one of the most favor use is to support late binding. There a whole lot [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=683&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=683</guid>
         <pubDate>Sat, 07 May 2011 05:39:19 +0000</pubDate>
         <content:encoded><![CDATA[<p>In this post I am going over three points listed bellow:</p>
<p><strong>What is .NET Reflection?</strong> Cut short it refer to a set of API built-in .NET Framework, which give you a greate power to load and manipulate type within assembly (.dll) one of the most favor use is to support late binding. There a whole lot of explaination available through google! but that all I care for now.</p>
<p><strong>How about LINQ? </strong>stand for .NET Language-Integrated Query,</p>
<blockquote><p> a set of general purpose <em>standard query operators</em> that allow traversal, filter, and projection operations to be expressed in a direct yet declarative way in any .NET-based programming language. The standard query operators allow queries to be applied to any <strong>IEnumerable&lt;T&gt;</strong>-based information source.</p></blockquote>
<p><strong>What it mean to me?</strong><br />
Assume that I had ITrap interface and a bunch of Trap implementation as show in the code bellow:<br />
<pre>
interface ITrap{
  void Setup();
  int OrderNr { get; };
}

class LevelOneTrap: ITrap{
  public void Setup(){
    Console.WriteLine(&quot;LevelOne Setup First&quot;);
  }
  public int OrderNr {
    get { return 1; }
  }
}

class LevelTwoTrap: ITrap{
  public void Setup(){
    Console.WriteLine(&quot;LevelTwo Setup Next&quot;);
  }
  public int OrderNr {
    get { return 2; }
  }
}
</pre></p>
<p>Now I want to Setup all trap by respecting it OrderNr which mean LevelOneTrap.Setup() must execute before LevelTwoTrap.Setup() so far so good? Let see how many lines of code needed:</p>
<p><pre>
var trapInterface = typeof(ITrap);

var trapImplementations = ( from t in trapInterface.Assembly.GetTypes()
                      where t.IsClass &amp;&amp; t.GetInterfaces().Any(x =&gt; x == trapInterface)
                      select (ITrap)Activator.CreateInstance(t)
                  ).OrderBy(k=&gt;k.OrderNr);

// time to play ;)
foreach( var trap in trapImplementations ) {
  trap.Setup();
}

//   LevelOne Setup First
//   LevelTwo Setup Next

</pre></p>
<p>Cool isn&#8217;t it? Life is short so our code!</p>
<br /> Tagged: <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/net-reflection/'>.NET Reflection</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/c/'>C#</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/linq/'>LINQ</a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/683/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/683/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/683/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/683/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/683/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/683/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/683/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/683/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=683&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
      </item>
      <item>
         <title>High Performance Website Presentation at Hackerspacepp</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/vYx4zHw4qmY/high-performance-website-presentation.html</link>
         <description>I’m a little bit disappointed in myself. What I intended to do presentation is about Web Scaling, but I ended up with go through the front end side. This presentation will focus on how to make your website faster on the front end side. I did focus on some aspects on HTTP concept as well. Those are rules from Steve Souders, but I modify and adjust to make it clear to the audience.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;&quot; id=&quot;__ss_7783873&quot;&gt; &lt;strong style=&quot;display:block;margin:12px 0 4px;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/high-performance-website-7783873&quot; title=&quot;High performance website&quot;&gt;High performance website&lt;/a&gt;&lt;/strong&gt;  &lt;div style=&quot;padding:5px 0 12px;&quot;&gt; View more &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;Chamnap Chhorn&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-8404703751548354636?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/vYx4zHw4qmY&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-8404703751548354636</guid>
         <pubDate>Mon, 02 May 2011 02:24:00 +0000</pubDate>
      </item>
      <item>
         <title>Re: Re-Activate the group</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/06ab0de4c97e8e6a/f713d529c77ea4a0?show_docid=f713d529c77ea4a0</link>
         <author>Khou Suylong</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/06ab0de4c97e8e6a/f713d529c77ea4a0?show_docid=f713d529c77ea4a0</guid>
         <pubDate>Mon, 04 Apr 2011 14:07:34 +0000</pubDate>
      </item>
      <item>
         <title>Re: Re-Activate the group</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/06ab0de4c97e8e6a/76b026f9d12b31e1?show_docid=76b026f9d12b31e1</link>
         <author>Chea sereyvath</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/06ab0de4c97e8e6a/76b026f9d12b31e1?show_docid=76b026f9d12b31e1</guid>
         <pubDate>Mon, 04 Apr 2011 04:08:33 +0000</pubDate>
      </item>
      <item>
         <title>REST Presenation on DevCamp, Hackerspacepp</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/YLRvFAvXbwU/rest-presenation-on-devcamp.html</link>
         <description>Last sunday, I talked to some people, around 10 software developers, about how to build web services using REST architecture. However, I didn't talk on &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/rest-web-services-in-rails&quot;&gt;my previous slide presentation&lt;/a&gt;. I took on &lt;a rel=&quot;nofollow&quot;&gt;Doing REST Right&lt;/a&gt; by Kerry Buckley. I decided to choose this slide because I feel I learnt something new and it's recommended by my boss, Chris. Actually, I were not well-prepared, but the presentation went well. I missed some slides before I went to do this presentation.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;&quot; id=&quot;__ss_3385800&quot;&gt; &lt;strong style=&quot;display:block;margin:12px 0 4px;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/kjbuckley/doing-rest-right-3385800&quot; title=&quot;Doing REST Right&quot;&gt;Doing REST Right&lt;/a&gt;&lt;/strong&gt;     &lt;embed name=&quot;__sse3385800&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=doingrestright-100310081847-phpapp01&amp;stripped_title=doing-rest-right-3385800&amp;userName=kjbuckley&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;  &lt;div style=&quot;padding:5px 0 12px;&quot;&gt; View more &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/kjbuckley&quot;&gt;Kerry Buckley&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-7641631831709968702?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/YLRvFAvXbwU&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-7641631831709968702</guid>
         <pubDate>Tue, 29 Mar 2011 03:42:00 +0000</pubDate>
         <enclosure length="94394" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=doingrestright-100310081847-phpapp01&amp;stripped_title=doing-rest-right-3385800&amp;userName=kjbuckley"/>
      </item>
      <item>
         <title>How to check your ubuntu distribution</title>
         <link>http://sareuon.blogspot.com/2011/03/how-to-check-your-ubuntu-distribution.html</link>
         <description>Knowing your distribution is help to install package that is suitable for your box. This command will help you to find out what is your Ubuntu distribution.&lt;br /&gt;&lt;br /&gt;cat /etc/*-release&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-809098922331738474?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-809098922331738474</guid>
         <pubDate>Tue, 15 Mar 2011 03:31:00 +0000</pubDate>
      </item>
      <item>
         <title>Find Process Id in Ubutu</title>
         <link>http://sareuon.blogspot.com/2011/01/find-process-id-in-ubutu.html</link>
         <description>Many times that I have problem with how can I stop the background process of some app like tomcat, geoserver, ruby....&lt;br /&gt;&lt;br /&gt;Ok, I found that we can use command $ps aux | grep tomcat&lt;br /&gt;&lt;br /&gt;the returning result is here.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;1000      2957  0.0  0.0   3044   800 pts/1    S+   10:05   0:00 grep --color=auto tomcat&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;so on the return result I realize that the process is of tomcat is &quot;2957&quot;.&lt;br /&gt;&lt;br /&gt;then I can kill it by run $sudo kill 2957&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-3144777792581902951?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-3144777792581902951</guid>
         <pubDate>Fri, 28 Jan 2011 03:01:00 +0000</pubDate>
      </item>
      <item>
         <title>Kills Backgroud Process On Ubuntu</title>
         <link>http://sareuon.blogspot.com/2011/01/kills-backgroud-process-on-ubuntu.html</link>
         <description>I run Geoserver on port 8080 in background process, I wish to stop it so I have to run command:&lt;br /&gt;1-$sudo netstat -lpn | grep :8080&lt;br /&gt;then it will reply some think like here.&lt;br /&gt;&lt;br /&gt;tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1847/java&lt;br /&gt;&lt;br /&gt;2.then I found that geoserver on my box have process id 1847 so. I can kill it by run&lt;br /&gt;$sudo kill 1847.&lt;br /&gt;&lt;br /&gt;it done.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-3354943287824074854?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-3354943287824074854</guid>
         <pubDate>Fri, 28 Jan 2011 02:52:00 +0000</pubDate>
      </item>
      <item>
         <title>ShareVisoin: Web Mapping</title>
         <link>http://sareuon.blogspot.com/2011/01/sharevisoin-web-mapping.html</link>
         <description>Hi there this is my slide at &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.hackerspacepp.org/&quot;&gt;HackerSpacePP&lt;/a&gt;, on 22 jan 2011.&lt;br /&gt;&lt;div style=&quot;width:425px;&quot; id=&quot;__ss_6707675&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/sareuon/web-mapping-6707675&quot; title=&quot;Web mapping&quot;&gt;Web mapping&lt;/a&gt;&lt;/strong&gt;&lt;embed name=&quot;__sse6707675&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=webmapping-110126041734-phpapp01&amp;stripped_title=web-mapping-6707675&amp;userName=sareuon&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;padding:5px 0 12px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/sareuon&quot;&gt;Sareuon Soum&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-4303807542932175041?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-4303807542932175041</guid>
         <pubDate>Wed, 26 Jan 2011 10:23:00 +0000</pubDate>
      </item>
      <item>
         <title>.NET developer survive on linux</title>
         <link>http://chornsokun.wordpress.com/2011/01/22/net-developer-survive-on-linux/</link>
         <description>I&amp;#8217;ve been joking with my friends &amp;#8220;the open source fan boyz&amp;#8221; that I am a Microsoft slave for the fact that I am a dedicated .NET developer. But for all the joke I found some competitive disadvantage for me moving forward. If customer is looking for a low cost solution .NET is not the way to [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=675&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=675</guid>
         <pubDate>Sat, 22 Jan 2011 15:36:16 +0000</pubDate>
         <content:encoded><![CDATA[<p>I&#8217;ve been joking with my friends &#8220;the open source fan boyz&#8221; that I am a Microsoft slave for the fact that I am a dedicated .NET developer. But for all the joke I found some competitive disadvantage for me moving forward. If customer is looking for a low cost solution .NET is not the way to go. Base on what I do for a living, I build desktop and web application in .NET. But I tend to focus more on Web Application which dragged me to ASP.NET MVC.</p>
<p>Let taking ASP.NET MVC to build solution <span style="text-decoration:underline;"><strong>for me</strong></span> it yield a great ROI for me</p>
<ol>
<li>I got to learn more about .NET library</li>
<li>it still .NET so I can use all the skill I got</li>
<li>got great IDE support =&gt; productivity is high so and so &#8230;</li>
</ol>
<p><strong>for clients</strong> :/ intranet deploy</p>
<ol>
<li>invest on the server hardware (normal)</li>
<li>software license just take Microsoft Windows Server + SQL Server hmm</li>
</ol>
<p>and for Internet deploy ASP.NET hosting generally more expensive than LAMP stack. If I am about to help client cutting down expenditure cost I got to get rid of the underline infrastructure need to run the application. Possible with Mono but I am keep hearing incompatible issues on ASP.NET + Mono.</p>
<p>Anyway let me (us) forget all about ASP.NET glorious day. Recently, I start caught up with a movement in two different communities. Both of them trying to escape from ASP.NET sandbox and they both  gave birth to two unrelated open source projects <strong><a rel="nofollow" target="_blank" href="https://github.com/jacksonh/manos">manos</a></strong> and <strong><a rel="nofollow" target="_blank" href="https://github.com/thecodejunkie/Nancy">Nancy</a></strong> that the cool part.</p>
<p>These two project promised to free its user from underline infrastructure (no more IIS is required!) and it work x-platform.</p>
<blockquote><p>Up to this point I can only make manos serve page, I am keep watching and follow-up with Nancy development. I hope to be able to compare advantage and disadvantage between the two projects in the future.</p>
<p><em>&#8220;Nancy start with a full range of view template to choice from, and I do not think it hard for manos to do the same thing&#8221;.</em></p></blockquote>
<p><strong>Which one is the best?</strong> is not really important at this point, what important is when these projects are matured we can use it to build low cost solution for my clients while still enjoy writing C# &#8220;YES, it pronounced C-Sharp&#8221; :D, <strong>but how?</strong> Here the spec</p>
<ul>
<li>Web Application power by [manos | Nancy] + a few open source libraries</li>
<li>Mono 2.8.x or higher</li>
<li>Server OS OpenSuse 11.13</li>
<li>Back-end database name a few open source DBMS</li>
</ul>
<p>Why OpenSuse? it is mono home&#8217;s os, and if you want to get hot-fix on time that the way to go. So let me end this blah blah post with a teasing screenshot!</p>
<div id="attachment_676" class="wp-caption alignnone" style="width:710px;"><a rel="nofollow" target="_blank" href="http://chornsokun.files.wordpress.com/2011/01/monos-hello-world.png"><img class="size-full wp-image-676" title="monos-hello-world" src="http://chornsokun.files.wordpress.com/2011/01/monos-hello-world.png?w=700&#038;h=460" alt="" width="700" height="460"/></a><p class="wp-caption-text">Hello World from manos running on OpenSuse 11.13 inside VirtualBox, client access from Ubuntu 10.10 if you care about the environment :D</p></div>
<p>There you go it&#8217;s how a .NET developer survive on linux nice hacking weekend everyone!</p>
<br /> Tagged: <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/manos/'>manos</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/mono-2-8-x/'>mono-2.8.x</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/nancy/'>Nancy</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/opensuse-11-13/'>OpenSuse-11.13</a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/675/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/675/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/675/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/675/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/675/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/675/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/675/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=675&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
         <media:content medium="image" url="http://chornsokun.files.wordpress.com/2011/01/monos-hello-world.png">
            <media:title type="html">monos-hello-world</media:title>
         </media:content>
      </item>
      <item>
         <title>Open Tech-Talk on Web Mapping</title>
         <link>http://sareuon.blogspot.com/2011/01/open-tech-talk-on-web-mapping.html</link>
         <description>There are a lot of people using they browsers to suff information on the net, also today technology you can use web map to show the location of restaurants, museums, and art venues. A business can post a map for reaching its offices. The state government can present a map showing average income by area.&lt;br /&gt;&lt;br /&gt;Most of you already use web map but don't really know the process and accompanying tools for creating and publishing on-line maps. Ok, on 22 January 2011, at HackerSpacePP we have Open Tech-Talk organize by ShareVisoin Team Iḿ going to have a talk on the process of designing, implementing, generating and delivering maps to www.&lt;br /&gt;&lt;br /&gt;So see you there!&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-2596907762513940985?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-2596907762513940985</guid>
         <pubDate>Mon, 17 Jan 2011 13:33:00 +0000</pubDate>
      </item>
      <item>
         <title>How to changing default Khmer Unicode Font in Ubuntu</title>
         <link>http://chornsokun.wordpress.com/2010/12/10/how-to-changing-default-khmer-unicode-font-in-ubuntu/</link>
         <description>In Ubuntu 10.10 release cycle ttf-khmeros version 5.0.3 was included. However the only problem I had with Chrome.  Later on I was told that the fix is by trying various font until we find the one that work properly. So the idea is to change default Khmer Unicode font so let see how we do [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=668&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=668</guid>
         <pubDate>Fri, 10 Dec 2010 01:27:56 +0000</pubDate>
         <content:encoded><![CDATA[<p>In Ubuntu 10.10 release cycle ttf-khmeros version 5.0.3 was included. However the only problem I had with Chrome.  Later on I was told that the fix is by trying various font until we find the one that work properly.</p>
<p>So the idea is to change default Khmer Unicode font so let see how we do it:<br />
<pre>
sudo gedit /etc/fonts/conf.d/65-khmer.conf
</pre></p>
<p>you can replace &lt;family&gt;<strong>Khmer OS</strong>&lt;/family&gt; with &lt;family&gt;<strong>Khmer_Unicode_Font_Of_Your_Choice</strong>&lt;/family&gt; or if you do not want to touch the line you can just add another line on top like this:<br />
<pre>
&lt;family&gt;Khmer_Unicode_Font_Of_Your_Choice&lt;/family&gt;
&lt;family&gt;Khmer OS&lt;/family&gt;
</pre><br />
next step issue the following command to update font package:</p>
<p><pre>
sudo dpkg-reconfigure ttf-khmeros
</pre></p>
<p>logout and log back in again.</p>
<p>Thanks @<a rel="nofollow" target="_blank" href="http://www.facebook.com/chanrithy.thim">rithy</a> for sharing this technique.</p>
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/668/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/668/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/668/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/668/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/668/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/668/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/668/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/668/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=668&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
      </item>
      <item>
         <title>.NET Database Application Development (C#)</title>
         <link>http://chornsokun.wordpress.com/2010/12/05/net-database-application-development-c/</link>
         <description>If you are interested in .NET and want to jump start with Database Application Development in no time here is your chance Lady &amp;#38; Gentlemen, boy &amp;#38; girl I present you a .NET Database Application Development (C#) fast track with the following content: C# Programming Introduction Introduction to NHibernate .NET Object Relational Mapping (ORM) Advance Data Processing with [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=664&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=664</guid>
         <pubDate>Sun, 05 Dec 2010 09:36:32 +0000</pubDate>
         <content:encoded><![CDATA[<p>If you are interested in .NET and want to jump start with Database Application Development in no time here is your chance</p>
<p>Lady &amp; Gentlemen, boy &amp; girl I present you a <strong>.NET Database Application Development (C#) </strong>fast track with the following content:</p>
<ol>
<li>C# Programming Introduction</li>
<li>Introduction to NHibernate .NET 	Object Relational Mapping (ORM)</li>
<li>Advance Data Processing with 	NHibernate Criteria API</li>
<li>Hand-on practice</li>
</ol>
<p>At the end of the course your will learn tools &amp; technique to develop database application which could talk various Database Management System (DBMS) from Microsoft Access, Microsoft SQL Server, MySQL you name it.</p>
<p>Now the truth about doing this in no time :D I lie :-P I need minimum 10 hours before I can transform a newbie into a <strong>.NET Database Application Development (C#)</strong></p>
<p><strong>Requirement:</strong></p>
<ul>
<li>Basic Programming Concept</li>
<li>Know basic C# Programming</li>
<li>Be able to read and understand this blog post &#8211; otherwise get yourself English tutor</li>
</ul>
<p>If you, your friend interested or your employer got budget to develop your capacity drop me a line I would love to hear about it ;)</p>
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/664/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/664/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/664/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/664/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/664/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/664/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/664/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=664&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
      </item>
      <item>
         <title>Deploy MonoRail on IIS7</title>
         <link>http://chornsokun.wordpress.com/2010/11/04/deploy-monorail-on-iis7/</link>
         <description>Note to myself 1. On Default Web Site, click Add Application 2. Change Application Pools = Classic .NET AppPool , go to Application Pools and click on Classic .NET AppPool then take Advanced Settings 3. Add the following setting to web.config We good to go, hope I don&amp;#8217;t waste my time again on this thing.&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=658&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=658</guid>
         <pubDate>Thu, 04 Nov 2010 09:10:08 +0000</pubDate>
         <content:encoded><![CDATA[<p>Note to myself</p>
<p>1. On Default Web Site, click <strong>Add Application</strong></p>
<p>2. Change Application Pools = <strong>Classic .NET AppPool</strong> , go to Application Pools and click on <strong>Classic .NET AppPool</strong> then take <strong>Advanced Settings</strong></p>
<div id="attachment_660" class="wp-caption alignnone" style="width:449px;"><a rel="nofollow" target="_blank" href="http://chornsokun.files.wordpress.com/2010/11/class-aspnet.png"><img class="size-full wp-image-660" title="class-aspnet" src="http://chornsokun.files.wordpress.com/2010/11/class-aspnet.png?w=700" alt=""/></a><p class="wp-caption-text">Calssic .NET Application Pools, Advanced Settings</p></div>
<p>3. Add the following setting to <strong>web.config</strong></p>
<p><pre>
	&lt;system.webServer&gt;
		&lt;handlers&gt;
		  &lt;clear /&gt;
		  &lt;add name=&quot;PageHandlerFactory-ISAPI-2.0-64&quot; path=&quot;*.aspx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%&#92;Microsoft.NET&#92;Framework64&#92;v2.0.50727&#92;aspnet_isapi.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;classicMode,runtimeVersionv2.0,bitness64&quot; responseBufferLimit=&quot;0&quot; /&gt;
		  &lt;add name=&quot;PageHandlerFactory-ISAPI-2.0&quot; path=&quot;*.aspx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%&#92;Microsoft.NET&#92;Framework&#92;v2.0.50727&#92;aspnet_isapi.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;classicMode,runtimeVersionv2.0,bitness32&quot; responseBufferLimit=&quot;0&quot; /&gt;
		  &lt;add name=&quot;MonoRail64&quot; path=&quot;*.castle&quot; verb=&quot;*&quot; type=&quot;&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%&#92;Microsoft.NET&#92;Framework64&#92;v2.0.50727&#92;aspnet_isapi.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;classicMode,runtimeVersionv2.0,bitness64&quot; responseBufferLimit=&quot;4194304&quot; /&gt;
		  &lt;add name=&quot;MonoRail&quot; path=&quot;*.castle&quot; verb=&quot;*&quot; type=&quot;&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%&#92;Microsoft.NET&#92;Framework&#92;v2.0.50727&#92;aspnet_isapi.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;classicMode,runtimeVersionv2.0,bitness32&quot; responseBufferLimit=&quot;4194304&quot; /&gt;
		  &lt;!--
		  &lt;add name=&quot;UrlRewriting64&quot; path=&quot;*&quot; verb=&quot;*&quot; type=&quot;&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%&#92;Microsoft.NET&#92;Framework64&#92;v2.0.50727&#92;aspnet_isapi.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;None&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;classicMode,runtimeVersionv2.0,bitness64&quot; responseBufferLimit=&quot;4194304&quot; /&gt;
		  &lt;add name=&quot;UrlRewriting&quot; path=&quot;*&quot; verb=&quot;*&quot; type=&quot;&quot; modules=&quot;IsapiModule&quot; scriptProcessor=&quot;%windir%&#92;Microsoft.NET&#92;Framework&#92;v2.0.50727&#92;aspnet_isapi.dll&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;None&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;classicMode,runtimeVersionv2.0,bitness32&quot; responseBufferLimit=&quot;4194304&quot; /&gt;
		  --&gt;
		  &lt;add name=&quot;StaticFile&quot; path=&quot;*&quot; verb=&quot;*&quot; type=&quot;&quot; modules=&quot;StaticFileModule,DefaultDocumentModule,DirectoryListingModule&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Either&quot; requireAccess=&quot;Read&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;&quot; responseBufferLimit=&quot;4194304&quot; /&gt;
		&lt;/handlers&gt;
	&lt;/system.webServer&gt;
</pre></p>
<p>We good to go, hope I don&#8217;t waste my time again on this thing.
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/658/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/658/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/658/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/658/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/658/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/658/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/658/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=658&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
         <media:content medium="image" url="http://chornsokun.files.wordpress.com/2010/11/class-aspnet.png">
            <media:title type="html">class-aspnet</media:title>
         </media:content>
      </item>
      <item>
         <title>Ubuntu (NHibernate Mono MySQL) Take 2</title>
         <link>http://chornsokun.wordpress.com/2010/10/19/ubuntu-nhibernate-mono-mysql-take-2/</link>
         <description>In my previous post I am talking about the setting mono, Nhibernate and MySQL stack on Ubuntu, it was a fun experience. However I made a mistake since I didn&amp;#8217;t intend seriously use mono at the time I just wipe the whole os off my laptop and boom all the sample code and assembly gone [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=649&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=649</guid>
         <pubDate>Tue, 19 Oct 2010 14:43:08 +0000</pubDate>
         <content:encoded><![CDATA[<p>In my <a rel="nofollow" target="_blank" href="http://chornsokun.wordpress.com/2009/11/05/nhibernate-mono-mysql-fly-by/">previous post</a> I am talking about the setting mono, Nhibernate and MySQL stack on Ubuntu, it was a fun experience. However I made a mistake since I didn&#8217;t intend seriously use mono at the time I just wipe the whole os off my laptop and boom all the sample code and assembly gone too. But guess what this time I did it again with the combination of</p>
<ul>
<li>Nhibernate 3 (beta build from trunk)</li>
<li>ConfORM (just so I don&#8217;t have to worry about .hbm.xml files)</li>
<li>MySQL driver install via Synaptic Package Manager (cuz I&#8217;m a bit lazy this time)</li>
</ul>
<p>Now see what I got:</p>
<div id="attachment_650" class="wp-caption alignnone" style="width:690px;"><a rel="nofollow" target="_blank" href="http://chornsokun.files.wordpress.com/2010/10/mono-nhibernate3-beta.png"><img class="size-full wp-image-650" title="mono-nhibernate3-beta" src="http://chornsokun.files.wordpress.com/2010/10/mono-nhibernate3-beta.png?w=700" alt=""/></a><p class="wp-caption-text">SchemaExport in Action ;)</p></div>
<p>And of cause I do make the sample code &amp; assembly accessible at <a rel="nofollow" target="_blank" href="http://www.joljet.net/nhibernate3-confORM-mono.tar.gz">http://www.joljet.net/nhibernate3-confORM-mono.tar.gz</a> .</p>
<br /> Tagged: <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/mysql/'>MySql</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/nhibernate/'>NHibernate</a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/649/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/649/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/649/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/649/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/649/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/649/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/649/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=649&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
         <media:content medium="image" url="http://chornsokun.files.wordpress.com/2010/10/mono-nhibernate3-beta.png">
            <media:title type="html">mono-nhibernate3-beta</media:title>
         </media:content>
      </item>
      <item>
         <title>Relative local file path to Uri</title>
         <link>http://chornsokun.wordpress.com/2010/09/11/relative-local-file-path-to-uri/</link>
         <description>It just another weekend in my life time; let write a few line of code for fun. Hope you enjoy your weekend :D&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=624&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=624</guid>
         <pubDate>Sat, 11 Sep 2010 03:27:25 +0000</pubDate>
         <content:encoded><![CDATA[<p>It just another weekend in my life time; let write a few line of code for fun.</p>
<p><pre>
// Do you know you can easily conver file with relative path to an Uri object?
// of cause you do :D
var fileInfo = new FileInfo(@&quot;..&#92;Files&#92;TGIS.xls&quot;);
var uri = new Uri(fileInfo.Fullname);
</pre></p>
<p>Hope you enjoy your weekend :D</p>
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/624/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/624/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/624/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=624&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
         <category>Tips &amp; Tricks</category>
      </item>
      <item>
         <title>Load Balancer Algorithm Explained</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/pel3tvwIEP0/load-balancer-algorithm-explained.html</link>
         <description>I've been googling around 2 days just want to know the best way that heavy-load rails sites was handled. I'm having trouble with mongrel clusters, one of which usually dies because of some heavy requests and nginx still forwards request to that frozen mongrel (using nginx simple load balancer). I was curious what are the options to solve this. I have looked at various solutions: &lt;span style=&quot;font-weight:bold;&quot;&gt;simple nginx load balancer&lt;/span&gt;, &lt;span style=&quot;font-weight:bold;&quot;&gt;fair nginx load balancer&lt;/span&gt;, &lt;span style=&quot;font-weight:bold;&quot;&gt;HAProxy&lt;/span&gt;, and finally &lt;span style=&quot;font-weight:bold;&quot;&gt;Phusion Passenger&lt;/span&gt;. However, I didn't go through JRuby for deploy rails app and Unicorn.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Simple Load Balancer&lt;/span&gt;&lt;br /&gt;By default, nginx is only a simple robin-round load balancer. What it does is just send those requests to one of those backends (mongrel in this case) in simple manner (a,b,a,b, ...). The round-robin algorithm is often an acceptable tool: if every request finishes within a few milliseconds, there’s no problem. In this scenario, each backend has its own queue for processing concurrent requests. Therefore, if the heavy request comes in, the queue requests in that backend will be waiting and is able to process until that long-running request finishes. So what if that heavy request process longer than 60 seconds, those queue requests will never be able to process because it has been timeout.&lt;br /&gt;Another problem is that nginx would flood mongrels with too many requests and mongrel's request queue was not solid and it would quickly get stuck with too many queued requests.&lt;br /&gt;&lt;br /&gt;Here is the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://wiki.nginx.org/NginxLoadBalanceExample&quot;&gt;configuration &lt;/a&gt;of nginx simple load balancer.&lt;br /&gt;&lt;pre&gt;http {&lt;br /&gt;  upstream myproject {&lt;br /&gt;    server 127.0.0.1:8000;&lt;br /&gt;    server 127.0.0.1:8001;&lt;br /&gt;    server 127.0.0.1:8002;    &lt;br /&gt;    server 127.0.0.1:8003;&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;  server {&lt;br /&gt;    listen 80;&lt;br /&gt;    server_name www.domain.com;&lt;br /&gt;    location / {&lt;br /&gt;      proxy_pass http://myproject;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Fair Load Balancer&lt;/span&gt;&lt;br /&gt;Seeing this problem, a guy from Engine Yard wrote a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://nginx.localdomain.pl/wiki/UpstreamFair&quot;&gt;personal patch&lt;/a&gt; by adding a module in nginx called &lt;span style=&quot;font-weight:bold;&quot;&gt;fair load balancer&lt;/span&gt;. What it basically does it know many requests each backend is processing and it will avoid sending further requests to already busy backends. By default, fair load balancer will assign request to idle backend first, when all are busy it will use &lt;span style=&quot;font-weight:bold;&quot;&gt;weighted least-connection round-robin&lt;/span&gt; (WLC-RR) algorithm, meaning that it will assign the requests using a score that depends on both the number of requests assigned to the peer (as most important) and if all equal, to the peer that had the earliest assignment.&lt;br /&gt;Another mode is whenever the first backend is idle, it's going to get the next request. If it's busy, the request will go to the second backend unless it's busy too etc. &lt;br /&gt;&lt;br /&gt;As you can see, the backend still has its queue requests, and it will run into this scenario:&lt;br /&gt;Suppose we have 3 backends which have 3 requests in their queue, except for the first backend which has only 1 request in its queue.&lt;br /&gt;Backend process A:  [*     ]  (1 request in queue)&lt;br /&gt;Backend process B:  [***   ]  (3 requests in queue)&lt;br /&gt;Backend process C:  [***   ]  (3 requests in queue)&lt;br /&gt;Backend process D:  [***   ]  (3 requests in queue)&lt;br /&gt;&lt;br /&gt;Next, new request comes in, so backend A will have 2 requests where X is the new request.&lt;br /&gt;Backend process A:  [*X    ]  (2 request in queue)&lt;br /&gt;Backend process B:  [***   ]  (3 requests in queue)&lt;br /&gt;Backend process C:  [***   ]  (3 requests in queue)&lt;br /&gt;Backend process D:  [***   ]  (3 requests in queue)&lt;br /&gt;&lt;br /&gt;Assuming that B, C and D are still processing its queues, the next request comes in (called Y), it will be forwarded to backend A because it has the least number of request queues.&lt;br /&gt;Backend process A:  [*XY   ]  (3 requests in queue)&lt;br /&gt;Backend process B:  [***   ]  (3 requests in queue)&lt;br /&gt;Backend process C:  [***   ]  (3 requests in queue)&lt;br /&gt;Backend process D:  [***   ]  (3 requests in queue)&lt;br /&gt;&lt;br /&gt;The problem arises if Backend A needs 60 seconds to process X. Y will never be processed because it has been timeout. It would be much better if Y was forward to other Backends.&lt;br /&gt;&lt;br /&gt;Here is the configuration:&lt;br /&gt;&lt;pre&gt;upstream mongrel {&lt;br /&gt;    fair;&lt;br /&gt;    server 127.0.0.1:5000;&lt;br /&gt;    server 127.0.0.1:5001;&lt;br /&gt;    server 127.0.0.1:5002;&lt;br /&gt;  }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;HAProxy&lt;/span&gt;&lt;br /&gt;Rails was traditionally and mostly deployed using Apache or nginx  with either a built-in or standalone proxy (like &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://haproxy.1wt.eu/&quot;&gt;HAProxy&lt;/a&gt;) against a cluster of Mongrels or Unicorns.&lt;br /&gt;&lt;blockquote&gt;HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If using HAProxy, the setup is similar to this:&lt;br /&gt;&lt;br /&gt;  &lt;span style=&quot;font-weight:bold;&quot;&gt;Web &lt;/span&gt;=&amp;gt; &lt;span style=&quot;font-weight:bold;&quot;&gt;Nginx &lt;/span&gt;=&amp;gt; &lt;span style=&quot;font-weight:bold;&quot;&gt;HAProxy &lt;/span&gt;=&amp;gt; &lt;span style=&quot;font-weight:bold;&quot;&gt;Mongrel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this setup nginx just proxies to a single haproxy instance and haproxy has all registered mongrels configured. HAProxy queue is much more stable and it better balances all the requests between backends than nginx does. HAProxy has better support for upstream ok/fail detection and can also limit each app server to 1 connection (maxconn directive) which is key for mongrel. HAProxy limits the number of requests sent to mongrel instead of blindly forward requests. The fact that mongrel has only 1 request to process makes the application more scalable since the previous problem never happens. If there is one heavy request, processing that request won't affect on other requests since HAProxy only forwards request to the idle mongrel.&lt;br /&gt;&lt;br /&gt;One downside of using this is that it brings any additional latencies.&lt;br /&gt;Another thing is that it's more complicated to setup and administrate than using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.modrails.com/&quot;&gt;Phusion Passenger&lt;/a&gt; a.k.a. modrails or modrack.&lt;br /&gt;&lt;br /&gt;Just to take the advantage of the &lt;span style=&quot;font-weight:bold;&quot;&gt;maxconn&lt;/span&gt; directive, try &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/ry/nginx-ey-balancer&quot;&gt;nginx-ey-balancer&lt;/a&gt;. One thing to keep in mind is that the maxconn is per nginx worker.&lt;br /&gt;&lt;pre&gt;upstream mongrels {&lt;br /&gt;    server 127.0.0.1:8001;&lt;br /&gt;    server 127.0.0.1:8002;&lt;br /&gt;    max_connections 1;&lt;br /&gt;  }&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Phusion Passenger&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;Phusion Passenger is an Nginx module, which makes deploying Ruby and Ruby on Rails applications on Nginx a breeze.&lt;/blockquote&gt;&lt;br /&gt;It's a great tool for me to deploy rails and rack-based ruby applications. Passenger has both nginx and apache module. Passenger comes with feature called &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.modrails.com/documentation/Users%20guide%20Nginx.html#PassengerUseGlobalQueue&quot;&gt;global queuing&lt;/a&gt;, which works similar to what I mentioned above.&lt;br /&gt;&lt;br /&gt;The good thing about passenger, it's easier to configure than HAProxy. It has a couple of strategies to load rails application (smart, smart-lv2, conservative). It can even reduce memory to 33% if using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.rubyenterpriseedition.com/&quot;&gt;Ruby Enterprise Edition&lt;/a&gt;. The installation process is to install passenger gem, which is quite up-to-date and support ruby 1.9.&lt;br /&gt;&lt;br /&gt;I won't dig into detail about passenger, you might go through the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.modrails.com/documentation.html&quot;&gt;documentation &lt;/a&gt;by yourself.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-6963897337485578850?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/pel3tvwIEP0&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-6963897337485578850</guid>
         <pubDate>Mon, 30 Aug 2010 03:26:00 +0000</pubDate>
      </item>
      <item>
         <title>Ruby Object Model</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/Pcmn3iRfTZc/ruby-object-model.html</link>
         <description>I conduct a training on Ruby Object Model this week. I start talking about Ruby from scratch then the object model of Ruby. At the same time, I discussed about JavaScript object model.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;&quot; id=&quot;__ss_4978263&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/ruby-object-model-4978263&quot; title=&quot;Ruby object model&quot;&gt;Ruby object model&lt;/a&gt;&lt;/strong&gt;&lt;embed name=&quot;__sse4978263&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rubyobjectmodel-100816032824-phpapp01&amp;stripped_title=ruby-object-model-4978263&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;padding:5px 0 12px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;cchamnap&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-2503661580222697536?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/Pcmn3iRfTZc&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-2503661580222697536</guid>
         <pubDate>Tue, 17 Aug 2010 03:13:00 +0000</pubDate>
         <enclosure length="116031" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=rubyobjectmodel-100816032824-phpapp01&amp;stripped_title=ruby-object-model-4978263"/>
      </item>
      <item>
         <title>Cross-Domain Solutions</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/5P9_Y3S0uR8/cross-domain-solutions.html</link>
         <description>Recently, I found a presentation on how to solve cross domain issues. I think it's quite useful for web developers.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;&quot; id=&quot;__ss_1636202&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/mehmetakin/ajax-world&quot; title=&quot;Solving Cross-Domain Issues When Building Mashups&quot;&gt;Solving Cross-Domain Issues When Building Mashups&lt;/a&gt;&lt;/strong&gt;&lt;embed name=&quot;__sse1636202&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ajaxworld-090624204735-phpapp01&amp;stripped_title=ajax-world&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;padding:5px 0 12px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/mehmetakin&quot;&gt;mehmetakin&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-8469432277758439455?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/5P9_Y3S0uR8&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-8469432277758439455</guid>
         <pubDate>Sat, 31 Jul 2010 01:50:00 +0000</pubDate>
         <enclosure length="113298" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ajaxworld-090624204735-phpapp01&amp;stripped_title=ajax-world"/>
      </item>
      <item>
         <title>Khmer Collation support in SQL Server 2008</title>
         <link>http://chornsokun.wordpress.com/2010/07/28/khmer-collation-support-in-sql-server-2008/</link>
         <description>SQL Server &amp;#8217;08 using default collation as &amp;#8220;SQL_Latin1_General_CP1_CI_AS&amp;#8221; which most/all of us knew that We can store Khmer Unicode (with NVARCHAR, NText etc) Searching Khmer Unicode ? suck ! There are work around if you really want to search content in Khmer Unicode after you stored it; using SQL Server &amp;#8217;08 default collation. How? Method [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=615&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=615</guid>
         <pubDate>Wed, 28 Jul 2010 03:48:04 +0000</pubDate>
         <content:encoded><![CDATA[<p>SQL Server &#8217;08 using default collation as &#8220;SQL_Latin1_General_CP1_CI_AS&#8221; which most/all of us knew that</p>
<ul>
<li>We can store Khmer Unicode (with NVARCHAR, NText etc)</li>
<li>Searching Khmer Unicode ? suck !</li>
</ul>
<p>There are work around if you really want to search content in Khmer Unicode after you stored it; using SQL Server &#8217;08 default collation. How?</p>
<blockquote><p>Method #1: Try to break each word using hidden space</p>
<p>Method #2: Encoding incoming Khmer Unicode content and stored it as ASCI</p></blockquote>
<p>It works but it hurt; there is an althernative SQL Server &#8217;08 introduce a few additional collation algorithm among those &#8220;Khmer_100&#8243; is one of them.</p>
<div id="attachment_616" class="wp-caption aligncenter" style="width:371px;"><a rel="nofollow" target="_blank" href="http://chornsokun.files.wordpress.com/2010/07/collation_khmer_100.png"><img class="size-full wp-image-616" title="collation_Khmer_100" src="http://chornsokun.files.wordpress.com/2010/07/collation_khmer_100.png?w=700" alt=""/></a><p class="wp-caption-text">Khmer Collation in SQL Server 2008</p></div>
<p>That awesome all you have to do is changing your column collation from &lt;default collation&gt; to &#8220;Windows Collation -&gt; Khmer_100&#8243; that&#8217;s it no code isn&#8217;t that cool ?</p>
<p>No it&#8217;s not cool, It only works if SQL Server install on Windows Vista or Higher.</p>
<p><strong>Edit</strong>: actually we can also use this</p>
<p><a rel="nofollow" target="_blank" href="http://chornsokun.files.wordpress.com/2010/07/latin1_general_bin.png"><img class="alignnone size-full wp-image-690" title="Latin1_General_BIN" src="http://chornsokun.files.wordpress.com/2010/07/latin1_general_bin.png?w=700" alt=""/></a></p>
<br /> Tagged: <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/khmer-collation/'>Khmer Collation</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/sql-server-2008/'>SQL Server 2008</a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/615/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/615/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/615/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/615/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/615/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/615/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/615/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/615/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=615&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
         <media:content medium="image" url="http://chornsokun.files.wordpress.com/2010/07/collation_khmer_100.png">
            <media:title type="html">collation_Khmer_100</media:title>
         </media:content>
         <media:content medium="image" url="http://chornsokun.files.wordpress.com/2010/07/latin1_general_bin.png">
            <media:title type="html">Latin1_General_BIN</media:title>
         </media:content>
      </item>
      <item>
         <title>Mocking ASP.NET MVC 2 Context &amp; Session using RhinoMock</title>
         <link>http://chornsokun.wordpress.com/2010/07/26/mocking-asp-net-mvc-context-sessionstatebase-using-rhinomock/</link>
         <description>Watching video record from #mvcconf about &amp;#8220;Making ASP.NET Apps Testable&amp;#8221; by Eric B. Sowell. He showing how to test ASP.NET MVC Session make me wonder how difficult it is for RhinoMock so I load sample app and here how I test it. Since and the action: So, what you think? it just fine to love [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;amp;blog=3780464&amp;amp;post=609&amp;amp;subd=chornsokun&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chornsokun.wordpress.com/?p=609</guid>
         <pubDate>Mon, 26 Jul 2010 03:45:38 +0000</pubDate>
         <content:encoded><![CDATA[<p>Watching video record from #mvcconf about &#8220;<strong>Making ASP.NET Apps Testable</strong>&#8221; by <strong>Eric B. Sowell.</strong> He showing how to test ASP.NET MVC Session make me wonder how difficult it is for RhinoMock so I load sample app and here how I test it. Since</p>
<p><pre>
[Test]
public void TestSession()
{
   // Arrange
   // HttpContextBase, HttpSessionStateBase are abstract classes
   // I can ask RhinoMock to generate stubs for those classes
   var httpContext = MockRepository.GenerateStub&lt;HttpContextBase&gt;();
   var session = MockRepository.GenerateStub&lt;HttpSessionStateBase&gt;();

   session[&quot;Name&quot;] = &quot;Sokun&quot;;
   httpContext.Stub(c =&gt; c.Session)
      .Return(session);

   // act
   controller.ControllerContext = new ControllerContext(httpContext, new RouteData(), controller);
   var result = controller.TestSession() as ViewResult;

   // assert
   Assert.IsNotNull(result);
}
</pre></p>
<p>and the action:</p>
<p><pre>
public ActionResult TestSession()
{
   ViewData[&quot;Name&quot;] = Session[&quot;Name&quot;];
   return View();
}
</pre></p>
<p>So, what you think? it just fine to love ASP.NET MVC 2</p>
<br /> Tagged: <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/asp-net-mvc-2/'>ASP.NET MVC 2</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/rhinomock/'>RhinoMock</a>, <a rel="nofollow" target="_blank" href='http://chornsokun.wordpress.com/tag/tdd/'>TDD</a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/609/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/609/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chornsokun.wordpress.com/609/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chornsokun.wordpress.com/609/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/609/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/609/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/609/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/609/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&amp;blog=3780464&amp;post=609&amp;subd=chornsokun&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&amp;amp;d=&amp;amp;r=G">
            <media:title type="html">c.sokun</media:title>
         </media:content>
      </item>
      <item>
         <title>REST and RAILS</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/a_HFZmnv5Vw/rest-and-rails.html</link>
         <description>I made a presentation to InStedd guys recently on REST. This slide cover most parts related to REST and RAILS. Hope it could help.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;&quot; id=&quot;__ss_4758443&quot;&gt;&lt;strong style=&quot;display:block;margin:12px 0 4px;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/rest-web-services-in-rails&quot; title=&quot;Rest and Rails&quot;&gt;Rest and Rails&lt;/a&gt;&lt;/strong&gt;&lt;embed name=&quot;__sse4758443&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=restwebservicesinrails-100715000911-phpapp01&amp;stripped_title=rest-web-services-in-rails&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;padding:5px 0 12px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;cchamnap&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-8799523426899345039?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/a_HFZmnv5Vw&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-8799523426899345039</guid>
         <pubDate>Fri, 16 Jul 2010 03:46:00 +0000</pubDate>
         <enclosure length="118650" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=restwebservicesinrails-100715000911-phpapp01&amp;stripped_title=rest-web-services-in-rails"/>
      </item>
      <item>
         <title>ruby alias_method for class methods</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/PX1yMdjUoTI/ruby-aliasmethod-for-class-methods.html</link>
         <description>Generally, a ruby programmer could alias instance methods of a ruby object, but how could he alias class methods instead? The answer is he needs to understand how &quot;self&quot; works in ruby. If not yet knows, check out my &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/ruby-object-model-4978263&quot;&gt;presentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;ruby&quot;&gt;&lt;br /&gt;class Foo&lt;br /&gt;  def a; 'a'; end&lt;br /&gt;  alias_method :alias_for_a, :a&lt;br /&gt;&lt;br /&gt;  def self.b; 'b'; end&lt;br /&gt;  class &amp;lt;&amp;lt;self&lt;br /&gt;    alias_method :alias_for_b, :b&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;puts Foo.new.a&lt;br /&gt;puts Foo.new.alias_for_a&lt;br /&gt;&lt;br /&gt;puts Foo.b&lt;br /&gt;puts Foo.alias_for_b&lt;br /&gt;&lt;/pre&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-5301529849123717727?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/PX1yMdjUoTI&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-5301529849123717727</guid>
         <pubDate>Mon, 31 May 2010 07:01:00 +0000</pubDate>
      </item>
      <item>
         <title>Re-Activate the group</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/06ab0de4c97e8e6a/570966476bd2a7b9?show_docid=570966476bd2a7b9</link>
         <author>c.sokun</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/06ab0de4c97e8e6a/570966476bd2a7b9?show_docid=570966476bd2a7b9</guid>
         <pubDate>Sun, 23 May 2010 11:39:27 +0000</pubDate>
      </item>
      <item>
         <title>Meta-programming in Ruby and JavaScript</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/0MXP-NLE_ng/meta-programming-in-ruby-and-javascript.html</link>
         <description>Recently, I have been working with writing a ruby gem, Yoolk API Gem. What is really interesting for me is I do some meta programming and object-oriented programming in Ruby which I have never experienced before. A few month later, there is a requirement that my team needs to write in JavaScript, but I don't want to touch JavaScript really much. Therefore, my team member took over this task. Whenever I write code in Ruby, I just try to think how to do it in JavaScript as well. Several things that came up to my mind with some from my team member:&lt;br /&gt;&lt;br /&gt;1. Defer class from a variable.&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;// JavaScript&lt;br /&gt;var klass = &quot;Person&quot;;&lt;br /&gt;p = new window[klass]; //class without namespace&lt;br /&gt;p = new yoolk[klass]; //class with namespace&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class=&quot;ruby&quot;&gt;&lt;br /&gt;# Ruby&lt;br /&gt;klass = &quot;Person&quot;&lt;br /&gt;p = Object.const_get(klass).new #class without namespace&lt;br /&gt;p = Yoolk.const_get(klass).new #class with namespace&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2. Access class method from instance object&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;// JavaScript&lt;br /&gt;var p = new Person();&lt;br /&gt;p.constructor.getCount();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class=&quot;ruby&quot;&gt;&lt;br /&gt;#Ruby&lt;br /&gt;p = Person.new&lt;br /&gt;p.class.count&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. Define method of an object&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;//JavaScript&lt;br /&gt;var p = new Person();&lt;br /&gt;p.hello = function() {&lt;br /&gt;  alert('hello');&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class=&quot;ruby&quot;&gt;&lt;br /&gt;//Ruby&lt;br /&gt;p = Person.new&lt;br /&gt;def p.hello&lt;br /&gt;  puts &quot;hello&quot;&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;4. Define class methods&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;//JavaScript&lt;br /&gt;Person.hello = function() {&lt;br /&gt;  alert('hello');&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class=&quot;ruby&quot;&gt;&lt;br /&gt;//Ruby&lt;br /&gt;def Person.hello&lt;br /&gt;  puts &quot;hello&quot;&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-4129043679609270801?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/0MXP-NLE_ng&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-4129043679609270801</guid>
         <pubDate>Fri, 19 Feb 2010 10:50:00 +0000</pubDate>
      </item>
      <item>
         <title>Script Console Tricks</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/bqcq5RV8aPE/script-console-tricks.html</link>
         <description>Script console in rails helps me very much to debug my applications. However, I usually encounter an annoying problem with ActiveRecord. I want to see the generated SQL that has been executed. I never have enough time to figure out this until last week. Just add the following code to your environment.rb, you could see the generated SQL statement.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;if &quot;irb&quot; == $0&lt;br /&gt;  ActiveRecord::Base.logger = Logger.new(STDOUT)  # ActiveRecord&lt;br /&gt;  ActiveResource::Base.logger = Logger.new(STDOUT)  # ActiveResource&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For more information:&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://weblog.jamisbuck.org/2007/1/31/more-on-watching-activerecord&quot;&gt;http://weblog.jamisbuck.org/2007/1/31/more-on-watching-activerecord&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://railscasts.com/episodes/48-console-tricks&quot;&gt;http://railscasts.com/episodes/48-console-tricks&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-4360924167161407139?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/bqcq5RV8aPE&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-4360924167161407139</guid>
         <pubDate>Wed, 14 Oct 2009 07:16:00 +0000</pubDate>
      </item>
      <item>
         <title>My Presentation at Barcamp Phnom Penh 2009</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/_5pkPuLAdIY/my-presentation-at-barcamp-phnom-penh.html</link>
         <description>I did two presentations at Barcampp in last week. One is for people who starts learning about the web. I talked on many basic concepts, the history, and how the web works. Some of friends complained me that my slide is too much. Anyway, I think I missed several main points. I just feel it is a prime concept of the web, and it drives me really well since I started learning it. The other is about JavaScript in OOP way. It is the same topic but very compact as I used to do presentation in my office. I did fairly good with borey since some of the audiences interest my presentation.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;text-align:left;&quot; id=&quot;__ss_2046225&quot;&gt;&lt;a rel=&quot;nofollow&quot; style=&quot;font:14px Helvetica, Arial, Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/introduction-to-web-architecture&quot; title=&quot;Introduction to Web Architecture&quot;&gt;Introduction to Web Architecture&lt;/a&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=introductiontowebarchitecture-090922221506-phpapp01&amp;stripped_title=introduction-to-web-architecture&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma, arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;cchamnap&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-419767841573897220?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/_5pkPuLAdIY&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-419767841573897220</guid>
         <pubDate>Thu, 08 Oct 2009 04:26:00 +0000</pubDate>
         <enclosure length="121655" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=introductiontowebarchitecture-090922221506-phpapp01&amp;stripped_title=introduction-to-web-architecture"/>
      </item>
      <item>
         <title>Sacla Function Literal</title>
         <link>http://sareuon.blogspot.com/2009/09/sacla-function-literal.html</link>
         <description>Scala is programming language for who have skill with java and ruby. With Scala you write small script to build larges system. Scala support full Functional Programming and pure OOP.&lt;br /&gt;Scala you can write down functions as unnamed literals and then pass them around as values(runtime).&lt;br /&gt;&lt;br /&gt;(x: Int, y: Int) =&amp;gt; x + y&lt;br /&gt;&lt;br /&gt;The =&amp;gt; designates that this function converts the thing on the left (any integer x,y) to the thing on the right (x + y).&lt;br /&gt;&lt;br /&gt;List(1,2,3).filter(x =&amp;gt; x % 2 == 1)&lt;input id=&quot;gwProxy&quot; type=&quot;hidden&quot;&gt;&lt;input id=&quot;jsProxy&quot; type=&quot;hidden&quot;&gt;&lt;div id=&quot;refHTML&quot;&gt;&lt;/div&gt;&lt;input id=&quot;gwProxy&quot; type=&quot;hidden&quot;&gt;&lt;input id=&quot;jsProxy&quot; type=&quot;hidden&quot;&gt;&lt;div id=&quot;refHTML&quot;&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-20485044689730562?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-20485044689730562</guid>
         <pubDate>Wed, 09 Sep 2009 01:18:00 +0000</pubDate>
      </item>
      <item>
         <title>Principles in Refactoring</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/dNH6usJBVPo/principles-in-refactoring.html</link>
         <description>This week, in my office we did a study group, and vorleak and I were moderators in that session. We studied the book from Refactoring the Existing Code by Martin Fowler. Here is the slide I prepared.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;text-align:left;&quot; id=&quot;__ss_1961578&quot;&gt;&lt;a rel=&quot;nofollow&quot; style=&quot;font:14px Helvetica, Arial, Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/principles-in-refactoring&quot; title=&quot;Principles in Refactoring&quot;&gt;Principles in Refactoring&lt;/a&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=principlesinrefactoring-090906230021-phpapp01&amp;stripped_title=principles-in-refactoring&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma, arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;cchamnap&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-7037022000664296624?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/dNH6usJBVPo&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-7037022000664296624</guid>
         <pubDate>Sat, 05 Sep 2009 04:33:00 +0000</pubDate>
         <enclosure length="121655" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=principlesinrefactoring-090906230021-phpapp01&amp;stripped_title=principles-in-refactoring"/>
      </item>
      <item>
         <title>Action Caching</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/D6PVrxPAB2k/action-caching.html</link>
         <description>Recently, I have been working with RESTful web services. I came to a caching stage where I need to cache some requests that map to my actions. The problem is that I have actions with multiple possible routes, therefore those routes should be cached differently. For example:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;/people/1?display=details&lt;br /&gt;/people/1?display=summary&lt;br /&gt;/people/1?display=details&amp;format=xml&lt;br /&gt;/people/1?display=summary&amp;format=json&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fortunately, there is an option inside caches_action called :cache_path. All you need to do is to pass a proc object and return the path you want to cache. It is called with the current controller instance. In this case,&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;  caches_action :index, :show, :cache_path =&amp;gt; Proc.new { |c|&lt;br /&gt;    request_url = { :controller =&amp;gt; c.params[:controller], :action =&amp;gt; c.params[:action] }.merge(c.request.query_parameters)&lt;br /&gt;    c.url_for request_url&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There is another problem when the request is coming without format, the cache returns the result with content-type: text/html. To solve this, add a before_filter inside application controller to assign the headers['Content-type'].&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;  def set_default_response_format&lt;br /&gt;    response.headers['Content-type'] = 'application/xml; charset=utf-8' if params[:format].nil?&lt;br /&gt;  end&lt;br /&gt;&lt;/pre&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-5801985646602093655?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/D6PVrxPAB2k&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-5801985646602093655</guid>
         <pubDate>Sat, 29 Aug 2009 08:29:00 +0000</pubDate>
      </item>
      <item>
         <title>MVC</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/us9PXi00334/this-is-what-it-means-to-have.html</link>
         <description>Many Rails newcomers, even some people who know MVC quite well, often confuse how to code in the right way. The controller are usually fat, and the logic spreads across the whole application. The views still messy because it contains logic and even worse people often code like a controller (query to db). However, the model are usually skinny. I could say there is no restrictions in the way you code. It is a set of disciplines that every developers must know in order to have a cheaper maintenance.&lt;br /&gt;&lt;br /&gt;MVC has been successful for many reasons, and some of those reasons are “readability”, “maintainability”, “modularity”, and “separation of concerns”. You’d like your code to have those properties, right? The rules of thumb are:&lt;br /&gt;&lt;br /&gt;1. Controller should be skinny. This is what it means to have a controller know what to do without knowing the details of how to do it. &lt;br /&gt;2. Any complexity related to building a business logic will be specified and implemented in the Model.&lt;br /&gt;3. Inside View, access to instance variables that have been defined in Controller. Try not to use if-else condition or loop as much as possible.&lt;br /&gt;&lt;br /&gt;By putting everything in the right place, you would benefit from a lot of MVC pattern.&lt;br /&gt;&lt;br /&gt;Good example can be found on:&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers&quot;&gt;http://www.therailsway.com/2007/6/1/railsconf-recap-skinny-controllers&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model&quot;&gt;http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-1543620890150642532?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/us9PXi00334&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-1543620890150642532</guid>
         <pubDate>Sat, 22 Aug 2009 02:30:00 +0000</pubDate>
      </item>
      <item>
         <title>Announcing BarCamp Phnom Penh 2009</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/d4c3b190151d05d6/70928e0e826bb6a1?show_docid=70928e0e826bb6a1</link>
         <author>Chantra</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/d4c3b190151d05d6/70928e0e826bb6a1?show_docid=70928e0e826bb6a1</guid>
         <pubDate>Wed, 05 Aug 2009 01:01:33 +0000</pubDate>
      </item>
      <item>
         <title>Sending mail to developer about exception errors</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/8a-xdRT120k/sending-report-developer.html</link>
         <description>I want my application to send me a mail about any errors that occurs during production. Basically, I want to see a detail report like in development environment. All I have to do is to override &lt;code&gt;rescue_action_in_public&lt;/code&gt;. This method by default calls &lt;code&gt;render_optional_error_file&lt;/code&gt; method to render a static page based on status code thrown. &lt;code&gt;rescue_action_locally&lt;/code&gt; method by default will render details diagnostics from a controller action. Therefore, I just combine all of these methods into rescue_action_in_public and add some code to send mail.&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;def rescue_action_in_public(exception)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;render_optional_error_file response_code_for_rescue(exception)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@template.instance_variable_set(&quot;@exception&quot;, exception)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@template.instance_variable_set(&quot;@rescues_path&quot;, RESCUES_TEMPLATE_PATH)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@template.instance_variable_set(&quot;@contents&quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@template.render(:file =&amp;gt; template_path_for_local_rescue(exception)))&lt;br /&gt;&lt;br /&gt;    # send mail to developers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mail = ExceptionNotifier.create_sent(@template)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mail.set_content_type(&quot;text/html&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ExceptionNotifier.deliver(mail)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is my ExceptionNotifier class, just extract needed variable to be available inside my view.&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;class ExceptionNotifier &amp;lt; ActionMailer::Base&lt;br /&gt;  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def sent(template)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@subject               = 'Bug Reports'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@body[&quot;request&quot;]       = template.request&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@body[&quot;response&quot;]      = template.response&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@body[&quot;exception&quot;]     = template.instance_variable_get(&quot;@exception&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@body[&quot;rescues_path&quot;]  = template.instance_variable_get(&quot;@rescues_path&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@recipients = ['chamnapchhorn@gmail.com', 'ungsophy@gmail.com']&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@from       = 'noreply@gmail.com'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@headers    = {}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is my view, the default view for exception. I just change to locate new variables only.&lt;br /&gt;&lt;pre class=&quot;html&quot;&gt;&lt;br /&gt;&amp;lt;h1&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;%=h @exception.class.to_s %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% if @request.parameters['controller'] %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;in &amp;lt;%=h @request.parameters['controller'].humanize %&amp;gt;Controller&amp;lt;% if @request.parameters['action'] %&amp;gt;#&amp;lt;%=h @request.parameters['action'] %&amp;gt;&amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;pre&amp;gt;&amp;lt;%=h @exception.clean_message %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%= render :file =&amp;gt; @rescues_path[&quot;rescues/_trace.erb&quot;] %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%= render :file =&amp;gt; @rescues_path[&quot;rescues/_request_and_response.erb&quot;], :locals =&amp;gt; { :request =&amp;gt; @request, :response =&amp;gt; @response } %&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-7544957222579683619?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/8a-xdRT120k&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-7544957222579683619</guid>
         <pubDate>Tue, 21 Jul 2009 10:08:00 +0000</pubDate>
      </item>
      <item>
         <title>Handling Exception at the Application Level in Rails</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/KZCvB5p8kak/handling-exception-at-application-level.html</link>
         <description>At last the point of the project, I found one more important thing that is quite useful and it could reduce the code 20%. That's when I did a handling service error on both server and client. I find myself have been repeating the code on the way. Luckily, after discussion with my colleague, I came up with idea to handle in application controller. It means that instead of handle exception on all of my controllers, I could just handle in a single place whenever exception has raised from these controllers.&lt;br /&gt;Basically, there are two methods (&lt;code&gt;rescue_action&lt;/code&gt; and &lt;code&gt;rescue_action_in_public&lt;/code&gt;) that you would need to override based on your needs. By default, these two methods do the best job to handle exception both in development and production mode. &lt;code&gt;rescue_action&lt;/code&gt; method will be called with an exception parameter that raises inside an action method. &lt;code&gt;rescue_action_in_public method&lt;/code&gt;, however, is used for public exception handling (for requests answering false to &lt;code&gt;local_request?&lt;/code&gt;). &lt;code&gt;local_request?&lt;/code&gt; method tells which rescue_*** method to call.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://api.rubyonrails.org/classes/ActionController/Rescue.html&quot;&gt;http://api.rubyonrails.org/classes/ActionController/Rescue.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;More importantly, we can handle exceptions for specific controller instead of the whole. All you need to do is to override one of these methods inside that controller.&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;class PostsController &amp;lt; ApplicationController&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def rescue_action_in_public(exception)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case(exception)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;when ActiveRecord::RecordNotFound then render :file =&amp;gt; '/bad_record'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;when NoMethodError then render :file =&amp;gt; '/no_method'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else render :file =&amp;gt; '/error'&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We can even handle them in a much cleaner way rather than if/else statement by using rescue_from. What it does is that it maps an exception type to handler method. This handler method can take either an exception parameter or a non-argument. We can even specify a proc or block.&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;class PostsController &amp;lt; ApplicationController&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Declare exception to handler methods&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;rescue_from ActiveRecord::RecordNotFound, :with =&amp;gt; :bad_record&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;rescue_from NoMethodError, :with =&amp;gt; :show_error&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def bad_record; render :file =&amp;gt; '/bad_record'; end&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def show_error(exception); render :text =&amp;gt; exception.message; end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://ryandaigle.com/articles/2007/9/24/what-s-new-in-edge-rails-better-exception-handling&quot;&gt;http://ryandaigle.com/articles/2007/9/24/what-s-new-in-edge-rails-better-exception-handling&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-2672112506476727939?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/KZCvB5p8kak&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-2672112506476727939</guid>
         <pubDate>Fri, 10 Jul 2009 09:55:00 +0000</pubDate>
      </item>
      <item>
         <title>Maintaining Javascript Pop-Up Window Communication Across Window Opener Page Loads</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/NCR2zrEr16s/maintaining-javascript-pop-up-window.html</link>
         <description>I came across a blog post that talks how to maintain a reference to javascript popup window while the parent window has been navigated away. This scenario doesn't want to reload the child popup window. I just quoted out from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.1pixelout.net/2006/12/15/cross-window-javascript-communication-20/&quot;&gt;1 Pixel Out&lt;/a&gt;. There is a really nick trick.&lt;br /&gt;&lt;br /&gt;In the main window:&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;var popupWin = null;&lt;br /&gt;&lt;br /&gt;function openPopup() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var url = &quot;popup.htm&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;popupWin = open( &quot;&quot;, &quot;popupWin&quot;, &quot;width=500,height=400&quot; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if( !popupWin || popupWin.closed || !popupWin.doSomething ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;popupWin = window.open( url, &quot;popupWin&quot;, &quot;width=500,height=400&quot; );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;popupWin.focus();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function doSomething() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;openPopup();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;popupWin.doSomething();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the popup:&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;self.focus();&lt;br /&gt;&lt;br /&gt;function doSomething() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&quot;I'm doing something&quot;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.bennadel.com/blog/89-Maintaining-Javascript-Pop-Up-Window-Communication-Across-Window-Opener-Page-Loads.htm&quot;&gt;http://www.bennadel.com/blog/89-Maintaining-Javascript-Pop-Up-Window-Communication-Across-Window-Opener-Page-Loads.htm&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.1pixelout.net/2005/04/19/cross-window-javascript-communication/&quot;&gt;http://www.1pixelout.net/2005/04/19/cross-window-javascript-communication/&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.1pixelout.net/2006/12/15/cross-window-javascript-communication-20/&quot;&gt;http://www.1pixelout.net/2006/12/15/cross-window-javascript-communication-20/&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.1pixelout.net/wp-content/downloads/popups20.zip&quot;&gt;http://www.1pixelout.net/wp-content/downloads/popups20.zip&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-3156078894202383489?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/NCR2zrEr16s&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-3156078894202383489</guid>
         <pubDate>Sat, 27 Jun 2009 11:05:00 +0000</pubDate>
         <enclosure length="1969" type="application/zip" url="http://www.1pixelout.net/wp-content/downloads/popups20.zip"/>
      </item>
      <item>
         <title>Cross-window Javascript communication</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/armXt65b69s/cross-window-javascript-communication.html</link>
         <description>It reminds me about uploading via iframe that I did a year ago when my colleague asked me to help with login openid in a popup window. It's a similar story with this problem. Actually, login with openid could not place in a iframe because you could the code that prevents this.&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;if(top == self) { document.write(&quot;&quot;); } else  { top.location.href = &quot;http://www.yahoo.com&quot;; }&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, let's see a quick summary on this basic communication.&lt;br /&gt;&lt;br /&gt;Communication from parent to child window, you need to a reference of the child window so that can call any function in the child window.&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;// Create a new popup window&lt;br /&gt;var popupWin = window.open(url, &quot;popupWin&quot;);&lt;br /&gt;&lt;br /&gt;// To call functions defined in the popup:&lt;br /&gt;popupWin.doSomething();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Communication from child to parent window, you need to use this way:&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;window.opener.doSomethingOnParent();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is the problem, the parent window needs to know when the uploading (in iframe) or logging in (in popup window) is done. The only way that the parent window can notified by the child window after finish processing. Usually, for uploading and logging in with openid, the action in your controller would render a view back. The trick is here on the onload of the body, you could notify the parent window.&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;def login&lt;br /&gt;  @status = &quot;something&quot;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;#view&lt;br /&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body onload=&quot;window.opener.handleOpenIDResponse('&quot; + @status + &quot;');window.close();&quot;&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That would solve the problem, and you could send any information back through your view.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-8426930390371482210?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/armXt65b69s&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-8426930390371482210</guid>
         <pubDate>Sat, 27 Jun 2009 07:10:00 +0000</pubDate>
      </item>
      <item>
         <title>has_and_belongs_to_many or has_many :through?</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/xviTAcPEs2c/hasandbelongstomany-or-hasmany-through.html</link>
         <description>Well, I had been quite confusing about these two topics before I read some rails books. These are just different ways to do many to many relationships in ActiveRecord.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;has_and_belongs_to_many (habtm)&lt;/b&gt;&lt;br /&gt;habtm is the very old way since rails 1.2. It creates a link between associated models through an intermediate join table.&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;class CreateProjectsProgrammers &amp;lt; ActiveRecord::Migration&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def self.up&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;create_table :projects_programmers, :id =&amp;gt; false do |t|&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;t.column :project_id, :integer, :null =&amp;gt; false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;t.column :programmer_id, :integer, :null =&amp;gt; false&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def self.down&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;drop_table :projects_programmers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;end&lt;br /&gt;class Programmer &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_and_belongs_to_many :projects       # foreign keys in the join table&lt;br /&gt;end&lt;br /&gt;class Project &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_and_belongs_to_many :programmers    # foreign keys in the join table&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that an id primary key is not needed in the join table and there is no join model, only join table. Here we will face a problem when we want to add extra columns on the join table. If it is in rails 1.2, we would have used &lt;code&gt;push_with_attributes&lt;/code&gt; to do this. However, &lt;code&gt;push_with_attributes&lt;/code&gt; has been deprecated in favor of a far more powerful technique, where regular Active Record models are used as join tables (remember that with habtm, the join table is not an Active Record object).&lt;br /&gt;&lt;br /&gt;To conclude, habtm is a simple way to do a many-to-many relationship using a join table when the join table doesn't have extra columns. You will need to upgrade the relationship to use &lt;code&gt;has_many :through&lt;/code&gt; once you need to add additional columns.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;has_many :through&lt;/b&gt;&lt;br /&gt;Records in the join table of habtm implementation has no independent existence. Later, we will find it very soon that the join table has a life of its own and should have a model when we add extra columns on that join table. Let's talk about relationship between article, user, and the join model is reading.&lt;br /&gt;&lt;br /&gt;When a user reads an article, we can record the fact.&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;class Article &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_many :readings&lt;br /&gt;end&lt;br /&gt;class User &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_many :readings&lt;br /&gt;end&lt;br /&gt;class Reading &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;belongs_to :article&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;belongs_to :user&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;reading = Reading.new&lt;br /&gt;reading.rating = params[:rating]&lt;br /&gt;reading.read_at = Time.now&lt;br /&gt;reading.article = current_article&lt;br /&gt;reading.user = session[:user]&lt;br /&gt;reading.save&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here we lost what habtm solved. We could not ask a user which articles that they has read and vice versa. To solve this, use :through options inside has_many.&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;class Article &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_many :readings&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_many :users, :through =&amp;gt; :readings&lt;br /&gt;end&lt;br /&gt;class Reading &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;belongs_to :article&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;belongs_to :user&lt;br /&gt;end&lt;br /&gt;class User &amp;lt; ActiveRecord::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_many :readings&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;has_many :articles, :through =&amp;gt; :readings&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, you could do query both direction:&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;readers = an_article.users&lt;br /&gt;articles = a_reader.articles&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Unlike a normal has_many, ActiveRecord won’t let us add an object to the the has_many :through association if both ends of the relationship are unsaved records. The create method saves the record before adding it, so it does work as expected, provided the parent object isn’t unsaved itself. To add extra attributes:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;user.readings.create(:read_at =&amp;gt; Time.now,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;:rating =&amp;gt; params[:rating],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;:article =&amp;gt; Article.new)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Choosing which way to build a many-to-many relationship is not always simple. If you need to work with the relationship model as its own entity, use has_many :through. Use has_and_belongs_to_many when working with legacy schemas or when you never work directly with the relationship itself.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blog.hasmanythrough.com/2006/4/20/many-to-many-dance-off&quot;&gt;http://blog.hasmanythrough.com/2006/4/20/many-to-many-dance-off&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://blog.hasmanythrough.com/2006/4/17/join-models-not-proxy-collections&quot;&gt;http://blog.hasmanythrough.com/2006/4/17/join-models-not-proxy-collections&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-8509927370996612874?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/xviTAcPEs2c&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-8509927370996612874</guid>
         <pubDate>Thu, 18 Jun 2009 08:46:00 +0000</pubDate>
      </item>
      <item>
         <title>Proper use of session</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/jcyT8Zbwd9A/proper-use-of-session.html</link>
         <description>Consider the following scenario, you want to store information about current user. After successful login, you might do this.&lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;user = User.authenticate(params[:user_name], params[:password])&lt;br /&gt;if user&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;session[:current_user] = user.attributes&lt;br /&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;flash[:notice] = &quot;Email and password do not match.&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;redirect_to :controller =&amp;gt; &quot;login&quot;&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Everything would work as you expected except when you try to change the structure of your session. This would make sessions of online users invalid while they are using your web application. For example, they will feel annoying while they are adding items to their wish lists. Another problem is that you want to make that session invalid after you delete that user account, for example. That won't work because you stored the entire record in his session. The only way to do is to add before_filter in application controller to check the existence of the current user. That would make another job to do it.&lt;br /&gt;&lt;br /&gt;The best practice is  store only simple data in the session: strings, numbers, and so on. Keep your application objects in the database, and then reference them using their primary keys from the session data. &lt;br /&gt;&lt;pre class=&quot;javascript&quot;&gt;&lt;br /&gt;class ApplicationController &amp;lt; ActionController::Base&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;before_filter :get_current_user&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;def get_current_user&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@current_user = User.find_by_id(session[:user_id])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here you can access @current_user everywhere in your application and solve many issues during development.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-2856585702419930140?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/jcyT8Zbwd9A&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-2856585702419930140</guid>
         <pubDate>Wed, 03 Jun 2009 01:23:00 +0000</pubDate>
      </item>
      <item>
         <title>Custom Rake Tasks</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/xZG8Z0kQ_V4/custom-rake-tasks.html</link>
         <description>I came across to write a custom rake script for my rails application. Because my application is rich client side application and doesn't use id for any of my models. Instead, it used UUID as a primary key. I got some problems while changing this, and one of them is rails rake commands such as rake &lt;code&gt;db:test:prepare, rake test:functionals&lt;/code&gt;, .... For my application, these two commands didn't work really well since it makes my test database messed with autonumber id of all tables. Here, my rake script to load to my test database. Pay attention to mysql command, in this case, I need to run several commands inside mysql command.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;rails&quot;&gt;&lt;br /&gt;  task :load_test_db do&lt;br /&gt;    #load data to development&lt;br /&gt;    Rake::Task[&quot;db:fixtures:load&quot;].invoke&lt;br /&gt;    &lt;br /&gt;    #clone development to test&lt;br /&gt;    Rake::Task[&quot;db:test:clone_structure&quot;].invoke&lt;br /&gt;    &lt;br /&gt;    #pull data from development&lt;br /&gt;    sh &quot;mysqldump &amp;gt; test.sql development_ncdd_templates -u root&quot;&lt;br /&gt;&lt;br /&gt;    sh &quot;mysql -u root &amp;lt;&amp;lt; EOF&lt;br /&gt;       use test_ncdd_templates;&lt;br /&gt;       source test.sql;&lt;br /&gt;       exit&lt;br /&gt;    EOF&quot;&lt;br /&gt;  end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you want to run bash command, take this as an example. I'm not a expert of shell script, but it works for me anyway.&lt;br /&gt;&lt;br /&gt;   sh &quot;#!/bin/bash&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cd lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ruby to_yml.rb&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cd ..&quot;&lt;br /&gt;&lt;br /&gt;Here are some excellent sources:&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial&quot;&gt;http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial&lt;/a&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://railscasts.com/episodes/66-custom-rake-tasks&quot;&gt;http://railscasts.com/episodes/66-custom-rake-tasks&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-7762041590822974093?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/xZG8Z0kQ_V4&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-7762041590822974093</guid>
         <pubDate>Thu, 14 May 2009 04:03:00 +0000</pubDate>
      </item>
      <item>
         <title>JavaScript in Object-Oriented Way</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/i9A3dShRbxU/javascript-in-object-oriented-way.html</link>
         <description>I conducted a training to some developers in my office about one full day, yesterday. It is quite exhausted anyway, but everyone seems understand really well. This slide covers many advanced features of JavaScript: Function, Object, Closure,.... Some other points I have pointed out in this slide are about how to make private variable, public variable, static variable, privileged variable and how to do inheritance. I took about 20 different sources as my references and three famous authors. It took me two weeks, at every weekend, to finish this slide.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;text-align:left;&quot; id=&quot;__ss_1426608&quot;&gt;&lt;a rel=&quot;nofollow&quot; style=&quot;font:14px Helvetica, Arial, Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/javascript-in-objectoriented-way?type=powerpoint&quot; title=&quot;JavaScript in Object-Oriented Way&quot;&gt;JavaScript in Object-Oriented Way&lt;/a&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=javascriptinobject-orientedway-090512225827-phpapp02&amp;stripped_title=javascript-in-objectoriented-way&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma, arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;cchamnap&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-4515566835543181045?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/i9A3dShRbxU&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-4515566835543181045</guid>
         <pubDate>Wed, 13 May 2009 03:59:00 +0000</pubDate>
         <enclosure length="121655" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=javascriptinobject-orientedway-090512225827-phpapp02&amp;stripped_title=javascript-in-objectoriented-way"/>
      </item>
      <item>
         <title>JavaScript Mixins</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/8DSAEbZeL1k/javascript-mixins.html</link>
         <description>I have just reviewed JavaScript Design Patterns, and I think it is good to mention this.&lt;br /&gt;&lt;br /&gt;It is possible to do a mixin class in JavaScript as in Ruby. This is another way to make our code reuse without inheritance. Consider you have a function, and you wish to use in many classes. In practice, you create a class that contains your general-purpose methods, and then use it to augment other classes. Class with these general-purpose methods is called Mixin class. It is generally not instantiated or called directly, instead it exists to provide methods to other classes.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var Mixin = function() {};&lt;br /&gt;Mixin.prototype = {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;serialize: function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var output = [];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(key in this) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output.push(key + ': ' + this[key]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return output.join(', ');&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This sort of method could potentially be useful in many different types of classes, but it doesn’t make sense to have each of these classes inherit from Mixin. Similarly, duplicating the code in each class doesn’t make much sense either. The best approach is to use the augment function to add this method to each class that needs it:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;augment(Author, Mixin);&lt;br /&gt;&lt;br /&gt;var author = new Author('Ross Harmes', ['JavaScript Design Patterns']);&lt;br /&gt;var serializedString = author.serialize();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This can be thought of as a way to implement multiple inheritance in JavaScript.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* Augment function. */&lt;br /&gt;function augment(receivingClass, givingClass) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(methodName in givingClass.prototype) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!receivingClass.prototype[methodName]) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;receivingClass.prototype[methodName] = givingClass.prototype[methodName];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;A more robust augment allows copying one or two of them over to another class.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* Augment function, improved. */&lt;br /&gt;function augment(receivingClass, givingClass) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(arguments[2]) { // Only give certain methods.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(var i = 2, len = arguments.length; i &amp;lt; len; i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;receivingClass.prototype[arguments[i]] = givingClass.prototype[arguments[i]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else { // Give all methods.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(methodName in givingClass.prototype) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(!receivingClass.prototype[methodName]) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;receivingClass.prototype[methodName] = givingClass.prototype[methodName];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can now write augment(Author, Mixin, 'serialize'); to only augment Author with the single serialize method.&lt;br /&gt;&lt;br /&gt;In other times, you don't have to need this augment function in order to do Mixins. You could do this by using apply or call method inside constructor function.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var Author = function(name, books) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.name = name || &quot;&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.books = books || [];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mixin.apply(this);&lt;br /&gt;};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Often it makes more sense to augment a class with a few methods than it does to make&lt;br /&gt;one class inherit from another. This is a lightweight way to prevent code duplication. Unfortunately, there aren’t many situations where it can be used. Only methods general enough to be used in very dissimilar classes make good candidates for sharing (if the classes aren’t that dissimilar, normal inheritance is often a better choice).&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-5429879078678621629?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/8DSAEbZeL1k&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-5429879078678621629</guid>
         <pubDate>Thu, 07 May 2009 04:41:00 +0000</pubDate>
      </item>
      <item>
         <title>Prototypal Inheritance vs. Classical Inheritance</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/4OrxwJxVsKE/prototypal-inheritance-vs-classical.html</link>
         <description>While it is possible to emulate classical inheritance like Java or C#, it is clear that we do prototypal inheritance by taking advantages of prototype lookup chains. Each has its own advantages and disadvantages. Here I quoted from JavaScript Design Patterns:&lt;br /&gt;&lt;br /&gt;The classical approach to creating an object is to (a) define the structure of the object, using&lt;br /&gt;a class declaration, and (b) instantiate that class to create a new object. Objects created in this&lt;br /&gt;manner have their own copies of all instance attributes, plus a link to the single copy of each&lt;br /&gt;of the instance methods.&lt;br /&gt;&lt;br /&gt;In prototypal inheritance, instead of defining the structure through a class, you simply&lt;br /&gt;create an object. This object then gets reused by new objects, thanks to the way that prototype&lt;br /&gt;chain lookups work. It is called the &lt;span style=&quot;font-style:italic;&quot;&gt;prototype object&lt;/span&gt; because it provides a prototype for what the other objects should look like.&lt;br /&gt;&lt;br /&gt;Instead of using a constructor function named Person to define the class structure, Person&lt;br /&gt;is now an object literal. It is the prototype object for any other Person-like objects that you want to create. Define all attributes and methods you want these objects to have, and give them&lt;br /&gt;default values. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* Person Prototype Object. */&lt;br /&gt;var Person = {&lt;br /&gt;   name: 'default name',&lt;br /&gt;   getName: function() {&lt;br /&gt;     return this.name;&lt;br /&gt;   }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;var reader = clone(Person);&lt;br /&gt;alert(reader.getName()); // This will output 'default name'.&lt;br /&gt;reader.name = 'John Smith';&lt;br /&gt;alert(reader.getName()); // This will now output 'John Smith'.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To create a new Person-like object, use the clone function. This provides an empty object with&lt;br /&gt;the prototype attribute set to the prototype object. This means that if any method or attribute&lt;br /&gt;lookup on this object fails, that lookup will instead look to the prototype object.&lt;br /&gt;To create Author, you make a clone.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* Author Prototype Object. */&lt;br /&gt;var Author = clone(Person);&lt;br /&gt;Author.books = []; // Default value.&lt;br /&gt;Author.getBooks = function() {&lt;br /&gt;  return this.books;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var author0 = clone(Author);&lt;br /&gt;author0.name = 'Dustin Diaz';&lt;br /&gt;author0.books = ['JavaScript Design Patterns'];&lt;br /&gt;var author1 = clone(Author);&lt;br /&gt;author1.name = 'Ross Harmes';&lt;br /&gt;author1.books = ['JavaScript Design Patterns'];&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Here is the clone function. First the clone function creates a new and empty function, F. It then sets the prototype attribute of F to the prototype object. Lastly, the function creates a new object by calling the new operator on F. The cloned object that is returned is completely empty, except for the prototype attribute, which is (indirectly) pointing to the prototype object, by way of the F object.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;/* Clone function. */&lt;br /&gt;function clone(object) {&lt;br /&gt;    function F() {}&lt;br /&gt;    F.prototype = object;&lt;br /&gt;    return new F;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In classical inheritance, each instance of Author has its own copy of the books array. You could add to it by writing author1.books.push('New Book Title'). That is not initially possible with the object you created using prototypal inheritance because of the way prototype chaining works. A clone is not a fully independent copy of its prototype object; it is a new empty object with its prototype attribute set to the prototype object. When it is just created, author1.name is actually a link back to the primitive Person.name. When you write to author1.name, you are defining a new attribute directly on the author1 object.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var authorClone = clone(Author);&lt;br /&gt;alert(authorClone.name); // Linked to the primative Person.name, which is the&lt;br /&gt;                         // string 'default name'.&lt;br /&gt;authorClone.name = 'new name'; // A new primative is created and added to the&lt;br /&gt;                               // authorClone object itself.&lt;br /&gt;alert(authorClone.name); // Now linked to the primative authorClone.name, which&lt;br /&gt;                         // is the string 'new name'.&lt;br /&gt;authorClone.books.push('new book'); // authorClone.books is linked to the array&lt;br /&gt;                                    // Author.books. We just modified the&lt;br /&gt;                                    // prototype object's default value, and all&lt;br /&gt;                                    // other objects that link to it will now&lt;br /&gt;                                    // have a new default value there.&lt;br /&gt;authorClone.books = []; // A new array is created and added to the authorClone&lt;br /&gt;                        // object itself.&lt;br /&gt;authorClone.books.push('new book'); // We are now modifying that new array.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Classical inheritance is well understood, both in JavaScript and the programmer commu-&lt;br /&gt;nity in general. Almost all object-oriented code written in JavaScript uses this paradigm. If you&lt;br /&gt;are creating an API for widespread use, or if there is the possibility that other programmers not&lt;br /&gt;familiar with prototypal inheritance will be working on your code, it is best to go with classical.&lt;br /&gt;&lt;br /&gt;JavaScript is the only popular, widely used language that uses prototypal inheritance, so odds&lt;br /&gt;are most people will never have used it before. It can also be confusing to have an object with&lt;br /&gt;links back to its prototype object. Programmers who don’t fully understand prototypal inheri-&lt;br /&gt;tance will think of this as some sort of reverse inheritance, where the parent inherits from its&lt;br /&gt;children. Even though this isn’t the case, it can still be a very confusing topic. But since this&lt;br /&gt;form of classical inheritance is only imitating true class-based inheritance, advanced JavaScript&lt;br /&gt;programmers need to understand how prototypal inheritance truly works at some point any-&lt;br /&gt;way. Some would argue that hiding this fact does more harm than good.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-8560760159261924?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/4OrxwJxVsKE&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-8560760159261924</guid>
         <pubDate>Thu, 07 May 2009 04:40:00 +0000</pubDate>
      </item>
      <item>
         <title>ActiveRecord::Dirty</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/EzShHrQeQ3k/activerecorddirty.html</link>
         <description>Another powerful feature of ActiveRecord is dirty objects. This module tracks unsaved attribute changes. This feature is available probably since &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://ryandaigle.com/articles/2008/3/31/what-s-new-in-edge-rails-dirty-objects&quot;&gt;March, 2008&lt;/a&gt;. See examples below:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;A newly instantiated object is unchanged:&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  person = Person.find_by_name('uncle bob')&lt;br /&gt;  person.changed?       # =&amp;gt; false&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;b&gt;Change the name:&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  person.name = 'Bob'&lt;br /&gt;  person.changed?       # =&amp;gt; true&lt;br /&gt;  person.name_changed?  # =&amp;gt; true&lt;br /&gt;  person.name_was       # =&amp;gt; 'uncle bob'&lt;br /&gt;  person.name_change    # =&amp;gt; ['uncle bob', 'Bob']&lt;br /&gt;  person.name = 'Bill'&lt;br /&gt;  person.name_change    # =&amp;gt; ['uncle bob', 'Bill']&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;b&gt;Save the changes:&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  person.save&lt;br /&gt;  person.changed?       # =&amp;gt; false&lt;br /&gt;  person.name_changed?  # =&amp;gt; false&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;b&gt;Assigning the same value leaves the attribute unchanged:&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  person.name = 'Bill'&lt;br /&gt;  person.name_changed?  # =&amp;gt; false&lt;br /&gt;  person.name_change    # =&amp;gt; nil&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;b&gt;Which attributes have changed?&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  person.name = 'bob'&lt;br /&gt;  person.changed        # =&amp;gt; ['name']&lt;br /&gt;  person.changes        # =&amp;gt; { 'name' =&amp;gt; ['Bill', 'bob'] }&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;b&gt;Before modifying an attribute in-place:&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  person.name_will_change!&lt;br /&gt;  person.name &amp;lt;&amp;lt; 'by'&lt;br /&gt;  person.name_change    # =&amp;gt; ['uncle bob', 'uncle bobby']&lt;br /&gt;&lt;/code&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-3190805459986718748?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/EzShHrQeQ3k&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-3190805459986718748</guid>
         <pubDate>Wed, 29 Apr 2009 01:33:00 +0000</pubDate>
      </item>
      <item>
         <title>My Restful Rails Presentation</title>
         <link>http://feedproxy.google.com/~r/blogspot/chamnap/~3/OKLkFZ1IJh8/my-restful-rails-presentation.html</link>
         <description>Last month, I did a presentation to my team about Restful Rails. I just uploaded to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/rest-in-rails&quot;&gt;http://www.slideshare.net/cchamnap/rest-in-rails&lt;/a&gt;. It might be useful for newbie rails developer.&lt;br /&gt;&lt;div style=&quot;width:425px;text-align:left;&quot; id=&quot;__ss_1355315&quot;&gt;&lt;a rel=&quot;nofollow&quot; style=&quot;font:14px Helvetica, Arial, Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap/rest-in-rails?type=powerpoint&quot; title=&quot;Rest in Rails&quot;&gt;Rest in Rails&lt;/a&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=restinrails-090428004646-phpapp01&amp;stripped_title=rest-in-rails&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma, arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a rel=&quot;nofollow&quot; style=&quot;text-decoration:underline;&quot; target=&quot;_blank&quot; href=&quot;http://www.slideshare.net/cchamnap&quot;&gt;cchamnap&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6761142148052793737-5671066014858289713?l=chamnapchhorn.blogspot.com' alt=''/&gt;&lt;/div&gt;&lt;img src=&quot;http://feeds.feedburner.com/~r/blogspot/chamnap/~4/OKLkFZ1IJh8&quot; height=&quot;1&quot; width=&quot;1&quot;/&gt;</description>
         <author>noreply@blogger.com (chamnap)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6761142148052793737.post-5671066014858289713</guid>
         <pubDate>Tue, 28 Apr 2009 05:53:00 +0000</pubDate>
         <enclosure length="121655" type="application/x-shockwave-flash" url="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=restinrails-090428004646-phpapp01&amp;stripped_title=rest-in-rails"/>
      </item>
      <item>
         <title>Transparency PNG file in IE</title>
         <link>http://vuthysan.blogspot.com/2009/02/transparency-png-file-in-ie.html</link>
         <description>The ability of this script is help you to show PNP files transparency in IE.It's will effect all ur &amp;lt;img class=&quot;whatever&quot;&amp;gt; tag in the page that u added this script.But to make sure that img u have to create class whatever it's name.
&lt;br /&gt;
&lt;br /&gt;// CONFIGURATION
&lt;br /&gt;// png_overlay is the png 'frame' that will be loaded over the images with a class      name of &quot;frame&quot;
&lt;br /&gt;// suffix is the identifier for the rollover image; image.jpg -&amp;gt; image_suffix.jpg
&lt;br /&gt;//
&lt;br /&gt;//	var png_overlay = 'rounded_frame.png';
&lt;br /&gt;//	var suffix = '_over';
&lt;br /&gt;
&lt;br /&gt;//
&lt;br /&gt;//	addEvent()
&lt;br /&gt;//	Allows attachment of events to elements
&lt;br /&gt;//
&lt;br /&gt;function addEvent( obj, type, fn ) {
&lt;br /&gt;   if (obj.addEventListener) {
&lt;br /&gt;      obj.addEventListener( type, fn, false );
&lt;br /&gt;      EventCache.add(obj, type, fn);
&lt;br /&gt;   }
&lt;br /&gt;   else if (obj.attachEvent) {
&lt;br /&gt;      obj[&quot;e&quot;+type+fn] = fn;
&lt;br /&gt;      obj[type+fn] = function() { obj[&quot;e&quot;+type+fn]( window.event ); }
&lt;br /&gt;      obj.attachEvent( &quot;on&quot;+type, obj[type+fn] );
&lt;br /&gt;      EventCache.add(obj, type, fn);
&lt;br /&gt;   }
&lt;br /&gt;   else {
&lt;br /&gt;      obj[&quot;on&quot;+type] = obj[&quot;e&quot;+type+fn];
&lt;br /&gt;   }
&lt;br /&gt;}
&lt;br /&gt;var EventCache = function() {
&lt;br /&gt;    var listEvents = [];
&lt;br /&gt;    return {
&lt;br /&gt;	   listEvents : listEvents,
&lt;br /&gt;	   add : function(node, sEventName, fHandler) {
&lt;br /&gt;	         listEvents.push(arguments);
&lt;br /&gt;	   },
&lt;br /&gt;	   flush : function() {
&lt;br /&gt;   		 var i, item;
&lt;br /&gt;		 for(i = listEvents.length - 1; i &amp;gt;= 0; i = i - 1) {
&lt;br /&gt;  		     item = listEvents[i];
&lt;br /&gt;		     if(item[0].removeEventListener) {
&lt;br /&gt;			item[0].removeEventListener(item[1], item[2], item[3]);
&lt;br /&gt;    		     };
&lt;br /&gt;		     if(item[1].substring(0, 2) != &quot;on&quot;) {
&lt;br /&gt;			item[1] = &quot;on&quot; + item[1];
&lt;br /&gt;		     };
&lt;br /&gt;		     if(item[0].detachEvent) {
&lt;br /&gt;			item[0].detachEvent(item[1], item[2]);
&lt;br /&gt;         	     };
&lt;br /&gt;		     item[0][item[1]] = null;
&lt;br /&gt;		 };
&lt;br /&gt;	   }
&lt;br /&gt;	};
&lt;br /&gt;}();
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;addEvent(window,'unload',EventCache.flush);
&lt;br /&gt;//
&lt;br /&gt;//	correctPNG()
&lt;br /&gt;//	Allows transparent PNG images to be display correctly in IE
&lt;br /&gt;//	Not sure who wrote it, but thanks
&lt;br /&gt;//
&lt;br /&gt;function correctPNG() {
&lt;br /&gt;      for(var i=0; i
 	  var img = document.images[i]
&lt;br /&gt;	  var imgName = img.src.toUpperCase()
&lt;br /&gt;	  if (imgName.substring(imgName.length-3, imgName.length) == &quot;PNG&quot;) {
&lt;br /&gt;	      var imgID = (img.id) ? &quot;id='&quot; + img.id + &quot;' &quot; : &quot;&quot;
&lt;br /&gt;	      var imgClass = (img.className) ? &quot;class='&quot; + img.className + &quot;' &quot; : &quot;&quot;
&lt;br /&gt;	      var imgTitle = (img.title) ? &quot;title='&quot; + img.title + &quot;' &quot; : &quot;title='&quot; +              img.alt + &quot;' &quot;
&lt;br /&gt;	      var imgStyle = &quot;display:inline-block;&quot; + img.style.cssText 
&lt;br /&gt;	      if (img.align == &quot;left&quot;) imgStyle = &quot;float:left;&quot; + imgStyle
&lt;br /&gt;	      if (img.align == &quot;right&quot;) imgStyle = &quot;float:right;&quot; + imgStyle
&lt;br /&gt;	      if (img.parentElement.href) imgStyle = &quot;cursor:hand;&quot; + imgStyle		
&lt;br /&gt;	      var strNewHTML = &quot;&lt;span
&gt;	          + &quot; style=&amp;#92;&quot;&quot; + &quot;width:&quot; + img.width + &quot;px; height:&quot; + img.height +         &quot;px;&quot; + imgStyle + &quot;;&quot;
&lt;br /&gt;         	  + &quot;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader&quot;
&lt;br /&gt;		  + &quot;(src=&amp;#92;'&quot; + img.src + &quot;&amp;#92;', sizingMethod='image');&amp;#92;&quot;&amp;gt;&lt;/span&gt;&quot; 
&lt;br /&gt;		  img.outerHTML = strNewHTML
&lt;br /&gt;		  i = i-1
&lt;br /&gt;	     }
&lt;br /&gt;	}
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;//
&lt;br /&gt;//	rollovers()
&lt;br /&gt;//	Displays a rollover for any image with a class name of &quot;rollover&quot;. Includes IE friendly function for transparent PNG fix.
&lt;br /&gt;//
&lt;br /&gt;var rollovers = {
&lt;br /&gt;    obj : Object,
&lt;br /&gt;    init : function() {
&lt;br /&gt;	for( var i = 0, over; over = document.getElementsByTagName('img')[i]; i++ ){
&lt;br /&gt;	     if( over.className.indexOf('rollover') &amp;gt;= 0 ) {
&lt;br /&gt;		 rollovers.preload(over);
&lt;br /&gt;		 addEvent(over,'mouseover',rollovers.show);
&lt;br /&gt;		 addEvent(over,'mouseout',rollovers.hide);
&lt;br /&gt;	     }
&lt;br /&gt;	}
&lt;br /&gt;    },
&lt;br /&gt;    preload : function(e) {
&lt;br /&gt;	var img = new Image;
&lt;br /&gt;	var ext = e.src.substring(e.src.length - 4, e.src.length);
&lt;br /&gt;	var name = e.src.substring(0, e.src.length - 4);
&lt;br /&gt;	img.src = name + suffix + ext;
&lt;br /&gt;    },
&lt;br /&gt;    show : function(e) {
&lt;br /&gt;	var ext = this.src.substring(this.src.length - 4, this.src.length);
&lt;br /&gt;	var name = this.src.substring(0, this.src.length - 4);
&lt;br /&gt;	this.src = name + suffix + ext;
&lt;br /&gt;    },
&lt;br /&gt;    hide : function(e) {
&lt;br /&gt;	this.src = this.src.replace(suffix,'');
&lt;br /&gt;    }
&lt;br /&gt;}
&lt;br /&gt;var rollovers_ie = {
&lt;br /&gt;	obj : Object,
&lt;br /&gt;	init : function() {
&lt;br /&gt;	     if( document.getElementsByTagName('span').length &amp;lt; 1 )
&lt;br /&gt;		 setTimeout('rollovers_ie.init()',500);
&lt;br /&gt;		 for( var i = 0, span; span =     document.getElementsByTagName('span')[i]; i++ ){
&lt;br /&gt;         	    if( span.className.indexOf('rollover') &amp;gt;= 0 ) {
&lt;br /&gt;			rollovers_ie.preload(span);
&lt;br /&gt;			addEvent(span,'mouseover',rollovers_ie.show);
&lt;br /&gt;			addEvent(span,'mouseout',rollovers_ie.hide);
&lt;br /&gt;		    }
&lt;br /&gt;		}
&lt;br /&gt;	},
&lt;br /&gt;	preload : function(e) {
&lt;br /&gt;	        var img = new Image;
&lt;br /&gt;		var filter = e.style.filter;
&lt;br /&gt;		var src = filter.substring( filter.indexOf(&quot;src='&quot;) + 5,  filter.indexOf(&quot;',&quot;));
&lt;br /&gt;		var ext = src.substring(src.length - 4, src.length);
&lt;br /&gt;		var name = src.substring(0, src.length - 4);
&lt;br /&gt;		img.src = name + suffix + ext;
&lt;br /&gt;	},
&lt;br /&gt;	show : function(e) {
&lt;br /&gt;		var filter = this.style.filter;
&lt;br /&gt;		var src = filter.substring( filter.indexOf(&quot;src='&quot;) + 5, filter.indexOf(&quot;',&quot;));
&lt;br /&gt;		var ext = src.substring(src.length - 4, src.length);
&lt;br /&gt;		var name = src.substring(0, src.length - 4);
&lt;br /&gt;		this.style.filter = &quot;progid:DXImageTransform.Microsoft.AlphaImageLoader&quot; + &quot;(src=&amp;#92;'&quot; + name + suffix + ext + &quot;&amp;#92;', sizingMethod='image')&quot;;
&lt;br /&gt;	},
&lt;br /&gt;	hide : function(e) {
&lt;br /&gt;		var filter = this.style.filter;
&lt;br /&gt;		var src = filter.substring( filter.indexOf(&quot;src='&quot;) + 5, filter.indexOf(&quot;',&quot;));
&lt;br /&gt;		this.style.filter = &quot;progid:DXImageTransform.Microsoft.AlphaImageLoader&quot; + &quot;(src=&amp;#92;'&quot; + src.replace(suffix,'') + &quot;&amp;#92;', sizingMethod='image')&quot;;
&lt;br /&gt;	}
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;//
&lt;br /&gt;//	pngFrame()
&lt;br /&gt;//	Replaces images with class name of &quot;frame&quot; with png_overlay file.
&lt;br /&gt;//
&lt;br /&gt;function pngFrame() {
&lt;br /&gt;	var imgs = document.images;
&lt;br /&gt;	for( var i = 0, img; img = imgs[i]; i++ ) {
&lt;br /&gt;		if( img.className.indexOf('frame') &amp;gt;= 0 ) {
&lt;br /&gt;			var bgSrc = img.src;
&lt;br /&gt;			img.style.background = &quot;url(&quot; + bgSrc + &quot;)&quot;;
&lt;br /&gt;			img.src = png_overlay;
&lt;br /&gt;		}
&lt;br /&gt;	}
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;//
&lt;br /&gt;// Load the Functions
&lt;br /&gt;//
&lt;br /&gt;if( navigator.userAgent.indexOf('MSIE') &amp;gt;= 0 )
&lt;br /&gt;	addEvent(window,'load',correctPNG);
&lt;br /&gt;addEvent(window,'load',pngFrame);
&lt;br /&gt;if( navigator.userAgent.indexOf('MSIE') &amp;gt;= 0 )
&lt;br /&gt;	addEvent(window,'load',rollovers_ie.init);
&lt;br /&gt;addEvent(window,'load',rollovers.init);
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092296896310373218-1165836996647974201?l=vuthysan.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Vuthy)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5092296896310373218.post-1165836996647974201</guid>
         <pubDate>Thu, 12 Feb 2009 07:27:00 +0000</pubDate>
      </item>
      <item>
         <title>My pimped up dev environment</title>
         <link>http://mmiika.wordpress.com/2008/10/22/my-pimped-up-dev-environment/</link>
         <description>Spent some hours to: Upgrade from Vista 32-bit to Windows Server 2008 64 bit Funky console from http://sourceforge.net/projects/console/ Neat light-on-dark theme for VS 2008 from Brad Wilson: http://www.agileprogrammer.com/dotnetguy/archive/2006/09/07/19030.aspx Chaos Crystal for transparent VS 2008: http://www.elgorithms.com/downloads/chaoscrystal.php Desktop background from http://www.framebox.de/creations/3d/disruption/index.htm The result: Quite happy now, though Windows and VS could be a bit more tweakable&amp;#8230; and wish I had well [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=64&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=64</guid>
         <pubDate>Wed, 22 Oct 2008 10:21:08 +0000</pubDate>
         <content:encoded><![CDATA[<p>Spent some hours to:</p>
<ul>
<li>Upgrade from Vista 32-bit to Windows Server 2008 64 bit</li>
<li>Funky console from <a rel="nofollow" target="_blank" href="http://sourceforge.net/projects/console/">http://sourceforge.net/projects/console/</a></li>
<li>Neat light-on-dark theme for VS 2008 from Brad Wilson: <a rel="nofollow" target="_blank" href="http://www.agileprogrammer.com/dotnetguy/archive/2006/09/07/19030.aspx">http://www.agileprogrammer.com/dotnetguy/archive/2006/09/07/19030.aspx</a></li>
<li>Chaos Crystal for transparent VS 2008: <a rel="nofollow" target="_blank" href="http://www.elgorithms.com/downloads/chaoscrystal.php">http://www.elgorithms.com/downloads/chaoscrystal.php</a></li>
<li>Desktop background from <a rel="nofollow" target="_blank" href="http://www.framebox.de/creations/3d/disruption/index.htm">http://www.framebox.de/creations/3d/disruption/index.htm</a></li>
</ul>
<p>The result:</p>
<p><a rel="nofollow" title="pimped VS 2008 by Mmiika, on Flickr" target="_blank" href="http://www.flickr.com/photos/84034255@N00/2963326093/"><img src="http://farm4.static.flickr.com/3137/2963326093_bd309897bb.jpg" alt="pimped VS 2008" width="500" height="313"/></a></p>
<p>Quite happy now, though Windows and VS could be a bit more tweakable&#8230; and wish I had well working workspaces like with Ubuntu.</p>
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/64/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/64/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/64/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/64/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/64/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/64/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/64/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=64&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
         <media:content medium="image" url="http://farm4.static.flickr.com/3137/2963326093_bd309897bb.jpg">
            <media:title type="html">pimped VS 2008</media:title>
         </media:content>
      </item>
      <item>
         <title>Inheritance</title>
         <link>http://sareuon.blogspot.com/2008/10/inheritance.html</link>
         <description>In Oop languages, Inheritance can help you to reduce the duplicate code and make objects as loosely coupled.&lt;br /&gt;So this is how to do Inheritance in javascript. Let see the code below:&lt;br /&gt;&lt;br /&gt;//Supper Class&lt;br /&gt;Input = function(a, b){&lt;br /&gt;     var _a = a;&lt;br /&gt;     var _b =b;&lt;br /&gt;     &lt;br /&gt;            this.getA = function(){&lt;br /&gt;                    return _a;&lt;br /&gt;           };&lt;br /&gt;     &lt;br /&gt;           this.getB = function(){&lt;br /&gt;                 return _b;&lt;br /&gt;           };&lt;br /&gt;     }&lt;br /&gt;   &lt;br /&gt;     //Concrete Class&lt;br /&gt;     Sum = function(a, b){&lt;br /&gt;           Input.apply(this,[a,b]);&lt;br /&gt;     &lt;br /&gt;          this.getSum = function(){&lt;br /&gt;                 return (this.getA() + this.getB());&lt;br /&gt;          }&lt;br /&gt;     }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;     //Implementation&lt;br /&gt;   &lt;br /&gt;     var mySum = new Sum(2,3);&lt;br /&gt;     alert(mySum.getSum();&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-5712356165798470401?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-5712356165798470401</guid>
         <pubDate>Fri, 17 Oct 2008 03:22:00 +0000</pubDate>
      </item>
      <item>
         <title>Get width of text in px</title>
         <link>http://vuthysan.blogspot.com/2008/10/get-width-of-text-in-px.html</link>
         <description>Create a DIV styled with the following styles. In your JavaScript, set the font size and attributes that you are trying to measure, put your string in the DIV, then read the current width and height of the DIV. It will stretch to fit the contents and the size will be within a few pixels of the string rendered size.&lt;br /&gt;&lt;br /&gt;&amp;lt;div id=&quot;introtext&quot; class=&quot;txt_select&quot;&amp;gt;This is some introductory text&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;style&amp;gt;&lt;br /&gt;    &amp;nbsp;.txt_select{&lt;br /&gt;        position: absolute;&lt;br /&gt;        background-color:#000099;&lt;br /&gt;        font-size:12px;&lt;br /&gt;    }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;    var test = document.getElementById(&quot;introtext&quot;);&lt;br /&gt;    var height = (test.clientHeight + 1) + &quot;px&quot;;&lt;br /&gt;    var width = (test.clientWidth + 1) + &quot;px&quot;;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092296896310373218-2987372434541284658?l=vuthysan.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Vuthy)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5092296896310373218.post-2987372434541284658</guid>
         <pubDate>Thu, 09 Oct 2008 03:46:00 +0000</pubDate>
      </item>
      <item>
         <title>Callback Functions</title>
         <link>http://vuthysan.blogspot.com/2008/09/callback-functions.html</link>
         <description>When you pass a function A to another function B and B executes A, it's often said that A is a callback function. If A doesn't have a name, then you can say that it's an anonymous callback function.&lt;br /&gt;&lt;br /&gt;When are the callback functions useful? Let's see some examples that demonstrate the benefits of the callback functions, namely:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;They let you pass functions without the need to name them (which means there are less global variables)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;You can delegate the responsibility of calling a function to another function (which means there is less code to write)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;They can help with performance&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Callback Example:&lt;/span&gt;&lt;br /&gt;    function multiplyByTwo(a, b, c, callback)     {&lt;br /&gt;        var i, ar = [];&lt;br /&gt;        for(i = 0; i &amp;lt; 3; i++)     {&lt;br /&gt;            ar[i] = callback(arguments[i] * 2);&lt;br /&gt;        }&lt;br /&gt;        return ar;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; myarr = multiplyByTwo(1, 2, 3, addOne);&lt;br /&gt;       &lt;br /&gt;        [3, 5, 7]&lt;br /&gt;&lt;br /&gt;Instead of defining addOne() we can use an anonymous function, this way saving an extra global variable.&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; myarr = multiplyByTwo(1, 2, 3, function(a){return a + 1});&lt;br /&gt;&lt;br /&gt;        [3, 5, 7]&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092296896310373218-4217937691894572827?l=vuthysan.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Vuthy)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5092296896310373218.post-4217937691894572827</guid>
         <pubDate>Mon, 22 Sep 2008 03:25:00 +0000</pubDate>
      </item>
      <item>
         <title>Local versus Global scoping</title>
         <link>http://vuthysan.blogspot.com/2008/09/local-versus-global-scoping.html</link>
         <description>Here's an interesting example that shows an important aspect of the local versus global scoping.&lt;br /&gt;    var a = 123;&lt;br /&gt;    function f()  {&lt;br /&gt;        alert(a);&lt;br /&gt;        var a = 1;&lt;br /&gt;        alert(a);&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;    f();&lt;br /&gt;&lt;br /&gt;You might expect that the first alert() will display 123 (the value of the global variable a) and the second will display 1 (the local a). This is not the case. The first alert will show &quot;undefined&quot;. This is because inside the function the local scope is more important than the global scope. So a local variable overwrites any global variable with the same name. At the time of the first alert() a was not yet defined (hence the value undefined) but it still existed in the local space.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092296896310373218-2002202165215481447?l=vuthysan.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Vuthy)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5092296896310373218.post-2002202165215481447</guid>
         <pubDate>Mon, 22 Sep 2008 03:08:00 +0000</pubDate>
      </item>
      <item>
         <title>Phnom Penh Developers Yahoo Pipe</title>
         <link>http://mmiika.wordpress.com/2008/09/22/phnom-penh-developers-yahoo-pipe/</link>
         <description>Merged couple of feeds from developers in Phnom Penh into a Yahoo Pipe. Subscribe and let me know if you are blogging about programming and not part of that list yet. The current sources are: me Chris in Cambodia Vorleak Sokun Chamnap Sophy Samneang Sareuon Vuthy Phnom Penh Pragmatic Programmers&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=57&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=57</guid>
         <pubDate>Mon, 22 Sep 2008 03:00:08 +0000</pubDate>
         <content:encoded><![CDATA[<p>Merged couple of feeds from <a rel="nofollow" target="_blank" href="http://pipes.yahoo.com/mmiika/phnompenhdev">developers in Phnom Penh</a> into a Yahoo Pipe. Subscribe and let me know if you are blogging about programming and not part of that list yet. The current sources are:</p>
<ul>
<li><a rel="nofollow" target="_blank" href="http://mmiika.wordpress.com">me</a></li>
<li><a rel="nofollow" title="Chris in Cambodia" target="_blank" href="http://chrisincambo.wordpress.com">Chris in Cambodia<br />
</a></li>
<li><a rel="nofollow" target="_blank" href="http://vorleakchy.wordpress.com">Vorleak</a></li>
<li><a rel="nofollow" target="_blank" href="http://chornsokun.wordpress.com">Sokun</a></li>
<li><a rel="nofollow" target="_blank" href="http://chamnapchhorn.blogspot.com">Chamnap</a></li>
<li><a rel="nofollow" target="_blank" href="http://ungsophy.blogspot.com">Sophy</a></li>
<li><a rel="nofollow" target="_blank" href="http://samneang-ngeth.blogspot.com">Samneang</a></li>
<li><a rel="nofollow" target="_blank" href="http://sareuon.blogspot.com">Sareuon</a></li>
<li><a rel="nofollow" target="_blank" href="http://vuthysan.blogspot.com">Vuthy</a></li>
<li><a rel="nofollow" target="_blank" href="http://groups.google.com/group/ppppkh">Phnom Penh Pragmatic Programmers</a></li>
</ul>
<br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/57/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/57/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/57/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/57/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/57/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/57/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/57/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=57&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>Phnom Penh Dev Feed</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/8f19b6a3617a779f/8f4f96a8fb69a5a9?show_docid=8f4f96a8fb69a5a9</link>
         <author>Miika Makinen</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/8f19b6a3617a779f/8f4f96a8fb69a5a9?show_docid=8f4f96a8fb69a5a9</guid>
         <pubDate>Mon, 22 Sep 2008 01:24:59 +0000</pubDate>
      </item>
      <item>
         <title>Set up Khmer fonts</title>
         <link>http://sareuon.blogspot.com/2008/09/khkhj.html</link>
         <description>Hi, this is my first article for my blog. This is about how to setup khmer fornts on ubuntu both true type fonts and unicode. To install khmer fonts you can do following :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Copy the fonts files from Microsoft Windows (C:&amp;#92;Windows&amp;#92;Fonts) or you can download it from internet by searching on google, yahoo or the other search engine.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create new folder to store new fonts in &quot; /usr/local/share &quot; Ex. &lt;span style=&quot;font-weight:bold;&quot;&gt;cambodia&lt;/span&gt; and place all copy's fonts you wish to install on this new folder.&lt;/li&gt;&lt;li&gt;Open terminal ( Application -&amp;gt; Accessories -&amp;gt; Terminal) the type &lt;span style=&quot;font-weight:bold;&quot;&gt;$sudo fc-cache -fv &lt;/span&gt;to clear cache.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;To be able to type unicode in ubuntu go to (System -&amp;gt; Preferences -&amp;gt; Keyboard -&amp;gt; Layouts -&amp;gt;Add ) from Layouts select cambodia and click Add&lt;/li&gt;&lt;li&gt;After you Add cambodia keyboard you can set Layout Options and chose you favorite Layout switching&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2359002249313379007-6554818490878419590?l=sareuon.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Sareuon)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-2359002249313379007.post-6554818490878419590</guid>
         <pubDate>Tue, 16 Sep 2008 10:29:00 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/a13dacefec165039?show_docid=a13dacefec165039</link>
         <author>c.sokun</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/a13dacefec165039?show_docid=a13dacefec165039</guid>
         <pubDate>Sat, 13 Sep 2008 02:52:56 +0000</pubDate>
      </item>
      <item>
         <title>SQL_BIG_SELECTS</title>
         <link>http://vuthysan.blogspot.com/2008/09/sqlbigselects.html</link>
         <description>Before I had one problem that can not execute big query in my Search page.It's because of web-hosting not allow to execute big query. So we have to add one line bellow before the big query like this:&lt;br /&gt;ActiveRecord::Base.connection.execute('SET SQL_BIG_SELECTS = on')&lt;br /&gt;Place.find_by_sql(&quot;..............&quot;)&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092296896310373218-3673576625412134258?l=vuthysan.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Vuthy)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5092296896310373218.post-3673576625412134258</guid>
         <pubDate>Fri, 12 Sep 2008 07:00:00 +0000</pubDate>
      </item>
      <item>
         <title>Yahoo! BOSS for Ruby</title>
         <link>http://ungsophy.blogspot.com/2008/09/yahoo-boss-for-ruby.html</link>
         <description>Yahoo! launched &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://developer.yahoo.com/search/boss/&quot;&gt;BOSS&lt;/a&gt;. It is a service that allows you to search the entire Yahoo! Search index. It is really cool. Meanwhile, Jay Pignata has developed a ruby library, BOSSMan, for Rubyists to mess around with Yahoo! search web service. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/jpignata/bossman-gem/tree/master&quot;&gt;BOSSMan&lt;/a&gt; lives on Github. If you wanna try just:&lt;br /&gt;&lt;pre style=&quot;font-family:courier new;&quot;&gt;gem sources -a http://gems.github.com&lt;br /&gt;gem install jpignata-bossman&lt;br /&gt;&lt;/pre&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-103607047874672813?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-103607047874672813</guid>
         <pubDate>Thu, 04 Sep 2008 02:55:00 +0000</pubDate>
      </item>
      <item>
         <title>Re: Scrum training</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/9c55f5fc297d95d5/b9c66ecbf865fe65?show_docid=b9c66ecbf865fe65</link>
         <author>Chris Brown</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/9c55f5fc297d95d5/b9c66ecbf865fe65?show_docid=b9c66ecbf865fe65</guid>
         <pubDate>Mon, 01 Sep 2008 13:30:26 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/c32eac8c2c93ebc8?show_docid=c32eac8c2c93ebc8</link>
         <author>Miika Makinen</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/c32eac8c2c93ebc8?show_docid=c32eac8c2c93ebc8</guid>
         <pubDate>Mon, 01 Sep 2008 06:48:28 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/8f62393ba1ab0b67?show_docid=8f62393ba1ab0b67</link>
         <author>c.sokun</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/8f62393ba1ab0b67?show_docid=8f62393ba1ab0b67</guid>
         <pubDate>Mon, 01 Sep 2008 06:34:55 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/2be1c57a34c24007?show_docid=2be1c57a34c24007</link>
         <author>Miika Makinen</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/2be1c57a34c24007?show_docid=2be1c57a34c24007</guid>
         <pubDate>Mon, 01 Sep 2008 05:09:48 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/9e7208d61df77b26?show_docid=9e7208d61df77b26</link>
         <author>c.sokun</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/9e7208d61df77b26?show_docid=9e7208d61df77b26</guid>
         <pubDate>Mon, 01 Sep 2008 05:01:07 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/89c0ace6c98e46ae?show_docid=89c0ace6c98e46ae</link>
         <author>Samnang</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/89c0ace6c98e46ae?show_docid=89c0ace6c98e46ae</guid>
         <pubDate>Mon, 01 Sep 2008 04:54:19 +0000</pubDate>
      </item>
      <item>
         <title>Re: free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/8ab8d8150c77dea6?show_docid=8ab8d8150c77dea6</link>
         <author>Miika</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/8ab8d8150c77dea6?show_docid=8ab8d8150c77dea6</guid>
         <pubDate>Mon, 01 Sep 2008 04:25:14 +0000</pubDate>
      </item>
      <item>
         <title>Re: Scrum training</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/9c55f5fc297d95d5/39bb8c39a549dba0?show_docid=39bb8c39a549dba0</link>
         <author>Miika Makinen</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/9c55f5fc297d95d5/39bb8c39a549dba0?show_docid=39bb8c39a549dba0</guid>
         <pubDate>Mon, 01 Sep 2008 04:22:30 +0000</pubDate>
      </item>
      <item>
         <title>free c# lecturing session</title>
         <link>http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/fe698478db6f751d?show_docid=fe698478db6f751d</link>
         <author>c.sokun</author>
         <guid isPermaLink="false">http://groups.google.com/group/ppppkh/browse_thread/thread/abf999f5e8f5fd37/fe698478db6f751d?show_docid=fe698478db6f751d</guid>
         <pubDate>Mon, 01 Sep 2008 03:46:46 +0000</pubDate>
      </item>
      <item>
         <title>Save_without_validation</title>
         <link>http://vuthysan.blogspot.com/2008/08/first-blog.html</link>
         <description>This snip code bellow show about save a new record without validation&lt;br /&gt;&lt;br /&gt;photo = Photo.new&lt;br /&gt;photo.name = &quot;&quot;&lt;br /&gt;photo.save(false)&lt;br /&gt;&lt;br /&gt;if we use &lt;b&gt;update_attribute_with_validation_skipping&lt;/b&gt;(name, value) to update record without validation and want to success this task when we user find_by_sql to find that record we must to select all fields of that record.otherwise it will not effect at all.&lt;br /&gt;biz = Photo.find_by_sql(..............)&lt;br /&gt;biz.update_attribute_with_validation_skipping(&quot;request_date&quot;, Time.now)&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5092296896310373218-2999492964558349184?l=vuthysan.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>noreply@blogger.com (Vuthy)</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-5092296896310373218.post-2999492964558349184</guid>
         <pubDate>Sat, 23 Aug 2008 06:26:00 +0000</pubDate>
      </item>
      <item>
         <title>Congrats Canadia Bank…</title>
         <link>http://mmiika.wordpress.com/2008/08/21/congrats-canadia-bank/</link>
         <description>Well done! Canadia bank website has manage to get into listed as an attack site&amp;#8230; http://www.google.com/search?q=canadia+bank I have an account there :(&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=52&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=52</guid>
         <pubDate>Thu, 21 Aug 2008 10:01:37 +0000</pubDate>
         <content:encoded><![CDATA[<p>Well done! Canadia bank website has manage to get into listed as an attack site&#8230; <a rel="nofollow" target="_blank" href="http://www.google.com/search?q=canadia+bank">http://www.google.com/search?q=canadia+bank</a></p>
<p>I have an account there :(</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/52/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/52/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/52/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/52/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/52/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/52/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/52/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/52/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/52/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=52&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>Prawn generates PDF</title>
         <link>http://ungsophy.blogspot.com/2008/08/prawn-generates-pdf.html</link>
         <description>You can use Prawn to generate PDF. Prawn is a ruby library that make PDF creation possible in Ruby. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://prawn.majesticseacreature.com/&quot;&gt;more &lt;img width=&quot;36&quot; alt=&quot;prawn.png&quot; src=&quot;http://www.rubyinside.com/wp-content/uploads/2008/08/prawn.jpg&quot;/&gt;&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-2578418007760746581?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-2578418007760746581</guid>
         <pubDate>Fri, 15 Aug 2008 03:33:00 +0000</pubDate>
      </item>
      <item>
         <title>Ruby to JavaScript</title>
         <link>http://ungsophy.blogspot.com/2008/08/ruby-to-javascript.html</link>
         <description>If you are a fan of Ruby and you want to write JavaScript code, you don't need to learn JavaScript. You can write JavaScript code by using RED. RED is a ruby library that will convert Ruby code to JavaScript code. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://wonderfullyflawed.com/2008/08/07/javascript-makes-me-see-red/&quot;&gt;Check this out!&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-3274245190116771906?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-3274245190116771906</guid>
         <pubDate>Thu, 14 Aug 2008 18:22:00 +0000</pubDate>
      </item>
      <item>
         <title>IRC channel for patterns, practices and principles</title>
         <link>http://mmiika.wordpress.com/2008/08/14/irc-channel-for-patterns-practices-and-principles/</link>
         <description>I could not find any decent IRC channel for pragmatic programmers, so I&amp;#8217;ve just created one: irc://freenode/*dd. So, if you are into chatting about &amp;#8220;advanced&amp;#8221; programming topics like DDD, BDD/TDD, patterns or other similar subjects (language independent), come on in!&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=45&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=45</guid>
         <pubDate>Thu, 14 Aug 2008 08:50:34 +0000</pubDate>
         <content:encoded><![CDATA[<p>I could not find any decent IRC channel for pragmatic programmers, so I&#8217;ve just created one:                                 <a rel="nofollow" id="ch-url-anchor" class="chatzilla-link">irc://freenode/*dd</a>. So, if you are into chatting about &#8220;advanced&#8221; programming topics like DDD, BDD/TDD, patterns or other similar subjects (language independent), come on in!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/45/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/45/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/45/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/45/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/45/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/45/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/45/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/45/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/45/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=45&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>Firefox 3 and localhost on Vista</title>
         <link>http://mmiika.wordpress.com/2008/08/08/firefox-3-and-localhost-on-vista/</link>
         <description>Symptom: Firefox 3 does not find localhost on Windows Vista, but does find the ip 127.0.0.1 Cure: Type &amp;#8220;about:config&amp;#8221; to Firefox address bar, and set network.dns.disableIPv6 to true&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=42&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=42</guid>
         <pubDate>Fri, 08 Aug 2008 01:09:49 +0000</pubDate>
         <content:encoded><![CDATA[<p><strong>Symptom: </strong>Firefox 3 does not find localhost on Windows Vista, but does find the ip 127.0.0.1</p>
<p><strong>Cure:</strong> Type &#8220;about:config&#8221; to Firefox address bar, and set <strong>network.dns.disableIPv6 </strong>to <strong>true</strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/42/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/42/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/42/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/42/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/42/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/42/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/42/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/42/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/42/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=42&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>LOC5</title>
         <link>http://mmiika.wordpress.com/2008/08/02/loc5/</link>
         <description>total([{Item, Amount}&amp;#124;T]) -&amp;#62; price(Item) * Amount + total(T);&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=39&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=39</guid>
         <pubDate>Sat, 02 Aug 2008 09:54:21 +0000</pubDate>
         <content:encoded><![CDATA[<p>total([{Item, Amount}|T]) -&gt; price(Item) * Amount + total(T);</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/39/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/39/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/39/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/39/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/39/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/39/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/39/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/39/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/39/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=39&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>Master Scrum</title>
         <link>http://mmiika.wordpress.com/2008/07/16/master-scrum/</link>
         <description>We might be able to pull off Certified Scrum Master training class here in Phnom Penh, Cambodia, if there are enough interested people. I did this class a while ago and it was probably the best thing I&amp;#8217;ve ever done in my life. Ok, maybe I&amp;#8217;m exaggerating a tiny bit there&amp;#8230; but ask anybody in [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=18&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=18</guid>
         <pubDate>Wed, 16 Jul 2008 00:17:33 +0000</pubDate>
         <content:encoded><![CDATA[<p>We might be able to pull off Certified Scrum Master training class here in Phnom Penh, Cambodia, if there are enough interested people. I did this class a while ago and it was probably the best thing I&#8217;ve ever done in my life. Ok, maybe I&#8217;m exaggerating a tiny bit there&#8230;  but ask anybody in our office and I&#8217;m sure they&#8217;ll say adopting scrum has been *hugely great*.</p>
<p>Anybody interested?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/18/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/18/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/18/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/18/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/18/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/18/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/18/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/18/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/18/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=18&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>JavaScript: Behavior Driven Development / Test Driven Development Tools Roundup</title>
         <link>http://chrisincambo.wordpress.com/2008/07/14/javascript-behavior-driven-development-test-driven-development-tools-roundup/</link>
         <description>I&amp;#8217;m sure with size, complexity and sheer number of JavaScript applications and frameworks that have been poring into production over the last few years, there must be a lot of developers out there putting serious effort into testing. Despite this there seems to be quite a low amount of information on the web about the [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;amp;blog=4041893&amp;amp;post=15&amp;amp;subd=chrisincambo&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chrisincambo.wordpress.com/?p=15</guid>
         <pubDate>Mon, 14 Jul 2008 15:01:06 +0000</pubDate>
         <content:encoded><![CDATA[<p>I&#8217;m sure with size, complexity and sheer number of JavaScript applications and frameworks that have been poring into production over the last few years, there must be a lot of developers out there putting serious effort into testing. Despite this there seems to be quite a low amount of information on the web about the tools and frameworks that are available. So I thought I would share the with you my own personal experiences when it comes to the tools that are out there.</p>
<p><strong>Spec and Testing Frameworks:</strong></p>
<p>This is an area JavaScript has pretty much got nailed with two great offering for both the xUnit and xSpec/xBehave crowds.</p>
<p><a rel="nofollow" target="_blank" href="http://jania.pe.kr/aw/moin.cgi/JSSpec#head-7c8c71ed9dd60af7680034a40e03a0e2b92e70f7"><strong>JSSpec</strong></a></p>
<p>I really don&#8217;t know what I would do without this great BDD framework written by 강규영 (a.k.a Alan Kang). It follows the standard semantics of BDD and has an extremely natural DSL which I&#8217;ve seen developers get up and running with in under ten minutes.</p>
<pre>
describe('Plus operation', {
    'should concatenate two strings': function() {
        value_of(&quot;Hello &quot; + &quot;World&quot;).should_be(&quot;Hello World&quot;);
    },
    'should add two numbers': function() {
        value_of(1 + 2).should_be(3);
    }
});
</pre>
<p>The spec runner is also quite something to behold as it runs through each spec within the suite for your story. I still believe that a GUI or web interface as is the case in JSSpec is a very powerful tool when conveying the value of thorough testing to the product owner. I even had a product owner bring stakeholders into the office who have no idea about BDD or any software development practices for that matter just to show them the tests.</p>
<p>There are a few &#8216;quirks&#8217;, such as extending some of JavaScript&#8217;s base type classes and a small sprinkling of global variables but that&#8217;s a small price to pay in the name of elegant DSL, besides the code is very readable which means you can easily get in there and make some tweaks if you would prefer a slightly less flowing DSL in return for a clean namespace.</p>
<p><a rel="nofollow" target="_blank" href="http://jsunit.net/"><strong>JSUnit</strong></a></p>
<p>I used this JavaScript port of JUnit for a long time before I discovered BDD and then JSSpec. It is a very well supported framework and is very good at what it does, but as is the problem with all of the xUnit family of test suites it doesn&#8217;t have a clearly defined set of semantics for testing other than assertThis and assertThat so therefore can&#8217;t really have a DSL, so instead we have a collection of functions and a lot of room for developers to fill in the blanks.</p>
<pre>
function testPlusOperation() {
    assertEquals(&quot;Hello &quot; + &quot;World&quot;, &quot;Hello World&quot;);
    assertEquals(1 + 2, 3);
}
</pre>
<p>For people who are experienced at testing it works great, for those who aren&#8217;t things can get very ugly, very quickly. It also has a nice test runner, but the green progress bar just doesn&#8217;t have the same impact in conveying the sheer weight of  the tests it is running through in the same way JSSpec does, it is very functional but isn&#8217;t going to impress the stakeholders. To sum up as I said already I can&#8217;t knock the software itself, it does exactly what is says on the box.</p>
<p><strong>Mocking Frameworks:</strong></p>
<p>Unfortunately the two offerings for mocking frameworks aren&#8217;t nearly as strong as their spec/test counterparts discussed already. They both have their ups and downs but one major flaw they both share is an inability to reliably get the public methods from your class (function) constructors and this is in part a JavaScript problem. In order for the mocking frameworks to retrieve the public methods which may be contained within your classes constructor rather than its prototype, the class has to be instantiated so that the the properties can be iterated through to see if the expected method can be found there. This is great, but the problem comes when your class is dependent on an argument passed in to the constructor. Like so:</p>
<pre>
function MyClass(dependancyObject){
    this.foo = dependancyObject.someMethod();
}
</pre>
<p>When we pass MyClass over to be mocked, the mocking framework is not going to pass in an argument that implements the interface of the dependency object and therefore will raise an exception. Yes I already know there are umpteen good JavaScript coding practice that will avoid this problem, but the point is that a mocking framework should work as long as the code for my class is valid, regardless of whether it follows good practices or not.</p>
<p><a rel="nofollow" target="_blank" href="http://jsmock.sourceforge.net/"><strong>JSMock</strong></a></p>
<p>JSMock is cool little mocking framework with a very sexy DSL, the only problem is that it isn&#8217;t fully featured. It allows for you to add return value expectations to your mock object but does not allow you to place an expectation on the number of times the method will be called. This often results in this kind of thing:</p>
<pre>
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
myMock.expects().myVeryWellUsedMethod().andReturns(something)
</pre>
<p>When what I REALLY REALLY want to do is this:</p>
<pre>
myMock.expects().myVeryWellUsedMethod().times(8).andReturns(something)
</pre>
<p>Or if we were a bit naughty and had extended the Number.prototype, maybe even something like this:</p>
<pre>
myMock.expects().myVeryWellUsedMethod().8.times().andReturns(something)
</pre>
<p>But what we all to often end up with is this:</p>
<pre>
// <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley'/>
var myStub = function(){
    myVeryWellUsedMethod: function(){
        return something;
    }
};
</pre>
<p>There is also no support giving expectations to the parameters passed to methods of the mock object. Personally with my normal usage patterns I seem to be able to live with that, but I know that for other people it is a big issue. I know I sound like I&#8217;ve come down quite hard on JSMock but that&#8217;s only because I really love the DSL and know that with just a couple more features it could have been perfect.</p>
<p><a rel="nofollow" target="_blank" href="http://mock4js.sourceforge.net/"><strong>Mock4js</strong></a></p>
<p>While JSMock falls short on features, I very much doubt you will hear many people laying the same charge against Mock4js. It has everything you would expect from a fully featured mocking framework, we can set expectations for our mock methods on the arguments passed, the return values, the number of times we expect it to be called and can also quickly knock up stubs if you are that way inclined.<br />
But don&#8217;t start getting too excited quite yet. The DSL is not very smooth, meaning it will take a few days before you are writing mocks without having to check the docs, but this is a small issue compared to the havoc it causes in your namespace. In order to be able to create mocks you need to make a call like so:</p>
<pre>
Mock4JS.addMockSupport(this);
</pre>
<p>This method then proceeds to decorate whichever namespace &#8216;this&#8217; is referring to (usually global or that of your testing framework) with a sh!t load of methods. The first time I used it was within in the JSSpec namespace and straight away there was a collision.<br />
“And that&#8217;s all I have to say about that”. Forrest Gump.</p>
<p><strong>Code Coverage Tools</strong></p>
<p>Although I&#8217;m not anywhere as religious about code coverage as I am to other aspects of testing, especially in JavaScript where inconsistencies often mean you have whole modules that were designed only for a single browser, SVG/VML type applications spring to mind. This means a file can receive 100% coverage in one browser and 0% in another. Despite these glaring inconsistencies code coverage is still useful to find any large gaps, especially if you are a lead developer working on a large code base with a large team where monitoring manually can be a real pain.</p>
<p><a rel="nofollow" target="_blank" href="http://siliconforks.com/jscoverage/"><strong>JSCoverage</strong></a></p>
<p>JSCoverage is a cool command line app that runs through your projects folder and recreates the project in a new folder only with some added &#8216;special sauce&#8217;. You will now be able to point there web interface to the HTML page of you test suite and get back a detailed coverage report.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chrisincambo.wordpress.com/15/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chrisincambo.wordpress.com/15/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisincambo.wordpress.com/15/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisincambo.wordpress.com/15/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisincambo.wordpress.com/15/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisincambo.wordpress.com/15/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisincambo.wordpress.com/15/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisincambo.wordpress.com/15/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chrisincambo.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisincambo.wordpress.com/15/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;blog=4041893&amp;post=15&amp;subd=chrisincambo&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="">
            <media:title type="html">chrisincambo</media:title>
         </media:content>
      </item>
      <item>
         <title>Mono on Ubuntu Hardy</title>
         <link>http://mmiika.wordpress.com/2008/07/13/mono-on-ubuntu-hardy/</link>
         <description>sudo apt-get install monodevelop sudo apt-get install mono-gmcs Is it possible to code without R#?&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=35&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=35</guid>
         <pubDate>Sun, 13 Jul 2008 13:16:52 +0000</pubDate>
         <content:encoded><![CDATA[<ol>
<li>sudo apt-get install monodevelop</li>
<li>sudo apt-get install mono-gmcs</li>
<li>Is it possible to code without R#?</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/35/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/35/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/35/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/35/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/35/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/35/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/35/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/35/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/35/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=35&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>Ubuntu Adventures</title>
         <link>http://mmiika.wordpress.com/2008/07/12/ubuntu-adventures/</link>
         <description>For me PC has equaled Microsoft since I sometime in late eighties/early nineties booted my fathers &amp;#8220;portable&amp;#8221; Panasonic into MS-DOS the first time. I also remember well the huge speed difference between 10 and 12 MHz 286s :) Anyways, the closest to Linux I ever came was the fact that Mr. Torvalds was born in [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=30&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=30</guid>
         <pubDate>Sat, 12 Jul 2008 08:19:10 +0000</pubDate>
         <content:encoded><![CDATA[<p>For me PC has equaled Microsoft since I sometime in late eighties/early nineties booted my fathers &#8220;portable&#8221; Panasonic into MS-DOS the first time. I also remember well the huge speed difference between 10 and 12 MHz 286s :) Anyways, the closest to Linux I ever came was the fact that Mr. Torvalds was born in same city as me. That is, until last couple of weeks. A &#8220;heated discussion&#8221; with Vista on my laptop lead me on a trip to Ubuntuland. Here&#8217;s a collection of thoughts:</p>
<p>Installation was a breeze. Truth be told, this is the first time I&#8217;ve installed any operating system and I was a bit scared. I found a perfect solution for me: <a rel="nofollow" target="_blank" href="http://wubi-installer.org/">Wubi</a>. As easy as installing any software on your machine!</p>
<p>A big difference between Windows and Linux world is the startup position. Windows installs with all bells and whistles turned on and Linux with them turned off. With Vista I&#8217;ve spent hours and hours trying to turn off services which slow me down and with Ubuntu I&#8217;ve spent the same hours installing services I need. Linux-way wins: It&#8217;s a lot more rewarding learning about processes you&#8217;ll need than learning about processes you&#8217;ll not need!</p>
<p>Linux has a DIY feel to it. I&#8217;ve never really wanted to install custom themes etc. to my Windows, but that was one of the first things I did with Ubuntu.</p>
<p>Terminal is your friend. I really like the fact that you learn from the beginning that most of the stuff can be done either in the terminal or with the GUI.</p>
<p>I really miss VIsual Studio, C# and Resharper while booted in Linux. Haven&#8217;t dared to try to run Mono yet.</p>
<p>Unpolished diamond? There are whole lot of things in Ubuntu (or with apps installed on it) still that need a bit of work. Couple of most annoying things: Firefox always starts in Offline mode (I&#8217;m using 3g phone as modem). No sound in Youtube videos for me.</p>
<p>Conclusion. I want to play with a Mac as well. I think OSs will and should become more specialized, one size just does not fit all. I actually like it now that I can boot into different world depending on my feeling/needs.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/30/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/30/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/30/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/30/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/30/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/30/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/30/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/30/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/30/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=30&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>A Big Party?</title>
         <link>http://mmiika.wordpress.com/2008/07/12/a-big-party/</link>
         <description>How many times have you clicked through an installation dialog like a zombie, not really reading any stage but just going &amp;#8220;next&amp;#8221;. &amp;#8220;next&amp;#8221;? I admit doing that, but it gets worse: even web apps start to work a bit like that for me: testing a new app I&amp;#8217;ve found myself quite a few times &amp;#8220;assuming&amp;#8221; [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;amp;blog=3798048&amp;amp;post=32&amp;amp;subd=mmiika&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://mmiika.wordpress.com/?p=32</guid>
         <pubDate>Sat, 12 Jul 2008 04:35:31 +0000</pubDate>
         <content:encoded><![CDATA[<p>How many times have you clicked through an installation dialog like a zombie, not really reading any stage but just going &#8220;next&#8221;. &#8220;next&#8221;? I admit doing that, but it gets worse: even web apps start to work a bit like that for me: testing a new app I&#8217;ve found myself quite a few times &#8220;assuming&#8221; what a button does etc.</p>
<p>Now, this carelessness lead to a funny (and gotta admit a it embarassing) incident yesterday. I logged into my Linked In account first time in x months and started to play with it (UI had changed quite a lot since I saw it the last time). I tested the &#8220;import contacts&#8221; feature and knowingly gave my gmail password (scary things they have nowadays) to import contacts. This imported quite a few mail addresses, including lot of expired ones, mailing list addresses, you name it. And by default each one selected, ready to be invited to linked in. Now I started to scan for a button which would &#8220;invert the selection&#8221;, and saw one saying &#8220;Invert selected contacts&#8221;, perfect! I clicked before and basically at the same time realized that it said &#8220;INVITE&#8221;, not &#8220;INVERT&#8221;. I was too late with the esc key&#8230;</p>
<p>So, as a result I managed to create some confusion on some mailing lists and probably there are some other people wondering as well about who I might be :) </p>
<p>If you were my victim, sorry about that,<br />
Miika</p>
<p>Edit: A quick search tells me I&#8217;m not the only one that has done similar mistake: <a rel="nofollow">http://www.google.com/search?q=&#8221;Invitation+to+connect+to+linked+in&#8221;</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mmiika.wordpress.com/32/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mmiika.wordpress.com/32/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mmiika.wordpress.com/32/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mmiika.wordpress.com/32/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mmiika.wordpress.com/32/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mmiika.wordpress.com/32/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mmiika.wordpress.com/32/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mmiika.wordpress.com/32/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/mmiika.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mmiika.wordpress.com/32/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mmiika.wordpress.com&amp;blog=3798048&amp;post=32&amp;subd=mmiika&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/b015344ba49711e90affd0687f854dba?s=96&amp;amp;d=identicon">
            <media:title type="html">mmiika</media:title>
         </media:content>
      </item>
      <item>
         <title>Ubuntu – Two Weeks Later</title>
         <link>http://chrisincambo.wordpress.com/2008/07/07/ubuntu-two-weeks-later/</link>
         <description>The Good (things that didn&amp;#8217;t work very well for me last time I tried): All of my usb devices were recognized straight away Connecting to wireless networks is effortless Linux Skype now has video calls Eclipse works with all of my favourite add-ons Google Earth My ATI graphics card Bluetooth The Bad: Eclipse (never known [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;amp;blog=4041893&amp;amp;post=13&amp;amp;subd=chrisincambo&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chrisincambo.wordpress.com/?p=13</guid>
         <pubDate>Mon, 07 Jul 2008 10:31:29 +0000</pubDate>
         <content:encoded><![CDATA[<p>The Good (things that didn&#8217;t work very well for me last time I tried):</p>
<ul>
<li>All of my usb devices were recognized straight away</li>
<li>Connecting to wireless networks is effortless</li>
<li>Linux Skype now has video calls</li>
<li>Eclipse works with all of my favourite add-ons</li>
<li>Google Earth</li>
<li>My ATI graphics card</li>
<li>Bluetooth</li>
</ul>
<p>The Bad:</p>
<ul>
<li>Eclipse (never known for its legs) is even slower than on windows</li>
<li>Fonts still look a bit skanky without a lot of messing around</li>
<li>OpenOffice still butchers five out of every ten .doc files I try opening</li>
</ul>
<p>The Ugly:</p>
<ul>
<li>It took me about three days of command line hacking to use dial-up via my 3G phone</li>
</ul>
<p>Summary:</p>
<p>Still not perfect but I think for me at least it now has the edge on Windows.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chrisincambo.wordpress.com/13/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chrisincambo.wordpress.com/13/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisincambo.wordpress.com/13/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisincambo.wordpress.com/13/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisincambo.wordpress.com/13/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisincambo.wordpress.com/13/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisincambo.wordpress.com/13/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisincambo.wordpress.com/13/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chrisincambo.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisincambo.wordpress.com/13/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;blog=4041893&amp;post=13&amp;subd=chrisincambo&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="">
            <media:title type="html">chrisincambo</media:title>
         </media:content>
         <category>ubuntu</category>
      </item>
      <item>
         <title>Passing arguments from method to method in JavaScript</title>
         <link>http://ungsophy.blogspot.com/2008/07/passing-arguments-from-method-to-method.html</link>
         <description>For example, you have one function &lt;span style=&quot;font-family:courier new;&quot;&gt;greeting()&lt;/span&gt; that accepts two string arguments only. And you have another function &lt;span style=&quot;font-family:courier new;&quot;&gt;callAnotherFunction()&lt;span style=&quot;font-family:arial;&quot;&gt; &lt;/span&gt;&lt;/span&gt;that accepts only one argument which is a function. In order to pass arguments from method to method, JavaScript provide ideal &lt;span style=&quot;font-family:courier new;&quot;&gt;apply()&lt;/span&gt; and &lt;span style=&quot;font-family:courier new;&quot;&gt;call()&lt;/span&gt; to deal with this scenario.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;function greeting(name, str) {&lt;br /&gt;alert(str + &quot;, &quot; + name);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function callAnotherFunction(method) {&lt;br /&gt;method.apply(null, arguments);   // arguments refer to [&quot;John&quot;, &quot;Good morning&quot;]&lt;br /&gt;alert(arguments.length);  // arguments refer to method&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;callAnotherFunction(function() {greeting(&quot;John&quot;, &quot;Good morning&quot;)});&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;The significant point in this example is &lt;code&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;arguments &lt;/span&gt;&lt;/code&gt;in&lt;code&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;/span&gt; callAnotherFunction(method). &lt;/code&gt;It means differently in the same function. In &lt;code&gt;method.apply(null, arguments)&lt;span style=&quot;font-family:Georgia, serif;&quot;&gt;, &lt;/span&gt;&lt;/code&gt;it refers to the arguments that passed from method. And in &lt;code&gt;alert(arguments.length), &lt;/code&gt;it refers to method itself, not its arguments.&lt;br /&gt;&lt;br /&gt;These example might not make sense to some people but it very useful when you want to pass arguments from method to method.&lt;br /&gt;&lt;br /&gt;Hope this help.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-2134861502520415309?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-2134861502520415309</guid>
         <pubDate>Thu, 03 Jul 2008 18:08:00 +0000</pubDate>
      </item>
      <item>
         <title>Good practice in array deletion in JavaScript</title>
         <link>http://ungsophy.blogspot.com/2008/07/good-practice-in-array-deletion.html</link>
         <description>It is really piss me off when I spent a few hours trying to find the failure in my JavaScript code.&lt;br /&gt;&lt;br /&gt;Eventually, I found out what the problem was. I did not delete my array correctly.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var arr = [1, 2, 3, 4];&lt;br /&gt;for (var i=0; i&amp;lt;arr.length; i++)&lt;br /&gt;  arr.splice(i, 1);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This for loop never delete all the elements in your array. When i = 0, arr[0] (a) is deleted and when i = 1, arr[1] (c) is deleted and then exit the loop cause i eqauls arr.length equals 2.&lt;br /&gt;&lt;br /&gt;To deal with this problem, you should assing arr.length to one variable so when you delete the array it does not effect you loop.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;var arr = [1, 2, 3, 4];&lt;br /&gt;for (i=0, len=arr.length; i&amp;lt;len; i++)&lt;br /&gt;  arr.splice(0,1);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Hope this help.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-7237636593239577410?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-7237636593239577410</guid>
         <pubDate>Wed, 02 Jul 2008 22:51:00 +0000</pubDate>
      </item>
      <item>
         <title>Contender for quote of the year 2008:</title>
         <link>http://chrisincambo.wordpress.com/2008/06/25/contender-for-quote-of-the-year-2008/</link>
         <description>Scrum Master: He (team member) actually believes his opinion is valuable.&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;amp;blog=4041893&amp;amp;post=10&amp;amp;subd=chrisincambo&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chrisincambo.wordpress.com/?p=10</guid>
         <pubDate>Wed, 25 Jun 2008 02:22:36 +0000</pubDate>
         <content:encoded><![CDATA[<p>Scrum Master: He (team member) <em><strong>actually</strong></em> believes his opinion is valuable.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chrisincambo.wordpress.com/10/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chrisincambo.wordpress.com/10/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisincambo.wordpress.com/10/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisincambo.wordpress.com/10/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisincambo.wordpress.com/10/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisincambo.wordpress.com/10/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisincambo.wordpress.com/10/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisincambo.wordpress.com/10/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chrisincambo.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisincambo.wordpress.com/10/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;blog=4041893&amp;post=10&amp;subd=chrisincambo&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="">
            <media:title type="html">chrisincambo</media:title>
         </media:content>
         <category>scrum</category>
      </item>
      <item>
         <title>Windows out, Ubuntu in!</title>
         <link>http://chrisincambo.wordpress.com/2008/06/25/windows-out-ubuntu-in/</link>
         <description>Dear diary, well I guess it&amp;#8217;s that time of year again, my annual bout of: &amp;#8220;F%*ck you Windows, it&amp;#8217;s over, and this time I mean it, pack your crap and get out!&amp;#8221;. This time the provocation is a virus that is so persistent, that even after three weeks and multiple treatments it still keeps reappearing. [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;amp;blog=4041893&amp;amp;post=8&amp;amp;subd=chrisincambo&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chrisincambo.wordpress.com/?p=8</guid>
         <pubDate>Wed, 25 Jun 2008 01:16:16 +0000</pubDate>
         <content:encoded><![CDATA[<p>Dear diary, well I guess it&#8217;s that time of year again, my annual bout of: &#8220;F%*ck you Windows, it&#8217;s over, and this time I mean it, pack your crap and get out!&#8221;. This time the provocation is a virus that is so persistent, that even after three weeks and multiple treatments it still keeps reappearing. Yep, time to trade in that fat, winging and extremely bloated package for a more slender cost effective model.</p>
<p>So I have now asked Ubuntu, my long standing and very hot bit on the side to move in with me full time. She&#8217;s slim, attractive and lets me use her without protection. All my mates are really impressed! But this is now a well traveled path, I&#8217;ve been with Ubuntu before, come to think of it, I&#8217;ve even been with her sisters Fedora and Debian a few times too and I already know there&#8217;s a flip side to this coin.</p>
<p>Last time we had a whirlwind romance, I had to eventually give her the boot because after a grueling 72 hour marathon session in my spare room, she STILL could not figure out how to access the internet on my mobile phone. Anyway that&#8217;s water under the bridge, she&#8217;s matured a lot since then and I think this time we can really make a go of it, besides if I go back to Windows after telling all my friends what a fat virus riddled skank she is, I won&#8217;t be able to show my face in the pub ever again.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chrisincambo.wordpress.com/8/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chrisincambo.wordpress.com/8/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisincambo.wordpress.com/8/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisincambo.wordpress.com/8/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisincambo.wordpress.com/8/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisincambo.wordpress.com/8/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisincambo.wordpress.com/8/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisincambo.wordpress.com/8/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chrisincambo.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisincambo.wordpress.com/8/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;blog=4041893&amp;post=8&amp;subd=chrisincambo&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="">
            <media:title type="html">chrisincambo</media:title>
         </media:content>
      </item>
      <item>
         <title>Decorator Pattern in JavaScript – GoF Design Patterns</title>
         <link>http://chrisincambo.wordpress.com/2008/06/23/decorator-pattern-in-javascript-gof-design-patterns/</link>
         <description>Since moving into the new office we&amp;#8217;ve been trying really hard to set things up in such a way that a culture of learning and knowledge sharing is created. In addition to pair programming, a reading area and an ever growing library, we&amp;#8217;ve set aside three hours of group study time a week. As with [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;amp;blog=4041893&amp;amp;post=3&amp;amp;subd=chrisincambo&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chrisincambo.wordpress.com/?p=3</guid>
         <pubDate>Mon, 23 Jun 2008 01:48:55 +0000</pubDate>
         <content:encoded><![CDATA[<p>Since moving into the new office we&#8217;ve been trying really hard to set things up in such a way that a culture of learning and knowledge sharing is created. In addition to pair programming, a reading area and an ever growing library, we&#8217;ve set aside three hours of group study time a week. As with all things under Scrum, the time, duration, date, topic and existence of the study periods was voted on by the development teams. We settled on three sessions a week &#8211; Tuesday: GoF Design Patterns, Wednesday: Open Mic(anybody can present anything) and Thursday: JavaScript.</p>
<p>Miika and I are leading the design pattern session and I&#8217;m leading the JavaScript session. So what is the obvious progression from this&#8230;&#8230;?</p>
<p>Well I&#8217;m guessing you&#8217;ve already read the title so I doubt I&#8217;ve built up much suspense &#8211; Design Patterns in JavaScript!</p>
<p>We are using <a rel="nofollow" target="_blank" href="http://www.amazon.com/Head-First-Design-Patterns/dp/0596007124/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1214186937&amp;sr=1-1">Head First Design Patterns</a> as our study guide as it is much easier to digest than any of the other books are, especially for people who speak English as a second language. So the plan is to post each one of the examples from the book implemented in JavaScript, I&#8217;m then going to post those example to Wikipedia as JavaScript is currently not very well represented in most of the design pattern entries.</p>
<p>I&#8217;m not the first person to cover the subject, in fact  Ross Harmes, Dustin Diaz have already written an excellent <a rel="nofollow" target="_blank" href="http://www.amazon.com/JavaScript-Design-Patterns-Recipes-Problem-Solution/dp/159059908X">book on the subject</a>, but I am going to take a slightly different angle. The plan is to where ever possible avoid building constructs that try to imitate the constructs of other languages, so I will be avoiding using helper methods to mimic interfaces, abstract classes and other constructs and instead embrace JavaScript&#8217;s dynamic nature.</p>
<p>Here&#8217;s the pizza example from the Head First book in JavaScript:</p>
<pre>
//Class to be decorated
function Coffee(){
    this.cost = function(){
        return 1;
    };
}

//Decorator A
function Milk(coffee){
    this.cost = function(){
        return coffee.cost() + 0.5;
    };
}

//Decorator B
function Whip(coffee){
    this.cost = function(){
        return coffee.cost() + 0.7;
    };
}

//Decorator C
function Sprinkles(coffee){
    this.cost = function(){
        return coffee.cost() + 0.2;
    };
}

//Here's one way of using it
var coffee = new Milk(new Whip(new Sprinkles(new Coffee())));
alert( coffee.cost() );

//Here's another
var coffee = new Coffee();
coffee = new Sprinkles(coffee);
coffee = new Whip(coffee);
coffee = new Milk(coffee);
alert(coffee.cost());
</pre>
<p>As you can see by the procedural code using the decorator pattern in JavaScript is much the same as its usage in other more orthodox languages, the big difference is in the implementation of the pattern. As you can see there is no <em>defined </em>interface. JavaScript has no Interface construct, the answer to this as with many other dynamic languages is <a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Duck_typing">duck typing</a> (<em>Note: Wikipedia needs a JavaScript duck typing example</em>).</p>
<p>Duck Typing shifts the responsibility of making sure an object meets an interface from the creator to the receiver. Which is exactly what is happening above, the decorators receive an object which needs to implement the coffee interface by having a single method named cost(). If the object passed in does not have a method called coffee, then an exception will be raised by the JavaScript interpreter at runtime.</p>
<p>I guess what I&#8217;m trying to say is the main thing for me when addressing design patterns is that the &#8216;what&#8217; (behaviour) is more important than the &#8216;how&#8217; (implementation). In JavaScript the how is duck typing, in Java the how is an interface, but who cares? The important part is the what, and in both if we try to utilize an object which doesn&#8217;t meet our interface then an exception will be raised.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/chrisincambo.wordpress.com/3/"/> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/chrisincambo.wordpress.com/3/"/> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisincambo.wordpress.com/3/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godelicious/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisincambo.wordpress.com/3/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gofacebook/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chrisincambo.wordpress.com/3/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gotwitter/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chrisincambo.wordpress.com/3/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gostumble/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisincambo.wordpress.com/3/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/godigg/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisincambo.wordpress.com/3/"/></a> <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/goreddit/chrisincambo.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisincambo.wordpress.com/3/"/></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisincambo.wordpress.com&amp;blog=4041893&amp;post=3&amp;subd=chrisincambo&amp;ref=&amp;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="">
            <media:title type="html">chrisincambo</media:title>
         </media:content>
      </item>
      <item>
         <title>What happen in DOM?</title>
         <link>http://ungsophy.blogspot.com/2008/06/unexpect-dom-behaviour.html</link>
         <description>I have discovered the unexpected behavior of DOM when I was writing some JavaScript code. The example will illustrate the problem&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;// Create one container and add to two children to it&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;var container1 = document.createElement(&quot;DIV&quot;);&lt;/span&gt; &lt;span style=&quot;font-family:courier new;font-size:85%;&quot;&gt;container1.appendChild(document.createElement(&quot;DIV&quot;));&lt;br /&gt;container1.appendChild(document.createElement(&quot;DIV&quot;));&lt;br /&gt;&lt;br /&gt;//Now I want to the two children in container to document.body&lt;br /&gt;//Apparently, the code in the comment below should work&lt;br /&gt;//document.body.appendChild(container1.childNodes[0]);&lt;br /&gt;//document.body.appendChild(container1.childNodes[1]);&lt;br /&gt;&lt;br /&gt;//Unfortunately, it does not work. When we appended the first child in container1 to&lt;br /&gt;//document.body the browser automatically deleted that child from container. So,&lt;br /&gt;//after the insertion container1 has only one child not two. The code should be like&lt;br /&gt;//the below code:&lt;br /&gt;&lt;br /&gt;document.body.appendChild(container1.childNodes[0]);&lt;br /&gt;document.body.appendChild(container1.childNodes[0]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this help.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-6248469243201389386?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-6248469243201389386</guid>
         <pubDate>Tue, 10 Jun 2008 18:22:00 +0000</pubDate>
      </item>
      <item>
         <title>Fixed position in IE</title>
         <link>http://ungsophy.blogspot.com/2008/03/fixed-position-in-ie.html</link>
         <description>IE does not support position: fixed like Firefox does. But we still have way to make it possible.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;/* set background url to whatever you want and then make it fixed position.*/&lt;br /&gt;body{ &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  background:url(foo1) fixed;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;/* this is the div that you want to be fix */&lt;br /&gt;#my_div{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  position:fixed;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  _position:absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  top:0;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  _top:expression(eval(document.body.scrollTop));&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  left:0;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  margin:0;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  padding:0;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;  background:lime;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;Actually, I got this stuff from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://annevankesteren.nl/test/examples/ie/position-fixed.html&quot;&gt;http://annevankesteren.nl/test/examples/ie/position-fixed.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;Hope this help.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-662115681671487760?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-662115681671487760</guid>
         <pubDate>Tue, 18 Mar 2008 21:46:00 +0000</pubDate>
      </item>
      <item>
         <title>Problems RMagick and RubyGems</title>
         <link>http://ungsophy.blogspot.com/2008/03/problems-rmagick-and-rubygems.html</link>
         <description>It will have some problems if you use try to use RMagick with RubyGem &amp;gt; 0.9.For instance, if you use drawing primitive methods, simply you will see &lt;span style=&quot;font-style:italic;font-weight:bold;&quot;&gt;(no primitives defined):Magick::Draw &lt;/span&gt;error message. To deal with this error, it is not very difficult. You just go to your require statement and change form &lt;span style=&quot;font-weight:bold;font-family:courier new;&quot;&gt;require 'RMagick'&lt;/span&gt; to &lt;span style=&quot;font-weight:bold;font-family:courier new;&quot;&gt;require 'RMagic.rb'. &lt;/span&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;See the difference.&lt;br /&gt;&lt;br /&gt;Hope this help.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-132034446552348634?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-132034446552348634</guid>
         <pubDate>Tue, 18 Mar 2008 20:23:00 +0000</pubDate>
      </item>
      <item>
         <title>RMagick unable to read font n021004l.pfb solution</title>
         <link>http://ungsophy.blogspot.com/2008/03/rmagick-unable-to-read-font-n021004lpfb.html</link>
         <description>&lt;span style=&quot;font-family:arial;&quot;&gt;During my development process, I have encountered one problem with RMagick. RMagick was unable to read font n021004l.pfb. Let assume that you have installed RMagick in &lt;span style=&quot;font-weight:bold;&quot;&gt;C:&amp;#92;Program Files&amp;#92;ImageMagick-6.3.0-Q8&lt;/span&gt;. Then go to folder &lt;span style=&quot;font-weight:bold;&quot;&gt;config&lt;/span&gt; in your RMagick folder and open a file name &lt;span style=&quot;font-weight:bold;&quot;&gt;type.xml&lt;/span&gt; and &lt;span style=&quot;font-style:italic;&quot;&gt;comment &lt;code&gt;&amp;lt;!--&amp;lt;include file=&quot;type-ghostscript.xml&quot; /&amp;gt;--&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this help.&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6020668935883798887-4269245393234030178?l=ungsophy.blogspot.com' alt=''/&gt;&lt;/div&gt;</description>
         <author>Sophy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-6020668935883798887.post-4269245393234030178</guid>
         <pubDate>Fri, 07 Mar 2008 01:11:00 +0000</pubDate>
      </item>
   </channel>
</rss>
<!-- fe5.pipes.sp1.yahoo.com compressed/chunked Mon Feb 13 00:18:30 UTC 2012 -->

