原创 java多線程實現生產者消費者模式
package cn.learn.test;public class WaitNotifyTest { /** * @param args */ public static void main(String[] args) {
原创 Types in C++
Enumerated Types An integer really represents a value within a sequence — the sequence of numbers. Enumerated typeslet
原创 自動資源釋放-使用對象管理資源,解決資源泄露問題
自動資源釋放-使用對象管理資源,解決資源泄露問題自動資源釋放-使用對象管理資源,解決資源泄露問題自動資源釋放-使用對象管理資源,解決資源泄露問題
原创 析構函數與異常
析構函數應該從不拋出異常 在爲某個異常進行棧展開時,如果析構函數又拋出自己的一個未經過處理的另外一個異常,將會導致調用標準庫的terminate函數,terninate函數將回調用abort函數,強制從整個程序非正常退出. 如果析構函數調
原创 java中的transient
被聲明爲transient的屬性,在序列化保存時是不會被保存的,比如密碼這類信息,爲了安全性,在序列化存儲對象時不需要保存,則可以把密碼聲明爲transient. 如下是transient的例子 保存對象前輸出:saved User:cn
原创 Greedy quantifiers, Reluctant quantifiers, Possessive quantifiers
Greedy quantifiers X? X, once or not at all X* X, zero or more times X+ X, one or more times X{n} X, exactly n times
原创 Tomcat Remote Debug
1.1 Tomcat Remote Debug 1.1.1 Run Tomcat as a windows service To configure remote debugging when windows as set
原创 Partial mock local private method or public method in the class and suppress static initial block
public class Calc { static { System.out.println("hahaha"); } public int add(int a, int b) { return interADD(a,
原创 wwwww
<html><hr><br><hr><hr>
原创 webservice trainning plan
================================= webservice training plan ================================= 1. Write a HelloWorld with
原创 SSl握手流程
The previous section provides a high-level description of the SSL handshake, which is the exchange of information betwe
原创 Enable debug in JRE class
1. Create a temporary directory. Let's say "tmp" > mkdir \tmp > mkdir \tmp\out 2. Extract src.zip in
原创 Link方式在MyEclipse安裝spket插件
1、 下載spket插件,將插件解壓縮到指定的目錄,例如D:\EclipsePlug目錄 2、 在Eclipse安裝目錄中創建文件夾Links,在文件中創建一個文件spket.link,在文件中寫入”path=D:\\EclipsePl
原创 Mock construction of new objects
Quick summary Use the @RunWith(PowerMockRunner.class) annotation at the class-level of the test case.Use the @PrepareF
原创 Comet (programming)
Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser,