Assert.assertEquals("发生错误时报告消息","预期值","生产值"); Assert.assertEquals("精确两位小数点",3.33,10.0/3.0,0.01); Assert.assertNotNull("");//验证是否为非空 ...
分类:
其他好文 时间:
2014-07-07 08:17:40
阅读次数:
168
//Situation System prompts"xxx is not in the sudoers file"(xxx equals the user name)while executing command "sudo": sudo-i Password: xxx ...
分类:
其他好文 时间:
2014-07-06 21:39:36
阅读次数:
175
要求:用户从外部导入TXT文件(input textfile),该文件有三列,分别是storeNum,MosrName,MosrNum,如下是一个input textfile的Case:5099,Scoresby,56595250,Scoresby,56595211,Scoresby,5659513...
分类:
其他好文 时间:
2014-07-06 13:12:43
阅读次数:
232
package com.letv.cloud.spider;import java.util.HashSet;import java.util.List;import us.codecraft.webmagic.Page;import us.codecraft.webmagic.Site;impor...
分类:
Web程序 时间:
2014-07-05 18:52:01
阅读次数:
266
在前面的文章C#相等性比较和C#排序比较中,我已经叙述了类型相等,类型哈希,和类型比较的.NET标准协议。实现了这些协议的类型在一个字典或者列表中也可以正常工作。但是需要注意的是: 只有当类型的Equals方法和GetHashCode方法返回有意义的结果时,该类型才可以作为Dictionary或H....
分类:
其他好文 时间:
2014-07-03 21:33:16
阅读次数:
560
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
分类:
其他好文 时间:
2014-07-03 13:02:23
阅读次数:
200
在使用hashCode的时候,发现会出现相同id,虽然几率很小。虽然发现并不是hashCode的原因,而是其他逻辑的问题。 但是还是试着自己写了一个id生成器,有些id是int的,比如说任务id;有些id是long的,比如说玩家id。先贴代码来看:private static AtomicI...
分类:
其他好文 时间:
2014-07-03 00:45:45
阅读次数:
695
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-07-02 22:34:44
阅读次数:
318
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-07-02 22:10:42
阅读次数:
262
覆盖equals时,遵守通用约定
对equal方法的覆盖看起来很简单,但是有许多情况是容易导致错误,最好的避免这些错误的办法
就是不覆盖equals方法.
必须遵循的原则:
自反性--对于任何非空的引用 x,有x.equals(x) 为true;
对称性--对于任何非空的引用x,y,如果x.equals(y) 为true,则必有y.equals(x) 为true;
传递...
分类:
其他好文 时间:
2014-07-02 17:03:19
阅读次数:
142