可迭代的类实现一个可迭代的类,需要在类里面定义两种方法:1. __iter__():返回iterator对象本身2. next():每当next()方法被调用时,返回下一个值,直到抛出StopIteration的异常 1 class Fabonacci(object): 2 """Fabon...
分类:
其他好文 时间:
2014-08-19 23:44:05
阅读次数:
191
日前,为测试一个传入多参数的方法,使用了junit进行单元测试,由于接触单元测试不久,很多不熟悉的地方,弄了挺久的。这里试用了两种方法进行测试,由于是新手,很多需要改善学习。示例方法:public void add(Long a,Long b,String c,String d,Date date1...
分类:
其他好文 时间:
2014-08-19 23:43:55
阅读次数:
242
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the". 1 public class Solution { 2 ....
分类:
编程语言 时间:
2014-08-19 23:43:45
阅读次数:
209
table{table-layout:fixed;}table tr td:first-child,table tr td:first-child{width:120px;}首行第一个td定宽同列的宽度都会和他一样.*注意 第一行 第一个用的是 td 还是 th
分类:
Web程序 时间:
2014-08-19 23:43:25
阅读次数:
188
1. 图2. 图的存储结构2.1 数组表示法(邻接矩阵表示法)2.2 邻接表2.3 十字链表2.4 邻接多重表1. 图顶点:图中的数据元素。V是顶点的有穷非空集合。弧:表示从v到w的一条弧,v为弧尾,w为弧头。VR是两个顶点关系的集合。无向图:若∈VR,必有∈VR,则此图为无向图。有向图:无上述关系...
分类:
其他好文 时间:
2014-08-19 23:43:05
阅读次数:
433
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.la...
分类:
移动开发 时间:
2014-08-19 23:42:45
阅读次数:
313
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2014-08-19 23:42:35
阅读次数:
227
Being a Good Boy in Spring FestivalTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4658Accepted Su...
分类:
编程语言 时间:
2014-08-19 23:42:15
阅读次数:
226
centos7默认的php是5.5,mysql已经变为mariadb,如果想要自定义的配置,需要自己手动来编译配置.以下步骤在公司服务器上已经正常操作过.1、安装centos7选择基本安装,配置完网络后首先要先关闭firewall:停止firewall# systemctl stop firewal...
分类:
其他好文 时间:
2014-08-19 23:42:05
阅读次数:
495