title:
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
翻译:
通过列出前6个质数,我们可知第6个质数是13。
那么第10001个质数是...
分类:
其他好文 时间:
2014-06-05 12:28:28
阅读次数:
277
title:
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)2 = 552 = 3025
Hence ...
分类:
其他好文 时间:
2014-06-05 12:03:29
阅读次数:
243
在lxc安装过程遇到的所有问题解决后,你可以创建你的第一个lxc容器了。最简单的方法使用lxc自带的创建文件系统的工具,当然你也可以自己做个文件系统。模板的安装路径一般放在/usr/local/share/lxc/templates#lxc-create -t centos -n centos-tst#lxc-start -n centos-tst...
分类:
其他好文 时间:
2014-06-05 09:38:02
阅读次数:
258
【题目】
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous ...
分类:
其他好文 时间:
2014-06-05 08:28:43
阅读次数:
321
观察者模式是最常用的设计模式之一,【对象之间多对一的依赖关系,当一个对象发生变化时,其会通知所有依赖它的对象】。拿订阅报纸和发行报社打比方,报社采集到news制作新的报纸,派送给订阅的客户,以此把最新的消息告知客户。所以,
出版社 + 订阅者 = 观察者模式。
这种一对多的关系,也即“一个”主题、“多个”观察者能够使得观察者仅仅了解主题推送的消息但不知晓其中的细节,而主题握有观察者列表...
分类:
其他好文 时间:
2014-06-02 23:33:05
阅读次数:
376
在软件系统中,“行为请求者”与“行为实现者”通常呈现一种“紧耦合”。但在某些场合,比如要对行为进行“记录、撤销/重做、事务”等处理,这种无法抵御变化的紧耦合是不合适的。在这种情况下,如何将“行为请求者”与“行为实现者”解耦?将一组行为抽象为对象,实现二者之间的松耦合。这就是命令模式(Command
Pattern)————题记
设计模式
命令模式:将“请求”封装成对象,以便使用不同...
分类:
其他好文 时间:
2014-06-02 04:59:53
阅读次数:
398
title:
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
1, 3, 6, 10,...
分类:
其他好文 时间:
2014-06-01 10:31:26
阅读次数:
233
title:
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
37107287533902102798797998220837590246510135740250
4637693767749000971264812489697007805041701826053...
分类:
其他好文 时间:
2014-06-01 08:53:33
阅读次数:
276
Jump Game IIGiven an array of non-negative
integers, you are initially positioned at the first index of the array.Each
element in the array represents...
分类:
其他好文 时间:
2014-05-31 03:14:14
阅读次数:
243