Archive for April, 2007

30
Apr

Maneki Neko

My boss recieved a gift today of one of these Maneki Neko (Lucky Cat).

Maneki Neko (Lucky Cat)

Supposedly they are placed in a particular spot in your office/shop to bring in customers / money (depending which paw is raised). Actually there’s a really cool shop in Suan Lum Night Bazaar that sells just these ornaments - but I forget the name …

Whether they really work or not is another matter, but a colleague did mention to me it helped his football team. He place the cat in a strategic spot behind the other teams goal … the rest you can figure out ;-)

28
Apr

Logical coding

I was reviewing some code one of my developers wrote the other day and found this:

    function getSomeInfo( $r_id ){
        $sql =  "SELECT *  FROM sometable WHERE c_id = '$r_id' ";           
        if ($results = $this->db->get_results($sql)) {
            $i = 0 ;
            foreach($results as $report_list ){
                $i ++ ;
            }return $i; 
        }else{
            return false;
        }               
    }

A programmer must be logical and have a clear sense of process. Therefore for the non-programmers or in-experienced ones, you can reduce the amount of code into the following:

    function getSomeInfo( $r_id ){
        $sql = "SELECT count(id) FROM sometable WHERE c_id = $r_id;"
        return $this->db->get_var();
    }

The DB class we use allows us to pull a single variable from a query with the “getvar” function. The database class we use is called ezsql by Justin Vincent. The class incidentally, is also used by WordPress :)

To be honest, there’s always a way to reduce the amount of code you write, and a faster way to do it. But not everyone is aware of the techniques and that includes me, but in my mind the above solution should have been obvious despite the urgency of the work. Am I being harsh? I don’t think so. Poor thinking and mistakes can break a company’s reputation and finally put it out of business.

Now - I must plan a little chat with an individual…

28
Apr

Bad grammar

I can’t believe how bad my grammar is! I just made a quick sweep of my posts and found several mistakes of “its” rather than “it’s” all over.

I really suck!

BTW, going for another upgrade to WordPress 2.1.3 - “you can never be too careful” as someone mentioned to me recently :)

26
Apr

A List Apart - Web Design Survey 2007

Don’t forget to fill it out - I’m looking forward to the results!

A List Apart - Web Design Survey 2007

26
Apr

Paradorn engages world beauty … WTF?

In case you folks didn’t know, Paradorn Srichaphan, Thailand’s Tennis ambassador (currently 88 on the ATP rankings) officially announced his engagement to the 2006 Miss Universe pageant winner - Natalie Glebova.

I don’t know about you - but a lot of people in my office and at home are going, ‘How did the f* did that happen?’.

He hasn’t exactly got the best reputation right now - at least according to my understanding, but I really do hope this is the real deal for him and that he’s not just going to teach Natalie what most Thai men typically do …

Besides the bangkok post wrote that he’s “currently in rehab for a wrist problem” - hahah, I suppose I’m just warped, but that could taken in a different light…( I think they should have re-phrased the sentence )

23
Apr

Warning: Cat’s = Loss of intelligence

Every once in a while a hard working developer such as myself (blows trumpet) needs a break from reality, enter xkcd.com!

Symptoms of proximity to cats