2015年12月21日 #
$ locate libiconv.so.2 $ whereis libiconv.so.2 $ find /usr /lib -name libiconv.so.2 $ find / -name libiconv.so.2 2>/dev/null
2015年12月20日 #
2011年4月6日 #
對(duì)于C++類:顯示地寫(xiě)出拷貝構(gòu)造函數(shù),重載賦值操作符和析構(gòu)函數(shù)是良好的習(xí)慣,但在寫(xiě)構(gòu)造函數(shù)時(shí)需要注意一些容易的錯(cuò)誤,如下面的代碼:
在下面三種情況下會(huì)調(diào)用拷貝構(gòu)造函數(shù):
(1)用一個(gè)已經(jīng)實(shí)例化了的該類對(duì)象,去實(shí)例化該類的另外一個(gè)對(duì)象;
(2)用該類的對(duì)象傳值的方式作為一個(gè)函數(shù)的參數(shù);
(3)一個(gè)函數(shù)返回值為該類的一個(gè)對(duì)象。
特別地,對(duì)于語(yǔ)句 M m; M mm=m; 屬于(1)情況,即語(yǔ)句M mm=m;調(diào)用的是拷貝構(gòu)造函數(shù),而不是構(gòu)造函數(shù)。
但在重載=操作符時(shí),返回值不是引用類型將導(dǎo)致程序運(yùn)行出現(xiàn)嚴(yán)重問(wèn)題。即如果出現(xiàn)上面會(huì)調(diào)用拷貝構(gòu)造函數(shù)的三種情況之一,或者使用=操作符時(shí),拷貝構(gòu)造函數(shù)和operator =將循環(huán)遞歸調(diào)用,導(dǎo)致程序出現(xiàn)死循環(huán)。原因是拷貝構(gòu)造函數(shù)和operator =之間不斷地重復(fù)調(diào)用。
解決辦法:將operator =的返回類型改為引用類型M&,此時(shí)調(diào)用operator =時(shí)不會(huì)去調(diào)用拷貝構(gòu)造函數(shù)。
還有,若要寫(xiě)clone時(shí),若通過(guò)下面的方式:
前提是拷貝構(gòu)造函數(shù)不能調(diào)用clone來(lái)完成拷貝,否則出現(xiàn)上面同樣的問(wèn)題,下面的代碼就會(huì)出現(xiàn)這樣的問(wèn)題
總之,在寫(xiě)這些函數(shù)時(shí),要特別留意彼此的調(diào)用關(guān)系。
以下是我的慣用寫(xiě)法:
(A)對(duì)于拷貝構(gòu)造函數(shù)和重載=操作符
這里寫(xiě)成了inline函數(shù),只是方便說(shuō)明問(wèn)題,其實(shí)不必非要這么寫(xiě),可以采取先聲明,后定義的常規(guī)方法。
(B)對(duì)于clone函數(shù)
聲明: virtual M clone(); //考慮繼承時(shí)的多態(tài)
定義:
2008年9月12日 #
2008年9月11日 #
As mentioned earlier, it is more efficient to reuse statements than to drop them and allocate new ones. Before executing a new SQL statement on a statement, applications should be sure that the current statement settings are appropriate. These include statement attributes, parameter bindings, and result set bindings. Generally, parameters and result sets for the old SQL statement need to be unbound (by calling SQLFreeStmt with the SQL_RESET_PARAMS and SQL_UNBIND options) and rebound for the new SQL statement.
When the application has finished using the statement, it calls SQLFreeHandle to free the statement. After freeing the statement, it is an application programming error to use the statement's handle in a call to an ODBC function; doing so has undefined but probably fatal consequences.
When SQLFreeHandle is called, the driver releases the structure used to store information about the statement.
SQLDisconnect automatically frees all statements on a connection.
2008年2月26日 #
Dom Programming Guid: (Apache)http://www.slac.stanford.edu/exp/glast/ground/software/extDoc/xerces/2_6_0/doc/program-dom.html#validation-dynamic
Java與XML聯(lián)合編程之DOM篇:http://kimmyzhang.zhmy.com/archives/2006/9579.shtml
DOM初步及jdom的介紹:http://www.xml.org.cn/dispbbs.asp?boardID=11&ID=37000
DOM的一些介紹:http://blog.sina.com.cn/u/57db2a730100037i
用Xerces操作XML文檔:http://blog.sina.com.cn/u/57db2a73010002p5
使用 Xerces-C++ 緩存和序列化 XML 模式:http://www-128.ibm.com/developerworks/cn/xml/x-xsdxerc.html
充分利用 Xerces-C++,第 1 部分:http://www-128.ibm.com/developerworks/cn/xml/x-xercc/
技巧: 如何利用Xerces C++正確處理XML文檔中的WhiteSpaceL:http://www-128.ibm.com/developerworks/cn/xml/tips/x-xercesc2/淺談利用Xerces C++解析XML文檔http://hi.baidu.com/fx0517/blog/item/258f12d53c32c6c451da4bb3.htmlapache xerces c++ windows 下編譯與vc6實(shí)例 http://blog.csdn.net/smq65/archive/2006/09/04/1174368.aspx
2008年1月31日 #
Copyright @ r2100 Powered by: .Text and ASP.NET Theme by: .NET Monster