李sir_Blog

博客园 首页 联系 订阅 管理

2011年3月21日

摘要: 打开D:\oracle\product\10.2.0\db_1\network\admin下的sqlnet.ora修改SQLNET.AUTHENTICATION _SERVICES=(NONE) 阅读全文
posted @ 2011-03-21 16:33 李sir 阅读(636) 评论(0) 推荐(0)

摘要: void main() { LARGE_INTEGER lv; // 获取每秒多少CPU Performance Tick QueryPerformanceFrequency( &lv ); // 转换为每个Tick多少秒 double secondsPerTick = 1.0 / lv.QuadPart; for ( size_t i = 0; i < 100; ++i ) { // 获取CPU运行到现在的Tick数 QueryPerformanceCounter( &lv ); // 计算CPU运行到现在的时间 // 比GetTickCount和timeGetTime 阅读全文
posted @ 2011-03-21 11:06 李sir 阅读(667) 评论(0) 推荐(0)

摘要: 精确的时间计时,有时候是非常必要的。比如播放多媒体时视频与音频的时间同步,还有在测试代码的性能时,也需要使用到非常精确的时间计时。还有测试硬件的性能时,也需要精确的时间计时。这时就需要使用QueryPerformanceCounter来查询定时器的计数值,如果硬件里有定时器,它就会启动这个定时器,并且不断获取定时器的值,这样的定时器精度,就跟硬件时钟的晶振一样精确的。QueryPerformanceCounter 查询性能计数器 The QueryPerformanceCounter function retrieves the current value of the high-resolu 阅读全文
posted @ 2011-03-21 11:05 李sir 阅读(1690) 评论(0) 推荐(0)

摘要: 1.boost::any boost::any是一种通用的数据类型,可以将各种类型包装后统一放入容器内最重要的它是类型安全的。有点象COM里面的variant.使用方法:any::type() 返回包装的类型any_cast可用于any到其他类型的转化 #include < boost / any.hpp > void test_any() {typedefstd::vector < boost::any > many;manya;a.push_back( 2 );a.push_back( string ( " test " )); for (uns 阅读全文
posted @ 2011-03-21 10:57 李sir 阅读(10453) 评论(1) 推荐(1)

摘要: Log4cxx是开放源代码项目Apache Logging Service的子项目之一,是Java社区著名的log4j的c++移植版,用于为C++程序提供日志功能,以便开发者对目标程序进行调试和审计。有关log4cxx的更多信息可以从Apache Loggin Service的网站http://logging.apache.org获得。当前的最新版本为0.10.0,本文内容及示例代码都是基于此版本。可以从官方网站(http://logging.apache.org/log4cxx/index.html)获取源代码,下载版本为apache-log4cxx-0.10.0,下载完成后解压缩到合适目录 阅读全文
posted @ 2011-03-21 10:46 李sir 阅读(4671) 评论(0) 推荐(0)