
2006年11月10日
發(fā)布21個已知被微軟黑屏的序列號提醒相關(guān)用戶不要冒險去驗證升級
發(fā)布21個已知被微軟黑屏的序列號,提醒使用該序列號的用戶就不要冒險去驗證升級了。
已知被黑屏的序列號(這21個序列號是我今天一個個通過驗證測試出來的結(jié)果):
XP8BF-F8HPF-PY6BX-K24PJ-TWT6M
F4297-RCWJP-P482C-YY23Y-XH8W3
HH7VV-6P3G9-82TWK-QKJJ3-MXR96
HCQ9D-TVCWX-X9QRG-J4B2Y-GR2TT
MRX3F-47B9T-2487J-KWKMF-RPWBY
T72KM-6GWBP-GX7TD-CXFT2-7WT2B
QHYXK-JCJRX-XXY8Y-2KX2X-CCXGD
DG8FV-B9TKY-FRT9J-6CRCC-XPQ4G
MFBF7-2CK8B-93MDB-8MR7T-4QRCQ
MRX3F-47B9T-2487J-KWKMF-RPWBY
DFXFM-DKWTG-MYDWJ-68DQF-YBCYG
TB7JC-3VJKY-J3VMR-PP8TP-HMTWY
KR88V-RCBCB-D78QP-V4FF9-JW77M
HWCTG-CQPWK-D22DQ-JD7TQ-GXVW8
Q7TG8-MQ3BK-RHXQC-YDXJD-6Q6M3
BP6XM-YXMKY-V4Q74-KJP8X-VW3CQ
BFBPF-TF64Y-BT8T9-DQJFY-3TH7W
GQ9CX-QDFPR-XFRMF-T3M94-2JG9Y
XPF44-PDM32-XT4B8-R8W8C-CPP6T
RC7QJ-KX66J-V4R9W-32HC4-CJH2B
DDQXW-THQ8M-79V6K-2YFGH-R793Q
注:但有網(wǎng)友反映MRX3F-47B9T-2487J-KWKMF-RPWBY這個序列號有些地方能通過正版驗證,有些地方不能通過正版驗證,看來微軟這次驗證還分蠻細的,并可以按地區(qū)來判斷序列號是否為盜版和正版呀。
posted @
2008-10-26 00:40 崛起的程序員 閱讀(375) |
評論 (0) |
編輯 收藏
AJAX 流行之后,總想好好學習一下。但是眾多的框架實在難以選擇。說明一下 ASP.NET AJAX 并不包括在 AJAX 框架之中。
剛開始學了 JQuqery, 眾多的 $get(),...等等符號早已把我搞暈了。暫時就放棄了。
后來學習 ASP.NET AJAX ,在微軟的領(lǐng)導下,逐漸由服務器端轉(zhuǎn)向客戶端編程。 激起我客戶端編程的興趣,
才想起學習一下了 Jquery.
隨著WEB2.0及ajax思想在互聯(lián)網(wǎng)上的快速發(fā)展傳播,陸續(xù)出現(xiàn)了一些優(yōu)秀的Js框架,其中比較著名的有Prototype、YUI、jQuery、mootools、Bindows以及國內(nèi)的JSVM框架等,通過將這些JS框架應用到我們的項目中能夠使程序員從設(shè)計和書寫繁雜的JS應用中解脫出來,將關(guān)注點轉(zhuǎn)向功能需求而非實現(xiàn)細節(jié)上,從而提高項目的開發(fā)速度。
jQuery是繼prototype之后的又一個優(yōu)秀的Javascript框架。它是由 John Resig 于 2006 年初創(chuàng)建的,它有助于簡化 JavaScript™ 以及Ajax 編程。有人使用這樣的一比喻來比較prototype和jQuery:prototype就像Java,而jQuery就像ruby. 它是一個簡潔快速靈活的JavaScript框架,它能讓你在你的網(wǎng)頁上簡單的操作文檔、處理事件、實現(xiàn)特效并為Web頁面添加Ajax交互。
它具有如下一些特點:
1、代碼簡練、語義易懂、學習快速、文檔豐富。
2、jQuery是一個輕量級的腳本,其代碼非常小巧,最新版的JavaScript包只有20K左右。
3、jQuery支持CSS1-CSS3,以及基本的xPath。
4、jQuery是跨瀏覽器的,它支持的瀏覽器包括IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+。
5、可以很容易的為jQuery擴展其他功能。
6、能將JS代碼和HTML代碼完全分離,便于代碼和維護和修改。
7、插件豐富,除了jQuery本身帶有的一些特效外,可以通過插件實現(xiàn)更多功能,如表單驗證、tab導航、拖放效果、表格排序、DataGrid,樹形菜單、圖像特效以及ajax上傳等。
jQuery的設(shè)計會改變你寫JavaScript代碼的方式,降低你學習使用JS操作網(wǎng)頁的復雜度,提高網(wǎng)頁JS開發(fā)效率,無論對于js初學者還是資深專家,jQuery都將是您的首選。
jQuery適合于設(shè)計師、開發(fā)者以及那些還好者,同樣適合用于商業(yè)開發(fā),可以說jQuery適合任何JavaScript應用的地方,可用于不同的Web應用程序中。
官方站點:http://jquery.com/ 中文站點:http://jquery.org.cn/
1.2、目的
通過學習本文檔,能夠?qū)Query有一個簡單的認識了解,清楚JQuery與其他JS框架的不同,掌握jQuery的常用語法、使用技巧及注意事項。
二、使用方法
在需要使用JQuery的頁面中引入JQuery的js文件即可。
例如:<script type="text/javascript" src="js/jquery.js"></script>
引入之后便可在頁面的任意地方使用jQuery提供的語法。
三、學習教程及參考資料
請參照《jQuery中文API手冊》和http://jquery.org.cn/visual/cn/index.xml
推薦兩篇不錯的jquery教程:《jQuery的起點教程》和《使用 jQuery 簡化 Ajax 開發(fā)》
四、語法總結(jié)和注意事項
1、關(guān)于頁面元素的引用
通過jquery的$()引用元素包括通過id、class、元素名以及元素的層級關(guān)系及dom或者xpath條件等方法,且返回的對象為jquery對象(集合對象),不能直接調(diào)用dom定義的方法。
2、jQuery對象與dom對象的轉(zhuǎn)換
只有jquery對象才能使用jquery定義的方法。注意dom對象和jquery對象是有區(qū)別的,調(diào)用方法時要注意操作的是dom對象還是jquery對象。
普通的dom對象一般可以通過$()轉(zhuǎn)換成jquery對象。
如:$(document.getElementById("msg"))則為jquery對象,可以使用jquery的方法。
由于jquery對象本身是一個集合。所以如果jquery對象要轉(zhuǎn)換為dom對象則必須取出其中的某一項,一般可通過索引取出。
如:$("#msg")[0],$("div").eq(1)[0],$("div").get()[1],$("td")[5]這些都是dom對象,可以使用dom中的方法,但不能再使用Jquery的方法。
以下幾種寫法都是正確的:
$("#msg").html();
$("#msg")[0].innerHTML;
$("#msg").eq(0)[0].innerHTML;
$("#msg").get(0).innerHTML;
3、如何獲取jQuery集合的某一項
對于獲取的元素集合,獲取其中的某一項(通過索引指定)可以使用eq或get(n)方法或者索引號獲取,要注意,eq返回的是jquery對象,而get(n)和索引返回的是dom元素對象。對于jquery對象只能使用jquery的方法,而dom對象只能使用dom的方法,如要獲取第三個<div>元素的內(nèi)容。有如下兩種方法:
$("div").eq(2).html(); //調(diào)用jquery對象的方法
$("div").get(2).innerHTML; //調(diào)用dom的方法屬性
4、同一函數(shù)實現(xiàn)set和get
Jquery中的很多方法都是如此,主要包括如下幾個:
$("#msg").html(); //返回id為msg的元素節(jié)點的html內(nèi)容。
$("#msg").html("<b>new content</b>");
//將“<b>new content</b>” 作為html串寫入id為msg的元素節(jié)點內(nèi)容中,頁面顯示粗體的new content
$("#msg").text(); //返回id為msg的元素節(jié)點的文本內(nèi)容。
$("#msg").text("<b>new content</b>");
//將“<b>new content</b>” 作為普通文本串寫入id為msg的元素節(jié)點內(nèi)容中,頁面顯示<b>new content</b>
$("#msg").height(); //返回id為msg的元素的高度
$("#msg").height("300"); //將id為msg的元素的高度設(shè)為300
$("#msg").width(); //返回id為msg的元素的寬度
$("#msg").width("300"); //將id為msg的元素的寬度設(shè)為300
$("input").val("); //返回表單輸入框的value值
$("input").val("test"); //將表單輸入框的value值設(shè)為test
$("#msg").click(); //觸發(fā)id為msg的元素的單擊事件
$("#msg").click(fn); //為id為msg的元素單擊事件添加函數(shù)
同樣blur,focus,select,submit事件都可以有著兩種調(diào)用方法
5、集合處理功能
對于jquery返回的集合內(nèi)容無需我們自己循環(huán)遍歷并對每個對象分別做處理,jquery已經(jīng)為我們提供的很方便的方法進行集合的處理。
包括兩種形式:
$("p").each(function(i){this.style.color=['#f00','#0f0','#00f'][i]})
//為索引分別為0,1,2的p元素分別設(shè)定不同的字體顏色。
$("tr").each(function(i){this.style.backgroundColor=['#ccc','#fff'][i%2]})
//實現(xiàn)表格的隔行換色效果
$("p").click(function(){alert($(this).html())})
//為每個p元素增加了click事件,單擊某個p元素則彈出其內(nèi)容
6、擴展我們需要的功能
$.extend({
min: function(a, b){return a < b?a:b; },
max: function(a, b){return a > b?a:b; }
}); //為jquery擴展了min,max兩個方法
使用擴展的方法(通過“$.方法名”調(diào)用):
alert("a=10,b=20,max="+$.max(10,20)+",min="+$.min(10,20));
7、支持方法的連寫
所謂連寫,即可以對一個jquery對象連續(xù)調(diào)用各種不同的方法。
例如:
$("p").click(function(){alert($(this).html())})
.mouseover(function(){alert('mouse over event')})
.each(function(i){this.style.color=['#f00','#0f0','#00f'][i]});
8、操作元素的樣式
主要包括以下幾種方式:
$("#msg").css("background"); //返回元素的背景顏色
$("#msg").css("background","#ccc") //設(shè)定元素背景為灰色
$("#msg").height(300); $("#msg").width("200"); //設(shè)定寬高
$("#msg").css({ color: "red", background: "blue" });//以名值對的形式設(shè)定樣式
$("#msg").addClass("select"); //為元素增加名稱為select的class
$("#msg").removeClass("select"); //刪除元素名稱為select的class
$("#msg").toggleClass("select"); //如果存在(不存在)就刪除(添加)名稱為select的class
9、完善的事件處理功能
Jquery已經(jīng)為我們提供了各種事件處理方法,我們無需在html元素上直接寫事件,而可以直接為通過jquery獲取的對象添加事件。
如:
$("#msg").click(function(){alert("good")}) //為元素添加了單擊事件
$("p").click(function(i){this.style.color=['#f00','#0f0','#00f'][i]})
//為三個不同的p元素單擊事件分別設(shè)定不同的處理
jQuery中幾個自定義的事件:
(1)hover(fn1,fn2):一個模仿懸停事件(鼠標移動到一個對象上面及移出這個對象)的方法。當鼠標移動到一個匹配的元素上面時,會觸發(fā)指定的第一個函數(shù)。當鼠標移出這個元素時,會觸發(fā)指定的第二個函數(shù)。
//當鼠標放在表格的某行上時將class置為over,離開時置為out。
$("tr").hover(function(){
$(this).addClass("over");
},
function(){
$(this).addClass("out");
});
(2)ready(fn):當DOM載入就緒可以查詢及操縱時綁定一個要執(zhí)行的函數(shù)。
$(document).ready(function(){alert("Load Success")})
//頁面加載完畢提示“Load Success”,相當于onload事件。與$(fn)等價
(3)toggle(evenFn,oddFn): 每次點擊時切換要調(diào)用的函數(shù)。如果點擊了一個匹配的元素,則觸發(fā)指定的第一個函數(shù),當再次點擊同一元素時,則觸發(fā)指定的第二個函數(shù)。隨后的每次點擊都重復對這兩個函數(shù)的輪番調(diào)用。
//每次點擊時輪換添加和刪除名為selected的class。
$("p").toggle(function(){
$(this).addClass("selected");
},function(){
$(this).removeClass("selected");
});
(4)trigger(eventtype): 在每一個匹配的元素上觸發(fā)某類事件。
例如:
$("p").trigger("click"); //觸發(fā)所有p元素的click事件
(5)bind(eventtype,fn),unbind(eventtype): 事件的綁定與反綁定
從每一個匹配的元素中(添加)刪除綁定的事件。
例如:
$("p").bind("click", function(){alert($(this).text());}); //為每個p元素添加單擊事件
$("p").unbind(); //刪除所有p元素上的所有事件
$("p").unbind("click") //刪除所有p元素上的單擊事件
10、幾個實用特效功能
其中toggle()和slidetoggle()方法提供了狀態(tài)切換功能。
如toggle()方法包括了hide()和show()方法。
slideToggle()方法包括了slideDown()和slideUp方法。
11、幾個有用的jQuery方法
$.browser.瀏覽器類型:檢測瀏覽器類型。有效參數(shù):safari, opera, msie, mozilla。如檢測是否ie:$.browser.isie,是ie瀏覽器則返回true。
$.each(obj, fn):通用的迭代函數(shù)。可用于近似地迭代對象和數(shù)組(代替循環(huán))。
如
$.each( [0,1,2], function(i, n){ alert( "Item #" + i + ": " + n ); });
等價于:
var tempArr=[0,1,2];
for(var i=0;i<tempArr.length;i++){
alert("Item #"+i+": "+tempArr[i]);
}
也可以處理json數(shù)據(jù),如
$.each( { name: "John", lang: "JS" }, function(i, n){ alert( "Name: " + i + ", Value: " + n ); });
結(jié)果為:
Name:name, Value:John
Name:lang, Value:JS
$.extend(target,prop1,propN):用一個或多個其他對象來擴展一個對象,返回這個被擴展的對象。這是jquery實現(xiàn)的繼承方式。
如:
$.extend(settings, options);
//合并settings和options,并將合并結(jié)果返回settings中,相當于options繼承setting并將繼承結(jié)果保存在setting中。
var settings = $.extend({}, defaults, options);
//合并defaults和options,并將合并結(jié)果返回到setting中而不覆蓋default內(nèi)容。
可以有多個參數(shù)(合并多項并返回)
$.map(array, fn):數(shù)組映射。把一個數(shù)組中的項目(處理轉(zhuǎn)換后)保存到到另一個新數(shù)組中,并返回生成的新數(shù)組。
如:
var tempArr=$.map( [0,1,2], function(i){ return i + 4; });
tempArr內(nèi)容為:[4,5,6]
var tempArr=$.map( [0,1,2], function(i){ return i > 0 ? i + 1 : null; });
tempArr內(nèi)容為:[2,3]
$.merge(arr1,arr2):合并兩個數(shù)組并刪除其中重復的項目。
如:$.merge( [0,1,2], [2,3,4] ) //返回[0,1,2,3,4]
$.trim(str):刪除字符串兩端的空白字符。
如:$.trim(" hello, how are you? "); //返回"hello,how are you? "
12、解決自定義方法或其他類庫與jQuery的沖突
很多時候我們自己定義了$(id)方法來獲取一個元素,或者其他的一些js類庫如prototype也都定義了$方法,如果同時把這些內(nèi)容放在一起就會引起變量方法定義沖突,Jquery對此專門提供了方法用于解決此問題。
使用jquery中的jQuery.noConflict();方法即可把變量$的控制權(quán)讓渡給第一個實現(xiàn)它的那個庫或之前自定義的$方法。之后應用Jquery的時候只要將所有的$換成jQuery即可,如原來引用對象方法$("#msg")改為jQuery("#msg")。
如:
jQuery.noConflict();
// 開始使用jQuery
jQuery("div p").hide();
// 使用其他庫的 $()
$("content").style.display = 'none';
posted @
2008-09-21 21:24 崛起的程序員 閱讀(314) |
評論 (0) |
編輯 收藏
1377-4167-5844-4698-0048-5821
posted @
2008-03-02 19:35 崛起的程序員 閱讀(336) |
評論 (0) |
編輯 收藏
Flex License:
1307-1581-4356-2616-4951-7949 (Commercial Version)
1307-1581-4356-2939-1231-4484 (Education Version)
Charting License:
1301-4581-4356-7349-9369-3351 (Commercial Version)
posted @
2008-02-24 21:43 崛起的程序員 閱讀(404) |
評論 (0) |
編輯 收藏
Today we shipped Visual Studio 2008 and .NET 3.5. You can download the final release using one of the links below:
-
If you are a MSDN subscriber, you can download your copy from the MSDN subscription site (note: some of the builds are just finishing being uploaded now - so check back later during the day if you don't see it yet).
-
If you are a non-MSDN subscriber, you can download a 90-day free trial edition of Visual Studio 2008 Team Suite here. A 90-day trial edition of Visual Studio 2008 Professional (which will be a slightly smaller download) will be available next week. A 90-day free trial edition of Team Foundation Server can also be downloaded here.
-
If you want to use the free Visual Studio 2008 Express editions (which are much smaller and totally free), you can download them here.
-
If you want to just install the .NET Framework 3.5 runtime, you can download it here.
Quick Tour of Some of the New Features
Visual Studio 2008 and .NET 3.5 contain a ton of new functionality and improvements. Below are links to blog posts I've done myself as well as links to videos you can watch to learn more about it:
VS 2008 Multi-Targeting Support
VS 2008 enables you to build applications that target multiple versions of the .NET Framework. This means you can use VS 2008 to open, edit and build existing .NET 2.0 and ASP.NET 2.0 applications (including ASP.NET 2.0 applications using ASP.NET AJAX 1.0), and continue to deploy these application on .NET 2.0 machines. You can learn more about how this works from my blog post here:
ASP.NET AJAX and JavaScript Support
.NET 3.5 has ASP.NET AJAX built-in (no separate download required). In addition to including all of the features in ASP.NET AJAX 1.0, ASP.NET 3.5 also now includes richer support for UpdatePanels integrating with WebParts, ASP.NET AJAX integration with controls like <asp:menu> and <asp:treeview>, WCF support for JSON, and many other AJAX improvements.
VS 2008 and Visual Web Developer 2008 also now have great support for integrating JavaScript and AJAX into your applications. You can learn more about this from my blog posts here:
You can watch some videos that discuss ASP.NET AJAX and Visual Studio 2008 support for it here.
I also highly recommend the excellent ASP.NET AJAX in Action book to learn more about ASP.NET AJAX (both client-side and server-side).
VS 2008 Web Designer and CSS Support
VS 2008 and Visual Web Developer 2008 Express includes a significantly improved HTML web designer (the same one that ships with Expression Web). This delivers support for split-view editing, nested master pages, and great CSS integration. Below are some articles I've written that discuss this more:
ASP.NET 3.5 also has a new <asp:ListView> control that provides the ability to perform rich data scenarios with total control over the markup. It works nicely with the new CSS support in VS 2008. You can learn more about it from my article here:
You can watch some videos that discuss the new Visual Studio 2008 web designer features and the new ListView/DataPager controls here.
Language Improvements and LINQ
The new VB and C# compilers in VS 2008 deliver significant improvements to the languages. Both add functional programming concepts that enable you to write cleaner, terser, and more expressive code. These features also enable a new programming model we call LINQ (language integrated query) that makes querying and working with data a first-class programming concept with .NET.
Below are some of the articles I've written that explore these new language features using C#:
Here are a few additional blog posts I've written that show off some of the new VS 2008 code editing support and some cool ways to use these new language features:
The Visual Basic team has also created some great free videos that cover LINQ. You can watch them here.
Data Access Improvements with LINQ to SQL
LINQ to SQL is a built-in OR/M (object relational mapper) in .NET 3.5. It enables you to model relational databases using a .NET object model. You can then query the database using LINQ, as well as update/insert/delete data from it. LINQ to SQL fully supports transactions, views, and stored procedures. It also provides an easy way to integrate business logic and validation rules into your data model. Below are some of the articles I've written that explore how to use it:
I think you'll find that LINQ and LINQ to SQL makes it much easier to build much cleaner data models, and write much cleaner data code. I'll be adding more posts to my LINQ to SQL series in the weeks and months ahead (sorry for the delay in finishing them earlier - so much to-do and so little time to-do it all!).
Scott Stanfield is also working on creating some great LINQ to SQL videos for the www.asp.net site based on my article series above (all videos are in both VB and C#). You can watch the first 4 videos in this series here.
Browsing the .NET Framework Library Source using Visual Studio
As I blogged a few weeks ago, we will be releasing a reference version of the .NET Framework library source code as part of this release. Visual Studio 2008 has built-in debugger support to automatically step-into and debug this code on demand (VS 2008 can pull down the source for the appropriate .NET Framework library file automatically for you).
We are deploying the source servers to enable this right now, and will be publishing the steps to turn this feature on in the next few weeks.
Lots of other improvements
The list above is only a small set of the improvements coming. For client development VS 2008 includes WPF designer and project support. ClickOnce and WPF XBAPs now work with FireFox. WinForms and WPF projects can also now use the ASP.NET Application Services (Membership, Roles, Profile) for roaming user data.
Office development is much richer - including support for integrating with the Office 2007 ribbon, and with Outlook. Visual Studio Tools for Office support is also now built-into Visual Studio (you no longer need to buy a separate product).
New WCF and Workflow projects and designers are now included in VS 2008. Unit testing support is now much faster and included in VS Professional (and no longer just VSTS). Continuous Integration support is now built-in with TFS. AJAX web testing (unit and load) is now supported in the VS Test SKU. And there is much, much more...
Installation Suggestions
People often ask me for suggestions on how best to upgrade from previous betas of Visual Studio 2008. In general I'd recommend uninstalling the Beta2 bits explicitly. As part of this you should uninstall Visual Studio 2008 Beta2, .NET Framework Beta2, as well as the Visual Studio Web Authoring Component (these are all separate installs and need to be uninstalled separately). I then usually recommend rebooting the machine after uninstalling just to make sure everything is clean before you kick off the new install. You can then install the final release of VS 2008 and .NET 3.5 on the machine.
Once installed, I usually recommend explicitly running the Tools->Import and Export Settings menu option, choosing the "Reset Settings" option, and then re-pick your preferred profile. This helps ensure that older settings from the Beta2 release are no longer around (and sometimes seems to help with performance).
Note that VS 2008 runs side-by-side with VS 2005 - so it is totally fine to have both on the same machine (you will not have any problems with them on the same box).
Silverlight Tools and VS Web Deployment Project Add-Ins
Two popular add-ins to Visual Studio are not yet available to download for the final VS 2008 release. These are the Silverlight 1.1 Tools Alpha for Visual Studio and the Web Deployment Project add-in for Visual Studio. Our hope is to post updates to both of them to work with the final VS 2008 release in the next two weeks. If you are doing Silverlight 1.1 development using VS 2008 Beta2 you'll want to stick with with VS 2008 Beta2 until this updated Silverlight Tools Add-In is available.
posted @
2007-12-02 02:24 崛起的程序員 閱讀(852) |
評論 (0) |
編輯 收藏
PYHYP-WXB3B-B2CCM-V9DX9-VDY8T
在開始>設(shè)置>控制面版>添加或刪除程序>卸載vs.net2008>出現(xiàn)卸載界面>點擊Next>輸入上面CD-key ->出現(xiàn)Success畫面。。激動ING
本人使用的是VS2008 RTM版..
Microsoft.Visual.Studio.Team.System.2008.Team.Suite-ZWTiSO
ed2k: Microsoft.Visual.Studio.Team.System.2008.Team.Suite-ZWTiSO.iso [3.83 Gb] 
ed2k: Microsoft.Visual.Studio.Team.System.2008.Team.Suite-ZWTiSO.nfo [5.8 Kb] 
[ Add all 2 links to your ed2k client ]
Microsoft.Visual.Studio.2008.Professional.Edition-ZWTiSO
ed2k: Microsoft.Visual.Studio.2008.Professional.Edition-ZWTiSO.iso [3.31 Gb] 
ed2k: Microsoft.Visual.Studio.2008.Professional.Edition-ZWTiSO.nfo [5.5 Kb] 
[ Add all 2 links to your ed2k client ]
Microsoft.Visual.Studio.Team.System.2008.Development.Edition
ed2k: Microsoft.Visual.Studio.Team.System.2008.Development.Edition-ZWTiSO.iso [3.81 Gb] 
ed2k: Microsoft.Visual.Studio.Team.System.2008.Development.Edition-ZWTiSO.nfo [5.5 Kb] 
[ Add all 2 links to your ed2k client ]
Microsoft.Visual.Studio.Team.System.2008.Team.Foundation.Server.Workgroup.Edition-ZWTiSO
ed2k: Microsoft.Visual.Studio.Team.System.2008.Team.Foundation.Server.Workgroup.Edition-ZWTiSO.iso [1.29 Gb] 
ed2k: Microsoft.Visual.Studio.Team.System.2008.Team.Foundation.Server.Workgroup.Edition-ZWTiSO.nfo [5.7 Kb] 
[ Add all 2 links to your ed2k client ]
Microsoft.Visual.Studio.Team.System.2008.Test.Load.Agent-ZWT
ed2k: Microsoft.Visual.Studio.Team.System.2008.Test.Load.Agent-ZWTiSO.iso [551.01 Mb] 
ed2k: Microsoft.Visual.Studio.Team.System.2008.Test.Load.Agent-ZWTiSO.nfo [5.7 Kb] 
[ Add all 2 links to your ed2k client ]
posted @
2007-12-02 02:21 崛起的程序員 閱讀(20624) |
評論 (30) |
編輯 收藏
注冊機下載地址
http://www.tkk7.com/Files/ioriqw/Altova%202008.rar
posted @
2007-10-30 16:23 崛起的程序員 閱讀(1001) |
評論 (1) |
編輯 收藏
摘要: 在網(wǎng)上找了一圈Ajax的Java框架,感覺不錯的只有兩個,一個是被提到比較多的DWR(Direct Web Remoting),另一個是剛剛1.0的Ajax4JSF。本文先用代碼說話,各用兩個框架開發(fā)同樣功能的Ajax輸入驗證的小程序。在最后表達一下鄙人對這兩個框架的淺見。·程序功能 頁面上有兩個輸入框,一個填用戶名,一個填密碼。兩個框空著時提示...
閱讀全文
posted @
2007-08-27 20:17 崛起的程序員 閱讀(566) |
評論 (0) |
編輯 收藏
Go to window-preferences-java-installed jre's- edit
and add the values
-Xms512m -Xmx512m -Xss256k
(or the amount of memory you want)
eclipse starts tomcat with those values, so your memory problems should be solved
posted @
2007-06-10 22:26 崛起的程序員 閱讀(381) |
評論 (0) |
編輯 收藏
有個系統(tǒng)隱藏的文件夾System Volume Information會達到1G甚至20G,這是系統(tǒng)還原的文件夾,這個目錄是WINDOWS對于大硬盤搜索方便的索引記錄文件!會在WINDOWS空閑時自動記錄,所以這個文件夾會越來越大,然后PF使用率不斷上升,導致機器卡住!&W&D.C g V b j [ a
我們可以禁用這個自動索引功能!打開搜索功能->改變首選項->不使用制作索引服務->不,不要啟用制作索引服務->確定。還有一件事,就是回到剛才的地方,下面還有一個“改變制作索引服務設(shè)置(高級)”,按下去,右鍵彈出的窗口中的那個索引服務->刪除,就好了!海騰數(shù)據(jù)中心服務器論壇 Y \ M z(R1{ O f ?&f t j9Y&] B `
SystemVolumeInformation\catalog.wci的文件用來存放索引文件,而且在系統(tǒng)空閑時,Windows會自動讀硬盤更新索引,安裝的文件越多,索引文件會越來越大。 D Y }&X
刪除索引服務:海騰數(shù)據(jù)、服務器論壇聯(lián)盟、win服務器、代理服務器,郵件服務器、代碼、程序、游戲下載、軟件、電腦技術(shù)、設(shè)計、圖片、信息發(fā)布 N i$y l z:M } 運行msconfig,然后選擇服務選項,找到IndexingService,將前面的小勾去掉,再刪掉文件夾即可。
|
posted @
2007-04-11 10:36 崛起的程序員 閱讀(1433) |
評論 (0) |
編輯 收藏
Introduction
Changing proxy settings of IE is a frequent requirement of mine. Then I got the idea of writing a tool by myself, at last. I have not found clear instructions on this. Many articles recommend to modify registry directly, but unfortunately their instruction is not enough. Most of them direct me to modify the following values in registry :-
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"=":"
"ProxyOverride"=""
"DisablePasswordCaching"=dword:00000001
Details
I tested it and find that it does not work at least on my computer.( I access internet by ADSL connection.) So I backed up registry and modified proxy settings via Internet Explorer, finding that [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections] is also changed. So I wrote the following code snippet to change proxy settings:
Collapse
void ShowError(long lerr)
{
LPVOID lpMsgBuf;
if (!FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
lerr,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL ))
{
return;
}
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
LocalFree( lpMsgBuf );
}
void CieproxyDlg::OnBnClickedOk()
{
UpdateData();
GetDlgItemText(IDC_EDIT1,m_sIEProxy);
HKEY hk;
LONG lret=RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
NULL,KEY_WRITE|KEY_SET_VALUE,&hk);
if(lret==ERROR_SUCCESS&&NULL!=hk)
{
TCHAR* pbuf=m_sIEProxy.GetBuffer(1);
lret=RegSetValueEx( hk,"ProxyServer",NULL,REG_SZ,pbuf,m_sIEProxy.GetLength());
DWORD dwenable=1;
lret=RegSetValueEx(hk,"ProxyEnable",NULL,REG_DWORD,
(LPBYTE)&dwenable,sizeof(dwenable));
RegCloseKey(hk);
}
const TCHAR* keyname3=_T(
"software\\Microsoft\\windows\\currentversion\\Internet Settings\\Connections");
lret=RegOpenKeyEx(HKEY_CURRENT_USER,keyname3,NULL,
KEY_READ|KEY_WRITE|KEY_SET_VALUE,&hk);
if(lret==ERROR_SUCCESS&&NULL!=hk)
{
DWORD dwtype;
char pbuf[256];
DWORD dwlen=sizeof(pbuf);
constchar* valname="Connection to adsl3";
lret=RegQueryValueEx(hk,valname,NULL,&dwtype,pbuf,&dwlen);
if(lret!=ERROR_SUCCESS)
{
ShowError(lret);
}
pbuf[8] = 3;
pbuf[4]=pbuf[4]+1;
constchar* p=m_sIEProxy.GetBuffer(1);
memcpy(pbuf+16,p,m_sIEProxy.GetLength());
char c=0;
for(int i=m_sIEProxy.GetLength();i<20;i++)
pbuf[16+i]=c;
m_sIEProxy.ReleaseBuffer();
lret=RegSetValueEx(hk,valname,NULL,REG_BINARY,pbuf,dwlen);
RegCloseKey(hk);
}
DWORD dwret;
SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL,
SMTO_NORMAL,1000,&dwret);
}
void CieproxyDlg::OnBnClickedDisableProxy()
{
UpdateData();
GetDlgItemText(IDC_EDIT1,m_sIEProxy);
HKEY hk;
LONG lret=RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
NULL,KEY_WRITE|KEY_SET_VALUE,&hk);
if(lret==ERROR_SUCCESS&&NULL!=hk)
{
DWORD dwenable=0;
lret=RegSetValueEx(hk,"ProxyEnable",NULL,REG_DWORD,
(LPBYTE)&dwenable,sizeof(dwenable));
RegCloseKey(hk);
}
const TCHAR* keyname3=_T(
"software\\Microsoft\\windows\\currentversion\\Internet Settings\\Connections");
lret=RegOpenKeyEx(HKEY_CURRENT_USER,keyname3,
NULL,KEY_READ|KEY_WRITE|KEY_SET_VALUE,&hk);
if(lret==ERROR_SUCCESS&&NULL!=hk)
{
DWORD dwtype;
char pbuf[256];
DWORD dwlen=sizeof(pbuf);
constchar* valname="Connection to adsl3";
lret=RegQueryValueEx(hk,valname,NULL,&dwtype,pbuf,&dwlen);
if(lret!=ERROR_SUCCESS)
{
ShowError(lret);
}
pbuf[8] = 1;
pbuf[4]=pbuf[4]+1;
lret=RegSetValueEx(hk,valname,NULL,REG_BINARY,pbuf,dwlen);
RegCloseKey(hk);
}
DWORD dwret;
SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL,SMTO_NORMAL,
1000,&dwret);
}
Problem with above code is that existing Internet Explorer instances don't know the change of settings. What is more, changing registry directly is not an elegant method. Then the following must be more attractive :
Collapse
BOOL SetConnectionOptions(LPCTSTR conn_name,LPCTSTR proxy_full_addr)
{
INTERNET_PER_CONN_OPTION_LIST list;
BOOL bReturn;
DWORD dwBufSize = sizeof(list);
list.dwSize = sizeof(list);
list.pszConnection = conn_name;
list.dwOptionCount = 3;
list.pOptions = new INTERNET_PER_CONN_OPTION[3];
if(NULL == list.pOptions)
{
OutputDebugString("failed to allocat memory in SetConnectionOptions()");
return FALSE;
}
list.pOptions[0].dwOption = INTERNET_PER_CONN_FLAGS;
list.pOptions[0].Value.dwValue = PROXY_TYPE_DIRECT |
PROXY_TYPE_PROXY;
list.pOptions[1].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
list.pOptions[1].Value.pszValue = proxy_full_addr;
list.pOptions[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS;
list.pOptions[2].Value.pszValue = "local";
bReturn = InternetSetOption(NULL,
INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize);
delete [] list.pOptions;
InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);
return bReturn;
}
BOOL DisableConnectionProxy(LPCTSTR conn_name)
{
INTERNET_PER_CONN_OPTION_LIST list;
BOOL bReturn;
DWORD dwBufSize = sizeof(list);
list.dwSize = sizeof(list);
list.pszConnection = conn_name;
list.dwOptionCount = 1;
list.pOptions = new INTERNET_PER_CONN_OPTION[list.dwOptionCount];
if(NULL == list.pOptions)
{
OutputDebugString("failed to allocat memory in DisableConnectionProxy()");
return FALSE;
}
list.pOptions[0].dwOption = INTERNET_PER_CONN_FLAGS;
list.pOptions[0].Value.dwValue = PROXY_TYPE_DIRECT ;
bReturn = InternetSetOption(NULL,
INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize);
delete [] list.pOptions;
InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);
return bReturn;
}
The usage is very straightforward:
const
char* connection_name="Connection to adsl3";
SetConnectionOptions(connection_name,"62.81.236.23:80");
DisableConnectionProxy(connection_name);
Existing Internet Explorer instances are notified by INTERNET_OPTION_SETTINGS_CHANGED
and INTERNET_OPTION_REFRESH
posted @
2007-01-25 20:13 崛起的程序員 閱讀(887) |
評論 (0) |
編輯 收藏
Hot Spot JVM5中的GC調(diào)優(yōu)
Written by Halatu Hubisi
引言
有JAVA開發(fā)經(jīng)驗的朋友們一定碰到過下面的這種情況,那就是自己所開發(fā)的應用運行了一段時間后其性能或者響應速度會有明顯的降低.這是由多方面的原因造成的即有程序本身的優(yōu)化問題,也有運行環(huán)境問題.此運行環(huán)境即包括硬件環(huán)境也包括軟件環(huán)境.大多數(shù)人第一個能想到的解決方法是提升硬件的配置而忽略了程序本身的運行環(huán)境JVM也提供了比較多的調(diào)優(yōu)選項.本文將重點描述利用JVM的一些選項對GC進行調(diào)優(yōu).
約定:
1.讀者應具備一定JAVA的知識.
2.本文中的JVM選項均以SUN公司發(fā)布的HotSpot JVM 5為準(不過大多數(shù)的選項在JVM1.3,JVM1.4中也是可用的).
3.以JAVA_HOME下demo/jfc/SwingSet2/SwingSet2.jar為例進行說明.
4.閱讀本文需要一些關(guān)于GC的知識,可以到附錄A中了解這些知識。
關(guān)鍵字:
JVM(java虛擬機),調(diào)優(yōu),GC(垃圾回收)
JVM GC調(diào)優(yōu)
為了能夠?qū)VM GC的調(diào)優(yōu)能夠使用在具體的實踐當中,下面將利用若干個例子來說明GC的調(diào)優(yōu).
例1:Heap size 設(shè)置
JVM堆的設(shè)置是指java程序運行過程中JVM可以調(diào)配使用的內(nèi)存空間的設(shè)置.JVM在啟動的時候會自動設(shè)置Heap size的值,其初始空間(即-Xms)是物理內(nèi)存的1/64,最大空間(-Xmx)是物理內(nèi)存的1/4。可以利用JVM提供的-Xmn -Xms -Xmx等選項可進行設(shè)置。Heap size 的大小是Young Generation 和Tenured Generaion 之和。
當在JAVA_HOME下demo/jfc/SwingSet2/目錄下執(zhí)行下面的命令。
java -jar -Xmn4m -Xms16m -Xmx16m SwingSet2.jar
系統(tǒng)輸出為:
Exception in thread "Image Fetcher 0" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Image Fetcher 3" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Image Fetcher 1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Image Fetcher 2" java.lang.OutOfMemoryError: Java heap space
除了這些異常信息外,還會發(fā)現(xiàn)程序的響應速度變慢了。這說明Heap size 設(shè)置偏小,GC占用了更多的時間,而應用分配到的執(zhí)行時間較少。
提示:在JVM中如果98%的時間是用于GC且可用的Heap size 不足2%的時候?qū)伋龃水惓P畔ⅰ?/span>
將上面的命令換成以下命令執(zhí)行則應用能夠正常使用,且未拋出任何異常。
java -jar -Xmn4m -Xms16m -Xmx32m SwingSet2.jar
提示:Heap Size 最大不要超過可用物理內(nèi)存的80%,一般的要將-Xms和-Xmx選項設(shè)置為相同,而-Xmn為1/4的-Xmx值。
例2:Young Generation(-Xmn)的設(shè)置
在本例中看一下Young Generation的設(shè)置不同將有什么現(xiàn)象發(fā)生。
假設(shè)將Young generation 的大小設(shè)置為4M ,即執(zhí)行java -jar -verbose:gc -Xmn4m -Xms32m -Xmx32m -XX:+PrintGCDetails SwingSet2.jar,屏幕輸出如下(節(jié)選)
[GC [DefNew: 3968K->64K(4032K), 0.0923407 secs] 3968K->2025K(32704K), 0.0931870 secs]
[GC [DefNew: 4021K->64K(4032K), 0.0356847 secs] 5983K->2347K(32704K), 0.0365441 secs]
[GC [DefNew: 3995K->39K(4032K), 0.0090603 secs] 6279K->2372K(32704K), 0.0093377 secs]
[GC [DefNew: 3992K->23K(4032K), 0.0057540 secs] 6325K->2356K(32704K), 0.0060290 secs]
[GC [DefNew: 3984K->27K(4032K), 0.0013058 secs] 6317K->2360K(32704K), 0.0015888 secs]
[GC [DefNew: 3981K->59K(4032K), 0.0023307 secs] 6315K->2422K(32704K), 0.0026091 secs]
將程序體制并將Young Generation的大小設(shè)置為8M,即執(zhí)行java -jar -verbose:gc -Xmn8m -Xms32m -Xmx32m -XX:+PrintGCDetails SwingSet2.jar,屏幕輸出如下(節(jié)選)
[GC [DefNew: 7808K->192K(8000K), 0.1016784 secs] 7808K->2357K(32576K), 0.1022834 secs]
[GC [DefNew: 8000K->70K(8000K), 0.0149659 secs] 10165K->2413K(32576K), 0.0152557 secs]
[GC [DefNew: 7853K->59K(8000K), 0.0069122 secs] 10196K->2403K(32576K), 0.0071843 secs]
[GC [DefNew: 7867K->171K(8000K), 0.0075745 secs] 10211K->2681K(32576K), 0.0078376 secs]
[GC [DefNew: 7970K->192K(8000K), 0.0201353 secs] 10480K->2923K(32576K), 0.0206867 secs]
[GC [DefNew: 7979K->30K(8000K), 0.1787079 secs] 10735K->4824K(32576K), 0.1790065 secs]
那么根據(jù)GC輸出的信息(這里取第一行)做一下Minor收集的比較。可以看出兩次的Minor收集分別在Young generation中找回3904K(3968K->64K)和7616K(7808K->192K)而對于整個jvm則找回1943K(3968K->2025)和5451K(7808K->2357K)。第一種情況下Minor收集了大約50%(1943/3904)的對象,而另外的50%的對象則被移到了tenured generation。在第二中情況下Minor收集了大約72%的對象,只有不到30%的對象被移到了Tenured Generation.這個例子說明此應用在的Young generation 設(shè)置為4m時顯的偏小。
提示:一般的Young Generation的大小是整個Heap size的1/4。Young generation的minor收集率應一般在70%以上。當然在實際的應用中需要根據(jù)具體情況進行調(diào)整。
例3:Young Generation對應用響應的影響
還是使用-Xmn4m 和-Xmn8m進行比較,先執(zhí)行下面的命令
java -jar -verbose:gc -Xmn4m -Xms32m -Xmx32m -XX:+PrintGCDetails -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime SwingSet2.jar
屏幕輸出如下(節(jié)選)
Application time: 0.5114944 seconds
[GC [DefNew: 3968K->64K(4032K), 0.0823952 secs] 3968K->2023K(32704K), 0.0827626 secs]
Total time for which application threads were stopped: 0.0839428 seconds
Application time: 0.9871271 seconds
[GC [DefNew: 4020K->64K(4032K), 0.0412448 secs] 5979K->2374K(32704K), 0.0415248 secs]
Total time for which application threads were stopped: 0.0464380 seconds
Young Generation 的Minor收集占用的時間可以計算如下:應用線程被中斷的總時常/(應用執(zhí)行總時?L+應用線程被中斷的總時常),那么在本例中垃圾收集占用的時?L約為系統(tǒng)的5%~14%。那么當垃圾收集占用的時間的比例越大的時候,系統(tǒng)的響應將越慢。
提示:對于互聯(lián)網(wǎng)應用系統(tǒng)的響應稍微慢一些,用戶是可以接受的,但是對于GUI類型的應用響應速度慢將會給用戶帶來非常不好的體驗。
例4:如何決定Tenured Generation 的大小
分別以-Xmn8m -Xmx32m和-Xmn8m -Xmx64m進行對比,先執(zhí)行
java -verbose:gc -Xmn8m -Xmx32m-XX:+PririntGCDetails -XX:+PrintGCTimeStamps java類,命令行將提示(只提取了Major收集)
111.042: [GC 111.042: [DefNew: 8128K->8128K(8128K), 0.0000505 secs]111.042: [Tenured: 18154K->2311K(24576K), 0.1290354 secs] 26282K->2311K(32704K), 0.1293306 secs]
122.463: [GC 122.463: [DefNew: 8128K->8128K(8128K), 0.0000560 secs]122.463: [Tenured: 18630K->2366K(24576K), 0.1322560 secs] 26758K->2366K(32704K), 0.1325284 secs]
133.896: [GC 133.897: [DefNew: 8128K->8128K(8128K), 0.0000443 secs]133.897: [Tenured: 18240K->2573K(24576K), 0.1340199 secs] 26368K->2573K(32704K), 0.1343218 secs]
144.112: [GC 144.112: [DefNew: 8128K->8128K(8128K), 0.0000544 secs]144.112: [Tenured: 16564K->2304K(24576K), 0.1246831 secs] 24692K->2304K(32704K), 0.1249602 secs]
再執(zhí)行java -verbose:gc -Xmn8m -Xmx64m-XX:+PririntGCDetails -XX:+PrintGCTimeStamps java類,命令行將提示(只提取了Major收集)
90.597: [GC 90.597: [DefNew: 8128K->8128K(8128K), 0.0000542 secs]90.597: [Tenured: 49841K->5141K(57344K), 0.2129882 secs] 57969K->5141K(65472K), 0.2133274 secs]
120.899: [GC 120.899: [DefNew: 8128K->8128K(8128K), 0.0000550 secs]120.899: [Tenured: 50384K->2430K(57344K), 0.2216590 secs] 58512K->2430K(65472K), 0.2219384 secs]
153.968: [GC 153.968: [DefNew: 8128K->8128K(8128K), 0.0000511 secs]153.968: [Tenured: 51164K->2309K(57344K), 0.2193906 secs] 59292K->2309K(65472K), 0.2196372 secs]
可以看出在Heap size 為32m的時候系統(tǒng)等候時間約為0.13秒左右,而設(shè)置為64m的時候等候時間則增大到0.22秒左右了。但是在32m的時候系統(tǒng)的Major收集間隔為10秒左右,而Heap size 增加到64m的時候為30秒。那么應用在運行的時候是選擇32m還是64m呢?如果應用是web類型(即要求有大的吞吐量)的應用則使用64m(即heapsize大一些)的比較好。對于要求實時響應要求較高的場合(例如GUI型的應用)則使用32m比較好一些。
注意:
1。因為在JVM5運行時已經(jīng)對Heap-size進行了優(yōu)化,所以在能確定java應用運行時不會超過默認的Heap size的情況下建議不要對這些值進行修改。
2。Heap size的 -Xms -Xmn 設(shè)置不要超出物理內(nèi)存的大小。否則會提示“Error occurred during initialization of VM Could not reserve enough space for object heap”。
例5:如何縮短minor收集的時間
下面比較一下采用-XX:+UseParNewGC選項和不采用它的時候的minor收集將有什么不同。先執(zhí)行
java -jar -server -verbose:gc -Xmn8m -Xms32m -Xmx32m SwingSet2.jar
系統(tǒng)將輸出如下信息(片段〕
[GC 7807K->2641K(32576K), 0.0676654 secs]
[GC 10436K->3108K(32576K), 0.0245328 secs]
[GC 10913K->3176K(32576K), 0.0072865 secs]
[GC 10905K->4097K(32576K), 0.0223928 secs]
之后再執(zhí)行 java -jar -server -verbose:gc -XX:+UseParNewGC -Xmn8m -Xms32m -Xmx32m SwingSet2.jar
系統(tǒng)將輸出如下信息(片段〕
[ParNew 7808K->2656K(32576K), 0.0447687 secs]
[ParNew 10441K->3143K(32576K), 0.0179422 secs]
[ParNew 10951K->3177K(32576K), 0.0031914 secs]
[ParNew 10985K->3867K(32576K), 0.0154991 secs]
很顯然使用了-XX:+UseParNewGC選項的minor收集的時間要比不使用的時候優(yōu)。
例6:如何縮短major收集的時間
下面比較一下采用-XX:+UseConcMarkSweepGC選項和不采用它的時候的major收集將有什么不同。先執(zhí)行
java -jar -verbose:gc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Xmn64m -Xms256m -Xmx256m SwingSet2.jar
系統(tǒng)將輸出如下信息(片段〕
[Full GC 22972K->18690K(262080K), 0.2326676 secs]
[Full GC 18690K->18690K(262080K), 0.1701866 secs
之后再執(zhí)行 java -jar -verbose:gc -XX:+UseParNewGC -Xmn64m -Xms256m -Xmx256m SwingSet2.jar
系統(tǒng)將輸出如下信息(片段〕
[Full GC 56048K->18869K(260224K), 0.3104852 secs]
提示:此選項在Heap Size 比較大而且Major收集時間較長的情況下使用更合適。
例7:關(guān)于-server選項 在JVM中將運行中的類認定為server-class的時候使用此選項。SUN 的Hot Spot JVM5 如果判斷到系統(tǒng)的配置滿足如下條件則自動將運行的類認定為server-class,并且會自動設(shè)置jvm的選項(當沒有手工設(shè)置這選項的時候〕而且HOTSPOT JVM5提供了自動調(diào)優(yōu)的功能,他會根據(jù)JVM的運行情況進行調(diào)整。如果沒有特別的需要是不需要太多的人工干預的。SUN形象的稱這個機制為“人體工學”(Ergonomics〕。具體可以參考http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
*.具有2個或更多個物理的處理器
*.具有2G或者更多的物理內(nèi)存
提示:此選項要放在所有選項的前面。例如:java -server 其他選項 java類
附錄A:預備知識
.JVM中對象的劃分及管理
JVM根據(jù)運行于其中的對象的生存時間大致的分為3種。并且將這3種不同的對象分別存放在JVM從系統(tǒng)分配到的不同的內(nèi)存空間。這種對象存放空間的管理方式叫做Generation管理方式。
1。Young Generation:用于存放“早逝”對象(即瞬時對象)。例如:在創(chuàng)建對象時或者調(diào)用方法時使用的臨時對象或局部變量。
2。Tenured Generation:用于存放“駐留”對象(即較長時間被引用的對象)。往往體現(xiàn)為一個大型程序中的全局對象或長時間被使用的對象。
3。Perm Generation:用于存放“永久”對象。這些對象管理著運行于JVM中的類和方法。
.JVM選項的分類
JVM有這么幾種選項供使用.
1.供-X選項使用的項目,又稱為非標準選項,不同廠商的此類型選項是有所不同的。例如:IBM的JVM用的一些選項在Sun的JVM中就不一定能生效。這種選項的使用方式如下:
java -Xmn16m -Xms64m -Xmx64m java類名
2.供-XX選項使用的項目,這種類型的選項可能要求有對系統(tǒng)信息訪問的權(quán)限。所以要慎用。這種選項的使用方式如下:
java -XX:MaxHeapFreeRatio=70 -XX:+PrintGCDetails java類名
3.java選項(即在命令行執(zhí)行java后提示的選項).
java -server -verbose:gc -d64 java類名
.垃圾收集分類
在JVM中有兩種垃圾方式,一種叫做Minor(次收集),另一種叫做Major(主收集)。其中Minor在Young Generation的空間被對象全部占用后執(zhí)行,主要是對Young Generation中的對象進行垃圾收集。而Major是針對于整個Heap size的垃圾收集。其中Minor方式的收集經(jīng)常發(fā)生,并且Minor收集所占用的系統(tǒng)時間小。Major方式的垃圾收集則是一種“昂貴”的垃圾收集方式,因為在Major要對整個Heap size進行垃圾收集,這會使得應用停頓的時間變得較長。
.GC信息的格式
[GC [<collector>: <starting occupancy1> -> <ending occupancy1>, <pause time1> secs] <starting occupancy3> -> <ending occupancy3>, <pause time3> secs]
<collector> GC為minor收集過程中使用的垃圾收集器起的內(nèi)部名稱.
<starting occupancy1> young generation 在進行垃圾收集前被對象使用的存儲空間.
<ending occupancy1> young generation 在進行垃圾收集后被對象使用的存儲空間
<pause time1> minor收集使應用暫停的時間長短(秒)
<starting occupancy3> 整個堆(Heap Size)在進行垃圾收集前被對象使用的存儲空間
<ending occupancy3> 整個堆(Heap Size)在進行垃圾收集后被對象使用的存儲空間
<pause time3> 整個垃圾收集使應用暫停的時間長短(秒),包括major收集使應用暫停的時間(如果發(fā)生了major收集).
.GC信息的選項
-XX:+PrintGCDetails 顯示GC的詳細信息
-XX:+PrintGCApplicationConcurrentTime 打印應用執(zhí)行的時間
-XX:+PrintGCApplicationStoppedTime 打印應用被暫停的時間
提示:1.":"后的"+"號表示開啟此選項,如果是"-"號那么表示關(guān)閉此選項。
?????2.在不同的選項和不同的收集方式和類型下輸出的格式會有所不同。
附錄B:HotSpot JVM 選項
請參考JavaTM HotSpot VM Options
附錄C:其他資源
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
http://java.sun.com/docs/hotspot/gc5.0/ergo5.html
posted @
2006-11-28 19:23 崛起的程序員 閱讀(440) |
評論 (0) |
編輯 收藏
清晨的時候,
在近春園曲折的小路上走,
看見一個老人坐在湖邊悠閑地垂釣
依稀聽見濕漉漉的笛聲
婉約進樹林深處,
老人專注的神情似乎能
漾起水中的波影,
然后目光被長長的眉須剪斷,
撲閃在晨霧中捕捉著空氣.
這是怎樣一種美妙啊!
我在他身邊坐下,靜靜等待
魚兒的到來.半個小時過去了,
我的心情開始煩躁,
可老人的微笑一如既往.
"你們二十幾歲的年輕人啊,
心就像一個玻璃杯,
透明,盛滿了陽光."
老人說話跟垂釣一樣,安詳.
和仙風道骨的老人話別后,
我決定從粉綠的湖邊繼續(xù)往前走,
去探尋校園極致的景色,
享受年輕的心情,
呵呵,像玻璃杯……???????????????????????????????????
posted @
2006-11-19 19:57 崛起的程序員 閱讀(293) |
評論 (0) |
編輯 收藏
String strs = request.getParameter("yourstrs");
byte b[] = strs.getBytes("ISO-8859-1");
strs = new String(b);
簡潔寫法:
String convert = new String(request.getParmater("inputname").trim().getBytes("ISO8859_1"), "GBK");
posted @
2006-11-10 09:53 崛起的程序員 閱讀(240) |
評論 (0) |
編輯 收藏