关于线程池的介绍,请看上一篇博客:http://www.cnblogs.com/DarrenChan/p/5774921.html 1. 线程池的5中创建方式 1) Single Thread Executor : 只有一个线程的线程池,因此所有提交的任务是顺序执行, 代码: Executors.n ...
分类:
编程语言 时间:
2017-03-11 00:42:59
阅读次数:
170
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai ...
分类:
其他好文 时间:
2017-03-10 17:31:28
阅读次数:
185
单例:使得对象成为系统中的唯一实例 伴生对象: 当单例对象与某个类共享同一个名称时,它就被称为是这个类的伴生对象(companion object)。类和它的伴生对象必须定义在同一个源文件中。类被称为是这个单例对象的伴生类(companion class)。类和它的伴生对象可以互相访问其私有成员。 ...
分类:
其他好文 时间:
2017-03-10 13:08:23
阅读次数:
128
Integer Intervals http://poj.org/problem?id=1716 Time Limit: 1000MS Memory Limit: 10000K Description An integer interval [a,b], a < b, is a set of all ...
分类:
其他好文 时间:
2017-03-10 12:32:08
阅读次数:
142
BackgroundThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that dig ...
分类:
其他好文 时间:
2017-03-08 19:26:47
阅读次数:
133
网页端调用:$this->getLayout()->createBlock('cms/block')->setBlockId('home_jbcs_daojishi')->toHtml();"home_jbcs_daojishi为静态块的url key"; 后台网页调用静态块:{{block typ ...
分类:
其他好文 时间:
2017-03-08 13:39:40
阅读次数:
134
简易入门 一、作用 当我们在调用一个缓存方法时会根据相关信息和返回结果作为一个键值对存放在缓存中,等到下次利用同样的参数来调用该方法时将不再执行该方法,而是直接从缓存中获取结果进行返回。 二、启用方式 1.POM.xml 文件中添加spring cache依赖 2.添加一种cacheManager的 ...
分类:
编程语言 时间:
2017-03-08 13:19:42
阅读次数:
399
1. 单一职责原则(Single Responsibility Principle,SRP):就一个类而言,应该仅有一个引起它变化的原因。 如果一个类承担的职责过多,就等于把这些职责耦合在一起,一个职责的变化可能会削弱或者抑制这个类完成其他职责的能力。这种耦合会导致脆弱的设计,当变化发生时,设计会遭 ...
分类:
其他好文 时间:
2017-03-08 10:57:48
阅读次数:
159
package cn.china; public class Single { public static void main(String[]args){ // S singles=S.getInstance(); // S singless=S.getInstance(); // System.... ...
分类:
编程语言 时间:
2017-03-07 22:34:18
阅读次数:
129
1、单一职责原则(SRP) Single Responsibility principle: 每个类应只有一个引起它变化的原因/每个类应只担任一个职责,以便于日后的程序的维护。 2、李氏替换原则(LSP) 和 依赖倒置原则(DIP) Liskov Substitution Principle:LSP ...
分类:
其他好文 时间:
2017-03-07 17:44:35
阅读次数:
193