- 博客(8)
- 收藏
- 关注
原创 解决GC问题
1、top查看CPU占用最高的PID 2、ps -mp 9825 -o THREAD,tid,time | sort -rn 9925是步骤1通过top命令查看到得PID 3、printf "%x\n" 9929 4、jstack 9825|grep 26c9 -A 100
2015-08-16 15:08:03
344
原创 Guava event bus 简单例子
最近项目中用到了GUAVA的eventbus来做异步操作,感觉很顺手,这里写了个小demo,作为备忘:(引入guava 18.0版本) 1.AppEventBus类:用来注册,执行和卸载事件,内部实例化了一个AsyncEventBus类,用线程池开了四个线程。 2.StringMessageEvent:事件类。 3.StringMessageListener类:监听者,会实例化一个A...
2015-07-06 23:54:21
165
原创 一种JAVA线程轮训调度算法(转载)
话不多说,直接上代码(本算法转载自“并发编程网 http://ifeve.com”)。 public class CycleAtomicInteger { private final static long PARK_TIME = 1000L * 1000; private AtomicInteger counter = new AtomicInteger(0); pri...
2015-07-05 20:37:21
640
原创 JS网页跳转
window.location.href 进行网页跳转,如果带前缀http://(如http://www.baidu.com) , 则跳转到新的网页。如果不带前缀,则当成子路径进行跳转。 window.location.href = "http://www.baidu.com" :跳转到百度的页面 window.location.href = "www.baidu.com" :跳转到 ...
2014-11-12 16:32:10
183
原创 JDK默认的三种路径
代码: public class JVMTest { public static void main(String[] args) { String bootPath = System.getProperty("sun.boot.class.path"); String extPath = System.getProperty("java.ext.dirs")...
2013-08-19 10:27:24
2105
原创 整数1到N的全排列----非递归方法
庞果网上的一道题目:打印N个字符的全排列,百度了一下。百度百科介绍如下(http://baike.baidu.com/view/1710135.htm),根据百度百科的提示,自己实现了一下,以下为源代码: public class Combine { public static void combine(Integer[] array) { Integer[] ...
2013-03-10 16:27:01
559
原创 多叉树的查找及转换
方法一: 1. 带有父节点信息的节点: public class FlatNode { private Integer path; private String name; private Integer parent; public Integer getPath() { return path; } public void ...
2013-02-24 15:49:53
251
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人