How to use KEY in xslt

W3C

I think XML is a very simple storage medium that you can save and query in it. But all data is storage as a tree node in the XML. In this case, it can very simple to save hierarchy data structure. But how to handle it you have reference item?

Just use key in your XML code. For more detail please refer the sample as follow:

t1.xslt

<?xml version=”1.0” encoding=”UTF-8”?>

--------------------------------------------------------------------------------- Result --------------------------------------------------------------------------------- <item ID=" " refID=" "> <name> </name> <adress> </adress> </item>

x1.xml

J. Smith Taipei, Taiwan R. Paul TAIWAN, SA E. Rock CA, US

Result

<?xml version=”1.0” encoding=”utf-8”?>

J. Smith Taipei, Taiwan R. Paul TAIWAN, SA E. Rock CA, US --------------------------------------------------------------------------------- Result --------------------------------------------------------------------------------- E. Rock CA, US R. Paul TAIWAN, SA E. Rock CA, US J. Smith Taipei, Taiwan

如何使用BT


(圖片: PCHome)

BT大概是近幾年最受歡的的下載技術了,而軟體BitComet也是最好用的軟體之ㄧ,要下載請到PCHome。一些相關網頁整理如下:

  1. BITCOMET下載網頁
  2. BITCOMET教學
  3. BitComet參數設置詳解
  4. BitComet設定攻略
  5. BitComet提速教程
  6. 害怕BT傷硬碟的都進來看看吧!

Runtime to start/stop another window sevice

WindowsService (WinCE).JPG 

Except to set the dependency of services in SCM(Service Control Manager). You have another way to make sure some services can run before your application (serivce).

Use StartService to start a Window Service

Please note as follow:

  1. If the service already start, it will return FALSE.
  2. The function will return if the Windows Service is in running status (maybe needs 30sec atmost) or failed.

For more detail, please refer MSDN. Refer the sample code.

 SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CONNECT);  SC_HANDLE service; > >  if (serviceControlManager)   {   service = OpenService(serviceControlManager,          "SERVICE_NAME",          SERVICE_START | SERVICE_QUERY_STATUS | DELETE); // Make sure you have the privilege of SERVICE_START. > >   if (service)    {    if (StartService(service, 0, NULL))     {     // Services already startup successes.     }    else     {     DWORD dwLastError = GetLastError();     if (dwLastError == ERROR_SERVICE_ALREADY_RUNNING)      {      //Services already started      }     else      {      //Service can not start.      hr = E_FAIL;      return;      }     }    } > >

Use ControlService to stop Windows Services

You may think it may have a function StopService to stop serivce. Unfortunately, you have use CotrolService to do that. Please refer the sample code for more detail.

SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CONNECT);  SC_HANDLE service; > >  if (serviceControlManager)   {   service = OpenService(serviceControlManager,          "SERVICE_NAME",          SERVICE_STOP | SERVICE_QUERY_STATUS | DELETE); // Make sure you have the privilege of SERVICE_STOP. > >   if (service)    {    SERVICE_STATUS serviceStatus;    QueryServiceStatus( service, &serviceStatus ); > >    if (serviceStatus.dwCurrentState != SERVICE_STOPPED)     {     if (! ControlService(service,    // handle to service           SERVICE_CONTROL_STOP,  // control value to send           &serviceStatus) )  // address of status info       {       // ControlService failed        }     }    }   }  > >

原來MYSQL4.0X不是unicode

MySQL

最近由於想架設一個DKP網站,才知道自己主機的MySQL 的版本竟然太舊而無法support unicode的問題(4.1X才有Unicode support, 4.0X都是外面Unicode 而資料庫裡面還是使用iso-8859-1~~)

所以列出一些參考資料

其實充其量~~ 就是為了一個功能

      SET NAMES utf8

乾脆換成FreeBSD算了~~ 反正最近ADSL又改成PPPOE的方式了~~~

找到使用MySQL 4.0X版本的EQDKP的版本(1.30)

繁體中文:簡單架設DKP網站
簡體中文:EQDKP 1.3.0 with ItemStats 中文版

Head first design pattern–”Singleton pattern”

Head First Design Patterns
(Picturefrom Amazon)

Sometime you just write code without fully understanding the meaning. Like design pattern, maybe you already know part of them even use them very well. “Head First Design Patterns” is a good book, it use a story to let you know why you must use this pattern (some of us may not know forever).

As this chapter “Singleton pattern”, I have already used it in my code everywhere. But I can not get fully understand why we have to use this, how to use this and how to prevent other this in multiple threading programming.

I list a example fot singleton implementation.

class CSingleton { public:  static CSingleton * getInstance(); public:   void f1();  void f2();  void f3(); > > private:  virtual ~CSingleton();  CSingleton(); > > private:  static CSingleton *m_uniInstance; }; > >

傑克~ 你真是太神奇了~~(鐵達尼二之傑克回來啦~~)

Titanic2.JPG

如果要選電影史上~~ 最受歡迎的奶油男主角~ 大概就是鐵達尼的Jack 了~~ 他的一句”You Jump, I Jump !!”不知道 迷死多少女的~~~~

但是 JACK 回來啦~~~

Titanic2-1.JPG

所以~ 電影公司特地請這位死掉的帥氣小生~~ 復活!!還是透過最新的冷凍科技 ? 哈~~~ 只能說 電影公司的腦袋 真不是普通人可以了解~~~

傑森大戰佛萊迪之後~~ 這大概是讓我最感覺驚訝的電影吧?  其實我是不介意~~ 來個無間道4讓梁朝偉復活  來個歐比旺大復活 來個蜘蛛人打蝙蝠俠

 

聽說這個電影是有人虛構出來的~~~厲害!!