岚天逸见

上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 79 下一页

2012年7月24日 #

测试mktime和localtime_r性能及优化方法

摘要: // 编译方法:g++ -g -o x x.cpp或g++ -O2 -o x x.cpp,两种编译方式性能基本相同。//// 结论:// 1) 环境变量TZ和isdst均不影响localtime_r的性能// 2) 环境变量TZ严重影响mktime和localtime... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(190) 评论(0) 推荐(0)

Linux上制作可执行的共享库示例

摘要: http://bbs.hadoopor.com/thread-3313-1-1.htmlx.cpp为共享库libx.so的实现,b.cpp为可执行b的实现。x.cpp文件内容:#include #include // 使用C++作为编译器void woo(){ ... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(129) 评论(0) 推荐(0)

只显示指定网卡IP地址命令

摘要: export eth=1&&netstat -ie|awk -F'[: ]' 'begin{found=0;} { if (match($0,"eth'"$eth"'")) found=1; else if ((1==found) && match($0,"eth")... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(229) 评论(0) 推荐(0)

代码规范:换行对齐问题

摘要: 今天有同事看了我写的代码,问为何逗号要放在前面,以下列两段代码为列:代码段一void function(int a , char b , short c , long d , st... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(687) 评论(0) 推荐(0)

高质量C++编程补充条款

摘要: 文件:高质量C++编程补充条款.pdf大小:169KB下载:下载目录1. 前言 12. 条款:避免使用非众所周知的缩略语 13. 条款:规范好#include 14. 条款:避免长短语句无规律交错 25. 条款:避免头重脚轻 26. 条款:充分利用public和pr... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(105) 评论(0) 推荐(0)

清理disuz垃圾用户信息SQL语句

摘要: -- hadoop开头的是UCenter表,cdb开头的是BBS部分的表-- 搜索出所有垃圾用户名:select `hadoop_members`.`username` from `hadoop_members` left join `cdb_members` on ... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(90) 评论(0) 推荐(0)

解决C++代码单元测试中的难题-不可验证和IO调用

摘要: 在做C++程序的单元测试时,大家经常会遇到两个问题:1.不方便验证测试结果,原因是因为不可访问保护和私有类成员2.对于需要访问的connect、receive、send等不好绕过这里介绍两种方法,即可解决:1.在编译单元测试代码时,加上UNIT_TEST宏(名字可以为... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(105) 评论(0) 推荐(0)

按时间顺序显示指定目录的文件

摘要: 方法:ls -lrt --time-style=long-iso $(find 目录路径 -type f) 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(146) 评论(0) 推荐(0)

如何查看Linux内核是否为64位版本?

摘要: 方法非常简单,LINUX提供了一个查看配置的命令(实际有相应的库函数)getconf,使用它即可,方法如下:getconf LONG_BIT如果返回64,就表示为64位内核,否则应当返回32。 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(294) 评论(0) 推荐(0)

mooon db wrapper

摘要: mooon db wrapper1. 前言mooon db wrapper不是一个DB,仅是对现有的DB API的封装,使得使用更为简单。项目地址:http://code.google.com/p/mooon,可使用SVN下载最新代码。开发和交流论坛:http://b... 阅读全文

posted @ 2012-07-24 16:19 岚天逸见 阅读(167) 评论(0) 推荐(0)

上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 79 下一页

导航