tag:blogger.com,1999:blog-357332742009-03-03T01:06:23.823+07:00Chorn Sokun!!! err-detected !!! show.detail(this, bug); plan.attack(this, bug);Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comBlogger66125tag:blogger.com,1999:blog-35733274.post-24870287715993448582008-05-21T15:03:00.001+07:002008-05-21T15:05:02.605+07:00blog moveI decided to abandon blogger and become a press, if you want to keep up with me bookmark my new blog url http://chornsokun.wordpress.com<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-2487028771599344858?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-11900282414537945862008-05-02T13:42:00.002+07:002008-05-02T14:16:30.946+07:00the most amazing dreamRecently I have been in the most busy period where I had to deliver various tasks simultaneously , which hurt my brain a bit before I finally manage it. People said don't think to much at day time or you will dream about it. Lucky that I don't think about something dirty otherwise I will regret it when I wake up :)) "Well, unless a few hit from the wife".<br /><br />I normally always forget my dream once I awake but this time I tried not to forget and I love to keep this memory.<br /><br />There are two dream actually happen in two separate nights one after another.<br /><br /><span style="font-weight: bold;">Dream #1 : </span>I know it hard to describe in text version but I'll give it a try ;)<br />I was dealing with a computer issue (programming) then I feel there is something wrong my computer run slower than usual; I "in the dream" believed that I got virus and no matter how I tried I can't remove the virus; now the fun part it is in the dream world right? anything is possible so this is how the dream go on. Suddenly Bill Gate (Oh Yeah I did) walk in and he touch my computer with the fastest keyboard type I've ever seen. He booted up my computer but that not MS Windows I ever use it is not Linux either; the software is amazing It allow us "Me &amp; Bill Gate" to view and detected the virus virtually; we can see how the virus attack just like a tank destroy houses' block. So the next thing Bill did he screening for the virus movement (when the virus move it show red spots move in group a few red spot at a time) the way he remove the virus was drag mouse to draw a wall in front of the virus direction so one the virus hit the wall it disappear (clean). I asked Bill how you did that? I hacked, he whispered. But how? I asked then he told me there is a secret code in hack with a list of key stroke :)) I hope this true although I don't remember the code he told me.<br /><br />Even thought it a dream; if computer security product ever invent this way I would be fun.<br />Instead of watching list of file scan rotating I virtual see how the virus movement and be able to stop it my hand :))<br /><br /><span style="font-weight: bold;">Dream #2:</span> Lucky that not about computer<br />I got visited from a long lost friend; Well you guess he/she :))<br />I wish that night would last longer, but we can't live in the dream world forever.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-1190028241453794586?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-42907627374426201862008-04-23T15:22:00.007+07:002008-04-23T16:22:41.262+07:00Many to many lazzziiiNHibernate's rock I scratched my head for a few hours looking at this code<br /><blockquote>DetachedCriteria filter = DetachedCriteria.For(typeof(Project))<br />.Add(Expression.Eq("ID", pid))<br />.SetProjection(Projections.Property("Type"));<br /><br />DetachedCriteria q = DetachedCriteria.For(typeof(List_Output), "op")<br />.CreateCriteria("ProjectTypes")<br />.Add(Subqueries.Exists(filter));<br /><br />return q.GetExecutableCriteria(<br /> holder.CreateSession(typeof(List_Output))<br /> ).List<list_output>();<br /></list_output></blockquote>Wonder why I got so many sql call to the server? the domain objects in the discussion context are <span style="font-weight: bold;">Project </span>has a <span style="font-weight: bold;">Type </span>and base on selected <span style="font-weight: bold;">Type </span>a project can choices a bunch of Outputs.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BRGf4aMx5dE/SA74iaXXs1I/AAAAAAAABDI/Md6Vu1ySPiI/s1600-h/diagram.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_BRGf4aMx5dE/SA74iaXXs1I/AAAAAAAABDI/Md6Vu1ySPiI/s400/diagram.jpg" alt="" id="BLOGGER_PHOTO_ID_5192360690481345362" border="0" /></a>So <span style="font-weight: bold;">Project </span>is belong to a <span style="font-weight: bold;">Type </span>[One-to-Many], and <span style="font-weight: bold;">Type </span>has many <span style="font-weight: bold;">Outputs </span>where <span style="font-weight: bold;">Output </span>belong to Many <span style="font-weight: bold;">Types </span>[Many-to-Many].<br /><br />What I found and fix is Lazzzzzzzziiiiiiiiiiiiiiii :))<br />I forgot to tell Type to load Outputs in a Lazy way and vise versa once that done I got only one YEAH ! I mean ONE sql call to the server to get what I asked for instead of 2 + N (where N is number of relevant Outputs in a Type)<br /><br />Thanks to DetachedCriteria &amp; the Laziness until next time today magic word is "Lazy = true"<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-4290762737442620186?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-44582377691278617672008-04-18T15:48:00.003+07:002008-04-18T16:01:19.835+07:00Woh Woh storedprocedure no more ...Read the title and want to know how to do that? come with me hacking the <a href="http://svn.castleproject.org:8080/svn/castle/trunk">Castle code base</a> or to be accurate hack <a href="https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk">NHibernate code base</a>, what you need to bring along? not much but a <a href="http://tortoisesvn.tigris.org">SubVersion</a>, <a href="http://nant.sourceforge.net">NAnt</a>, <a href="http://www.mbunit.com">MbUnit </a>and <a href="http://www.nunit.org">NUnit </a>that sound enough ;)<br /><br />Enjoy plug &amp; play your database and let the Jedi rise<br />Happy Friday everyone !<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-4458237769127861767?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-59262753262210353862008-04-06T17:39:00.003+07:002008-04-06T17:48:51.539+07:00... and so there is a responseAs I sad I love to see thing happen without me touching the code base :)) and how about the full fill my wish list?<br /><ul><li><a href="http://brainstorm.ubuntu.com/idea/4846/">MonoDevelop 1.0 go for Hardy</a> (done)</li></ul>Oh ! how about eclipse &amp; it partner PDT? Vote it up so we "eclipse fan" can have it goes for Hardy as well ;)<br /><ul><li><a href="http://brainstorm.ubuntu.com/idea/1265/">Make Eclipse Priority</a></li><li><a id="title-5884" class="itemtitle itemundeleted" href="http://brainstorm.ubuntu.com/idea/5884/">Add PDT-Eclipse (PHP-Support)</a></li></ul>Last but it the beast <a id="title-6088" class="itemtitle itemundeleted" href="http://brainstorm.ubuntu.com/idea/6088/">Ship Mono.19 with Ubuntu 8.04</a> go vote for it if we're true friend.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-5926275326221035386?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-70973577548551861762008-04-06T10:32:00.002+07:002008-04-06T10:35:16.861+07:00Encoded messageRob Conery the man behind "SubSonic" a blogger like to post his <a href="http://blog.wekeroad.com/blog/thoughts-for-a-friday/">though in a hex</a>; wonder what on his mind? try this online hex converter http://www.dolcevie.com/js/converter.html<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-7097357754855186176?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-49291874477148631682008-04-03T00:33:00.004+07:002008-04-03T00:51:54.362+07:00Ubuntu 8.04 Hardy Heron - that for my momIf you follow my previous post you might know what I've been doing so far, well i was messing around with Ubuntu 8.04 and if you ask me how was that? I would say "Yeah, It is an OS for my mom". How about you buddi? you asked. See the problem is Ubuntu 8.04 was developed for my mom it wasn't me ! :( that kind of sad isn't it?<br /><br />Now let me express what make me feel this way, I guess you know who I am right? Oh ! com'on I knew you did hahaha I write VB, PHP, Java &amp; C# tool I am expected to see in Hardy Heron<br /><ul><li>Eclipse 3.3 (sorry we got 3.2 )<br /></li><li>Mono 1.9 (hm hmm, wait and see u might have it next release cycle)<br /></li><li>MonoDevelop 1.0 (oh, isn't beta 3 work great for ya ?!)<br /></li></ul>the Ubuntu guy love to play with giant snake therefore all they care about is Python.<br /><br />After all I might have to do I miss catch for 8.04 cuz my mom don't use any computer :(<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-4929187447714863168?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-11440003925316213792008-03-09T12:13:00.005+07:002008-03-23T18:11:25.645+07:00Ubuntu 8.04 Hardy Heron Alpha 6Khmer Script Line break solved see screenshot bellow<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_BRGf4aMx5dE/R9Nyb44N6kI/AAAAAAAAAsM/ucpNSDA3J0U/s1600-h/khmer_script_solved_in_hard.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_BRGf4aMx5dE/R9Nyb44N6kI/AAAAAAAAAsM/ucpNSDA3J0U/s400/khmer_script_solved_in_hard.jpg" alt="" id="BLOGGER_PHOTO_ID_5175606220229044802" border="0" /></a>However I am not sure what was wrong with a few character which can't render properly.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BRGf4aMx5dE/R9Nyyo4N6lI/AAAAAAAAAsU/9RB0ukrZ6jE/s1600-h/missing_script.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_BRGf4aMx5dE/R9Nyyo4N6lI/AAAAAAAAAsU/9RB0ukrZ6jE/s400/missing_script.jpg" alt="" id="BLOGGER_PHOTO_ID_5175606611071068754" border="0" /></a>Any thought?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-1144000392531621379?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-65321922581173320392008-03-07T08:43:00.003+07:002008-03-07T08:52:32.597+07:00IP Switch WS_FTP die dieI always been a fan of WS_FTP up until last night I just can't get on with that freaking slow file transfer. I just told myself to blame ISP for not taken care of FTP connection however after tried a few different ISP connection I start to belive that was not the case. I must had to do something about it or else I better shot myself in the foot. So here come the decision:<br /><br />Get rid of WS_FTP install CuteFTP from <a href="http://www.cuteftp.com">GlobalSCAPE </a>and voilá all the pain gone thanks Budha !<br />Last word die die die WS_FTP.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-6532192258117332039?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-9177641455493381132008-03-05T14:37:00.006+07:002008-03-05T15:02:49.646+07:00Tabify why I never care?I thought I was one of the coder who obey coding standard, but hell no until <a href="http://support.castleproject.org//browse/COMP-51?page=comments#action_12558">a guy told me I wasn't</a>. That kind of make me feel like a fool :))<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BRGf4aMx5dE/R85PiiYKDrI/AAAAAAAAArk/gER6B8X20-M/s1600-h/nake-eyes.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_BRGf4aMx5dE/R85PiiYKDrI/AAAAAAAAArk/gER6B8X20-M/s400/nake-eyes.jpg" alt="" id="BLOGGER_PHOTO_ID_5174160476657553074" border="0" /></a>Well, this is how I get around:<br /><ul><li>Tools -> Options -> Text Editor -> C# -> Tabs (Hell no ! "Insert spaces" was selected)</li><li>select "Keep tabs"</li></ul>Alright let see will this work "Tabify"<br /><ul><li>Edit -> Advanced -> View White space (Crtl + R, Crtl + W)</li><li>Now reformat your code [ Ctrl + A; Ctrl + K, Ctrl + F]<br /></li></ul><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_BRGf4aMx5dE/R85Q9iYKDsI/AAAAAAAAArs/qLxfa_m43C4/s1600-h/eye-open.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_BRGf4aMx5dE/R85Q9iYKDsI/AAAAAAAAArs/qLxfa_m43C4/s400/eye-open.jpg" alt="" id="BLOGGER_PHOTO_ID_5174162040025648834" border="0" /></a>Is that "Tabify" you talking about <a href="http://www.kenegozi.com/blog/">Ken </a>;)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-917764145549338113?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-72992374394687769482008-03-04T14:32:00.003+07:002008-03-04T14:49:20.576+07:00What a storm !No no there is no weather news to tell ya, just being one of <a href="http://www.ubuntu.com/">Ubuntu</a>'s fan I got to tell you how I love the project as well as the people behind it.<br /><br />They try so hard to make it possible for everyone to contribute back and like every kids love x-mas hope their wish will come true. Now there is a new Santa looking for your wishes @<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://brainstorm.ubuntu.com/"><img style="margin: 0px auto 10px; display: block; text-align: left; cursor: pointer; width: 400px;" src="http://brainstorm.ubuntu.com/modules/qawebsite/images/logo/idea-logo.png" alt="" border="0" /></a><br />To cut the long story short here is the latest tool <a href="http://brainstorm.ubuntu.com/">brainstorm</a> ;) I find it cool to vote/write down great idea and got it build "without us do the hard work" what a storm !<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-7299237439468776948?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-8221015286141397472008-02-01T17:40:00.000+07:002008-02-01T18:02:02.785+07:00ASP.NET FileuploadCall me lazy cuz I am deserved it. It shocked me a bit when a production code crash on my face. As part of my job today I have to train a few admin staffs on how to operate our newly invented site <a href="http://www.ncdd.gov.kh/jobs">www.ncdd.gov.kh/jobs</a> it works out quiet well on my machine cuz I dev, test &amp; teach on Mozill Firefox. But it turn out that I don't perform enough exercise cuz I haven't test the site with IE yeah, cuz I haven't use IE for almost 3 years enough to forgot about it :)) anyway here is the story.<br /><br />Do you know this guy <a href="http://msdn2.microsoft.com/en-us/library/system.web.httppostedfile.aspx">System.Web.HttpPostedFile</a>? yeah, he is my best friend when it comes to uploading file in ASP.NET. However you should know that he acted bit strange with browse in used.<br /><br />Let say file1 is an instance of HttpPostedFile and if we ask him <span style="font-weight: bold;">file1.FileName</span><br /><blockquote>Firefox return :<br />"<span style="font-weight: bold;">Hello My Friend.doc</span>"<br />Nice , isn't it?<br /><br />IE return :<br />"C:\Document &amp; Setting ....\user_name\desktop\<span style="font-weight: bold;">Hello My Friend.doc</span>"<br />WWOWO WHAT?! it slap me so hard to make me laugh out loud :))<br />Not Nice !<br /></blockquote>Anyway quick fix would be add a small detection on the file1.FileName<br /><blockquote>int lastDirSeparatorChar = file1.FileName.LastIndexOf(Path.DirectorySeparatorChar);<br /><br />if (lastDirSeparatorChar > 0)<br />{<br /> filename = file1.FileName.Substring(lastDirSeparatorChar + 1);<br />}<br />else<br />{<br /> filename = file1.FileName<br />}<br /></blockquote><span style="font-weight: bold;">Lesson learn</span> - test dev. site with IE as much as I hate "IE"<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-822101528614139747?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-64650677481546202682008-01-24T16:55:00.000+07:002008-01-24T16:58:34.097+07:00NCDD Recruitment Website is now onlineEarly release to take away my workloads; okay now it is the HR who got fun time with the new toy.<br />Check it out <a href="http://www.ncdd.gov.kh/jobs">www.ncdd.gov.kh/jobs</a> if think you have something to do with D&amp;D<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-6465067748154620268?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-58691077196852240722008-01-23T08:18:00.001+07:002008-01-23T08:27:02.963+07:00Sagernotebook.com's Product<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_BRGf4aMx5dE/R5aXvdVAftI/AAAAAAAAAmo/cctCaY5ABu0/s1600-h/spec.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_BRGf4aMx5dE/R5aXvdVAftI/AAAAAAAAAmo/cctCaY5ABu0/s400/spec.jpg" alt="" id="BLOGGER_PHOTO_ID_5158477264781868754" border="0" /></a><br />Well, just the spec that would satisfy me :D<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-5869107719685224072?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-37845493249336772982008-01-22T15:53:00.000+07:002008-01-22T16:06:51.444+07:00We had lost our buddy<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://limbiz.blogspot.com/2008/01/nov-vithous-wedding.html"><img style="margin: 0px auto 10px; display: block; text-align: left; cursor: pointer;" src="http://2.bp.blogspot.com/_BRGf4aMx5dE/R5WwhtVAfrI/AAAAAAAAAmY/ENzYZ07QOCY/s400/vithou.jpg" alt="" id="BLOGGER_PHOTO_ID_5158223041372651186" border="0" /></a>We are so sad to congrats our buddi who had lost his freedom.<br />Don't worry my friend, we will always remember all bar, bear &amp; karaoke room that we went together.<br /><br />To You &amp; Yours Happy Couple<br /><br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-3784549324933677298?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-357821976173717442008-01-18T15:13:00.000+07:002008-01-18T15:17:53.102+07:00Extending MonoRail ViewComponentQuick note before I leave my desk for a meeting<br /><br />Always apply ViewComponentDetailsAttribute on your custom ViewComponent like this<br /><blockquote>[ViewComponentDetails(string name, string sections, Type CacheKeyFactory, ViewComponentCache Cache)]<br /></blockquote><br /><br />This will prevent your custom view component name clash with base component name.<br />Okay ! got to go<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-35782197617371744?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-8860795662411233922008-01-17T15:55:00.000+07:002008-01-17T16:16:40.901+07:00Let do ProjectionThis would be a continue part from my <a href="http://chorn-sokun.blogspot.com/2007/12/ilist-you-have-me.html">previous post</a>, what I tried to do is find out how to use ActiveRecord "NHiberate to be clear" in my reporting scenario (not a CRUD) after a quick search I come up with a few blog posts which give me some light:<br /><ul><li><a href="http://www.ayende.com/Blog/archive/7510.aspx">ActiveRecord and ASP.NET 2.0 [Ayende ]<br /></a></li><li><a href="http://www.kenegozi.com/Blog/2006/10/08/projection-using-activerecords-importattribute-and-hqls-select-new-clause.aspx">Projection Using ActiveRecord's ImportAttribute and HQL's new Clause [Ken Egozi]</a></li></ul>It will take another post for me to wrap up how I come up with .... stay tune.<br /><br /><span style="font-style: italic;">Edit:</span> I shouldn't have missed, exploring test case<br /><a href="http://fisheye3.cenqua.com/browse/castleproject/trunk/ActiveRecord/Castle.ActiveRecord.Tests">Castle.ActiveRecord.Tests</a>\<a href="http://fisheye3.cenqua.com/browse/castleproject/trunk/ActiveRecord/Castle.ActiveRecord.Tests/ActiveRecordGenericsTestCase.cs">ActiveRecordGenericsTestCase.cs</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-886079566241123392?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-17030242458373199782008-01-17T08:54:00.000+07:002008-01-17T09:11:04.811+07:00Ubuntu "Dock It Mac Way"It almost 2 months since my busy schedule started, I was unable to find sometime to spend with my beloved Gutsy until today * I am no expert in Ubuntu * in the exploration process I decided to upgrade a few packages to it latest version and well I come across one cool package:<br /><br />Avant Window Navigator (Awn) is a dock-like bar which sits at the bottom of the screen. It has support for launchers, task lists, and third party applets.The Awn project is the development of the ‘dock’, avant-window-navigator, and its corresponding shared library ‘libawn’, which is used to develop applets.<br /><br />For more detail instruction read it @ http://www.ubuntugeek.com or direct link <a href="http://www.ubuntugeek.com/howto-install-avant-window-navigator-awn-in-ubuntu-710-gutsy-gibbon.html/trackback/">Avant Window Navigator</a> enjoy fun ;)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-1703024245837319978?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-87256096388888250122008-01-07T08:29:00.000+07:002008-01-07T08:43:03.221+07:00Visual Studio 2008 stink without ReSharperOh ! man I though VS2008 will give developer more productivity I was wrong.<br />Without <a href="http://www.jetbrains.com/resharper/">ReSharper </a>I feel like I take my time writing stupid code that do nothing.<br /><br />VS2008 Refactoring tool is suck !<br /><br />However the ReSharper 4.0 for Visual Studio 2008 is not yet release, but I can install the 3.1 with the following command<br /><blockquote>msiexec /i ReSharperSetup.3.1.Full.VS80.msi VSVERSION=9.0</blockquote>And here we go all the goodness command are come back to me.<br />If you don't believe me <a href="http://www.jetbrains.com/resharper/documentation/presentation/Editor_Feature_Highlights/ReSharperEFH.html">watch demo video feature highlight</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-8725609638888825012?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-87256166080494736832008-01-06T12:07:00.000+07:002008-01-06T12:17:16.795+07:00This is how a GIANT learn to copy files<a href="http://technet2.microsoft.com/WindowsVista/en/library/005f921e-f706-401e-abb5-eec42ea0a03e1033.mspx?pf=true">Vista SP1 Notable Change</a> - most notable change is MS is still learning how perform file operation (Copy/Move/Delete) the right way.<br /><blockquote><ul><li>Improves performance over Windows Vista’s current performance across the following scenarios1:</li><ul><li>25% faster when copying files locally on the same disk on the same machine</li><li>45% faster when copying files from a remote non-Windows Vista system to a SP1 system</li><li>50% faster when copying files from a remote SP1 system to a local SP1 system</li></ul></ul></blockquote>Oh and here is the funny part:<br /><blockquote>Improves the copy progress estimation when copying files within Windows Explorer to about two seconds.</blockquote>What so exciting improvement to be expect in the list :D Well, it sound like we have to wait for SP1+ before purchasing product release by MS.<br />I wonder does SP1+ = version 3.0 :)) anyway enjoy reading <a href="http://technet2.microsoft.com/WindowsVista/en/library/005f921e-f706-401e-abb5-eec42ea0a03e1033.mspx?pf=true">detail here</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-8725616608049473683?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-88631173643446252642008-01-03T08:40:00.000+07:002008-01-03T08:49:01.908+07:00Level1Remove : Unblock/block file attachments in MS. OutlookNote for myself <a href="http://support.microsoft.com/kb/837388">http://support.microsoft.com/kb/837388</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-8863117364344625264?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-8975849295339574882008-01-01T00:09:00.000+07:002008-01-01T00:40:32.995+07:002008 hitting the road<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_BRGf4aMx5dE/R3klkNVAfqI/AAAAAAAAAmQ/7Ev9MABuaxU/s1600-h/images.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://4.bp.blogspot.com/_BRGf4aMx5dE/R3klkNVAfqI/AAAAAAAAAmQ/7Ev9MABuaxU/s400/images.jpg" alt="" id="BLOGGER_PHOTO_ID_5150188952858164898" border="0" /></a>Let me take this opportunity wishing you all the best,<br /><div style="text-align: left;">2008 refresh our brain bring more innovations and best of all let rock the Net.<br /><br /><span style="font-weight: bold;"><br />2008 Wish list:</span><br /><ul><li><a href="http://www.ubuntu.com/testing">Ubuntu 8.04 Hardy Heron</a> - more hardware support out of the box please ...<br /></li><li><a href="http://www.hibernate.org/357.html#A14">NHibernate 2.0 GA</a> - let persist the universe<br /></li><li><a href="http://www.castleproject.org/">Castle 1.0 GA</a> - let become a great warrior </li><li>MySQL 5.1/6.0 GA - falcon data engine, data partitioning<br /></li><li>Die, die Windows Vista - don't you know how much I hate you?<br /></li><li><a href="http://www.monodevelop.org/Main_Page">MonoDevelop 1.0</a> - let us all have a real IDE for Mono "Unleash the Monkey"<br /></li></ul></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-897584929533957488?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-87824028425518147292007-12-31T15:14:00.000+07:002007-12-31T15:38:02.908+07:00Castle.MonoRail.Framework.IFilter - Part IToday I would like to share some technique in using <a href="http://www.castleproject.org/monorail/documentation/trunk/usersguide/filters.html">Castle.MonoRail.Framework.IFilter</a> . I am a bit sad because it takes too much time for me to realize how useful, until I read between the line over and over again<br /><blockquote> Filters are executed before and|or after your actions. It is useful for security, dynamic content and to <span style="font-weight: bold;">keep away repetitive code</span>.</blockquote>Keep away repetitive code is what I am tracing, let the hear the story shall we?<br /><br />This happen with one of the real world project that I am working on <a href="http://www.ncdd.gov.kh/koma">Data Bridge</a> like any other web application it need authentication and passing some user preference along each action (inherit from SecureController) to the view such as List, Add, Edit &amp; Delete action &amp; view.<br /><br />This can be done using the following technique:<br /><br /><span style="font-style: italic;">Create Filters\AuthenticationFilter.cs</span><br /><blockquote>public class AuthenticationFilter: IFilter<br />{<br /> bool IFilter.Perform(ExecuteEnum exec,<br /> IRailsEngineContext context,<br /> IController controller){<br /> if(!UserNotLogin())<br /> {<br /> Redirect("Login", "Index");<br /> } <br /> else<br /> {<br /><span style="color: rgb(255, 0, 0);"> controller.PropertyBag["maxRow"] = GetUserMaxRowPreference();</span><br /><span style="color: rgb(255, 0, 0);"> ... set more preferences as needed</span><br /> } <br /> }<br />}<br /></blockquote><span style="font-style: italic;">Create SecureController</span><br /><blockquote>[Layout("default"), Rescue("generalerror")]<br />[Filter(<span style="color: rgb(255, 0, 0);">ExecuteEnum.BeforeAction</span>, <span style="font-weight: bold; color: rgb(0, 153, 0);">typeof(AuthenticationFilter)</span>)]<br />public <span style="font-weight: bold;">abstract </span>class SecureController : ARSmartDispatcherController<br />{<br />}<span style="font-style: italic;"><br /></span></blockquote><span style="font-style: italic;"><span style="font-style: italic;"></span></span>SecureController is marked as abstract, prevent from direct use.<br /><br /><span style="font-style: italic;">Using SecureController</span><br /><blockquote>public abstract class ProductController: SecureController<br />{<br /> public void List()<br /> {<br /> }<br />}</blockquote><span style="font-style: italic;">Now view part:</span> View\Product\list.vm<br /><blockquote>When render table I want to display miximum <span style="font-weight: bold; color: rgb(255, 0, 0);">$maxRow</span> rows.<br /></blockquote>See there is no code need to set preference in each action method, nice.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-8782402842551814729?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-25510662567614174332007-12-27T09:22:00.000+07:002007-12-27T09:24:46.597+07:002007 Party of the Year :))<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="400" height="267" flashvars="host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fchornsokun%2Falbumid%2F5148470210025520497%3Fkind%3Dphoto%26alt%3Drss" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed><br /><br />This party made especially for an old friend "Phors" he was on his scholarship assignment, Wish you all the best.<br /><br />Happy New Year Everyone<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-2551066256761417433?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.comtag:blogger.com,1999:blog-35733274.post-30763384024059938682007-12-05T15:40:00.000+07:002007-12-05T16:19:19.632+07:00IList you have me?As much as I hate to deal with numerical index I had to cross it one way or the other so be it.<br />Here is the fact, I am enjoy using Castle.ActiveRecord to wrap my DAL code cuz it simplify thing a lot for me > 80% somehow when it came to not so complex scenario like this one:<br /><br />I want to allow my customer to list all the products and set the qty they want to order.<br />If they already order I would like to give them a chance to update qty for the product that they miss in the previous hit.<br /><blockquote>public IList LoadProductOrderList(int customer_id)<br />{<br /> IList result;<br /> ISessionFactoryHolder sh =<br /> ActiveRecordMediator.GetSessionFactoryHolder();<br /> ISession session = sh.CreateSession(typeof(AnnualTarget));<br /> try<br /> {<br /> // note: code wrapped for view<br /> string sql = "SELECT p.pid, p.name, o.qty, o.id as order_id<br /> FROM Products p JOIN Orders o<br /> ON p.pid = o.product_id WHERE <span style="font-weight: bold;">o.customer_id = :c1 </span><br /> UNION<br /> SELCT pid, name, 0 as qty, 0 order_id FROM Products";<br /><br /> result = session.CreateSQLQuery(sql)<br /> .AddScalar("ID", NHibernateUtil.Int32)<br /> .AddScalar("NAME", NHibernateUtil.String)<br /> .AddScalar("QTY", NHibernateUtil.Int32)<br /> .AddScalar("ORDER_ID", NHibernateUtil.Int32)<br /> .SetInt32("c1", customer_id)<br /> .List();<br /> }<br /> catch (Exception ex)<br /> {<br /> ....<br /> }<br /> finally<br /> {<br /> sh.ReleaseSession(session);<br /> }<br /><br /><span style="font-weight: bold;"> return result; <- this is an IList ?!!! I don't like to work with it </span>}<span style="font-weight: bold;"><br /></span></blockquote>As much as I hate, it is a bad idea to pass IList back to the caller object. What is interesting about this code session.CreateSQLQuery(sql) you can tell it to map the result to an Entity by call like this<br /><blockquote>session.CreateSQLQuery(sql)<br />.AddEntity(typeof(EntityObjectOfTypeActiveRecord))<br />.List();</blockquote>But anyway I have got time to dig what AddEntity would do with the object pass in to me the road a head is a bit dark. Can I have something more simple?<br /><br />The simple should be:<br /><blockquote>public IList<productorderdto> LoadProductOrderList(int customer_id)<br />{<br /> IList<productorderdto> betterResult = new List<productorderdto>();<br /> .....<br /> for(int i = 0; i < curobject =" (object[])" dto =" new" id =" curObject[0];" name =" curObject[1];" qty =" curObject[2];" orderid =" curObject[3];"></productorderdto></productorderdto></productorderdto></blockquote>Now it much better to work with<br /><br /><blockquote></blockquote><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35733274-3076338402405993868?l=chorn-sokun.blogspot.com'/></div>Chorn Sokunhttp://www.blogger.com/profile/00435656875216513074noreply@blogger.com