<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/wordpress-mu-1.1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Kenyth's BizTech Blog</title>
	<link>http://my.donews.com/kenyth</link>
	<description>迷途难返！Do the best with what god gave you！</description>
	<pubDate>Sun, 13 May 2007 12:55:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=wordpress-mu-1.1.1</generator>
	<language>en</language>
			<item>
		<title>SWT Programming Tutorials</title>
		<link>http://my.donews.com/kenyth/2007/05/13/swt-programming-tutorials/</link>
		<comments>http://my.donews.com/kenyth/2007/05/13/swt-programming-tutorials/#comments</comments>
		<pubDate>Sun, 13 May 2007 12:55:38 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/05/13/swt-programming-tutorials/</guid>
		<description><![CDATA[Resources

SWT Programming with Eclipse  
What exactly is the &#8220;Event Dispatch&#8221; thread (aka &#8220;AWT&#8221; Thread)?  
When exactly is the AWT thread started?  
Getting started with SWT  
Getting Started with Eclipse 2.1 and the SWT
... ]]></description>
			<content:encoded><![CDATA[<p><strong><u>Resources</u></strong></p>
<ol>
<li><a href="http://www.developer.com/java/other/article.php/3330861">SWT Programming with Eclipse</a>  </li>
<li><a href="http://www.jguru.com/faq/view.jsp?EID=8963">What exactly is the &#8220;Event Dispatch&#8221; thread (aka &#8220;AWT&#8221; Thread)?</a>  </li>
<li><a href="http://www.jguru.com/faq/view.jsp?EID=209463">When exactly is the AWT thread started?</a>  </li>
<li><a href="http://www.javazoid.com/swtGridPuzzle.html">Getting started with SWT</a>  </li>
<li><a href="http://www.cs.umanitoba.ca/~eclipse/">Getting Started with Eclipse 2.1 and the SWT</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/05/13/swt-programming-tutorials/feed/</wfw:commentRss>
		</item>
		<item>
		<title>上海EDGE/EGPRS商用5.17（世界电信日）</title>
		<link>http://my.donews.com/kenyth/2007/05/13/%e4%b8%8a%e6%b5%b7edgeegprs%e5%95%86%e7%94%a8517%ef%bc%88%e4%b8%96%e7%95%8c%e7%94%b5%e4%bf%a1%e6%97%a5%ef%bc%89/</link>
		<comments>http://my.donews.com/kenyth/2007/05/13/%e4%b8%8a%e6%b5%b7edgeegprs%e5%95%86%e7%94%a8517%ef%bc%88%e4%b8%96%e7%95%8c%e7%94%b5%e4%bf%a1%e6%97%a5%ef%bc%89/#comments</comments>
		<pubDate>Sun, 13 May 2007 12:20:56 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[好玩的东东]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/05/13/%e4%b8%8a%e6%b5%b7edgeegprs%e5%95%86%e7%94%a8517%ef%bc%88%e4%b8%96%e7%95%8c%e7%94%b5%e4%bf%a1%e6%97%a5%ef%bc%89/</guid>
		<description><![CDATA[听说/看见
详见新闻，其实内环线以内可能早就有了，有人4月份就发现了（里面还包括了详细的技术参数）。这里说的EDGE在5.17商用可能是在上海全境覆盖。我是看了这条新闻才昨天在自己的手... ]]></description>
			<content:encoded><![CDATA[<p><strong><u>听说/看见</u></strong></p>
<p>详见<a href="http://tech.sina.com.cn/t/2007-05-12/09541503664.shtml" target="_blank">新闻</a>，其实内环线以内可能早就有了，<a href="http://firefly-icelus.spaces.live.com/Blog/cns!42B42899E8075E68!153.entry" target="_blank">有人4月份就发现了</a>（里面还包括了详细的技术参数）。这里说的EDGE在5.17商用可能是在上海全境覆盖。我是看了这条新闻才昨天在自己的手机上注意到以前显示信号的那个G （GPRS）变成了E（EDGE/EGPRS），但还是会时常在G和E之间跳动，不知道是为什么，大概还在测试吧。</p>
<p>总体感觉在网速上还没有多明显的变化，和以前感觉差不多，其实上海GPRS网络不稳定（跟上海移动的客服反应过，没有明确答复，叫我重启机器重新搜索网络），就我的使用经验来说，GPRS的速度都还可以容忍，所以比较赞成<a href="http://blog.sina.com.cn/u/4a49bd18010009dt" target="_blank">这位朋友的看法</a>，注重<strong>用户体验</strong>，虽然他是从资费的角度来讲的。</p>
<p>对两者的网速有些说法。首先理论峰值，GPRS：171.2kbps，EDGE：473.6kbps；稳定（不在高速移动的情况下）的时候实际值，GPRS：57.6kbps，相当于56k的猫，EDGE：190kbps。所以EDGE的速度是GPRS的2～4倍。</p>
<p>另外，CDMA1X的理论峰值307.2kbps，实际稳定值有153.6kbps，几乎是GPRS的4倍。</p>
<p>要注意的是换成字节的速度（B, Byte）都要除以8。</p>
<p><strong><u>实测</u></strong></p>
<p>我用手机上的operaMini上网在<a href="http://www.bandwidthplace.com/speedtest" target="_blank">这里</a>测了一下速度，一共测了三次，前两次的结果差不多都是：</p>
<p>240k<strong>b</strong>ps communications</p>
<p>29.8k<strong>B</strong>ps storage</p>
<p>39s 1MB file download</p>
<p>第三次的测试结果为（信号显示又变回了G，但是199.8kbps也超出了GPRS的理论值，confusing）：</p>
<p>199.8k<strong>b</strong>ps communications</p>
<p>24.4k<strong>B</strong>ps storage</p>
<p>42s 1MB file download</p>
<p>测试结果项目的解释见<a href="http://www.bandwidthplace.com/speedtest/about/tech.php?a=results" target="_blank">这里</a>，有这么快么，感觉没这么快啊，怀疑ing。</p>
<p>现在市面上的手机应该有很多都支持EDGE的。</p>
<p><strong><u>BUZZ</u></strong></p>
<p>别人的体验和评论：<a href="http://comment1.news.qq.com/comment.htm?site=tech&amp;id=136190" target="_blank">1</a>，<a href="http://comment4.news.sina.com.cn/comment/skin/default.html?channel=kj&amp;newsid=2-1-1503664" target="_blank">2</a>，<a href="http://comment.tech.163.com/tech_bbs/3E98T48V000915BE.html" target="_blank">3</a>，<a href="http://blog.sina.com.cn/u/4a49bd18010009dt" target="_blank">4</a>，<a href="http://firefly-icelus.spaces.live.com/Blog/cns!42B42899E8075E68!153.entry" target="_blank">5</a>。</p>
<p>引述别人的一个评论泼一下冷水：</p>
<blockquote><p><font color="#8000ff">别吹了,当年中国移吹的gprs能达到171.2k.而实际有多少,人少的时候能达到2-3k,人多时就只有那200个字节左右.远比1x差远了,现在又造出什么EGPRS,号称470k,也就gprs的2.5倍 ,本人没用过,但按2.5倍算,充其量就是最大7k.小500字节,中国移动的东西大大打折扣,你们别信它 .这就是广东推EGPRS半年多,也没几个人用,人们还去买1x的原因.</font></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/05/13/%e4%b8%8a%e6%b5%b7edgeegprs%e5%95%86%e7%94%a8517%ef%bc%88%e4%b8%96%e7%95%8c%e7%94%b5%e4%bf%a1%e6%97%a5%ef%bc%89/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Difference among Swing, AWT, SWT and JFace</title>
		<link>http://my.donews.com/kenyth/2007/05/07/difference-among-swing-awt-swt-and-jface/</link>
		<comments>http://my.donews.com/kenyth/2007/05/07/difference-among-swing-awt-swt-and-jface/#comments</comments>
		<pubDate>Sun, 06 May 2007 16:49:39 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/05/07/difference-among-swing-awt-swt-and-jface/</guid>
		<description><![CDATA[Introduction
I know questions like telling the differences among Swing, awt, SWT and JFace or some of them are frequently asked in an interview for Java programmers. I don&#8217;t use them very often and extensively, nor do I know too much about those fo... ]]></description>
			<content:encoded><![CDATA[<p><strong><u>Introduction</u></strong></p>
<p>I know questions like telling the differences among Swing, awt, SWT and JFace or some of them are frequently asked in an interview for Java programmers. I don&#8217;t use them very often and extensively, nor do I know too much about those four things, especially from the implementation perspective or the guru&#8217;s best practice perspective. But I do read some materials and figure out some conceptual difference between those four things that I think would suffice answering such questions in an interview.</p>
<p><strong><u>AWT and Swing</u></strong></p>
<p>-AWT</p>
<p>AWT&nbsp;stands for abastract window toolkit which comes with an early release of the Java Programming Language ( about 1.1 ). AWT&nbsp;components are &nbsp;referred to as <strong>heavyweight components</strong>. It is implemented as having &#8220;peer&#8221; native code for every widget you create. Most of the <strong>significant logics (including the core event handling logic)&nbsp;of the toolkit are written in C/C++</strong>, for which via JNI (Java Native Interface) your GUI program may directly calls those &#8220;peer&#8221; native code. It means all of the drawings of your GUI are done directly by the graphic API of the underlying operating system. This implementation underlies several limitations:</p>
<ul>
<li>Not all the operating system support the same set of native widgets, so a &#8220;least common denominator&#8221; philosophy is used when shipping the&nbsp;AWT library, that is only a basic set of components are provided as library via which you write your GUI. So no complex components such as slider, tree and table can be found in AWT components,&nbsp;which you have to build yourself either through directly writing native code as&nbsp;AWT is implemented, or through writing Java codes which wraps AWT ( this is the way Swing is implemented).  </li>
<li>Because the core logic are hided from you in the native code, debugging your GUI program can be annoying.</li>
</ul>
<p>This kind of implementation also results in your GUI implemented with AWT always having the same look and feel as the underlying OS.</p>
<p>-Swing</p>
<p>In contrast, &nbsp;Swing components are known as <strong>lightweight components</strong>, because Swing doesn&#8217;t implement <strong>the underlying drawing and event handling logic which are delegated to the toolkit in this case AWT, on which it is built on</strong>. As mentioned above, Swing is implemented by pure Java codes. So it is conceivable that Swing has the portability that AWT doesn&#8217;t have, and that Swing has almost all the nontrivial complex components. Swing can also have the same look and feel on all OS, and can also be switched to another style of look and feel at runtime regardless of the underlying OS. It is said that Swing has a better performance than AWT, however, from the implementation logic so far I&#8217;ve known, I can&#8217;t tell why. Swing seems well known for its good design and architecture.</p>
<p>-Never intermix&nbsp;AWT&nbsp;and Swing</p>
<p>I know&nbsp;a lot has been said and written about this subject. The first item in the resources section is a good example of that.</p>
<p><strong><u>SWT and JFace</u></strong></p>
<p>-SWT</p>
<p>SWT, short&nbsp;for standard widget tookit, is originally introduced by IBM, as a substitute of AWT. SWT now is as part of the eclipse platform based on which the eclipse GUIs are implemented. <strong>SWT is very similar to AWT conceptually</strong>, however,&nbsp;the underlying implementation is a little different. Different from implementing all the core logic in &#8220;peer&#8221; logic in native code, SWT bears a thin JNI layer which is used for directly call the GUI API of each underlying platform. All the significant logics are written in pure Java codes in which the thin JNI layer is used. So <strong>almost all the limitations AWT has are elimintated in SWT</strong>. Other than this, better performance are gained, for which I don&#8217;t know the specific reason. As of AWT, SWT has a consisten look and feel as the underlying OS.</p>
<p>Disadvantages of using SWT:</p>
<ul>
<li>Reuire a native library (This also holds true for AWT).  </li>
<li>Low level of abstraction (This also holds true for AWT).</li>
</ul>
<p>-JFace</p>
<p><strong>JFace is conceputally similar to Swing</strong>.&nbsp;The relationship between JFace and SWT is very similar to the relationship between Swing and AWT. It works above the level of raw widgets, in this case, SWT. JFace has a rich set of complex widgets.</p>
<p><strong><u>Resources</u></strong></p>
<ol>
<li><a href="http://www.devx.com/tips/Tip/14718">Why You Shouldn&#8217;t&nbsp; Mix AWT and Swing</a>  </li>
<li><a href="http://www.jguru.com/faq/view.jsp?EID=507891">What is the difference between AWT and SWT</a>  </li>
<li><a href="http://forum.java.sun.com/thread.jspa?threadID=271579&amp;messageID=1044844">what is difference between swing and awt</a></li>
</ol>
<div class="wlWriterSmartContent">Technorati tags: <a href="http://technorati.com/tags/GUI" rel="tag">GUI</a>, <a href="http://technorati.com/tags/SWT" rel="tag">SWT</a>, <a href="http://technorati.com/tags/JFace" rel="tag">JFace</a>, <a href="http://technorati.com/tags/Swing" rel="tag">Swing</a>, <a href="http://technorati.com/tags/AWT" rel="tag">AWT</a>, <a href="http://technorati.com/tags/Java" rel="tag">Java</a>, <a href="http://technorati.com/tags/Eclipse" rel="tag">Eclipse</a></div>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/05/07/difference-among-swing-awt-swt-and-jface/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Exception as Non-Exception</title>
		<link>http://my.donews.com/kenyth/2007/05/03/exception-as-non-exception/</link>
		<comments>http://my.donews.com/kenyth/2007/05/03/exception-as-non-exception/#comments</comments>
		<pubDate>Thu, 03 May 2007 09:04:35 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/05/03/exception-as-non-exception/</guid>
		<description><![CDATA[Introduction
Quotes: One of the unexpected benefits of exception handling is better performance because many errors can be processed centrally instead of after each function call. - by Bruce Eckel, the author of Thinking in Java.
-First, what is exceptio... ]]></description>
			<content:encoded><![CDATA[<p><strong><u>Introduction</u></strong></p>
<p>Quotes: One of the unexpected benefits of exception handling is better performance because many errors can be processed centrally instead of after each function call<strong>.</strong> - by Bruce Eckel, the author of Thinking in Java.</p>
<p>-First, what is exception? </p>
<p>In JVM SPEC, an exception is defined to be an error that JVM would signal to a program if a program <strong>violates the semantic constrains</strong> of the Java programming language. But that&#8217;s not the complete fact, more generally, causing an exception&nbsp;is considered to be an exceptional condition or abnormal state that a program is in. So&nbsp;besides violating&nbsp;the semantic constrains of a programming language, which may be a critical and unrecoverable condition, breaking the assumption on the logic functionality of a program can also be considered to be exceptions. From a more formal perspective, every statement, method or generally, module are expected to fullfill some implicit or explicit contract, and an exception indicates the inability to fullfill the contract. Regardeless of the context of the specific programming languge (such&nbsp;as&nbsp;Java)&nbsp;exception handling mechanism,&nbsp;exception and&nbsp;error are interchangeablely used.</p>
<p>-Second, what is exception handling?</p>
<p>Informally speaking, exception handling is what you do about the exceptional condition. However, though an agreement on the defintion of exception are generally achieved, exception handling mechanisms are from time to time debated on. Generally, <strong>three techinques / mechanisms / notions are concerning with exception handling</strong>. <strong>First</strong>, exceptions can be identified by&nbsp;returning distinguished error values and handling exceptions is immediately done based on the error values. This is the most conventional way of identifying and handling exceptions. Many large system written in C or most conventional procedure languages utilize this way. <strong>Second</strong>, exceptions identifying and handling are distinguished from other features that a porgramming language provides. This can be found in many modern OO language such as C++ and Java. An Exception class (or method ?) is&nbsp; and can be designated for each kind of exceptional condition, and special satements with special keywords are introduced to notify ( or throw ) the condition and then handle the condition, usually at different places in your program. <strong>Third</strong>, exceptions are covered or at least not emphasized based on the assumption that a module and the client of a module take clearly divided responsiblities. This is mainly concerning an OO design principle called <strong>design by contract</strong>, DBC for short.</p>
<p><strong><u>Old-fashioned style by returning distinguished error values</u></strong></p>
<p>When encountering an error, return&nbsp;distinguished error values that are not considered normal return values. For example, a method that is to calculate the square root of a number doesn&#8217;t consider a negative number as a normal return value, so returning -1 / -2 / -3 indicates an error. <strong>The client code can distinguish a normal return value from error return values</strong>, so the client programmer can write code to cope with each exceptional condition according to returned error values, each of which indicate a kind of exceptional condition. E.g., </p>
<p><font color="#8000ff">int sqrt( int num )</font></p>
<p><font color="#8000ff">{</font></p>
<p><font color="#8000ff">&nbsp;&nbsp; if ( .. ) return -1;</font></p>
<p><font color="#8000ff">&nbsp;&nbsp; else if ( &#8230; )</font></p>
<p><font color="#8000ff">&nbsp;&nbsp; {</font></p>
<p><font color="#8000ff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8230;</font></p>
<p><font color="#8000ff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -2;</font></p>
<p><font color="#8000ff">&nbsp;&nbsp;&nbsp; }</font></p>
<p><font color="#8000ff">&#8230;</font></p>
<p><font color="#8000ff">}</font></p>
<p>-<strong>pros and cons</strong></p>
<p>pros:&nbsp; Both notifying and handling exceptions are light weight. 1) <strong>No extra mechanisms are needed</strong> to notify and handle exceptional condition, which means codes notifying and handling exceptional conditions are executed in exactly the same way other codes that solving the core problems runs. 2) This <strong>will not introduce any extra runtime overhead</strong> for exception handling.</p>
<p>cons: 1) This idiom tend to <strong>cause spaghetti codes</strong>. It will complexicate your method codes by having to place many error checking codes. 2) <strong>Agreements on what each error value means must be established</strong> between the author and the user of the method. And if the same&nbsp;meaning of an error value must be used among more than one method, the global agreement is hard to be established. For instance:</p>
<p><font color="#8000ff">return -1, if the passed in argument &lt; 0, -2, if &#8230;, -3 if &#8230;</font></p>
<p>3) For the client code, <strong>it is not enforced to handle any exceptional conditions</strong>. In other words, it&#8217;s completely up to the client programmer whether or not to handle any exceptional conditions. 4) In addition, even exceptional conditions are to be handled, <strong>duplicate codes must be written for each call of the mehod</strong>, that is, several calls to the same method requires several times of handling several same kind of exceptional conditions which means codes for handing exceptional conditions can&#8217;t be centralized and thus be reused. 5) More worse, handling exceptions must usually be followed immediately after recieving the error values, regardless of whether or not the then&#8217;s current context can provide enough information to handle the exceptions. That is, i<strong>t is hard to propagate the exception to the right level of abstraction only&nbsp;on which such exceptions can be properly handled</strong>.</p>
<p><strong><u>Exception handling style</u></strong></p>
<p>Utilize dedicated constructs, such as Exception types, to represent the exceptions and collect information about the exceptional conditions, and handle exceptions based on information wrapped in such constructs. </p>
<p>-<strong>pros and cons</strong></p>
<p>pros: 1) <strong>Exceptions and their handling are standardized</strong> as part of the features of a programming language that are distinguished from other features of that language. Handling some kinds of exceptions are enforced by the compiler, which means the learning curve are to some degree flattened.&nbsp;It&nbsp;less depends on the experiences, but are forced to be done. 2) <strong>Agreements on what exception means are easily established by the kind of dedicated constructs</strong>. And global reuse of these agreements needs no extra effort. 3) Though, it will stil cause spaghetti codes, it is alleviated by exception handling mechanism enabling that some exceptional conditions (such as access members on a null reference) are automatically notified in the standard way which means <strong>less error checking codes are needed</strong>. 4) Exceptions notifying and handling are loosely coupled, that is, identifying exceptions and handling them can be at two point far away from each othe in the control flow. This also means it is easy to propagate exceptions to the right level of abstraction on which such exceptions can be properly handled. 5) Due to easily propagating exceptions, <strong>handling the same kind of exceptions can be centralized</strong>, for which someone argues that unexpected performance benefits will be get as opposed to old-fashioned error values way.</p>
<p>cons: 1) Extra runtime overhead are needed to notify and handle exceptions for which at the implementation level,<strong> extra transfer of control is needed</strong>. &nbsp;2) <strong>Client codes are complicated by exceptions handler codes</strong> which are more obvious if exceptions notifying are misued and/or overused.</p>
<p><strong><u>Design by contract</u></strong></p>
<p>A contract is established, explicitly or implicitly, between a module and the user (client code) of the module. Any side must comform to the contract at any time, under any circumstance. The contract consists of precondition, invariant and postcondition. Whenever wherever the module is&nbsp;called (used)&nbsp;the precondition must be met, and after executing the module, the postcondition must be met. In the whole process the invariant must&nbsp;always be met. <strong>Obligations and benefits for both parties are specified</strong>. It is the obligation of the client to ensure the precondition is met before calling the module, and that of the module to ensure the invariant and postcondition are met. So any party is committed to its obligation regardless of the&nbsp;other party&#8217;s obligation.</p>
<p>More specificly, the client will check and ensure the precondition is met before it calling the module, so on most occassions, no exception mechanism is needed.&nbsp; <strong>Because if the contract is always conformed to, no exceptions are foreseen</strong>. But, usually, <strong>extra mechanism,&nbsp;such as assertion, is needed to help tell and/or check whether or not the contract is conformed to</strong>. However, even no such extra mechanism is provided, <strong>the idea behind DBC can also be used to prevent from overusing exceptions</strong> which may be caused by defensive programming. In general, DBC is sometimes considered to be a formal method.</p>
<p>p.s., the DBC community considers returning error values and exception handling two rivals <img src='http://my.donews.com/kenyth/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><u>Defensive programming</u></strong></p>
<p>The philosophy of defensive programming can be summed up as: Better to check too much, or check redundantly, than to check little. This is in contrast to DBC which advocates guaranteeing more by checking less. It is conceivable that defensive programming is caused because the contract in DBC is not established at all. Actually, defensive programming goes to another extreme. It assumes that the other party never burden its obligation, such as ensuring the precondition, so the module will itself burden others&#8217; obligations, such as checking for the precondition. This is mainly responsible for complexity and obscureness&nbsp;of codes. For instances, we have a module:</p>
<p><font color="#8000ff">int sqrt( int num )</font></p>
<p><font color="#8000ff">{</font></p>
<p><font color="#8000ff">&nbsp;&nbsp; if <strong>precondition is met</strong> then</font></p>
<p><font color="#8000ff">&nbsp;&nbsp;&nbsp; solve the problem; return &#8230;</font></p>
<p><font color="#8000ff">&nbsp;&nbsp;&nbsp; else return &#8230;</font></p>
<p><font color="#8000ff">}</font></p>
<p>and we have a snippet of client codes to call that module:</p>
<p><font color="#8000ff">if <strong>preondition for sqrt( .. ) is met</strong> then</font></p>
<p><font color="#8000ff">call sqrt( .. );</font></p>
<p>Pseudocodes in bold are caused by defensive programming. This way of programming are extensively common.</p>
<p><strong><u>Exception handling in Java</u></strong></p>
<p>When an exception is thrown, the JVM will transfer the control from the point where the exception occur to the point that can be specified by the programmer. During the process, the JVM abruptly completes, one by one, any expressions, statements, method and constructor invocations, static initializers, and field initialization expressions that have begun but not yet completed the execution in the current thread. The process continues until a handler for the thrown exception is found. If no such handler is found, then the method <strong>uncaughtException</strong> is invoked for the <strong>ThreadGroup</strong> that is the parent of the current thread.</p>
<p>If a <code>finally</code> clause is executed because of abrupt completion of a <code>try</code> block and the <code>finally</code> clause itself completes abruptly, then <strong>the reason for the abrupt completion of the <code>try</code> block is discarded and the new reason for abrupt completion is propagated from there</strong>.</p>
<p>If a method throws an exception, it must assume that exception is &#8220;caught&#8221; and dealt with. One of the advantages of Java exception handling is that it allows you to concentrate on the problem you&#8217;re trying to solve in one place, and then deal with errors from that code in another place.</p>
<p><strong><u>Goal of exception handling</u></strong></p>
<p>Make your program more reliable, robust and error-tolerant. Usually, it provides&nbsp;measures for you to be notified of the exceptional condition and recover from that condition.</p>
<p><strong><u>Best practices in Exception handling</u></strong></p>
<p>Below are some best practices in exception handling citing from the book &#8220;Effective Java&#8221;.</p>
<p>-Use exceptions only for exceptional condition</p>
<p>Prevent from overusing exception.</p>
<p>-Use checked exceptions for recoverable conditions and runtime exceptons for programming errors</p>
<p>Three kinds of exceptions: checked exception, unchecked exception and errors. By convention, errors must be&nbsp;used only by JVM. <strong>Programming errors may be considered to fail to fullfill the contract</strong> and are generally unrecoverable.</p>
<p>-Avoid unnecessary use of checked exceptions</p>
<p>Two reasons: first, exceptions handling needs extra runtime overhead; second, checked exceptions are forced to be caught which would complexicate your client code. This to some degree conforms to DBC by advocating the client code calls state-testing methods which actually is to ensure the precondition.</p>
<p>-Prefer standard exceptions over user-defined exceptions</p>
<p>For learning curve about your codes, &nbsp;understanability and portability of your codes.</p>
<p>-Throw exceptions appropriate to the abstraction</p>
<p>Exception translation, Exception chain.</p>
<p>-Document all exceptions&nbsp;thrown by each method</p>
<p>Javadoc style, or declaration using the keyword throws which is also called the exception specification.</p>
<p>Exceptions as a part of the specification of a method.</p>
<p>-Include failure-capture information in detail message</p>
<p>Refers to the goal of exception handling</p>
<p>-Strive for failure atomicity</p>
<p>Refers to the goal of exception handling</p>
<p>-Don&#8217;t ignore exceptions</p>
<p>No empty catch block.</p>
<p><strong><u>Other guidelines</u></strong></p>
<p>-User visible error message should not be the same as the failure message wrapped in the exception object (<strong>needs further investigation</strong>). The latter are only for programmer to debug the program.</p>
<p>-Don&#8217;t assume the way which the client codes burden&nbsp;their obligation and/or the degree to which they burden their obligations. However, unfortunately, defensive programming&nbsp;is often needed, though you should try your best to avoid.</p>
<p><strong><u>Resources</u></strong></p>
<ol>
<li>Chapter 8 Exceptions, Effective Java.  </li>
<li>2.16 Exceptions, Java Virtual Machine Spec.  </li>
<li>Chapter 10 Error Handling with Exceptions, Thinking in Java 2nd version.  </li>
<li><a href="http://archive.eiffel.com/doc/manuals/technology/contract/">Building bug-free O-O software: An introduction to Design by Contract(TM)</a>  </li>
<li><a href="http://www.computing.dcu.ie/research/papers/1999/3099.html">Design By Contract</a>  </li>
<li><a href="http://www.csc.calpoly.edu/~dstearns/SeniorProjectsWWW/Rideg/dbc.html">Design By Contract (DBC)</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/05/03/exception-as-non-exception/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Java基础复习</title>
		<link>http://my.donews.com/kenyth/2007/04/30/java%e5%9f%ba%e7%a1%80%e5%a4%8d%e4%b9%a0-2/</link>
		<comments>http://my.donews.com/kenyth/2007/04/30/java%e5%9f%ba%e7%a1%80%e5%a4%8d%e4%b9%a0-2/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 15:47:29 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/04/30/java%e5%9f%ba%e7%a1%80%e5%a4%8d%e4%b9%a0-2/</guid>
		<description><![CDATA[Introduction
基本上是按照网上流传甚广的一套Java的面试题目来的，一个一个问题回答。
谈谈final、finally、finalize的区别
&#160;其实除了名字类似，是不沾边的三个东西。
final
Final is a keyword that can&... ]]></description>
			<content:encoded><![CDATA[<p class="zoundry_bw_tags"><!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><span class="ztags"></span><span class="ztagspace"><strong>Introduction</strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">基本上是按照网上流传甚广的一套Java的面试题目来的，一个一个问题回答。</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>谈谈final、finally、finalize的区别</strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"></span>&nbsp;其实除了名字类似，是不沾边的三个东西。</p>
<p class="zoundry_bw_tags">final</p>
<p class="zoundry_bw_tags">Final is a keyword that can&nbsp;be used for&nbsp;classes, methods and data ( field / arguments ). It means what it modifies can&#8217;t be changed anymore. For final&nbsp;classes, they can&#8217;t be extended or derived; for final&nbsp;methods, the method&#8217;s behavior can&#8217;t be changed by overridden; for final data,&nbsp;they can only be initialized once and&nbsp;not be assigned values any more.&nbsp;But remember there&#8217;re two reasons for preventing change: design or efficiency.</p>
<p class="zoundry_bw_tags">&gt; final methods</p>
<p class="zoundry_bw_tags">There&#8217;re two reasons why you make a method final: 1) quite small final method can be inlined when they&#8217;re called which is more efficiently; 2) you don&#8217;t want a method to be explicitly overridden.</p>
<p class="zoundry_bw_tags">Private methods are considered to be implicitly final, because in whatever cases, you can&#8217;t access or override a private method.</p>
<p class="zoundry_bw_tags">&gt; final data</p>
<p class="zoundry_bw_tags">A&nbsp;misconception ( maybe it&#8217;s only mine : ) is that declaring data&nbsp;to be&nbsp;final doesn&#8217;t necessarily mean that its value is known at compile-time. The value can be run-time determinable. And data can also be declared to be final without any initialization value. In this case the final datum is called blank final field which has to be initialized in constructor or static initializer, or somewhere before use.</p>
<p class="zoundry_bw_tags">&gt; final classes</p>
<p class="zoundry_bw_tags">Defining classes as final simply prevents inheritance &#8212; nothing more. Since a class declared to be final can&#8217;t be inherited, all its&nbsp;methods are implicitly final and the complier can opt to bring efficiency for you as with other explicitly final methods.</p>
<p class="zoundry_bw_tags">finally</p>
<p class="zoundry_bw_tags">Finally is to do with Exception handling which can introduce a piece of code that you want to execute whether or not an exception is thrown within a try blok or catched in a catch block.</p>
<p class="zoundry_bw_tags">finalize</p>
<p class="zoundry_bw_tags">Finalize which is&nbsp;the name of a method&nbsp;of Object is to do with garbage collection, that is to do with memory release. Garbage collection in java is a two-pass process.&nbsp;In the first pass in which case the object is eligible for garbage-collected, garbage collector will call finalize(), and&nbsp;in the second pass in which case the running programm may reach the point of runing out memory, garbage collector may physically release memeory of eligible objects. So the storage of a finalized object isn&#8217;t necessarily get released.</p>
<p class="zoundry_bw_tags"><strong>Anonymous Inner Class （匿名内部类） 是否可以extends（继承）其它类，是否可以implements（实现）interface（接口）</strong></p>
<p class="zoundry_bw_tags">The answer is yes for both cases.</p>
<p class="zoundry_bw_tags">Inner class <strong>constructors get passed a hidden parameter</strong>, a reference to the outer class object that created them. static nested classes don&#8217;t have this hidden parameter. This is analogous to the way instance methods have hidden this parameter, where static methods do not.</p>
<p class="zoundry_bw_tags"><b>Inner classes are not permitted to have static methods or fields.</b> That is not quite true. They are allowed static final compile time constants, which are treated as if there were literals. If inner classes need statics, they have to get the outer class to hold them, or you have to use static nested classes or you have to inherit the static fields. Oddly, inner classes are permitted to extend classes that do have static methods and fields.</p>
<p class="zoundry_bw_tags">Anonymous inner class can&#8217;t define constructors. An anonymous inner class implements an interface, say, ITest, by:</p>
<p class="zoundry_bw_tags">new ITest() { .. }</p>
<p class="zoundry_bw_tags">and extends a class, say, Test,&nbsp;by:</p>
<p class="zoundry_bw_tags">new Test( name) { .. }</p>
<p class="zoundry_bw_tags">where Test( String name ) is an <strong>non-default constructor</strong> of Test, and default constructor can&#8217;t be used here!</p>
<p class="zoundry_bw_tags">For which&nbsp;kind&nbsp;of classes an anonymous class can extend / implement, refer to <a href="http://mindprod.com/jgloss/nestedclasses.html">nested classes : Java Glossary</a>.</p>
<p class="zoundry_bw_tags"><strong>Static Nested Class 和 Inner Class的不同</strong></p>
<p class="zoundry_bw_tags">Differs in creating instance of them, and linking with the outter class /instance.</p>
<p class="zoundry_bw_tags"><strong>&amp;和&amp;&amp;的区别</strong></p>
<p class="zoundry_bw_tags">&amp; is bitwise AND ( 位与) operator,&nbsp; while &amp;&amp; is logical AND (逻辑与) operator.</p>
<p class="zoundry_bw_tags"><strong>Shift operators</strong></p>
<p class="zoundry_bw_tags">The left-shift operator(&nbsp;&lt;&lt;&nbsp;) produces the operand to the left of the operator shifted to the left by the number of bits specified after the operator( inserting zeroes at the lower-order bits ).&nbsp;The signed right-shift operator( &gt;&gt; )&nbsp;produces the operand to the left of the operator shifted to the right by the number of bits specified after the operator( inserting zeroes / ones&nbsp;at the higher-order bits ). There&#8217;s an unsigned right-shift operator( &gt;&gt;&gt; ) will produces results inserting&nbsp;zeroes at the&nbsp;higher-order bits regardless of the sign.&nbsp;</p>
<p class="zoundry_bw_tags">Shift operators can be combined with equl sign, such as, &lt;&lt;=, &gt;&gt;=, and &gt;&gt;&gt;=.</p>
<p class="zoundry_bw_tags"><strong>Talk about collection framwork in Java 2</strong></p>
<p class="zoundry_bw_tags">Main interfaces: Collection, List, Set, Map. There&#8217;re actually <strong>only three collections List, Set and Map</strong>, and only two or three implementations of each one. And <strong>Map is not derived from Collection</strong>. The reason putting it the collection framwork is because a Map can produce collections from its key set and value list. Refer to chaper 9 of Thinking in Java 2nd version and Sun&#8217;s Java library for full details.</p>
<p class="zoundry_bw_tags">All collection implementation requires type checking ( especially&nbsp;with generic feature in Java 5 )&nbsp;or bounds checking, or both.</p>
<p class="zoundry_bw_tags">Vector is synchronized, which means it&#8217;s thread-safe.</p>
<p class="zoundry_bw_tags">ArrayList is much like an array except it is variant-sized which brings extra run-time overhead.</p>
<p class="zoundry_bw_tags">The <strong>List interface</strong> provides four methods for positional (indexed) access to list elements. Note that these operations may execute in time proportional to the index value for some implementations (the LinkedList class, for example). Thus, <strong>iterating over the elements in a list is typically preferable to indexing through it if the caller does not know the implementation</strong>.</p>
<p class="zoundry_bw_tags">For the <strong>Set interface</strong>, a speicial case of prohibition is that it is not permissible for a set to contain itself as an element.</p>
<p class="zoundry_bw_tags">&nbsp;</p>
<p class="zoundry_bw_tags"><strong>Diff between Collection and Collections</strong></p>
<p class="zoundry_bw_tags">First Collections is the name of a<strong> conceptual framework</strong> coined by the designers of Java to represent a collection of interfaces and / or classes that enables an object holding a group of objects and variaous operations on it. It is generally called the <strong>collections framework ( or container classes before Java 2 )</strong>.</p>
<p class="zoundry_bw_tags">Collection as a type name is the name of an interface which is <strong>the root of the collecitons framework hierarchy</strong> and is located at package <strong>java.util</strong>. While it is the root of the collection hierarchy, there&#8217;re some collection classes that&nbsp;aren&#8217;t rooted from it, such as Map.</p>
<p class="zoundry_bw_tags">While Collections is a class also&nbsp;located in the package java.util which consists of a variety of static methods that operate on or return collections. This is common technique used to <strong>organize a bunch of related PO paradigm interfaces*</strong> ( may be not types, but methods ) into one module supported by OOP paradigm to improve the modularity and/or accessability of such interfaces*. In some cases, this is called the <strong>facade design pattern</strong>. Similar classes examplifying this techinque are Arrays, Math, etc.</p>
<p class="zoundry_bw_tags"><strong>Diff between HashMap and HashTable</strong></p>
<p class="zoundry_bw_tags"><strong>String, StringBuffer, and StringBuilder</strong></p>
<p class="zoundry_bw_tags"><strong>String</strong> class represents character strings. All string literals ( e.g., &#8220;Kenyth&#8221; )&nbsp;in Java program are implemented as instances of String class. <strong>Strings are constant, namely immutable</strong>, as opposed to mutable StringBuffers. Their values can&#8217;t be changed after they&#8217;re created, which makes they can be shared ( refer to a&nbsp;compiler theory book about handling of constants ). And any modification to a String will produce a new instance of String, explicitly or implicitly. Concatenation of String is implemented as operations on StringBuffer( see the class file bytecode ), and conversions from an object to String is facilitated by the toString() method defined in Object class.</p>
<p class="zoundry_bw_tags"><strong>StringBuffer</strong> class represents a sequence of characters. It is <strong>mutable</strong>. It&nbsp;allows for&nbsp;data being appended to and inserted into&nbsp;it. It is thread-safe.</p>
<p class="zoundry_bw_tags"><strong>StringBuilder</strong> is like StringBuffer, but is not intended to be used by multi threads, that is not synchronized, or not thread-safe. It is <strong>introduced as of Java 5</strong>.</p>
<p class="zoundry_bw_tags"><strong>When to use assert</strong></p>
<p class="zoundry_bw_tags">( Actually I&#8217;ve never used this keyword in my programming ) For the full details refer to Sun&#8217;s official document <a href="http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html">Programming With Assertions</a>.</p>
<p class="zoundry_bw_tags">Simply speaking, assert in Java provides you a debugging facility similar to macros in C/C++. You can enable/disable your assertions when starting your program by passing in JVM command-line arguments ea/da. However, by default assertions are disabled at run-time.</p>
<p class="zoundry_bw_tags">There&#8217;s one guideline for deciding where/when to use assert that you <strong>should never use it for what your programming code do, such as method contract enforcement</strong>. Because since it is just a helper tool for debugging / observing your program and can be disabled, you must&nbsp;not depend the functionalities of your program on it.</p>
<p class="zoundry_bw_tags"><font color="#c0c0c0">more are coming soon&#8230;</font></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>Resources</strong></span></p>
<ol>
<li>Thinking in java version 2.  </li>
<li><a href="http://dev.cbw.com/java/j2ee/20056305404_4107281.shtml">JAVA面试题目（去了两家公司，都是这样的题目）</a> ：一个很好的问题导向的复习提纲。  </li>
<li><a href="http://www.frontfree.net/articles/services/view.asp?id=704&amp;page=1">初识Java内部类</a>：关于内部类的好处，静态内部类以及非静态内部类。&nbsp;  </li>
<li><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4351453">`final&#8217; variables and inner classes</a>: explains why access from anonymous inner&nbsp;class to non-final&nbsp;outter variables is not allowed.&nbsp;  </li>
<li><a href="http://mindprod.com/jgloss/nestedclasses.html">nested classes : Java Glossary</a>: contains very detailed explanation of the terms nested &nbsp;/ inner class and their usages.  </li>
<li><a href="http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html">Programming With Assertions</a>
<div class="zoundry_bw_tags"><span class="ztagspace"></span>&nbsp;</div>
</li>
</ol>
<p class="zoundry_bw_tags"><span class="ztagspace">Technorati</span> : <a class="ztag" href="http://technorati.com/tag/basics" rel="tag">basics</a>, <a class="ztag" href="http://technorati.com/tag/java" rel="tag">java</a>, <a class="ztag" href="http://technorati.com/tag/programming" rel="tag">programming</a> <br /><span class="ztags"></span><span class="ztagspace">Del.icio.us</span> : <a class="ztag" href="http://del.icio.us/tag/basics" rel="tag">basics</a>, <a class="ztag" href="http://del.icio.us/tag/java" rel="tag">java</a>, <a class="ztag" href="http://del.icio.us/tag/programming" rel="tag">programming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/04/30/java%e5%9f%ba%e7%a1%80%e5%a4%8d%e4%b9%a0-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Architecture of Eclipse</title>
		<link>http://my.donews.com/kenyth/2007/04/20/the-architecture-of-eclipse/</link>
		<comments>http://my.donews.com/kenyth/2007/04/20/the-architecture-of-eclipse/#comments</comments>
		<pubDate>Fri, 20 Apr 2007 12:00:42 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/04/20/the-architecture-of-eclipse/</guid>
		<description><![CDATA[Introduction
If explaining every bit in detail, you must be missed in the details and can&#8217;t see the architecture from a global perspective, nor will you be benifited in your practise. So I&#8217;m trying to explain the architecture based on senario... ]]></description>
			<content:encoded><![CDATA[<p class="zoundry_bw_tags"><!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><span class="ztags"></span><span class="ztagspace"><strong><em>Introduction</em></strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">If explaining every bit in detail, you must be missed in the details and can&#8217;t see the architecture from a global perspective, nor will you be benifited in your practise. So I&#8217;m trying to <strong>explain the architecture based on senarios</strong> such as what will happen when you startup elipse, what will happen when an action that you contribute is fired, etc. I hope in such a way&nbsp;it will do help in your practice with Eclipse.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">And, it is worthy to point out this is <strong>not an overview on the architecture of Eclipse</strong> for which there are tons of articles written about.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong><em>Startup of Eclipse</em></strong></span></p>
<p class="zoundry_bw_tags">What will happen when the file eclipse.exe is executed.</p>
<p class="zoundry_bw_tags">Startup of Eclilpse begins by running a system specific executable binary file called eclilpse.exe which is located under the&nbsp;root directory of the eclipse installation. This executable will then lauches the <strong>org.eclipse.core.launcher.Main</strong>, located in startup.jar. After that the entry point of Main, that is static main method of Main is invoked. Below we will illustrate the calling path of important methods to demonstrate the post startup process of Eclipse.</p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>Main.run( args )</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>Main.basicRun( args )</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>Main.getBootPath( .. ) : locate boot plugin ( in &#8220;plugin&#8221; directory of your eclispe installation ), within which Main.getDevPath( .. ) is called, within which Main.addBaseJars( .. ) is called, within which Main.readFrameworkExtensions( .. ) is called; invokeFramework( .. ): <strong>invoke EclipseStarter</strong></u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>the class <strong>EclipseStarter</strong> ( indicated by STARTER field ) is loaded by a URLClassLoader defined as an inner class with Main; EclipseStarter.run( .. ) is invoked in a reflective way</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>EclipseStarter.startup( .. ) : starts the platform and sets it up to run a single application</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>OSGi.new( .. ) : an instance of OSGi service platform is created</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>OSGi.launch() : <strong>start the OSGi framework</strong></u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>Framework.launch()</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>SystemBundle.resume() : <strong>SystemBundle</strong> subclasses Bundle to provide a system Bundle so that the framework can be represented as bundle</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>StartLevelManager.launch( .. ) : StartLevelManager is the startLevel service implementation for the OSGi spec</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>StartLevelManager.doSetStartLevel( .. )</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>StartLevelManager.incFWSL( .. )</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>StartLevelManager.getInstalledBundles( .. ) : Build an array of all installed bundles to be launch; StartLevelManager.loadInstalledBundles( .. ) : Load all bundles; StartLevelManager.resumeBundles( .. )</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>Framework.systemBundle.context.start() : Framework. :SystemBundle. :<strong>BundleContextImpl</strong>.start(), start the system bundle, BundleContextImpl.start() calls bundle&#8217;s BundleActivator.start()</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>BundleHost.loadBundleActivator() : Load and instantiate bundle&#8217;s BundleActivator class</u></font></p>
<p class="zoundry_bw_tags"><font color="#8000ff"><u>BundleContextImpl.startActivator( .. ) : <strong>calls the start method of a BundleActivator which you have to extend when you create a plug-in</strong>.</u></font></p>
<p class="zoundry_bw_tags"><strong>Eclispe can also be started from with a client </strong>( which is not part of the current Eclipse platform ), say, written in java, by using the <strong>EclispeStarter</strong> class located in org.eclipse.core.runtime.adaptor.</p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong><em>Action delegate and proxy</em></strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">What will happen when your contributed action is fired.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>Adding an action in a programatic way is different from adding it via contribution to an action extension point</strong>. For the former case, you have to implement some special API to create an action directly, while for the latter case you will have to only implement IActionDelegate+ which enables the lazy loading of the action.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">At startup the registry is read and a <strong>PluginAction</strong>( extends Action, implements *Selection*Listener, IPluginContribution ) is created for each action extension point. The instance of PluginAction is an <strong>action proxy</strong> which directly represent an action in run time but doesn&#8217;t do the job a real action does. When the action that the action proxy represents is fired, the real action( the <strong>action delegate</strong> )&nbsp;is created by the action proxy. After that point the action proxy delegate everything that is requested to the real action, the action delegate. This mechanism makes it possible to load the action extension lazily which is called <strong>lazy loading</strong>.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">Following depicts the flow of action proxy and delegate:</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><font color="#8000ff"><u>read from registry ( IExtensionRegistry ) -&gt; a PluginAction created for each action extension point ( while the action is fired -&gt; an action delegate created -&gt; action is delegated )</u></font></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong><em>Contribute an Extension</em></strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><font color="#c0c0c0">to be continued&#8230;</font></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong><em>Extension Pattern</em></strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">Adapter pattern&nbsp;is extensively used in Eclipse to contribute extensions ( different from extensions to extension point ) to type or instance. This mechanism is enabled mainly by implementing <strong>IAdaptable</strong> and IAdapterFactory. For the detailed explanation with examples, please refer to Chapter 31 of the book <a href="http://www.amazon.com/exec/obidos/ASIN/0321205758/qid%3D1101827580/sr%3D11-1/ref%3Dsr%5F11%5F1">Contributing to Eclipse: Principles, Patterns, and Plugins (Paperback)</a>.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong><em>Resources</em></strong></span></p>
<ol>
<li><a href="http://www.manageability.org/blog/stuff/the-architecture-of-eclipse/view">The Architecture of Eclipse</a>. This article refers to and linked to a lot of valuable resources.  </li>
<li><a href="http://www.developer.com/java/other/article.php/10936_3316241_1">A First Look at Eclipse Plug-In Programming</a>. Contains a very detailed comparsion between Sun&#8217;s awt and swing and Eclipse&#8217;s SWT and JFace and anatomy of the process of Eclispe startup.
<div class="zoundry_bw_tags"><span class="ztagspace"></span></div>
</li>
<li><a href="http://www.osgi.org/documents/collateral/TechnicalWhitePaper2005osgi-sp-overview.pdf">About the OSGi Service Platform - Technical Whitepaper Revision 4.0</a>  </li>
<li>org.eclipse.osgi_3.2.2.R32X_v20070118.jar : org.eclipse.core.runtime.adaptor.EclipseStarter.class source code, org.eclipse.osgi.framework.internal.core.AbstractBundle.class source code, org.eclipse.osgi.framework.internal.core.BundleContextImpl.class source code, org.eclipse.osgi.framework.internal.core.BundleHost.class source code, org.eclipse.osgi.framework.internal.core.Framework.class source code, org.eclipse.osgi.framework.internal.core.OSGi.class source code, org.eclipse.osgi.framework.internal.core.StartLevelManager.class source code, org.eclipse.osgi.framework.internal.core.SystemBundle.class source code, org.osgi.framework.BundleActivator.class source code.  </li>
<li>org.eclipse.ui.workbench_3.2.2.M20070119-0800.jar source code.  </li>
<li>eclipse 3.2.2 startup.jar : org.eclilpse.core.launcher.Main.class source code.  </li>
<li><a href="http://www.amazon.com/exec/obidos/ASIN/0321205758/qid%3D1101827580/sr%3D11-1/ref%3Dsr%5F11%5F1">Contributing to Eclipse: Principles, Patterns, and Plugins (Paperback)</a>  </li>
<li>Eclipse Help</li>
</ol>
<p><font color="#c0c0c0">to be continued&#8230;</font></p>
<p class="zoundry_bw_tags"><span class="ztagspace">Technorati</span> : <a class="ztag" href="http://technorati.com/tag/Architectrue" rel="tag">Architectrue</a>, <a class="ztag" href="http://technorati.com/tag/OSGi" rel="tag">OSGi</a>, <a class="ztag" href="http://technorati.com/tag/component%20oriented" rel="tag">component oriented</a>, <a class="ztag" href="http://technorati.com/tag/eclipse" rel="tag">eclipse</a>, <a class="ztag" href="http://technorati.com/tag/java" rel="tag">java</a>, <a class="ztag" href="http://technorati.com/tag/open%20source" rel="tag">open source</a>, <a class="ztag" href="http://technorati.com/tag/plug-in" rel="tag">plug-in</a> <br /><span class="ztags"></span><span class="ztagspace">Del.icio.us</span> : <a class="ztag" href="http://del.icio.us/tag/Architectrue" rel="tag">Architectrue</a>, <a class="ztag" href="http://del.icio.us/tag/OSGi" rel="tag">OSGi</a>, <a class="ztag" href="http://del.icio.us/tag/component+oriented" rel="tag">component oriented</a>, <a class="ztag" href="http://del.icio.us/tag/eclipse" rel="tag">eclipse</a>, <a class="ztag" href="http://del.icio.us/tag/java" rel="tag">java</a>, <a class="ztag" href="http://del.icio.us/tag/open+source" rel="tag">open source</a>, <a class="ztag" href="http://del.icio.us/tag/plug-in" rel="tag">plug-in</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/04/20/the-architecture-of-eclipse/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Knowledge on font size</title>
		<link>http://my.donews.com/kenyth/2007/04/19/knowledge-on-font-size/</link>
		<comments>http://my.donews.com/kenyth/2007/04/19/knowledge-on-font-size/#comments</comments>
		<pubDate>Thu, 19 Apr 2007 04:01:03 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/04/19/knowledge-on-font-size/</guid>
		<description><![CDATA[声明：全部摘抄自网络资源，准确性和完整性不能保证，请读者自己辨别。
Introduction
一种字体（font）是一组字形（glyph）的集合，每一个字形代表了特定字样（typeface）的字符集（character set）... ]]></description>
			<content:encoded><![CDATA[<p class="zoundry_bw_tags"><!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><span class="ztags"></span><span class="ztagspace"><strong>声明：全部摘抄自网络资源，准确性和完整性不能保证，请读者自己辨别。</strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>Introduction</strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">一种字体（font）是一组字形（glyph）的集合，每一个字形代表了特定字样（typeface）的字符集（character set）里面的一个字符。</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">A <a href="http://www.proxyhub.co.uk/index.php?q=uggc%3A%2F%2Fra.jvxvcrqvn.bet%2Fjvxv%2FSbag_%2528glcbtencuvp_grez%2529">font</a> is a set of glyphs (images) representing the characters from a particular <a href="http://www.proxyhub.co.uk/index.php?q=uggc%3A%2F%2Fra.jvxvcrqvn.bet%2Fjvxv%2FPunenpgre_frg">character set</a> in a particular typeface. In professional typography the term <i>typeface</i> is not interchangeable with the word <i>font</i>, which is defined as a given alphabet and its associated characters in a <i>single</i> size. For example, 8-point Caslon is one font, and 10-point Caslon is another. Historically, fonts came in specific sizes determining the size of characters, and in quantities of <i>sorts</i> or number of each letter provided. The design of characters in a font took into account all these factors.</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>Measurement of font size</strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">Point (pt, 磅)</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">在排版印刷中1pt是最小的测量单位，12pt是1pica，具体是多长视情况而定。传统的排版印刷中1pt可能在0.18到0.4mm之间，这依赖于对foot的定义，现代的桌面出版中（Desktop Publishing Point）1pt是1/72inch，也就是约0.3527mm，所以6pica是1inch。</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">Pixel（像素）</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">Inch（英寸）</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">millimeter（毫米）</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>Commonly used font size</strong></span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">9pt = 12px = 小五号</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">1pt = 4/3px</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace">MS WORD中最大能定义1638pt大小的字体！</span></p>
<p class="zoundry_bw_tags"><span class="ztagspace"></span></p>
<p>下表是字号与磅以及毫米之间的对应关系，并附以字样，以供大家在排版或调整布局时使用。<br /><img src="http://image2.sina.com.cn/IT/c/2003-01-02/1_2-68-897-8_20030102103153.jpg"/>  </p>
<p><strong>HTML和CSS中用的font size属性</strong>  </p>
<p>Syntax: font-size: &lt;absolute-size&gt; | &lt;relative-size&gt; | &lt;length&gt; | &lt;percentage&gt;<br />Possible Values:  </p>
<p>* &lt;absolute-size&gt;<br />o xx-small | x-small | small | medium | large | x-large | xx-large<br />* &lt;relative-size&gt;<br />o larger | smaller<br />* &lt;length&gt;<br />* &lt;percentage&gt; (in relation to parent element)  </p>
<p>Both <em>relative</em> and <em>absolute</em> length units are supported in CSS1. Relative units give a length relative to another length property, and are preferred since they will better adjust to different media. The following relative units are available:
<ul>
<li><strong>em</strong> (ems, the height of the element&#8217;s font)  </li>
<li><strong>ex</strong> (x-height, the height of the letter &#8220;x&#8221;)  </li>
<li><strong>px</strong> (pixels, relative to the canvas resolution) </li>
</ul>
<p>Absolute length units are highly dependent on the output medium, and so are less useful than relative units. The following absolute units are available:
<ul>
<li><strong>in</strong> (inches; 1in=2.54cm)  </li>
<li><strong>cm</strong> (centimeters; 1cm=10mm)  </li>
<li><strong>mm</strong> (millimeters)  </li>
<li><strong>pt</strong> (points; 1pt=1/72in)  </li>
<li><strong>pc</strong> (picas; 1pc=12pt) </li>
</ul>
<p>要注意的是，相同大小的字体在不同的具体环境下显示出来的字体的真实大小可能不一样，差别比较小的可能是用px度量的大小。</p>
<p>关于x-height的定义可以看<a href="http://www.proxyhub.co.uk/index.php?hl=0011110001&amp;q=uggc%3A%2F%2Fra.jvxvcrqvn.bet%2Fjvxv%2FFcrpvny%3AFrnepu%3Ffrnepu%3Dsbag%26fbheprvq%3Dzbmvyyn-frnepu#Font.2C_typeface_and_type_family">Typeface</a>中的解释，简要的说是，对每一个字体都有一个假想的水平线叫baseline（想想小时候练习写英文字母的时候每一行都有三条或者四条横线那种作业本），x-height就是从baseline到字体最高处的高度。</p>
<p class="zoundry_bw_tags"><span class="ztagspace"><strong>Resources</strong></span></p>
<ol>
<li><a href="http://htmlhelp.com/reference/css/font/font-size.html">Font Size</a>  </li>
<li><a href="http://www.proxyhub.co.uk/index.php?hl=0011110001&amp;q=uggc%3A%2F%2Fra.jvxvcrqvn.bet%2Fjvxv%2FFcrpvny%3AFrnepu%3Ffrnepu%3Dsbag%2Bfvmr%2B%26fbheprvq%3Dzbmvyyn-frnepu">Point (typography)</a>  </li>
<li><a href="http://www.proxyhub.co.uk/index.php?hl=0011110001&amp;q=uggc%3A%2F%2Fra.jvxvcrqvn.bet%2Fjvxv%2FFcrpvny%3AFrnepu%3Ffrnepu%3Dsbag%26fbheprvq%3Dzbmvyyn-frnepu#Font.2C_typeface_and_type_family">Typeface</a>  </li>
<li><a href="http://webdesign.chinaitlab.com/css/376665.html">CSS改变字体大小而不影响网页</a>  </li>
<li><a href="http://bbs.5qzone.net/read.php?tid=412349&amp;keyword=">【知识】字体中“号”“磅”及“毫米”的关系</a>  </li>
<li><a href="http://htmlhelp.com/reference/css/units.html#length">Length Units</a>
<div class="zoundry_bw_tags"><span class="ztagspace"></span>&nbsp;</div>
</li>
</ol>
<p class="zoundry_bw_tags"><span class="ztagspace">Technorati</span> : <a class="ztag" href="http://technorati.com/tag/CSS" rel="tag">CSS</a>, <a class="ztag" href="http://technorati.com/tag/HTML" rel="tag">HTML</a>, <a class="ztag" href="http://technorati.com/tag/Web%20Browser" rel="tag">Web Browser</a> <br /><span class="ztags"></span><span class="ztagspace">Del.icio.us</span> : <a class="ztag" href="http://del.icio.us/tag/CSS" rel="tag">CSS</a>, <a class="ztag" href="http://del.icio.us/tag/HTML" rel="tag">HTML</a>, <a class="ztag" href="http://del.icio.us/tag/Web+Browser" rel="tag">Web Browser</a> <br /><span class="ztags"></span><span class="ztagspace">Ice Rocket</span> : <a class="ztag" href="http://blogs.icerocket.com/tag/CSS" rel="tag">CSS</a>, <a class="ztag" href="http://blogs.icerocket.com/tag/HTML" rel="tag">HTML</a>, <a class="ztag" href="http://blogs.icerocket.com/tag/Web+Browser" rel="tag">Web Browser</a> <br /><span class="ztags"></span><span class="ztagspace">Flickr</span> : <a class="ztag" href="http://www.flickr.com/photos/tags/CSS" rel="tag">CSS</a>, <a class="ztag" href="http://www.flickr.com/photos/tags/HTML" rel="tag">HTML</a>, <a class="ztag" href="http://www.flickr.com/photos/tags/Web+Browser" rel="tag">Web Browser</a> <br /><span class="ztags"></span><span class="ztagspace">Zooomr</span> : <a class="ztag" href="http://beta.zooomr.com/photos/tags/CSS" rel="tag">CSS</a>, <a class="ztag" href="http://beta.zooomr.com/photos/tags/HTML" rel="tag">HTML</a>, <a class="ztag" href="http://beta.zooomr.com/photos/tags/Web%20Browser" rel="tag">Web Browser</a> <br /><span class="ztags"></span><span class="ztagspace">Buzznet</span> : <a class="ztag" href="http://www.buzznet.com/buzzwords/CSS" rel="tag">CSS</a>, <a class="ztag" href="http://www.buzznet.com/buzzwords/HTML" rel="tag">HTML</a>, <a class="ztag" href="http://www.buzznet.com/buzzwords/Web%20Browser" rel="tag">Web Browser</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/04/19/knowledge-on-font-size/feed/</wfw:commentRss>
		</item>
		<item>
		<title>newClasspathContainerEntry</title>
		<link>http://my.donews.com/kenyth/2007/03/21/newclasspathcontainerentry/</link>
		<comments>http://my.donews.com/kenyth/2007/03/21/newclasspathcontainerentry/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 13:43:25 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/03/21/newclasspathcontainerentry/</guid>
		<description><![CDATA[Introduction
Setting Java project build path involves setting classpaths of the project which are different from the Java runtime classpath. In JDT classpaths are represented with classpath entries which roughly fall into five kinds: source folder entrie... ]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Setting Java project build path involves setting classpaths of the project which are different from the Java runtime classpath. In JDT classpaths are represented with classpath entries which roughly fall into five kinds: source folder entries, binary library entries, prerequisite project entries, classpath variables, and classpath containers.</p>
<p>Start you eclipse JDT, open a Java project and launch the build path configuration window, and you&#8217;ll find all the options enabling you to add/remove all kinds of classpath entries. The frequently used JAVA_HOME system variable (under Windows) can be considered as a classpath variable here. And for a classpath container, hereafter comes more.</p>
<p><strong>Classpath Container</strong></p>
<p>Conceptually it is a data structure which represents a set of tupes with each in the form of &lt;aJavaProject, aClasspathContainer&gt;. An instance of this data structure can be referenced as an instance of IClasspathEntry which wrapped a unique path of type IPath called a container path. It is noteworthy that all kinds of classpath entries mentioned above are represented by instances of IClasspathEntry within which there is a field called kind identifying the kind of entries. And also, it is noteworthy that an instance of ClasspathContainer is not an instance of IClasspathEntry of kind container. Simply speaking, each instance of IClasspathEntry of kind container references as its member field a container path which uniquely identifies an instance of the data structure mentioned above which contains (or references) a set of instances of ClasspathContainer. Actually, it&#8217;s still a little complicated. But that&#8217;s it. Below is sketched the relationship.</p>
<p>IClasspathEntry(kind: container)-aContainerPath &#8211;&gt; &lt;aContainerPath, {&lt;aJavaProject, aClasspathContainer&gt;, &#8230;}&gt;.</p>
<p><strong>Ways of Creating Classpath Container Entries</strong></p>
<p>The implementation details are more complicated. Class or interfaces involved in include JavaModelManager, JavaCore, IClasspathEntry, ClassContainer, IClassContainerInitializer, and other Java Model classes. The set of tupes of the form of &lt;aJavaProject, aClasspathContainer&gt; are maintained in JavaModelManager.</p>
<p>Generally, there&#8217;re two ways of creating a classpath container entry. The 1st way is to hard code creating instances of ClasspathContainer, and the 2nd way is to create instances of ClasspathContainer via the lazily invoked classpath container initializer which you may define onto the extension point org.eclipse.jdt.core.classpathContainerInitializer.</p>
<p><em>The hard code way:</em></p>
<p>// create an instance of IClasspathEntry of kind CPE_CONTAINER<br />// but ClasspathContainer associated to this entry are not yet defined.<br />JavaCore.newContainerEntry(..);<br />&#8230;<br />// Create and set the classpath container<br />JavaCore.setClasspathContainer(..);<br />&#8230;<br />// Put container path, containers and projects into hashmaps.<br />// Invoked in JavaCore.setClasspathContainer(..).<br />JavaModelManager.containerPut(..)</p>
<p><em>The initializer way:</em></p>
<p>// Contribute an extension to the initializer extension point.</p>
<p>When classpath entries contained in containers get resolved, the execution process is:</p>
<p>// Methods resolving classpath entries will get method getClasspathContainer(..) invoked.<br />JavaCore.getClasspathContainer(..);<br />&#8230;<br />JavaModelManager.getClasspathContainer(..);<br />&#8230;<br />// Both ways would get this method invoked.<br />JavaModelManager.containerGet(..);<br />&#8230;<br />// The initializer way would get this method invoked,<br />// within which initializer extension(s) will be lazily invoked.<br />JavaModelManager.initializeAllContainers(..);<br />or JavaModelManager.initializeContainer(..);</p>
<p></p>
<p><strong>Resources</strong></p>
<ol>
<li><a href="http://help.eclipse.org/help32/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_classpath.htm">Setting the Java build path</a></li>
<li>JDT 3.2 Source Codes.</li>
</ol>
<p class="zoundry_bw_tags">
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  <span class="ztags"></span><span class="ztagspace">Technorati</span> : <a href="http://technorati.com/tag/Eclipse" class="ztag" rel="tag">Eclipse</a>, <a href="http://technorati.com/tag/JDT" class="ztag" rel="tag">JDT</a>, <a href="http://technorati.com/tag/classpath" class="ztag" rel="tag">classpath</a>, <a href="http://technorati.com/tag/java" class="ztag" rel="tag">java</a>, <a href="http://technorati.com/tag/plugin" class="ztag" rel="tag">plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/03/21/newclasspathcontainerentry/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Eclipse CDT CPU Usage 100% Solution</title>
		<link>http://my.donews.com/kenyth/2007/03/21/eclipse-cdt-cpu-usage-100-solution/</link>
		<comments>http://my.donews.com/kenyth/2007/03/21/eclipse-cdt-cpu-usage-100-solution/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 08:25:20 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/03/21/eclipse-cdt-cpu-usage-100-solution/</guid>
		<description><![CDATA[Solution
总的来说是把你的Eclipse使用的JRE换成6.0（早就download在机器上居然没有发现，2006.12.12就final release了，改成open source之后发布的速度快多了，现在都build100+了）的或者IBM的5.0实现，看别人... ]]></description>
			<content:encoded><![CDATA[<p><strong>Solution</strong></p>
<p>总的来说是把你的Eclipse使用的JRE换成6.0（早就download在机器上居然没有发现，2006.12.12就final release了，改成open source之后发布的速度快多了，现在都build100+了）的或者IBM的5.0实现，看别人的blog说是Sun的实现6.0以下有bug和CDT不兼容，我试了BEA的Jrockit5，也是有问题。</p>
<p>换成6.0后，Indexer和Content Assist都没有问题了，不会CPU100%了。</p>
<p>另外，不像[1]里面说的CDT3.0才有问题，最新的CDT3.1.2也还是有这个问题。</p>
<p><strong>Bonus Knowledge</strong></p>
<p>Use something like &#8220;-vmargs -Xmx256M&#8221; when launching eclipse to use more memory.</p>
<p><strong>Resources</strong></p>
<ol>
<li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=108242">Bugzilla Bug 108242 Full Indexer in CDT3.0 extremely slow or does not work</a></li>
<li><a href="http://www.javatang.com/archives/2007/01/28/202192.html">Eclipse3.2.1中使用CDT经常CPU100%问题的解决方法</a></li>
<li><a href="http://ykaiyan.blogchina.com/blog/5105624.html" target="_blank">Eclipse CDT开发C++速度慢的解决方法</a></li>
<li><a href="http://blog.sina.com.cn/u/493db3a4010007x0" target="_blank">CDT Indexer导致CPU 100%的解决办法</a></li>
<li><a href="http://www.javaworld.com.tw/jute/post/view?bid=10&amp;id=138616&amp;tpg=1&amp;ppg=1&amp;sty=1&amp;age=0#138616">Eclipse+cdt+MinGW 建立C++工程問題</a></li>
</ol>
<p class="zoundry_bw_tags">
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  <span class="ztags"></span><span class="ztagspace">Technorati</span> : <a href="http://technorati.com/tag/Eclipse%20CDT" class="ztag" rel="tag">Eclipse CDT</a>, <a href="http://technorati.com/tag/JRE6" class="ztag" rel="tag">JRE6</a>, <a href="http://technorati.com/tag/Java" class="ztag" rel="tag">Java</a> <br /><span class="ztags"></span><span class="ztagspace">Del.icio.us</span> : <a href="http://del.icio.us/tag/Eclipse+CDT" class="ztag" rel="tag">Eclipse CDT</a>, <a href="http://del.icio.us/tag/JRE6" class="ztag" rel="tag">JRE6</a>, <a href="http://del.icio.us/tag/Java" class="ztag" rel="tag">Java</a> <br /><span class="ztags"></span><span class="ztagspace">Ice Rocket</span> : <a href="http://blogs.icerocket.com/tag/Eclipse+CDT" class="ztag" rel="tag">Eclipse CDT</a>, <a href="http://blogs.icerocket.com/tag/JRE6" class="ztag" rel="tag">JRE6</a>, <a href="http://blogs.icerocket.com/tag/Java" class="ztag" rel="tag">Java</a> <br /><span class="ztags"></span><span class="ztagspace">Flickr</span> : <a href="http://www.flickr.com/photos/tags/Eclipse+CDT" class="ztag" rel="tag">Eclipse CDT</a>, <a href="http://www.flickr.com/photos/tags/JRE6" class="ztag" rel="tag">JRE6</a>, <a href="http://www.flickr.com/photos/tags/Java" class="ztag" rel="tag">Java</a> <br /><span class="ztags"></span><span class="ztagspace">Zooomr</span> : <a href="http://beta.zooomr.com/photos/tags/Eclipse%20CDT" class="ztag" rel="tag">Eclipse CDT</a>, <a href="http://beta.zooomr.com/photos/tags/JRE6" class="ztag" rel="tag">JRE6</a>, <a href="http://beta.zooomr.com/photos/tags/Java" class="ztag" rel="tag">Java</a> <br /><span class="ztags"></span><span class="ztagspace">Buzznet</span> : <a href="http://www.buzznet.com/buzzwords/Eclipse%20CDT" class="ztag" rel="tag">Eclipse CDT</a>, <a href="http://www.buzznet.com/buzzwords/JRE6" class="ztag" rel="tag">JRE6</a>, <a href="http://www.buzznet.com/buzzwords/Java" class="ztag" rel="tag">Java</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/03/21/eclipse-cdt-cpu-usage-100-solution/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blog APIs</title>
		<link>http://my.donews.com/kenyth/2007/03/15/blog-apis/</link>
		<comments>http://my.donews.com/kenyth/2007/03/15/blog-apis/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 14:32:22 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/03/15/blog-apis/</guid>
		<description><![CDATA[Resources:

Getting Started with the MetaWeblog API for Windows Live Spaces
Blogger Data API Developer&#8217;s Guide
More&#8230;


  
  Technorati : Blog, blogger, live space Del.icio.us : Blog, blogger, live space Ice Rocket : Blog, blogger, live space ... ]]></description>
			<content:encoded><![CDATA[<p>Resources:</p>
<ol>
<li><a href="http://msdn2.microsoft.com/en-us/library/bb259698.aspx">Getting Started with the MetaWeblog API for Windows Live Spaces</a></li>
<li><a href="http://code.google.com/apis/blogger/gdata.html#list_blogs">Blogger Data API Developer&#8217;s Guide</a></li>
<li>More&#8230;</li>
</ol>
<p class="zoundry_bw_tags">
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  <span class="ztags"></span><span class="ztagspace">Technorati</span> : <a href="http://technorati.com/tag/Blog" class="ztag" rel="tag">Blog</a>, <a href="http://technorati.com/tag/blogger" class="ztag" rel="tag">blogger</a>, <a href="http://technorati.com/tag/live%20space" class="ztag" rel="tag">live space</a> <br /><span class="ztags"></span><span class="ztagspace">Del.icio.us</span> : <a href="http://del.icio.us/tag/Blog" class="ztag" rel="tag">Blog</a>, <a href="http://del.icio.us/tag/blogger" class="ztag" rel="tag">blogger</a>, <a href="http://del.icio.us/tag/live+space" class="ztag" rel="tag">live space</a> <br /><span class="ztags"></span><span class="ztagspace">Ice Rocket</span> : <a href="http://blogs.icerocket.com/tag/Blog" class="ztag" rel="tag">Blog</a>, <a href="http://blogs.icerocket.com/tag/blogger" class="ztag" rel="tag">blogger</a>, <a href="http://blogs.icerocket.com/tag/live+space" class="ztag" rel="tag">live space</a> <br /><span class="ztags"></span><span class="ztagspace">Flickr</span> : <a href="http://www.flickr.com/photos/tags/Blog" class="ztag" rel="tag">Blog</a>, <a href="http://www.flickr.com/photos/tags/blogger" class="ztag" rel="tag">blogger</a>, <a href="http://www.flickr.com/photos/tags/live+space" class="ztag" rel="tag">live space</a> <br /><span class="ztags"></span><span class="ztagspace">Zooomr</span> : <a href="http://beta.zooomr.com/photos/tags/Blog" class="ztag" rel="tag">Blog</a>, <a href="http://beta.zooomr.com/photos/tags/blogger" class="ztag" rel="tag">blogger</a>, <a href="http://beta.zooomr.com/photos/tags/live%20space" class="ztag" rel="tag">live space</a> <br /><span class="ztags"></span><span class="ztagspace">Buzznet</span> : <a href="http://www.buzznet.com/buzzwords/Blog" class="ztag" rel="tag">Blog</a>, <a href="http://www.buzznet.com/buzzwords/blogger" class="ztag" rel="tag">blogger</a>, <a href="http://www.buzznet.com/buzzwords/live%20space" class="ztag" rel="tag">live space</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/03/15/blog-apis/feed/</wfw:commentRss>
		</item>
		<item>
		<title>服务器租借与托管资料收集</title>
		<link>http://my.donews.com/kenyth/2007/03/04/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%a7%9f%e5%80%9f%e4%b8%8e%e6%89%98%e7%ae%a1%e8%b5%84%e6%96%99%e6%94%b6%e9%9b%86/</link>
		<comments>http://my.donews.com/kenyth/2007/03/04/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%a7%9f%e5%80%9f%e4%b8%8e%e6%89%98%e7%ae%a1%e8%b5%84%e6%96%99%e6%94%b6%e9%9b%86/#comments</comments>
		<pubDate>Sun, 04 Mar 2007 07:20:34 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[好玩的东东]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/03/04/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%a7%9f%e5%80%9f%e4%b8%8e%e6%89%98%e7%ae%a1/</guid>
		<description><![CDATA[（本文仅仅为资料收集，不存在原创内容）
1. 名词解释
1U-4U：  
U（英文中的Unit？不知道）代表架式服务器的高度，1U=1.75英寸=4.45厘米。同样的2U=4*1.75英寸=4*4.45厘米，以此类推。  
机柜：  
一... ]]></description>
			<content:encoded><![CDATA[<p>（本文仅仅为资料收集，不存在原创内容）</p>
<p>1. 名词解释</p>
<p>1U-4U：  </p>
<p>U（英文中的Unit？不知道）代表架式服务器的高度，1U=1.75英寸=4.45厘米。同样的2U=4*1.75英寸=4*4.45厘米，以此类推。  </p>
<p>机柜：  </p>
<p>一般多个机架服务器安装在一个机柜内，一个普通机柜的高度是42U。  </p>
<p>ICP：  </p>
<p>ICP（Internet Content Provider）证的全称:《中华人民共和国电信与信息服务业务经营许可证》即ICP证，通过互联网向上网用户提供有偿信息、网上广告、代制作网页、电子商务及其它网上应用服务的公司必须办理的网络经营许可证。国家对经营性网站实行ICP证制度，注册资金应在100万或者100万以上的公司才能办理ICP证，一经办理一般能在该省的通信管理局的网站查询到。同时对从事非经营性活动的网站要进行ICP备案，简称为ICP备。  </p>
<p>2. 服务器的种类  </p>
<p>首先,我们必需了解何谓PC服务器?所谓PC服务器（下文讨论的多为PC服务器）,即是Intel架构服务器,与一些大型服务器如Mainframe, Unix架构服务器等不同,前者大多运行Windows或Linux等操作系统,使用较为普遍,后者多为专业用途,如银行,大型制造业,物流业,证券…等行业使用,一般人较少有机会接触到.  </p>
<p>可以按照各种标准进行分类，按应用层次分为：入门级服务器、工作组级服务器、部门级服务器和企业级服务器；按处理器架构分为：CISC（Complex Instruction Set Computer）架构服务器、RISC（Reduced Instruction Set Computing）架构服务器和VLIW（Very Long Instruction Word超长指令集架构）架构服务器；按用途分为：通用型服务器和专用型服务器，或者WEB服务器、E-mail服务器、数据服务器、DNS服务器等等；按机箱结构分为：台式（塔式）服务器、机架服务器、机柜服务器和刀片式（bladed）服务器。  </p>
<p>2.1 塔式服务器  </p>
<p>优点：服务器的主板扩展性较强、插槽也多，可以进行硬盘和电源的冗余扩展，对环境要求较低，原则上不用和机柜搭配使用，价格也相对较低，集多种常见的服务和应用于一身。  </p>
<p>缺点：塔式服务器长得跟我们平时用的台式机一样，占用空间比较大，适合小型企业自己维护，不适合放在服务器托管商那里托管，独立性太强，协同工作在空间占用和系统管理上都不方便，在一些应用要求较高的企业中，这种单机服务器无法满足要求。  </p>
<p>2.2 机架服务器  </p>
<p>机架式（RACK）服务器长得像卧着的台式机，可以一台一台地放到固定机架上，因此而得名。机架服务器一般采用标准19英寸的宽度设计，其高度按照一定的单位高度的设计，其单位为U，约为4.54cm。  </p>
<p>优点：机架是服务器的机箱宽度都是相同的，可以在标准的机柜中存放服务器，减少服务器产品对空间的要求，易于服务器的集中管理。所以机架服务器便于放在服务器托管商那里托管。  </p>
<p>缺点：&nbsp;购买价格相对较高，比同等配置的塔式服务器价格要高20%-30%，1U以上服务器服务器托管费用较高。由于在空间上非常紧凑，所以在扩展性和散热方面上具有一定限制，一般无法实现太完整的设备扩展，所以单机性能相对比较有限。  </p>
<p>2.3 刀片式服务器  </p>
<p>略  </p>
<p>3. 服务器的购买和租借  </p>
<p>一般服务器或者自行购买然后放到IDC（Internet Data Center）服务提供商的机房托管，或者租借IDC服务商的。租借的服务器一般IDC服务提供商都会负责托管，租借又分为送产权和不送产权两种，送产权的即租用一定时间（如1年或者2年）后服务器的产权归用户。需要指出的是租用的服务器大多数不是新的服务器，而是旧的组装服务器，当然也有宣称租用品牌服务器的IDC服务商。  </p>
<p>下面主要说说PC服务器的基本硬件配置常识。主要的服务器国际生产商有：IBM，HP，Dell，Sun（最近也推出X86服务器产品），超微等；国内生产商主要有：曙光、联想、浪潮、方正、清华同方、华硕等；服务器芯片生产商主要是：Intel和AMD；服务器芯片主要有：Pentium 4（单路）、Itanium（安腾，64位，Dual-Core）Xeon（至强，双路）、XeonMP（Multi Processing Platform，四路）、AthlonMP（速龙MP）、Opteron（皓龙，64位，100系列是单路，200系列是双路，800系列是四路和八路）。  </p>
<p>4. 托管服务器的流程  </p>
<p>4.1 选择托管服务器的类型 </p>
<p>购买全新服务器，或向服务器托管商租借。 </p>
<p>4.2 选择服务器托管商 </p>
<p>考察服务商、机房，最好能去现场考察，以检查其设施是否齐全。 </p>
<p>4.3 签订托管合同 </p>
<p>如果是自己购买的服务器，则需要运送服务器到托管商指定的机房，最后签订详细的托管合同。 </p>
<p>5. 经验  </p>
<p>5.1 最好不要异地托管 </p>
<p>如果是自己购买的服务器最好不要找异地托管，因为时候要对服务器进行本地维护。 </p>
<p>5.2 带宽保证 </p>
<p>不管是独享带宽还是共享带宽，实际使用的带宽一般不会超过10M，甚至5M甚至更低，各地的IDC都会有限制。 </p>
<p>5.3 ICP证 </p>
<p>一定要检查托管商是否有ICP证。 </p>
<p>6. 业界案例  </p>
<p>豆瓣网，土豆网，劲舞团等等。 </p>
<p>7. 上海的服务商简介 </p>
<p><a href="http://www.edong.com/" target="_blank">中国E动网</a>：<a href="http://www.edong.com">www.edong.com</a>  </p>
<p>8. 其他  </p>
<p>www.linkwan.com/vr&nbsp;，用来测试机房速度和当前连接的路由节点。 </p>
<p>参考资料：
<ol>
<li><a href="http://zhidao.baidu.com/question/827808.html?si=8">首次托管服务器经验</a>  </li>
<li><a href="http://zhidao.baidu.com/question/1578763.html?fr=qrl3">服务器结构中的1U 2U 3U是什么意思?</a>  </li>
<li><a href="http://zhidao.baidu.com/question/16415086.html?si=5">机架式服务器和塔式服务器的区别</a>  </li>
<li><a href="http://ks.cn.yahoo.com/question/?qid=1307020809071">服务器有哪些种类？</a>  </li>
<li><a href="http://www.edong.com/v8/delicatedserver/example.php" target="_blank">典型用户案例</a>  </li>
<li><a href="http://www.cbinews.com/inc/showcontentc.jsp?articleid=27184">什么是机架式服务器？</a>  </li>
<li><a href="http://www.bananaskin.cn/" target="_blank">BananaSkin</a>（持续关注IDC方面的博客）  </li>
<li>服务器有关的Post（<a href="http://blog.douban.com/douban/2006/01/16/55/" target="_blank">1</a>，<a href="http://blog.douban.com/douban/2006/02/11/58/" target="_blank">2</a>，<a href="http://blog.douban.com/douban/2005/11/03/43/" target="_blank">3</a>）（<a href="http://blog.douban.com/" target="_blank">豆瓣blog</a>）  </li>
<li><a href="http://ks.cn.yahoo.com/question/?qid=1407011515638&amp;r=w">如何挑选服务器？哪个牌子的最好？（1万元以下的）</a>  </li>
<li><a href="http://magicalg.blogspot.com/2007/02/blog-post_06.html">关于&#8221;个人网站申请备案&#8221;经验</a>  </li>
<li><a href="http://www.xuchao.cn/?id=1745">业内人士教您如何选择IDC</a>  </li>
<li><a href="http://www.20t.net/user/yunfei7/index.php?langtype=cn&amp;pageid=cn_14&amp;add=view&amp;id=1">服务器托管—你会选1U还是2U服务器？</a>  </li>
<li><a href="http://www.miibeian.org.cn/icpbeian.html">ICP专栏：介绍ICP相关知识，ICP申请、ICP备案流程及所须资料等</a>  </li>
<li><a href="http://jmh1982.spaces.live.com/Blog/cns!978B6811B7A62F94!1640.entry">【转载】教你如何租服务器和选择机房</a>  </li>
<li><a href="http://www.linuxmine.com/15024.html">差价缩小：现在你考虑1U还是2U？</a>  </li>
<li><a href="http://www.idcquan.com/top1.htm">中国IDC产业发展调查暨年度大典官方网站</a>  </li>
<li><a href="http://bbs.zhaoxiaoshuo.com/viewthread.php?tid=154">找小说网正式拥有属于自己的服务器</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/03/04/%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%a7%9f%e5%80%9f%e4%b8%8e%e6%89%98%e7%ae%a1%e8%b5%84%e6%96%99%e6%94%b6%e9%9b%86/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AspectJ Syntax Notes and More&#8230;</title>
		<link>http://my.donews.com/kenyth/2007/01/30/lgcagohvejtgttjwxbjxwykfbcalrmedshey/</link>
		<comments>http://my.donews.com/kenyth/2007/01/30/lgcagohvejtgttjwxbjxwykfbcalrmedshey/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 15:23:43 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/01/30/lgcAGoHvEjtgttJwXBJXWykfbCAlrmEDsHeY/</guid>
		<description><![CDATA[Note: Some of the following items, especially items in red, are based on my experience with aspectj 1.5.3.200611221118 (AJDT 1.4.1.200611230655) , JVM 1.5.0-b64, and JDT 3.2.0.v20060609m-F7snq1fxia-Z4XP.


[Nested/Inner Aspect] Nested aspects must be sta... ]]></description>
			<content:encoded><![CDATA[<p><strong>Note:</strong> Some of the following items, especially items in red, are based on my experience with aspectj 1.5.3.200611221118 (AJDT 1.4.1.200611230655) , JVM 1.5.0-b64, and JDT 3.2.0.v20060609m-F7snq1fxia-Z4XP.</p>
<ul>
<li>
<div>[Nested/Inner Aspect] Nested aspects must be static. An inner aspect has to be static, in order to get rid of <strong>the implicit &#8220;&amp;&amp; this()&#8221;</strong> which you get on a perthis-Aspect.</div>
</li>
<li>[Aspect Extension] aspects may only extend abstract aspects. It is an error for a concrete aspect to extend another concrete aspect.  </li>
<li>[Aspect Instantiation] Because advice only runs in the context of an aspect instance, aspect instantiation indirectly controls when advice runs.  </li>
<li>[Aspect Instantiation] The criteria used to determine how an aspect is instantiated is inherited from its parent aspect. If the aspect has no parent aspect, then by default the aspect is a singleton aspect.  </li>
<li>[Aspect Instantiation] Static initialization occurs when the type is loaded (i.e., the Java VM<br />loads the resulting class file for Lolo). At that point, the implementation of the before calls the static method aspectOf to access the singleton instance of Lolo.  </li>
<li>[Aspect Instantiation] You can get a NoAspectBoundException when there is a cycle in aspect initialization or static initialization (within one aspect, or between a chain of several aspects), most commonly when an aspect advises its own initializer.  </li>
<li>[Aspect Instantiation] During the constructor of an aspect, calling aspectOf() on that aspect would fail. Because at that moment, no aspect instance has been bound. It is the same reason why in an after() :(execution(AspectA.new())) advice, calling AspectA.aspectOf() would fail. In this case, instead, target can be used to expose the instance of AspectA.  </li>
<li>[Aspect Instantiation] ! <font color="#ff0000">Do not advise join points in cflowbelow(execution(AspectA.new())), there are bugs or flaws with aspectj</font> which your advice may reproduce, especially when dynamically determined variable are involved in your advice body. Or don&#8217;t define your own aspect constructor, but just use the default aspect constructor, which would make your aspectj code more robust.  </li>
<li>[Advice Execution] ! <font color="#ff0000">Exception or Error thrown in advice &#8220;before(String[] args) : execution(public static void *.main(String[]))&#8221; can&#8217;t be captured!</font>  </li>
<li>[Declaration] ! <font color="#ff0000">How to declare an error if some join points that are supposed to be captured are actually not captured?</font>  </li>
<li>[PCD] A named pointcut may be defined in either a class or aspect, and is treated as a member of the class or aspect where it is found. As a member, it may have an access modifier such as <tt>public</tt> or <tt>private</tt>. Abstract pointcuts may only be declared within abstract aspects. For completeness, a pointcut with a declaration may be declared <tt>final</tt>. Though named pointcut declarations appear somewhat like method declarations, and can be overridden in subaspects, they cannot be overloaded.  </li>
<li>[PCD] call(Foo.new(..))  can&#8217;t be used together with target(*). </li>
<li>[PCD] Rather than cflow, use lexical-structure based pointcuts, within or withincode, preferablely. It will make the cross-reference view of the AJDT more accurate and less time consuming.</li>
</ul>
<p><em><font color="#c0c0c0"> to be continued&#8230;</font></em></p>
<p><strong>Resources:</strong></p>
<ol>
<li>aspectj doc  </li>
<li>aspectj-user-request mailing list</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/01/30/lgcagohvejtgttjwxbjxwykfbcalrmedshey/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DOM Level 3 Load and Save</title>
		<link>http://my.donews.com/kenyth/2007/01/20/xoicmzzsqjannmmikngdosllufvzlvljktlw/</link>
		<comments>http://my.donews.com/kenyth/2007/01/20/xoicmzzsqjannmmikngdosllufvzlvljktlw/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 19:37:20 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/01/20/xOicmzzSqJaNnmmiknGdosLLufVzlVlJKtLW/</guid>
		<description><![CDATA[ 1. Introduction
Defined by w3 consortium, just as its name indicates, it serves as interfaces to objects that dealing with loading and saving DOM objects.
It&#8217;s noteworthy that various specific implementations doesn&#8217;t always fully support.
Wi... ]]></description>
			<content:encoded><![CDATA[<p><strong> 1. Introduction</strong></p>
<p>Defined by w3 consortium, just as its name indicates, it serves as interfaces to objects that dealing with loading and saving DOM objects.</p>
<p>It&#8217;s noteworthy that various specific implementations doesn&#8217;t always fully support.</p>
<p>With java, it is well supported, though, some optional specifications are not supported (at least not always workabe from my experience). However, <strong>for web developers</strong>, there&#8217;s a quote from a book for you:</p>
<blockquote><p><a href="http://www.macavon.org/webdesignbook/Book/Chapters/Examples/7.html">Now that XMLHttpRequest is being standardized, it seems likely that LSParser will never be supported by most browsers.</a></p></blockquote>
<p>In addition, with java, you can also selectively use <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/package-summary.html"><strong>javax.xml.transform</strong></a> to deal with loading and saving DOM objects.</p>
<p><strong>2. Breakdown</strong></p>
<p><em>Cite from </em><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/package-summary.html"><em>org.w3c.dom.ls</em></a><em>:</em></p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/DOMImplementationLS.html">DOMImplementationLS</a></strong><br />
<code>DOMImplementationLS</code> contains the factory methods for creating Load and Save objects.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSInput.html">LSInput</a></strong><br />
This interface represents an input source for data.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSLoadEvent.html">LSLoadEvent</a></strong><br />
This interface represents a load event object that signals the completion of a document load.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSOutput.html">LSOutput</a></strong><br />
This interface represents an output destination for data.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSParser.html">LSParser</a></strong><br />
An interface to an object that is able to build, or augment, a DOM tree from various input sources.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSParserFilter.html">LSParserFilter</a></strong><br />
<code>LSParserFilter</code>s provide applications the ability to examine nodes as they are being constructed while parsing.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSProgressEvent.html">LSProgressEvent</a></strong><br />
This interface represents a progress event object that notifies the application about progress as a document is parsed.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSResourceResolver.html">LSResourceResolver</a></strong><br />
<code>LSResourceResolver</code> provides a way for applications to redirect references to external resources.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSSerializer.html">LSSerializer</a></strong><br />
A <code>LSSerializer</code> provides an API for serializing (writing) a DOM document out into XML.</p>
<p><strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/LSSerializerFilter.html">LSSerializerFilter</a></strong><br />
<code>LSSerializerFilter</code>s provide applications the ability to examine nodes as they are being serialized and decide what nodes should be serialized or not.</p>
<p><strong>3. Examples</strong></p>
<p><em>a. Write an instance of <strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Document.html">Document</a></strong> to a file with <a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/package-summary.html"><em>org.w3c.dom.ls</em></a>: </em></p>
<blockquote><p><font color="#408080">DOMImplementationLS domImpl = (DOMImplementationLS)doc<br />
.getImplementation();<br />
LSSerializer serializer = domImpl.createLSSerializer();<br />
LSOutput output = domImpl.createLSOutput();<br />
output.setCharacterStream(new PrintWriter(fileName));<br />
serializer.write(doc, output);</font></p></blockquote>
<p><em>b. Write an instance of <strong><a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Document.html">Document</a></strong> to a file with </em><a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/package-summary.html"><em>javax.xml.transform</em></a><em>: </em></p>
<blockquote><p><font color="#408080">StreamResult sr = new StreamResult(new File(fileName));<br />
Transformer t = TransformerFactory.newInstance().newTransformer();<br />
t.transform(new DOMSource(doc), sr);</font></p></blockquote>
<p><strong>Note: </strong>it seems, from my experience, that example b can&#8217;t preserve the print friendly presentation.</p>
<p><strong>Resources:</strong></p>
<ol>
<li><a href="http://www.w3.org/TR/DOM-Level-3-Core/">Document Object Model (DOM) Level 3 Core Specification Version 1.0</a></li>
<li><a href="http://www.w3.org/TR/DOM-Level-3-LS/Overview.html#contents">Document Object Model (DOM) Level 3 Load and Save Specification Version 1.0</a></li>
<li><a href="http://www.idealliance.org/papers/dx_xml03/papers/04-01-03/04-01-03.html">DOM Level 3</a></li>
<li>Java Impl. Package org.w3c.dom.ls (<a href="http://www.google.com/codesearch?hl=en&amp;q=show:ssoYJPQ2kVI:DGC3IOM0LEU&amp;sa=N&amp;ct=rdp&amp;cs_p=ftp://ftp.gnu.org/gnu/classpath/classpath-0.19-generics.tar.gz&amp;cs_f=classpath-0.19-generics/external/w3c_dom/org/w3c/dom/ls">src</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/package-summary.html">api spec</a>)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/01/20/xoicmzzsqjannmmikngdosllufvzlvljktlw/feed/</wfw:commentRss>
		</item>
		<item>
		<title>URI, URL and Java</title>
		<link>http://my.donews.com/kenyth/2007/01/14/lYJFCGZIAgkbIHrnilMCiyfbylpzDMcOLMun/</link>
		<comments>http://my.donews.com/kenyth/2007/01/14/lYJFCGZIAgkbIHrnilMCiyfbylpzDMcOLMun/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 15:24:17 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/01/14/lYJFCGZIAgkbIHrnilMCiyfbylpzDMcOLMun/</guid>
		<description><![CDATA[This post basically is a collection of resources.
1. What&#8217;re URI, URN and URL?
A URI is a uniform resources identifier reference. A URL is a uniform resource locator. URNs name resources but do not specify how to locate them. The mailto, news, and ... ]]></description>
			<content:encoded><![CDATA[<p>This post basically is a collection of resources.</p>
<p><strong>1. What&#8217;re URI, URN and URL?</strong></p>
<p>A URI is a uniform resources <em>identifier</em> reference. A URL is a uniform resource <em>locator</em>. URNs name resources but do not specify how to locate them. The <tt>mailto</tt>, <tt>news</tt>, and <tt>isbn</tt> URIs shown above are examples of URNs. URLs and URNs both fall into URIs. But normally URNs and URLs doesn&#8217;t interset. Refer to <a href="http://www.ietf.org/rfc/rfc2396.txt"><em>RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax</em></a> for the syntax of a URI instance. And the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html" target="_blank">java class description of URI</a> gives a very good summary of URI, besides providing some useful resources.</p>
<p><strong>2. Syntax</strong></p>
<p>Below is a little breakdown on the syntax of URI, which is directly taken from the priviously mentioned JAVA API spec.</p>
<p>At the highest level a URI reference (hereinafter simply &#8220;URI&#8221;) in string form has the syntax:</p>
<p>[<em>scheme</em><tt><strong>:</strong></tt>] <em>scheme-specific-part</em> [<tt><strong>#</strong></tt><em>fragment</em>]</p>
<p>where square brackets [&#8230;] delineate optional components and the characters <tt><strong>:</strong></tt> and <tt><strong>#</strong></tt> stand for themselves. With a further breakdown on <em>scheme-specific-part</em> we can get a URI in the string form:</p>
<p>[<em>scheme</em><tt><strong>:</strong></tt>] <strong>[<tt>//</tt><em>authority</em>][<em>path</em>][<tt>?</tt><em>query</em>]</strong> [<tt><strong>#</strong></tt><em>fragment</em>]</p>
<p>where the characters <tt><strong>:</strong></tt>, <tt><strong>/</strong></tt>, <tt><strong>?</strong></tt>, and <tt><strong>#</strong></tt> stand for themselves. With a further breakdown on authority we can get a more general form:</p>
<p>[<em>scheme</em><tt><strong>:</strong></tt>] <strong>[<tt>//</tt></strong> [<em>user-info</em><tt>@</tt>]<em>host</em>[<tt>:</tt><em>port</em>] <strong>] [<em>path</em>] [<tt>?</tt><em>query</em>]</strong> [<tt><strong>#</strong></tt><em>fragment</em>]</p>
<p>where the characters <tt><strong>@</strong></tt> and <tt><strong>:</strong></tt> stand for themselves.</p>
<p><em>Note</em>: a scheme of a URL is called a protocol, such as &#8220;http&#8221; and &#8220;ftp&#8221;.</p>
<p><strong>3. Examples</strong></p>
<p>An <em>opaque</em> URI is an absolute URI whose scheme-specific part does not begin with a slash character (<tt>&#8216;/&#8217;</tt>). Opaque URIs are not subject to further parsing. Some examples of opaque URIs are:</p>
<p>mailto:java-net@java.sun.com /*URN*/<br />news:comp.lang.java /*URN*/<br />urn:isbn:096139210x /*URN*/</p>
<p>A <em>hierarchical</em> URI is either an absolute URI whose scheme-specific part begins with a slash character, or a relative URI, that is, a URI that does not specify a scheme. Some examples of hierarchical URIs are:</p>
<p>http://java.sun.com/j2se/1.3/ /*URL*/<br />docs/guide/collections/designfaq.html#28<br />../../../demo/jfc/SwingSet2/src/SwingSet2.java<br />file:///~/calendar</p>
<p>Also URIs are categorized as absolute URIs and relative URIs. An <em>absolute</em> URI specifies a scheme, and a URI that is not absolute is called a <em>relative</em> URI.</p>
<p>Among above examples comments in the form of &#8220;/*&#8230;*/&#8221; tell which are URLs and which are URNs.</p>
<p><strong>4. Character categories</strong></p>
<p>As specified in resources accessible, we quote some that matters:</p>
<p>RFC 2396 specifies precisely which characters are permitted in the various components of a URI reference. The following categories, most of which are taken from that specification, are used below to describe these constraints:</p>
<blockquote>
<table cellspacing="2" summary="Describes categories alpha,digit,alphanum,unreserved,punct,reserved,escaped,and other">
<tbody>
<tr>
<th valign="top"><em>alpha</em></th>
<td>The US-ASCII alphabetic characters, <tt>&#8216;A&#8217;</tt> through <tt>&#8216;Z&#8217;</tt> and <tt>&#8216;a&#8217;</tt> through <tt>&#8216;z&#8217;</tt></td>
</tr>
<tr>
<th valign="top"><em>digit</em></th>
<td>The US-ASCII decimal digit characters, <tt>&#8216;0&#8242;</tt> through <tt>&#8216;9&#8242;</tt></td>
</tr>
<tr>
<th valign="top"><em>alphanum</em></th>
<td>All <em>alpha</em> and <em>digit</em> characters</td>
</tr>
<tr>
<th valign="top"><em>unreserved</em></th>
<td>All <em>alphanum</em> characters together with those in the string <tt>&#8220;_-!.~&#8217;()*&#8221;</tt></td>
</tr>
<tr>
<th valign="top"><em>punct</em></th>
<td>The characters in the string <tt>&#8220;,;:$&amp;+=&#8221;</tt></td>
</tr>
<tr>
<th valign="top"><em>reserved</em></th>
<td>All <em>punct</em> characters together with those in the string <tt>&#8220;?/[]@&#8221;</tt></td>
</tr>
<tr>
<th valign="top"><em>escaped</em></th>
<td>Escaped octets, that is, triplets consisting of the percent character (<tt>&#8216;%&#8217;</tt>) followed by two hexadecimal digits (<tt>&#8216;0&#8242;</tt>-<tt>&#8216;9&#8242;</tt>, <tt>&#8216;A&#8217;</tt>-<tt>&#8216;F&#8217;</tt>, and <tt>&#8216;a&#8217;</tt>-<tt>&#8216;f&#8217;</tt>)</td>
</tr>
<tr>
<th valign="top"><em>other</em></th>
<td>The Unicode characters that are not in the US-ASCII character set, are not control characters (according to the <a href="@MSITStore:I:/E_book/PL/J2SE/jdk150.chm::/jdk150/api/java/lang/Character.html#isISOControl(char)"><code>Character.isISOControl</code></a> method), and are not space characters (according to the <a href="@MSITStore:I:/E_book/PL/J2SE/jdk150.chm::/jdk150/api/java/lang/Character.html#isSpaceChar(char)"><code>Character.isSpaceChar</code></a> method) <em>(<strong>Deviation from RFC 2396</strong>, which is limited to US-ASCII)</em></td>
</tr>
</tbody>
</table>
</blockquote>
<p><a name="HTML_TO_HH_28390"></a><a name="legal-chars">The set of all legal URI characters consists of the <em>unreserved</em>, <em>reserved</em>, <em>escaped</em>, and <em>other</em> characters.</a></p>
<h4>Escaped octets, quotation, encoding, and decoding</h4>
<p>RFC 2396 allows escaped octets to appear in the user-info, path, query, and fragment components. Escaping serves two purposes in URIs:</p>
<ul>
<li>
<p>To <strong><em>encode</em> non-US-ASCII characters</strong> when a URI is required to conform strictly to RFC 2396 by not containing any <em>other</em> characters.</p>
</li>
<li>
<p>To <em>quote</em> characters that are otherwise illegal in a component. The user-info, path, query, and fragment components differ slightly in terms of which characters are considered legal and illegal.</p>
</li>
</ul>
<p>These purposes are served in this class by three related operations:</p>
<ul>
<li>
<p><a name="HTML_TO_HH_28391"></a><a name="encode">A character is <em>encoded</em> by replacing it with the sequence of escaped octets that represent that character in the UTF-8 character set. The Euro currency symbol (<tt>&#8216;\u20AC&#8217;</tt>), for example, is encoded as <tt>&#8220;%E2%82%AC&#8221;</tt>. <em>(<strong>Deviation from RFC 2396</strong>, which does not specify any particular character set.)</em></a></p>
</li>
<li>
<p><a name="HTML_TO_HH_28392"></a><a name="quote">An illegal character is <em>quoted</em> simply by encoding it. The space character, for example, is quoted by replacing it with <tt>&#8220;%20&#8243;</tt>. UTF-8 contains US-ASCII, hence for US-ASCII characters this transformation has exactly the effect required by RFC 2396.</a></p>
</li>
<li>
<p><a name="HTML_TO_HH_28393"></a><a name="decode">A sequence of escaped octets is <em>decoded</em> by replacing it with the sequence of characters that it represents in the UTF-8 character set. UTF-8 contains US-ASCII, hence decoding has the effect of de-quoting any quoted US-ASCII characters as well as that of decoding any encoded non-US-ASCII characters. If a </a><a href="@MSITStore:I:/E_book/PL/J2SE/jdk150.chm::/jdk150/api/java/nio/charset/CharsetDecoder.html#ce">decoding error</a> occurs when decoding the escaped octets then the erroneous octets are replaced by <tt>&#8216;\uFFFD&#8217;</tt>, the Unicode replacement character.</p>
</li>
</ul>
<p><strong>5. Java Impl.</strong></p>
<p><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html" title="class in java.net"><strong>URI</strong></a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html" title="class in java.net"><strong>URL</strong></a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLClassLoader.html" title="class in java.net"><strong>URLClassLoader</strong></a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLConnection.html" title="class in java.net"><strong>URLConnection</strong></a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLDecoder.html" title="class in java.net"><strong>URLDecoder</strong></a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLEncoder.html" title="class in java.net"><strong>URLEncoder</strong></a> and <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLStreamHandler.html" title="class in java.net"><strong>URLStreamHandler</strong></a>, which are all located in package <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/package-summary.html"><strong>java.net</strong></a>.
<p><strong>Resources:</strong></p>
<ol>
<li><a href="http://www.ietf.org/rfc/rfc2396.txt">Uniform Resource Identifiers (URI): Generic Syntax</a></li>
<li><a href="http://www.ietf.org/rfc/rfc2732.txt">Format for Literal IPv6 Addresses in URL&#8217;s</a></li>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/overview-summary.html">JavaTM 2 Platform Standard Edition 5.0 API Specification</a></li>
</ol>
<p>
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  Technorati : <a href="http://technorati.com/tag/Java" class="ztag" rel="tag">Java</a>, <a href="http://technorati.com/tag/URI" class="ztag" rel="tag">URI</a>, <a href="http://technorati.com/tag/URL" class="ztag" rel="tag">URL</a>, <a href="http://technorati.com/tag/URN" class="ztag" rel="tag">URN</a> <br />Del.icio.us : <a href="http://del.icio.us/tag/Java" class="ztag" rel="tag">Java</a>, <a href="http://del.icio.us/tag/URI" class="ztag" rel="tag">URI</a>, <a href="http://del.icio.us/tag/URL" class="ztag" rel="tag">URL</a>, <a href="http://del.icio.us/tag/URN" class="ztag" rel="tag">URN</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/01/14/lYJFCGZIAgkbIHrnilMCiyfbylpzDMcOLMun/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Feed Format &#8212; The Programmable Web</title>
		<link>http://my.donews.com/kenyth/2007/01/13/tgeuuhgmydlmoyqfhuxzwqislhsbxxjrdnly/</link>
		<comments>http://my.donews.com/kenyth/2007/01/13/tgeuuhgmydlmoyqfhuxzwqislhsbxxjrdnly/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 10:06:10 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/01/13/tgeuuhgmydlmoyqfhuxzwqislhsbxxjrdnly/</guid>
		<description><![CDATA[Resources:
Spec. Intro.

What Is RSS
Content feeds with RSS 2.0
RSS 2.0 Specification
The Atom Syndication Format
OPML 1.0 Specification
OPML 2.0 draft spec

Feed Reader Impl.

A Java pen source reader: RSSOwl(bin, src)
XML Processing With Java Overview
... ]]></description>
			<content:encoded><![CDATA[<p><strong>Resources:</strong></p>
<p><em>Spec. Intro.</em></p>
<ol>
<li><a href="http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html">What Is RSS</a></li>
<li><a href="http://www-128.ibm.com/developerworks/xml/library/x-rss20/#resources">Content feeds with RSS 2.0</a></li>
<li><a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0 Specification</a></li>
<li><a href="http://tools.ietf.org/html/rfc4287">The Atom Syndication Format</a></li>
<li><a href="http://www.opml.org/spec">OPML 1.0 Specification</a></li>
<li><a href="http://www.opml.org/">OPML 2.0 draft spec</a></li>
</ol>
<p><em>Feed Reader Impl.</em></p>
<ol>
<li><a href="http://www.rssowl.org/">A Java pen source reader: RSSOwl</a>(<a href="http://mesh.dl.sourceforge.net/sourceforge/rssowl/rssowl_1_2_3_win32_bin.zip">bin</a>, <a href="URL%20http://www.prensacadiz.org/blogs/downloads/rssowl_1_2_src.tar.gz">src</a>)</li>
<li><a href="http://my.donews.com/kenyth/2006/11/10/eaoowdpwkfgndhglaxdfmyaljfwezejefytb/">XML Processing With Java Overview</a></li>
<li><a href="http://my.donews.com/kenyth/2006/11/13/hvloltpcmpqyuafimiuabfkdbcwxkixrdjgp/">Three ways of validating a xml document with Java</a></li>
<li><a href="http://my.donews.com/kenyth/2006/11/11/naubsdgowyfbnujxlnamcfzyytvkwydjyykr/">Comment on W3C DOM and various implmentations in defferent PL</a></li>
<li><a href="http://my.donews.com/kenyth/2006/11/10/pjvtqxvxjnehjyuxscfamlayfhesmhucrqvi/">Unicode, UTF等字符编码摘记</a></li>
<li><a href="http://my.donews.com/kenyth/2007/01/13/zwOhpVvzzDWTZoUKdcqYacusyptsCqWcNLjd/">Control a Web Browser From Within a Java Programm</a></li>
</ol>
<p>
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  Technorati : <a href="http://technorati.com/tag/RDF" class="ztag" rel="tag">RDF</a>, <a href="http://technorati.com/tag/RSS" class="ztag" rel="tag">RSS</a>, <a href="http://technorati.com/tag/feed" class="ztag" rel="tag">feed</a>, <a href="http://technorati.com/tag/feed%20reader" class="ztag" rel="tag">feed reader</a>, <a href="http://technorati.com/tag/programmable%20web" class="ztag" rel="tag">programmable web</a>, <a href="http://technorati.com/tag/xml" class="ztag" rel="tag">xml</a> <br />Del.icio.us : <a href="http://del.icio.us/tag/RDF" class="ztag" rel="tag">RDF</a>, <a href="http://del.icio.us/tag/RSS" class="ztag" rel="tag">RSS</a>, <a href="http://del.icio.us/tag/feed" class="ztag" rel="tag">feed</a>, <a href="http://del.icio.us/tag/feed+reader" class="ztag" rel="tag">feed reader</a>, <a href="http://del.icio.us/tag/programmable+web" class="ztag" rel="tag">programmable web</a>, <a href="http://del.icio.us/tag/xml" class="ztag" rel="tag">xml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/01/13/tgeuuhgmydlmoyqfhuxzwqislhsbxxjrdnly/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Control a Web Browser From Within a Java Programm</title>
		<link>http://my.donews.com/kenyth/2007/01/13/zwOhpVvzzDWTZoUKdcqYacusyptsCqWcNLjd/</link>
		<comments>http://my.donews.com/kenyth/2007/01/13/zwOhpVvzzDWTZoUKdcqYacusyptsCqWcNLjd/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 09:47:31 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[软件开发与学习]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/01/13/zwOhpVvzzDWTZoUKdcqYacusyptsCqWcNLjd/</guid>
		<description><![CDATA[Noramlly, more than two way you can use a web browser with your Java programm.
1.Fire commands to invoke a web browser with Java runtime support.
// cmd = &#8216;rundll32 url.dll,FileProtocolHandler http://&#8230;&#8217;cmd = WIN_PATH + &#8221; &#8221; +... ]]></description>
			<content:encoded><![CDATA[<p>Noramlly, more than two way you can use a web browser with your Java programm.</p>
<p><strong>1.Fire commands to invoke a web browser with Java runtime support.</strong></p>
<p>// cmd = &#8216;rundll32 url.dll,FileProtocolHandler <a href="http://...'/">http://&#8230;&#8217;</a><br />cmd = WIN_PATH + &#8221; &#8221; + WIN_FLAG + &#8221; &#8221; + url;<br />Process p = Runtime.getRuntime().exec(cmd);</p>
<p>See the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html" target="_blank">API Spec of Java for Process</a>, and Java Tip 66 of the Resources section for more information.</p>
<p><strong>2. Use a wrapped browser control</strong></p>
<p><em>2.1 Use Jacob, the open source COM wrapper. e.g.,</em></p>
<p>protected void openIExplorer(){<br />comp = new ActiveXComponent( &#8220;InternetExplorer.Application&#8221; );<br />comp.setProperty( &#8220;Visible&#8221;, new Variant(true) );<br />comp.invoke( &#8220;Navigate&#8221;, new Variant[]{ new Variant((String)comboFilename.getSelectedItem()) } );</p>
<p><em>2.2 Use browser wrapper provided by SWT.</em></p>
<p>import org.eclipse.swt.browser.Browser;<br />import org.eclipse.swt.browser.CloseWindowListener;<br />import org.eclipse.swt.browser.LocationAdapter;<br />import org.eclipse.swt.browser.LocationEvent;<br />import org.eclipse.swt.browser.OpenWindowListener;<br />import org.eclipse.swt.browser.ProgressEvent;<br />import org.eclipse.swt.browser.ProgressListener;<br />import org.eclipse.swt.browser.StatusTextEvent;<br />import org.eclipse.swt.browser.StatusTextListener;<br />import org.eclipse.swt.browser.VisibilityWindowAdapter;<br />import org.eclipse.swt.browser.WindowEvent;</p>
<p><strong>3. or any other ways I havn&#8217;t figured out&#8230;</strong></p>
<p><strong>Resources:</strong></p>
<ol>
<li><a href="http://www.javaworld.com/javaworld/javatips/jw-javatip66.html">Java Tip 66: Control browsers from your Java application</a></li>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/overview-summary.html">JavaTM 2 Platform Standard Edition 5.0 API Specification</a></li>
<li><a href="http://danadler.com/jacob/">The JACOB Project: A JAva-COM Bridge</a></li>
<li><a href="http://www.java2s.com/ExampleCode/SWT-JFace-Eclipse/SWTBrowser.htm">SWT Browser</a></li>
<li><a href="http://help.eclipse.org/help32/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/package-summary.html">Package org.eclipse.swt.browser</a></li>
<li><a href="http://forum.java.sun.com/thread.jspa?threadID=287471&amp;messageID=1126745">Developer Forums java to invoke IExplore?</a></li>
</ol>
<p>
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  Technorati : <a href="http://technorati.com/tag/firefox" class="ztag" rel="tag">firefox</a>, <a href="http://technorati.com/tag/ie" class="ztag" rel="tag">ie</a>, <a href="http://technorati.com/tag/java" class="ztag" rel="tag">java</a>, <a href="http://technorati.com/tag/linux" class="ztag" rel="tag">linux</a>, <a href="http://technorati.com/tag/netscape" class="ztag" rel="tag">netscape</a>, <a href="http://technorati.com/tag/safri" class="ztag" rel="tag">safri</a>, <a href="http://technorati.com/tag/web%20browser" class="ztag" rel="tag">web browser</a>, <a href="http://technorati.com/tag/windows" class="ztag" rel="tag">windows</a> <br />Del.icio.us : <a href="http://del.icio.us/tag/firefox" class="ztag" rel="tag">firefox</a>, <a href="http://del.icio.us/tag/ie" class="ztag" rel="tag">ie</a>, <a href="http://del.icio.us/tag/java" class="ztag" rel="tag">java</a>, <a href="http://del.icio.us/tag/linux" class="ztag" rel="tag">linux</a>, <a href="http://del.icio.us/tag/netscape" class="ztag" rel="tag">netscape</a>, <a href="http://del.icio.us/tag/safri" class="ztag" rel="tag">safri</a>, <a href="http://del.icio.us/tag/web+browser" class="ztag" rel="tag">web browser</a>, <a href="http://del.icio.us/tag/windows" class="ztag" rel="tag">windows</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/01/13/zwOhpVvzzDWTZoUKdcqYacusyptsCqWcNLjd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>阿凡提，好玩&#8211;有人实现了我的想法</title>
		<link>http://my.donews.com/kenyth/2007/01/11/qqlbqvgjhizthpkvlruvmoktitwhwtznjkoa/</link>
		<comments>http://my.donews.com/kenyth/2007/01/11/qqlbqvgjhizthpkvlruvmoktitwhwtznjkoa/#comments</comments>
		<pubDate>Thu, 11 Jan 2007 10:05:03 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[好玩的东东]]></category>

		<category><![CDATA[IT评论与思考]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2007/01/11/qqlbqvgjhizthpkvlruvmoktitwhwtznjkoa/</guid>
		<description><![CDATA[阿凡提,一个基于音频的问答(Ask&#38;Answer, c.f., Yahoo Answer, Google Answer)平台,Tangos的一个post里面做了报道和分析. Tangos的分析和我当时考虑的很多东西都很类似,在中国做这个有很多风险,但既然有人... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.afantee.com/" target="_blank">阿凡提</a>,一个基于音频的问答(Ask&amp;Answer, c.f., Yahoo Answer, Google Answer)平台,<a href="http://www.cwrblog.net/" target="_blank">Tangos</a>的<a href="http://www.cwrblog.net/429/afantee-voice-based-google-answer.html" target="_blank">一个post</a>里面做了报道和分析. Tangos的分析和我当时考虑的很多东西都很类似,在中国做这个有很多风险,但既然有人做了,我想进一步的调查和跟踪是非常有趣的.</p>
<p>在半年前还在公司实习期间想到的,很多点子都记录在我的小的笔记本上面.我当时的概念是一种knowledge sharing的概念(跟foody和xiaokun提起过),比阿凡提的概念更广泛一些.当然这种基于音频的协作方式是我想到的主要方式,我当时考虑的是用第三方的VoIP工具(如skype就是我当时考虑的),但是这样支付和计费都是有风险的,用户可以绕过你的支付和计费系统&#8221;作弊&#8221;,阿凡提用了自己的VoIP工具,这样把支付,计费和协作工具可以整合在一起,很好的解决了这个问题.</p>
<p>我当时的灵感来源于一个<a href="http://www.language-exchanges.org/" target="_blank">基于skype的.org网站</a>,它提供一种服务,让讲不同语言的人可以快速的找到可以一起学习各自语言的language partner,我当时试用的时候由于user base还不是足够大,所以效果不是很明显.</p>
<p>在思考knowledge sharing期间看到<a href="http://www.uuzone.com/blog/mao" target="_blank">老冒</a>的一个post里面看到提到的一个<a href="http://www.k68.cn/" target="_blank">国内的网站</a>,做的是收费的问答服务,这个网站已经运营了有好几年了.但是不同于Yahoo Answer,它提供平台(相对来说比较简陋)让用户可以向公司用户提供商业解决方案,当然这些方案都是可以数字化的东西,如公司logo的设计,ad poster的设计,甚至广告语的设计,上面的公司用户发的单子已经有上千RMB的了.有趣的是甚至有个人用户发单子要别人为自己刚出世的孩子取名字提供意见.</p>
<p>我基于一个最简单的想法,当一个电脑白痴(没有恶意和歧视性的称呼)想要配一台性价比高的兼容机(不要问我他不懂电脑为什么还要配兼容机,这正是这种服务的价值所在)时knowledge sharing这种服务可能会对他有用,但一般的用户想要获得生活的方方面面相关的法律咨询(很多电台节目就是做这个)的时候,这种服务可能会对他有用,而且获得这种服务的价格都相对比较低廉.所以提供这种服务是有价值的,而且具有起码的可行性.</p>
<p>其实knowledge sharing关键在于数字化一切可以数字化的东西,再提供各种各样的协作系统,建立良好的可以无限扩展的参与架构.</p>
<p>详细的想法这里不说了,有时间再说.这里说说我当时幻想的如果这种knowledge sharing网站做成功的话会出现什么盛况(yy总是充满乐趣的:),所谓成功是说在这个网站上形成了自己的生态系统,网站上的资深用户(阿凡提里面的专家用户)可能会出现高级的自由打工者,百万富翁级的soho一族,肯定会获得传统媒体的免费公关宣传,成为talk of the town,还会出现不可一世的传统巨头在上面发单,中小企业更是可以很好的利用这一平台,有一批核心用户可能会依靠这个平台来获得自己的唯一生活收入,等等.yy归yy,风险是大大的有的,但是看到有人去做我非常兴奋.</p>
<p>上面写的很没有逻辑,再说一句,你可以甚至用这种网站向公司用户提供call center服务,所谓的外包商业流程的一种.</p>
<p>类似于这种把智力,知识没有任何障碍的直接转化为财富的网站服务应该会越来越多,有人也在做文化衫的design的交易,qq zone里面的falsh的design的交易,甚至有bt的学术研究在研究可以让所有人都参与进来的知识构建模型(完全不同于wikipedia).</p>
<p>再一次证明单独的想法是不值钱的,资源掌控能力和执行力的结合才能产生价值.好好做一个看客: ).</p>
<p>
  <!-- Tag links generated by Zoundry Blog Writer. Do not manually edit. http://www.zoundry.com --><br />
  Technorati : <a href="http://technorati.com/tag/VoIP" class="ztag" rel="tag">VoIP</a>, <a href="http://technorati.com/tag/collaboration" class="ztag" rel="tag">collaboration</a>, <a href="http://technorati.com/tag/knowledge%20sharing" class="ztag" rel="tag">knowledge sharing</a> <br />Del.icio.us : <a href="http://del.icio.us/tag/VoIP" class="ztag" rel="tag">VoIP</a>, <a href="http://del.icio.us/tag/collaboration" class="ztag" rel="tag">collaboration</a>, <a href="http://del.icio.us/tag/knowledge+sharing" class="ztag" rel="tag">knowledge sharing</a></p>
]]></content:encoded>
			<wfw:commentRss>http://my.donews.com/kenyth/2007/01/11/qqlbqvgjhizthpkvlruvmoktitwhwtznjkoa/feed/</wfw:commentRss>
		</item>
		<item>
		<title>淘宝上第一宗交易成功</title>
		<link>http://my.donews.com/kenyth/2006/12/30/hmhfZHSGXUZxyKNPRMJyqXvtbckwRiiYvpev/</link>
		<comments>http://my.donews.com/kenyth/2006/12/30/hmhfZHSGXUZxyKNPRMJyqXvtbckwRiiYvpev/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 11:14:50 +0000</pubDate>
		<dc:creator>kenyth</dc:creator>
		
		<category><![CDATA[所有文章]]></category>

		<category><![CDATA[好玩的东东]]></category>

		<category><![CDATA[Web2.0]]></category>

		<category><![CDATA[生活感悟]]></category>

		<guid isPermaLink="false">http://my.donews.com/kenyth/2006/12/30/hmhfZHSGXUZxyKNPRMJyqXvtbckwRiiYvpev/</guid>
		<description><![CDATA[先申明一下，Ｃ２Ｃ交易这东西应该至少有5年（改正我，如果我错了的话）了吧，本人虽然一直有所关注，但是落实到行动还是比较落伍的。
卖掉了自己早已经就不用的内存，12.5号才正式上... ]]></description>
			<content:encoded><![CDATA[<p>先申明一下，Ｃ２Ｃ交易这东西应该至少有5年（改正我，如果我错了的话）了吧，本人虽然一直有所关注，但是落实到行动还是比较落伍的。</p>
<p>卖掉了自己早已经就不用的内存，12.5号才正式上架拍卖的，经过14天的拍卖，和买家沟通，快递发货等一整个过程，到今天才正式交易成功。期间买家的支付宝出了点问题，所以付款不是很及时，本来应该能在更短的时间内完成交易。</p>
<p>拍卖的目的完全达到，甚至超过预期。从一元起拍，经过４８次的加价，这个过程是比较<strong>好玩</strong>的，看着价钱一天一天的涨。价格上升过程基本上这样的，发布的第一天竞拍的买家比较多，通过这一天的竞拍价位基本上就上升到世面上同等物品的价位（以下称为应有价位）的８０％左右。随后的两天时间里价位继续上涨到应有价位的９０％，接下来的10天里面几乎没有竞拍者。在最后一天才圆满的达到应有价位，然后进入交易阶段。整个过程比较符合常识，也完全符合买家的心理，另一方面来说，淘宝的竞拍系统基本上做的是非常成功的。下面详细说说 <strong>好玩</strong>的点在哪里，也说说一些C2C交易里面一些基本要素。</p>
<p>先要说一下，之前我对正规的拍卖的流程、方法基本上就是一般人的常识水平（不知道现在还是不是？）。</p>
<p>当初选择拍卖这个东西，基本上出于以下下考虑。我卖的东西是二手的东西，没办法跟市场上买的东西去比较来定价，虽然我已经找到相类似的二手物品（价位150，找到完全一样的不是不可能，在淘宝这个大市场里面应该是可以找到的，但是唯一的代价是时间），但是和我的二手货也不完全相同，包括品牌、新旧程度，所以也不能根据别人的价位来精确定价。</p>
<p>我非常有限的经济学常识告诉我最好的定价方式是让市场来定价，当然这个是有一定风险的，如果我们稍微多想一下的话。<strong>如果你的拍卖信息不能在让足够多的有购买意向的买家看到的话（包括在竞拍前、竞拍中），很可能被低于真正市