当出现以下问题的时候,就要开始重构代码。 1)重复代码
重复代码在业务逻辑相同的地方,抽成方法。重复代码在业务逻辑不同的地方。抽成类。 2)long method
其实这个问题很多时候都碰到。我觉得原因主要还是两个。一个是修bug的时候,不敢改。因为这玩意,要改的话,压力还是很大的。还有一个写好之后...
分类:
其他好文 时间:
2014-05-19 15:35:39
阅读次数:
208
我的环境是ubuntu14.04安装scrapy,我使用pip
安装如果你还没安装pip,用下面命令安装sudo apt-get install python-pip然后使用pip来安装python相关的库扩展pip
install scrapy不过出现错误error: could not cre....
分类:
其他好文 时间:
2014-05-19 15:19:27
阅读次数:
364
vector::const_iterator result =
find(vector.begin(). vector.end(),search_value); 如果查找失败,分会end()
如果有两个,会返回哪一个的迭代器?int *reauslt = find(ia,ia+6,search_va...
分类:
编程语言 时间:
2014-05-19 15:15:33
阅读次数:
324
Context.javapackage edu.interpreter;public class
Context { private String input; private int output; public String getInput() {
return...
分类:
其他好文 时间:
2014-05-19 14:56:22
阅读次数:
322
域和静态方法不具有多态性:public class Test3 { public static
void main(String[] args) { Super sup = new Sub(); System.out.println(sup.field);
System.out.println...
分类:
其他好文 时间:
2014-05-19 14:28:59
阅读次数:
314
题目链接Given two numbers represented as strings,
return multiplication of the numbers as a string.Note: The numbers can be
arbitrarily large and are non-...
分类:
其他好文 时间:
2014-05-19 14:10:25
阅读次数:
250
一个基本的该类型字符串例子:@"This is a constant character
string object";在后台显示它:NSLog (@"%@", @"This is a constant character string
object");得到其长度:int len = [@"Hel...
分类:
其他好文 时间:
2014-05-19 13:59:33
阅读次数:
234
## 简单的python下载脚本 ##----------思路-- - 视频播放地址提取
直接解析一下原网页的源文件,利用正则就可以得到所有视频的播放地址,下面的代码以微信公共平台python教程的播放地址为例。 - 视频链接提取
这里利用了[飞驴视频下载API][1]进行视频链...
分类:
编程语言 时间:
2014-05-19 13:52:54
阅读次数:
423
在Action中execute方法声明为:public String execute()
throws Exception,这样,Action可以抛出任何Exception。 1)自己实现异常处理
我们还以helloWorldAction为例,在Action的execute方法中这样写:pu...
分类:
其他好文 时间:
2014-05-19 13:40:38
阅读次数:
185
http://space.itpub.net/14466241/viewspace-624132示例代码如下:namespace
SampleListT{ class Program { static void Main(string[] args) { //using System...
分类:
其他好文 时间:
2014-05-19 13:28:56
阅读次数:
233