Chorn Sokun's Weblog

Conquer inner fear, push it to the limit!

Archive for the ‘Joke’ Category

Best use of .NET 3.0 extension methods

with 2 comments

If you want to know what is .NET 3.0 extension methods visit ScottGu‘s post will help. Anyway it is not the main topic i want to discuss here; what I want you to help me is to build a business rule for the following use case.

extending seat

Toyota HQ, Change Request Accepted.


Scenario:
Cambodia is one of the country imported alot of second hand cars; and the best use of those cars are in Taxi business. Due to the quality of the car made from good material the users “Car owner” had come up with an idea of extending the car seat by converting the Car’s boot into reservation seats.

After review change requests Toyota HQ decided to build a custom Car for Cambodia only. A friend of your who is an engineering at Toyota his job now is to build this car with low cost. Lucky he had previously attended a few TechEd conferences so familiar with .NET 3.0 extension methods which allow him to attach new functionality to the existing car architecture :) and so he jump right into code:

public static void Load(this Car car, Guess g){
  if (car.RunIn == “Cambodia”
    && car.TotalGuessInside >= 8
    && car.Boot.IsStillFree
    && car.AverageSpeedKMph =< 75 ){
    if ( g.IsSingle ){
      Car.BootToSeat();
      car.Guesses.Add(g);
    }
    else
    {
      if ( g.Partner.HasThirdPartyRelationship || g.Partner.Age >= 30 )
      {
         Car.BootToSeat();
         car.Guesses.Add(g);
      }
      else
      {
         throw new InvalidToHellPermissionException(
             @"Your partner is still young if you really want to do
               that let get their written permission");
      } 
    } 
  }
  else
  {
    throw new InternationalTrafficLawException(”OMG!”);
  }
} 

And he asked me to review his code since I’m a Cambodian resident I should be able to tell him what are the criteria he missing; but I am a bit out of date with current taxi business how about you my dearest friends any idea for inclusion?

Advertisements

Written by Chorn Sokun

September 5, 2008 at 11:05 pm

Posted in Joke

Tagged with

Hug a developer

leave a comment »

Ayende had posted about “Hug a developer today” which show how deep pain a developer had earned over the past years.

I wished I’d be able to embed the movie inside wordpress however it doesn’t seem to work; anyway the video began with “Developers everywhere are in terrible pain” more detail go visit here.

Written by Chorn Sokun

September 2, 2008 at 9:54 pm

Posted in Geek, Joke, Rumor

Tagged with ,

read between the line

with 2 comments

It was last Friday when I tried to implement a UI for contractor register. Let see the code shall we?

if (!contractorTypeSelected)
{
    Flash["error"] = "Please select a contractor type";
    RedirectToStep("StepOne");
}
{
   DoNavigate();
}

Without knowing much detail it read like this “If the contractor’s type is not selected, flash an error and go back to step one otherwise take me to the next step“. It sounds pretty trivial right? well easy enough except it always take me to the next step no matter how bad the contractor’s type condition was ????!!!!!!

Now tell me what have I done wrong?

Written by Chorn Sokun

August 28, 2008 at 11:13 pm

Outlook delete items disappeared ???!!!

with 3 comments

Microsoft Outlook Deleted Items Disappeared

Microsoft Outlook Deleted Items Disappeared

A joke that make you cry, unless it took me 15mn or so to figure out how the heck this happen. Until I realize suck ! it must be a view option.

Now I know view option is the root cause problem solved. But what I don’t understand what does Current View got anything to do with Arrange By? Why it has to be a sub menu of Arrange By?

Written by Chorn Sokun

August 21, 2008 at 11:17 am

Posted in Joke, Tips & Tricks

Tagged with ,

Don’t tell me it time for “Reload”

leave a comment »

Phone Prepaid Card

$50, Monthly Prepaid Card

This is how we keep up with mobile phone free market competition in Cambodia, which doesn’t end up with a choice but multiple choice where you need to select all to survive.

I think they need an architecture review. Oh! may be they are going to need SOA, aren’t they?

Written by Chorn Sokun

July 30, 2008 at 3:37 pm

Posted in Geek, Joke, Socialize

Tagged with

This is how a GIANT learn to copy files

leave a comment »

Vista SP1 Notable Change – most notable change is MS is still learning how perform file operation (Copy/Move/Delete) the right way.

  • Improves performance over Windows Vista’s current performance across the following scenarios1:
    • 25% faster when copying files locally on the same disk on the same machine
    • 45% faster when copying files from a remote non-Windows Vista system to a SP1 system
    • 50% faster when copying files from a remote SP1 system to a local SP1 system

Oh and here is the funny part:

Improves the copy progress estimation when copying files within Windows Explorer to about two seconds.

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.
I wonder does SP1+ = version 3.0 :)) anyway enjoy reading detail here.

Written by Chorn Sokun

January 6, 2008 at 12:07 pm

Posted in Joke

Tagged with

The fun part for a programmer

leave a comment »

If you like me a guy who try hard to put his head above the water. You will feel like all the energy suck out during the working days. How many hours left for personal entertainment?

However I usually try to get some fun back as it goes.


All the tools had no brain, but we do so use it wisely.

I say : let hack it.

c:\svn\multi-billion-project\nant
You know we also have m$build say ‘Yes’ to switch command to C:\svn\multi-billion-project\m$build ok?h^ll yeah but why don’t you give the $ and do
C:\svn\multi-billion-project\hmmbuild


Never fix your brain to a single solution find the alternative.

I say : let explore it.

XML vs JSON
SOAP vs REST
AJAX vs POST BACK
MVC vs Code Behind
BLOG vs WIKI
Flash vs Silverlight/Moonlight

In a fight whatever could help you breaking your opponents head just use it.
I say : let draw first blood.

>sudo apt-get install ms-excel vba php4 php5 ruby mono
Error … hey that is m$ … I know just get-apt dosu.


Happy hacking…

Written by Chorn Sokun

July 28, 2007 at 10:41 am

Posted in Joke