Saturday, June 6, 2009

3姑回来了...

3姑一家, 从美国回来了... 11点多的飞机会到KLIA... 算一算应该有4-5年没见了.
今天我竟然有点兴奋到睡不着.. 不知道是梦太多,还是真的兴奋到醒了. 6点多就开始清醒了... 一下子梦到我3姑的脸, 变得有点怪怪,不修边幅,连我们都不认得她了. 一下子梦到她2个孩子,就连3姑丈 (uncle hor) 也有份. lol.

突然她的儿子吃东西吃到一半吐了起来.. 摸一摸他的额头, 竟然发烧了!! 全家开始乱了起来,有些建议马上看医生,有些说看看怎样再说... 不然一家这么多人被隔离起来,好像很严重.. 没有 A流感,也变得好像有了.....

乱了一场,结果是一场梦...

婆婆应该比我还要兴奋吧... 今天打算大煮一番,以我对婆婆的了解,她应该4点就会醒了... ^.^
好期待哦.. 今晚一定要记得拍全家福..

Thursday, June 4, 2009

Paypal Integration

I have tested the Paypal Express Checkout using Sandbox Test Account, it finally works! Thanks to the wizard. I bet i wouldn't able to complete it without the help of the wizard.

Here you go.. http://integrationwizard.x.com/index.php
Bookmark it!!

The Express Checkout Guide provided by Paypal seems to be so informative but in fact it sucks. It only tells you the idea of the entire integration and payment building block. How to implement it, you think yourself.. -_-"

It has some slight differences from what I used to integrate for other payment gateway solution.
Instead the simple http POST / GET as expected, you actually need something call "CURL" in place which i really not familiar with it at all!

#CURL - from what i understand it should be something similar like HttpClient or HttpURLConnection in Java..

... hehe.. done sharing. And I shall proceed to fully integrate the solution into my so-called-eCommerce product ^^

电脑程序员 . 没完没了

上一篇说到了Cytron网站的问题. 果然不出所料,当他们查不出个究竟时,就会说你的浏览量太大了, 所以建议我升级到 dedicated server. 我不敢说他们的判断及结果不准确, 但是我这总觉得 Cytron 网站离用 dedicated server 应该还有一段距离吧. Dedicated Server 很贵,短期内应该都不会升级的.

为了解决这个问题,唯有减少 database connection. 所以我就想到 cache. 没用过 php 的 cache。 Google 了一下,那天运气很好,一下子就找到cache 的方式了.. 很简单,也很有效. 这就是我喜欢 PHP 的原因... 不需要长篇大论的, 而且全世界都在用,解决方案多的是.

就是这个 http://www.theukwebdesigncompany.com/articles/php-caching.php
而最神奇的地方就是这短短的一段

// start the output buffer
ob_start(); ?>

//Your usual PHP script and HTML here ...

$cachefile = "cache/home.html";
// open the cache file "cache/home.html" for writing
$fp = fopen($cachefile, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();
?>

The world is flat. 多亏大家的分享. 我希望有一天我也研发到一些很好的东西,一定拿上来跟全世界分享.

加了 caching 后,网站明显的改善了很多.. 现在cache 的都是那些 static content.. 迟点有时间我才继续cache 其他的如 product information. 虽然网站的Speed 改善了,但不表示问题已经解决了,当浏览量多时, 问题一样会出来..

搞完这一单, 轻松了几天... 现在开始要还债了.... Paypal Integration, 到现在还不知道怎么做. Cytron 限我6月中完工. 刚才另一个客户 SMS 我,问我东西做到怎样.... 我一点都还没动!! 很老实的跟客户说清楚并答应 7 月中交货... 到时候做不到, 我真的不知道脸应该放在那里... -_-"

就在这个时候, aishop 网站又给了我一个怪怪的问题!!
上次发生过了. AJAX 的问题.. 没有解决方法. 但是刚好换了server, 过后问题就消失了..
今天又来了.. 但只发生在 IE, FF 没事.. AJAX 所 return 的 result, 多了一些 invisible character.. \n \r 之类的... -_-"

总之只要有一天我还是电脑程序员, 就是没完没了>>>>