<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-11284291</id><updated>2011-12-06T18:51:49.864-08:00</updated><category term='Python'/><category term='JMeter'/><category term='Computer Science'/><category term='SQL'/><category term='CSS'/><category term='Euler'/><category term='Subversion'/><category term='Cygwin'/><category term='VirtualBox'/><category term='Oracle'/><category term='Java'/><category term='Interview'/><category term='Google'/><category term='Groovy'/><category term='Programming'/><category term='Life'/><category term='Vim'/><category term='Firefox'/><category term='Opensource'/><category term='Eclipse'/><category term='Mathematic'/><category term='Ubuntu'/><category term='Emacs'/><category term='Wiki'/><category term='JavaScript'/><category term='Webwork'/><category term='BIRT'/><category term='LISP'/><category term='InUS'/><title type='text'>Flooyd's World</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default?start-index=101&amp;max-results=100'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>126</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11284291.post-3639556095191448988</id><published>2011-04-23T23:13:00.000-07:00</published><updated>2011-04-23T23:14:02.644-07:00</updated><title type='text'>A quote</title><content type='html'>&lt;div class="gmail_quote"&gt;&lt;span style="font-family:sans-serif;font-size:13px;line-height:19px"&gt;&amp;quot;.. there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.&amp;quot;&lt;/span&gt; &lt;div&gt;&lt;span style="font-family:sans-serif;font-size:13px;line-height:19px"&gt; -- Tony Hoare, 1980 ACM Turing Award Lecture.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse"&gt;&lt;/span&gt; &lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3639556095191448988?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3639556095191448988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3639556095191448988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3639556095191448988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3639556095191448988'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2011/04/quote.html' title='A quote'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1114589080150468111</id><published>2011-02-22T03:39:00.001-08:00</published><updated>2011-02-22T03:39:23.919-08:00</updated><title type='text'>Init implementation MVP in Flex / Action Scripts</title><content type='html'>&lt;font class="Apple-style-span" face="&amp;#39;trebuchet ms&amp;#39;, sans-serif"&gt;The motivation is MVP turns out to be less couple as well as more flexible that MVC in my opinion.&lt;/font&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;trebuchet ms&amp;#39;, sans-serif"&gt;This init version have been done without taking into account &amp;quot;Event Bus&amp;quot;.&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;trebuchet ms&amp;#39;, sans-serif"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;trebuchet ms&amp;#39;, sans-serif"&gt;Detail &lt;a href="http://code.google.com/p/stockwatcher-in-mvp/wiki/MVPInFlex?ts=1298374655&amp;amp;updated=MVPInFlex"&gt;here&lt;/a&gt;.&lt;/font&gt; &lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1114589080150468111?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1114589080150468111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1114589080150468111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1114589080150468111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1114589080150468111'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2011/02/init-implementation-mvp-in-flex-action.html' title='Init implementation MVP in Flex / Action Scripts'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5639023640259317397</id><published>2011-02-15T04:09:00.000-08:00</published><updated>2011-02-24T18:35:47.859-08:00</updated><title type='text'>Try to understand Git internal in one picture</title><content type='html'>&lt;span style="font-family:trebuchet ms,sans-serif;"&gt;The image is actually origin from a cool book &lt;a href="http://progit.org/book/ch9-3.html"&gt;GitPro &lt;/a&gt;by adding a few comments in order to have all key point in one place hopefully...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-4jhS3o6FkkA/TWcVRqCqmyI/AAAAAAAABpE/W4I11beReDo/s1600/git_internal.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 226px;" src="http://2.bp.blogspot.com/-4jhS3o6FkkA/TWcVRqCqmyI/AAAAAAAABpE/W4I11beReDo/s320/git_internal.png" alt="" id="BLOGGER_PHOTO_ID_5577450056609078050" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5639023640259317397?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5639023640259317397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5639023640259317397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5639023640259317397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5639023640259317397'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2011/02/try-to-understand-git-internal-in-one.html' title='Try to understand Git internal in one picture'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-4jhS3o6FkkA/TWcVRqCqmyI/AAAAAAAABpE/W4I11beReDo/s72-c/git_internal.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2149241124184337910</id><published>2011-02-13T23:26:00.001-08:00</published><updated>2011-02-13T23:26:23.627-08:00</updated><title type='text'>How to do multiple row/column dimensions in OLAPDataGrid</title><content type='html'>A simple OLAPDataGrid sample &lt;a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/OLAPDataGrid.html"&gt;here&lt;/a&gt;.&lt;br&gt;A good sample having multiple dimensions &lt;a href="http://flexpearls.blogspot.com/2008/04/custom-aggregator-sample-for-flex-olap.html"&gt;here&lt;/a&gt;.&lt;br&gt;  &lt;br&gt;The key point is that OLAPSet could join each other.&lt;br&gt;For instance, &lt;br&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;var customerSet:OLAPSet = new OLAPSet;&lt;br&gt;customerSet.addElements(cube.findDimension(&amp;quot;CustomerDim&amp;quot;).findAttribute(&amp;quot;Customer&amp;quot;).children);&lt;br&gt;  var quarterSet:OLAPSet = new OLAPSet;&lt;br&gt;quarterSet.addElements(cube.findDimension(&amp;quot;QuarterDim&amp;quot;).findAttribute(&amp;quot;Quarter&amp;quot;).children);&lt;br&gt;colQueryAxis.addSet(&lt;font class="Apple-style-span" color="#FF0000"&gt;quarterSet.crossJoin(customerSet)&lt;/font&gt;);&lt;/font&gt;&lt;br&gt;  &lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2149241124184337910?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2149241124184337910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2149241124184337910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2149241124184337910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2149241124184337910'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2011/02/how-to-do-multiple-rowcolumn-dimensions.html' title='How to do multiple row/column dimensions in OLAPDataGrid'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-963482264606193987</id><published>2010-11-25T17:27:00.001-08:00</published><updated>2010-11-25T17:27:57.097-08:00</updated><title type='text'>How to Boot a System to Run Level S</title><content type='html'>Type &lt;kbd&gt;&lt;b&gt;-s&lt;/b&gt;&lt;/kbd&gt; at the end of the boot entry line&lt;br&gt;&lt;br&gt;&lt;a href="http://docs.sun.com/app/docs/doc/819-2379/fvzqr?a=view"&gt;Details&lt;/a&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-963482264606193987?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/963482264606193987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=963482264606193987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/963482264606193987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/963482264606193987'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/11/how-to-boot-system-to-run-level-s.html' title='How to Boot a System to Run Level S'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4064294806681778349</id><published>2010-08-21T07:59:00.000-07:00</published><updated>2010-08-21T21:22:10.334-07:00</updated><title type='text'>Dive into mercurial</title><content type='html'>IMHO &lt;a href="http://mercurial.selenic.com/"&gt;Mercurial&lt;/a&gt; is using the Tree structure idea to manipulate the so-called 'trunk/branches/tags' which probably because of its  &lt;a href="http://selenic.com/mercurial/wiki/index.cgi/Presentations?action=AttachFile&amp;amp;do=get&amp;amp;target=ols-mercurial-paper.pdf"&gt;storage scheme&lt;/a&gt; revlog.&lt;br /&gt;&lt;br /&gt;This tree has only one top (r0) and one end. In case this rule is being broken, merge comes in.&lt;br /&gt;&lt;br /&gt;The following graph show a common scenario that one person change something base on r2.&lt;br /&gt;After he make the change, revision goes to 6.&lt;br /&gt; In &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt;,  if person do update base on r5, he will get the change which is at r6.&lt;br /&gt;Therefore Subversion need create another folder branches/tags to track change by name.&lt;br /&gt;&lt;br /&gt;By contract, Mercurial will ask for merge because it predicates there are two headers r5 and r6 (broke the rules of that Tree).&lt;br /&gt;After merge, new revision r7 created which has parent r5 and r6. (The storage schema revlog always doing append)&lt;br /&gt; So the Tree has one end again.&lt;br /&gt;&lt;br /&gt;Doing the change (commit) truns to be extending the tree by appeding nodes start from one specific node.&lt;br /&gt;&lt;br /&gt;0 -&amp;gt; 1 -&amp;gt; 2 -&amp;gt; 3 -&amp;gt; 4 -&amp;gt; 5     &lt;br /&gt;                  -----------------&amp;gt; 6&lt;br /&gt;&lt;br /&gt;My understanding of tag/branch in mercurial just give each node (revision) a name(alias).&lt;br /&gt;While the branch tracks the change after being branched, tag does not do that.&lt;br /&gt;Therefore we are able to check out any branches/tags without introducing extra folders.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Further reading including but not limit to storage scheme and examples.&lt;/i&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4064294806681778349?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4064294806681778349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4064294806681778349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4064294806681778349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4064294806681778349'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/08/dive-into-mercurial.html' title='Dive into mercurial'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6478076305859541432</id><published>2010-08-10T07:02:00.001-07:00</published><updated>2010-08-10T07:05:47.511-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>"Operation" Enum</title><content type='html'>&lt;pre&gt;&lt;span style="font-family: courier new,monospace;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new,monospace;"&gt;public enum Operation {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    PLUS {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;        double eval(double x, double y) { return x + y; }&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    },&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;    MINUS {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;        double eval(double x, double y) { return x - y; }&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;    },&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    TIMES {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;        double eval(double x, double y) { return x * y; }&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    },&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;    DIVIDED_BY {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;        double eval(double x, double y) { return x / y; }&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;    };&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    // Perform the arithmetic operation represented by this constant&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;    abstract double eval(double x, double y);&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    public static void main(String args[]) {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;        double x = 2.0&lt;/span&gt;;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;        double y = 4.0&lt;/span&gt;;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;        for (Operation op : Operation.values())&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;            System.out.println(x + &amp;quot; &amp;quot; + op + &amp;quot; &amp;quot; + y + &amp;quot; = &amp;quot; + op.eval(x, y));&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;    }&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;The document says it is anticipated that the need for this will be rare and it it a bit tricky.&lt;br&gt;  &lt;b&gt;How people think it is tricky?&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Reference&lt;br&gt;&lt;/pre&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="file:///home/haisgwu/documentation/langspec/classes.html#8.9"&gt;Java Lang Spec&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6478076305859541432?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6478076305859541432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6478076305859541432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6478076305859541432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6478076305859541432'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/08/operation-enum.html' title='&quot;Operation&quot; Enum'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-7343130320444298246</id><published>2010-08-10T05:54:00.001-07:00</published><updated>2010-08-10T07:05:47.511-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Increment/Decrement operators</title><content type='html'>The increment/decrement operators can be applied before (prefix)  or after (postfix) the operand. &lt;br&gt;The code &lt;code&gt;result++;&lt;/code&gt; and &lt;code&gt;++result;&lt;/code&gt; will both end in &lt;code&gt;result&lt;/code&gt; being incremented by one. &lt;br&gt;The only difference is that&lt;u&gt;&lt;b&gt;the prefix version (&lt;code&gt;++result&lt;/code&gt;) evaluates to the incremented value,    &lt;br&gt;whereas the postfix version (&lt;code&gt;result++&lt;/code&gt;) evaluates to the original value. &lt;/b&gt;&lt;/u&gt;&lt;br&gt;If you are just  performing a simple increment/decrement, it doesn&amp;#39;t really matter which version you choose. &lt;br&gt;But if  you use this operator in part of a larger expression, the one that you choose may make a  significant difference.  &lt;p&gt; The following program, PrePostDemo, illustrates the prefix/postfix unary increment operator:  &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;span style="font-family: courier new,monospace;"&gt;class PrePostDemo {&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;     public static void main(String[] args){&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;          int i = 3;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;	  i++;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;	  System.out.println(i);	// &amp;quot;4&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;	  ++i;			   &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;	  System.out.println(i);	// &amp;quot;5&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;	  System.out.println(++i);	// &amp;quot;6&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;	  System.out.println(i++);	// &amp;quot;6&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;	  System.out.println(i);	// &amp;quot;7&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;     }&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;pre&gt;&lt;i&gt;Reference&lt;/i&gt;&lt;br&gt;  &lt;/pre&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/javase/tutorial/java/nutsandbolts/op1.html"&gt;Java Language Basic&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-7343130320444298246?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/7343130320444298246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=7343130320444298246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7343130320444298246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7343130320444298246'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/08/incrementdecrement-operators.html' title='Increment/Decrement operators'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-437424334981998615</id><published>2010-06-13T00:15:00.001-07:00</published><updated>2010-08-10T07:05:47.512-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Refactoring StockWatcher in MVP</title><content type='html'>GWT get started tutorial has a sample project StockWatcher and I got refactoring it in a MVP way.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/stockwatcher-in-mvp/source/browse/#svn/tags/dev_1.0"&gt;StockWatcher in MVP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/stockwatcher-in-mvp/source/browse/trunk"&gt;StockWatcher in MVP with UiBinder&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://code.google.com/webtoolkit/doc/latest/tutorial/gettingstarted.html"&gt;GWT get started&lt;/a&gt;&lt;br /&gt; &lt;a href="http://code.google.com/webtoolkit/articles/mvp-architecture.html"&gt;MVP Architecture&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-437424334981998615?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/437424334981998615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=437424334981998615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/437424334981998615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/437424334981998615'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/06/refactoring-stockwatcher-in-mvp.html' title='Refactoring StockWatcher in MVP'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1996509990925196098</id><published>2010-05-05T05:43:00.000-07:00</published><updated>2010-05-05T05:49:43.434-07:00</updated><title type='text'>Dual Header at CentOS 5.4</title><content type='html'>&lt;span style="font-family: trebuchet ms;"&gt;Host: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;CentOS&lt;/span&gt; 5.4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Laptop: Dell 630&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Following second approach mentioned &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://intellinuxgraphics.org/dualhead.html"&gt;here&lt;/a&gt;&lt;span style="font-family: trebuchet ms;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;I just replace local &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;config&lt;/span&gt; with what the instruction said though I did not quit understand it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: trebuchet ms;"&gt;Find my detail &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;xorg&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;conf&lt;/span&gt; &lt;/span&gt;&lt;a style="font-family: trebuchet ms;" href="http://personal-study.googlecode.com/files/xorg.conf.dualheader"&gt;here&lt;/a&gt;&lt;span style="font-family: trebuchet ms;"&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1996509990925196098?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1996509990925196098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1996509990925196098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1996509990925196098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1996509990925196098'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/05/dual-header-at-centos-54.html' title='Dual Header at CentOS 5.4'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4923843444059619820</id><published>2010-02-07T22:19:00.000-08:00</published><updated>2010-09-16T18:48:42.671-07:00</updated><title type='text'>'Swap' Win and Ctrl in Linux</title><content type='html'>&lt;span style="font-size:130%;"&gt;OS: CentOS 5.4&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Add following line into $HOME/.Xmodmap: &lt;span style="font-style: italic; font-weight: bold;"&gt;add control = Super_L&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Add following line into $HOME/.xinitrc:&lt;span style="font-style: italic; font-weight: bold;"&gt; /usr/bin/xmodmap $HOME/.Xmodmap&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;check xmodmap manual for more information.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;OS: Ubuntu 10.x&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Go into System -&gt; Preferences -&gt; Keyboard&lt;/li&gt;&lt;li&gt; Click on the "Layouts" tab and then click the "Layout Options" button.&lt;/li&gt;&lt;li&gt; Click on "Alt/Win key behavior"&lt;/li&gt;&lt;li&gt; Select "Control is mapped to Win keys (and the usual ctrl key). &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4923843444059619820?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4923843444059619820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4923843444059619820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4923843444059619820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4923843444059619820'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2010/02/swap-win-and-ctrl-in-linux.html' title='&apos;Swap&apos; Win and Ctrl in Linux'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-7212716256871541992</id><published>2009-11-25T06:43:00.001-08:00</published><updated>2009-11-25T06:43:50.314-08:00</updated><title type='text'>Resize a VirtualBox Disk Image</title><content type='html'>&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;VirtualBox V3.0.8 &lt;/font&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;Host: Windows XP&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;Guest: CentOS 5.4&lt;/font&gt;&lt;/div&gt;&lt;div&gt;  &lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;Create new virtal disk at desired size&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;b&gt;VBoxManage.exe clonehd --existing old.vdi new.vdi&lt;/b&gt;&lt;/font&gt;&lt;/li&gt;  &lt;li&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;Use resize tool like GParted to create new partition for unused space as ext3 in the new.vdi&lt;/font&gt;&lt;/li&gt; &lt;li&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;use system-config-lvm to expand LogicVolumn with the new partition . (&lt;/font&gt;&lt;a href="http://wiki.centos.org/TipsAndTricks/ExpandLV"&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;Command line is preferred&lt;/font&gt;&lt;/a&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;)&lt;/font&gt;&lt;/li&gt;  &lt;/ol&gt;&lt;/div&gt;&lt;div&gt; &lt;blockquote style="margin:0 0 0 40px;border:none;padding:0px"&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   &lt;font class="Apple-style-span" color="#999999"&gt;basic command in case the url is bad&lt;/font&gt;&lt;/font&gt;&lt;div&gt;  &lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # lvm pvcreate /dev/sda5&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # lvm vgextend &amp;quot;MindbenderGroup&amp;quot; /dev/sda5&lt;/font&gt;&lt;/div&gt;   &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;      Volume group &amp;quot;MindbenderGroup&amp;quot; successfully extended&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # lvm lvresize -l 2261 /dev/MindbenderGroup/&lt;/font&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;MindbenderHome &lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;     &lt;i&gt;&lt;font class="Apple-style-span" color="#666666"&gt;;&lt;/font&gt;&lt;font class="Apple-style-span" color="#999999"&gt;;; 2261 is calculated according to Free PE / Current LE show by lvm vgdiaply &amp;amp; lvm lvdisplay&lt;/font&gt;&lt;/i&gt;&lt;/font&gt;&lt;/div&gt;   &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;     Extending logical volume MindbenderHome to 70.66 GB&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;     Logical volume MindbenderHome successfully resized&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # resize2fs /dev/MindbenderGroup/&lt;/font&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;MindbenderHome&lt;/font&gt;&lt;/div&gt;&lt;div&gt;  &lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   &lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   &lt;/font&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;a href="goog_1259159779264"&gt;&lt;font class="Apple-style-span" color="#999999"&gt;E&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;a href="http://www.centos.org/docs/4/4.5/System_Administration_Guide/Adding_Swap_Space-Extending_Swap_on_an_LVM2_Logical_Volume.html"&gt;&lt;font class="Apple-style-span" color="#999999"&gt;xpend/resize Swap partition&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;   &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # swapoff -v /dev/VolGroup00/LogVol01 &lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # lvm lvresize /dev/VolGroup00/LogVol01 -L +256M &lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # mkswap /dev/VolGroup00/LogVol01 &lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # swapon -va &lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # cat /proc/swaps # free &lt;/font&gt;&lt;/div&gt; &lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-7212716256871541992?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/7212716256871541992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=7212716256871541992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7212716256871541992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7212716256871541992'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/11/resize-virtualbox-disk-image.html' title='Resize a VirtualBox Disk Image'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2895684552343550332</id><published>2009-09-26T18:48:00.001-07:00</published><updated>2009-09-29T01:46:30.426-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Crawl Chinese web site with Scrapy</title><content type='html'>The response return by Scrapy is a Python repr() object thus Chinese character &amp;#39;display&amp;#39; in Unicode.&lt;br&gt;&lt;br&gt;Quick fix is like this:&lt;br&gt;  item[&amp;#39;name&amp;#39;][0].encode(&amp;#39;utf-8&amp;#39;)&lt;br&gt;Though some characters are still display incorrectly.&lt;br&gt;  Find source code &lt;a href="http://code.google.com/p/personal-study/source/browse/#svn/trunk/python-work/cncrk"&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;More about Unicode in Python:&lt;br&gt;  &lt;a href="http://evanjones.ca/python-utf8.html"&gt;http://evanjones.ca/python-utf8.html&lt;/a&gt;&lt;br&gt;    &lt;a href="http://www.b-list.org/weblog/2007/nov/10/unicode/"&gt;http://www.b-list.org/weblog/2007/nov/10/unicode/&lt;/a&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2895684552343550332?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2895684552343550332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2895684552343550332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2895684552343550332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2895684552343550332'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/09/crawl-chinese-web-site-with-scrapy.html' title='Crawl Chinese web site with Scrapy'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2484632366163707134</id><published>2009-09-18T05:10:00.001-07:00</published><updated>2009-09-29T01:46:02.559-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wiki'/><title type='text'>Trac quick setup</title><content type='html'>Came across &lt;a href="http://trac.edgewall.org/"&gt;Trac &lt;/a&gt;while checking information of &lt;a href="http://dev.scrapy.org/"&gt;Scrapy &lt;/a&gt;and had a quick try.&lt;br&gt;&lt;br&gt;Operation System is Ubuntu.&lt;br&gt;&lt;br&gt;Operation performed:&lt;br&gt;&lt;ul&gt;  &lt;li&gt;Download package from official site&lt;/li&gt;&lt;li&gt;Follow INSTALL doc in the package to complete installation&lt;/li&gt;&lt;li&gt;Start Trac and visit Guide&lt;/li&gt;&lt;li&gt;Auth&lt;/li&gt;&lt;ul&gt;&lt;li&gt;basic auth&lt;/li&gt;&lt;li&gt;TODO other auth of adding register feature&lt;br&gt;  &lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Subversion&lt;/li&gt;&lt;ul&gt;&lt;li&gt;python Subversion module (ubuntu install script: apt-get install python-subversion)&lt;br&gt;&lt;/li&gt;&lt;li&gt;&amp;quot;svnadmin create&amp;quot; Subversion repos and update trac.ini accordingly&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;  Permission (Guide section TracPermissions)&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Add permission TRAC_ADMIN to user in order to show the WebAdmin tab&lt;/li&gt;&lt;li&gt;WebAdmin is an Admin Web interface to perform admin operations&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Roadmap&lt;/li&gt;  &lt;li&gt;Component&lt;/li&gt;&lt;li&gt;TODO etc ...&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2484632366163707134?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2484632366163707134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2484632366163707134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2484632366163707134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2484632366163707134'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/09/trac-quick-setup.html' title='Trac quick setup'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-309665443204277544</id><published>2009-09-03T21:27:00.000-07:00</published><updated>2009-09-13T23:55:33.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Verify Binary Search result with duplicate target in the array</title><content type='html'>Testing scenario: If &lt;tt&gt;&lt;i&gt;testArray&lt;/i&gt;&lt;/tt&gt; contains &lt;tt&gt;&lt;i&gt;target&lt;/i&gt;&lt;/tt&gt; at position  &lt;tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;/tt&gt;, then &lt;tt&gt;binarySearch&lt;/tt&gt; &lt;tt&gt;&lt;i&gt;(testArray,  target&lt;/i&gt;&lt;/tt&gt;) must return &lt;tt&gt;&lt;i&gt;n&lt;br&gt;&lt;/i&gt;&lt;/tt&gt;&lt;br&gt;&lt;span style="font-family: courier new,monospace;"&gt;public void assertTheory4(int[] testArray, int target, int returnValue) { &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;  assertEquals(getTargetPosition(testArray, target), returnValue); 	&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;}  	&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;public int getTargetPosition(int[] testArray, int target) { 	    &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;  for (int i = 0; i &amp;lt; testArray.length; i++) 	        &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;    if (testArray[i] == target) 	            &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;      return i; 	    &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;  return -1; 	&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;} &lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="font-family: courier new,monospace;"&gt;Array=[2, 11, 36, 66, 104, 108, 108, 108, 122, 	155, 159, 161, 191] &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;target=108 &lt;/span&gt;&lt;br&gt;&lt;br&gt;Binary Search 108 will return 6 while getTargetPosition return 5.&lt;br&gt;  &lt;br&gt;&lt;b&gt;Possible fix: Update the function getTargetPosition to return a int array, which contains all position of the value.&lt;br&gt;  Then assert this return int array must contain binary search result.&lt;/b&gt;&lt;br&gt;&lt;br&gt;Any others?&lt;br&gt;  &lt;br&gt;&lt;i&gt;REFERENCE: SECTION 7.2 OF &amp;lt;BEAUTIFUL CODE&amp;gt;&lt;/i&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-309665443204277544?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/309665443204277544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=309665443204277544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/309665443204277544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/309665443204277544'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/09/verify-binary-search-result-with.html' title='Verify Binary Search result with duplicate target in the array'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-541413424870277859</id><published>2009-09-01T23:57:00.000-07:00</published><updated>2009-09-13T23:55:33.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>NameCheck of XML Validation</title><content type='html'>The beautiful part is build up a array with size 2^16, each value is 8bits, each bit indicate something like whether current character could be start of name, valid name.&lt;br&gt;For instance, number 4 is at 0x34 (decimal 52), so flags[52] = 0x0b (00001100), those 8bits 0/1 are indication.&lt;br&gt;  &lt;br&gt;&lt;b&gt;&lt;i&gt;Chapter 5 of &amp;lt;beautiful code&amp;gt; has the detail.&lt;/i&gt;&lt;/b&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-541413424870277859?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/541413424870277859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=541413424870277859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/541413424870277859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/541413424870277859'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/09/namecheck-of-xml-validation.html' title='NameCheck of XML Validation'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-7033720486446544196</id><published>2009-09-01T21:30:00.000-07:00</published><updated>2009-09-13T23:49:54.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Patterns: Factory method,Template method and Strategy</title><content type='html'>Basically, &lt;b&gt;Factory method&lt;/b&gt; is a method that is defined in Parent class and is implemented in Child class, which usually is abstract method.&lt;br&gt;&lt;br&gt;By contract, &lt;b&gt;Template method&lt;/b&gt; is a method that implements an &amp;quot;algorithm&amp;quot;. This implementation is usually defined in a &amp;quot;Parent&amp;quot; class and leveraging other methods including Factory methods. (See sample below)&lt;br&gt;  &lt;br&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;public abstract class PizzaStore {&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;        /**&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;         * #templateMethod(String type) is an Template Method.&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;         * &amp;lt;p&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;         * #factoryMethodOfInit() AND #factoryMethodOfCreate(String type) are both&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;         * Factory Method.&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;         */&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;        public Pizza templateMethod(String type) {&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                factoryMethodOfInit();&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                Pizza pizza = factoryMethodOfCreate(type);&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                System.out.println(&amp;quot;--- Making a &amp;quot; + pizza.getName() + &amp;quot; ---&amp;quot;);&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                pizza.prepare();&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                pizza.bake();&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                pizza.cut();&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                pizza.box();&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;                return pizza;&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;        }&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;        protected abstract void factoryMethodOfInit();&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;        protected abstract Pizza factoryMethodOfCreate(String type);&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;  &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;}&lt;/span&gt;&lt;br&gt;&lt;br&gt;Here is a definition:&lt;br&gt;&lt;b&gt;Factory Method：&lt;/b&gt;&lt;br&gt;   Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.&lt;br&gt;&lt;br&gt;&lt;b&gt;Template Method：&lt;/b&gt;&lt;br&gt;   Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm&amp;#39;s structure.&lt;br&gt;   (Here &amp;quot;lets subclasses redefine certain steps&amp;quot; could be done by leveraging Factory method)&lt;br&gt;&lt;br&gt;&lt;b&gt;Relationship&lt;/b&gt;: Factory Methods are often called by template methods.&lt;br&gt;  &lt;br&gt;Then the Strategy Pattern, Spring DI uses this pattern IMO somehow. &lt;br&gt;&lt;br&gt;Check the updated PizzaStore version below, londonPizzaCreator and nYorkPizzaCreator are &amp;quot;Strategies&amp;quot; of PizzaCreator.&lt;br&gt;Then PizzaStore can change strategies at runtime regardless implementation detail by injecting various strategies. (via method setPizzaCreator)&lt;br&gt;  &lt;br&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;public abstract class PizzaStore {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        private PizzaCreator pizzaCreator;&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        public Pizza templateMethod(String type) {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                factoryMethodOfInit();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                Pizza pizza = pizzaCreator.createPizza(type);&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                System.out.println(&amp;quot;--- Making a &amp;quot; + pizza.getName() + &amp;quot; ---&amp;quot;);&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                pizza.prepare();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                pizza.bake();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                pizza.cut();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                pizza.box();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                return pizza;&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        }&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        protected abstract void factoryMethodOfInit();&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        public void setPizzaCreator(PizzaCreator pizzaCreator) {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                this.pizzaCreator = pizzaCreator;&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        }&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;}&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;// ---------------------------------------------------------------------------------- &amp;quot;Strategies&amp;quot; &lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;public interface PizzaCreator {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        public Pizza createPizza(String type);&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;}&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;public class londonPizzaCreator implements PizzaCreator {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        public Pizza createPizza(String type) {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                // TODO add creat detail&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                return null;&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        }&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;}&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;public class nYorkPizzaCreator implements PizzaCreator {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        public Pizza createPizza(String type) {&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                // TODO add creat detail&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;                return null;&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;  &lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;        }&lt;/span&gt;&lt;br style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;&lt;span style="color: rgb(51, 102, 255); font-family: courier new,monospace;"&gt;}&lt;/span&gt;&lt;br&gt;  &lt;br&gt;&lt;br&gt;&lt;b&gt;Strategy&lt;/b&gt;:&lt;br&gt;  Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.&lt;br&gt;&lt;br&gt;&lt;b&gt;Related to Template Method:&lt;/b&gt;&lt;br&gt;  Template methods use inheritance to vary part of an algorithm. Strategies use delegation to vary the entire algorithm.&lt;br&gt;&lt;br&gt;&lt;font size="4"&gt;&lt;b&gt;What&amp;#39;s more?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;  Those patterns are actually in different category in the book by GoF, trying to understand the reason therefore to understand their diff more clearly.&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-7033720486446544196?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/7033720486446544196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=7033720486446544196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7033720486446544196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7033720486446544196'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/09/patterns-factory-methodtemplate-method.html' title='Patterns: Factory method,Template method and Strategy'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1879274660506392606</id><published>2009-08-19T21:41:00.001-07:00</published><updated>2009-09-29T01:45:22.567-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Tail Call Optimization</title><content type='html'>A tail call is a subroutine call which is followed by a return to the calling code.&lt;br&gt;&lt;br&gt;Tail calls are often optimized by interpreters and compilers of functional programming languages to more efficient forms of iteration.&lt;br&gt;  &lt;br&gt;See &lt;a href="http://www.c2.com/cgi/wiki?TailCallOptimization"&gt;here&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Tail_call"&gt;here&lt;/a&gt;.&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1879274660506392606?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1879274660506392606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1879274660506392606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1879274660506392606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1879274660506392606'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/08/tail-call-optimization.html' title='Tail Call Optimization'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2640803969762097944</id><published>2009-08-19T01:20:00.001-07:00</published><updated>2009-10-13T00:16:10.199-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LISP'/><title type='text'>Hello-Macro in Clojure</title><content type='html'>If define the unless as function like this,&lt;br&gt; &lt;span style="font-family: courier new,monospace;"&gt; (defn unless [expr form] (if expr nil form))&lt;/span&gt;&lt;br&gt;&lt;br&gt;Does that work?&lt;br&gt;&lt;span style="font-family: courier new,monospace;"&gt;(unless false (println &amp;quot;this should print&amp;quot;))&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;  =&amp;gt; this should print&lt;/span&gt;&lt;br&gt;&lt;span style="font-family: courier new,monospace;"&gt;(unless true (println &amp;quot;this should not print&amp;quot;))&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;  &lt;span style="font-family: courier new,monospace;"&gt;  =&amp;gt; this should not print&lt;/span&gt;&lt;br&gt;&lt;br&gt;Obviously the answer is no.&lt;br&gt;&lt;br&gt;The reason is Clojure evaluates all the arguments before passing them to a function, &lt;br&gt;so the println is called before unless ever sees it.&lt;br&gt;  So it seems Clojure is applicative order evaluation, but not normal order evaluation. (SICP exe. 1.5)&lt;br&gt;&lt;br&gt;Therefore Macro.&lt;br&gt;&lt;br&gt;&lt;span style="font-family: courier new,monospace;"&gt;(defmacro unless [expr form] (list &amp;#39;if expr nil form))&lt;/span&gt;&lt;br&gt;  &lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2640803969762097944?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2640803969762097944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2640803969762097944' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2640803969762097944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2640803969762097944'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/08/hello-macro-in-clojure.html' title='Hello-Macro in Clojure'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3324943524356325016</id><published>2009-03-05T21:22:00.001-08:00</published><updated>2009-11-06T00:31:35.463-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Uninstall Oracle DB in Windows XP</title><content type='html'>&lt;a style="font-family: trebuchet ms,sans-serif;" href="http://www.oracle-base.com/articles/misc/ManualOracleUninstall.php"&gt;This article&lt;/a&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt; shows the detail.&lt;/span&gt;&lt;br style="font-family: trebuchet ms,sans-serif;"&gt; &lt;br style="font-family: trebuchet ms,sans-serif;"&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt;But problem is the OUI failed to show all installed components...&lt;/span&gt;&lt;br style="font-family: trebuchet ms,sans-serif;"&gt; &lt;span style="font-family: trebuchet ms,sans-serif;"&gt;After read &lt;/span&gt;&lt;a style="font-family: trebuchet ms,sans-serif;" href="http://becomeappsdba.blogspot.com/2006/12/orainventory-in-oracle.html"&gt;this post&lt;/a&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt;, I got chance to read the &lt;b&gt;inventory.xml&lt;/b&gt; by finding out that my Oracle DB was not appeared in the HOME LIST...&lt;/span&gt;&lt;br style="font-family: trebuchet ms,sans-serif;"&gt; &lt;br style="font-family: trebuchet ms,sans-serif;"&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt;Everything went well once fix the &lt;b&gt;inventory.xml&lt;/b&gt; manualy.&lt;/span&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3324943524356325016?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3324943524356325016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3324943524356325016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3324943524356325016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3324943524356325016'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/03/uninstall-oracle-db-in-windows-xp.html' title='Uninstall Oracle DB in Windows XP'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3910737438386806947</id><published>2009-02-22T06:53:00.000-08:00</published><updated>2009-09-29T01:55:48.269-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>雨天</title><content type='html'>&lt;p&gt;还在继续。&lt;/p&gt; &lt;p&gt;&lt;br&gt;人们似乎都不喜欢雨天，在言语上排斥，在心里面厌烦。&lt;br&gt;空气中弥漫着雨水，打湿了漂亮的装扮，&amp;#39;浸湿&amp;#39;了衣服和被子。&lt;/p&gt; &lt;p&gt;水气冲到了家里的每一个角落。&lt;/p&gt; &lt;p&gt;落在雨棚上的雨滴是一种噪音。&lt;/p&gt; &lt;p&gt;人们开始头痛，身体感到不适。&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;打开窗，深呼吸，清心舒畅。&lt;/p&gt; &lt;p&gt;空气中，树叶上，街道里，&lt;/p&gt; &lt;p&gt;雨水洗刷了灰尘，雨滴变成了音符。&lt;/p&gt; &lt;p&gt;路上行人寥寥，雨点拍打湖面，声音依稀可见。&lt;/p&gt; &lt;p&gt;人们开始微笑，心里发现平静。&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;为了看到雨后的清澈，人们每天快乐。&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3910737438386806947?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3910737438386806947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3910737438386806947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3910737438386806947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3910737438386806947'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/02/blog-post.html' title='雨天'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4985199511610300342</id><published>2009-02-18T21:38:00.001-08:00</published><updated>2009-09-29T01:45:33.695-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Firemacs</title><content type='html'>Pretty cool Firefox addon.&lt;br&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/4141"&gt;https://addons.mozilla.org/en-US/firefox/addon/4141&lt;/a&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4985199511610300342?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4985199511610300342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4985199511610300342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4985199511610300342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4985199511610300342'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/02/firemacs.html' title='Firemacs'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6996948375313053819</id><published>2009-01-13T05:42:00.000-08:00</published><updated>2009-01-13T05:54:11.481-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Euler'/><category scheme='http://www.blogger.com/atom/ns#' term='Mathematic'/><title type='text'>Euler Problem 28</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;a href="http://projecteuler.net/index.php?section=problems&amp;amp;id=28"&gt;&lt;span style="font-family:verdana;"&gt;problem 28&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;""" Mathmatics method&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;S1 = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;S2 = 1 + 1 * (8*2*2 - 2 + 6) * 2 / 3 = 1 + 24 = 25&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Sn = S1 + (Pn-1 + n-1) + (Pn-1 + (n-1)*2) + (Pn-1 + (n-1)*3) + (Pn-1 + (n-1)*4)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;   = S1 + 4 * Pn-1 + (2*n - 2)*10&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;   = S1 + 16*{ sigma:X^2 | n-1 &gt;= X &gt;= 1 } + 4*{ sigma:X | n-1 &gt;= X &gt;= 1 } + 4*(n-1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;   = S1 + (n-1) * (8*n*n - n + 6) * 2 /3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;;;; Pn is the top-right element&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;P1 = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Pn = (2*n - 1)^2&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;;;; spiral number&lt;br /&gt;s = 2*n - 1&lt;br /&gt;;;;&lt;br /&gt;for 1001 by 1001 spiral, 1001 = 2*n - 1 =&gt; n=501&lt;br /&gt;thus S501 = S1 + 500 * (8*501*501 - 501 + 6) * 2 / 3&lt;br /&gt;"""&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6996948375313053819?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6996948375313053819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6996948375313053819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6996948375313053819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6996948375313053819'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/01/euler-problem-28.html' title='Euler Problem 28'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5814240510693989848</id><published>2009-01-06T05:33:00.000-08:00</published><updated>2009-01-06T05:44:56.297-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>VIM Commands learned</title><content type='html'>-- move the windows&lt;br /&gt;CTRL-W K    move window to the top&lt;br /&gt;CTRL-W H    move window to the far left&lt;br /&gt;CTRL-W J    move window to the bottom&lt;br /&gt;CTRL-W L    move window to the far right&lt;br /&gt;&lt;br /&gt;-- Editing Mulitple Files&lt;br /&gt;# is particularly useful with :e, since it allows you to switch back and forth between two files easily&lt;br /&gt;you could save a second version of the file letter with the command: :w %.new&lt;br /&gt;With the CTRL-O and CTRL-I command you&lt;br /&gt;can go to cursor positions before older jumps, and back again. &lt;br /&gt;&lt;br /&gt;-- Registers&lt;br /&gt;["x]yy        Copy line into register x&lt;br /&gt;           How to type(type four characters one by one): "xyy&lt;br /&gt;&lt;br /&gt;-- Mark&lt;br /&gt;m x            Mark current position with x (x can be any letter). See 'help mark'&lt;br /&gt;&lt;br /&gt;-- Parse select content to search&lt;br /&gt;Yank the selected content; start search by type /; Ctrl-r with "&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5814240510693989848?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5814240510693989848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5814240510693989848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5814240510693989848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5814240510693989848'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2009/01/vim-commands-learned.html' title='VIM Commands learned'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2651256218827348563</id><published>2008-12-08T23:15:00.000-08:00</published><updated>2009-01-06T05:41:23.213-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Decode Characters in Python</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;class CP037Decoder:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    _CHARSET_ = 'cp037'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    def __init__(self, message):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;self.decode_message = unicode(message, self._CHARSET_)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    def show_in_utf8(self):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        print self.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;decode_message&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;.encode('utf8')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if __name__ == '__main__':&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    msg_file = open(sys.argv[1], 'r')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;CP037Decoder&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;(msg_file.read()).show_in_utf8()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    msg_file.close()&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2651256218827348563?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2651256218827348563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2651256218827348563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2651256218827348563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2651256218827348563'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/12/class-cp037decoder-charset-cp037-def.html' title='Decode Characters in Python'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4885688662547089059</id><published>2008-10-19T17:15:00.001-07:00</published><updated>2008-10-19T17:26:04.432-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview'/><title type='text'>Interview with Donald Knuth</title><content type='html'>&lt;div dir="ltr"&gt;&lt;a href="http://www.informit.com/articles/article.aspx?p=1193856"&gt;http://www.informit.com/articles/article.aspx?p=1193856&lt;/a&gt;&lt;br&gt; &lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4885688662547089059?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4885688662547089059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4885688662547089059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4885688662547089059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4885688662547089059'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/10/interview-with-donald-knuth.html' title='Interview with Donald Knuth'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4999572931495350367</id><published>2008-10-12T18:10:00.001-07:00</published><updated>2009-09-29T01:47:01.774-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Hermes vs Oracle AQ</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;1. Need a wrapped connect factory, &lt;/span&gt;&lt;a style="font-family: verdana,sans-serif;" href="http://sites.google.com/site/freizl/java-code/oracleaqfactory"&gt;see here&lt;/a&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;. And package it into a jar, like &lt;b&gt;oracleaq-factory.jar&lt;/b&gt;&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;2. How to in Hermes:&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;div&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.1 add a new provider including those jars: aqapi.jar, jms.jar, jta.jar, ojdbc.jar and &lt;b&gt;oracleaq-factory.jar&lt;/b&gt;&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.2 create a new session for AQ topic (EAB_DEMO_QUEUE here): &lt;/span&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font size="1"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;lt;factory classpathId=&amp;quot;OracleAQ&amp;quot;&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;provider className=&amp;quot;com.freizl.OracleAQFactory&amp;quot;&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;properties&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&amp;quot;hostName&amp;quot; value=&amp;quot;vlinux&amp;quot;/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&amp;quot;password&amp;quot; value=&amp;quot;demoq&amp;quot;/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&amp;quot;sid&amp;quot; value=&amp;quot;XE&amp;quot;/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&amp;quot;userName&amp;quot; value=&amp;quot;demoq&amp;quot;/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/properties&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/provider&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;connection clientID=&amp;quot;&amp;quot; connectionPerThread=&amp;quot;false&amp;quot;&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;session audit=&amp;quot;false&amp;quot; checkSize=&amp;quot;false&amp;quot; checkSizePeriod=&amp;quot;0&amp;quot; id=&amp;quot; OralceAQ_Local&amp;quot; reconnects=&amp;quot;0&amp;quot; transacted=&amp;quot;true&amp;quot; useConsumerForQueueBrowse=&amp;quot;false&amp;quot;/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/connection&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;destination domain=&amp;quot;2&amp;quot; durable=&amp;quot;false&amp;quot; name=&amp;quot;EAB_DEMO_QUEUE&amp;quot;/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extension className=&amp;quot;hermes.ext.DefaultHermesAdminFactory&amp;quot;&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;properties/&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extension&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/factory&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;3. Double click the topic under the session, EAB_DEMO_QUEUE here, to connect to the topic.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hermes will create a new subscriber for this topic. &lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; And once there&amp;#39;s message push into this topic, it will be display in the Hermes. (not consume, just browser).&lt;/span&gt;&lt;br&gt;&amp;nbsp; &lt;br&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4999572931495350367?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4999572931495350367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4999572931495350367' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4999572931495350367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4999572931495350367'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/10/hermes-vs-oracle-aq.html' title='Hermes vs Oracle AQ'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2336813181266687248</id><published>2008-09-21T19:19:00.000-07:00</published><updated>2009-09-29T01:47:01.774-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Interactive with AQ Topic in Java</title><content type='html'>import static org.junit.Assert.assertNotNull;&lt;br /&gt;import java.util.Calendar;&lt;br /&gt;import javax.jms.Message;&lt;br /&gt;import javax.jms.QueueConnection;&lt;br /&gt;import javax.jms.QueueConnectionFactory;&lt;br /&gt;import javax.jms.Topic;&lt;br /&gt;import oracle.jms.AQjmsAgent;&lt;br /&gt;import oracle.jms.AQjmsFactory;&lt;br /&gt;import oracle.jms.AQjmsSession;&lt;br /&gt;import oracle.jms.AQjmsTextMessage;&lt;br /&gt;import oracle.jms.AQjmsTopicPublisher;&lt;br /&gt;import oracle.jms.AQjmsTopicReceiver;&lt;br /&gt;import org.junit.After;&lt;br /&gt;import org.junit.Before;&lt;br /&gt;import org.junit.Test;&lt;br /&gt;&lt;br /&gt;public class TestOracleAQ {&lt;br /&gt;&lt;br /&gt;    private static final String AQ_TOPIC = "ESB_DEMO_QUEUE";&lt;br /&gt;    /** AQ Server Connection */&lt;br /&gt;    private static final String HOST_NAME = "VLINUX";&lt;br /&gt;    private static final String SID = "XE";&lt;br /&gt;    private static final int CONNECT_PORT = 1521;&lt;br /&gt;    private static final String CONNECT_TYPE = "thin";&lt;br /&gt;    private static final String AQ_USER = "DEMOQ";&lt;br /&gt;    private static final String AQ_PASSWD = "DEMOQ";&lt;br /&gt;   &lt;br /&gt;    private QueueConnectionFactory qcf = null;&lt;br /&gt;    private AQjmsSession jmsSession = null;&lt;br /&gt;    private QueueConnection qc = null;&lt;br /&gt;    private Topic topic = null;&lt;br /&gt;&lt;br /&gt;    @Before&lt;br /&gt;    public void setUp() throws Exception {&lt;br /&gt;        qcf = AQjmsFactory.getQueueConnectionFactory(HOST_NAME, SID,&lt;br /&gt;                CONNECT_PORT, CONNECT_TYPE);&lt;br /&gt;        qc = qcf.createQueueConnection(AQ_USER, AQ_PASSWD);&lt;br /&gt;        qc.start();&lt;br /&gt;        jmsSession = (AQjmsSession) qc.createQueueSession(true, 0);&lt;br /&gt;        /* for single consumer AQ */&lt;br /&gt;        // q = ((AQjmsSession) qs).getQueue("DEMOQ", "ESB_DEMO_QUEUE");&lt;br /&gt;        /* for multiple consumer AQ */&lt;br /&gt;        topic = jmsSession.getTopic(AQ_USER, AQ_TOPIC);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @After&lt;br /&gt;    public void tearDown() throws Exception {&lt;br /&gt;        jmsSession.close();&lt;br /&gt;        qc.stop();&lt;br /&gt;        qcf = null;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Test&lt;br /&gt;    public void testReceive() throws Exception {&lt;br /&gt;        String subscriberId = "RECIPIENT";&lt;br /&gt;        AQjmsTopicReceiver receiver = jmsSession.createTopicReceiver(topic,&lt;br /&gt;                subscriberId, null);&lt;br /&gt;        Message msg = receiver.receive(200);&lt;br /&gt;        assertNotNull(msg);&lt;br /&gt;        /* a AQjmsTextMessage Type */&lt;br /&gt;        System.out.println(msg);&lt;br /&gt;        AQjmsTextMessage jmsMsg = (AQjmsTextMessage) msg;&lt;br /&gt;        /* User Data */&lt;br /&gt;        System.out.println(jmsMsg.getText());&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Test&lt;br /&gt;    public void testProduceToSpecificSubscriber() throws Exception {&lt;br /&gt;        AQjmsTopicPublisher publisher = (AQjmsTopicPublisher) jmsSession&lt;br /&gt;                .createPublisher(topic);&lt;br /&gt;        AQjmsTextMessage jmsMsg = new AQjmsTextMessage();&lt;br /&gt;        jmsMsg.setJMSTimestamp(Calendar.getInstance().getTime().getTime());&lt;br /&gt;        jmsMsg.setText("I am a message from junit test to simon... "&lt;br /&gt;                + Calendar.getInstance().getTime());&lt;br /&gt;        AQjmsAgent[] demoSimon = { new AQjmsAgent() };&lt;br /&gt;        String subscriberId = "DEMOAQ_SIMON";&lt;br /&gt;        demoSimon[0].setName(subscriberId);&lt;br /&gt;        publisher.publish(jmsMsg, demoSimon);&lt;br /&gt;        jmsSession.commit();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Test&lt;br /&gt;    public void testProduceToAllSubscriber() throws Exception {&lt;br /&gt;        AQjmsTopicPublisher publisher = (AQjmsTopicPublisher) jmsSession&lt;br /&gt;                .createPublisher(topic);&lt;br /&gt;        AQjmsTextMessage jmsMsg = new AQjmsTextMessage();&lt;br /&gt;        jmsMsg.setJMSTimestamp(Calendar.getInstance().getTime().getTime());&lt;br /&gt;        jmsMsg.setText("I am a message from junit test to all subscriber... "&lt;br /&gt;                + Calendar.getInstance().getTime());&lt;br /&gt;        publisher.publish(jmsMsg);&lt;br /&gt;        jmsSession.commit();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2336813181266687248?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2336813181266687248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2336813181266687248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2336813181266687248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2336813181266687248'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/09/interactive-with-aq-topic-in-java.html' title='Interactive with AQ Topic in Java'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-941013404123932132</id><published>2008-09-21T19:14:00.001-07:00</published><updated>2008-10-19T17:26:04.433-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview'/><title type='text'>Erich Gamma Discusses Jazz, Eclipse, JUnit and Design Patterns</title><content type='html'>http://www.infoq.com/interviews/gamma-jazz-eclipse-junit-design-patterns&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-941013404123932132?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/941013404123932132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=941013404123932132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/941013404123932132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/941013404123932132'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/09/erich-gamma-discusses-jazz-eclipse.html' title='Erich Gamma Discusses Jazz, Eclipse, JUnit and Design Patterns'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6739009322870626006</id><published>2008-08-19T01:50:00.001-07:00</published><updated>2009-01-06T06:17:12.331-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cygwin'/><title type='text'>Set programs installed in Windows Program files folder to PATH (Cygwin)</title><content type='html'>&lt;div dir="ltr"&gt;VIM_HOME=&amp;#39;/cygdrive/c/Program Files/Vim/vim72&amp;#39;&lt;br&gt;JAVA_HOME=&amp;#39;/cygdrive/c/Program Files/Java/jdk1.5.0_11&amp;#39;&lt;br&gt;&lt;br&gt;alias ll=&amp;quot;ls -lh&amp;quot;&lt;br&gt;alias l=&amp;quot;ls -a&amp;quot;&lt;br&gt;&lt;br&gt;PATH=&amp;quot;${VIM_HOME}&amp;quot;:&amp;quot;${JAVA_HOME}/bin&amp;quot;:${PATH}&lt;br&gt; export PATH&lt;br&gt;&lt;br&gt;The quote and double quote play the magic..&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6739009322870626006?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6739009322870626006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6739009322870626006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6739009322870626006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6739009322870626006'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/08/set-programs-installed-in-windows.html' title='Set programs installed in Windows Program files folder to PATH (Cygwin)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6015818706739588293</id><published>2008-08-14T00:10:00.001-07:00</published><updated>2008-10-19T17:24:09.135-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LISP'/><title type='text'>Compare ', #' and ` in LISP</title><content type='html'>&lt;div dir="ltr"&gt;&lt;b style="color: rgb(51, 51, 255);"&gt;quote &amp;#39;&lt;/b&gt;&lt;br&gt;is syntactic sugar for QUOTE, which takes a single expression as its &amp;quot;argument&amp;quot; and simply returns it, unevaluated. &lt;br&gt;(quote (+ 1 2))&amp;nbsp; ===&amp;nbsp; &amp;#39;(+ 1 2)&lt;br&gt; &lt;br&gt;&lt;b&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;#&amp;#39;&lt;/span&gt;&lt;/b&gt;&lt;br&gt;is syntactic sugar for FUNCTION.&lt;br&gt;(function foo)&amp;nbsp; ===&amp;nbsp; #&amp;#39;foo&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;b style="color: rgb(51, 51, 255);"&gt;backquote `&lt;/b&gt;&lt;br&gt;a backquoted expression is similar to a quoted expression except you can &amp;quot;unquote&amp;quot; particular subexpressions by preceding them with a comma, possibly followed by an at (@) sign.&lt;br&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;[Basicly it&amp;#39;s similar with quote &amp;#39;, but can do more, like evaluate subexpressions by a comma]&lt;br&gt;Without an at sign, the comma causes the value of the subexpression to be included as is.&lt;br&gt;With an at sign, the value--which must be a list--is &amp;quot;spliced&amp;quot; into the enclosing list.&lt;br&gt; &lt;br&gt;&lt;i&gt;&amp;lt;Examples&amp;gt;&lt;/i&gt;&lt;br&gt;Backquote Syntax&amp;nbsp;&amp;nbsp; &amp;nbsp;Equivalent List-Building Code&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Result&lt;br&gt;`(a (+ 1 2) c)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(list &amp;#39;a &amp;#39;(+ 1 2) &amp;#39;c)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(a (+ 1 2) c)&lt;br&gt;`(a ,(+ 1 2) c)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(list &amp;#39;a (+ 1 2) &amp;#39;c)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(a 3 c)&lt;br&gt; `(a (list 1 2) c)&amp;nbsp;&amp;nbsp; &amp;nbsp;(list &amp;#39;a &amp;#39;(list 1 2) &amp;#39;c)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(a (list 1 2) c)&lt;br&gt;`(a ,(list 1 2) c)&amp;nbsp;&amp;nbsp; &amp;nbsp;(list &amp;#39;a (list 1 2) &amp;#39;c)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(a (1 2) c)&lt;br&gt;`(a ,@(list 1 2) c)&amp;nbsp;&amp;nbsp; &amp;nbsp;(append (list &amp;#39;a) (list 1 2) (list &amp;#39;c))&amp;nbsp;&amp;nbsp; &amp;nbsp;(a 1 2 c)&lt;br&gt; &lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6015818706739588293?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6015818706739588293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6015818706739588293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6015818706739588293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6015818706739588293'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/08/compare-and-in-lisp.html' title='Compare &apos;, #&apos; and ` in LISP'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1813922429453083954</id><published>2008-08-06T17:58:00.001-07:00</published><updated>2008-08-06T17:58:09.753-07:00</updated><title type='text'>Reset Root Password of OpenBSD</title><content type='html'>&lt;div dir="ltr"&gt;&lt;br&gt;At boot&amp;gt; prompt type boot -s to boot into single user mode:&lt;br&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;boot&amp;gt; boot -s&lt;/span&gt;&lt;br&gt;&lt;br&gt;Next you will see a message as follows:&lt;br&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;Enter pathname of shell or RETURN for sh:&lt;/span&gt;&lt;br&gt; Just hit [Enter] key to load sh shell.&lt;br&gt;&lt;br&gt;Mount / and /usr file system in read-write mode:&lt;br&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;# mount -uw /&lt;/span&gt;&lt;br style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;# mount /usr&lt;/span&gt;&lt;br&gt; &lt;br&gt;Finally set or change the password for root user, enter:&lt;br&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;# passwd&lt;/span&gt;&lt;br&gt;&lt;br&gt;Press &lt;i style="color: rgb(0, 0, 153);"&gt;CTRL+D&lt;/i&gt; to boot into multiuser mode or just reboot server:&lt;br&gt; &lt;span style="color: rgb(0, 0, 153);"&gt;# reboot&lt;/span&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1813922429453083954?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1813922429453083954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1813922429453083954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1813922429453083954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1813922429453083954'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/08/reset-root-password-of-openbsd.html' title='Reset Root Password of OpenBSD'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-563026865425626352</id><published>2008-07-31T07:43:00.000-07:00</published><updated>2008-10-19T17:24:28.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Notes from </title><content type='html'>From the book &lt;&lt;a href="http://www.amazon.com/Elements-Java-Style-Allan-Vermeulen/dp/0521777682/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1217515582&amp;amp;sr=8-1"&gt;Elements of Java Style&lt;/a&gt;&gt;&lt;br /&gt;&lt;br /&gt;62. Describe why the code is doing what it does, not what the code is doing.&lt;br /&gt;&lt;br /&gt;70. Define subclasses so they may be used anywhere their superclasses may be used.&lt;br /&gt;    The Liskov Substitution Principle&lt;br /&gt;    The Open-Closed Principle&lt;br /&gt;&lt;br /&gt;100. Use lazy initialization&lt;br /&gt;  class PersonalFinance {&lt;br /&gt;      private LoanRateCalculator loan = null;&lt;br /&gt;      public LoanRateCalculator getLoan(){&lt;br /&gt;          if (this.loan == null) {&lt;br /&gt;              this.loan = new LoanRateCalculator();&lt;br /&gt;          }&lt;br /&gt;          return this.loan;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Packaging Conventions&lt;br /&gt;104.Place types that are commonly used, changed, and released together, or&lt;br /&gt;    mutually dependent on each other, into the same package.&lt;br /&gt;  - The Common Reuse Principle&lt;br /&gt;  - The Common Closure Principle&lt;br /&gt;  - The Resue/Release Equivalence Principle&lt;br /&gt;  - The Acyclic Dependencies Principle&lt;br /&gt;&lt;br /&gt;105. Isolate volatile classes and interfaces in separate packages.&lt;br /&gt;    volatile := something likely to change&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-563026865425626352?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/563026865425626352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=563026865425626352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/563026865425626352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/563026865425626352'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/notes-from.html' title='Notes from &lt;Elements of Java Style&gt;'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4656083705901724447</id><published>2008-07-28T21:24:00.001-07:00</published><updated>2009-09-29T01:55:29.965-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Emacs'/><title type='text'>Switching Control and Caps Lock on Windows(For Emacs)</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-family:trebuchet ms,sans-serif;"&gt;I didn't know I can do this till my colleague told me when he saw I'm playing Emacs.&lt;/span&gt; &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;"Your small figure will probably feel bad after you doing too much in Emacs", he said, "Try to switch the Control and Caps Lock."&lt;/span&gt;  &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;Sounds interesting!&lt;/span&gt; &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;I google the solution and it makes life easier in Emacs.&lt;/span&gt;  &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;But not very convenient out of Emacs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:trebuchet ms,sans-serif;" &gt;key points:&lt;/span&gt;  &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;add a new field to &lt;b&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout&lt;/b&gt;&lt;/span&gt; &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;with name&lt;b&gt; :&lt;/b&gt; &lt;b&gt;Scancode Map&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;and type    &lt;b&gt;: &lt;/b&gt;&lt;span style="font-family:trebuchet ms,sans-serif;"&gt;&lt;b&gt;Binary Value &lt;/b&gt;&lt;/span&gt; &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;and value &lt;b&gt; :&lt;/b&gt; &lt;b&gt;00000000 00000000 03000000 3A001D00 1D003A00 00000000&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style="color: rgb(51, 102, 255);"&gt;&lt;a href="http://bitquabit.com/2007/04/switching-control-and-caps-lock-on-windows/"&gt;details&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 102, 102);"&gt;;;; Updated&lt;/span&gt;&lt;br /&gt;use autohotkey turns out to be more convenient. (swap control with Win key)&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;LWin::Control&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;LControl::LWin&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4656083705901724447?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4656083705901724447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4656083705901724447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4656083705901724447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4656083705901724447'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/switching-control-and-caps-lock-on.html' title='Switching Control and Caps Lock on Windows(For Emacs)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6922509380997071805</id><published>2008-07-26T10:24:00.001-07:00</published><updated>2009-09-29T01:55:48.269-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Olympics 2008, Welcome to Beijing</title><content type='html'>&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/1HEndNYVhZo&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/1HEndNYVhZo&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;北京欢迎你&lt;br /&gt;词：林夕 　　曲：小柯&lt;br /&gt;&lt;br /&gt;迎接另一个晨曦，带来全新空气&lt;br /&gt;气息改变情味不变，茶香飘满情谊&lt;br /&gt;我家大门常打开，开放怀抱等你&lt;br /&gt;拥抱过就有了默契，你会爱上这里&lt;br /&gt;不管远近都是客人请不用客气&lt;br /&gt;相约好了在一起，我们欢迎你&lt;br /&gt;我家种着万年青，开放每段传奇&lt;br /&gt;为传统的土壤播种，为你留下回忆&lt;br /&gt;陌生熟悉都是客人请不用拘礼&lt;br /&gt;第几次来没关系，有太多话题&lt;br /&gt;北京欢迎你，为你开天辟地&lt;br /&gt;流动中的魅力充满着朝气&lt;br /&gt;北京欢迎你，在太阳下分享呼吸&lt;br /&gt;在黄土地刷新成绩&lt;br /&gt;我家大门常打开，开怀容纳天地&lt;br /&gt;岁月绽放青春笑容，迎接这个日期&lt;br /&gt;天大地大都是朋友请不用客气&lt;br /&gt;画意诗情带笑意，只为等待你&lt;br /&gt;北京欢迎你 像音乐感动你&lt;br /&gt;让我们都加油去超越自己&lt;br /&gt;北京欢迎你，有梦想谁都了不起&lt;br /&gt;有勇气就会有奇迹&lt;br /&gt;北京欢迎你，为你开天辟地&lt;br /&gt;流动中的魅力充满着朝气&lt;br /&gt;北京欢迎你，在太阳下分享呼吸&lt;br /&gt;在黄土地刷新成绩&lt;br /&gt;北京欢迎你，像音乐感动你&lt;br /&gt;让我们都加油去超越自己&lt;br /&gt;北京欢迎你，有梦想谁都了不起&lt;br /&gt;有勇气就会有奇迹&lt;br /&gt;我家大门常打开 开放怀抱等你&lt;br /&gt;拥抱过就有了默契，你会爱上这里&lt;br /&gt;不管远近都是客人请不用客气&lt;br /&gt;相约好了在一起，我们欢迎你&lt;br /&gt;北京欢迎你 为你开天辟地&lt;br /&gt;流动中的魅力充满着朝气&lt;br /&gt;北京欢迎你，在太阳下分享呼吸&lt;br /&gt;在黄土地刷新成绩&lt;br /&gt;我家大门常打开 开怀容纳天地&lt;br /&gt;岁月绽放青春笑容 迎接这个日期&lt;br /&gt;天大地大都是朋友请不用客气&lt;br /&gt;画意诗情带笑意，只为等待你许茹芸&lt;br /&gt;北京欢迎你，像音乐感动你&lt;br /&gt;让我们都加油去超越自己游鸿明&lt;br /&gt;北京欢迎你，有梦想谁都了不起&lt;br /&gt;有勇气就会有奇迹金海心&lt;br /&gt;北京欢迎你，为你开天辟地&lt;br /&gt;流动中的魅力充满着朝气&lt;br /&gt;北京欢迎你，在太阳下分享呼吸&lt;br /&gt;在黄土地刷新成绩&lt;br /&gt;北京欢迎你，像音乐感动你&lt;br /&gt;让我们都加油去超越自己&lt;br /&gt;北京欢迎你，有梦想谁都了不起&lt;br /&gt;有勇气就会有奇迹付丽珊&lt;br /&gt;北京欢迎你，有梦想谁都了不起&lt;br /&gt;有勇气就会有奇迹&lt;br /&gt;北京欢迎你 有梦想谁都了不起&lt;br /&gt;有勇气就会有奇迹&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6922509380997071805?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6922509380997071805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6922509380997071805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6922509380997071805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6922509380997071805'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/olympics-2008-welcome-to-beijing.html' title='Olympics 2008, Welcome to Beijing'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-7518025008100827095</id><published>2008-07-22T05:36:00.000-07:00</published><updated>2008-07-31T07:32:50.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Vim Commands</title><content type='html'>&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;Select the match in the complete list&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;  CTRL-N / CTRL-P&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Differs from 'j'/'k' when lines wrap&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  map &lt;up&gt; gk&lt;/up&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  map &lt;down&gt; gj&lt;/down&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Option for 'smart search'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  set ignorecase smartcase&lt;br /&gt;&lt;br /&gt;  \C := case sensitive&lt;br /&gt;  \c := case insensitive&lt;br /&gt;&lt;br /&gt;Offsets (when searching)&lt;br /&gt;  /default/2&lt;br /&gt;  /const/b+2&lt;br /&gt;  /const/e+1&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-7518025008100827095?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/7518025008100827095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=7518025008100827095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7518025008100827095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7518025008100827095'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/vim-commands.html' title='Vim Commands'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5821362605677892255</id><published>2008-07-20T20:54:00.001-07:00</published><updated>2009-01-06T06:16:36.351-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Subversion'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Install Subversion in Ubuntu Server</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt;&lt;a href="https://help.ubuntu.com/8.04/serverguide/C/subversion.html"&gt;https://help.ubuntu.com/8.04/serverguide/C/subversion.html&lt;/a&gt;&lt;/span&gt;&lt;br style="font-family: trebuchet ms,sans-serif;"&gt; &lt;br style="font-family: trebuchet ms,sans-serif;"&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt;Enable/Disable Apache Mod:&lt;/span&gt;&lt;br style="font-family: trebuchet ms,sans-serif;"&gt;&lt;span style="font-family: trebuchet ms,sans-serif;"&gt;&amp;nbsp; a2enmod/a2dismod&lt;/span&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5821362605677892255?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5821362605677892255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5821362605677892255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5821362605677892255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5821362605677892255'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/install-subversion-in-ubuntu-server.html' title='Install Subversion in Ubuntu Server'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5246579056850194461</id><published>2008-07-20T05:26:00.001-07:00</published><updated>2008-07-31T07:31:56.940-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>"Instance" an Interface (Java)</title><content type='html'>&lt;div dir="ltr"&gt;&lt;b style="font-family: trebuchet ms,sans-serif;"&gt;It looks like &amp;quot;instance&amp;quot; an Interface...&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 102, 255);"&gt;import static org.junit.Assert.assertTrue;&lt;br&gt; &lt;br&gt;import org.junit.Test;&lt;br&gt;&lt;br&gt;public class InterestingTests {&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;@Test&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public void TestConstructInterface() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TurnstileController controller = new TurnstileController() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; private boolean lockState = false;&lt;br&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; private boolean unlockState = false;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; public void lock() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; lockState = true;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; public void unlock() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; unlockState = true;&lt;br&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean isLockState() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return lockState;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean isUnlockState() {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return unlockState;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; controller.lock();&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertTrue(controller.isLockState());&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; controller.unlock();&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertTrue(controller.isUnlockState());&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;private interface TurnstileController {&lt;br&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void lock();&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void unlock();&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean isLockState();&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean isUnlockState();&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;};&lt;br&gt;&lt;br&gt;}&lt;/span&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 102, 255);"&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5246579056850194461?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5246579056850194461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5246579056850194461' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5246579056850194461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5246579056850194461'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/instance-interface-java.html' title='&quot;Instance&quot; an Interface (Java)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8826337035763983871</id><published>2008-07-17T20:34:00.000-07:00</published><updated>2009-09-29T01:56:20.339-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VirtualBox'/><title type='text'>My Network Config of (Sun)VirtualBox</title><content type='html'>Host: Windows XP&lt;br /&gt;Guest: ubuntu 8.04 Server&lt;br /&gt;&lt;br /&gt;VirtualBox Network Config:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_9WsaZ41Bb4c/SIAQPqyDvJI/AAAAAAAAAu0/BDNnLtTlRrk/s1600-h/VBox_Adapter0.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_9WsaZ41Bb4c/SIAQPqyDvJI/AAAAAAAAAu0/BDNnLtTlRrk/s320/VBox_Adapter0.png" alt="" id="BLOGGER_PHOTO_ID_5224193429118106770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_9WsaZ41Bb4c/SIAQe33nAzI/AAAAAAAAAu8/RGiiljuFLQA/s1600-h/VBox_Adapter1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_9WsaZ41Bb4c/SIAQe33nAzI/AAAAAAAAAu8/RGiiljuFLQA/s320/VBox_Adapter1.png" alt="" id="BLOGGER_PHOTO_ID_5224193690329088818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;ubuntu network config:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_9WsaZ41Bb4c/SIAQt2eoU7I/AAAAAAAAAvE/tWlPA15XVCE/s1600-h/ubuntu_network_config.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_9WsaZ41Bb4c/SIAQt2eoU7I/AAAAAAAAAvE/tWlPA15XVCE/s320/ubuntu_network_config.PNG" alt="" id="BLOGGER_PHOTO_ID_5224193947653919666" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;Why eth1 has address 169.254.4.130 ?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;Actually it depends. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;Start the VirtualBox with two network adapters and check all IP address in your host.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;You'll see the IP address of the adapter for VirtualBox, then set the eth1 IP address accordingly.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8826337035763983871?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8826337035763983871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8826337035763983871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8826337035763983871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8826337035763983871'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/my-network-config-of-sunvirtualbox.html' title='My Network Config of (Sun)VirtualBox'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_9WsaZ41Bb4c/SIAQPqyDvJI/AAAAAAAAAu0/BDNnLtTlRrk/s72-c/VBox_Adapter0.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2989486453098187066</id><published>2008-07-16T17:25:00.001-07:00</published><updated>2009-09-29T01:51:44.089-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Subversion'/><title type='text'>Install SVN as Windows Service</title><content type='html'>&lt;div dir="ltr" style="font-family: courier new,monospace; font-style: italic; color: rgb(17, 153, 204);"&gt;sc create svn binpath= "\"C:\svn-win32-1.4.4\bin\svnserve.exe\" --service -r C:\Workspace\SVN\repos" displayname= "Subversion Server" depend= Tcpip start= auto&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:courier new,monospace;"&gt;net start svn&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2989486453098187066?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2989486453098187066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2989486453098187066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2989486453098187066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2989486453098187066'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/install-svn-as-windows-service.html' title='Install SVN as Windows Service'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-798342147652688865</id><published>2008-07-16T06:33:00.001-07:00</published><updated>2008-07-16T06:36:17.354-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Something in Generic Programming</title><content type='html'>&lt;div dir="ltr"&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms,sans-serif;" &gt;-- difference between raw type list and wildcard type list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms,sans-serif;"&gt;You can put any element into a collection with a raw type, easily corrupting the collections type invariant.&lt;/span&gt;  &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;you cant put any element(other than null) into a Collection&amp;lt;?&amp;gt;. Attempting to do so will generate a compile-time error message.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms,sans-serif;" &gt;-- parametrized types are invariant. &lt;/span&gt; &lt;span style="font-family:trebuchet ms,sans-serif;"&gt;&lt;br /&gt;In other words, for any two distinct types Type1 and Type2, List&amp;lt;Type1&amp;gt; is either a subtype nor a supertype of List&amp;lt;Type2&amp;gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://flooyd-appenginee.googlecode.com/svn/trunk/java/Item23.java"&gt;test class in java&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-798342147652688865?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/798342147652688865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=798342147652688865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/798342147652688865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/798342147652688865'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/something-in-generic-programming.html' title='Something in Generic Programming'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5561338402608314393</id><published>2008-07-11T03:50:00.000-07:00</published><updated>2008-10-19T17:26:46.842-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Simple Sample of Regular Expression in Python</title><content type='html'>import re&lt;br /&gt;&lt;br /&gt;def read_file():&lt;br /&gt;file_name = 'merge.log'&lt;br /&gt;file = open(file_name, 'r')&lt;br /&gt;file_content = file.read()&lt;br /&gt;patterns = re.compile(r'(r\d{5}\s\|\scn-cma)(.*(?!cn-cma).*)(r\d{5}\s\|\s(?!cn-cma))', re.DOTALL)&lt;br /&gt;results = patterns.search(file_content)&lt;br /&gt;#results = patterns.match(file_content)&lt;br /&gt;print dir(results)&lt;br /&gt;if results :&lt;br /&gt;    results = results.groups()&lt;br /&gt;    print results[0]&lt;br /&gt;    def display(x):&lt;br /&gt;        print '$' * 50, '\n', x&lt;br /&gt;    #[ display(x) for x in results ]&lt;br /&gt;file.close()&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;merge.log&lt;/h4&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5561338402608314393?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5561338402608314393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5561338402608314393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5561338402608314393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5561338402608314393'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/simple-sample-of-regular-expression-in.html' title='Simple Sample of Regular Expression in Python'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1932072868242801709</id><published>2008-07-07T20:16:00.000-07:00</published><updated>2008-10-19T17:26:04.434-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Interview'/><title type='text'>JSE5, New Language Features Introduce by Joshua Bloch</title><content type='html'>&lt;span style="font-family:times new roman,serif;"&gt;(For me), it's a good overview introduce of JSE5 new feature.&lt;/span&gt; &lt;span style="font-family:times new roman,serif;"&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/features/2003/05/bloch_qa.html"&gt;http://java.sun.com/features/2003/05/bloch_qa.html&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:times new roman,serif;"&gt;Any other advance articles?&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1932072868242801709?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1932072868242801709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1932072868242801709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1932072868242801709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1932072868242801709'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/jse5-new-language-features-introduce-by.html' title='JSE5, New Language Features Introduce by Joshua Bloch'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6962427366602181768</id><published>2008-07-05T08:19:00.001-07:00</published><updated>2008-07-05T08:20:05.305-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Clean Up Ubuntu Grub Menu after Updates</title><content type='html'>&lt;font size="2"&gt;&lt;span style="font-family: times new roman,serif;"&gt;change the file: /boot/grub/menu.lst&lt;/span&gt;&lt;br style="font-family: times new roman,serif;"&gt;&lt;br style="font-family: times new roman,serif;"&gt;&lt;a style="font-family: times new roman,serif;" href="http://www.howtogeek.com/howto/ubuntu/clean-up-ubuntu-grub-boot-menu-after-upgrades/"&gt;details here&lt;/a&gt;&lt;/font&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6962427366602181768?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6962427366602181768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6962427366602181768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6962427366602181768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6962427366602181768'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/clean-up-ubuntu-grub-menu-after-updates.html' title='Clean Up Ubuntu Grub Menu after Updates'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3886403509920496314</id><published>2008-07-02T04:56:00.001-07:00</published><updated>2008-11-23T17:23:21.816-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Links for Blackberry</title><content type='html'>&lt;div class="gmail_quote"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;gmail&lt;/span&gt; :  &lt;a href="http://gmail.com/app" target="_blank"&gt;http://gmail.com/app&lt;/a&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;miniopera&lt;/span&gt; : &lt;a href="http://mini.opera.com/" target="_blank"&gt;http://mini.opera.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update System&lt;br /&gt;0. &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;prerequisites&lt;/span&gt;&lt;br /&gt;1. rename/rm Vendor.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;xml&lt;/span&gt; in "program files"/"Common Files"/"Research In Motion"/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;AppLoader&lt;/span&gt;&lt;br /&gt;2. loader.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;exe&lt;/span&gt; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;nojvm&lt;/span&gt; will start the application installation.&lt;br /&gt;&lt;blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"&gt;  &lt;/blockquote&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3886403509920496314?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3886403509920496314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3886403509920496314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3886403509920496314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3886403509920496314'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/links-for-blackberry.html' title='Links for Blackberry'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5359998476672169541</id><published>2008-07-01T06:08:00.001-07:00</published><updated>2008-07-05T08:20:22.708-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>Lexically Function Scrop</title><content type='html'>&lt;span style="font-family: verdana,sans-serif;"&gt;The following definition help to understand why need closure implement in JavaScript.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;b style="font-family: verdana,sans-serif;"&gt;Functions in JavaScript are lexically rather than dynamically scoped. This means that they run in the scope in which they are defined, not the scope from which they are executed.&lt;/b&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5359998476672169541?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5359998476672169541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5359998476672169541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5359998476672169541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5359998476672169541'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/07/lexically-function-scrop.html' title='Lexically Function Scrop'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2719679823911128033</id><published>2008-06-18T07:08:00.001-07:00</published><updated>2008-06-18T07:10:09.264-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>VIM Commands</title><content type='html'>&lt;span style="font-family: courier new,monospace;"&gt;command line editing:&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; &amp;lt;C-Left&amp;gt;, &amp;lt;C-Rigth&amp;gt;, &amp;lt;C-B&amp;gt;, &amp;lt;C-E&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; # also work in the insert model&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; &amp;lt;C-W&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; := Delete a word&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; &amp;lt;C-U&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; := Remove all texts&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;b style="font-family: courier new,monospace;"&gt;command line complete&lt;/b&gt;&lt;span style="font-family: courier new,monospace;"&gt;:&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; tab, &amp;lt;C-P&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; &amp;lt;C-D&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; := list match&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; q:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; := open command window&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;br style="font-family: courier new,monospace;"&gt;&lt;b style="font-family: courier new,monospace;"&gt;Session:&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; :mksession vimbook.vim&amp;nbsp;&amp;nbsp;&amp;nbsp; := create a session&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; :source vimbook.vim&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; := restore a session&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; vim -S vimbook.vim&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; := open vim with session&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;br style="font-family: courier new,monospace;"&gt;&lt;b style="font-family: courier new,monospace;"&gt;Explore files:&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; :e .&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; type &amp;lt;ENTER&amp;gt; to open file&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; &amp;lt;C-O&amp;gt; or :edit . to return back&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; o, i, s, x, r&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;b style="font-family: courier new,monospace;"&gt;Find a file:&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; set path+=./Workspace&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; :sfind **/svn_tool.py&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;br style="font-family: courier new,monospace;"&gt;&lt;b style="font-family: courier new,monospace;"&gt;Completing Specific Items(X Model):&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; C-X C-F :=&amp;nbsp;&amp;nbsp;&amp;nbsp; file names&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; C-X C-L :=&amp;nbsp;&amp;nbsp;&amp;nbsp; whole lines&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; C-X C-V :=&amp;nbsp;&amp;nbsp;&amp;nbsp; Vim command line&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; C-X C-O :=&amp;nbsp;&amp;nbsp;&amp;nbsp; Omni complete(Complete in source code, similar with C-SPACE in Eclipse)&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; C-X C-E&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; C-X C-Y :=&amp;nbsp;&amp;nbsp;&amp;nbsp; insert model scroll&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;b style="font-family: courier new,monospace;"&gt;Digraphs:&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; :digraphs&amp;nbsp; :=&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Special characters that are not on keyboard&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;b style="font-family: courier new,monospace;"&gt;Normal mode commands:&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;&amp;nbsp; execute any Normal model command from Insert mode by using &amp;lt;C-O&amp;gt; {command}&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2719679823911128033?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2719679823911128033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2719679823911128033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2719679823911128033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2719679823911128033'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/06/vim-commands.html' title='VIM Commands'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2539392235338609289</id><published>2008-05-21T22:16:00.001-07:00</published><updated>2008-06-18T07:10:09.264-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>HighLight Current Line in GVim 7</title><content type='html'>&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;augroup vim7highlightCurrentLineInActiveWindow&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp; au WinEnter * if g:HighlightCurrentLine | setlocal cul | endif&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp; au WinLeave * if g:HighlightCurrentLine | setlocal nocul | endif&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;augroup end&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;function! s:ToggleHighlightCurrentLine()&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp; if !exists(&amp;#39;g:HighlightCurrentLine&amp;#39;) || g:HighlightCurrentLine==0&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setlocal cul&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let g:HighlightCurrentLine=1&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp; else&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setlocal nocul&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let g:HighlightCurrentLine=0&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&amp;nbsp; endif&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;endfunction&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;command! ToggleHighlightCurrentLine :call &amp;lt;sid&amp;gt;ToggleHighlightCurrentLine()&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(0, 0, 153);"&gt;call &amp;lt;sid&amp;gt;ToggleHighlightCurrentLine()&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;br&gt;&lt;b&gt;&lt;a href="http://vim.wikia.com/wiki/VimTip769"&gt;More information.&lt;/a&gt;&lt;/b&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2539392235338609289?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2539392235338609289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2539392235338609289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2539392235338609289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2539392235338609289'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/05/highlight-current-line-in-gvim-7.html' title='HighLight Current Line in GVim 7'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5583560210024484777</id><published>2008-05-13T06:55:00.001-07:00</published><updated>2008-05-13T06:58:21.494-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Set External Diff of SVN as gvimdiff (ubuntu)</title><content type='html'>&lt;b&gt;SVN Config:&amp;nbsp; /etc/subversion/config&lt;/b&gt;&lt;br&gt;&amp;nbsp; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;diff-cmd = /home/username/diffwrap.sh&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;diffwrap.sh (make sure it&amp;#39;s executable.)&lt;/b&gt;&lt;br&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;#!/bin/sh&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# Configure your favorite diff program here.&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;DIFF=&amp;quot;/usr/bin/gvimdiff&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# Subversion provides the paths we need as the sixth and seventh &lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# parameters.&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;LEFT=${6}&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;RIGHT=${7}&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# Call the diff command (change the following line to make sense for&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# your merge program).&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;&lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;$DIFF $LEFT $RIGHT&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# Return an errorcode of 0 if no differences were detected, 1 if some were.&lt;/span&gt;&lt;br style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt; &lt;span style="font-family: courier new,monospace; color: rgb(51, 51, 255);"&gt;# Any other errorcode will be treated as fatal.&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5583560210024484777?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5583560210024484777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5583560210024484777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5583560210024484777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5583560210024484777'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/05/set-external-diff-of-svn-as-gvimdiff_13.html' title='Set External Diff of SVN as gvimdiff (ubuntu)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3046806112185367336</id><published>2008-05-12T20:44:00.001-07:00</published><updated>2008-06-29T07:04:48.779-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Set External Diff of SVN as gvimdiff (Windows)</title><content type='html'>&lt;b&gt;svn config (usually in: c:\Document and Settings\Application\Subversion\config)&lt;/b&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 153);font-family:courier new,monospace;" &gt;diff-cmd = c:/diffwrap.bat&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;c:/diffwrap.bat&lt;/b&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;@ECHO OFF&lt;/span&gt; &lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;REM Configure your favorite diff program here.&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;SET DIFF="C:\Program Files\Vim\vim71\gvim.exe"&lt;/span&gt;   &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;REM Subversion provides the paths we need as the sixth and seventh &lt;/span&gt;  &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;REM parameters.&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;SET LEFT=%6&lt;/span&gt;  &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;SET RIGHT=%7&lt;/span&gt;   &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;REM Call the diff command (change the following line to make sense for&lt;/span&gt;  &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;REM your merge program).&lt;/span&gt; &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;%DIFF% -d %LEFT% %RIGHT%&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;REM Return an errorcode of 0 if no differences were detected, 1 if some were.&lt;/span&gt;  &lt;span style="color: rgb(51, 51, 255);font-family:courier new,monospace;" &gt;&lt;br /&gt;REM Any other errorcode will be treated as fatal.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: arial; color: rgb(0, 0, 0);"&gt;vim diff option&lt;/span&gt;&lt;br /&gt;set diffopt+=iwhite&lt;br /&gt;set diffopt+=horizontal&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3046806112185367336?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3046806112185367336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3046806112185367336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3046806112185367336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3046806112185367336'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/05/set-external-diff-of-svn-as-gvimdiff.html' title='Set External Diff of SVN as gvimdiff (Windows)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5782249588409225005</id><published>2008-05-05T01:32:00.001-07:00</published><updated>2009-09-29T01:52:08.143-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>An Abstract Class when using DBUnit</title><content type='html'>&lt;a href="http://freizl.googlepages.com/AbstractDBUnitTestCase.java"&gt;http://sites.google.com/site/freizl/Home/java-code/sampledbunittest&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5782249588409225005?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5782249588409225005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5782249588409225005' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5782249588409225005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5782249588409225005'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/05/abstract-class-when-using-dbunit.html' title='An Abstract Class when using DBUnit'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8972701991669103844</id><published>2008-04-27T22:36:00.001-07:00</published><updated>2008-05-12T20:52:07.263-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Concert by Secret Garden</title><content type='html'>For me, they are awesome!&lt;br&gt;I know the Secret Garden almost ten years ago. I&amp;#39;m really being attractive by their music for long period.&lt;br&gt;And I couldn&amp;#39;t image I can ever get a chance to enjoy their music in live.&lt;br&gt; As Sherry said, even we are speaking in different language, but tonight we communicate with music.&lt;br&gt;&lt;br&gt;Last Saturday, I spend several hours having a quick practice the Django, which is a web framework wrote in Python.&lt;br&gt; The documents in the home site it good. It didn&amp;#39;t take me much time to set up the environment.&lt;br&gt;As I already have Apache and MySQL installed, I just need the related python mod.&lt;br&gt;Then downloaded the latest DJango stable package, installed and started the embed server. That&amp;#39;s it.&lt;br&gt; Also I tried the simple sample in the &amp;quot;get start&amp;quot; document.&lt;br&gt;But till now, I can&amp;#39;t see any benefits by using Django and Python to build a web app.&lt;br&gt;Comparing with Java, it turns out to be much simpler, but not with Groovy and PHP.&lt;br&gt; As for keeping learning the Python, I probably want to take a look into the CMS project &lt;a href="http://www.pylucid.org/"&gt;PyLucid&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8972701991669103844?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8972701991669103844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8972701991669103844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8972701991669103844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8972701991669103844'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/04/concert-by-secret-garden.html' title='Concert by Secret Garden'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8033865651335408431</id><published>2008-04-17T05:50:00.001-07:00</published><updated>2009-09-29T01:51:58.027-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Quotes from Pragmatic Programming</title><content type='html'>&lt;span style="font-family: verdana,sans-serif;"&gt;Tip4: Don&amp;#39;t live with Broken Windows&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;....You may be thinking that no one has the time to go around cleaning up all the broken glass of a project. If you continue to think like that, then you&amp;#39;d better plan on getting a dumpster, or moving to another neighborhood. Don&amp;#39;t let entropy win.&amp;quot;&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Tip5: Be a catalyst for Change&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [The stone soup story]&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Basically I think I experience the negative thing which is described in the Tip4.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;Looks like interesting and I need to think about doing better thing.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8033865651335408431?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8033865651335408431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8033865651335408431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8033865651335408431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8033865651335408431'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/04/quotes-from-pragmatic-programming.html' title='Quotes from Pragmatic Programming'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3209622440245126828</id><published>2008-04-16T07:56:00.001-07:00</published><updated>2008-05-12T20:51:36.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Install Taglist Vim plugin</title><content type='html'>Home Page: &lt;a href="http://vim-taglist.sourceforge.net/"&gt;http://vim-taglist.sourceforge.net/&lt;/a&gt;&lt;br&gt;Installation: &lt;a href="http://vim-taglist.sourceforge.net/installation.html"&gt;http://vim-taglist.sourceforge.net/installation.html&lt;/a&gt;&lt;br&gt; &lt;br&gt;The _vimrc setting for taglist:&lt;br&gt;&lt;b&gt;&lt;span style="font-family: courier new,monospace;"&gt;filetype on&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;let Tlist_Ctags_Cmd = &amp;#39;C:\MyWorkplace\ctags57\ctags.exe&amp;#39;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;let Tlist_Exit_OnlyWindow = 1&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;let Tlist_Sort_Type = &amp;quot;name&amp;quot;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;span style="font-family: courier new,monospace;"&gt;nnoremap &amp;lt;silent&amp;gt; &amp;lt;F8&amp;gt; :TlistToggle&amp;lt;CR&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;&amp;quot; Shortcut for switch between split windows quickly&lt;br&gt; nnoremap H &amp;lt;C-W&amp;gt;&amp;lt;C-H&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt;&lt;span style="font-family: courier new,monospace;"&gt;nnoremap L &amp;lt;C-W&amp;gt;&amp;lt;C-L&amp;gt;&lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;/b&gt;&amp;nbsp;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3209622440245126828?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3209622440245126828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3209622440245126828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3209622440245126828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3209622440245126828'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/04/install-taglist-vim-plugin.html' title='Install Taglist Vim plugin'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3258701000069093668</id><published>2008-04-16T06:57:00.001-07:00</published><updated>2008-04-16T06:57:06.918-07:00</updated><title type='text'>Java and Modern Web</title><content type='html'>&lt;a href="http://andigutmans.blogspot.com/2008/03/java-is-losing-battle-for-modern-web.html"&gt;http://andigutmans.blogspot.com/2008/03/java-is-losing-battle-for-modern-web.html&lt;/a&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3258701000069093668?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3258701000069093668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3258701000069093668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3258701000069093668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3258701000069093668'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/04/java-and-modern-web.html' title='Java and Modern Web'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1857921866143935625</id><published>2008-04-14T06:27:00.001-07:00</published><updated>2008-05-12T20:51:26.541-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Virtual Community</title><content type='html'>&lt;br&gt;  &lt;table height="100%"&gt;&lt;/table&gt;Several days ago,I started to &amp;quot;live&amp;quot; in the Facebook and Douban(CN), which are both so called virtual community as far as I know.&lt;br&gt;It&amp;#39;s even interesting to myself why I got a idea to start to experience those sites.&lt;br&gt; The Douban is ok and it&amp;#39;s all about sharing informations on books, music and movies.&lt;br&gt;And several other sections, like blog and &amp;#39;Channels&amp;#39;&amp;nbsp; provide many things as well.&lt;br&gt;The Facebook turns out to be COOL! I met several colleagues and looks like there will be more interesting things.&lt;br&gt; &lt;br&gt;My Facebook Profile: Simon Wu&lt;br&gt;My Douban: 海生&lt;br&gt;Email: &lt;a href="mailto:freizl@gmail.com"&gt;freizl@gmail.com&lt;/a&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1857921866143935625?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1857921866143935625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1857921866143935625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1857921866143935625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1857921866143935625'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/04/virtual-community.html' title='Virtual Community'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6303886324008035343</id><published>2008-04-03T20:34:00.000-07:00</published><updated>2008-04-03T20:41:44.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>map, iterate function list, time in python</title><content type='html'>&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;from __future__ import division&lt;br /&gt;&lt;br /&gt;def prime1(y):&lt;br /&gt;    if y &lt;= 1:&lt;br /&gt;        print y, 'not prime'&lt;br /&gt;    else:&lt;br /&gt;        x = y // 2&lt;br /&gt;        while x &gt; 1:&lt;br /&gt;            if y % x == 0:&lt;br /&gt;                retValue = y, 'has factor', x&lt;br /&gt;                break&lt;br /&gt;            x -= 1&lt;br /&gt;        else:&lt;br /&gt;            retValue = y, 'is prime'&lt;br /&gt;&lt;br /&gt;def timer(reps, func, *args):&lt;br /&gt;    import time&lt;br /&gt;    start = time.clock()&lt;br /&gt;    for i in xrange(reps):&lt;br /&gt;        map(func, args)&lt;br /&gt;    return time.clock() - start&lt;br /&gt;&lt;br /&gt;for func in (prime1,):&lt;br /&gt;    print timer(10000, func, 12,15,18,20,22,30)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;download &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://freizl.googlepages.com/prime.py"&gt;file&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6303886324008035343?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6303886324008035343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6303886324008035343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6303886324008035343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6303886324008035343'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/04/map-iterate-function-list-time-in.html' title='map, iterate function list, time in python'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8956779790557867353</id><published>2008-03-22T23:46:00.000-07:00</published><updated>2009-09-29T01:56:45.937-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wiki'/><title type='text'>Mirro the Wikipedia at your local</title><content type='html'>sudo apt-get update&lt;br /&gt;sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server mysql-client php5-mysql phpmyadmin&lt;br /&gt;mkdir ~/wiki/&lt;br /&gt;cd ~/wiki/&lt;br /&gt;wget http://download.wikimedia.org/mediawiki/1.10/mediawiki-1.10.0.tar.gz&lt;br /&gt;sudo mkdir /var/www/w/&lt;br /&gt;sudo tar xzf mediawiki-1.10.0.tar.gz -C /var/www/&lt;br /&gt;cd /var/www/mediawiki-1.10.0/&lt;br /&gt;sudo chmod a+x config&lt;br /&gt;&lt;br /&gt;$ mysql&lt;br /&gt;mysql&gt; USE mysql;&lt;br /&gt;mysql&gt; UPDATE user SET Password=PASSWORD(’new-password’) WHERE user=’root’;&lt;br /&gt;mysql&gt; FLUSH PRIVILEGES;&lt;br /&gt;&lt;br /&gt;add user 'wikiuser' and database 'wikidb' and set privileges &lt;br /&gt;&lt;br /&gt;wget http://download.wikimedia.org/enwiki/20070402/enwiki-20070402-pages-articles.xml.bz2&lt;br /&gt;bunzip2 -k enwiki-20070402-pages-articles.xml.bz2&lt;br /&gt;wget http://modzer0.cs.uaf.edu/~dev2c/mwimport.sh (OR http://freizl.googlepages.com/mwimport.sh)&lt;br /&gt;chmod +x mwimport.sh&lt;br /&gt;&lt;br /&gt;increase Default_Allowed_Packet for MySQL in MySQL configurate file&lt;br /&gt;cat enwiki-20070402-pages-articles.xml | ./mwimport.sh | mysql -f -uwikiuser -ppassword wikidb&lt;br /&gt;&lt;br /&gt;refreshLinks: php mediawiki/maintenance/refresheLinks.php (Not sure if it is necessary.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="http://modzer0.cs.uaf.edu/%7Edev2c/wiki/How_to_mirror_Wikipedia"&gt;Detail Infor.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8956779790557867353?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8956779790557867353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8956779790557867353' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8956779790557867353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8956779790557867353'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/03/mirro-wikipedia-at-your-local.html' title='Mirro the Wikipedia at your local'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6590732515360015401</id><published>2008-03-20T06:08:00.001-07:00</published><updated>2008-03-20T06:10:34.759-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Static Field/Method, Initialization Block Cont. (Java Disassemble)</title><content type='html'>Disassembles class files:&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;javap -c BaseObject&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6590732515360015401?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6590732515360015401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6590732515360015401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6590732515360015401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6590732515360015401'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/03/static-fieldmethod-initialization-block_3944.html' title='Static Field/Method, Initialization Block Cont. (Java Disassemble)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5591276568054141</id><published>2008-03-20T06:08:00.000-07:00</published><updated>2008-03-20T06:10:20.131-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Static Field/Method, Initialization Block Cont. (Java Disassemble)</title><content type='html'>Disassembles class files:&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;javap -c BaseObject&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5591276568054141?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5591276568054141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5591276568054141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5591276568054141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5591276568054141'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/03/static-fieldmethod-initialization-block_20.html' title='Static Field/Method, Initialization Block Cont. (Java Disassemble)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2564296291513777785</id><published>2008-03-19T19:14:00.001-07:00</published><updated>2008-08-24T20:13:45.610-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Static Field/Method, Initialization Block Cont. (After compile)</title><content type='html'>package com.foo;&lt;br /&gt;&lt;br /&gt;import java.io.PrintStream;&lt;br /&gt;import org.apache.commons.lang.builder.ReflectionToStringBuilder;&lt;br /&gt;&lt;br /&gt;public class BaseObject&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    private static long second = 0L;&lt;br /&gt;    private String name;&lt;br /&gt;&lt;br /&gt;    public BaseObject()&lt;br /&gt;    {&lt;br /&gt;        name = "";&lt;br /&gt;        System.out.println("I am class block initialization.");&lt;br /&gt;        second++;&lt;br /&gt;        System.out.println("I am constructor.");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public BaseObject(String name)&lt;br /&gt;    {&lt;br /&gt;        &lt;a href="http://this.name/"&gt;this.name&lt;/a&gt; = "";&lt;br /&gt;        System.out.println("I am class block initialization.");&lt;br /&gt;        &lt;a href="http://this.name/"&gt;this.name&lt;/a&gt; = name;&lt;br /&gt;        second++;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String getName()&lt;br /&gt;    {&lt;br /&gt;        return name;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void setName(String name)&lt;br /&gt;    {&lt;br /&gt;        &lt;a href="http://this.name/"&gt;this.name&lt;/a&gt; = name;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static long getSecond()&lt;br /&gt;    {&lt;br /&gt;        return second;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void setSecond(long second)&lt;br /&gt;    {&lt;br /&gt;        second = second;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String toString()&lt;br /&gt;    {&lt;br /&gt;        return ReflectionToStringBuilder.toString(this);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String args[])&lt;br /&gt;    {&lt;br /&gt;        System.out.println(getSecond());&lt;br /&gt;        BaseObject bo1 = new BaseObject("First One");&lt;br /&gt;        BaseObject bo2 = new BaseObject("Seconde One");&lt;br /&gt;        BaseObject bo3 = new BaseObject("Third One");&lt;br /&gt;        System.out.println((new StringBuilder()).append(bo1).append("__").append(getSecond()).toString());&lt;br /&gt;        System.out.println((new StringBuilder()).append(bo2).append("__").append(getSecond()).toString());&lt;br /&gt;        System.out.println((new StringBuilder()).append(bo3).append("__").append(getSecond()).toString());&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    static&lt;br /&gt;    {&lt;br /&gt;        System.out.println("I am static block initialization.");&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2564296291513777785?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2564296291513777785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2564296291513777785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2564296291513777785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2564296291513777785'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/03/static-fieldmethod-initialization-block_19.html' title='Static Field/Method, Initialization Block Cont. (After compile)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2204325353036327992</id><published>2008-03-19T19:12:00.001-07:00</published><updated>2008-08-24T20:14:48.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Static Field/Method, Initialization Block (Java)</title><content type='html'>&lt;span style="font-family:courier new,monospace;"&gt;package com.foo;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;import org.apache.commons.lang.builder.ReflectionToStringBuilder;&lt;/span&gt;   &lt;span style="font-family:courier new,monospace;"&gt;public class BaseObject {&lt;/span&gt;   &lt;span style="font-family:courier new,monospace;"&gt;    /** a static field; all object of this class share this variable. */&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    private static long second = 0;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    private String name = "";&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println("I am class block initialization.");&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    static {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println("I am static block initialization.");&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    public BaseObject() {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        super();&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        second++;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println("I am constructor.");&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    public BaseObject(String name) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        super();&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        &lt;a href="http://this.name/"&gt;this.name&lt;/a&gt; = name;&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        second++;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    public String getName() {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        return name;&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    public void setName(String name) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        &lt;a href="http://this.name/"&gt;this.name&lt;/a&gt; = name;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    public static long getSecond() {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        return second;&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt;   &lt;span style="font-family:courier new,monospace;"&gt;    public static void setSecond(long second) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        BaseObject.second = second;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    @Override&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    public String toString() {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        // jakarta lang toString utility&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        return ReflectionToStringBuilder.toString(this);&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    public static void main(String[] args) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println(BaseObject.getSecond());&lt;/span&gt;   &lt;span style="font-family:courier new,monospace;"&gt;        BaseObject bo1 = new BaseObject("First One");&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        BaseObject bo2 = new BaseObject("Seconde One");&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        BaseObject bo3 = new BaseObject("Third One");&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println(bo1 + "__" + BaseObject.getSecond());&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println(bo2 + "__" + BaseObject.getSecond());&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        System.out.println(bo3 + "__" + BaseObject.getSecond());&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    }&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;    // expected result:&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    /*&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;         I am static block initialization.&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        0&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        I am class block initialization.&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        I am class block initialization.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        I am class block initialization.&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        com.foo.BaseObject@19821f[name=First One]__3&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;        com.foo.BaseObject@190d11[name=Seconde One]__3&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;        com.foo.BaseObject@a90653[name=Third One]__3 &lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;     */&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2204325353036327992?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2204325353036327992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2204325353036327992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2204325353036327992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2204325353036327992'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/03/static-fieldmethod-initialization-block.html' title='Static Field/Method, Initialization Block (Java)'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2565199365388451212</id><published>2008-03-19T19:09:00.001-07:00</published><updated>2008-03-20T02:32:41.055-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Vim commands</title><content type='html'>-----------------------------------------------------------------------------------------------&lt;br /&gt;" could be in startup setting&lt;br /&gt;:ab MAA multiAccountAlert             # define a abbreviations&lt;br /&gt;:map &amp;lt;F7&amp;gt; :w!&amp;lt;CR&amp;gt;        # define a shortcut&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;" useful tips&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&amp;lt;C-V&amp;gt;&lt;/span&gt; then select "column(s)" with motion commands (&lt;span style="color: rgb(51, 102, 255);"&gt;win32 &amp;lt;C-Q&amp;gt;&lt;/span&gt;)&lt;br /&gt;&amp;lt;C-R&amp;gt;&amp;lt;C-W&amp;gt; : pull word under the cursor into a command line or search; &lt;span style="font-family:verdana;"&gt;i.e&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;: &amp;lt;ESA&amp;gt; -&amp;gt; / -&amp;gt; then this command&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;C-R&amp;gt;&amp;lt;C-A&amp;gt; : pull WORD under the cursor into a command line or search&lt;br /&gt;&lt;br /&gt;:n1,n2 d     # delete content between line n1 and n2&lt;br /&gt;:n1,n2 co n3   #copy content between line n1 and n2 under line n3&lt;br /&gt;:n1,n2 move n3   # move content&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;&lt;a href="http://www.gorillacodes.com/2007/12/25/recording-macros-in-vim/"&gt;recording macro in VIM&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2565199365388451212?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2565199365388451212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2565199365388451212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2565199365388451212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2565199365388451212'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/03/vim-commands.html' title='Vim commands'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6366631153780604965</id><published>2008-02-27T20:27:00.001-08:00</published><updated>2008-03-13T18:55:19.286-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Back to Hangzhou</title><content type='html'>At this moment...what can I recall about those two months...&lt;br&gt;&lt;br&gt;And we are leaving at 4 AM and arrive at Shanghai at 6pm.&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6366631153780604965?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6366631153780604965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6366631153780604965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6366631153780604965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6366631153780604965'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/02/back-to-hangzhou.html' title='Back to Hangzhou'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8869365987707774258</id><published>2008-01-31T23:01:00.000-08:00</published><updated>2008-03-13T18:55:28.068-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Runnning Warcraft 3 in Widescreen</title><content type='html'>&lt;span style=";font-family:verdana;font-size:100%;"  &gt;START &gt; run &gt; regedit&lt;br /&gt;locate to:&lt;br /&gt;HKEY_CURRENT_USER &gt; Software &gt; Blizzard Entertainment &gt; Warcraft III &gt; Video&lt;br /&gt;&lt;br /&gt;Make below change in decimal format:&lt;br /&gt;(Right click &gt; Change &gt; select "decimal" &gt; fill in new value)&lt;br /&gt;resheight = 1600&lt;br /&gt;reswidth = 900&lt;br /&gt;&lt;br /&gt;Replace width &amp;amp; height with whatever resolution you wanna play in, examples:&lt;br /&gt;1280x720  16:9 Widescreen&lt;br /&gt;1440x900   16:10 Widescreen&lt;br /&gt;1680x1050  16:10 Widescreen&lt;br /&gt;1920x1200  16:10 Widescreen&lt;br /&gt;&lt;br /&gt;&lt;a style="color: rgb(51, 51, 255); font-weight: bold;" href="http://warcraft.freakygaming.com/tutorials/running_warcraft_3_in_widescreen.html"&gt;For Details&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8869365987707774258?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8869365987707774258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8869365987707774258' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8869365987707774258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8869365987707774258'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/runnning-warcraft-3-in-widescreen.html' title='Runnning Warcraft 3 in Widescreen'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4952443133527861024</id><published>2008-01-27T15:59:00.001-08:00</published><updated>2009-09-29T01:54:02.969-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webwork'/><title type='text'>Custom WebWork Result Type</title><content type='html'>&lt;span style="font-family:verdana,sans-serif;"&gt;add following to a xwork.xml config file:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;&amp;lt;result-types&amp;gt;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;   &amp;lt;result-type name="mydispatch" class="com.company.portal.util.MyDispatch" default="true"/&amp;gt;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;   &amp;lt;result-type name="my2dispatch" class="MyDispatch" default="true"/&amp;gt;&amp;lt;!-- spring wire bean --&amp;gt;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;&amp;lt;/result-types&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana,sans-serif;"&gt;use this custom type in the action:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;&amp;lt;action name="&lt;/span&gt;&lt;span style="font-family:courier new,monospace;"&gt;mydispatch&lt;/span&gt;&lt;span style="font-family:courier new,monospace;"&gt;" class="myPackage.barAction"&amp;gt;&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;    &amp;lt;result&amp;gt;foo.jsp&amp;lt;/result&amp;gt;&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;&amp;lt;/action&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana,sans-serif;"&gt;Actually can simply extend a webwork predefined resulttype for some purpose and override the &lt;span style="font-family:courier new,monospace;"&gt;conditionalParse &lt;/span&gt;and return a final location for the action.&lt;/span&gt;   &lt;span style="font-family:verdana,sans-serif;"&gt;major methods in &lt;span style="font-family:courier new,monospace;"&gt;WebWorkSupport.java&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,monospace;"&gt;/**&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* Implementation of the execute method from the Result interface. This will call&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;* the abstract method {@link #doExecute(String, ActionInvocation)} after optionally evaluating the&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* location as an OGNL evaluation.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;*&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* @param invocation the execution state of the action.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;* @throws Exception if an error occurs while executing the result.&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;*/&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;public void execute(ActionInvocation invocation) throws Exception {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;  doExecute(conditionalParse(location, invocation), invocation);&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;   &lt;span style="font-family:courier new,monospace;"&gt;protected String conditionalParse(String param, ActionInvocation invocation) {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;if (parse &amp;amp;&amp;amp; param != null &amp;amp;&amp;amp; invocation != null) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;  return TextParseUtil.translateVariables(param, invocation.getStack(),&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;  new TextParseUtil.ParsedValueEvaluator() {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;  public Object evaluate(Object parsedValue) {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;  if (encode) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;  if (parsedValue != null) {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;  try {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;  // use UTF-8 as this is the recommended encoding by W3C to&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;  // avoid incompatibilities.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;  return URLEncoder.encode(parsedValue.toString(), "UTF-8");&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;&lt;span style="font-family:courier new,monospace;"&gt;catch(UnsupportedEncodingException e) {&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;_log.warn("error while trying to encode ["+parsedValue+"]", e);&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;return parsedValue;&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;});&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;} else {&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;return param;&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;}&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;/**&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* Executes the result given a final location (jsp page, action, etc) and the action invocation&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;* (the state in which the action was executed). Subclasses must implement this class to handle&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* custom logic for result handling.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;*&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* @param finalLocation the location (jsp page, action, etc) to go to.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;* @param invocation the execution state of the action.&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;* @throws Exception if an error occurs while executing the result.&lt;/span&gt; &lt;span style="font-family:courier new,monospace;"&gt;*/&lt;/span&gt;  &lt;span style="font-family:courier new,monospace;"&gt;protected abstract void doExecute(String finalLocation, ActionInvocation invocation) throws Exception;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4952443133527861024?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4952443133527861024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4952443133527861024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4952443133527861024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4952443133527861024'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/custom-webwork-result-type.html' title='Custom WebWork Result Type'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3294987260144350433</id><published>2008-01-27T09:17:00.000-08:00</published><updated>2008-01-27T09:19:38.515-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Force a vertical scroll bar in Firefox with CSS</title><content type='html'>&lt;pre style="font-family: courier new;" class="css"&gt;html &lt;span class="br0"&gt;{&lt;/span&gt;overflow-y&lt;span class="re2"&gt;:scroll&lt;/span&gt;;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3294987260144350433?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3294987260144350433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3294987260144350433' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3294987260144350433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3294987260144350433'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/force-vertical-scroll-bar-in-firefox.html' title='Force a vertical scroll bar in Firefox with CSS'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3599865618081976029</id><published>2008-01-15T21:05:00.001-08:00</published><updated>2008-01-27T09:19:44.298-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Move to a new Hotel</title><content type='html'>&lt;span style="font-family: verdana,sans-serif;"&gt;Actually it&amp;#39;s a kind of apartment named Boston Commons, at the south of Denver.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; We moved to here last Saturday and I lived in a two rooms&amp;#39; apartment with a colleague.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;It has a living room with a stove. And we took the light rail to the office. &lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Still busy these days and I didn&amp;#39;t have much time to check the GMail and write post. &lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;And generallyI didn&amp;#39;t find few interesting things to blog and forgot .&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;That&amp;#39;s it, just as in Hangzhou. Maybe one &amp;#39;big&amp;#39; different is we can buy thing cheaper here, comparing with in Hangzhou.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;And got a surprise from someone, saying a small gift prepared for me. Looking forward to it.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3599865618081976029?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3599865618081976029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3599865618081976029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3599865618081976029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3599865618081976029'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/move-to-new-hotel.html' title='Move to a new Hotel'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5799976562553791094</id><published>2008-01-13T23:07:00.000-08:00</published><updated>2008-01-27T09:19:38.516-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Block &amp; Inline Elments</title><content type='html'>&lt;ul style="font-family: verdana; list-style-type: square;"&gt;&lt;li&gt;An inline element is only as wide as the content  inside it.&lt;/li&gt;&lt;li&gt;Inline elements don't create a line break before or after them as block-level  elements do.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.webdesignfromscratch.com/css-block-and-inline.cfm"&gt;more infor.&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: verdana;font-family:verdana;" &gt;BLOCK ELMENTS:&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: verdana;" face="verdana"&gt;&lt;li&gt;DIV : Your general-purpose box&lt;/li&gt;&lt;li&gt;H1 ... h6 : All headings&lt;/li&gt;&lt;li&gt;P : Paragraph&lt;/li&gt;&lt;li&gt;UL, OL, DL : Lists (unordered, ordered and definition)&lt;/li&gt;&lt;li&gt;LI, DT, DD : List items, definition list terms, and definition list definitions&lt;/li&gt;&lt;li&gt;TABLE : Tables&lt;/li&gt;&lt;li&gt;BLOCKQUOTE : Like an indented paragraph, meant for quoting passages of text&lt;/li&gt;&lt;li&gt;PRE : Indicates a block of preformatted code&lt;/li&gt;&lt;li&gt;FORM : An input form&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;font-family:verdana;" &gt;INLINE ELMENTS:&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;SPAN : Your all-purpose inline element&lt;/li&gt;&lt;li&gt;A : Anchor, used for links (and also to mark specific targets on a page for direct linking)&lt;/li&gt;&lt;li&gt;STRONG : Used to make your content strong, displayed as bold in most browsers, replaces the narrower b (bold) tag&lt;/li&gt;&lt;li&gt;EM : Adds emphasis, but less strong than strong. Usually displayed as italic text, and replaces the old &lt;i&gt; (italic) &lt;/i&gt;tag&lt;/li&gt;&lt;li&gt;IMG : Image&lt;/li&gt;&lt;li&gt;BR : The line-break is an odd case, as it's an inline element that forces a new line. However, as the text carries on on the next line, it's not a block-level element. &lt;/li&gt;&lt;li&gt;INPUT : Form input fields like and &lt;/li&gt;&lt;li&gt;ABBR : Indicates an abbr. (hover to see how it works)&lt;/li&gt;&lt;li&gt;ACRONYM : Working much like the abbreviation, but used for things like this TLA.&lt;i&gt; &lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;i style="font-family: verdana;"&gt;&lt;br /&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5799976562553791094?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5799976562553791094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5799976562553791094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5799976562553791094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5799976562553791094'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/block-inline-elments.html' title='Block &amp; Inline Elments'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5062937246199796128</id><published>2008-01-13T23:05:00.000-08:00</published><updated>2008-01-27T09:19:38.517-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>Which Style Wins</title><content type='html'>&lt;ul style="font-family: verdana;"&gt;&lt;li&gt; &lt;p class="docList"&gt;A tag selector is worth &lt;span style="font-weight: bold;" class="docEmphStrong"&gt;1  point&lt;/span&gt;.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;A class selector is worth &lt;span style="font-weight: bold;" class="docEmphStrong"&gt;10  points&lt;/span&gt;.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;An ID selector is worth &lt;span style="font-weight: bold;" class="docEmphStrong"&gt;100  points&lt;/span&gt;.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;An inline style is  worth &lt;span style="font-weight: bold;" class="docEmphStrong"&gt;1000 points&lt;/span&gt;.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5062937246199796128?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5062937246199796128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5062937246199796128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5062937246199796128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5062937246199796128'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/which-style-wins.html' title='Which Style Wins'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3832676406275853400</id><published>2008-01-13T23:00:00.000-08:00</published><updated>2008-01-27T09:19:38.517-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>The Limits of CSS Inheritance</title><content type='html'>&lt;p style="font-family: verdana;" class="docText"&gt;Here are examples of times when &lt;a name="idx-CHP-4-0264"&gt;&lt;/a&gt;inheritance doesn't strictly apply:&lt;/p&gt; &lt;ul style="font-family: verdana;"&gt;&lt;li&gt; &lt;p class="docList"&gt;As a general rule, properties that affect the placement of  elements on the page, or the margins, background colors, and borders of elements  aren't &lt;a name="idx-CHP-4-0265"&gt;&lt;/a&gt;inherited.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;Web browsers use their own inherent styles to format various  tags: headings are big and bold, links are blue, and so on. When you define a  font-size for the text on a page and apply it to the &amp;lt;body&amp;gt; tag, headings  still appear larger than paragraphs, and &amp;lt;h1&amp;gt; tags are still larger than &amp;lt;h2&amp;gt; tags. It's the same when you apply a font color to the &amp;lt;body&amp;gt;  the links on the page still appear in good old-fashioned, Web-browser blue.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p class="docList"&gt;When styles conflict, the more specific style wins out. In  other words, when you've specifically applied CSS properties to an elementlike  specifying the font-size for an unordered listand those properties conflict with  any inherited propertieslike a font-size set for the &amp;lt;body&amp;gt; tagthe browser  uses the font size applied to the &amp;lt;ul&amp;gt; tag.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3832676406275853400?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3832676406275853400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3832676406275853400' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3832676406275853400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3832676406275853400'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/limits-of-css-inheritance.html' title='The Limits of CSS Inheritance'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3858620467192109470</id><published>2008-01-08T23:22:00.000-08:00</published><updated>2008-01-08T23:37:45.687-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Happy hour</title><content type='html'>It's happy hour and also thanks party since several GDC guys are gonna back to Hangzhou.&lt;br /&gt;It's a bar nearby office in downtown. It looks not very modern and a litter different with those in Hangzhou. And the drinkings here, wo... I'm almost lost. Beer,Vodka and Whisky, those all I can remember. To be honestly I couldn't drink and just tasted a small bottle of wine, that I forgot its name.&lt;br /&gt;A couple of things learned are skiing here is a very cool thing and a place named Boulder is a good place to go. It has beautiful scene of mountain and nice houses.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3858620467192109470?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3858620467192109470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3858620467192109470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3858620467192109470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3858620467192109470'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/happy-hour.html' title='Happy hour'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-7545806753725470282</id><published>2008-01-08T23:17:00.001-08:00</published><updated>2008-01-08T23:21:24.736-08:00</updated><title type='text'>Install Ubuntu 7.10 in MS Virtual PC</title><content type='html'>&lt;span style="font-family: verdana;"&gt;I have to say &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://arcanecode.wordpress.com/2007/10/18/installing-ubuntu-710-under-virtual-pc-2007/"&gt;this guide&lt;/a&gt;&lt;span style="font-family: verdana;"&gt; is great.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;For simulate the mice, option "i8042.noloop" play the magic.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-7545806753725470282?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/7545806753725470282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=7545806753725470282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7545806753725470282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7545806753725470282'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/install-ubuntu-710-in-ms-virtual-pc.html' title='Install Ubuntu 7.10 in MS Virtual PC'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5082378786228988550</id><published>2008-01-08T22:29:00.001-08:00</published><updated>2008-01-12T13:31:44.058-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Addtional VIM commands</title><content type='html'>&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;:set number/nonumber&lt;/span&gt;  =&amp;gt; show/hidden the line number&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;/\&amp;lt;the\&amp;gt;&lt;/span&gt; =&amp;gt; search the whole word 'the'&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;:nohlsearch&lt;/span&gt; =&amp;gt; un-highlight the search result temporaryly&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;:set hlsearch/nohlsearc&lt;/span&gt; =&amp;gt; set highlight/not highlight the search result&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;x&lt;/span&gt;  stands for  dl  (delete character under the cursor)&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;X&lt;/span&gt;  stands for  dh  (delete character left of the cursor)&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;D&lt;/span&gt;  stands for  d$  (delete to end of the line)&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;C&lt;/span&gt;  stands for  c$  (change to end of the line)&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;s&lt;/span&gt;  stands for  cl  (change one character)&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;S&lt;/span&gt;  stands for  cc  (change a whole line)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;.&lt;/span&gt;  The "." command is one of the most simple yet powerful commands in Vim.  It repeats the last change.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;~&lt;/span&gt;  change case of the character under the cursor, and move the cursor to the next character.  This is not an operator (unless 'tildeop' is set), thus you can't use it with a motion command.  It does works in Visual mode and changes case for all the selected text then.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;-------------------------- Start up settings for GUI Vim&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;" Windows size&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;set columns=110&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;set lines=40&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;"Max mine Windows when open&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;au GUIEnter * simalt ~x&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;" set scheme&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;color murphy&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;" set font&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;set guifont=courier_new:h10&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;" Turn off useless toolbar&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;set guioptions-=T&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;" Turn off right-hand scroll-bar&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;set guioptions-=r&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;" Turn off menu bar&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;set guioptions-=M&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5082378786228988550?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5082378786228988550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5082378786228988550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5082378786228988550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5082378786228988550'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/addtional-vim-commands.html' title='Addtional VIM commands'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2081896815317096419</id><published>2008-01-01T21:18:00.001-08:00</published><updated>2008-01-01T21:27:07.741-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Happy New Year &amp; Being OT</title><content type='html'>&lt;span style="font-family: verdana;"&gt;This is the new year, 2008. But we are working from hotel.&lt;br /&gt;I didn't have much complain of being working over time occasionally.&lt;br /&gt;And we do solve something by the end of day.&lt;br /&gt;But this time turn out to be a litter different since it's the new year,.&lt;br /&gt;We should take a good rest, shouldn't we?&lt;br /&gt;&lt;br /&gt;I'm thinking about when we were working today, what were those management team, architecture team and customers doing?&lt;br /&gt;Probably only Chinese guys have to work at the new year day.&lt;br /&gt;Can you say it's unfair. No, IMHO.&lt;br /&gt;Imaging if we are customers, we pay the money, things definitely will be different.&lt;br /&gt;&lt;br /&gt;Anyway, Happy New Year.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_9WsaZ41Bb4c/R3sflR7CkII/AAAAAAAAAYo/7JFKxLNFf68/s1600-h/newyear08.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp0.blogger.com/_9WsaZ41Bb4c/R3sflR7CkII/AAAAAAAAAYo/7JFKxLNFf68/s320/newyear08.gif" alt="Pic From Google.com" id="BLOGGER_PHOTO_ID_5150745324154949762" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2081896815317096419?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2081896815317096419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2081896815317096419' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2081896815317096419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2081896815317096419'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2008/01/happy-new-year-being-ot.html' title='Happy New Year &amp; Being OT'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_9WsaZ41Bb4c/R3sflR7CkII/AAAAAAAAAYo/7JFKxLNFf68/s72-c/newyear08.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-745769385120946150</id><published>2007-12-30T19:56:00.001-08:00</published><updated>2008-01-01T21:18:54.128-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Pacific Ocean Marketplace</title><content type='html'>终于去到了传说中的太平洋超市，有所谓的Chinese stuff. 果然是看着9眼熟，&lt;br&gt;很多东西一眼望过去就知道是啥玩意，而且很多都有中文。&lt;br&gt;确实方便不少。米，醋，酒，一应俱全。连年糕，面，泡面都有，虽然和国内有些差别。&lt;br&gt;&lt;br&gt;再过几天就是这边的新年，看看会有些啥玩意，似乎不像农历新年热闹得很，&lt;br&gt;这里似乎很平静，或许是没去市区逛逛。&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-745769385120946150?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/745769385120946150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=745769385120946150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/745769385120946150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/745769385120946150'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/pacific-ocean-marketplace.html' title='Pacific Ocean Marketplace'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2939601045217597794</id><published>2007-12-30T06:47:00.001-08:00</published><updated>2007-12-30T06:51:00.391-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Quiet</title><content type='html'>这个地方很安静，除了冰箱的一点点噪音和如果开着的空调。没有多余的人和动物。&lt;br&gt;昨天晚12点多睡，一觉睡到7点，真爽。这样的状态似乎已然消逝很久。&lt;br&gt;昨天和安仔聊天，说US并没有给太多的惊喜，其实就是这样。&lt;br&gt;工作有点点忙，而且有不是很顺畅；语言还得下功夫；出去购物得有车，自己又不会开；&lt;br&gt;去购物的时候很多都不认识，不认识是什么牌子，不认识是什么东西；&lt;br&gt;而通常是集体出动，就跟着走走看看，稍微了解了解。&lt;br&gt;不过后来想了想，应该是看店面能看出这个牌子的档次，比如Calvin Klein的样子就比很多店装修的要好， &lt;br&gt;所以东西卖的也贵，名气应该不小。不过听说LV还是个太高档次的属于我们无法承受的店，所以去的那两个地方都没有。&lt;br&gt;&lt;br&gt;不过那帮人挑的东西大概都还是很值得买的，比起国内要便宜好些，牌子都是数得上。&lt;br&gt;一瓶Amarni 70$, 据说比国内便宜好些。香水和衣服是买的比较多的，可能正赶上还在打折的时间。&lt;br&gt;怪不得black Friday的时候要去血拼，原来几百的东西打到几十块，还不赶紧买。&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2939601045217597794?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2939601045217597794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2939601045217597794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2939601045217597794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2939601045217597794'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/quiet.html' title='Quiet'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4525203030682138072</id><published>2007-12-29T20:30:00.001-08:00</published><updated>2007-12-30T06:51:00.391-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Cheery Creek &amp; Castle Rock</title><content type='html'>It's weekend. So it's shopping day as some guys will go back to China soon.&lt;br /&gt;We started to Cheery Creek first which has lots of cosmetics, perfume, clothing, electronic, etc..&lt;br /&gt;We saw Clinique, Lascome, Channel and many brands we didn't know ever.&lt;br /&gt;There's a Apple store as well and we tested i Phone. How cool it is! 8G memory, 399$ without tax.&lt;br /&gt;The only disappointed thing is I can't use it in China as well as in US.&lt;br /&gt;&lt;br /&gt;My partners bought something then we went to Castle Rock. It's a shopping place. A lot of clothing stores.&lt;br /&gt;I only know several brands here. Many products are on sale and I got one item at Timberland.&lt;br /&gt;&lt;br /&gt;Apparently I need to know more about those two place by search on internet in case I will not lost when going next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4525203030682138072?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4525203030682138072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4525203030682138072' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4525203030682138072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4525203030682138072'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/cheery-creek-crystal-rock.html' title='Cheery Creek &amp; Castle Rock'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1574504037143033289</id><published>2007-12-28T22:29:00.001-08:00</published><updated>2007-12-30T06:51:00.392-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>WalMart</title><content type='html'>We rended several cars for shopping by COB.&lt;br&gt;First is the BestBuy. It&amp;#39;s not very big but do have many productions, software, CD/DVD, computer accessorizes. And seems doesn&amp;#39;t have much deals.&lt;br&gt;Then went to Walmart nearby. It&amp;#39;s huge. Lots of stuff and most of them I can&amp;#39;t identify what they are as well as what they are used for. &lt;br&gt;Since we didn&amp;#39;t have enough time, I just asked for partners to give me suggestions what I should buy for the coming a week.&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1574504037143033289?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1574504037143033289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1574504037143033289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1574504037143033289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1574504037143033289'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/walmart.html' title='WalMart'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-862614872377621295</id><published>2007-12-27T22:21:00.000-08:00</published><updated>2007-12-30T06:51:00.393-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Radio in Denver</title><content type='html'>&lt;span style="font-family: verdana,sans-serif;"&gt;I can receive more than 20 radio channels in Denver.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;But my iRiver T10 could only save 20  channels.Sound bad!.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Any stuff can deal with this tough thing?&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; Save all channels then I can select one I like easily.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-862614872377621295?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/862614872377621295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=862614872377621295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/862614872377621295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/862614872377621295'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/radio-in-denver.html' title='Radio in Denver'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1072864250874916740</id><published>2007-12-27T19:58:00.001-08:00</published><updated>2008-08-24T20:11:15.876-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>The first day</title><content type='html'>It's snow day here.&lt;br /&gt;We walked for about 10 Minutes to take bus to client office and learned the&lt;br /&gt;environment.&lt;br /&gt;Everywhere is covered by snow. The view outside is like what we saw in&lt;br /&gt;some old US films.&lt;br /&gt;And the bus is definitely more comfortable than that in Hangzhou as&lt;br /&gt;well as it's bigger.&lt;p&gt;About half of ten o'clock, Billy brought our new arrivals to&lt;br /&gt;our company office. It's&lt;br /&gt;smaller than the GDC office and nothing better than GDC I think. Lots&lt;br /&gt;of people are not here since now it's the holiday season and most of&lt;br /&gt;are on vocation.&lt;/p&gt;&lt;p&gt;It took us more than 15 Min. to a market to buy something. And it's&lt;br /&gt;terrible walking in the snow.&lt;br /&gt;The market is not very big but it has almost all what we want. And&lt;br /&gt;what can I say, all the thing was labeled in English and I'm lost most&lt;br /&gt;of the time.&lt;br /&gt;And the 16th ST. is the *main line* here. Many stores at this street.&lt;br /&gt;Back to office around 2PM and checking the mail and going back to&lt;br /&gt;hotel after 1 hour because the snow will be worse later.&lt;/p&gt;&lt;p&gt;One thing I got strong feeling is the English skills is a big problem&lt;br /&gt;and also a big challenge if I want to live here comfortable.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1072864250874916740?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1072864250874916740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1072864250874916740' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1072864250874916740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1072864250874916740'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/first-day.html' title='The first day'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-975588516475483839</id><published>2007-12-26T18:58:00.001-08:00</published><updated>2007-12-26T19:03:32.235-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InUS'/><title type='text'>Arrival in US</title><content type='html'>1一个半小时的火车，1个小时机场大巴，近11点才到达浦东机场&lt;br&gt;下午1点40的飞机，经过日本上空(听说的)，近12小时达到San Francisco.&lt;br&gt;San Francisco 就在西海岸，飞机跨过海岸线后，就开始准备着陆了。&lt;br&gt;地上的汽车小的像是自行车队；看到了朔长的金门大桥，只是耳朵痛得没来得急拍照，&lt;br&gt;8:45AM进机场，取行李，又安检，两瓶老干妈，一瓶咸菜，一瓶豆腐乳都扣押扔掉，NND...&lt;br&gt;这便算是安全进入美国境内了。时间大致9:30AM. &lt;br&gt;再在机场等1个小时，转机到Denver。这趟飞机作的实在舒服，一上飞机就开始睡，&lt;br&gt;连起飞都没不知道，就在降落的时候醒来了。Local time 2:45PM the plane landed in Denver.&lt;br&gt;Denver似乎下了大雪，外面除了公路上到处是积雪，天气还是很晴朗，温度零下8度。&lt;br&gt;等了半个多小时接送的车才到，直接送往旅馆，安排房间，单人房，有电视，网络，还算不错。&lt;br&gt;拆包，旅途结束。&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-975588516475483839?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/975588516475483839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=975588516475483839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/975588516475483839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/975588516475483839'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/arrival-in-us.html' title='Arrival in US'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2397146379900214508</id><published>2007-12-24T19:03:00.001-08:00</published><updated>2007-12-24T19:03:15.939-08:00</updated><title type='text'>Opensource Cache/Caching Solutions in Java</title><content type='html'>&lt;span style="font-family: verdana,sans-serif;"&gt;Details: &lt;b&gt;&lt;a href="http://entips.sharmavishal.com/2007/10/open-source-cachecaching-solutions-in.html"&gt;http://entips.sharmavishal.com/2007/10/open-source-cachecaching-solutions-in.html &lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Bamboo DHT&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; cache4j&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;FreePastry&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;EHCache &lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Java Caching System (JCS)&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; JBoss Cache&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;JCache&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Jofti&lt;/span&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;OceanStore&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Open Terracotta&lt;/span&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;OSCache&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;ShiftOne&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;SwarmCache&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;WhirlyCache&lt;/span&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2397146379900214508?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2397146379900214508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2397146379900214508' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2397146379900214508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2397146379900214508'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/opensource-cachecaching-solutions-in.html' title='Opensource Cache/Caching Solutions in Java'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3454292025704681052</id><published>2007-12-22T05:54:00.001-08:00</published><updated>2007-12-22T05:54:54.342-08:00</updated><title type='text'>Webware Top 10 website design 2007</title><content type='html'>&lt;a href="http://cssherald.com/webware-top-10-website-design-2007/"&gt;http://cssherald.com/webware-top-10-website-design-2007/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3454292025704681052?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3454292025704681052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3454292025704681052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3454292025704681052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3454292025704681052'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/webware-top-10-website-design-2007.html' title='Webware Top 10 website design 2007'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5080037060781205432</id><published>2007-12-14T18:06:00.001-08:00</published><updated>2007-12-14T18:06:43.671-08:00</updated><title type='text'>Removing duplicate whitespace using regular expression</title><content type='html'>&lt;b&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Think about how to implement this before clicking the link below...&lt;/span&gt;&lt;/b&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; &lt;a href="http://www.memezilla.com/2007/12/14/removing-duplicate-whitespace-using-regular-expression-2"&gt;http://www.memezilla.com/2007/12/14/removing-duplicate-whitespace-using-regular-expression-2&lt;/a&gt;&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;br style="font-family: verdana,sans-serif;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5080037060781205432?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5080037060781205432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5080037060781205432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5080037060781205432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5080037060781205432'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/removing-duplicate-whitespace-using.html' title='Removing duplicate whitespace using regular expression'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-900912773347739414</id><published>2007-12-11T20:25:00.001-08:00</published><updated>2007-12-12T05:46:38.915-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><title type='text'>What's new in Groovy 1.5</title><content type='html'>&lt;b&gt;&lt;a href="http://www.infoq.com/articles/groovy-1.5-new"&gt;http://www.infoq.com/articles/groovy-1.5-new&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A couple of things I found are pretty cool.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Annotation. Aha... getters and setters are gone!  Actually that means we don't auto-generate ourselves in IDE. And code becomes naturally concise and readable. &lt;/li&gt;&lt;li&gt;Elvis operator.  Compare piece of code below...&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;String name = &lt;span style="color:#ff0000;"&gt;"Guillaume"&lt;/span&gt;;&lt;br /&gt;String displayName = name != &lt;strong&gt;null&lt;/strong&gt; ? name : &lt;span style="color:#ff0000;"&gt; "Unknown";&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;String name = &lt;span style="color:#ff0000;"&gt;"Guillaume"&lt;/span&gt;&lt;br /&gt;String displayName = name ?: &lt;span style="color:#ff0000;"&gt;"Unknown"&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-900912773347739414?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/900912773347739414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=900912773347739414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/900912773347739414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/900912773347739414'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/whats-new-in-groovy-15.html' title='What&apos;s new in Groovy 1.5'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1001665201789137355</id><published>2007-12-08T09:59:00.001-08:00</published><updated>2007-12-12T04:34:53.987-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Hooters, Hangzhou</title><content type='html'>&lt;span style="font-family: verdana,sans-serif;"&gt;Michael asked for a party in the hooters since he&amp;#39;s going back to US a couple weeks later.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; We really enjoyed ourselves I think, the beer, the chicken wings and of course hot girls.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Except the cost is expensive.&lt;/span&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;One guy here told that she&amp;#39;s preparing GRE and ToFEL. In another words she&amp;#39;s planning to study in US.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt; &lt;span style="font-family: verdana,sans-serif;"&gt;Sounds good. And it made me think that I had this plan before. But it&amp;#39;s merely a plan in mind till now.....&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; And Mike also said if people can get scholarship, the cost will be much lower.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;And probably international students could get scholarship. &lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;I definitely felt I got far more thing to do in improving English skills. &lt;/span&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;Because it&amp;#39;s not easy to express myself sometime and I could only understand a part of what they&amp;#39;re talking about.&lt;/span&gt; &lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt;And the language skill is the basic thing for making foreign friends.&lt;/span&gt;&lt;br style="font-family: verdana,sans-serif;"&gt;&lt;span style="font-family: verdana,sans-serif;"&gt; So, what the plan should be?&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1001665201789137355?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1001665201789137355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1001665201789137355' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1001665201789137355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1001665201789137355'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/hooters-hangzhou.html' title='Hooters, Hangzhou'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5471792732038254628</id><published>2007-12-04T19:03:00.001-08:00</published><updated>2007-12-12T05:38:56.745-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Opensource'/><title type='text'>Top Ten Obscure but Useful Java Open Source Projects - Circa 2007</title><content type='html'>&lt;font face="verdana,sans-serif"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;1. SymmetricDS&lt;br&gt;2. Bedework&lt;br&gt;3. Gadget&lt;br&gt;4. Carbonado&lt;br&gt;5. Nux&lt;br&gt;6. Cleversafe&lt;br&gt;7. XXL&lt;br&gt;8. UIMA&lt;br&gt;9. Queplix&lt;br&gt;10. ZK&lt;br&gt;&lt;br&gt;More information&amp;#39;s &lt;a href="http://www.manageability.org/blog/stuff/top-ten-truly-obscure-java-projects-2007"&gt; here&lt;/a&gt;.&lt;/font&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5471792732038254628?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5471792732038254628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5471792732038254628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5471792732038254628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5471792732038254628'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/top-ten-obscure-but-useful-java-open.html' title='Top Ten Obscure but Useful Java Open Source Projects - Circa 2007'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8629028899639271889</id><published>2007-12-04T00:13:00.001-08:00</published><updated>2007-12-12T04:33:47.999-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Color labels in GMail</title><content type='html'>&lt;span style="font-family:verdana,sans-serif;"&gt;I supported it's a cool new feature!&lt;br /&gt;&lt;br /&gt;Today I open GMail and found that a green box next to every label.&lt;br /&gt;You can select a color for each label by clicking that box.&lt;br /&gt;&lt;br /&gt;Then turn back to your inbox ...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8629028899639271889?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8629028899639271889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8629028899639271889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8629028899639271889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8629028899639271889'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/color-labels-in-gmail.html' title='Color labels in GMail'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-2653904711043041829</id><published>2007-12-02T06:11:00.000-08:00</published><updated>2007-12-02T06:31:45.320-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Multiple Firefox profile in single machine</title><content type='html'>&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Start Firefox ProfileManager from command line or windows-&gt;run&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;Firefox.exe --profilemanager&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By using the profile manager, we can configure multiple profiles.&lt;br /&gt;&lt;br /&gt;Then start Firefox with specific profile by adding appropriate parameter to properties of each shortcut.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-family:courier new;" &gt;"C:\Program Files\Mozilla Firefox 3 Beta 1\firefox.exe" -P FF3-Beta1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;TIPS: It seems the parameter P is case sensitive.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lifehacker.com/software/firefox/geek-to-live--manage-multiple-firefox-profiles-231646.php"&gt;Here&lt;/a&gt; is the details.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-2653904711043041829?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/2653904711043041829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=2653904711043041829' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2653904711043041829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/2653904711043041829'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/12/multiple-firefox-profile-in-single.html' title='Multiple Firefox profile in single machine'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8341126868685310003</id><published>2007-11-25T23:51:00.001-08:00</published><updated>2007-11-26T00:40:34.306-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer Science'/><title type='text'>Floating number in binary format</title><content type='html'>&lt;img width="430px;" src="http://upload.wikimedia.org/wikipedia/en/7/70/Float_example_frac.PNG" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;How to calculate its decimal value:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;exponent&lt;/span&gt;(&lt;span style="color: rgb(0, 153, 0);"&gt;0111 1100&lt;/span&gt;) := 2&lt;/span&gt;&lt;sup style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 60%;"&gt;7&lt;/sup&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt; - 4 - (2&lt;/span&gt;&lt;sup style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 60%;"&gt;(8-1)&lt;/sup&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt; - 1) = -3&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;fraction&lt;/span&gt; :=1.01&lt;/span&gt;&lt;sub style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 60%;"&gt;2&lt;/sub&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt; = 1.25&lt;/span&gt;&lt;sub style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 60%;"&gt;10&lt;/sub&gt;&lt;br /&gt;&lt;span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"&gt;here, &lt;span style="color: rgb(255, 102, 102);"&gt;m = 1.&lt;/span&gt; because the number above is normalized. follow to the link below to see the detail why m=1. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;So the result is: 1.25 * (2&lt;/span&gt;&lt;sup style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 60%;"&gt;-3&lt;/sup&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;) = 0.15625&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;Found interesting when I was studying the  &lt;/span&gt;&lt;a style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 85%;" href="http://en.wikipedia.org/wiki/IEEE_754"&gt;IEEE-754&lt;/a&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt; Standard, and of course I can not understand several concepts.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8341126868685310003?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8341126868685310003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8341126868685310003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8341126868685310003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8341126868685310003'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/11/floating-number-in-binary-format.html' title='Floating number in binary format'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5049819732666471531</id><published>2007-11-14T20:38:00.001-08:00</published><updated>2007-11-25T23:58:04.101-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Keyborad Shortcuts Experient in Google Search</title><content type='html'>It&amp;#39;s interesting.&lt;div&gt;I like the shortcuts J/K, just like working in VIM.&lt;/div&gt;&lt;div&gt;more information &lt;a href="http://www.google.com/experimental/index.html"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;But a big problem is that I have to select one kind of experient every time even with a login session. &lt;/div&gt;&lt;div&gt;Is there any ways to let google remember my favoriate experimental selection?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5049819732666471531?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5049819732666471531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5049819732666471531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5049819732666471531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5049819732666471531'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/11/keyborad-shortcuts-experient-in-google.html' title='Keyborad Shortcuts Experient in Google Search'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-7874267854261853469</id><published>2007-11-08T22:14:00.001-08:00</published><updated>2007-11-25T23:54:13.518-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Shortcut to System.out.println in Eclipse</title><content type='html'>&lt;font size="4"&gt; type:&lt;b&gt; syso&lt;br&gt;&lt;/b&gt; now presss&lt;b&gt; CTRL + SPACE BAR&lt;/b&gt;&lt;/font&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-7874267854261853469?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/7874267854261853469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=7874267854261853469' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7874267854261853469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/7874267854261853469'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/11/shortcut-to-systemoutprintln-in-eclipse.html' title='Shortcut to System.out.println in Eclipse'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-8737696760880392982</id><published>2007-10-18T00:08:00.001-07:00</published><updated>2007-11-25T23:54:38.989-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title type='text'>margin:0px auto;</title><content type='html'>&lt;span style="font-family: times new roman,serif;"&gt;This setting make a box(DIV) horizontally centered.&lt;/span&gt;&lt;br style="font-family: times new roman,serif;"&gt;&lt;span style="font-family: times new roman,serif;"&gt;a example: &lt;span style="text-decoration: underline;"&gt; &lt;a href="http://bluerobot.com/web/css/center1.html"&gt;http://bluerobot.com/web/css/center1.html&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: times new roman,serif;"&gt;&lt;br style="font-family: times new roman,serif;"&gt;&lt;span style="font-family: times new roman,serif;"&gt; So why it can take that effect?&lt;/span&gt;&lt;br style="font-family: times new roman,serif;"&gt;&lt;span style="font-family: times new roman,serif;"&gt;What&amp;#39;s the difference with &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255); font-family: courier new,monospace;"&gt; margin: 0px 100px;&lt;/span&gt;&lt;br style="font-family: times new roman,serif;"&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-8737696760880392982?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/8737696760880392982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=8737696760880392982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8737696760880392982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/8737696760880392982'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/10/margin0px-auto.html' title='margin:0px auto;'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-1660004635710303066</id><published>2007-10-17T07:25:00.001-07:00</published><updated>2009-09-29T01:53:09.910-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Interview'/><title type='text'>Becoming a Better Programmer......</title><content type='html'>&lt;div&gt; &lt;span style="color: rgb(0, 0, 0);font-family:trebuchet ms;font-size:85%;"  &gt;&lt;a style="font-weight: bold;" href="http://java.sun.com/developer/technicalArticles/Interviews/community/kabutz_qa.html"&gt;Here&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt; 's the interview with the Java Champion Heinz Kabutz by sun.&lt;/span&gt;   &lt;div&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;span style="font-family:trebuchet ms;"&gt;In his closing thoughts, that guy gave some suggestions for how to be a good programmer.&lt;br /&gt;And I found that the continuous learning again is a very important thing.&lt;br /&gt;As Kabutz mentioned, keep learning and experiment in technical, we have to sacrifice our personal time.&lt;br /&gt;It push me thinking that recently I spent all my personal time in playing WOW since the expansion TBC launched in  &lt;a href="http://www.wowchina.com/"&gt;China&lt;/a&gt;.&lt;br /&gt;And now my most interested thing had been done, the druid's epic flight form.&lt;br /&gt;I have to say flight is the most wonderful thing in &lt;a href="http://www.worldofwarcraft.com/"&gt; WOW&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;So what's the next step?&lt;br /&gt;Seems I always have many learning plans in hands but don't have relevant action plans!&lt;br /&gt;1. learning PHP. motivation is I want to learn another language.&lt;br /&gt;2. reading books. &amp;lt;the extreme programming explained, by Kent Beck&amp;gt;, &amp;lt;the Pragmatic Progammer, Andrew Hunt &amp;amp; David Thomas&amp;gt;&lt;br /&gt;* 3. &lt;span style="font-weight: bold;"&gt;learning algorithm&lt;/span&gt;. but I still wonder whether learning algorithm will contribute to my working as a information system development.Definitely hope people can give some recommendations!&lt;br /&gt;4. JUnit testing, EJB, WebWork, Freemarker, selenium, etc... those things are used in the project I'm working on.&lt;br /&gt;Hope I will got more opportunities to experiment with JUnit, Selenium and EJB.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="border: 1px dashed rgb(153, 153, 153);background-color:rgb(255, 255, 255);"&gt;  &lt;div  style="color: rgb(153, 153, 153); background-color: rgb(255, 255, 255);font-family:arial,sans-serif;margin:5px;"&gt;&lt;span style="font-size:85%;"&gt;Kabutz: Programmers need to be careful that their brains don't turn to stone. You may specialize in one field and find that, when the technology changes, you end up on the street. Because your brain is your single biggest asset, you need to continually feed it new information and ideas.&lt;/span&gt;&lt;/div&gt;   &lt;div  style="color: rgb(153, 153, 153); background-color: rgb(255, 255, 255);font-family:arial,sans-serif;margin:5px;"&gt;&lt;span style="font-size:85%;"&gt;To really learn, you need to choose the technology that you want to experiment in and take the time to study and read, which will require sacrificing your personal time. If you follow this advice, you'll grow more valuable over time and won't become a computer dinosaur.&lt;/span&gt;&lt;/div&gt;  &lt;div  style="color: rgb(153, 153, 153); background-color: rgb(255, 255, 255);font-family:arial,sans-serif;margin:5px;"&gt;&lt;span style="font-size:85%;"&gt;I've taught many courses to contented programmers, ranging from Y2K consultants to COBOL programmers, who have stuck their head in the sand for so long that it's downright impossible for them to adapt to new paradigms and languages. &lt;/span&gt;&lt;/div&gt; &lt;div  style="color: rgb(153, 153, 153); background-color: rgb(255, 255, 255);font-family:arial,sans-serif;margin:5px;"&gt;&lt;span style="font-size:85%;"&gt;If you are currently a Java programmer, you owe it to yourself to experiment in other technologies. Try out Squeak,  &lt;/span&gt;&lt;/div&gt;  &lt;div  style="color: rgb(153, 153, 153); background-color: rgb(255, 255, 255);font-family:arial,sans-serif;margin:5px;"&gt;&lt;span style="font-size:85%;"&gt;JRuby, and other languages. Install and use a different IDE. Never stop learning. The moment you stop, you can lose the wave, and it will require a lot of paddling to catch up with it again.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-1660004635710303066?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/1660004635710303066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=1660004635710303066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1660004635710303066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/1660004635710303066'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/10/becoming-better-programmer.html' title='Becoming a Better Programmer......'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3423291237824837834</id><published>2007-10-02T20:36:00.001-07:00</published><updated>2007-12-12T05:28:21.981-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Exhausted and extremely happy</title><content type='html'>It&amp;#39;s great interesting to get a comment from a foreigner on previous Chinese post.&lt;br&gt;Maybe he&amp;#39;s interested in foreign language like Chinese, or something else.&lt;br&gt;And I have to say I&amp;#39;m not able to write every post in English just because of my little English skills. &lt;br&gt;I couldn&amp;#39;t express something in my mind exactly in English and mostly English is used for reporting something and instant communication.&lt;br&gt;&lt;br&gt;On the Oct. 01 and Oct. 02, first two days of our &lt;span style="font-weight: bold;"&gt; National Holiday&lt;/span&gt;, we enjoyed every second.&lt;br&gt;Hiking on the Longgangshan Mountain and Yandangshan Mountain, parting, KTV, sleeping, mah-jong, volleyball, badminton.&lt;br&gt;We&amp;#39;re pretty sorry that we forgot to take along a digit camera. So we didn&amp;#39;t take anything photos. &lt;br&gt;Maybe I will share most of the details later on.&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3423291237824837834?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3423291237824837834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3423291237824837834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3423291237824837834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3423291237824837834'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/10/exhausted-and-extremely-happy.html' title='Exhausted and extremely happy'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-3379255863495093059</id><published>2007-09-29T21:31:00.001-07:00</published><updated>2007-12-12T05:28:21.982-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>My Sister got married</title><content type='html'>28号二姐结婚了。&lt;br&gt;说起来作为弟弟的我当天是重要角色，按照家乡的习俗，小舅子当天做&amp;quot;大&amp;quot;，不光事情要忙里忙外的，特别是酒席上敬酒环节，似乎会显的格外重要。&lt;br&gt;只是我是太不经事故，亦拙于言词，所以大部分事情都父母们操办了，或者情人&amp;quot;代替&amp;quot;操办，我便显得没啥事情。&lt;br&gt;姐夫的亲戚们比较远，所以晚上得去他们那边再一次酒席，我们先开车到姐夫老家，稍坐休息，吃过汤圆，便要去酒店了。&lt;br&gt;到是从姐夫家里出来的时候感觉怪怪的，原来嫁人确实不是那么的容易，这么多年和父母生活，突然现在把她放到了&amp;quot;别人&amp;quot;家里。。。 &lt;br&gt;&lt;br&gt;老妈的话语里是在说二姐有些&amp;quot;强势&amp;quot;，有时候说话乱讲，和她相处起来心理还是有疙瘩，这到也罢，只是会让姐夫在家里显得拘束。&lt;br&gt;这到真是个不好的事情，二姐的脾气大概向来如此，不知道这以后会不会有所改变。&lt;br&gt;但只要他们同心同德，事情肯定是越来越好的。 Best wishes for your guys！&lt;br&gt;&lt;br&gt;二姐的事情基本上算是完成了，下面就会轮到我了，然后便说起相亲来。我对这事并不排斥，反倒觉得还是不错的认识人的方式。 &lt;br&gt;但说归说，想归想，真的遇上自己，却又觉得很是别扭，目的性似乎过于明确。还真难迈出这步。。。&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-3379255863495093059?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/3379255863495093059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=3379255863495093059' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3379255863495093059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/3379255863495093059'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/09/my-sister-got-married.html' title='My Sister got married'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-6511229678041202788</id><published>2007-09-20T19:44:00.001-07:00</published><updated>2009-09-29T01:54:52.933-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><title type='text'>Boltech no more Boldtech</title><content type='html'>&lt;span style="font-family:times new roman,serif;"&gt;Ron announced a very important news this morning that&lt;span style="text-decoration: underline; font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt; &lt;a href="http://www.boldtech.com/" style="color: rgb(0, 0, 0);"&gt;Boldtech Systems&lt;/a&gt; has been acquired by  &lt;a href="http://www.perficient.com/" style="color: rgb(0, 0, 0);"&gt;Perficient, Inc&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt; &lt;span style="font-family:times new roman,serif;"&gt;And GDC China became a part of the &lt;a style="font-weight: bold; color: rgb(0, 0, 0);" href="http://www.perficient.com/"&gt; Perficient &lt;/a&gt;as well. &lt;/span&gt; &lt;span style="font-family:times new roman,serif;"&gt;According Ron's words, we won't get much change in short term in China but not including time&amp;amp;expense system and email system. &lt;/span&gt; &lt;span style="font-family:times new roman,serif;"&gt;More official information might come along next.&lt;/span&gt; &lt;span style="font-family:times new roman,serif;"&gt; A surprise definitely.&lt;/span&gt; &lt;span style="font-family:times new roman,serif;"&gt;Good news or bad news? who knows.&lt;br /&gt;&lt;br /&gt;Detail news &lt;a style="font-weight: bold;" href="http://www.perficient.com/news_events/news_detail.asp?news_id=252"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-6511229678041202788?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/6511229678041202788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=6511229678041202788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6511229678041202788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/6511229678041202788'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/09/boltech-no-more-boldtech.html' title='Boltech no more Boldtech'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-4588563580694794209</id><published>2007-09-05T04:30:00.000-07:00</published><updated>2007-09-05T05:01:18.731-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vim'/><title type='text'>Several VIM commands learned today</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Substitute words&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:s/From/To/g&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:%s/From/To/g&lt;/span&gt;&lt;br /&gt;/g means substitute all happens in the line.&lt;br /&gt;%s means means affect all lines in the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Split window&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:split&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:split file-name&lt;/span&gt; -&gt;open a second window and starts editing the file&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:vsplit&lt;/span&gt; -&gt; vertical splits&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;CTRL-W w&lt;/span&gt; -&gt; jump between windows&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;vim -o one.txt two.txt three.txt &lt;/span&gt;-&gt; open a window for each file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;CTRL-V&lt;/span&gt; : block visual mode&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;SHIFT-V&lt;/span&gt; : select a line&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Y&lt;/span&gt; : copy a line&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;y &lt;/span&gt;: copy selected&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;P&lt;/span&gt; : insert parse&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;p&lt;/span&gt; : appending parse&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tab pages&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:tabedit file-name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;gt, gT&lt;/span&gt; -&gt; navigate between tabs&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;w, e, b       W, E, B&lt;/span&gt;      &lt;span style="color: rgb(51, 102, 255);"&gt;^, $&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Move to a single character. A litter different between 'f' and 't'.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;fx, Fx, 3fx&lt;/span&gt; ('f' means 'find')&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;tx, Tx, 3tx&lt;/span&gt; ('t' means 'to')&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Match a parenthesis&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;%&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Move line&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;g, G, gg, H, M, L&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Simple search&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;/pattern&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;n,N&lt;/span&gt; -&gt; navigate between search results&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;:set hlsearch&lt;/span&gt;  -&gt; highlight search results&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-4588563580694794209?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/4588563580694794209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=4588563580694794209' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4588563580694794209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/4588563580694794209'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/09/several-vim-commands-learned-today.html' title='Several VIM commands learned today'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11284291.post-5772163796484710804</id><published>2007-09-04T04:39:00.000-07:00</published><updated>2007-09-04T05:55:42.341-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BIRT'/><title type='text'>Script Cross-tab in BIRT 2.2</title><content type='html'>I failed to find out how to add column name for a 'dimension' in cross-tab item of BIRT 2.2, so I have to use scripts to create a cross-table. The idea here is creating table columns before the create table event。&lt;br /&gt;(&lt;span style="font-weight: bold;"&gt;You may notice that the top-left part of the cross-tab in BIRT 2.2 is blank and could not add any other report items into it. It's confused!??&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:85%;"&gt;importPackage(Packages.org.eclipse.birt.report.model.api);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 170, 0);"&gt;// invode a java object to get all 'usTitles' datas from Database.&lt;/span&gt;&lt;br /&gt;usTitleService = new Packages.com.boldtech.seed.util.ReportUsTitleUtil;&lt;br /&gt;usTitles = usTitleService.getUsTitles();&lt;br /&gt;&lt;br /&gt;reportDesignHandle = reportContext.getReportRunnable().designHandle.getDesignHandle();&lt;br /&gt;reportEngine = reportContext.getReportRunnable().reportEngine;&lt;br /&gt;elementFactory = reportDesignHandle.getElementFactory();&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 170, 0);"&gt;// a table in the report body&lt;/span&gt;&lt;br /&gt;employeeTable = reportDesignHandle.getBody().getContents().get(0);&lt;br /&gt;header = employeeTable.getHeader().get(0);&lt;br /&gt;detail = employeeTable.getDetail().get(0);&lt;br /&gt;footer = employeeTable.getFooter().get(0);&lt;br /&gt;group = employeeTable.getGroups().get(0);&lt;br /&gt;groupFooter = group.getFooter().get(0);&lt;br /&gt;computedSet = employeeTable.getColumnBindings();&lt;br /&gt;&lt;br /&gt;usTitleSize = usTitles.size();&lt;br /&gt;var startAddColumn = 2;&lt;br /&gt;for(var i=0; i &amp;lt; usTitleSize; i++){&lt;br /&gt;  &lt;span style="color: rgb(0, 170, 0);"&gt;//--- column title&lt;/span&gt;&lt;br /&gt;  var addedColumn = startAddColumn + i;&lt;br /&gt;  employeeTable.insertColumn(addedColumn,1);     &lt;br /&gt;  cell = header.getCells().get(addedColumn);&lt;br /&gt;  cell.getWidth().setValue("10%");&lt;br /&gt;  label = &lt;span style="color: rgb(255, 204, 51);"&gt;elementFactory.newLabel(null)&lt;/span&gt;;&lt;br /&gt;  cell.getContent().add(label);&lt;br /&gt;  label.setText(usTitles.get(i).getSysConfigName()); &lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 170, 0);"&gt;//--- column value&lt;br /&gt;  // "employeeTitleResult" was created to keep metric values in the 'onFetch' event of table&lt;/span&gt;&lt;br /&gt;  cs1 = &lt;span style="color: rgb(255, 204, 51);"&gt;StructureFactory.createComputedColumn()&lt;/span&gt;;&lt;br /&gt;  cs1.setName("Column_TitleCount_" + i); &lt;br /&gt;  cs1.setExpression("employeeTitleResult[row.__rownum][" + i + "].value");&lt;br /&gt;  cs1.setDataType("any"); &lt;br /&gt;  computedSet.addItem( cs1 );&lt;br /&gt;&lt;br /&gt;  cell = detail.getCells().get(addedColumn); &lt;br /&gt;  data = &lt;span style="color: rgb(255, 204, 51);"&gt;elementFactory.newDataItem(null)&lt;/span&gt;; &lt;br /&gt;  data.setResultSetColumn("Column_TitleCount_" + i);&lt;br /&gt;  data.setName("ColumnValue_" + i);&lt;br /&gt;  data.setStyleName("cell-text-center-align"); &lt;br /&gt;  cell.getContent().add(data);&lt;br /&gt;   &lt;br /&gt;  &lt;span style="color: rgb(0, 170, 0);"&gt;//--- summary at group footer cell&lt;/span&gt;&lt;br /&gt;  cs1 = StructureFactory.createComputedColumn();&lt;br /&gt;  cs1.setName("Group_TitleCount_" + i);&lt;br /&gt;  cs1.setAggregateFunction("SUM");&lt;br /&gt;  cs1.setExpression("row[\"Column_TitleCount_" + i + "\"]");&lt;br /&gt;  cs1.setFilterExpression("row[\"Column_TitleCount_" + i + "\"]&gt;=1");&lt;br /&gt;  cs1.setDataType("any");&lt;br /&gt;  cs1.setAggregateOn("ProjectGroup");&lt;br /&gt;  computedSet.addItem( cs1 );&lt;br /&gt;&lt;br /&gt;  cell = groupFooter.getCells().get(addedColumn); &lt;br /&gt;  data = elementFactory.newDataItem( null ); &lt;br /&gt;  data.setResultSetColumn("Group_TitleCount_"+i);&lt;br /&gt;  data.setName("GroupValue_" + i);&lt;br /&gt;  data.setStyleName("cell-text-center-align");&lt;br /&gt;  cell.getContent().add(data);&lt;br /&gt;  &lt;span style="color: rgb(0, 170, 0);"&gt;// group summary rule: do not display '0' value.&lt;/span&gt;&lt;br /&gt;  cs1 = StructureFactory.createMapRule();&lt;br /&gt;  cs1.setTestExpression("row[\"Group_TitleCount_" + i + "\"]");&lt;br /&gt;  cs1.setOperator("le");&lt;br /&gt;  cs1.setValue1("0");&lt;br /&gt;  data.getPropertyHandle("mapRules").addItem(cs1);&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 170, 0);"&gt;//--- summary at footer cell&lt;/span&gt;&lt;br /&gt;  cs1 = StructureFactory.createComputedColumn();&lt;br /&gt;  cs1.setName("Grand_TitleCount_" + i);&lt;br /&gt;  cs1.setAggregateFunction("SUM");&lt;br /&gt;  cs1.setExpression("row[\"Group_TitleCount_" + i + "\"]");&lt;br /&gt;  cs1.setFilterExpression("row[\"Group_TitleCount_" + i + "\"]&gt;=1");&lt;br /&gt;  cs1.setDataType("any");&lt;br /&gt;  computedSet.addItem( cs1 );&lt;br /&gt;&lt;br /&gt;  cell = footer.getCells().get(addedColumn); &lt;br /&gt;  data = elementFactory.newDataItem( null ); &lt;br /&gt;  data.setResultSetColumn("Grand_TitleCount_" + i);&lt;br /&gt;  data.setName("GrandValue_" + i);&lt;br /&gt;  data.setStyleName("cell-text-center-align");&lt;br /&gt;  cell.getContent().add(data);&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 170, 0);"&gt;// footer summary rule: do not display '0' value.&lt;/span&gt;&lt;br /&gt;  cs1 = StructureFactory.createMapRule();&lt;br /&gt;  cs1.setTestExpression("row[\"Grand_TitleCount_" + i + "\"]");&lt;br /&gt;  cs1.setOperator("le");&lt;br /&gt;  cs1.setValue1("0");&lt;br /&gt;  data.getPropertyHandle("mapRules").addItem(cs1);&lt;br /&gt;}&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11284291-5772163796484710804?l=freizl.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://freizl.blogspot.com/feeds/5772163796484710804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11284291&amp;postID=5772163796484710804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5772163796484710804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11284291/posts/default/5772163796484710804'/><link rel='alternate' type='text/html' href='http://freizl.blogspot.com/2007/09/script-cross-tab-in-birt-22.html' title='Script Cross-tab in BIRT 2.2'/><author><name>Haisheng</name><uri>http://www.blogger.com/profile/18260538564892354310</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
