2012年3月16日 星期五

喜歡的設計

從幸福空間上看到不錯的設計

topic_120315-14點點花壁磚 好可愛

topic_120315-1窗戶外推+白色窗簾 很明亮 搭木製地板很舒服

2012年3月15日 星期四

[note]auto_ptr

auto_ptr<CPolicyEvent> pPolicyEvent( new CPolicyEvent(pEvent) );

有constructor 和desctructor之後, C++真的可以玩很多東西耶

auto_ptr 這玩意會在離開scope的時候 自動幫你Delete

 

template<class _Ty>
    class auto_ptr
        {    // wrap an object pointer to ensure destruction

    explicit auto_ptr(_Ty *_Ptr = 0) _THROW0()
        : _Myptr(_Ptr)
        {    // construct from object pointer
        }

~auto_ptr()
    {    // destroy the object
    delete (_Ty *)_Myptr;
    }'

private:
    const _Ty *_Myptr;    // the wrapped object pointer

}

 

方便~

2012年1月31日 星期二

2012年1月8日 星期日

kernel debug command and options

bcdedit /dbgsettings serial debugport:1

bcdedit /copy {current} /d DebugEntry After this command executed, the ${ID} will appear on console and please replace all ${ID} with it.

bcdedit /displayorder {current} ${ID}

bcdedit /debug ${ID} ON

bcdedit /default ${ID}

** The commands above need to be executed on administrator privilege console window(right click command prompt and choose “run as administrator” option).

** To execute driver without signed:

        . Press F8 when windows starting

        . Choose “停用驅動程式簽章增強” option(I forget the wording in English)

** To show debug log message on WinDBG console, please modify the registry value below:

        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter]

                "DEFAULT"=dword:0000ffff

2012年1月4日 星期三

windows hook

今天阿文TOI 有提到的 Three Ways to Inject Your Code into Another Process

針對 windows hook 我的理解是 windows 開放來monitor windows message 用的 (比如某隻process 有沒有收到keyboard的message 或者滑鼠做了什麼事..)

可以自己monitor自己 也可以monotor 別人(別的process) message

透過 SetWindowHookEx(MSDN link) 就可以做到這件事, (寫到這裡忽然有同事說遊戲外掛就是用這個做的. 攔到就多送幾個鍵. XD)

因為它的實作會把dll map 到remote process 去執行, 所以就可以用這個function 來做到inject dll.

這邊還有一篇介紹windows hook的 文章 , 簡體的不會比英文好讀到那裡去.. :P 不過還是可以看一下

2012年1月3日 星期二

phpbb 用 LDAP 認證

Lightweight Directory Access Protocol

LDAP目錄也是一種類型的資料庫,但是不是關係型資料庫。不像被設計成每分鐘需要處理成百上千條資料變化的資料庫,例如:在電子商務中經常用到的在線交易處理(OLTP)系統,LDAP主要是最佳化資料讀取的效能

LDAP最大的優勢是:可以在任何電腦平台上,用很容易獲得的而且數目不斷增加的LDAP的客戶端程序訪問LDAP目錄。而且也很容易定制應用程式為它加上LDAP的支持

節錄自 這裡 裡面 還有介紹一些內部用tree來記和其他有的沒的

php bb設定 (待續)

目前找到的參考資料, 中文唷

2012年1月1日 星期日

2011年12月29日 星期四

2011年11月21日 星期一

感情這種事

其實很難說是非對錯.

愛情淡了,是每個人都會經歷的過程。不管是因為暑假, 碩班考試, 當兵, 或者是新的事業環境。

愛情淡了不放手,是放不開。用婚姻來代替永恆,即使再怎麼讓適婚年齡的女子心動,心裡的聲音,真的能平息嗎?

相信互相扶持、彼此的空氣、終於找到了一生摯愛、相知相惜的婚姻,一定是存在的。

只是,有多少人如此幸運的找到了這樣的伴侶,可遇不可求。

反之,條件不錯,顧家正直善良浪漫的好人,加上累積的感情,根本就是好老公代表了。

只是 好老公,和彼此的空氣,仰賴彼此而活之間,似乎還是存在著那麼一口止不住的嘆息。

2011年10月12日 星期三

Two dictums from a friend

1. Have the courage to follow your heart and intuition (adopted from Jobs)

2. Don’t lie to others, you can only fool the one who believes in you.