Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

Archive for the ‘Brainstorm’ Category

NHibernate + Mono + MySQL Fly by

with 7 comments

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)

rebuild the stack for new home ;)

Sweet :) next rediscover Castle stack on Mono that should be fun let see how much I stress MonoDevelop 2.2

Written by Chorn Sokun

November 5, 2009 at 5:11 pm

Posted in Brainstorm, OSS, Ubuntu

Tagged with , ,

Myth of Cambodia Geography Identification Code

with one comment

How many of you are familiar with Cambodia Geography Identification code. Do you know the myth behind it code assignment? Well, it’s all started like this:

  • There are 4 levels of administration
    • Province
      • District
        • Commune
          • Village
  • Each level add up 2 digits begin with Province 2 digits
  • Identification code are stored in numberic form (Integer)

That mean valid village code length bewteen 7 and 8 for example code 24020406 would identified as:

  • Village Name = Ou Ressey Loeu (24020406)
  • In Commune  = Ou Andoung (240204)
  • In District = Sala Krau (2402)
  • In Province = Pailin (24)

Now suppose these Geography represent in 4 separate tables (SQL Server for ghost shack!) 


By knowing a village code (eg:  24020406) I want to extract province code and I want the quickest way possible any thought? Oh ! there will be a reward for best answer.

Written by Chorn Sokun

April 28, 2009 at 5:27 pm

Rhino-Tools, Sample Applications

with one comment

It had been quiet a while since I tried to allocate some time to get in deep with Rhino-Tools and my previous attempt was not fruitful. However I had learn that most of the problem that prevent me to run the sample project with the latest build (local build) because there is a mismatch assembly used.

Minimum Assembly Reference

Minimum Assembly Reference

The typical Rhino-Tools sample applications always make reference to assembly files stored in the SharedLibs in each sample applications’ folder and after every successful build of Rhino-Tools I always want to run the sample application again to see if it break anything. What I usually do is to copy assembly file from the ..\Build\net-2.0\debug & ..\SharedLibs\Castle folder to SharedLibs located in individual sample application folder.

This step is such a pain an annoying. I want to setup a system which I could later on forget about it. So to fix the problem one and for all is to reference needed assembly from it original location ..\rhino-tools\SharedLibs\Castle and ..\rhino-tools\build\net-2.0\debug this way we do not waste disk space for storing the same assemly files and since it is a sample project it doesn’t hurt a ship by doing so.

However I still recommend to copy the needed assembly to private folder and reference from there if you are working with your real world application.

Until this solution is adopted I need to add svn ignore roles SharedLibs in each sample applications folder.

Written by Chorn Sokun

July 24, 2008 at 11:58 pm


with 3 comments

Ayende’s Rhino-Tools become the most wanted library for my next project, consuming open source library with lack of walkthrough sample/enough test suite is always a painful experience “at the beginning”. It makes me stress for sometime as I can’t find any peer near by to share the experience with and yeah I tell you if you’ve got weak heart and usually depend on external person to walk you through the percentage of success is very low.

“No Pain, No Gain”, although the OSS’s troop are miles aways I’ll keep standing still until my last breath and hopefully, hopefully the support troop would come along.

So on the next day(s) I found the following post appear on the net which help me stand again.

Now I know how to spend my next weekend, thanks to all the good works and the sharing.

Written by Chorn Sokun

June 3, 2008 at 10:47 am

PHP Suck ?!

leave a comment »

It came as a surprise to read half of Jeff Atwood’s post title, PHP Sucks, But It Doesn’t Matter. But I truth this guy he always had a reason to write about these thing and I am totally agreed when he says:

Building a compelling application is far more important than choice of language.

Sufficiently talented coders can write great applications in terrible languages, too.

It’s a painful lesson, but an important one.

Written by Chorn Sokun

May 22, 2008 at 3:54 am

Posted in Brainstorm

Tagged with

I give you the power –

leave a comment »

I had spend the rest of my weekend playing around with DokuWiki by coding a tiny discussion feature. The purpose if to discover and use as much as utility functions that DokuWiki had, very interesting indeed.

Features: (implemented)

  • It allow wiki owner (the one who create content) to click on an action button in order to enable/disable comment on his/her page.
  • It come with tiny security feature captcha prevent from post back attack.
  • It had client side validation using jquery
  • Remember name, e-mail, url of the user posting comment by storing their info in a protected cookie – sharing dokuwiki blowfish salt key.
  • Send notify mail to content author when visitor post comments.

TODO: This will be this weekend assignment …

  • Take advantage of existing caching function to cache comments reducing time to load comment from the database.
  • Apply more security – random key protecting captcha field.
  • Enable geshi coding in comments – this allow visitor to make comment with code snippet.
  • Comment & Voting – may be that a great idea ;)

In software development you should release it when it is good enough, this give a chance to get feedback from the users. Alrite, I just upload the modification code to run live in go and make some comments.

Until next monday I will tell you where my head …

Written by Chorn Sokun

July 30, 2007 at 10:11 am

Posted in Brainstorm

When Open Source Culture got into my brain…

with one comment

From day to day I got new knowledge from the open source project as well as the open mind of the guru out there “Cyberspace”. I don’t even have a chance to see them in personal, but I do appreciate their brilliant contribution to the people knowledge all over the world.

In line with this I would like to extend the culture of sharing knowledge to my citizenship, but I will do it a little bit different. Instead of giving them a Hello World kind of thing tutorial I will try to bring concept to into their brain and let them growth the way I do.

I will bring my imagination to live through a project call “a-Kdam“, which is currently under-development.

I will announce the URL one the website is up and running.
Until then …

Written by Chorn Sokun

April 9, 2007 at 4:45 pm