Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:
其他好文 时间:
2014-10-24 13:00:38
阅读次数:
170
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:
其他好文 时间:
2014-10-24 12:28:03
阅读次数:
211
本周遇到了好几个core都很有典型性。在这里和大家分享下。
相信有过Linux编程经验的人,肯定都遇到过。感觉周围人很多对core有天然的恐惧感,尤其对刚入行不久的同学来说。当然了,也有工作好几年看到core也束手无策的。今天就分析一下,core,其实大部分都是很容易解决的。如果一个core很难以复现,那么说明还是很复杂的,算是Corner case,可能需要很长时间,脑子里要有很好的运行时状态才可以(阅读源码,学习的是逻辑;将源码对应到运行时的状态,分析一些状态机的转换,再去分析可能会发生的情况)。相信前...
分类:
系统相关 时间:
2014-10-24 00:28:39
阅读次数:
255
今天又舔着脸开始LeetCode的征程了,本来是写在CSDN的,无奈遇上他家博客老是在升级中。。。题目:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the...
分类:
其他好文 时间:
2014-10-24 00:11:43
阅读次数:
151
Java7中的switch支持String的实现细节作者:zsxwing更新: 2013-03-04 21:08:02 发布: 2012-04-26 13:58:19在Java7之前,switch只能支持 byte、short、char、int或者其对应的封装类以及Enum类型。在Java7中,呼吁...
分类:
编程语言 时间:
2014-10-24 00:02:06
阅读次数:
203
单元测试属于白盒测试,它是所有测试的第一个环节,也是最重要的一个环节。它主要是针对一个类的public的方法来做测试。编写单元测试是一种验证类功能的行为,和优化设计的重要手段,因此它是程序员的工作。编写单元测试的过程从测试列表中取出一个测试case定义一个测试方法pub..
分类:
其他好文 时间:
2014-10-23 21:10:28
阅读次数:
208
1、switch语句执行过程:从第一个匹配条件开始,后边的所有代码都执行,直至结束或遇到 break;
#include
int main()
{
int x = 1,a = 0,b = 0;
switch(x){
case 0:b++;
case 1:a++;
case 2:a++,b++;
}
printf("%d %d\n",a,b);
return 0;
}输出结果: 2...
分类:
其他好文 时间:
2014-10-23 17:43:43
阅读次数:
174
case执行完毕后,会回到CtsTest的run方法中:
这个时候会先将mRemainingTestPkgs列表的第一项移除,以便下一次取第一个的时候,取的是新的TestPackage对象,然后根据case的类别来做相应的重启操作,最后返回到主界面。最后,截图留下犯罪现场,下载之前安装的jar包。在finally语句块中report未执行的case。为执行的case是通过执行...
分类:
其他好文 时间:
2014-10-23 14:26:40
阅读次数:
251
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
class Solution {
public:
std::vector anagrams(std::vector &strs) {
...
分类:
其他好文 时间:
2014-10-23 09:33:28
阅读次数:
173
pathmunge () { case ":${PATH}:" in *:"$1":*) ;; *) if [ "$2" = "after" ] ; then PATH=$PATH:$1 ...
分类:
其他好文 时间:
2014-10-23 01:21:29
阅读次数:
775