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日 #
對于C++類:顯示地寫出拷貝構(gòu)造函數(shù),重載賦值操作符和析構(gòu)函數(shù)是良好的習慣,但在寫構(gòu)造函數(shù)時需要注意一些容易的錯誤,如下面的代碼:
在下面三種情況下會調(diào)用拷貝構(gòu)造函數(shù):
(1)用一個已經(jīng)實例化了的該類對象,去實例化該類的另外一個對象;
(2)用該類的對象傳值的方式作為一個函數(shù)的參數(shù);
(3)一個函數(shù)返回值為該類的一個對象。
特別地,對于語句 M m; M mm=m; 屬于(1)情況,即語句M mm=m;調(diào)用的是拷貝構(gòu)造函數(shù),而不是構(gòu)造函數(shù)。
但在重載=操作符時,返回值不是引用類型將導致程序運行出現(xiàn)嚴重問題。即如果出現(xiàn)上面會調(diào)用拷貝構(gòu)造函數(shù)的三種情況之一,或者使用=操作符時,拷貝構(gòu)造函數(shù)和operator =將循環(huán)遞歸調(diào)用,導致程序出現(xiàn)死循環(huán)。原因是拷貝構(gòu)造函數(shù)和operator =之間不斷地重復調(diào)用。
解決辦法:將operator =的返回類型改為引用類型M&,此時調(diào)用operator =時不會去調(diào)用拷貝構(gòu)造函數(shù)。
還有,若要寫clone時,若通過下面的方式:
前提是拷貝構(gòu)造函數(shù)不能調(diào)用clone來完成拷貝,否則出現(xiàn)上面同樣的問題,下面的代碼就會出現(xiàn)這樣的問題
總之,在寫這些函數(shù)時,要特別留意彼此的調(diào)用關(guān)系。
以下是我的慣用寫法:
(A)對于拷貝構(gòu)造函數(shù)和重載=操作符
這里寫成了inline函數(shù),只是方便說明問題,其實不必非要這么寫,可以采取先聲明,后定義的常規(guī)方法。
(B)對于clone函數(shù)
聲明: virtual M clone(); //考慮繼承時的多態(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實例 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