Looping over a range of numbersBad:for i in [0,1,2,3,4,5]: print i**2Good:for i in range(6): print i**2Looping over a collection:Bad:colors = [ ...
分类:
编程语言 时间:
2015-07-19 23:30:34
阅读次数:
201
重构代码更多的是对程序的可读性和可扩展性上做一些优化。首先我对可读性进行细化。借鉴大神川山甲的重构系列文http://www.cnblogs.com/baochuan/archive/2012/03/31/2425441.html,我也来抛砖引玉。面对一些有bad smell的代码,我们应该如何处理...
分类:
Web程序 时间:
2015-07-19 00:02:45
阅读次数:
186
题意:有一个数列 seed[x+1]=(seed(x)+step)%mod 给出 step 和 mod 如果求出的是以 1。。。mod-1 为循环节的数列 则为 good choice 否则 则是 bad choice思路:1.用标记法 如果 形成循环节时 每个数都被标记到 则good choice...
分类:
其他好文 时间:
2015-07-18 12:13:38
阅读次数:
180
Problem Description
Timer took the Probability and Mathematical Statistics course in the 2012, But his bad attendance angered Professor Tian who is in charge of the course. Therefore, Professor Tia...
分类:
其他好文 时间:
2015-07-17 18:58:22
阅读次数:
121
Hoeffding公式为\epsilon]\leq{2e^{-2\epsilon^2N}}">如果把Training error和Test error分别看成和的话,Hoeffding告诉我们,取样出来的v和总的u大部分是比较接近的,很小的概率是差很远的,即Ein和Eout差很远,这种情况称为Bad...
分类:
其他好文 时间:
2015-07-17 00:20:30
阅读次数:
221
We want:根据Hoeffding:但是M是无穷大的,是否可以找到一个有穷大的m_H去替代无穷大的M?思考:M从何而来。Hset里有M个h,对于每个Data,只要存在一个h会造成Bad,即Ein和Eout差很远,则称该Data是一个Bad sample,因此是用or的关系。这里的upper bo...
分类:
其他好文 时间:
2015-07-17 00:14:18
阅读次数:
164
You Gotta Care About the CodePete GoodliffeIT DOESN’T TAKE SHERLOCK HOLMES to work out that good programmers write good code. Bad programmers…don’t. They produce monstrosities that the rest of us have...
分类:
其他好文 时间:
2015-07-15 13:26:23
阅读次数:
110
# mount -t nfs -o nolock 192.168.1.84:/home/jason/filesys /mnt/nfsmount: wrong fs type, bad option, bad superblock on 192.168.1.84:/home/jason/filesys, missing codepage or helper program, or oth...
分类:
其他好文 时间:
2015-07-14 15:44:54
阅读次数:
244
case 10004: error = "Interrupted system call 中断的系统呼叫"; break; case 10009: error = "Bad file number"; break; case 10013: error = "Permission denied 进入被...
分类:
其他好文 时间:
2015-07-13 16:02:47
阅读次数:
100
Description
Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can ...
分类:
其他好文 时间:
2015-07-13 14:01:45
阅读次数:
135