链接: http://poj.org/problem?id=1258Agri-NetTime Limit:1000MSMemory Limit:10000KTotal Submissions:38326Accepted:15424DescriptionFarmer John has been ele...
分类:
其他好文 时间:
2014-07-09 00:11:17
阅读次数:
251
#coding=utf-8import osimport hashlibdef GetFileMd5(filename): if not os.path.isfile(filename): print(filename) return mymd5 = has...
分类:
其他好文 时间:
2014-07-08 23:52:38
阅读次数:
502
最近工作中,发现了一个bug,是和ListView Adapter有关的。产生了FC,描述信息大约是
"The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a b...
分类:
其他好文 时间:
2014-07-08 20:09:41
阅读次数:
199
Ruby has its own style to define the abstract methods in its class....
分类:
其他好文 时间:
2014-07-08 19:45:49
阅读次数:
145
题目
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
解答
首先要注意空链表不成环;不能开额外的空间,即空间复杂度是o(1),可采用“快慢指针”查检查链表是否含有环,如果在快的指针能够追上慢的指针,则有环,否...
分类:
其他好文 时间:
2014-07-08 19:17:47
阅读次数:
160
Robot Motion
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 10267
Accepted: 5001
Description
A robot has been programmed to follow the instructions ...
分类:
其他好文 时间:
2014-07-08 19:13:43
阅读次数:
203
Singleton is one design pattern in the software engineering. Ruby has its own special feature to declare singleton class...
分类:
其他好文 时间:
2014-07-08 18:05:25
阅读次数:
213
《Think in java·第 6 章类再生》
读TIJ -1 对象入门 中已经就代码复用性吐槽了。继承关系在结果上(不是为了代码复用而设计继承关系)为代码复用提供了新的途径。
本章看其目录就比较杂,程序员的内聚思想去哪儿了?合成复用优先——合成、继承,为什么实现继承是不好的……
6.1 合成的语法
解释了一个例程,没有什么好说的。has_a关系。
6.2 继承的语法
【You ca...
分类:
其他好文 时间:
2014-07-08 18:01:33
阅读次数:
198
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2...
分类:
其他好文 时间:
2014-07-08 17:54:12
阅读次数:
297
importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.PreparedStatement;importjava.sql.ResultSet;publicclasstest{publicstaticfinalStringDBDRIVER="com.mysql.jdbc.Driver";//定义MySQL数据库的连接地址publicstaticfinalStringDBURL="jdbc:mysql://lo..
分类:
数据库 时间:
2014-07-08 10:04:24
阅读次数:
357