`
monkeycn
  • 浏览: 42703 次
  • 性别: Icon_minigender_1
  • 来自: 福州
文章分类
社区版块
存档分类
最新评论
文章列表
对字符编码问题,这里给出ice的策略: #1 Narrow strings (that is, strings mapped to std::string) are presented to the application in UTF-8 encoding and, similarly, the application is expected to provide narrow strings in UTF-8 encoding to the Ice run time for transmission. 首先以8位为一个字节的字符格式,例如ascii,gbk,等,就是能在std::strin ...
用 Visual C++ 创建在 64 位 Windows 操作系统中运行的应用程序时,应注意以下问题: 在 64 位 Windows 操作系统中,int 和 long 是 32 位值。对于计划为 64 位平台编译的程序,应注意不要将指针赋给 32 位变量。在 64 位平台上,指针为 64 位,如果将该指针赋给 32 位变量,则应截断该指针值。 在 64 位 Windows 操作系统中,size_t、time_t 和 ptrdiff_t 是 64 位值。 在 32 位 Windows 操作系统上 Visual C++ 2005 之前的 Visual C++ 版本中,time_t 是 32 ...
使用vc 2008 的bcg 控件有内存泄露: {759} client block at 0x0209DAC8, subtype c0, 200 bytes long. a CMFCVisualManager object at $0209DAC8, 200 bytes long Object dump complete. 程序“[448] facebook_dlg.exe: 本机”已退出,返回值为 2 (0x2)。 在退出前调用 if( CMFCVisualManager::GetInstance () != NULL )         delete CMFCVisualManage ...
使用情景:当类对象被 shared_ptr 管理时,需要在类自己定义的函数里把当前类对象作为参数传给其他函数时,这时需要传递一个 shared_ptr ,否则就不能保持 shared_ptr 管理这个类对象的语义(因为有一个 raw pointer 指向这个类对象, ...
vckbase上那个搜索顺序和递归算法的搜索顺序不同,哥这个就是递归的顺序 void search(string file_exp, string folder, reg_exp* rexp==NULL) { if ( !rexp ) { file1? ==> file[a-zA-Z0-9]{1,1} file* ==> file[a-zA-Z0-9]{0,} rexp = new reg_exp("..."); } foreach(ifile in folder ...
#include<IceUtil/Monitor.h> template<classT>classQueue :publicIceUtil::Monitor<IceUtil::Mutex>{ public: Queue():_waitingReaders(0){} voidput(constT&item){ IceUtil::Monitor<IceUtil::Mutex>::Locklock(*this); _q.push_back(item); if(_w ...
1.需要文件: (1) pcre 下载: http://download.chinaunix.net/download/0008000/7913.shtml tar zxvf pcre-7.9.tar.gz cd pcre-7.9/ ./configure make && make install cd ../ (2)zlib 下载: http://download.chinaunix.net/download/0013000/12241.shtml (3) openssl 下载 http://download.chinaunix.net/download/0001000/11 ...
(1) 安装 libevent cd /tmp wget http://www.monkey.org/~provos/libevent-2.0.4-alpha.tar.gz   注:memcached 用到了 libevent 这个库用于 Socket 的处理,所以 还需要安装 libevent tar zxvf libevent-2.0.4-alpha.tar.gz cd libevent-2.0.4-alpha ./configure -prefix=/usr/local/libevent make make install ln -s /usr/local/libevent/lin/li ...
mysql 数据库分页逻辑 // 基于0,  返回0:错误, 否则返回总页数 uint get_recs_on_page_of(int page_index, int n_per_page) {      int n = select  count(*) from books;      int page_count;      page_count = n/page_count;      n?(page_count += n%page_count?1:0): page_count=1;           if ( page_index >= page_count ) return ...
struct node {     int data;     node* next; }; // 单向链表头,如何倒序操作 inverse(node* head) { node thead; thead.next = NULL; for(current = head; current!=null; ) {      if ( current == head )      { node * t = current->next;          thead.next = current; current->next = NULL;          current = t ...
基于once0.6的高性能socks5服务器:once socks 5 ,windows平台 经过测试,以下软件可以用once socks5代理上网: QQ, Firefox, Chome(C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe --proxy-server=socks5://127.0.0.1:1080), Foxmail, 迅雷, 银河证券, 淘宝旺旺, FlashFXP http://www.co-coding.net/once_socks5_0.1.rar http://www. ...
强大的log4cxx,rapidxml,boost组合起来更加强大: #include "stdafx.h" // include log4cxx header files. #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/helpers/exception.h> #include <rapidxm ...
#1 Log4cxx有比较完整的配置文档方式,xml和java配置档;GLog只能通过启动程序的时候的输入参数来配置; #2 GLog单独写文件的效能比Log4cxx高15%左右;但是GLog写stderr的效能低于Log4cxx; #3 GLog同时写stderr和文件的效能比Log4cxx低; #4 两者占用cpu和内存情况基本相同; #5 二者都支持c的printf和c++的stream类型的输出形式; #6 二者在多线程下都有办法做到当前线程的log输出是连续的; #7 Log4cxx目前可以输出到console、file、remote server和一些特殊的设备,GLog ...
int i=0; // 读取索引数,从0开始 const int n = 5000; // 读取多少次后开始读缓存操作 void read_html() {      if ( i < n ) // 一般操作     {           read_from_disk();           i++;     }     else if ( i==n ) // 建立缓存     {            read_from_disk();            map.lock();            map.add(html_file_name);            map. ...
Linux下必须确保动态库所有的搜索路径中只有一份动态库,这血的教训, 今天遇到问题: nous 不要找了 极品外公22:46:59 问题好像是这样的 极品外公22:47:22 我在 /usr/local/lib保留了一份旧的once库 小贤22:47:42 嗯,那明白了 极品外公22:47:41 然后我把新的copy到 /usr/lib出现了问题 小贤22:47:58 他识别成为旧了 小贤22:48:04 这个问题我越到过 极品外公22:47:53 怎么会这样啊 极品外公22:48:01 极品外公22:48:12 昨天晚上识别到/lib 小贤22:48:26 必须确保他的动态库所有的搜索路 ...
Global site tag (gtag.js) - Google Analytics