Wednesday, May 21, 2008

blog move

I 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

Friday, May 02, 2008

the most amazing dream

Recently 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".

I normally always forget my dream once I awake but this time I tried not to forget and I love to keep this memory.

There are two dream actually happen in two separate nights one after another.

Dream #1 : I know it hard to describe in text version but I'll give it a try ;)
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 & 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.

Even thought it a dream; if computer security product ever invent this way I would be fun.
Instead of watching list of file scan rotating I virtual see how the virus movement and be able to stop it my hand :))

Dream #2: Lucky that not about computer
I got visited from a long lost friend; Well you guess he/she :))
I wish that night would last longer, but we can't live in the dream world forever.

Wednesday, April 23, 2008

Many to many lazzziii

NHibernate's rock I scratched my head for a few hours looking at this code

DetachedCriteria filter = DetachedCriteria.For(typeof(Project))
.Add(Expression.Eq("ID", pid))
.SetProjection(Projections.Property("Type"));

DetachedCriteria q = DetachedCriteria.For(typeof(List_Output), "op")
.CreateCriteria("ProjectTypes")
.Add(Subqueries.Exists(filter));

return q.GetExecutableCriteria(
holder.CreateSession(typeof(List_Output))
).List();
Wonder why I got so many sql call to the server? the domain objects in the discussion context are Project has a Type and base on selected Type a project can choices a bunch of Outputs.
So Project is belong to a Type [One-to-Many], and Type has many Outputs where Output belong to Many Types [Many-to-Many].

What I found and fix is Lazzzzzzzziiiiiiiiiiiiiiii :))
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)

Thanks to DetachedCriteria & the Laziness until next time today magic word is "Lazy = true"

Friday, April 18, 2008

Woh Woh storedprocedure no more ...

Read the title and want to know how to do that? come with me hacking the Castle code base or to be accurate hack NHibernate code base, what you need to bring along? not much but a SubVersion, NAnt, MbUnit and NUnit that sound enough ;)

Enjoy plug & play your database and let the Jedi rise
Happy Friday everyone !

Sunday, April 06, 2008

... and so there is a response

As I sad I love to see thing happen without me touching the code base :)) and how about the full fill my wish list?

Oh ! how about eclipse & it partner PDT? Vote it up so we "eclipse fan" can have it goes for Hardy as well ;)
Last but it the beast Ship Mono.19 with Ubuntu 8.04 go vote for it if we're true friend.