字段摘要staticintMAX_VALUE 保持 int 类型的最大值的常量可取的值为
231-1。staticintMIN_VALUE 保持 int 类型的最小值的常量可取的值为 -231。staticintSIZE 以二进制补码形式表示 int
值的位数。staticClassTYPE ...
分类:
编程语言 时间:
2014-05-12 15:49:08
阅读次数:
423
两个Activity之间的传参的具体做法如下: 1.新建一个Bundle类 Bundle
bundle=new Bundle(); 2.向Bundle类中放入数据(类似于map) bundle.putString("key" ," value");
3.新建一个intent对象,并将该bund...
分类:
其他好文 时间:
2014-05-06 09:05:48
阅读次数:
349
1、定义ServiceContract及实现 [ServiceContract] public
interface IMemberService { [OperationContract] string GetData(int value); ...
分类:
Web程序 时间:
2014-05-06 01:03:39
阅读次数:
383
命名的返回值优化:
针对返回一个局部的变量的优化,可以直接用返回的结果对象直接替代局部变量,从而减少了一个复制拷贝,从而提高效率。比如 一个函数如下:X bar(){ X xx;
// .. 处理xx return xx;}而在编译器看来则是如下的代码: // 此处的_resu...
分类:
其他好文 时间:
2014-05-06 00:01:10
阅读次数:
442
1.const修饰普通变量和指针const修饰变量,一般有两种写法:constTYPEvalue;TYPEconstvalue;这两种写法在本质上是一样的。它的含义是:const修饰的类型为TYPE的变量value是不可变的。对于一个非指针的类型TYPE,无论怎么写,都是一个含义,即value只不可...
分类:
编程语言 时间:
2014-05-05 23:46:44
阅读次数:
351
1.利用返回值而不是副作用来写程序(副作用包含破坏性修改对象以及对变量赋值).2.需要返回多个值请使用multiple-value-bind和values的组合方式.3.函数式编程需要思考你要什么,而不是要怎么做.4.一个给定的调用可以安全的修改它唯一拥有的东西(函数拥有被调用函数返回的对象,但不拥...
分类:
其他好文 时间:
2014-05-05 23:30:48
阅读次数:
358
在做hibernate修改和删除的时候,可能会遇到
org.hibernate.NonUniqueObjectException异常,a different object with the same
identifier value was already associated with the s...
分类:
系统相关 时间:
2014-05-05 22:27:35
阅读次数:
361
Write an efficient algorithm that searches for
a value in anmxnmatrix. This matrix has the following properties:Integers in
each row are sorted from l...
分类:
其他好文 时间:
2014-05-02 10:41:53
阅读次数:
267
Given a sorted array and a target value, return
the index if the target is found. If not, return the index where it would be if
it were inserted in or...
分类:
其他好文 时间:
2014-05-02 09:54:11
阅读次数:
269
最近在看Jdk6中String的源码的时候发现String的有个这样的构造方法,源代码内容如下:
public String(String original) {
int size = original.count;
char[] originalValue = original.value;
char[] v;
if (originalValue.length > size) {
...
分类:
其他好文 时间:
2014-05-02 06:34:52
阅读次数:
237