<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chorn Sokun's Weblog</title>
	<atom:link href="http://chornsokun.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chornsokun.wordpress.com</link>
	<description>try { divide and conquer; } catch { keep it simple!; } finally { nothing is impossible; }</description>
	<lastBuildDate>Thu, 05 Nov 2009 10:11:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='chornsokun.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/23c892e38e24abe8bd8ad0c8d763caf2?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Chorn Sokun's Weblog</title>
		<link>http://chornsokun.wordpress.com</link>
	</image>
			<item>
		<title>NHibernate + Mono + MySQL Fly by</title>
		<link>http://chornsokun.wordpress.com/2009/11/05/nhibernate-mono-mysql-fly-by/</link>
		<comments>http://chornsokun.wordpress.com/2009/11/05/nhibernate-mono-mysql-fly-by/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 10:11:28 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Brainstorm]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[NHibernate]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=566</guid>
		<description><![CDATA[I thought about it and I want to see it works for me and there it goes ;)

Ubuntu Karmic
Mono 2.4.3
NHibernate (trunk)
MySql connector-net (trunk)

Sweet :) next rediscover Castle stack on Mono that should be fun let see how much I stress MonoDevelop 2.2
 Tagged: Mono, MySql, NHibernate      <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=566&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I thought about it and I want to see it works for me and there it goes ;)</p>
<ul>
<li>Ubuntu Karmic</li>
<li>Mono 2.4.3</li>
<li>NHibernate (trunk)</li>
<li>MySql connector-net (trunk)</li>
</ul>
<div id="attachment_567" class="wp-caption alignleft" style="width: 710px"><img class="size-full wp-image-567" title="NH1" src="http://chornsokun.files.wordpress.com/2009/11/nh1.png?w=700&#038;h=586" alt="NH1" width="700" height="586" /><p class="wp-caption-text">rebuild the stack for new home ;)</p></div>
<p>Sweet :) next rediscover Castle stack on Mono that should be fun let see how much I stress <a href="http://monodevelop.com/Download/What%27s_new_in_MonoDevelop_2.2" target="_blank">MonoDevelop 2.2</a></p>
 Tagged: Mono, MySql, NHibernate <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/566/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/566/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/566/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/566/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/566/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/566/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/566/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/566/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/566/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/566/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=566&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/11/05/nhibernate-mono-mysql-fly-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>

		<media:content url="http://chornsokun.files.wordpress.com/2009/11/nh1.png" medium="image">
			<media:title type="html">NH1</media:title>
		</media:content>
	</item>
		<item>
		<title>Storm the Castle in Action</title>
		<link>http://chornsokun.wordpress.com/2009/10/23/storm-the-castle-in-action/</link>
		<comments>http://chornsokun.wordpress.com/2009/10/23/storm-the-castle-in-action/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 10:50:35 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Castle]]></category>
		<category><![CDATA[Castle.ActiveRecord]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[Screen]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=557</guid>
		<description><![CDATA[felt bore today and decided to tune into studio and record some stuff :D hope you enjoy it.

I know, I know the quality is bad but I don&#8217;t know I am not do much with youtube so it the luck I get :) BUT as always orginal video can be download here.
Source code: http://storm-the-castle.googlecode.com/svn/tags/barcamppp
 Tagged: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=557&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>felt bore today and decided to tune into studio and record some stuff :D hope you enjoy it.</p>
<p><span style="text-align:center; display: block;"><a href="http://chornsokun.wordpress.com/2009/10/23/storm-the-castle-in-action/"><img src="http://img.youtube.com/vi/Tzj8sNUfANo/2.jpg" alt="" /></a></span></p>
<p>I know, I know the quality is bad but I don&#8217;t know I am not do much with youtube so it the luck I get :) BUT as always orginal video can be <a href="http://joljet.net/storm-the-castle-work-out.mp4">download here</a>.</p>
<p>Source code: <a href="http://storm-the-castle.googlecode.com/svn/tags/barcamppp">http://storm-the-castle.googlecode.com/svn/tags/barcamppp</a></p>
 Tagged: Screen <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/557/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=557&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/10/23/storm-the-castle-in-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://joljet.net/storm-the-castle-work-out.mp4" length="12995519" type="video/mp4" />
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/Tzj8sNUfANo/2.jpg" medium="image" />
	</item>
		<item>
		<title>Gdo, Gazetteer Database Online</title>
		<link>http://chornsokun.wordpress.com/2009/10/02/gdo-gazetteer-database-online/</link>
		<comments>http://chornsokun.wordpress.com/2009/10/02/gdo-gazetteer-database-online/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 18:18:19 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Rumor]]></category>
		<category><![CDATA[Cambodia]]></category>
		<category><![CDATA[Gazetteer]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=538</guid>
		<description><![CDATA[There are 3/4 variants of the Cambodia Gazetteer after UNTAC created the list; now it time to put this mess to rest one and for all.
Ministry of Interior, Department of Local Administration currently setup a task force to reconsolidates the master list and make it an only office Gazetteer.
Now my colleague expected to write up a forward [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=538&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignleft size-full wp-image-539" title="Gazetteer Database Online" src="http://chornsokun.files.wordpress.com/2009/10/gazetteer.png?w=487&#038;h=575" alt="Gazetteer Database Online" width="487" height="575" />There are 3/4 variants of the Cambodia Gazetteer after UNTAC created the list; now it time to put this mess to rest one and for all.</p>
<p>Ministry of Interior, Department of Local Administration currently setup a task force to reconsolidates the master list and make it an only office Gazetteer.</p>
<p>Now my colleague expected to write up a forward document about this project; which I&#8217;m not going to discuss here.</p>
<p>What you should know in the near future there is only one set of Cambodia Gazetteer and you can access it online absolutely free, so stay tune &#8230;</p>
<p>And you don&#8217;t have to guess how I built or when it goes live since I had 3 projects developed &amp; maintenance in parallel no doubt I no longer had time to enjoy playing JXII :(</p>
<p><strong><span style="text-decoration:underline;">Feature Highlight</span></strong>:</p>
<p>- Online browsing Province, District, Commune, Village meta data</p>
<p>- Province, District, Commune Map (produced by external consultant)</p>
<p>- Download Gazetteer data in Excel format for offline use.</p>
<p>I love this job ;)</p>
 Tagged: Cambodia, Gazetteer <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/538/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=538&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/10/02/gdo-gazetteer-database-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>

		<media:content url="http://chornsokun.files.wordpress.com/2009/10/gazetteer.png" medium="image">
			<media:title type="html">Gazetteer Database Online</media:title>
		</media:content>
	</item>
		<item>
		<title>Use jQuery to catch and display MR AJAX errors</title>
		<link>http://chornsokun.wordpress.com/2009/10/02/use-jquery-to-catch-and-display-mr-ajax-errors/</link>
		<comments>http://chornsokun.wordpress.com/2009/10/02/use-jquery-to-catch-and-display-mr-ajax-errors/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 17:58:56 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[MonoRail]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=541</guid>
		<description><![CDATA[This post influenced Dave Ward&#8217;s post to replicate the behavior that he discussed within MonoRail application.  To mimic this behavior I created a method call RenderJsonError(Exception ex) inside my base controller (I want to reuse this method)

public abstract class AbstractBaseController: ARSmartDispatcherController{
   private void RenderJsonError(Exception ex){
      CancelLayout();
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=541&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This post influenced <a href="http://encosia.com/2009/03/04/use-jquery-to-catch-and-display-aspnet-ajax-service-errors/" target="_blank">Dave Ward&#8217;s post</a> to replicate the behavior that he discussed within MonoRail application.  To mimic this behavior I created a method call RenderJsonError(Exception ex) inside my base controller (I want to reuse this method)</p>
<pre class="brush: csharp;">
public abstract class AbstractBaseController: ARSmartDispatcherController{
   private void RenderJsonError(Exception ex){
      CancelLayout();
      Response.StatusCode = 500;
      Response.ContentType = &quot;application/json; charset=utf-8&quot;;

      // I love this Framework :)
      var json = Context.Services.JSONSerializer.Serialize(
         new ErrorObject(){
            Message = e.Message,
            StackTrace = e.StackTrace
         });

      RenderText(json);
   }
}
</pre>
<p>From the code above look like I need to create a dummy DTO class ErrorObject and hand it over to JSONSerializer service instead of doing string escape/string concat myself :) MR use <em>Newtonsoft.Json.dll</em> behind the scene.</p>
<pre class="brush: csharp;">
public abstract class AbstractBaseController: ARSmartDispatcherController{
  ....
  internal class ErrorObject{
     public string Message { get; set; }
     public string StackTrace { get; set; }
  }
}
</pre>
<p>Now let through some booms back to client</p>
<pre class="brush: csharp;">
public class HomeController: AbstractBaseController{
   public void Index(){
      try{
          throw new Exception(&quot;Boom ! boom !&quot;);
      }catch(Exception ex){
          RenderJsonError(ex);
      }
   }
}
</pre>
<p>That work ! however if you don&#8217;t want to deal with try{..} catch {..} then combine this technique with RescueAttribute describe in my <a href="http://chornsokun.wordpress.com/2009/10/01/monorail-irescuecontroller-handle-unexpected-exception/">previous post</a>.</p>
 Tagged: jQuery, JSON <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/541/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=541&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/10/02/use-jquery-to-catch-and-display-mr-ajax-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>
	</item>
		<item>
		<title>MonoRail, IRescueController Handle Unexpected Exception</title>
		<link>http://chornsokun.wordpress.com/2009/10/01/monorail-irescuecontroller-handle-unexpected-exception/</link>
		<comments>http://chornsokun.wordpress.com/2009/10/01/monorail-irescuecontroller-handle-unexpected-exception/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 03:38:49 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Castle]]></category>
		<category><![CDATA[MonoRail]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[IRescueController]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=531</guid>
		<description><![CDATA[By default you can intercept unexpected exceptional error occur in MonoRail you can opt to render a specific view from Views/Rescues folder or let MR pick standard one such as 404 page not found &#8230;
How how about you want to log the exception then you need to build a custom controller class that implement IRescueController [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=531&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>By default you can intercept unexpected exceptional error occur in MonoRail you can opt to render a specific view from Views/Rescues folder or let MR pick standard one such as 404 page not found &#8230;</p>
<p>How how about you want to log the exception then you need to build a custom controller class that implement IRescueController interface just like this:</p>
<pre class="brush: csharp;">
public class RuntimeExceptionController : SmartDispatcherController, IRescueController
{
  public void Rescue(Exception exception, IController controller, IControllerContext controllerContext)
  {
    // ... log via log4net ...
    // ... render &amp; send error back home :) whatever you find helpful
  }
}

// usage: simple
[Rescue(typeof(RuntimeExceptionController))]
public class HomeController: SmartDispatcherController{
  public void Index(){
     throw new Exception(&quot;Boom !&quot;);
  }
}
</pre>
 Tagged: IRescueController <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/531/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=531&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/10/01/monorail-irescuecontroller-handle-unexpected-exception/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>
	</item>
		<item>
		<title>Khmer Localization with .NET</title>
		<link>http://chornsokun.wordpress.com/2009/10/01/khmer-localization-with-net/</link>
		<comments>http://chornsokun.wordpress.com/2009/10/01/khmer-localization-with-net/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 02:10:24 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Localization]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=527</guid>
		<description><![CDATA[Localization in .NET doesn&#8217;t seem to solve a lot of problem in theory but I get no luck to get it work, although I built a custom Culture and having the resource file embedded in the assembly it just WON&#8217;T WORK !
After look around for solution I decided to give up and cheat a bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=527&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Localization in .NET doesn&#8217;t seem to solve a lot of problem in theory but I get no luck to get it work, although I built a custom Culture and having the resource file embedded in the assembly it just WON&#8217;T WORK !</p>
<p>After look around for solution I decided to give up and cheat a bit building localization engine from scratch is not too difficult but I tend not to spend my time on this yet.</p>
<p>So here is my way to have bilingual UI (Khmer &amp; English)<br />
<img class="alignnone size-full wp-image-528" title="resource" src="http://chornsokun.files.wordpress.com/2009/09/resource.jpg?w=220&#038;h=68" alt="resource" width="220" height="68" /></p>
<p>by faking treat fr-FR == km-KH and that work !</p>
<p>Never die with your tool, exercise your brain ;)</p>
 Tagged: ASP.NET, Localization <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/527/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=527&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/10/01/khmer-localization-with-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>

		<media:content url="http://chornsokun.files.wordpress.com/2009/09/resource.jpg" medium="image">
			<media:title type="html">resource</media:title>
		</media:content>
	</item>
		<item>
		<title>Rediscover WinForm, landing Alien base?</title>
		<link>http://chornsokun.wordpress.com/2009/09/29/rediscover-winform-landing-alien-base/</link>
		<comments>http://chornsokun.wordpress.com/2009/09/29/rediscover-winform-landing-alien-base/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 15:50:08 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Binding]]></category>
		<category><![CDATA[Cascade]]></category>
		<category><![CDATA[ComboBox]]></category>
		<category><![CDATA[WinForm]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=519</guid>
		<description><![CDATA[Simple scenario each time a province change, district, commune &#38; village will reset, not a big deal for me now a day to have this scenario on the web application but hey look it WinForm :( let see

I started from Form Load event cbProvince combobox get binded then wire cbProvince with SelectedIndexChanged event handler to load [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=519&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Simple scenario each time a province change, district, commune &amp; village will reset, not a big deal for me now a day to have this scenario on the web application but hey look it WinForm :( let see</p>
<p><img class="size-full wp-image-520" title="Cascaded ComboBox Data Binding" src="http://chornsokun.files.wordpress.com/2009/09/combobox.jpg" /></p>
<p>I started from Form Load event cbProvince combobox get binded then wire cbProvince with SelectedIndexChanged event handler to load list of district into cbDistrict combobox and so on the code look more or less like this</p>
<pre class="brush: csharp;">

public void Form_Load(object sender, System.EventArgs e){
  // binding cbProvince
}

public void cbProvince_SelectedIndexChanged(object sender, EventArgs e){
  //... binding the cbDistrict ComboBox using current selected value from cbProvince
}

public void cbDistrict_SelectedIndexChanged(object sender, EventArgs e){
  //... binding the cbCommune ComboBox using current selected value from cbDistrict
}
</pre>
<p>Sound good all event wired hit F5 to try out. Guess what happen? it slow &amp; AND finally throw an exception !!! but how? years passed and this behavior didn&#8217;t change a bit</p>
<pre class="brush: csharp;">
// flag state
private bool formReady = false;
public void Form_Load(object sender, System.EventArgs e){
  // binding cbProvince
  formReady = true;
}

public void cbProvince_SelectedIndexChanged(object sender, EventArgs e){
  if(!formReady) return; // this is the trick don't fire the event
  formReady = false;
  //... binding the cbDistrict ComboBox using current selected value from cbProvince
  formReady = true;
}
public void cbDistrict_SelectedIndexChanged(object sender, EventArgs e){
  if(!formReady) return; // this is the trick don't fire the event
  formReady = false;
  //... binding the cbCommune ComboBox using current selected value from cbDistrict
  formReady = true;
}
</pre>
 Tagged: .NET, Binding, Cascade, ComboBox, WinForm <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/519/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/519/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/519/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=519&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/09/29/rediscover-winform-landing-alien-base/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>

		<media:content url="http://chornsokun.files.wordpress.com/2009/09/combobox.jpg" medium="image">
			<media:title type="html">Cascaded ComboBox Data Binding</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery.selectboxes removeOption()</title>
		<link>http://chornsokun.wordpress.com/2009/07/28/jquery-selectboxes-removeoption/</link>
		<comments>http://chornsokun.wordpress.com/2009/07/28/jquery-selectboxes-removeoption/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 08:58:46 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[jquery; selectboxes]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=506</guid>
		<description><![CDATA[Base on the doc page located here http://www.texotela.co.uk/code/jquery/select/ if I wanted to remove (clear) items from a select box all I need to do is call:

$('#select_box').removeOption(/./);

But in my case I had a select box like this:

&#60;select name=&#34;select_box&#34; id=&#34;select_box&#34;&#62;
    &#60;option value=&#34;&#34;&#62;N/A&#60;/option&#62;
    &#60;option value=&#34;1&#34;&#62;Low&#60;/option&#62;
    &#60;option value=&#34;2&#34;&#62;Meduim&#60;/option&#62;
   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=506&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Base on the doc page located here <a href="http://www.texotela.co.uk/code/jquery/select/">http://www.texotela.co.uk/code/jquery/select/</a> if I wanted to remove (clear) items from a select box all I need to do is call:</p>
<pre class="brush: xml;">
$('#select_box').removeOption(/./);
</pre>
<p>But in my case I had a select box like this:</p>
<pre class="brush: xml;">
&lt;select name=&quot;select_box&quot; id=&quot;select_box&quot;&gt;
    &lt;option value=&quot;&quot;&gt;N/A&lt;/option&gt;
    &lt;option value=&quot;1&quot;&gt;Low&lt;/option&gt;
    &lt;option value=&quot;2&quot;&gt;Meduim&lt;/option&gt;
    &lt;option value=&quot;3&quot;&gt;High&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>and of cause the syntax specified above doesn&#8217;t do the trick; this is how I fix it:</p>
<pre class="brush: xml;">
$('#select_box').removeOption(/(.?)/);
</pre>
<p>Was that how it should be done? oh ! by the way the shorter way</p>
<pre class="brush: xml;">
$('#select_box').empty();
</pre>
 Tagged: jquery; selectboxes <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/506/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=506&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/07/28/jquery-selectboxes-removeoption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>
	</item>
		<item>
		<title>Weekend =&gt; app.goLive ;)</title>
		<link>http://chornsokun.wordpress.com/2009/07/24/weekend-app-golive/</link>
		<comments>http://chornsokun.wordpress.com/2009/07/24/weekend-app-golive/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 08:59:21 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[PID]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=496</guid>
		<description><![CDATA[Early this month I got into a busy schedule in order to release my new database application. I needed to run &#38; check a final test, wrote up manual and do some paper work to invite my colleague across the country (2 staffs from each province X 24) to attend a 3 days training workshop [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=496&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Early this month I got into a busy schedule in order to release my new database application. I needed to run &amp; check a final test, wrote up manual and do some paper work to invite my colleague across the country (2 staffs from each province X 24) to attend a 3 days training workshop in total we get approximately 48 staffs which is too much for an IT training so we split it into 2 batches 12 provinces each.</p>
<p>In term of the actual database I allocated 2 days and for the first day of the training I leave it for general IT update lesson which include Khmer Unicode orientat<em>ion</em><em> </em><em>half morning,</em> and for that session alone I am very lucky to have <strong>Mr. CHEA Sok Huor</strong> a <em>Country Project Leader</em> from <a href="http://www.pancambodia.info" target="_blank">PAN</a> and his colleague came in for help. Without them I wouldn&#8217;t know where to get such precise Khmer Unicode Orientation somewhere else, so thank you from the deepest of my heart.</p>
<p>Oh! Talking about helping there is another gentle who I owe him as well, that gentle is <strong>Mr. Tuy Pheap</strong> my long colleague. We share room in the last 3 years before he moved on to his current job and come back to seat behind my back :) &#8220;Again :D&#8221;.  I disturb him from time to time :D policing what my system do against his employer needs (the World Bank) not only that he also help me correct my Khmer Translation + Spelling :) and this phrase &#8220;ខ្ញុំយល់ហើយ!!!&#8221; for a button which in English say &#8220;I Understand&#8221; was his innovation :) let me tell you about this joke</p>
<blockquote><p>In our new application if there are any problems or errors detected a list of detail explanation will show up ( jQuery modal )  what I originally did was to have user click on &#8220;Ok&#8221; button to close the message. But without anything special user might just click &#8220;Ok&#8221; and go on &#8230; that not fun. So we came up with an idea instead of naming the button &#8220;Ok&#8221; we called it &#8220;I Understand&#8221; :))</p>
<p>And as a side effect during the training we forget to translate a few messages so default message showed. Since the user  do not read English and he dare not click on the button to close the message :(</p></blockquote>
<p>I am glad with the result as it turn out and thanks to all the backend libraries that I used without them I wouldn&#8217;t know how much I would need to damage my brain cells to get this job done :)</p>
<p>What I used?</p>
<ul>
<li>NHibernate</li>
<li>Castle (MonoRail, ActiveRecord)</li>
<li>Rhino-Tool (Rhino.Security, Rhino.Common)</li>
<li>Oh ! ASP.NET for sure :) but I a brail devil don&#8217;t blame me for not      using webform</li>
<li>Log4net</li>
<li>jQuery &amp; it plug-in(s)</li>
</ul>
<p>Challenges:</p>
<ul>
<li>For the past 5 years most of them get use to do data entry in      desktop mode (VB6)</li>
<li>Some of them using the Internet for the first time; right this is      (1==1).</li>
<li>The amount of data that we collect had increase 1.5X</li>
<li>More restriction in term of data modification &#8211; they used to have      full control over there data and that cause me alot of headache over the      past years.</li>
</ul>
<p>At the end of training session I got a request to setup a demo URL (<a href="http://db.ncdd.gov.kh/pid-train" target="_blank">http://db.ncdd.gov.kh/pid-train</a>) so that when participant get back to their duty province they can teach their colleague, by doing this I get a few additional feedback on how to improve the process of data entry as well as knowing how user interact with the application.</p>
<p>For sure: &#8220;No one is perfect&#8221; and &#8220;No software ever release bug free&#8221; as long as it could do it main job properly I would call it V1.</p>
<p>Now the weekend is coming I had to switch on actual URL and for that mean I had to copy a folder change connection string to get another URL up and running KOOL stuff ;)</p>
 Tagged: PID <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/496/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=496&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/07/24/weekend-app-golive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP date diff</title>
		<link>http://chornsokun.wordpress.com/2009/07/04/php-date-diff/</link>
		<comments>http://chornsokun.wordpress.com/2009/07/04/php-date-diff/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 04:37:00 +0000</pubDate>
		<dc:creator>Chorn Sokun</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://chornsokun.wordpress.com/?p=492</guid>
		<description><![CDATA[I call out for an excuse for not practicing PHP enough recent year; with just a simple date_diff could knock me out :) not to open my complain of having different version of PHP to check before using a function(s) I got a request from a friend to help workout how many days from two [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=492&subd=chornsokun&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I call out for an excuse for not practicing PHP enough recent year; with just a simple date_diff could knock me out :) not to open my complain of having different version of PHP to check before using a function(s) I got a request from a friend to help workout how many days from two given date.</p>
<p>Now if I have two date string (it is what we get from form post right?)</p>
<pre class="brush: php;">
// fixed format as I don't want to deal with complicate of different world format :(
$day1 = &quot;26/03/2009&quot;;
$day2 = &quot;28/03/2009&quot;;
// now I need to know how many days does it take from day1 to day2
// PHP 4.x; ignore my out of date PHP skill this is how I did it
$break_day1_apart = explode('/', $day1);
$break_day2_apart = explode('/', $day2);
$day1_number_form = $break_day1_apart[2].$break_day1_apart[1].$break_day1_apart[0];
$day2_number_form = $break_day2_apart[2].$break_day2_apart[1].$break_day2_apart[0];

$day_diff = abs((int)$day2_number_form - (int)$day1_number_form);

// and it should work by theory
echo $day_diff; 
</pre>
<p>Suck ! what would you do instead?</pre>
 Tagged: PHP <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chornsokun.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chornsokun.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chornsokun.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chornsokun.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chornsokun.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chornsokun.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chornsokun.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chornsokun.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chornsokun.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chornsokun.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chornsokun.wordpress.com&blog=3780464&post=492&subd=chornsokun&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chornsokun.wordpress.com/2009/07/04/php-date-diff/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc60b386b64b2b05c043d7676dde360e?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">c.sokun</media:title>
		</media:content>
	</item>
	</channel>
</rss>