原创 drools rule: stateful vs stateless knowledge session

Both the sessions maintain a state. The difference is that a stateful session also maintains its state between session

原创 weblogic cluster load balance

0. configure a separate, non-clustered Managed Server to host the HTTP Cluster Servlet(proxyserver). 1. create dir prox

原创 字符流 vs 字節流

字符流:Writer/Reader 字節流:OutputStream/InputStream 對於非純文本形式的文件,採用字節流操作;純文本格式的文件則可以採用字符流操作 package com.test.io; import jav

原创 maven copy dependency 到指定位置

maven項目,有些時候,需要指定將dependency的jar拷到某個指定位置,Maven Dependency Plugin可以滿足這樣的需求 more details:http://maven.apache.org/plugins/

原创 有用的網址收藏

中文情感挖掘語料 http://www.searchforum.org.cn/tansongbo/corpus-senti.htm http://wenku.baidu.com/view/819b90d676eeaeaad1f3306e

原创 jvm 參數問題

關於jvm內存,有些問題還沒有弄的特別清楚,記錄一下,有待解決。 1.6 jvm各個區內存默認大小?? 1.7jvm各個區內存默認大小?? 棧內存一定的情況下,棧的深度如何確定?一次方法調用入棧所需空間大小? =============

原创 如何清理threadlocals

轉自 http://stackoverflow.com/questions/3869026/how-to-clean-up-threadlocals The javadoc says this: "Each thread hold

原创 exception handler in drools rule

As I know, we have 2 ways to handle exception in drools rule: 1.  try-catch in rule file(.drl) consequence:  e.g. rule

原创 CountDownLatch Test

according to Java Doc: CountDownLatch:A synchronization aid that allows one or more threads to wait until a set of oper

原创 插入排序

算法原理: 數組R[1...n], R[1]爲有序區, R[2...n]爲無序區。 從i=2起直至i=n止,依次尋找R[i]在當前有序區R[1...i-1]的位置並插入。 java實現: /**  * 插入排序,從小到大  * 數組實現

原创 java 6/7 加密解密 java.security.InvalidKeyException: Illegal key size

1.6jdk安裝過(JCE)Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6 1.7沒安裝。 1.6加密的密文,1.7

原创 Thread類裏interrupted() 和isInterrupted()的區別

interrupted() : Interrupted status在此方法調用之後會被清掉(即如果兩次成功調用這個方法,第二次調用返回false除非這個線程又被中斷) isInterrupted(): 該方法調用不會更改線程的Inter

原创 start managed server using wlst

1. start node manage(%wl_home%/common/bin/startManagedWebLogic) 2. start wlst(%wl_home%/common/bin/wlst) 3. in wlst: st

原创 歸併排序

歸併排序是將兩個有序的子序列合併成一個有序序列的過程,採用分治法。 java實現: public class MergeSort { public int[] mergerSort(int[] arrays){int[] tmp = n

原创 冒泡排序

算法原理: 將臨近的數字兩兩比較,按照從小到大或者從大到小的順序交換,這樣一趟之後,最大或者最小的數字被放到最後一位;然後再從頭開始兩兩比較交換,至倒數第二位結束;如此直至所有數字排序完畢 java實現: 用數組: public clas