随笔分类 -  c++

c++ 类的堆成员的声明及使用
摘要:_reg = new boost::regex("aoe "); boost::regex_search(line, what, *_reg) 阅读全文

posted @ 2016-02-02 11:00 雨渐渐 阅读(285) 评论(0) 推荐(0) 编辑

c 时间转移函数
摘要:/* @param date @param formart of date @return time_t @author yangqijun@outlook.com */ time_t strtotime(char* const date,char* const format="%Y%m%d%H%M 阅读全文

posted @ 2016-01-29 14:53 雨渐渐 阅读(221) 评论(0) 推荐(0) 编辑

replay的意义
摘要:数据库重放: (1) 在测试环境中重新创建实际的生产数据库工作量。 (2) 在生产中实施更改之前,确定和分析潜在的不稳定性。 (3) 捕获生产中的工作量: 阅读全文

posted @ 2015-12-16 15:04 雨渐渐 阅读(257) 评论(0) 推荐(0) 编辑

c++ 异常 warning: 'MEMORY_UNIT_NAME' defined but not used
摘要:是开关的问题 , 将 #-g -O2 -pipe -W -Wall -Werror -fPIC -Wno-deprecated c++ 去掉。不检查。 阅读全文

posted @ 2015-12-11 17:35 雨渐渐 阅读(592) 评论(0) 推荐(0) 编辑

c++ 异常 discards qualifiers 丢弃
摘要:src/feedbackservice.cpp:76: error: passing `const ps::spider::urlreceiver::entry::ConfigManager' as `this' argument of `int ps::spider::urlreceiver::e... 阅读全文

posted @ 2015-12-08 20:25 雨渐渐 阅读(1581) 评论(0) 推荐(0) 编辑

c++ 条件变量
摘要:1.条件变量创建静态创建:pthread_cond_t cond=PTHREAD_COND_INITIALIZER;动态创建:pthread_cond _t cond; pthread_cond_init(&cond,NULL);其中的第二个参数NULL表示条件变量的属性,虽然POSIX中定义了条... 阅读全文

posted @ 2015-12-08 13:51 雨渐渐 阅读(3919) 评论(0) 推荐(0) 编辑

c++ >>
摘要:_bit = new char[(_bit_arr_length >> 3) + 1]; if (_bit == NULL) {std::cout << "malloc failed" << std::endl; _success = false;return;} memset(_bit, 0, ( 阅读全文

posted @ 2015-12-03 23:20 雨渐渐 阅读(200) 评论(0) 推荐(0) 编辑

c++ ip地址相关
摘要:#include #include #include #include #include #include #define NUM 20void *working(void *args) { in_addr* inaddr = (in_addr* )args; //inaddr.s_ad... 阅读全文

posted @ 2015-11-27 18:49 雨渐渐 阅读(299) 评论(0) 推荐(0) 编辑

c++ ip地址的操作 c版
摘要:http://blog.csdn.net/cpp_funs/article/details/69881541、htonl ()和ntohl( )u_long PASCAL FAR ntohl (u_long netlong);u_short PASCAL FAR ntohs (u_short net... 阅读全文

posted @ 2015-11-26 19:05 雨渐渐 阅读(1259) 评论(0) 推荐(0) 编辑

c++ 缺少动态库
摘要:http://www.cnblogs.com/smartvessel/archive/2011/01/21/1940868.html总结下来主要有3种方法:1. 用ln将需要的so文件链接到/usr/lib或者/lib这两个默认的目录下边ln -s /where/you/install/lib/*.... 阅读全文

posted @ 2015-11-25 21:06 雨渐渐 阅读(448) 评论(0) 推荐(0) 编辑

c++ dirname() basename()
摘要:http://linux.about.com/library/cmd/blcmdl3_dirname.htm#include #include int main(void) { char *path = "../conf/pipe_client.conf"; std::cout << p... 阅读全文

posted @ 2015-11-18 21:23 雨渐渐 阅读(4252) 评论(0) 推荐(0) 编辑

c++ swap 函数
摘要:转载地址1,最通用的模板交换函数模式:创建临时对象,调用对象的赋值操作符。 template void swap ( T& a, T& b ) { T c(a); a=b; b=c; } 需要构建临时对象,一个拷贝构造,两次赋值操作。2,针对int型... 阅读全文

posted @ 2015-11-17 15:10 雨渐渐 阅读(1384) 评论(0) 推荐(0) 编辑

c++ 原子操作
摘要:转载自:http://blog.csdn.net/yockie/article/details/8838686 所谓的原子操作,取的就是“原子是最小的、不可分割的最小个体”的意义,它表示在多个线程访问同一个全局资源的时候,能够确保所有其他的线程都不在同一时间内访问相同的资源。也就是他确保了在同一时刻... 阅读全文

posted @ 2015-11-09 09:41 雨渐渐 阅读(4413) 评论(0) 推荐(1) 编辑

c++ 格式化printf
摘要:类型为uint64_t的变量,使用printf进行打印时,需要区分操作系统:64位系统:使用%ld32位系统:使用%llu#include#include int64_t a = 9102928374747474; int main(void) { std::cout << a << std::en... 阅读全文

posted @ 2015-11-05 11:21 雨渐渐 阅读(687) 评论(0) 推荐(0) 编辑

c++ 单例模式
摘要:class C{private: C();public: static C* get_instance();}待测 阅读全文

posted @ 2015-11-05 09:41 雨渐渐 阅读(117) 评论(0) 推荐(0) 编辑

c++ 时间格式化
摘要:struct tm tm_time; strptime(time.c_str(), "%Y%m%d %H:%M:%S", &tm_time); time_t tt = mktime(&tm_time);mktime() python time模块也有这个函数。-------------------- 阅读全文

posted @ 2015-11-04 19:09 雨渐渐 阅读(554) 评论(0) 推荐(0) 编辑

c++ read
摘要:#include #include int main(void) { char url[1000] = {0}; int buff_len = 1000; std::ifstream read("./urls"); if (!read) { // 这跟python语法相似啊 ... 阅读全文

posted @ 2015-11-04 04:48 雨渐渐 阅读(1729) 评论(0) 推荐(0) 编辑

c++ 时间与字符串转换
摘要:1、时间转字符串函数size_t strftime( char *strDest, size_t maxsize, const char *format, const struct tm *timeptr );2、字符串转时间函数char *strptime(const char *s, const... 阅读全文

posted @ 2015-10-30 17:31 雨渐渐 阅读(586) 评论(0) 推荐(0) 编辑

c++ switch case
摘要:http://www.cnblogs.com/RealOnlyme/articles/2579628.html 阅读全文

posted @ 2015-10-27 17:04 雨渐渐 阅读(103) 评论(0) 推荐(0) 编辑

c++ 常用数据接口 set
摘要:#include #include #include int main(void) { std::set sites; std::string site0 = "sina.com.cn"; std::string site1 = "sina.com.cn"; std::str... 阅读全文

posted @ 2015-09-18 14:38 雨渐渐 阅读(854) 评论(0) 推荐(0) 编辑

导航