把這個寫在run run configurations arguments里面,-server -XX:PermSize=256M -XX:MaxPermSize=512m,寫到配置文件里面,有時候不管用
樓主我急需一份最新版的,非常感謝樓主無私奉獻。更佩服樓主高超的技術。
admin@bugxm.com,謝謝了。
re: 為什么總是缺人 小明 2013-05-14 10:34
這種情況,我覺得一線領導要負責任,進度估計靠的是經驗。上來來的任務和進度要求,一定不能一概接受,然后壓榨手下兄弟拼命完成。要考慮培訓,調試,文檔,溝通等各種軟性的時間。如果你某次能在很短的時間內完成進度,上面的領導就會自然的認為任務能在很短時間來完成,就會趨向把時間安排的越來越緊。
想法一:
如果采用時間戳在加上一個隨機數是不是也可以解決這個問題,碰撞的概率微乎其微。
想法二:
ID = 時間戳+機器ID(2位數字,可以在程序啟動的時候設置好)+本機自增序列
這樣也不需要每次都使用一個全局的ID
re: 包圍的區域 小明 2013-04-22 18:05
@cintana
謝謝,確實,我想復雜了
re: 有點難度的java筆試題 小明 2013-04-18 09:32
@Harry
The answer of question is b
b) If user doesn’t specify classpath, the JVM search the class from the current folder by default.
JVM doesn't search the class from the current folder by default.
re: 最長連續序列問題 小明 2013-04-15 17:25
@Harry
你這個算法肯定不是,光排序就是O(nlgn)的復雜度了
re: 最長連續序列問題 小明 2013-04-15 17:21
@Harry
Containkey of hashmap should be O(1) normally. In worst is O(n) when there are lots of hash conflicts.
re: +1 小明 2013-04-15 17:18
@Harry
你這遞歸調用,效率不高吧
re: 把字符串第一個字母大寫 小明 2012-03-21 13:42
用bytes涉及到編碼轉化,可能要慢一點,另外,如果第一個字符是中文,會是什么情況?用char要安全多了。
更簡單的寫法:
private static String getMethodName(String fildeName){
char[] chars =fildeName.toCharArray();
chars[0] = Character.toUpperCase(chars[0]);
return new String(chars);
}
re: 一次簡單卻致命的錯誤 小明 2012-03-16 11:03
寫出 if (StringUtils.isNotEmpty(buf.toString()))的程序員應該裁掉
stackoverflow有類似的問題:
http://stackoverflow.com/questions/2608763/why-does-first-call-to-java-io-file-createtempfilestring-string-file-take-5-se有人提到是因為用戶屬于guest group的原因:
As noted as a comment on one of the answers below, I noticed this time is actually spent in the first invocation of SecureRandom.nextLong(). Also, I found that this behavior only occurs when a user has the "Guest" group associated with them. I can execute this test with a user and have it run in less than 100ms and then re-execute the same test with the same user account after just adding that user to the "Guests" group (without removing any other group associations from the user had in the previous run).
你可以驗證一下
非常好的例子啊
通過這個例子,我直觀得學習了如何使用Timer了
這個東東在很多場合比線程好用多了
re: 智力題集[未登錄] 小明 2008-03-06 23:59
@阿輝
re: 系統分析師最新資料[未登錄] 小明 2007-10-11 14:44
感激樓主的分享精神!我的郵箱是:
xiaomingming@aspire-tech.com
回復:謝謝!頂樓主!
re: 系統分析師最新資料[未登錄] 小明 2007-09-27 17:13
感激樓主的分享精神!我的郵箱是:
xiaomingming@aspire-tech.com
re: 基于事件分發機制的企業應用開發 小明 2005-12-06 11:55
如果FinancialService 不幸的被聲明為了final. ?
難道FinancialService 不是接口么?
re: 對象的部分聚合問題 小明 2005-12-06 10:06
樓主不會不知道Spring framework吧?
Spring IOC能很好幫助你解決這個問題阿
re: 基于事件分發機制的企業應用開發 小明 2005-12-06 10:03
我說一下我的一小點看法
對于你的代碼
public class OrderService {
private FinancialService financialService;
public void setFinancialService(FinancialService fs){
this.financialService=fs;
}
public Order saveOrder(Order order){
。。。。處理訂單
// financialService.createRequestOfMoney(order.getAmount());
financialService.dealWith(order.getAmount());
}
}
我覺得當遇到你說的情況時,我同樣可以Create another impl class來完成這個任務阿
當然FinancialService 的接口最好更改為dealWithMoney(...)
public class NewFinancialService implements FinancialService
{
dealWithMoney(...)
{
payMoney(...)
}
}
在這個子類中完成任務。然后注入到OrderService阿
剛剛打錯了,應該是
System.out.println(new String(title.getBytes("8859_1")));
為什么一定要用native2ascii轉換一下呢,修改起來也麻煩
我看了一下jdk的src
發現讀取配置文件總是使用這樣的方法
BufferedReader in = new BufferedReader(new InputStreamReader(inStream, "8859_1"));
不知道jdk為什么要強制以8859_1來讀取,所以得到以后要轉化回來
String title = rb.getString("helloworld.title");
System.out.println(new String(title,"8859_1")));
這樣就對了。