2009年11月24日 星期二

Avoid Deprecated: Assigning the return value of new by reference is deprecated in...

Preventing Warning Message from Cakephp 
Message: Deprecated: Assigning the return value of new by reference is deprecated in...
Solution: Modify cake/libs/configure.php
< ?php
if (isset($config['debug'])) {
if ($_this->debug) {
error_reporting(E_ALL);
// add below contents
if (error_reporting() > 6143) {
error_reporting(E_ALL & ~E_DEPRECATED);
}
?>




2009年11月19日 星期四

Capture http package for your http server

tcpdump -A -s 1024 'port 80 and src host 192.x.x.x'

-A enables ASCII mode display
-s enlarge package length
src host x.x.x.x for specified host IP only

Enables your Dreamweaver to recognize thtml and ctp

1. Modify C:\Documents and Settings\user_name\Application Data\Macromedia\Dreamweaver 8\Configuration\Extensions.txt 
Append thtml, ctp in below section:
“PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files”

2. Modify C:\Program Files\Macromedia\Dreamweaver 8\Configuration\Extensions.txt 

Append thtml, ctp in below section:
“PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files”

3. Modify C:\Program Files\Macromedia\Dreamweaver 8\Configuration\DocumentTypes directory\MMDocumentTypes.xml

Append thtml, ctp in below section:
< documenttype id="PHP_MySQL" writebyteordermark="false" file="Default.php" macfileextension="php,php3,php4,php5,thtml,ctp" winfileextension="php,php3,php4,php5,thtml,ctp" internaltype="Dynamic" servermodel="PHP MySQL" >

2009年10月6日 星期二

My notes of jquery-translate usage

Effects: 
Automatic distinguish between Simp Chinese and Trad Chinese then translate to desired language. Few steps to enable localization functionality.

Requirement:
#1. jquery Library. get from here.
#2. jquery-translate. get from here.

Procedures:
#1. Include all necessary JS file.
#2. Make sure all require JS file store in inc folder correctly.
#3. Content of wraper.trans.js

var lang = window.navigator.userLanguage || window.navigator.language ;
var autolang=lang.toLowerCase();
var trans2CN = (autolang == "zh-cn") ? true : false;
trans2CN = true;
$(document).ready(function() {
if(trans2CN){
document.navagation.src='/images/pic.gif';
$('body').translate('zh-CN');
}
});


2009年9月25日 星期五

How to resolve "無法啟動 adobe updater"

1. Browse to  C:\DocumentsandSettings\User Name\ApplicationData\Adobe\Updater\
2. Create a new file or Modify exist file named "AdobeUpdaterPrefs.dat"
3. Paste below content and save the document.

<?xml version="1.0" encoding="UTF-8" ?>
<AdobeUpdater>
<AutoCheck>0</AutoCheck>
</AdobeUpdater>

4. Launch Adobe Photoshop to test.

2009年8月26日 星期三

MSN 2009 for Windows 2003, 2008 0x80280004 (原來一切都是Wrapper搞的鬼)

如果作業系統是Windows 2003, Windows 2008當安裝MSN的時候,得到回應 os_check: 0x80280004,嘗試下列方式安裝。

MSN2009這各版本微軟還是將Os type determination 直接封裝在wlsetup-web.exe裡面,要成功安裝這各版本,除了取得 Messenger.msi 外,包含相關的XML parser、Dll以及其他MSN附屬程式,都得一併安裝,才能保證MSN個功能正常運作。

安裝方式:
Step1:
找一台XP或能成功安裝MSN2009的機器,下載 MSN 安裝程式wlsetup-web.exe http://download.live.com/messenger

Step2:
執行 wlsetup-web.exe 之後,依照畫面提示將MSN安裝完成。

Step3:
安裝完成後,請到 C:\Program Files\Common Files\Windows Live\.cache 這個目錄,MSN2009的相關暫存檔案都放在此,請將所有的*.MSI檔案複製到Windows2003 or 2008進行安裝。

Step4:
至此,所有的程式若已安裝完成,可以開始使用MSN。
如果有遇到 Error 80040111 or 80040154,再額外進行Step5。

Step5:
Dos Prompt下執行 %windir%\system32\regsvr32 %windir%\system32\msxml3.dll
安裝。

註記: 倘若依照上述方式進行安裝之後,還是無法成功登入,請查看相關錯誤代碼的解決方式 或來信討論。