英文原文:Top 6 Refactoring Patterns to Help You Score 80% in Code Quality 在过去做了不少代码走读,发现了一些代码质量上比较普遍的问题,以下是其中的前五名:臃肿的类: 类之所以会臃肿,是因为开发者缺乏对最基本的编码原则,即“单一职责原....
分类:
其他好文 时间:
2014-08-25 18:41:04
阅读次数:
183
Problem Description
Dragon is watching competitions on TV. Every competition is held between two competitors, and surely Dragon's favorite. After each competition he will give a score of either 0 or ...
分类:
其他好文 时间:
2014-08-21 22:53:15
阅读次数:
245
参考文献
某海量用户网站,用户拥有积分,积分可能会在使用过程中随时更新。现在要为该网站设计一种算法,在每次用户登录时显示其当前积分排名。用户最大规模为2亿;积分为非负整数,且小于100万。
存储结构
首先,我们用一张用户积分表user_score来保存用户的积分信息。
表结构:
scoreschema" title="" style="border:0px">
示例数据:
sco...
分类:
其他好文 时间:
2014-08-21 19:28:14
阅读次数:
362
-- ------------------------------------------------------------ 表的结构 `score`--CREATE TABLE IF NOT EXISTS `score` ( `id` int(11) NOT NULL AUTO_INCREME....
分类:
数据库 时间:
2014-08-21 01:34:43
阅读次数:
624
题目链接:uva 11651 - Krypton
Number System
题目大意:给定进制base,和分数score,求在base进制下,有多少个数的值为score,要求不能有连续相同的数字以及前导0.计算一个数的值即为相邻两位数的平方差和。
解题思路:因为score很大,所以直接dp肯定超时,但是即使对于base=6的情况,每次新添一个数score最大增加25(0-5),所...
分类:
其他好文 时间:
2014-08-21 00:17:43
阅读次数:
284
Problem Description
Xueba: Using the 4-Point Scale, my GPA is 4.0.
In fact, the AVERAGE SCORE of Xueba is calculated by the following formula:
AVERAGE SCORE = ∑(Wi * SCOREi) / ∑(Wi) 1
where ...
分类:
其他好文 时间:
2014-08-20 14:08:06
阅读次数:
173
Problem Description
Xueba: Using the 4-Point Scale, my GPA is 4.0.
In fact, the AVERAGE SCORE of Xueba is calculated by the following formula:
AVERAGE SCORE = ∑(Wi * SCOREi) / ∑(Wi) 1
where SC...
分类:
其他好文 时间:
2014-08-20 00:07:55
阅读次数:
310
Problem Description
Xueba: Using the 4-Point Scale, my GPA is 4.0.
In fact, the AVERAGE SCORE of Xueba is calculated by the following formula:
AVERAGE SCORE = ∑(Wi * SCOREi) / ∑(Wi) 1
where SC...
分类:
其他好文 时间:
2014-08-19 19:02:25
阅读次数:
422
#include void main(){ /*方法一 int score; printf("请输入分数:\n") ; scanf("%d",&score); if (score>=90&&score=80) { printf("等级为B\n") ; } else if (sco...
分类:
其他好文 时间:
2014-08-14 23:09:46
阅读次数:
137
class Studentx implements Comparable { private String name; private int age; private float score; public Studentx(String name, int age, float score) {...
分类:
其他好文 时间:
2014-08-14 16:16:18
阅读次数:
205