在autolayout里修改constant时调用animateWithDuration,发现没有动画效果怎么办?在block里加一句[self.view
layoutIfNeeded]就OK了...
分类:
其他好文 时间:
2015-07-22 13:14:13
阅读次数:
103
Tomcat 6.x
JSP文件最后修改时间大于当前系统时间导致Perm区内存泄露问题(java Memory pool CMS Perm Gen)
出现场景:
由于测试业务,需要模拟跨天测试,所以通常会采用修改服务器实现,来完成测试业务,测试完成后,不会立即同步系统时间,而直接发布上线,这时问题就出现了,由于使用穿越时间打包的,所以打包的所有文件最后修改时间都穿越了。
例如:今天是:...
分类:
其他好文 时间:
2015-07-22 13:10:22
阅读次数:
167
咳咳。c++11 加入了线程库,从此告别了标准库不支持并发的历史。然而 c++ 对于多线程的支持还是比较低级,稍微高级一点的用法都需要自己去实现,譬如线程池、信号量等。线程池(thread pool)这个东西,在面试上多次被问到,一般的回答都是:“管理一个任务队列,一个线程队列,然后每次取一个任务分配给一个线程去做,循环往复。” 貌似没有问题吧。但是写起程序来的时候就出问题了。...
分类:
编程语言 时间:
2015-07-22 09:30:47
阅读次数:
145
Java ConcurrentExecutorService
ExecutorService exec = Executors.newCachedThreadPool(); // create a cached pool
ExecutorService exec = Executors.newFixedThreadPool(4); // fixed sized thread pool
Executo...
分类:
编程语言 时间:
2015-07-22 00:03:11
阅读次数:
170
方法一、使用命令 ntpdate time-a.nist.gov方法二、本地安装ntpdate客户端 在本地安装ntpdate客户端,更新时用 ntpdate cn.pool.ntp.org 如果你的机子不支持域名,则可以用 ping cn.pool.ntp.org 得到该域名的IP地址。 然后用 ...
分类:
系统相关 时间:
2015-07-21 06:44:58
阅读次数:
219
Problem Definition: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto s....
分类:
其他好文 时间:
2015-07-20 22:52:15
阅读次数:
105
JNDI学习总结(三)——Tomcat下使用Druid配置JNDI数据源 com.alibaba.druid.pool.DruidDataSourceFactory实现了javax.naming.spi.ObjectFactory,可以作为JNDI数据源来配置。一、下载Druid的jar包 下载.....
分类:
Web程序 时间:
2015-07-20 12:14:47
阅读次数:
300
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get ...
分类:
其他好文 时间:
2015-07-20 09:16:26
阅读次数:
96
题目描述
链接地址
解法
算法解释题目描述Given 3*n + 1 numbers, every numbers occurs triple times except one, find it.ExampleGiven [1,1,2,3,3,3,2,2,4,1] return 4ChallengeOne-pass, constant extra space.链接地址http://www.lintc...
分类:
其他好文 时间:
2015-07-19 23:39:56
阅读次数:
140
对象池的实现其实是非常简单的
思想也是很简单的:
用一个队列来存放所有的对象,需要时get一个对象,从队列头取一个对象,当用完后,重新将该对象投入到队列尾部。
#ifndef OBJ_POOL_H_
#define OBJ_POOL_H_
#include
#include
#include
using std::queue;
using std::shared_ptr;...
分类:
编程语言 时间:
2015-07-18 17:03:44
阅读次数:
121