定义:一个软件实体如类、模块和函数应该对扩展开放,对修改关闭。问题由来:在软件的生命周期内,因为变化、升级和维护等原因需要对软件原有代码进行修改时,可能会给旧代码中引入错误,也可能会使我们不得不对整个功能进行重构,并且需要原有代码经过重新测试。解决方案:当软件需要变化时,尽量通过扩展软件实体的行为来...
分类:
其他 时间:
2015-12-06 12:49:45
收藏:
0 评论:
0 赞:
0 阅读:
202
// 为UIView写分类//UIView+Extension.h#import @interface UIView (Extension)@property (nonatomic, assign) CGFloat x;@property (nonatomic, assign) CGFloat y;...
分类:
其他 时间:
2015-12-06 12:49:35
收藏:
0 评论:
0 赞:
0 阅读:
113
dij适合计算单源最短路径,计算一个源到各个点的距离比较快dfs不适合算每个点到每个点的距离,迭代次数太多、时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA gas station has to be built at such ...
分类:
其他 时间:
2015-12-06 12:48:55
收藏:
0 评论:
0 赞:
0 阅读:
238
Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum.Input Specification:Each input file contains one...
分类:
其他 时间:
2015-12-06 12:48:45
收藏:
0 评论:
0 赞:
0 阅读:
204
这是语文作业,但想到这题目除了OI也没啥好写的,就写了个电子稿放上来,语文不好,勿喷。高考之外一直以来,关于高考制度有这两种观点:一是在高中阶段,“两耳不闻窗外事,一心只读圣贤书”,全力以赴,备战高考,“一举成名天下知”;二是在保证正常功课的条件下,开展课外活动,丰富生活,拥有快乐的青春。而我,一名...
分类:
其他 时间:
2015-12-06 12:48:15
收藏:
0 评论:
0 赞:
0 阅读:
257
最近一周开发一个LED球泡灯可控硅调光项目,现总结如下:项目要求:1、使用RCC调光方案2、输入电压Ui=120V(60HZ),输出电压Uo=66V,输出电流Io=120mA(恒流)什么是可控硅:单向可控硅由4层半导体组成,有3个PN结:阳极A,阴极K,控制极G,如下图:单向可控硅文字符号:SCR(...
分类:
其他 时间:
2015-12-06 12:48:05
收藏:
0 评论:
0 赞:
0 阅读:
534
It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if ...
分类:
其他 时间:
2015-12-06 12:47:35
收藏:
0 评论:
0 赞:
0 阅读:
218
时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- every...
分类:
其他 时间:
2015-12-06 12:47:05
收藏:
0 评论:
0 赞:
0 阅读:
204
Given any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation tha...
分类:
其他 时间:
2015-12-06 12:46:45
收藏:
0 评论:
0 赞:
0 阅读:
216
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-...
分类:
其他 时间:
2015-12-06 12:46:35
收藏:
0 评论:
0 赞:
0 阅读:
157
挺简单的,多占内存,少用循环Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an ima...
分类:
其他 时间:
2015-12-06 12:45:55
收藏:
0 评论:
0 赞:
0 阅读:
406
时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAn AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two c...
分类:
其他 时间:
2015-12-06 12:45:45
收藏:
0 评论:
0 赞:
0 阅读:
201
挺坑的,现百度的二次探测法。The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the i...
分类:
其他 时间:
2015-12-06 12:45:15
收藏:
0 评论:
0 赞:
0 阅读:
125
On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on sc...
分类:
其他 时间:
2015-12-06 12:45:05
收藏:
0 评论:
0 赞:
0 阅读:
164
输入需要稍作变换,变为一个每个人和他的关注者的map 而不是他和他的关注人、然后bfs搜索。注意搜索层数的要求。Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, a...
分类:
其他 时间:
2015-12-06 12:44:55
收藏:
0 评论:
0 赞:
0 阅读:
122
About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theor...
分类:
其他 时间:
2015-12-06 12:44:45
收藏:
0 评论:
0 赞:
0 阅读:
95
根据中序遍历建立完全二叉树。时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA Binary Search Tree (BST) is recursively defined as a binary tree which has t...
分类:
其他 时间:
2015-12-06 12:44:25
收藏:
0 评论:
0 赞:
0 阅读:
120
第十二章 并发编程 操作系统提供了三种基本的构造并发程序的方法: 1、进程。每个逻辑控制流都是一个进程,由内核来调度和维护; 2、I/O多路复用。 3、线程。 一、基于进程的并发编程 在接受连接请求之后,服务器派生出一个子进程,这个子进程获得服务器描述表完整的拷贝。子进程关闭它的拷贝中监听...
分类:
其他 时间:
2015-12-06 11:31:15
收藏:
0 评论:
0 赞:
0 阅读:
114
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key ...
分类:
其他 时间:
2015-12-06 11:31:05
收藏:
0 评论:
0 赞:
0 阅读:
198
The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. F...
分类:
其他 时间:
2015-12-06 11:30:55
收藏:
0 评论:
0 赞:
0 阅读:
133