Integer 中public static Integer valueOf(int i) { assert IntegerCache.high >= 127; if (i >= IntegerCache.low && i <= IntegerCache.high) ret...
分类:
其他好文 时间:
2015-08-28 10:58:17
阅读次数:
145
什么时候用assert。assertion(断言)在软件开发中是一种常用的调试方式,很多开发语言中都支持这种机制。在实现中,assertion就是在程序中的一条语句,它对一个boolean表达式进行检查,一个正确程序必须保证这个boolean表达式的值为true;如果该值为false,说明程序已经处于不正确的状态下,系统将给出警告或退出。一般来说,assertion用于保证程序最基本、关键的正确性。...
分类:
编程语言 时间:
2015-08-28 09:38:17
阅读次数:
219
使用了pypiwin32包中的pythoncom的时候,当跑在apache下,日志报错:[Thu Aug 27 17:06:44 2015] [error] [client 127.0.0.1] import pywintypes[Thu Aug 27 17:06:44 2015] [error] ...
分类:
其他好文 时间:
2015-08-27 18:30:06
阅读次数:
284
几个重点强调一下:
(1)注意使用assert;
(2)strcat 和 strcpy最后注意赋值'\0';
(3)strcpy注意内存覆盖的情况;
(4)strcmp中:while(!(ret = *(unsigned char *)s1 - *(unsigned char *)s2) && *s2 != '\0');???为什么要转换类 型;
(5)...
分类:
其他好文 时间:
2015-08-27 15:15:57
阅读次数:
144
var assert = require('assert');var ASN1 = { EOC: 0, Boolean: 1, Integer: 2, BitString: 3, OctetString: 4, Null: 5, OID: 6, ObjectDescriptor: 7, Extern...
分类:
Web程序 时间:
2015-08-27 15:01:50
阅读次数:
1219
强调一下几个重点:
(1)new 操作符申请内存失败,是抛出异常,并不是返回NULL,若想申请失败返回NULL,需要加 (std::nothrow);
(2)使用std::nothrow 需要加头文件 #include
(3)使用assert
(4)构造函数有参数时最好加默认参数,这样就有默认构造函数了,且不要忘了定义为const
(5)赋值操作符函数体if语句中的条件必须是 this ...
分类:
其他好文 时间:
2015-08-27 11:09:44
阅读次数:
172
配置文件路径可通过命令查看/usr/local/php/bin/php-i|headvim/usr/local/php/etc/php.ini1)disable_functions禁用一些高风险的函数,默认为空disable_functions=eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,passthru,exec,system,chroot,scandir,chgrp,chown,e..
分类:
Web程序 时间:
2015-08-27 00:46:50
阅读次数:
154
android使用微软雅黑字体,需要下载字体 ttf文件下载地址:http://download.csdn.net/detail/xiaoliu123586/9049219放在assert,然后引用即可,如下图:1 Button button= (Button) this.findViewById(...
分类:
移动开发 时间:
2015-08-26 13:52:28
阅读次数:
534
1、assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: #include?<assert.h> void?assert(?int?expression?); ??????assert的作用是现计算表达式?express...
分类:
编程语言 时间:
2015-08-26 09:34:43
阅读次数:
187
C语言指针和内存泄露常见的内存错误:1.内存分配未成功却使用了它。如果指针p是函数的参数,要在函数的入口处用assert(p!=NULL)进行检查;如果是用malloc来动态申请内存,应该用if(p==NULL)或if(p!=NULL)进行防错处理。2.内存分配成功,尚未初始化就使用它。3.内存分配..
分类:
编程语言 时间:
2015-08-26 00:01:28
阅读次数:
448