NSLog在开发中是必须使用到的,但是其本身是特别耗费性能的,所以在产品发布后是一定要去掉的。在大的开发项目中一个个处理NSLog是相当困难的,所以可以考虑在pch文件中进行宏定义,如:#define
MyLog(...) NSLog(__VA_ARGS__)待程序发布时可以将后面的NSLog(__...
分类:
其他好文 时间:
2014-06-11 22:10:47
阅读次数:
319
泛型:泛型只是提供给编译器。在编译完之后,生产字节码文件时就擦除类型信息,泛型就不在了泛型的术语:整个Arraylist:称为泛型类型。Arraylist中的E称为类型变量或类型参数整个Arraylisst称为:参数化的类型Arraylist中的Integer称为类型参数的实例。Arraylist中...
分类:
其他好文 时间:
2014-06-11 08:03:03
阅读次数:
265
1.泛型算法:
大多数算法定义在头文件algorithm中,标准库还在头文件numeric中定义了一组数值泛型算法
举例:
find函数用于找出容器中一个特定的值,有三个参数
int val = 10;//val为我们需要查找的值
auto result = find(vec.begin(), vec.end(), val):
cout
find将前两个表示范围的迭代器内的元素与va...
分类:
编程语言 时间:
2014-06-09 23:35:41
阅读次数:
279
题目:
Determine whether an integer is a palindrome. Do this without extra space.
解题思路:
判断一个int型整数是不是回文数字,这个题也不难,依次取得数字最高位和最低位进行比较,就可以判断是不是回文数字。需要注意的是负数不是回文数字。
代码实现:...
分类:
其他好文 时间:
2014-06-08 15:35:48
阅读次数:
375
static void jindutiao_ZF(Args _args){
RunBaseProgress progress; integer i,j;; i = 10000; progress = new...
分类:
其他好文 时间:
2014-06-08 07:24:32
阅读次数:
189
var CommonCheck = { //两个时间比较
compareDate:function(end,start){ var d1Arr=end.split("-"); var
d2Arr=start.split("-"); va...
分类:
Web程序 时间:
2014-06-07 23:51:18
阅读次数:
359
JDK1.5之后的功能自动装箱:指的是开发人员可以把一个基本数据类型直接赋给对应的包装类自动拆箱:指开发人员可以把一个包装类对象直接赋给对应的基本数据类型public
static void main(String[] args) { Integer i = 1; //装箱 int j...
分类:
编程语言 时间:
2014-06-07 23:38:09
阅读次数:
350
Evaluate the value of an arithmetic expression
in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be
an integer or another ex...
分类:
其他好文 时间:
2014-06-07 20:34:41
阅读次数:
214
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:
其他好文 时间:
2014-06-07 12:21:30
阅读次数:
284
这个题比较简单,考虑特殊情况如12000,注意检查反转后数字是否会越界溢出。...
分类:
其他好文 时间:
2014-06-07 12:01:08
阅读次数:
258