Code Review最佳实践
* [单一职责原则:](http://en.wikipedia.org/wiki/Single_responsibility_principle)一个类有且只能一个职责。我通常使用这个原则去衡量,如果我们必须使用“和”来描述一个方法做的事情,这可能在抽象层上出了问题。
* [开闭原则](http://en.wikipedia.org/wiki/Open/closed_princip...
分类:
其他好文 时间:
2015-05-24 14:16:08
阅读次数:
176
// Copyright (c) // All rights reserved.////Describe : Only can run single program.//Author : Qing//Date : 2014-08-14#ifndef __SINGLE_PROGRAM_H_...
分类:
系统相关 时间:
2015-05-24 10:06:25
阅读次数:
197
I title:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime co...
分类:
其他好文 时间:
2015-05-23 20:03:35
阅读次数:
162
题目链接:Big Number
题目大意:每次输入两个数,第一个是高精度,第二个数小于100000;求 a mod b
根据同余定理:
(a+b)% c = (a%c+ b%c)%c
(a*b)%c = ( a%c* b%c)%c
所以 对于大数,例如 :123 可以这样分解
123 = (1*10+2)*10 + 3;
123 % c = ( (...
分类:
其他好文 时间:
2015-05-23 14:16:41
阅读次数:
138
问题:InputThe first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. Each data set consists of a...
分类:
其他好文 时间:
2015-05-23 11:28:17
阅读次数:
171
所用方法// NOTE: All of the following methods will default to drawing on a baseline, limiting drawing to a single line.// To correctly draw and size multi...
分类:
其他好文 时间:
2015-05-23 11:24:49
阅读次数:
146
所用方法// NOTE: All of the following methods will default to drawing on a baseline, limiting drawing to a single line.// To correctly draw and size multi...
分类:
其他好文 时间:
2015-05-23 11:22:49
阅读次数:
178
同步函数的是this,静态同步函数的锁是Class.class,要使同步代码块和静态同步函数都能执行相同的锁,则需要使用Class.class作为锁的对象。回顾:1.恶汉式:Class Single{ private Single single = new Single(); publi...
分类:
编程语言 时间:
2015-05-22 00:31:10
阅读次数:
128
Typesint, uint, float32, float64, bool, stringControl Structuresif-elseforswitchArrays, Slices and MapsArrays - indexable, single type, fixed lengthSl...
分类:
其他好文 时间:
2015-05-21 23:56:56
阅读次数:
159
//连个链表相加//#include "stdafx.h"#include using namespace std;// single linked list nodestruct listNode{ int val; listNode *next; listNode(int x)...
分类:
其他好文 时间:
2015-05-21 22:26:39
阅读次数:
211