条款13:以对象管理资源
使用RAII,获得资源后立刻放进管理对象,管理对象运用析构函数确保资源被释放。
为防止资源泄露,请使用RAII对象,它们在构造函数中获得资源并在析构函数中释放资源。
两个常被使用的RAII类是tr1::shared_ptr和tr1::auto_ptr。前者通常是较佳选择,因为其拷贝行为比较直观。若选择auto_ptr,复制动作会使被复制物指向null.
条款14...
分类:
编程语言 时间:
2014-08-22 16:22:49
阅读次数:
250
今天coding的时候碰到一个异常:ERROR: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.查了下资料:大部分都是将ntlmauth.dll.....
分类:
数据库 时间:
2014-08-22 16:06:28
阅读次数:
362
1.打开配置文件 2.移除不需要的Block,并添加Log Block 3.添加“Custom Trace Listener” 4.定义Attributes 5.添加定义类库“CustomTraceListenerExtensions” 6.编写代码,如下: using System;
using ...
分类:
Web程序 时间:
2014-08-22 12:24:26
阅读次数:
349
The use of the jQuery library is growing and growing(just released jQuery 1.4), more and more people are using this useful javascript library. This me...
分类:
Web程序 时间:
2014-08-22 09:18:35
阅读次数:
334
这里直接把在网上的找到的答案记录下来,原文地址:http://www.oschina.net/question/109676_15561:如果出现启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误,原因1:给定目录下jvm.d...
分类:
系统相关 时间:
2014-08-21 22:39:54
阅读次数:
707
有时候,日志输出的时候会根据时间来分类,譬如“20140821\trace.log”,在Enterprise Library中通过工具配置,只能定义日志文件名称,可以通过代码修改FlatFileTraceListenerData实现或Custom Trace Listener方式, 通过代码修改Fl...
分类:
Web程序 时间:
2014-08-21 18:48:24
阅读次数:
376
Pillowsupport for JPEG2000 comes fromopenjpeg2 library. Unfortunatly, Ubuntu's libopenjpeg2 package is not version 2 of the openjpeg library, butactua...
分类:
编程语言 时间:
2014-08-21 18:35:14
阅读次数:
363
多线程模型设计是一个比较复杂的逻辑,但是python对于多线程的处理却有种种方便的类库,不需要过多的纠结线程间的操作细节。比如[multiprocessing.Pool](https://docs.python.org/2/library/multiprocessing.html...
分类:
编程语言 时间:
2014-08-21 17:27:04
阅读次数:
339
1.编译目标代码时指定的动态库搜索路径 -rpath; 2.环境变量LD_LIBRARY_PATH指定的动态库搜索路径; 3.配置文件/etc/ld.so.conf中指定的动态库搜索路径; 4.默认的动态库搜索路径/lib; 5.默认的...
分类:
其他好文 时间:
2014-08-21 15:21:44
阅读次数:
245
先把收集到有用资料整理一下,等项目完成再写篇文章
app在后台播放报警音:https://developer.apple.com/library/ios/qa/qa1668/_index.html
后台运行设置:http://blog.shiqichan.com/ios-ble-background-central-scanning/
http://blog.csdn.net/mon...
分类:
移动开发 时间:
2014-08-21 13:24:14
阅读次数:
239