- 博客(35)
- 资源 (1)
- 收藏
- 关注
转载 Java 线程/内存模型的缺陷和增强
原文地址:http://www.uml.org.cn/j2ee/j2ee090601.htmshyguy 原创 本文是由JR主持写作的《J2SE进阶》一书的部分章节整理而成,《J2SE进阶》正在写作、完善阶段。您阅读后,有任何建议、批评,请和我联系,或在这儿留言。《J2SE进阶》写作项目组感谢您阅读本文。Java
2014-09-25 17:02:21 480
原创 不用第三个变量,交换两个int数
package com.others;public class ExchangeInt { /** * 不用第三个变量,交换两个int数 */ public static void exchange(int a,int b){ System.out.println("a=" + a +",b=" + b); if((a > 0 && b 0)){ //同号 b
2014-09-19 17:13:06 439
原创 青蛙跳
N块石头,青蛙在第1块石头上。青蛙跳,每次只能跳1个或者2个。问跳到第N块石头一共有多少种不同的跳法 public class FrogJump { public static int frogJumpWays(int n){ if(n == 1 || n ==2){ return 1; } int tmp = 1; int num1 = 1; in
2014-09-17 16:53:28 512
原创 反转单链表
反转单链表:class LinkNode{ private int num; private LinkNode next; public LinkNode(){ } public LinkNode(int num){ this.num = num; } public int getNum() { return num; } public void setNum(
2014-09-17 15:48:12 419
原创 象棋中马走日字,给定棋盘上两个点,求两点间马最少走几步可达
一道有趣的算法题:package com.others;import java.util.ArrayDeque;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Stack;/** * * 马走日字,
2014-09-17 14:33:32 5852 1
原创 codility test 4
package com.lesson2;import java.util.BitSet;/** * * Write a function: class Solution { public int solution(int[] A); } that, * given a non-empty zero-indexed array A of N integers, returns the
2014-08-29 10:56:07 695
原创 codility test3
package com.lesson2;/** * * You are given N counters, initially set to 0, and you have two possible * operations on them: increase(X) − counter X is increased by 1, max counter − * all counters
2014-08-29 10:44:15 782
原创 codility test 2
FrogRiverOne package com.lesson2;import java.util.BitSet;/** * * A small frog wants to get to the other side of a river. The frog is currently * located at position 0, and wants to ge
2014-08-26 16:50:35 935
原创 codility test
lesson 1: PermMissingElempackage com.lesson1;import java.util.BitSet;/** * A zero-indexed array A consisting of N different integers is given. The array * contains integers in the range
2014-08-26 16:48:19 1453
原创 maven Error occurred during initialization of VM
Error occurred during initialization of VMCould not reserve enough space for object heapCould not create the Java virtual machine.
2014-08-12 16:06:09 5036
转载 如何清理threadlocals
http://stackoverflow.com/questions/3869026/how-to-clean-up-threadlocals
2014-08-12 14:13:12 2038
原创 使用log4jdbc记录db log
log4jdbc可以用来生成实际参考:https://code.google.com/p/log4jdbc/
2014-07-22 16:40:34 574
原创 gc日志分析
[Full GC (System) 1.265: [Tenured: 51610K->51610K(62148K), 0.0098892 secs] 51746K->51610K(67140K), [Perm : 1330K->1330K(12288K)], 0.0100709 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]Ten
2014-07-16 13:38:29 424
原创 oracle: set currval of sequenct
select HIBERNATE_SEQUENCE.nextval from dual
2014-07-15 13:42:27 414
翻译 java 6/7 加密解密 java.security.InvalidKeyException: Illegal key size
Most likely you don't have the unlimited strength file installed now.You may need to download this file:Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6Ja
2014-07-09 09:20:47 529
原创 Thread类里interrupted() 和isInterrupted()的区别
interrupted() : Interrupted status在此方法调用之后会被清掉
2014-06-03 15:20:10 542
原创 drools rule: stateful vs stateless knowledge session
both the sessions maintain a state. The difference is that a stateful session also maintains its statebetween session invocations (calls to the fireAllRules method). This is useful when weneed to
2014-05-30 11:45:34 1804
原创 exception handler in drools rule
As I know, we have 2 ways to handle exception in drools rule:1. try-catch in rule
2014-05-30 11:36:18 1167
原创 CountDownLatch Test
package com.test.concurrent;import java.util.concurrent.CountDownLatch;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.TimeUni
2014-05-30 11:16:28 496
原创 start managed server using wlst
1. start node manage(%wl_home%/common/bin/startManagedWebLogic.cmd)2.
2014-05-21 16:22:27 378
原创 快速排序
快排也是用到了分治法的思想,对一个典型子数组A[p...r]排序的分治过程为三个步骤:1.分解:A[p..r]被划分为俩个(可能空)的子数组A[p ..q-1]和A[q+1 ..r],使得A[p ..q-1] 2.解决:通过递归调用快速排序,对子数组A[p ..q-1]和A[q+1 ..r]排序。3.合并。
2014-04-28 11:23:44 404
原创 归并排序
public class MergeSort {public int[] mergerSort(int[] arrays){int[] tmp = new int[arrays.length];mergSort(arrays,0,arrays.length -1,tmp);return arrays;}public void mergSort(int[] arr
2014-04-28 10:12:59 431
转载 有用的网址收藏
http://www.searchforum.org.cn/tansongbo/corpus-senti.htmhttp://wenku.baidu.com/view/819b90d676eeaeaad1f3306e.html
2014-04-25 11:48:11 642
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人