<?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-1691661231583466814</id><updated>2012-01-31T17:47:40.307-08:00</updated><category term='dependency'/><category term='Tellurium'/><category term='injection'/><category term='Groovy'/><category term='Transformation'/><category term='AST'/><title type='text'>Jian's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default?start-index=101&amp;max-results=100'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>139</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2228590016320333131</id><published>2011-08-31T09:39:00.000-07:00</published><updated>2011-08-31T09:42:10.191-07:00</updated><title type='text'>Cassandra 0.8 installation</title><content type='html'>Because Cassandra 0.8 uses mmap, we need to enable jna to avoid swapping out memory. Include jna.jar and modify /etc/security/limits.conf to add the following two lines&lt;br /&gt;&lt;br /&gt;cassandra_user        -       memlock       unlimited&lt;br /&gt;cassandra_user        -       nofile        32000&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2228590016320333131?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2228590016320333131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/08/cassandra-08-installation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2228590016320333131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2228590016320333131'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/08/cassandra-08-installation.html' title='Cassandra 0.8 installation'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3943298585359464332</id><published>2011-08-25T13:51:00.000-07:00</published><updated>2011-08-25T14:09:52.442-07:00</updated><title type='text'>Hadoop 0.20.2 tips</title><content type='html'>1) If no-password ssh login does not work for rsa, try dsa.&lt;br /&gt;&lt;br /&gt;2) ssh public key could be copied over with the command such as&lt;br /&gt;&lt;br /&gt;ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@dnjsrcha01&lt;br /&gt;&lt;br /&gt;3) Leave safe mode&lt;br /&gt;&lt;br /&gt;bin/hadoop dfsadmin -safemode leave&lt;br /&gt;&lt;br /&gt;4) Balance HDFS disk space after add/remove nodes, for example,&lt;br /&gt;&lt;br /&gt;bin/start-balancer.sh -threshold 10&lt;br /&gt;&lt;br /&gt;5) Bigger HDFS block such as 128MB works better for very big input files. Not obvious otherwise.&lt;br /&gt;&lt;br /&gt;6) ChainMapper &amp; ChainReducer save intermediate file storage&lt;br /&gt;&lt;br /&gt;7) HADOOP_MASTER in hadoop-env.sh can be set to distribute file changes to slaves.&lt;br /&gt;&lt;br /&gt;8) HADOOP_PID_DIR in hadoop-env.sh should be set, otherwise, the pids are saved to /tmp by default, which could be a problem when you shut down the cluster if the pid files on /tmp are removed by Linux system&lt;br /&gt;&lt;br /&gt;9) Kill a running job:&lt;br /&gt;&lt;br /&gt; bin/hadoop job -kill job_id&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3943298585359464332?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3943298585359464332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/08/hadoop-0202-tips.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3943298585359464332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3943298585359464332'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/08/hadoop-0202-tips.html' title='Hadoop 0.20.2 tips'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2922267127441443280</id><published>2011-07-07T14:25:00.000-07:00</published><updated>2011-07-07T14:26:06.738-07:00</updated><title type='text'>Spring http remoting with embedded Jetty server</title><content type='html'>I created a wiki page on Spring http remoting with embedded Jetty server here:&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/SpringHttpRemotingWithEmbeddedJettyServer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2922267127441443280?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2922267127441443280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/07/spring-http-remoting-with-embedded.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2922267127441443280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2922267127441443280'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/07/spring-http-remoting-with-embedded.html' title='Spring http remoting with embedded Jetty server'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5656848321158162427</id><published>2011-04-20T08:13:00.001-07:00</published><updated>2011-04-20T08:22:44.618-07:00</updated><title type='text'>Database Connection Pooling and too may TCP connetions in TIME_WAIT state</title><content type='html'>TCP TIME_WAIT is the final state and usually it will stay there for 4 minutes. Detailed explanations of TCP TIME_WAIT could be found here:&lt;br /&gt;&lt;br /&gt;http://stackoverflow.com/questions/41602/how-to-forcibly-close-a-socket-in-time-wait&lt;br /&gt;http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html&lt;br /&gt;&lt;br /&gt;Recently, I experienced a problem with too many connections in TIME_WAIT state, which prevented new connection from creating on the server side. I used a database connection pool, i.e., common dbcp, to pool the connections. I was very surprised to see so many connections are created and closed. What was the problem? Finally, I realized that I did not set the connection pool correct. The connection pool has parameters such as max connections, max idle connections, and wait time. For my case, the number of max idle connections is too low and thus, the connection pool had to create a lot of new connections. Once I increased the max idle connections, the problem went away. A lesson to lean.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5656848321158162427?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5656848321158162427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/database-connection-pooling-and-too-may.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5656848321158162427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5656848321158162427'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/database-connection-pooling-and-too-may.html' title='Database Connection Pooling and too may TCP connetions in TIME_WAIT state'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1603148218426048463</id><published>2011-04-15T16:16:00.000-07:00</published><updated>2011-04-26T09:32:01.414-07:00</updated><title type='text'>Turn NookColor into a Honeycomb tablet</title><content type='html'>NookColor is the ebook reader from B&amp;N.com and it is powered by Android 2.&lt;br /&gt;One feature of NookColor is that it will check for the SD card to boot first.&lt;br /&gt;As a result, I can create a bootable SD card with Android 3, i.e., Honeycomb.&lt;br /&gt;&lt;br /&gt;There are some good guides, for example.&lt;br /&gt;&lt;br /&gt;http://nookdevs.com/Nookie_Honeycomb:_Burning_a_bootable_SD_card&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The basic steps are&lt;br /&gt;&lt;br /&gt;1) Download Honeycomb image file for NookColor from http://www.rbrune.de/nookhoney04.img.zip&lt;br /&gt;2) Unzip the file and write the image file to a SD card (all existing data will be lost because of image writing). I first tried to use Linux command:&lt;br /&gt;&lt;br /&gt;dd if=nookhoney04.img of=/dev/sdb1 bs=1M&lt;br /&gt;&lt;br /&gt;where /dev/sdb1 is my SD card driver. But the SD card cannot be booted. Then, &lt;br /&gt;I tried to use an image writer (http://www.winimage.com/download.htm)&lt;br /&gt;on windows and it works. Not sure why.&lt;br /&gt;&lt;br /&gt;Also, I bought a Mini SD card adapter so that my computer can read the SD card directly.&lt;br /&gt;&lt;br /&gt;3) Since the SD card I used is 32GB, but the honeycomb image is only 4GB. To use the unallocated space, I used the gparted tool in Linux to expend the /sdcard partition on the SD card to take over the remaining space, i.e., 28GB.&lt;br /&gt;4) Insert the SD Card to NookColor and reboot it, then you will be in Honeycomb.&lt;br /&gt;5) The Honeycomb I burn is a minimum one and does not include even Android market. &lt;br /&gt;I downloaded the market and couple other packets from&lt;br /&gt;&lt;br /&gt;http://www.addictivetips.com/?attachment_id=44426&lt;br /&gt;&lt;br /&gt;Mount the SD Card to my computer and copy the files to the /system/app directory and then change the file permission to be 6755. The commands are similar to the ones in the HoneyGAppInstall.cmd of the downloaded package. But I didn't use the adb tool.&lt;br /&gt;&lt;br /&gt;6) Use Market to install some popular apps, for example, FbReader, dropbox, Hot Apps, Astro file manager, advanced task manager, nook, kindle, pandora, the wheather channel, youtube, and so on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1603148218426048463?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1603148218426048463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/turn-nookcolor-into-honycomb-tablet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1603148218426048463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1603148218426048463'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/turn-nookcolor-into-honycomb-tablet.html' title='Turn NookColor into a Honeycomb tablet'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2835771002736053351</id><published>2011-04-15T07:06:00.000-07:00</published><updated>2011-04-15T07:09:27.846-07:00</updated><title type='text'>Netactview</title><content type='html'>Netactview is a graphic interface of net activities in Linux. Similiar to &lt;br /&gt;the netstat command. The project is at&lt;br /&gt; &lt;br /&gt;http://netactview.sourceforge.net/&lt;br /&gt;&lt;br /&gt;But for Fedora, you can simply install it with the following command&lt;br /&gt;&lt;br /&gt;yum install -y netactview&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2835771002736053351?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2835771002736053351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/netactview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2835771002736053351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2835771002736053351'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/netactview.html' title='Netactview'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5925495906020701995</id><published>2011-04-12T07:20:00.000-07:00</published><updated>2011-04-12T08:43:28.216-07:00</updated><title type='text'>Maven release deployment: Failed to transfer file:  Return code is: 400</title><content type='html'>Some times, when we tried to redeploy release to Maven repo with command&lt;br /&gt;&lt;br /&gt;mvn clean install deploy&lt;br /&gt;&lt;br /&gt;and we got the following error:&lt;br /&gt;&lt;br /&gt;Maven release deployment: Failed to transfer file: myfile-url Return code is: 400&lt;br /&gt;&lt;br /&gt;The reason is that the Maven nexus release repo does not allow redeployment by default. To enable that, you should logon nexus and select the release repo, then change the configuration to allow redeployment there.&lt;br /&gt;&lt;br /&gt;But be aware that any projects use the release artifact will ONLY download the artifact once and thus the artifact you redeployed may not be able to be consumed by the projects, which may cause a lot of troubles. The solution is to manually remove the cached release artifact under .m2/repository so that Maven can download the new one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5925495906020701995?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5925495906020701995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/maven-release-deployment-failed-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5925495906020701995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5925495906020701995'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/maven-release-deployment-failed-to.html' title='Maven release deployment: Failed to transfer file:  Return code is: 400'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-305703046822597463</id><published>2011-04-08T14:00:00.000-07:00</published><updated>2011-04-08T14:03:52.650-07:00</updated><title type='text'>FreeTDS, a Linux client for MS SQL server</title><content type='html'>Here are the steps to install and run FreeDTS in Linux.&lt;br /&gt;&lt;br /&gt;1) Download freetds&lt;br /&gt;&lt;br /&gt;wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz&lt;br /&gt;&lt;br /&gt;2) Compile and install freetds as root&lt;br /&gt;&lt;br /&gt;tar zxvf freetds-stable.tgz&lt;br /&gt;cd freetds-0.82/&lt;br /&gt;./configure --prefix=/usr/local/freetds --enable-msdblib&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;3) Edit configuration file. I added the following portion to &lt;br /&gt;/usr/local/freetds/etc/freetds.conf.&lt;br /&gt;&lt;br /&gt;[MSSQL1]&lt;br /&gt;        host = MSSQL1.telluriumsource.org&lt;br /&gt;        port = 1433&lt;br /&gt;        tds version = 8.0&lt;br /&gt;&lt;br /&gt;[MSSQL2]&lt;br /&gt;        host = MSSQL2.telluriumsource.org&lt;br /&gt;        port = 1433&lt;br /&gt;        tds version = 8.0&lt;br /&gt;&lt;br /&gt;4) Add environment variables by adding the following lines&lt;br /&gt;to /etc/profile.&lt;br /&gt;&lt;br /&gt;export TDSVER=8.0&lt;br /&gt;export FREETDS_HOME=/usr/local/freetds&lt;br /&gt;export PATH=$FREETDS_HOME/bin:$PATH&lt;br /&gt;&lt;br /&gt;5) Use tsql tool to connect to Database. For the databases I &lt;br /&gt;registered in /usr/local/freetds/etc/freetds.conf, you can use&lt;br /&gt;-S servername to specify the database, for example,&lt;br /&gt;&lt;br /&gt;tsql -S MSSQL1 -U 'NTDomain\jfang' -D databaseName&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-305703046822597463?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/305703046822597463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/freetds-linux-client-for-ms-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/305703046822597463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/305703046822597463'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/04/freetds-linux-client-for-ms-sql-server.html' title='FreeTDS, a Linux client for MS SQL server'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1218374965878291706</id><published>2011-01-21T09:30:00.000-08:00</published><updated>2011-01-21T09:37:44.584-08:00</updated><title type='text'>CLOSE_WAIT TCP connections</title><content type='html'>While we develop a Java application, we saw a lot of CLOSE_WAIT TCP connections.&lt;br /&gt;&lt;br /&gt;netstat -pan | grep CLOSE_WAIT&lt;br /&gt;&lt;br /&gt;This could lead to the following exception:&lt;br /&gt;&lt;br /&gt;Thread Execute Exception java.net.SocketException: Too many open files&lt;br /&gt;&lt;br /&gt;because a lot of sockets are still there occupanying linux system file descriptors. &lt;br /&gt;&lt;br /&gt;The following command could be used to check the system limits.&lt;br /&gt;&lt;br /&gt;ulimit -a&lt;br /&gt;&lt;br /&gt;After testing and debugging, we found that some HttpURLConnection did not get disconnected&lt;br /&gt;when exception happens. Fortunately we found the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1218374965878291706?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1218374965878291706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/01/closewait-tcp-connections.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1218374965878291706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1218374965878291706'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/01/closewait-tcp-connections.html' title='CLOSE_WAIT TCP connections'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2486975916756018059</id><published>2011-01-14T09:52:00.000-08:00</published><updated>2011-01-14T09:55:08.930-08:00</updated><title type='text'>Add a user to a group in Linux</title><content type='html'>The group is defined in /etc/group&lt;br /&gt;&lt;br /&gt;To add a new user to a group&lt;br /&gt;&lt;br /&gt;useradd -g {groupname} username&lt;br /&gt;&lt;br /&gt;To add an existing user to a group&lt;br /&gt;&lt;br /&gt;usermod -g {groupname} username&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2486975916756018059?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2486975916756018059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/01/add-user-to-group-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2486975916756018059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2486975916756018059'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/01/add-user-to-group-in-linux.html' title='Add a user to a group in Linux'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6987348137200799471</id><published>2011-01-06T07:59:00.000-08:00</published><updated>2011-01-06T08:03:32.055-08:00</updated><title type='text'>iBatis "select top" statement</title><content type='html'>I use MS SQL server to select a list of products, for example,&lt;br /&gt;&lt;br /&gt;select top 200 from mydb(nolock)&lt;br /&gt;&lt;br /&gt;If I like to use a parameter to replace 200 in iBatis, I first tried&lt;br /&gt;&lt;br /&gt;select top #value# from mydb(nolock)&lt;br /&gt;&lt;br /&gt;but it didn't work. After googling and found the correct way is&lt;br /&gt;to use the $value$ to pass the parameter, i.e.,&lt;br /&gt;&lt;br /&gt;select top $value$ from mydb(nolock)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6987348137200799471?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6987348137200799471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2011/01/ibatis-select-top-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6987348137200799471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6987348137200799471'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2011/01/ibatis-select-top-statement.html' title='iBatis &quot;select top&quot; statement'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3623599856081131299</id><published>2010-12-20T08:08:00.000-08:00</published><updated>2010-12-20T08:12:23.400-08:00</updated><title type='text'>Install Skype for Fedora Linux 14 X86-64</title><content type='html'>First download the rpm skype-2.1.0.81-fc10.i586.rpm from skype:&lt;br /&gt;&lt;br /&gt;http://www.skype.com/intl/en-us/get-skype/on-your-computer/linux/post-download/&lt;br /&gt;&lt;br /&gt;You cannot install the above rpm alone, otherwise, you will get errors such as&lt;br /&gt;&lt;br /&gt;"error while loading shared libraries: libXv.so.1: cannot open shared object file: No such file or directory"&lt;br /&gt;&lt;br /&gt;You need couple more dependencies and thus, you should use the following command to install it.&lt;br /&gt;&lt;br /&gt;yum localinstall --nogpgcheck skype-2.1.0.81-fc10.i586.rpm  glibc.i686 alsa-lib.i686 libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3623599856081131299?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3623599856081131299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/install-skype-for-fedora-linux-14-x86.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3623599856081131299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3623599856081131299'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/install-skype-for-fedora-linux-14-x86.html' title='Install Skype for Fedora Linux 14 X86-64'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6364866025146732372</id><published>2010-12-17T08:02:00.000-08:00</published><updated>2010-12-17T08:06:13.247-08:00</updated><title type='text'>Enable network card on boot for Fedora 14</title><content type='html'>Fedora 14 disabled the network interface on boot. You may like to change it to be active on boot. &lt;br /&gt;Update the file /etc/sysconfig/network-scripts/ifcfg-xxxx, where xxxx is the interface name, for example  &lt;br /&gt;&lt;br /&gt;/etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;&lt;br /&gt;Change the following line from&lt;br /&gt;&lt;br /&gt;ONBOOT="no"&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;ONBOOT="yes"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6364866025146732372?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6364866025146732372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/enable-network-card-on-boot-for-fedora.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6364866025146732372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6364866025146732372'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/enable-network-card-on-boot-for-fedora.html' title='Enable network card on boot for Fedora 14'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1964323607626810379</id><published>2010-12-17T07:17:00.000-08:00</published><updated>2010-12-17T07:23:22.341-08:00</updated><title type='text'>Mount Windows network drive to Linux</title><content type='html'>Take fedora as an example, use the following command&lt;br /&gt;&lt;br /&gt;mount -t cifs //mynetworkname/jfang /mnt/working -o user=jfang&lt;br /&gt;&lt;br /&gt;Be aware that you should use cifs as the type, not smbfs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1964323607626810379?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1964323607626810379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/mount-windows-network-drive-to-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1964323607626810379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1964323607626810379'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/mount-windows-network-drive-to-linux.html' title='Mount Windows network drive to Linux'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2907904978740352412</id><published>2010-12-09T08:23:00.000-08:00</published><updated>2010-12-09T08:24:55.335-08:00</updated><title type='text'>Tellurium IDE 0.8.0 RC2 released</title><content type='html'>After many hours hard-work, finally I released Tellurium 0.8.0 RC2. 0.8.0 RC2 is a bug fix release. Fixed Mac OS X spinning cursor problem,updated UI module generation algorithm, improved UI layout on Windows systems, and many other bug fixes and improvement. &lt;br /&gt;&lt;br /&gt;The release notice is here:&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/aost/wiki/TelluriumIde080RC2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2907904978740352412?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2907904978740352412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/tellurium-ide-080-rc2-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2907904978740352412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2907904978740352412'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/tellurium-ide-080-rc2-released.html' title='Tellurium IDE 0.8.0 RC2 released'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-9024354106213141339</id><published>2010-12-07T09:03:00.000-08:00</published><updated>2010-12-07T09:04:39.698-08:00</updated><title type='text'>Circuit Breaker Implemented in Java</title><content type='html'>Just created a post on Circuit breaker in Java. &lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/CircuitBreakerDesignPattern&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-9024354106213141339?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/9024354106213141339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/circuit-breaker-implemented-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/9024354106213141339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/9024354106213141339'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/circuit-breaker-implemented-in-java.html' title='Circuit Breaker Implemented in Java'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1918588161959360799</id><published>2010-12-06T08:08:00.000-08:00</published><updated>2010-12-06T08:14:01.017-08:00</updated><title type='text'>Use chromebug to debug Firefox plugin</title><content type='html'>I was not aware of chromebug until recently. Chromebug has a better UI to debug Firefox plugins. To install and use chromebug, you need the following steps&lt;br /&gt;&lt;br /&gt;1) Install Firebug &lt;br /&gt;2) Install Chromebug with the same version of Firebug, for example, chromebug-1.7.0a7.xpi. Chromebug can be found here:&lt;br /&gt;&lt;br /&gt;  http://getfirebug.com/releases/chromebug/&lt;br /&gt;&lt;br /&gt;3) Restart Firefox with the additional "-chromebug"&lt;br /&gt;&lt;br /&gt;For example, in Mac OS X, I use the following command&lt;br /&gt;&lt;br /&gt;/Applications/Firefox.app/Contents/MacOS/firefox-bin  -chromebug&lt;br /&gt;&lt;br /&gt;4) Open the firefox plugin that you want debug&lt;br /&gt;5) Go to the File menu in Chromebug and select JavaScript files from your plugin and set breakpoints. &lt;br /&gt;6) Run the plugin and debug the plugin when it stops at breakpoints.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1918588161959360799?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1918588161959360799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/use-chromebug-to-debug-firefox-plugin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1918588161959360799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1918588161959360799'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/12/use-chromebug-to-debug-firefox-plugin.html' title='Use chromebug to debug Firefox plugin'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2197957451784185536</id><published>2010-11-21T20:17:00.000-08:00</published><updated>2010-11-21T20:21:57.348-08:00</updated><title type='text'>JavaScript singleton</title><content type='html'>Following some posts on JavaScript singleton, I created the following JavaScript singleton in Tellurium IDE, which requires a singleton instance to access the Tellurium Engine.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function TelluriumFactory() {&lt;br /&gt;  var instance = (function() {&lt;br /&gt;    var _tellurium = null;&lt;br /&gt;    var initialized = false;&lt;br /&gt;&lt;br /&gt;    function initialize () {&lt;br /&gt;        _tellurium = new Tellurium();&lt;br /&gt;        _tellurium.initialize();&lt;br /&gt;        initialized = true;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return {&lt;br /&gt;      // public interface&lt;br /&gt;      getInstance: function () {&lt;br /&gt;          if(!initialized){&lt;br /&gt;              initialize();&lt;br /&gt;          }&lt;br /&gt;          return _tellurium;&lt;br /&gt;      }&lt;br /&gt;    };&lt;br /&gt;  })();&lt;br /&gt;&lt;br /&gt;  TelluriumFactory = function () {&lt;br /&gt;    // re-define the function for subsequent calls&lt;br /&gt;    return instance;&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;  return TelluriumFactory(); // call the new function&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To get the singleton instance, simply call the following method&lt;br /&gt;&lt;br /&gt;var tellurium = (new TelluriumFactory()).getInstance();&lt;br /&gt;&lt;br /&gt;where tellurium is a singleton.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2197957451784185536?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2197957451784185536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/11/javascript-singleton.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2197957451784185536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2197957451784185536'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/11/javascript-singleton.html' title='JavaScript singleton'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8123288780847305303</id><published>2010-11-19T13:45:00.000-08:00</published><updated>2010-11-19T13:51:47.061-08:00</updated><title type='text'>JavaScript duplicated constants</title><content type='html'>Recently, I updated Tellurium IDE with changes from Tellurium Engine. After the merge, Tellurium IDE, the Firefox plugin, stopped working and it took me quick some time to figure out what happened. The cause was duplicated constants. &lt;br /&gt;&lt;br /&gt;In Tellurium Engine, I defined the following constants&lt;br /&gt;&lt;br /&gt;const ValueType = {&lt;br /&gt;    NUMBER: "number",&lt;br /&gt;    STRING: 'string',&lt;br /&gt;    BOOLEAN: 'boolean',&lt;br /&gt;    OBJECT: 'object',&lt;br /&gt;    VARIABLE: "var",&lt;br /&gt;    NIL: "nil"&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;const CommandType = {&lt;br /&gt;    HasUid: "hasUid",&lt;br /&gt;    NoUid: "noUid",&lt;br /&gt;    ACTION: "action",&lt;br /&gt;    ACCESSOR: "accessor",&lt;br /&gt;    DIRECT: "direct",&lt;br /&gt;    ASSERTION: "assertion"&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;const ReturnType = {&lt;br /&gt;    VOID: "void",&lt;br /&gt;    BOOLEAN: "boolean",&lt;br /&gt;    STRING: "string",&lt;br /&gt;    ARRAY: "Array",&lt;br /&gt;    NUMBER: "number",&lt;br /&gt;    OBJECT: "object"&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;While in Tellurium IDE, I had the same constants defined in a file workspace.js. Seems&lt;br /&gt;Firefox detected the duplicates and quietly quitted loading the script file. Thus, the &lt;br /&gt;object Workspace defined in workspace.js became undefined, which led to the misbehavior&lt;br /&gt;of Tellurium IDE. Never expected this before. A good lesson to learn.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8123288780847305303?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8123288780847305303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/11/javascript-duplicated-constants.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8123288780847305303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8123288780847305303'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/11/javascript-duplicated-constants.html' title='JavaScript duplicated constants'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1625849076394848461</id><published>2010-11-01T12:05:00.000-07:00</published><updated>2010-11-01T12:09:50.052-07:00</updated><title type='text'>jQuery live() pitfall</title><content type='html'>Tellurium IDE used jQuery live() to bind event listener to the document to capture all user's actions. Recently, I found there is a problem with this approach. That is to say, if the event handlers on the web return false, then the events won't be propagated to the document. As a result, Tellurium IDE cannot capture these events. &lt;br /&gt;&lt;br /&gt;The problems was reported by one user while he tried to use Tellurium IDE to capture the "click" event on jQuery UI tab containers. &lt;br /&gt;&lt;br /&gt;Be aware of this pitfall.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1625849076394848461?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1625849076394848461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/11/jquery-live-pitfall.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1625849076394848461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1625849076394848461'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/11/jquery-live-pitfall.html' title='jQuery live() pitfall'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-120244555153425564</id><published>2010-10-19T20:07:00.000-07:00</published><updated>2010-10-19T20:10:59.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dependency'/><category scheme='http://www.blogger.com/atom/ns#' term='AST'/><category scheme='http://www.blogger.com/atom/ns#' term='injection'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><category scheme='http://www.blogger.com/atom/ns#' term='Tellurium'/><category scheme='http://www.blogger.com/atom/ns#' term='Transformation'/><title type='text'>Simple Dependency Injection with Groovy AST Transformation</title><content type='html'>AST Transformation is a cool feature in Groovy to do compile-time meta-programming. This feature somehow looks like the compile-time weaving in AOP programming. This article will introduce how to use Groovy AST Transformation as a simple dependency injection for Groovy classes. The basic idea is to change the Groovy class source code at compile time to wire in dependences.&lt;br /&gt;&lt;br /&gt;First, I will cover the implementation details followed by the usage of the dependency injection framework. Then, I like to show you the code snippets on how I use the dependency injection framework in tellurium core. &lt;br /&gt;&lt;br /&gt;The full article is available here:&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/DependencyInjectionWithGroovyASTTransformation&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-120244555153425564?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/120244555153425564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/10/simple-dependency-injection-with-groovy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/120244555153425564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/120244555153425564'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/10/simple-dependency-injection-with-groovy.html' title='Simple Dependency Injection with Groovy AST Transformation'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6146363548008966326</id><published>2010-09-24T12:48:00.001-07:00</published><updated>2010-09-24T12:56:09.103-07:00</updated><title type='text'>cntlm in gateway mode</title><content type='html'>I have two machines at work, one is an iMac and the other one is a Linux box. I have the cntlm proxy (http://cntlm.sourceforge.net/) installed on my Linux box, but I cannot install cntlm on my Mac OS because I haven't downloaded a C compiler yet. I want to use the cntlm in my Linux box from my iMac. &lt;br /&gt;&lt;br /&gt;Fortunately, cntlm has a gateway mode. By default, cntlm binds to localhost loopback address. While in the gateway mode, it listens to all network interfaces, which is really cool. &lt;br /&gt;&lt;br /&gt;I simply run the following command&lt;br /&gt;&lt;br /&gt;cntlm -g&lt;br /&gt;&lt;br /&gt;on my Linux box, then on my Mac, I use its address as the proxy address and everything works great.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6146363548008966326?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6146363548008966326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/cntlm-in-gateway-mode.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6146363548008966326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6146363548008966326'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/cntlm-in-gateway-mode.html' title='cntlm in gateway mode'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4731735787023496109</id><published>2010-09-22T09:30:00.000-07:00</published><updated>2010-09-22T09:36:44.511-07:00</updated><title type='text'>Attribute "bundlevalue" must be declared for element type "attr"</title><content type='html'>My current NetBeans version is 6.9.1. When I run couple sample NetBeans applications created with NetBeans 6.5, the following error was thrown complaining the layer.xml file:&lt;br /&gt;&lt;br /&gt; Attribute "bundlevalue" must be declared for element type "attr"&lt;br /&gt;&lt;br /&gt;I googled but without any useful information. I looked closer and compared the layer.xml generated with NetBeans 6.9.1. The difference is the header DTD definition. &lt;br /&gt;&lt;br /&gt;In 6.9.1, the DTD is &lt;br /&gt;&lt;br /&gt;"-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd"&lt;br /&gt;&lt;br /&gt;while the one in NetBeans 6.5 is &lt;br /&gt;&lt;br /&gt;"-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd"&lt;br /&gt;&lt;br /&gt;I replaced the DTD definition in the sample application files with the one from NetBeans 6.9.1 and fortunately the compilation passed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4731735787023496109?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4731735787023496109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/attribute-bundlevalue-must-be-declared.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4731735787023496109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4731735787023496109'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/attribute-bundlevalue-must-be-declared.html' title='Attribute &quot;bundlevalue&quot; must be declared for element type &quot;attr&quot;'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2664171141399981973</id><published>2010-09-21T06:36:00.000-07:00</published><updated>2010-09-21T06:42:33.423-07:00</updated><title type='text'>InfoQ article on Tellurium</title><content type='html'>My InfoQ article "Introducing the Tellurium Automated Testing Framework" has been finally published. Here is the link:&lt;br /&gt;&lt;br /&gt;http://www.infoq.com/articles/tellurium_intro&lt;br /&gt;&lt;br /&gt;It took quite some time and special thanks to InfoQ editors Ryan Slobojan and Charles Humble for making this possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2664171141399981973?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2664171141399981973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/infoq-article-on-tellurium.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2664171141399981973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2664171141399981973'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/infoq-article-on-tellurium.html' title='InfoQ article on Tellurium'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2072764508003922661</id><published>2010-09-20T09:08:00.001-07:00</published><updated>2010-09-20T09:15:04.445-07:00</updated><title type='text'>Change JVM options for Netbeans</title><content type='html'>I didn't use NetBeans very often, but I do use it often now because I need to work on some Swing application. Sometimes, I saw PermGen space OutOfMemoryError and similar to IntelliJ IDEA, I can change the JVM options for NetBeans to get rid of this error.&lt;br /&gt;&lt;br /&gt;First, find where is the configuration file:&lt;br /&gt;&lt;br /&gt;$ locate netbeans.conf&lt;br /&gt;/Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/etc/netbeans.conf&lt;br /&gt;/Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/etc/netbeans.conf.orig&lt;br /&gt;&lt;br /&gt;Then, add the following line to netbeans.conf&lt;br /&gt;&lt;br /&gt;-XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2072764508003922661?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2072764508003922661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/change-jvm-options-for-netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2072764508003922661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2072764508003922661'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/change-jvm-options-for-netbeans.html' title='Change JVM options for Netbeans'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3174345286237066160</id><published>2010-09-14T10:37:00.000-07:00</published><updated>2010-09-14T11:03:17.406-07:00</updated><title type='text'>EasyMock Capture</title><content type='html'>I have a unit test written with jMock for a MVP framework. The presenter looks as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class MyPresenter {&lt;br /&gt;    public MyPresenter(final IMyModel model, final IMyAdapter adapter) {&lt;br /&gt;        // handling events between model and view&lt;br /&gt;        adapter.whenScanned(new ScannedHandler() {&lt;br /&gt;            public void canned() {&lt;br /&gt;                String id = adapter.getScanned();&lt;br /&gt;                model.retrieveShipment(id);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;&lt;br /&gt;        model.whenRetrieved(new RetrievedHandler() {&lt;br /&gt;            public void retrieve(Shipment shipment) {&lt;br /&gt;                adapter.updateShipment(shipment);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;jMock uses an InstanceCatcher class to capture the handler passed in MyPresenter constructor.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class InstanceCatcher&lt;T&gt; extends BaseMatcher&lt;T&gt; {&lt;br /&gt;    private T instance;&lt;br /&gt;&lt;br /&gt;    public T getInstance() {&lt;br /&gt;        return instance;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean matches(Object o) {&lt;br /&gt;        try {&lt;br /&gt;            instance = (T) o;&lt;br /&gt;            return true;&lt;br /&gt;        } catch (ClassCastException ex) {&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The magic is that jMock will call the matches method if you define the jMock&lt;br /&gt;object as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    protected JUnit4Mockery context = new JUnit4Mockery();&lt;br /&gt;    InstanceCatcher&lt;ScannedHandler&gt; scannedHandlerCatcher = new InstanceCatcher&lt;ScannedHandler&gt;();&lt;br /&gt;    InstanceCatcher&lt;ScannedHandler&gt; retrievedHandlerCatcher = new InstanceCatcher&lt;RetrievedHandler&gt;();&lt;br /&gt;&lt;br /&gt;    context.checking(new Expectations() {&lt;br /&gt;      {&lt;br /&gt;     one(adapter).whenScanned(with(scannedHandlerCatcher));&lt;br /&gt;     one(model).whenRetrieved(with(retrievedHandlerCatcher));&lt;br /&gt;      }&lt;br /&gt;    });&lt;br /&gt;&lt;br /&gt;    new MyPresenter(model, adapter);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;since scannedHandlerCatcher and retrievedHandlerCatcher capture the handlers during MyPresenter initialization, we can call on the handler in unit in the following way.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;context.checking(new Expectations(){{&lt;br /&gt;   one(adapter).getScanned(); will(returnValue(identifier));&lt;br /&gt;   one(model).retrieve(identifier);&lt;br /&gt; }});&lt;br /&gt;scannedHandlerCatcher.getInstance().identifierScanned();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For EasyMock, I need to use the Capture command to capture the handler instance.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ScannedHandler scannedHandler;&lt;br /&gt;RetrievedHandler retrievedHandler;&lt;br /&gt;&lt;br /&gt;model = EasyMock.createMock(IMyModel.class);&lt;br /&gt;adapter = EasyMock.createMock(IMyAdapter.class);&lt;br /&gt;        &lt;br /&gt;Capture&lt;ScannedHandler&gt; ishCapture= new Capture&lt;ScannedHandler&gt;();&lt;br /&gt;adapter.whenIdentifierScanned(EasyMock.and(EasyMock.capture(ishCapture), EasyMock.isA(ScannedHandler.class)));&lt;br /&gt;EasyMock.expectLastCall().once();&lt;br /&gt;&lt;br /&gt;Capture&lt;RetrievedHandler&gt; sorhCapture = new Capture&lt;RetrievedHandler&gt;();&lt;br /&gt;model.whenRetrieved(EasyMock.and(EasyMock.capture(sorhCapture), EasyMock.isA(RetrievedHandler.class)));&lt;br /&gt;EasyMock.expectLastCall().once();&lt;br /&gt;EasyMock.replay(adapter, model);&lt;br /&gt;&lt;br /&gt;new MyPresenter(model, adapter);&lt;br /&gt;EasyMock.verify(adapter, model);&lt;br /&gt;scannedHandler = ishCapture.getValue();&lt;br /&gt;retrievedHandler = sorhCapture.getValue();&lt;br /&gt;EasyMock.reset(adapter, model);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After that, I can call on the handlers directly.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;EasyMock.expect(adapter.getScanned()).andReturn(identifier).once();&lt;br /&gt;model.retrieve(identifier);&lt;br /&gt;EasyMock.expectLastCall().once();&lt;br /&gt;EasyMock.replay(adapter, model);&lt;br /&gt;scannedHandler.identifierScanned(); &lt;br /&gt;&lt;br /&gt;EasyMock.verify(adapter, model);&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/1691661231583466814-3174345286237066160?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3174345286237066160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/easymock-capture.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3174345286237066160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3174345286237066160'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/easymock-capture.html' title='EasyMock Capture'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4791596489643321633</id><published>2010-09-06T11:22:00.000-07:00</published><updated>2010-09-06T11:26:30.042-07:00</updated><title type='text'>NetBeans 6.9 Error "Module org.jdesktop.layout excluded from the target platform"</title><content type='html'>I am learning to use NetBeans 6.9.1 to create a Swing application, but the following error was thrown when I run build.&lt;br /&gt;&lt;br /&gt;/Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/harness/suite.xml:175: The following error occurred while executing this line:&lt;br /&gt;/Applications/NetBeans/NetBeans 6.9.1.app/Contents/Resources/NetBeans/harness/build.xml:168: Module org.jdesktop.layout excluded from the target platform&lt;br /&gt;   &lt;br /&gt;Did some googling, but couldn't find anything useful. I tried to search the word "org.jdesktop.layout" from the project and ah, found one entry in the platform.properties file.&lt;br /&gt;&lt;br /&gt;cluster.path=\&lt;br /&gt;    ${nbplatform.active.dir}/platform&lt;br /&gt;disabled.modules=\&lt;br /&gt;    org.jdesktop.layout,\&lt;br /&gt;    org.netbeans.api.visual,\&lt;br /&gt;    org.netbeans.core.execution,\&lt;br /&gt;    org.netbeans.core.multiview,\&lt;br /&gt;    org.netbeans.libs.jsr223,\&lt;br /&gt;    org.netbeans.modules.autoupdate.services,\&lt;br /&gt;    org.netbeans.modules.autoupdate.ui,\&lt;br /&gt;    org.netbeans.modules.core.kit,\&lt;br /&gt;    org.netbeans.modules.favorites,\&lt;br /&gt;    org.netbeans.modules.templates,\&lt;br /&gt;    org.openide.compat,\&lt;br /&gt;    org.openide.execution,\&lt;br /&gt;    org.openide.options,\&lt;br /&gt;    org.openide.util.enumerations&lt;br /&gt;nbplatform.active=default&lt;br /&gt;&lt;br /&gt;Tried to remove the following line &lt;br /&gt; org.jdesktop.layout,\&lt;br /&gt;&lt;br /&gt;then recompiled the code, it passed this time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4791596489643321633?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4791596489643321633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/netbeans-69-error-module.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4791596489643321633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4791596489643321633'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/netbeans-69-error-module.html' title='NetBeans 6.9 Error &quot;Module org.jdesktop.layout excluded from the target platform&quot;'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6949552741878006068</id><published>2010-09-05T17:47:00.000-07:00</published><updated>2010-09-05T17:50:00.879-07:00</updated><title type='text'>Convert ogv video file to avi file</title><content type='html'>The desktop session recorder recordmydesktop generates an ogv video file. To convert it to an avi file, just run the following command:&lt;br /&gt;&lt;br /&gt;mencoder -idx TelluriumWorksDemo.ogv -ovc lavc -oac mp3lame -o TelluriumWorksDemo.avi&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6949552741878006068?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6949552741878006068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/convert-ogv-video-file-to-avi-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6949552741878006068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6949552741878006068'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/convert-ogv-video-file-to-avi-file.html' title='Convert ogv video file to avi file'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5959513840763576406</id><published>2010-09-02T14:05:00.001-07:00</published><updated>2010-09-02T14:10:29.868-07:00</updated><title type='text'>Wired M2_HOME not recognized problem in IntelliJ IDEA 9</title><content type='html'>I suddenly run into a wired IntelliJ IDEA 9 problem. I have a Maven project and the IDEA cannot find the Maven dependencies. I traced the problem and found that the IDEA did not recognize the system M2_HOME variable. I use Mac OS X. After googling and found one  suggestion to create the following file:&lt;br /&gt;&lt;br /&gt;~/.MacOSX/environment.plist&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;"M2_HOME"="/usr/share/maven";&lt;br /&gt;M2="/usr/share/maven/bin";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Restarted IntelliJ and the Maven dependencis is back now. Still sound wired to me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5959513840763576406?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5959513840763576406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/wired-m2home-not-recognized-problem-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5959513840763576406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5959513840763576406'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/wired-m2home-not-recognized-problem-in.html' title='Wired M2_HOME not recognized problem in IntelliJ IDEA 9'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3883935665085027320</id><published>2010-09-02T07:21:00.000-07:00</published><updated>2010-09-02T07:27:18.235-07:00</updated><title type='text'>Maven 2.2.0 bug: escaped absolute path not valid</title><content type='html'>I switch to an iMac recently and I was not aware that it was using Maven 2.2.0 until I had a problem to run Maven command for one project. The error message is pretty misleading:&lt;br /&gt;&lt;br /&gt;[INFO] Invalid uri 'http://maven.kungfuters.org/nexus/content/repositories/thirdparty/org/springframework/spring-core/${spring.version}/spring-core-${spring.version}.pom': escaped absolute path not valid&lt;br /&gt;&lt;br /&gt;After googling and couple hours struggling, I got to know that is a bug in Maven 2.2.0, not really the escape problem (I tried to add the spring.version property in pom or Maven settings.xml, but problem was still there). I upgrade the maven to 2.2.1 and fortunately, the problem went away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3883935665085027320?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3883935665085027320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/maven-220-bug-escaped-absolute-path-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3883935665085027320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3883935665085027320'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/09/maven-220-bug-escaped-absolute-path-not.html' title='Maven 2.2.0 bug: escaped absolute path not valid'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5423691807210954622</id><published>2010-08-24T08:02:00.000-07:00</published><updated>2010-08-24T08:06:23.279-07:00</updated><title type='text'>Run Griffon app behind firewall</title><content type='html'>I tried to run a Griffon sample app called "Greet", but I got a "connection rejected" error because I am behind the fire wall. Seems the proxy setting for the Griffon setting does not apply for the application itself. To solve this problem, I added the following line to Initialize.groovy for the http proxy:&lt;br /&gt;&lt;br /&gt;System.properties['http.proxySet'] = true&lt;br /&gt;System.properties['http.proxyHost']='localhost'&lt;br /&gt;System.properties['http.proxyPort']='5865'&lt;br /&gt;&lt;br /&gt;After that, the "Greet" app run smoothly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5423691807210954622?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5423691807210954622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/run-griffon-app-behind-firewall.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5423691807210954622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5423691807210954622'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/run-griffon-app-behind-firewall.html' title='Run Griffon app behind firewall'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5106730348060567147</id><published>2010-08-20T06:30:00.000-07:00</published><updated>2010-08-20T06:32:51.104-07:00</updated><title type='text'>svn add new files recursively</title><content type='html'>I used meld a lot to do subversion merge. One problem for that is I have to manually add all the new files to svn. To do that, I work on command line and run the following command:&lt;br /&gt;&lt;br /&gt;svn add --force .&lt;br /&gt;&lt;br /&gt;where . is the current directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5106730348060567147?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5106730348060567147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/svn-add-new-file-recursively.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5106730348060567147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5106730348060567147'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/svn-add-new-file-recursively.html' title='svn add new files recursively'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-632023258773585367</id><published>2010-08-18T13:03:00.000-07:00</published><updated>2010-08-18T13:28:30.504-07:00</updated><title type='text'>My Firefox Plugin Development Experience with Tellurium IDE</title><content type='html'>Recently, I worked on a Firefox plugin called Tellurium IDE, which is a derivative from our existing Firefox Plugin Tellurium UI Module Plugin. The main features of the Tellurium IDE are to record, automatically generate Tellurium DSL scripts, and play tests. I like to share my experience with you, but I will not cover the basics of Firefox plugin development such as XUL, but mainly focus on the implementation details of the new features.&lt;br /&gt;&lt;br /&gt;Details on&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/FirefoxPluginDevelopmentWithTelluriumIDE&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-632023258773585367?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/632023258773585367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/my-firefox-plugin-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/632023258773585367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/632023258773585367'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/my-firefox-plugin-development.html' title='My Firefox Plugin Development Experience with Tellurium IDE'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3235094312167404638</id><published>2010-08-18T07:19:00.000-07:00</published><updated>2010-08-18T07:27:55.118-07:00</updated><title type='text'>griffon proxy setting</title><content type='html'>I tried out griffon 0.9 and the first problem I had was to get around the firewall proxy. I tried &lt;br /&gt;&lt;br /&gt;griffon add-proxy client --host=localhost --port=5865&lt;br /&gt;&lt;br /&gt;but got the following error:&lt;br /&gt;&lt;br /&gt;Running script /usr/local/griffon/scripts/AddProxy_.groovy&lt;br /&gt;Error executing script AddProxy: No such property: args for class: _GriffonArgParsing_groovy&lt;br /&gt;No such property: args for class: _GriffonArgParsing_groovy&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;also tried &lt;br /&gt;&lt;br /&gt;griffon set-proxy&lt;br /&gt;&lt;br /&gt;and got back the same error:&lt;br /&gt;&lt;br /&gt;Running script /usr/local/griffon/scripts/SetProxy_.groovy&lt;br /&gt;Error executing script SetProxy: No such property: args for class: _GriffonArgParsing_groovy&lt;br /&gt;No such property: args for class: _GriffonArgParsing_groovy&lt;br /&gt;&lt;br /&gt;It is really difficult to find support for griffon. Griffon has maillist, but lacks of a good GUI to show the posts and search. Not understand why they don't simply create a google user group.&lt;br /&gt;&lt;br /&gt;Dag a bit deeper into the code and saw that griffon actually uses grails set-proxy. I first run&lt;br /&gt;&lt;br /&gt;grails set-proxy&lt;br /&gt;&lt;br /&gt;without any problem. The configuration file is under ~/.grails/scripts/ProxyConfig.groovy&lt;br /&gt;&lt;br /&gt;Inspired by this, I created a file at ~/.griffon/scripts/ProxyConfig.groovy with the following content:&lt;br /&gt;&lt;br /&gt;proxyConfig = [proxyHost:'localhost',proxyPort:'5865',proxyUser:'',proxyPassword:'']&lt;br /&gt;&lt;br /&gt;Then run griffon add plugin command&lt;br /&gt;&lt;br /&gt;griffon install-plugin spring 0.3&lt;br /&gt;&lt;br /&gt;ah, it works this time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3235094312167404638?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3235094312167404638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/griffon-proxy-setting.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3235094312167404638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3235094312167404638'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/griffon-proxy-setting.html' title='griffon proxy setting'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7726819662731677797</id><published>2010-08-18T07:14:00.000-07:00</published><updated>2010-08-18T07:19:17.582-07:00</updated><title type='text'>gnome-subtitles</title><content type='html'>gnome-subtitles is a very good subtitle tool for you to add subtitles to your recorded video. You can load up the video in gnome-subtitles and type in texts for an interval that you want to apply. One good thing is that youtube supports subtitle.&lt;br /&gt;&lt;br /&gt;I used gnome-subtitles for my tellurium-ide tutorial, you can see the effect here:&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=yVIBY8QzWzE&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7726819662731677797?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7726819662731677797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/gnome-subtitles.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7726819662731677797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7726819662731677797'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/gnome-subtitles.html' title='gnome-subtitles'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1517558837016228894</id><published>2010-08-11T20:10:00.000-07:00</published><updated>2010-08-11T20:13:13.577-07:00</updated><title type='text'>recordmydesktop: another Linux desktop session recorder</title><content type='html'>I used istanbul and came across another Linux desktop session recorder: recordmydesktop.&lt;br /&gt;&lt;br /&gt;To install it, run&lt;br /&gt;&lt;br /&gt;yum install -y recordmydesktop&lt;br /&gt;&lt;br /&gt;To run it, use the following command on command line:&lt;br /&gt;&lt;br /&gt;recordmydesktop&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1517558837016228894?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1517558837016228894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/recordmydesktop-another-linux-desktop.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1517558837016228894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1517558837016228894'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/recordmydesktop-another-linux-desktop.html' title='recordmydesktop: another Linux desktop session recorder'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-290036622725042513</id><published>2010-08-10T10:29:00.000-07:00</published><updated>2010-08-10T10:30:44.393-07:00</updated><title type='text'>https proxy for Maven</title><content type='html'>If your Maven repositories use both http and https, you can specify the http proxy in the settings.xml and the https proxy in Maven command line as follows:&lt;br /&gt;&lt;br /&gt;mvn install -Dhttps.proxyHost=localhost -Dhttps.proxyPort=5865&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-290036622725042513?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/290036622725042513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/https-proxy-for-maven.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/290036622725042513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/290036622725042513'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/08/https-proxy-for-maven.html' title='https proxy for Maven'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8930382076923429492</id><published>2010-07-30T12:59:00.000-07:00</published><updated>2010-07-30T13:03:23.964-07:00</updated><title type='text'>How to debug Firefox plugin initialization code</title><content type='html'>During firefox plugin development, we need to debug the initialization code sometimes. But once you open up the plugin and JavaScript debugger, the initialization code has already been executed before you could set a breakpoint in JavaScript debugger.&lt;br /&gt;&lt;br /&gt;The trick to get around this problem is to set breakpoints in the initialization code, then close the firefox plugin and reopen it, then the breakpoints will be hit in JavaScript debugger.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8930382076923429492?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8930382076923429492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/07/how-to-debug-firefox-plugin.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8930382076923429492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8930382076923429492'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/07/how-to-debug-firefox-plugin.html' title='How to debug Firefox plugin initialization code'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7927675677726999045</id><published>2010-07-26T07:49:00.001-07:00</published><updated>2010-07-26T07:55:50.951-07:00</updated><title type='text'>event data in jQuery bind and live</title><content type='html'>The jQuery bind and live methods are used to bind event handlers to event types. The difference is that the live method is actually bind to the document with a selector, which means, the web element does not need to be existing before the live method is called.&lt;br /&gt;&lt;br /&gt;One often ignored feature of the bind and live methods is that they support an optional eventData parameter. For example, I used the following live method to pass in the recorder object for my Trump project:&lt;br /&gt;&lt;br /&gt;$(window.document).find(":input, a, select, textarea, button, table, tr, td, th, div").live("click", {recorder: this}, this.clickListener);&lt;br /&gt;&lt;br /&gt;then in the clickListener function, I can get the recorder object as follows:&lt;br /&gt;&lt;br /&gt;var recorder = event.data.recorder;&lt;br /&gt;&lt;br /&gt;In this way, we can pass other data to the event handler as well. This feature is really cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7927675677726999045?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7927675677726999045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/07/event-data-in-jquery-bind-and-live.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7927675677726999045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7927675677726999045'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/07/event-data-in-jquery-bind-and-live.html' title='event data in jQuery bind and live'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6284698259466629354</id><published>2010-06-02T09:04:00.000-07:00</published><updated>2010-06-02T09:06:18.327-07:00</updated><title type='text'>Use Spring Test Context Framework</title><content type='html'>Seems Spring provides a TextContext framework to load up test context starting from 2.5. I haven't tried that feature until now.  The TextContext is very elegant to define the context by annotations. I list my steps to make it work here:&lt;br /&gt;&lt;br /&gt; http://code.google.com/p/jianwikis/wiki/SpringTestContextFramework&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6284698259466629354?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6284698259466629354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/06/use-spring-test-context-framework.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6284698259466629354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6284698259466629354'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/06/use-spring-test-context-framework.html' title='Use Spring Test Context Framework'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8468954654419481967</id><published>2010-05-19T08:20:00.001-07:00</published><updated>2010-05-19T08:22:13.449-07:00</updated><title type='text'>Tellurium 0.7.0 presentation</title><content type='html'>Tellurium 0.7.0 Presentation: &lt;div style="width:425px" id="__ss_4142197"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/John.Jian.Fang/tellurium-070-presentation-4142197" title="Tellurium 0.7.0 presentation"&gt;Tellurium 0.7.0 presentation&lt;/a&gt;&lt;/strong&gt;&lt;object id="__sse4142197" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=tellurium070presentation-100518152918-phpapp02&amp;stripped_title=tellurium-070-presentation-4142197" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse4142197" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=tellurium070presentation-100518152918-phpapp02&amp;stripped_title=tellurium-070-presentation-4142197" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/John.Jian.Fang"&gt;John.Jian.Fang&lt;/a&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/1691661231583466814-8468954654419481967?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8468954654419481967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/tellurium-070-presentation.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8468954654419481967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8468954654419481967'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/tellurium-070-presentation.html' title='Tellurium 0.7.0 presentation'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1094933805434348329</id><published>2010-05-17T12:39:00.000-07:00</published><updated>2010-05-17T12:54:40.689-07:00</updated><title type='text'>Oracle SQL Merge Statement</title><content type='html'>The Merge SQL statement was introduced in Oracle 9i and it combines the sequence of conditional INSERT and UPDATE commands in a single atomic statement, depending on the existence of a record. Merge is primarily designed for ETL (Extraction, Transformation, and Loading). However, we could also use it to work on a single table. &lt;br /&gt;&lt;br /&gt;The following is an example to use the Merge statement with the iBatis ORM framework.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;parameterMap id="BillingPackageInfoMap" class="com.mycompany.PackageInfoRecord"&amp;gt;&lt;br /&gt;        &amp;lt;parameter property="invoiceId" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/&amp;gt;&lt;br /&gt;        &amp;lt;parameter property="issueDate" jdbcType="TIMESTAMP" javaType="java.util.Date" mode="IN"/&amp;gt;&lt;br /&gt;        &amp;lt;parameter property="completePackageId" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/&amp;gt;&lt;br /&gt;        &amp;lt;parameter property="returnBillingId" jdbcType="INTEGER" javaType="int" mode="OUT"/&amp;gt;&lt;br /&gt;    &amp;lt;/parameterMap&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;procedure id="saveOrUpdateReturnBilling" parameterMap="BillingPackageInfoMap"&amp;gt;&lt;br /&gt;&lt;br /&gt;    DECLARE&lt;br /&gt;        tInvoiceId SHIP.RETURN_BILLING.INVOICE_ID%TYPE;&lt;br /&gt;        tIssueDate SHIP.RETURN_BILLING.ISSUE_DATE%TYPE;&lt;br /&gt;        tReturnBarcode SHIP.RETURN_BILLING.RETURN_BARCODE%TYPE;&lt;br /&gt;        tReturnBillingId SHIP.RETURN_BILLING.RETURN_BILLING_ID%TYPE := 1;&lt;br /&gt;    BEGIN&lt;br /&gt;        BEGIN&lt;br /&gt;            tInvoiceId := ?;&lt;br /&gt;            tIssueDate := ?;&lt;br /&gt;            tReturnBarcode := ?;&lt;br /&gt;            Merge INTO SHIP.RETURN_BILLING&lt;br /&gt;            USING DUAL&lt;br /&gt;            ON (return_barcode = tReturnBarcode)&lt;br /&gt;            WHEN MATCHED THEN&lt;br /&gt;                UPDATE&lt;br /&gt;                    SET invoice_id = tInvoiceId,&lt;br /&gt;                        issue_date = tIssueDate&lt;br /&gt;            WHEN NOT MATCHED THEN&lt;br /&gt;                INSERT&lt;br /&gt;                (invoice_id,&lt;br /&gt;                 issue_date,&lt;br /&gt;                 return_barcode);&lt;br /&gt;        EXCEPTION&lt;br /&gt;            WHEN others then&lt;br /&gt;            SELECT&lt;br /&gt;                -1&lt;br /&gt;            INTO&lt;br /&gt;                tReturnBillingId&lt;br /&gt;            FROM&lt;br /&gt;                DUAL;&lt;br /&gt;        END;&lt;br /&gt;        ? := tReturnBillingId;&lt;br /&gt;    END;  &lt;br /&gt;    &amp;lt;/procedure&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;On bad thing is that the "returning" statement is no longer supported for the Update and insert statements in the Merge statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1094933805434348329?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1094933805434348329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/oracle-sql-merge-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1094933805434348329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1094933805434348329'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/oracle-sql-merge-statement.html' title='Oracle SQL Merge Statement'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7731613464526265352</id><published>2010-05-13T13:23:00.000-07:00</published><updated>2010-05-14T06:56:20.508-07:00</updated><title type='text'>My open source developement experiences with Tellurium</title><content type='html'>About two years ago, I started the open source project: "Tellurium Automated Testing Framework", or Tellurium in short. Tellurium is my first open source project. I like to share with you about my experiences in open source development.&lt;br /&gt;&lt;br /&gt;First, the good parts. To be involved in an open source project, you can learn and exploit a lot of new Technologies. For example, I tried Groovy, jQuery, AntLR 3, and Maven archetypes in Tellurium. I don't think I could have these experiences without developing Tellurium. I work for a company. Usually, the enterprise is very conservative about new technologies and does not really like to adopt them until the technologies are very mature in IT industry. I cannot image my company allows me to use Groovy in production at the current stage. &lt;br /&gt;&lt;br /&gt;For open source projects, more or less, we work in a team. It is a great chance to get to know a lot of talented people. Gradually, we can build up a good social network. Tellurium developers came from different countries such as the States, UK, China, and India. We presented Tellurium in Rich Web experience 2009 conference and we talked to some big guys in IT. This type of experiences is very helpful for our own careers. &lt;br /&gt;&lt;br /&gt;More exciting part is that you don't know how far your project can go. As we paved our own way to the future, we may be able to build a very useful and popular project. Tellurium is not at this stage yet. But Tellurium keeps evolving and it is a project with many novel ideas. With more contributors and bigger communities, we can build a better Tellurium for you. &lt;br /&gt;&lt;br /&gt;Well, how about the bad parts then? First, open source project management is extremely difficult. Here I am talking about the open source projects purely built by our own free time, not type of the big projects that are sponsored by big companies. Usually, open source contributors come and go. It is very difficult to maintain an active core members. Furthermore, all developers contributed their own free time without getting paid, you cannot really use the management style in a corporate. Instead, we have to use a more soft way to manage the project. If someone did not complete the task, some one has to take it over. Sometimes, the rule "20-80" applies, i.e. 20% people finish 80% of work. The only way to attract developers is their interests in the project. Honestly, Tellurium is not very successful in project management. We need a better way to attract more developers to build a stronger team.&lt;br /&gt;&lt;br /&gt;Open source project development is very time consuming, especially for people with a full time job like me. I have to spend every minute I can find to work on the project. Sometimes, I am buried deeply in the project and really don't have too much time to spend in other areas. For example, I have very high interest in data streaming network and strategy game development, but I cannot really have time to work on them. &lt;br /&gt;&lt;br /&gt;Frustration may also accompany you if the project does not go well. It is really sad if you spend a lot of time to develop something, but nobody really cares about it. Not all great ideas can be adopted by people very quickly. For a successful project, you may need the "right time and right place". After-all, the percentage of open source projects become popular is way too small. What you can do is just to try your best.&lt;br /&gt;&lt;br /&gt;Open source project development is really a personal choice. If you have chosen it, stick it and don't complain too much and look forward. Always think about "how I can improve" instead of "Damn, they don't like it".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7731613464526265352?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7731613464526265352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/my-open-source-developement-experiences.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7731613464526265352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7731613464526265352'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/my-open-source-developement-experiences.html' title='My open source developement experiences with Tellurium'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7374482624145339128</id><published>2010-05-05T09:44:00.000-07:00</published><updated>2010-05-05T09:46:17.095-07:00</updated><title type='text'>Build Tellurium Reference Document with Docbkx Maven Plugin</title><content type='html'>DocBook is an XML vocabulary that lets you create documents in a presentation-neutral form that captures the logical structure of your content. Tellurium 0.7.0 starts to use docbook to build the reference document. This article introduced how to use Docbkx Maven plugin to build DocBook V5.0 pdf files. Maven configuration, DocBook frequently used tags, code sample, and generated pdf files.&lt;br /&gt;&lt;br /&gt;The full article is available at&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/BuildTelluriumReferenceDocumentWithDocbkxMavenPlugin&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7374482624145339128?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7374482624145339128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/build-tellurium-reference-document-with.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7374482624145339128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7374482624145339128'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/05/build-tellurium-reference-document-with.html' title='Build Tellurium Reference Document with Docbkx Maven Plugin'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7045549999941394360</id><published>2010-04-30T11:28:00.000-07:00</published><updated>2010-04-30T11:33:17.878-07:00</updated><title type='text'>herold: convert html to docbook</title><content type='html'>Recently, I work on Tellurium 0.7.0 user guide. I use docbook to generate the pdf file from xml source file. Since we have a lot of wiki documents that need to be coverted to docbook xml format, it would be great if I could use some automation tool. Herold is one of them. I downloaded herold from&lt;br /&gt;&lt;br /&gt;http://www.michael-a-fuchs.de/&lt;br /&gt;&lt;br /&gt;then convert the html file to docbook with the following command:&lt;br /&gt;&lt;br /&gt;herold --in=udl.html --out=udl.xml -r book -T&lt;br /&gt;&lt;br /&gt;where in is input file and out is output file. The style is a book, not an article.&lt;br /&gt;&lt;br /&gt;Unfortunately, herold is pretty old and it converts html to docbook version 1.0. But I use the new version 5.0. I have to manually change a lot of stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7045549999941394360?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7045549999941394360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/herold-convert-html-to-docbook.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7045549999941394360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7045549999941394360'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/herold-convert-html-to-docbook.html' title='herold: convert html to docbook'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-997834354188679982</id><published>2010-04-29T07:46:00.000-07:00</published><updated>2010-04-29T11:54:41.020-07:00</updated><title type='text'>iMac commands</title><content type='html'>Just got a 27" iMac at work. Found some useful commands.&lt;br /&gt;&lt;br /&gt;1) current operating system version and build number&lt;br /&gt;&lt;br /&gt; sw_vers&lt;br /&gt;&lt;br /&gt;2) System information&lt;br /&gt;&lt;br /&gt;system_profiler &lt;br /&gt;&lt;br /&gt;3) Cut and Paste&lt;br /&gt;&lt;br /&gt;cmd + c /cmd + v&lt;br /&gt;&lt;br /&gt;4) Zoom&lt;br /&gt;&lt;br /&gt;cmd + "+" /cmd + "-"&lt;br /&gt;&lt;br /&gt;5) Toogle applications&lt;br /&gt;&lt;br /&gt;cmd + "~"&lt;br /&gt;&lt;br /&gt;6) Switch applications&lt;br /&gt;&lt;br /&gt;cmd + tab&lt;br /&gt;&lt;br /&gt;7) List all applications&lt;br /&gt;&lt;br /&gt;fn + F9&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-997834354188679982?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/997834354188679982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/imac-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/997834354188679982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/997834354188679982'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/imac-commands.html' title='iMac commands'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8987128825335739767</id><published>2010-04-13T14:00:00.000-07:00</published><updated>2010-04-13T14:02:33.276-07:00</updated><title type='text'>Tellurium 0.7.0 RC2 is out</title><content type='html'>After two months' hard work, Tellurium 0.7.0 RC2 is out now. &lt;br /&gt;&lt;br /&gt;The release announcement is here:&lt;br /&gt;&lt;br /&gt; http://code.google.com/p/aost/wiki/Tellurium070RC2Released&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8987128825335739767?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8987128825335739767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/tellurium-070-rc2-is-out.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8987128825335739767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8987128825335739767'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/tellurium-070-rc2-is-out.html' title='Tellurium 0.7.0 RC2 is out'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8507568734424704775</id><published>2010-04-01T10:05:00.000-07:00</published><updated>2010-04-01T10:12:50.237-07:00</updated><title type='text'>GIT behind firewall</title><content type='html'>I tried to reach GitHub behind firewall, but the connection got rejected. &lt;br /&gt;&lt;br /&gt;Then, I use NTLMAPS to set up a local proxy and do the following,&lt;br /&gt;&lt;br /&gt;export http_proxy=http://localhost:5865&lt;br /&gt;&lt;br /&gt;But this did not work for the protocol starting with git. For example, the following command&lt;br /&gt;&lt;br /&gt;git clone git://github.com/telluriumsource/tellurium.git tellurium&lt;br /&gt;&lt;br /&gt;returned the "Connection refused" error. The trick is to change the URL as follows,&lt;br /&gt;&lt;br /&gt;git clone http://github.com/telluriumsource/tellurium.git tellurium&lt;br /&gt;&lt;br /&gt;and the above command works fine. Seems GitHub supports http as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8507568734424704775?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8507568734424704775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/git-behind-firewall.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8507568734424704775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8507568734424704775'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/04/git-behind-firewall.html' title='GIT behind firewall'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6619678907328725477</id><published>2010-03-31T10:47:00.000-07:00</published><updated>2010-03-31T10:49:01.531-07:00</updated><title type='text'>Build Your Own Java Parser with ANTLR 3</title><content type='html'>ANTLR (ANother Tool for Language Recognition) is a parser generator. This article introduces how to use ANTLR 3 to create your own parser in Java. I use the Tellurium UID Description Language (UDL) as an example to walk you step by step. Maven dependencies, IDE support, code snippet, resources, and more.&lt;br /&gt;&lt;br /&gt;For the whole article, please see&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/BuildYourOwnJavaParserWithAntlr3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6619678907328725477?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6619678907328725477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/build-your-own-java-parser-with-antlr-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6619678907328725477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6619678907328725477'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/build-your-own-java-parser-with-antlr-3.html' title='Build Your Own Java Parser with ANTLR 3'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-667264296341627086</id><published>2010-03-23T17:37:00.000-07:00</published><updated>2010-03-23T17:41:07.481-07:00</updated><title type='text'>Use openssl to encrypt and decrypt files</title><content type='html'>Encryption:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;openssl aes-256-cbc -salt -in inputfile -out encryptedfile&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Decryption:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;openssl aes-256-cbc -d -in encryptedfile -out decryptedfile&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;where "aes-256-cbc" is the encryption algorithm, "-salt" is salt, and "-d" is decryption.&lt;br /&gt;&lt;br /&gt;For more commands, please use "openssl help".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-667264296341627086?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/667264296341627086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/use-openssl-to-encrypt-and-decrypt.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/667264296341627086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/667264296341627086'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/use-openssl-to-encrypt-and-decrypt.html' title='Use openssl to encrypt and decrypt files'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2490181119784208410</id><published>2010-03-19T13:16:00.000-07:00</published><updated>2010-03-19T13:21:46.397-07:00</updated><title type='text'>create ssh public key for GitHub</title><content type='html'>GitHub requires at least one SSH public key to upload code to Git repo. To create the ssh public key is very simple in Linux with the following command.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[jfang@localhost ~]$ ssh-keygen -t rsa -C "jfang@telluriumsource.org"&lt;br /&gt;Generating public/private rsa key pair.&lt;br /&gt;Enter file in which to save the key (/home/jfang/.ssh/id_rsa): &lt;br /&gt;Enter passphrase (empty for no passphrase): &lt;br /&gt;Enter same passphrase again: &lt;br /&gt;Your identification has been saved in /home/jfang/.ssh/id_rsa.&lt;br /&gt;Your public key has been saved in /home/jfang/.ssh/id_rsa.pub.&lt;br /&gt;The key fingerprint is:&lt;br /&gt;0d:04:f6:91:86:5e:f2:db:02:52:3b:71:8a:0d:cd:f7 jfang@telluriumsource.org&lt;br /&gt;The key's randomart image is:&lt;br /&gt;+--[ RSA 2048]----+&lt;br /&gt;|     oooo.       |&lt;br /&gt;|    ..Bo*.       |&lt;br /&gt;|     * @o.       |&lt;br /&gt;|    o B .oE      |&lt;br /&gt;|     . oSo.      |&lt;br /&gt;|        o .      |&lt;br /&gt;|         .       |&lt;br /&gt;|                 |&lt;br /&gt;|                 |&lt;br /&gt;+-----------------+&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The public key then is stored in the file .ssh/id_rsa.pub. You should copy and paste&lt;br /&gt;the whole file to GitHub.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2490181119784208410?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2490181119784208410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/create-ssh-public-key-for-github.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2490181119784208410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2490181119784208410'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/create-ssh-public-key-for-github.html' title='create ssh public key for GitHub'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2195634751945792447</id><published>2010-03-18T09:32:00.000-07:00</published><updated>2010-03-18T09:33:11.575-07:00</updated><title type='text'>Sonar 2.0 is Out</title><content type='html'>Sonar is a very cool tool to check your code. The sonar 2.0 is out now.&lt;br /&gt;&lt;br /&gt;http://java.dzone.com/announcements/sonar-20-out&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2195634751945792447?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2195634751945792447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/sonar-20-is-out.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2195634751945792447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2195634751945792447'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/sonar-20-is-out.html' title='Sonar 2.0 is Out'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1464614233772242167</id><published>2010-03-10T13:50:00.000-08:00</published><updated>2010-03-10T13:52:16.330-08:00</updated><title type='text'>A* Algorithm for Path Planning in Java</title><content type='html'>Recently, I work on a warehouse optimization project. On interesting problem is to select an optimal pick tour for the pick agent, which is very much like a simplified path planning problem in a game world. I used the popular A* search algorithm and like to share with you about my Java implementation of the A* algorithm.&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/AStarAlgorithmForPathPlanning&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1464614233772242167?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1464614233772242167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/algorithm-for-path-planning-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1464614233772242167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1464614233772242167'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/algorithm-for-path-planning-in-java.html' title='A* Algorithm for Path Planning in Java'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2891187033631819493</id><published>2010-03-03T06:57:00.000-08:00</published><updated>2010-03-03T07:03:34.596-08:00</updated><title type='text'>javap</title><content type='html'>I was not aware that JDK 1.6 comes with a handy command javap to disassemble the Java Class File. One useful usage is to show all the methods in side a compiled Java class. &lt;br /&gt;&lt;br /&gt;For instance, I have a Widget.class compiled from a Groovy class, I run the following command and got the result as follows,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ javap Widget&lt;br /&gt;Compiled from "Widget.groovy"&lt;br /&gt;public abstract class org.telluriumsource.ui.widget.Widget extends org.telluriumsource.ui.object.UiObject{&lt;br /&gt;    protected org.telluriumsource.crosscut.i18n.IResourceBundle i18nBundle;&lt;br /&gt;    public static final java.lang.String NAMESPACE_SUFFIX;&lt;br /&gt;    public static java.lang.Long __timeStamp;&lt;br /&gt;    public static java.lang.Long __timeStamp__239_neverHappen1267567080619;&lt;br /&gt;    public org.telluriumsource.ui.widget.Widget();&lt;br /&gt;    public abstract void defineWidget();&lt;br /&gt;    public org.telluriumsource.ui.object.UiObject walkTo(org.telluriumsource.dsl.WorkflowContext, org.telluriumsource.dsl.UiID);&lt;br /&gt;    public java.lang.Object this$dist$invoke$3(java.lang.String, java.lang.Object);&lt;br /&gt;    public void this$dist$set$3(java.lang.String, java.lang.Object);&lt;br /&gt;    public java.lang.Object this$dist$get$3(java.lang.String);&lt;br /&gt;    public int getTableMaxColumnNumForTbody(java.lang.String, int);&lt;br /&gt;    public java.lang.Object mouseOut(java.lang.String);&lt;br /&gt;    public void enableMacroCmd();&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If I run javap with a different option, I got the following results:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ javap -c Widget&lt;br /&gt;Compiled from "Widget.groovy"&lt;br /&gt;public abstract class org.telluriumsource.ui.widget.Widget extends org.telluriumsource.ui.object.UiObject{&lt;br /&gt;protected org.telluriumsource.crosscut.i18n.IResourceBundle i18nBundle;&lt;br /&gt;&lt;br /&gt;public static final java.lang.String NAMESPACE_SUFFIX;&lt;br /&gt;&lt;br /&gt;public static java.lang.Long __timeStamp;&lt;br /&gt;&lt;br /&gt;public static java.lang.Long __timeStamp__239_neverHappen1267567080619;&lt;br /&gt;&lt;br /&gt;public org.telluriumsource.ui.widget.Widget();&lt;br /&gt;  Code:&lt;br /&gt;   0:   aload_0&lt;br /&gt;   1:   invokespecial   #24; //Method org/telluriumsource/ui/object/UiObject."&lt;init&gt;":()V&lt;br /&gt;   4:   invokestatic    #28; //Method $getCallSiteArray:()[Lorg/codehaus/groovy/runtime/callsite/CallSite;&lt;br /&gt;   7:   astore_1&lt;br /&gt;   8:   aload_1&lt;br /&gt;   9:   ldc     #29; //int 0&lt;br /&gt;   11:  aaload&lt;br /&gt;   12:  invokestatic    #33; //Method $get$$class$org$telluriumsource$ui$widget$WidgetDslContext:()Ljava/lang/Class;&lt;br /&gt;   15:  invokeinterface #39,  2; //InterfaceMethod org/codehaus/groovy/runtime/callsite/CallSite.callConstructor:(Ljava/lang/Object;)Ljava/lang/Object;&lt;br /&gt;   20:  dup&lt;br /&gt;   21:  invokestatic    #33; //Method $get$$class$org$telluriumsource$ui$widget$WidgetDslContext:()Ljava/lang/Class;&lt;br /&gt;   24:  invokestatic    #45; //Method org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType:(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;&lt;br /&gt;   27:  checkcast       #47; //class org/telluriumsource/ui/widget/WidgetDslContext&lt;br /&gt;   30:  aload_0&lt;br /&gt;   31:  swap&lt;br /&gt;   32:  putfield        #49; //Field dsl:Lorg/telluriumsource/ui/widget/WidgetDslContext;&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/1691661231583466814-2891187033631819493?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2891187033631819493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/javap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2891187033631819493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2891187033631819493'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/03/javap.html' title='javap'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8912015635097273390</id><published>2010-02-18T11:15:00.000-08:00</published><updated>2010-02-18T11:19:26.712-08:00</updated><title type='text'>Aqua Data Studio with OID</title><content type='html'>Aqua Data Studio supports OID connection although the UI is a bit confusing.&lt;br /&gt;&lt;br /&gt;For example, I have a data source connection string &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;jdbc:oracle:thin:@ldap://kpoid.telluriumsource.com:2389/cn=OracleContext,dc=telluriumsource,dc=com/apps_dev01&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I need to set up the server as follows.&lt;br /&gt;&lt;br /&gt;Host: ldap://kpoid.telluriumsource.com&lt;br /&gt;Port: 2389&lt;br /&gt;SID: cn=OracleContext,dc=telluriumsource,dc=com/apps_dev01&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8912015635097273390?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8912015635097273390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/aqua-data-studio-with-oid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8912015635097273390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8912015635097273390'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/aqua-data-studio-with-oid.html' title='Aqua Data Studio with OID'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4238647149123047438</id><published>2010-02-11T10:45:00.000-08:00</published><updated>2010-02-11T10:46:49.259-08:00</updated><title type='text'>Tellurium 0.7.0 RC1 is Available Now</title><content type='html'>Tellurium 0.7.0 RC1 is out now. Over 150 issues have been closed. The issues include new features, bugs fixings, and other enhancements requested by users. There are some fundamental changes in Tellurium 0.7.0 compared with Tellurium 0.6.0 such as the group locating algorithm, UI module caching, Macro command, jQuery-based new APIs, and i18n support.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tellurium 0.7.0 RC1 tar ball can be downloaded from http://aost.googlecode.com/files/tellurium-0.7.0-RC1.tar.gz. You can also find Tellurium core and custom selenium server from the following Maven repositories, respectively.&lt;br /&gt;&lt;br /&gt;http://maven.kungfuters.org/content/repositories/releases/org/telluriumsource/tellurium-core/0.7.0-RC1/&lt;br /&gt;&lt;br /&gt;http://maven.kungfuters.org/content/repositories/thirdparty/org/seleniumhq/selenium/server/selenium-server/1.0.1-te2-RC1/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4238647149123047438?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4238647149123047438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/tellurium-070-rc1-is-available-now.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4238647149123047438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4238647149123047438'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/tellurium-070-rc1-is-available-now.html' title='Tellurium 0.7.0 RC1 is Available Now'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5623226340404057764</id><published>2010-02-10T09:32:00.000-08:00</published><updated>2010-02-10T09:37:48.732-08:00</updated><title type='text'>html2latex</title><content type='html'>I like to convert a html document to latex format. I searched the web and found a perl script from&lt;br /&gt;&lt;br /&gt;http://sourceforge.net/projects/html2latex/&lt;br /&gt;&lt;br /&gt;Install the Perl script, but got some problem to run it because of some errors such as&lt;br /&gt;&lt;br /&gt; Can't locate CPAN.pm in @INC&lt;br /&gt;&lt;br /&gt;Seems I missed couple Perl modules and I need the following steps&lt;br /&gt;&lt;br /&gt;1) yum install -y perl-CPAN&lt;br /&gt;2) Run Perl shell with the command "perl -MCPAN -e shell", then install the following modules&lt;br /&gt;  a) install HTML::Tree&lt;br /&gt;  b) install XML::Simple&lt;br /&gt;  c) install YAML&lt;br /&gt;  d) install HTML::TreeBuilder&lt;br /&gt;&lt;br /&gt;After the above steps, finally, I can run the "html2latex" command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5623226340404057764?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5623226340404057764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/html2latex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5623226340404057764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5623226340404057764'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/html2latex.html' title='html2latex'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6936666860815732867</id><published>2010-02-10T08:43:00.000-08:00</published><updated>2010-02-10T08:44:05.701-08:00</updated><title type='text'>Santa - A Novel UI group locating algorithm</title><content type='html'>UI Module is a group of nested UI elements or a UI widget and it is the heart of Tellurium Automated Testing Framework (Tellurium). Even UI Module was introduced at the prototype phase in early 2008, there was really no algorithm to locate the UI module as a whole. In Tellurium 0.7.0, a novel UI module group locating algorithm is designed to locate a UI module as whole at runtime. The concept such as branch and trim, lookId, lookAhead, relax, bonus point, and match score are covered as well as implementation details, examples, and more.&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/aost/wiki/SantaUiModuleGroupLocatingAlgorithm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6936666860815732867?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6936666860815732867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/santa-novel-ui-group-locating-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6936666860815732867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6936666860815732867'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/santa-novel-ui-group-locating-algorithm.html' title='Santa - A Novel UI group locating algorithm'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5903964694853999596</id><published>2010-02-09T08:05:00.000-08:00</published><updated>2010-02-09T08:08:34.896-08:00</updated><title type='text'>meld</title><content type='html'>My colleague showed me a cool merge tool, Meld. The project home is at&lt;br /&gt;&lt;br /&gt;http://meld.sourceforge.net/&lt;br /&gt;&lt;br /&gt;and in Linux, you can simply use the following command to install it.&lt;br /&gt;&lt;br /&gt;yum install -y meld&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5903964694853999596?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5903964694853999596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/meld.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5903964694853999596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5903964694853999596'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/meld.html' title='meld'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3796457393372724470</id><published>2010-02-08T16:47:00.000-08:00</published><updated>2010-02-08T16:51:29.816-08:00</updated><title type='text'>xvidcap</title><content type='html'>I use istanbel as a Linux desktop recorder, but one problem is that istanbel skips too many frames and thus leads to poor quality. Today, I found a better Linux desktop record xvidcap. I just download it from &lt;br /&gt;&lt;br /&gt;http://atrpms.net/dist/f12/xvidcap/&lt;br /&gt;&lt;br /&gt;and then run &lt;br /&gt;&lt;br /&gt;yum localinstall xvidcap-1.1.7-11.fc12.x86_64.rpm --nogpgcheck&lt;br /&gt;&lt;br /&gt;Another advantage of xvidcap is that you can specify an area to record, not just the whole desktop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3796457393372724470?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3796457393372724470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/xvidcap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3796457393372724470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3796457393372724470'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/02/xvidcap.html' title='xvidcap'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7526486000100476189</id><published>2010-01-21T09:51:00.000-08:00</published><updated>2010-01-21T09:57:39.754-08:00</updated><title type='text'>Groovy Grape class loader problem</title><content type='html'>I worked on a Groovy script to run tellurium DSL script. I used Groovy Grape to download all dependencies automatically and then run the DSL script. But seems the script always threw "class not found" exceptions even I used "grape resolve" to see the downloaded artifact correctly. &lt;br /&gt;&lt;br /&gt;After Googling for a while, I found the solution from stackoverflow. I have to put the classloader in the grab command as follows.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import groovy.grape.Grape;&lt;br /&gt;&lt;br /&gt;Grape.grab(group:'org.telluriumsource', module:'tellurium-core', version:'0.7.0-SNAPSHOT', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;Grape.grab(group:'org.stringtree', module:'stringtree-json', version:'2.0.10', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;Grape.grab(group:'caja', module:'json_simple', version:'r1', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;Grape.grab(group:'org.seleniumhq.selenium.server', module:'selenium-server', version:'1.0.1-te2', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;Grape.grab(group:'org.seleniumhq.selenium.client-drivers', module:'selenium-java-client-driver', version:'1.0.1', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;Grape.grab(group:'org.apache.poi', module:'poi', version:'3.0.1-FINAL', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;Grape.grab(group:'junit', module:'junit', version:'4.7', classLoader:this.class.classLoader.rootLoader)&lt;br /&gt;&lt;br /&gt;import org.telluriumsource.dsl.DslScriptExecutor&lt;br /&gt;&lt;br /&gt;@Grapes([&lt;br /&gt;   @Grab(group='org.codehaus.groovy', module='groovy-all', version='1.7.0'),&lt;br /&gt;   @Grab(group='org.seleniumhq.selenium.server', module='selenium-server', version='1.0.1-te2'),&lt;br /&gt;   @Grab(group='org.seleniumhq.selenium.client-drivers', module='selenium-java-client-driver', version='1.0.1'),&lt;br /&gt;   @Grab(group='junit', module='junit', version='4.7'),&lt;br /&gt;   @Grab(group='caja', module='json_simple', version='r1'),&lt;br /&gt;   @Grab(group='org.apache.poi', module='poi', version='3.0.1-FINAL'),&lt;br /&gt;   @Grab(group='org.stringtree', module='stringtree-json', version='2.0.10'),&lt;br /&gt;   @Grab(group='org.telluriumsource', module='tellurium-core', version='0.7.0-SNAPSHOT')&lt;br /&gt;])&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The wired thing is that I still need the @Grape section even I call grab directly. The good thing is it works now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7526486000100476189?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7526486000100476189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/groovy-grape-class-loader-problem.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7526486000100476189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7526486000100476189'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/groovy-grape-class-loader-problem.html' title='Groovy Grape class loader problem'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6510223810906721264</id><published>2010-01-20T08:21:00.000-08:00</published><updated>2010-01-20T08:23:57.605-08:00</updated><title type='text'>Run Grape behind a firewall</title><content type='html'>You can use one of the following two ways.&lt;br /&gt;&lt;br /&gt;1) export JAVA_OPTS environment variable. For example,&lt;br /&gt;   export JAVA_OPTS="-Dhttp.proxyHost=localhost -Dhttp.proxyPort=5865"&lt;br /&gt;   grape install org.mortbay.jetty jetty-embedded 6.1.14&lt;br /&gt;&lt;br /&gt;2) -Dhttp.proxyHost -Dhttp.proxyPort. For example,&lt;br /&gt;&lt;br /&gt;grape -Dhttp.proxyHost=localhost -Dhttp.proxyPort=5865 install org.mortbay.jetty jetty-embedded 6.1.14&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6510223810906721264?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6510223810906721264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/run-grape-behind-firewall.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6510223810906721264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6510223810906721264'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/run-grape-behind-firewall.html' title='Run Grape behind a firewall'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2759456442244904252</id><published>2010-01-19T07:39:00.000-08:00</published><updated>2010-01-19T07:41:18.020-08:00</updated><title type='text'>tellurium on twitter</title><content type='html'>Tellurium automated testing framework (tellurium) has an official twitter account: telluriumsource. Please follow http://twitter.com/telluriumsource for the latest update on Tellurium.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2759456442244904252?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2759456442244904252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/tellurium-on-twitter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2759456442244904252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2759456442244904252'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/tellurium-on-twitter.html' title='tellurium on twitter'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3635408617291951427</id><published>2010-01-08T14:10:00.000-08:00</published><updated>2010-01-08T14:29:42.199-08:00</updated><title type='text'>dvgrab + Kino</title><content type='html'>dvgrab is a linux command line tool to capture digital camera video via 1394 DV cable. &lt;br /&gt;Kino is an editing tool for digital camera raw data.&lt;br /&gt;&lt;br /&gt;To install them, simply run&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum install -y kino dvgrab&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To use dvgrab, first connect your digital camera to your computer using the 1394 cable, then run&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;dvgrab test-&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above command will dump all videos from your camera into one or multiple files starting with test-. For example,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;test-001.dv&lt;br /&gt;test-002.dv&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then, you can use Kino to edit the files and export them into different formats such as MPEG-2, MPEG-4, Ogg, VCD, or even DVD formats.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3635408617291951427?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3635408617291951427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/dvgrab-kino.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3635408617291951427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3635408617291951427'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/dvgrab-kino.html' title='dvgrab + Kino'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-239349989396734283</id><published>2010-01-05T21:00:00.000-08:00</published><updated>2010-01-05T21:20:26.596-08:00</updated><title type='text'>Linux configuration for dell studio xps</title><content type='html'>I bought a dell studio xps recently with a GeForce GT 220 video card and a Dell ST2010 Flat panel. I installed Fedora 12, but it took me some time to configure the video card and the monitor correctly because they are pretty new.&lt;br /&gt;&lt;br /&gt;For nvidia support, I did the following steps&lt;br /&gt;&lt;br /&gt;1) yum install nvidia&lt;br /&gt;2) go to the following site to download the latest nvidia drivers&lt;br /&gt;&lt;br /&gt;ftp://download.nvidia.com/XFree86/Linux-x86_64/&lt;br /&gt;&lt;br /&gt;I tried NVIDIA-Linux-x86_64-195.30-pkg0.run first because its date was the latest.&lt;br /&gt;&lt;br /&gt;I entered the text mode and run the following command,&lt;br /&gt;&lt;br /&gt;sh NVIDIA-Linux-x86_64-195.30-pkg0.run&lt;br /&gt;&lt;br /&gt;But it turned out that actually 190.53 was the latest instead when I run&lt;br /&gt;&lt;br /&gt;nvidia-installer --update&lt;br /&gt;&lt;br /&gt;Happily it automatically downloaded the NVIDIA-Linux-x86_64-190.53-pkg2.run package&lt;br /&gt;and configured it for me.&lt;br /&gt;&lt;br /&gt;The biggest trouble for me was that the Dell ST2010 monitor cannot be recognized by&lt;br /&gt;Fedora 12. I tried &lt;br /&gt;&lt;br /&gt;Xorg -configure&lt;br /&gt;  &lt;br /&gt;but without any luck. Finally, I had to manually set up the monitor section such as&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Section "Monitor"&lt;br /&gt;  Identifier "Dell ST2010"&lt;br /&gt;  Vendorname "Dell"&lt;br /&gt;  Modelname "ST2010"&lt;br /&gt;  modeline "640x480@60" 25.2 640 656 752 800 480 490 492 525 -vsync -hsync&lt;br /&gt;  modeline "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync&lt;br /&gt;  modeline "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -vsync -hsync&lt;br /&gt;  modeline "1600x900@60" 120.42 1600 1632 2088 2120 900 918 927 946 +hsync -vsync&lt;br /&gt;EndSection&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then set up the Screen section:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Section "Screen"&lt;br /&gt;        Identifier "Default Screen"&lt;br /&gt;        Device     "Videocard0"&lt;br /&gt;        Monitor    "Dell ST2010"&lt;br /&gt;        DefaultDepth     24&lt;br /&gt;        Option      "AddARGBGLXVisuals" "True"&lt;br /&gt;        SubSection "Display"&lt;br /&gt;                Viewport   0 0&lt;br /&gt;                Depth     24&lt;br /&gt;#               Virtual 1600 900&lt;br /&gt;                Modes "1600x900@60" "1024x768@60" "1280x960@60" "800x600@60" "640x480@60"&lt;br /&gt;        EndSubSection&lt;br /&gt;EndSection&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You may want to ask how did I generate the modelines? Here is the trick:&lt;br /&gt;&lt;br /&gt;1) Google and find the Dell ST2010 specification at&lt;br /&gt;&lt;br /&gt;http://support.dell.com/support/edocs/monitors/ST2010/en/ug/about.htm&lt;br /&gt;&lt;br /&gt;2) Go to the following website to generate the modelines using the data from the specification.&lt;br /&gt;&lt;br /&gt;http://xtiming.sourceforge.net/cgi-bin/xtiming.pl&lt;br /&gt;&lt;br /&gt;To test the configuration, you may like first go to the text mode&lt;br /&gt;&lt;br /&gt;init 3&lt;br /&gt;&lt;br /&gt;modify the /etc/X11/xorg.conf and then run&lt;br /&gt;&lt;br /&gt;startx&lt;br /&gt;&lt;br /&gt;If the configuration does not work, simply control+C to exit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-239349989396734283?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/239349989396734283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/linux-configuration-for-dell-studio-xps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/239349989396734283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/239349989396734283'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2010/01/linux-configuration-for-dell-studio-xps.html' title='Linux configuration for dell studio xps'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4846081545971733127</id><published>2009-12-23T09:43:00.001-08:00</published><updated>2009-12-24T08:33:31.906-08:00</updated><title type='text'>How to list all properties and methods of a Javascript object in Firebug</title><content type='html'>The idea is from this post&lt;br /&gt;&lt;br /&gt;http://www.irt.org/script/500.htm&lt;br /&gt;&lt;br /&gt;I modified it a bit so that it runs in Firebug.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function interrogate(what) {&lt;br /&gt;    var output = '';&lt;br /&gt;    for (var i in what)&lt;br /&gt;        output += i+ '\n';&lt;br /&gt;    console.log(output);&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For example, te is an Tellurium object, run&lt;br /&gt;&lt;br /&gt;interrogate(te) &lt;br /&gt;&lt;br /&gt;and you will see the following result.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;cache currentWindow currentDocument macroCmd isUseTeApi cbCache teApi apiMap initialize &lt;br /&gt;registerApi isApiMissing parseMacroCmd prepareArgumentList getUiElementFromCache dispatchCommand&lt;br /&gt;locate isLocator camelizeApiName delegateToSelenium processMacroCmd locateElementByCSSSelector &lt;br /&gt;getDOMElement getDOMAttributeNode convResult parseLocator validateResult &lt;br /&gt;locateElementByCacheAwareCSSSelector &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Another more direct and more powerful way is to use the console.dir API from Firebug&lt;br /&gt;&lt;br /&gt;http://getfirebug.com/console.html&lt;br /&gt;&lt;br /&gt;That is to say,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;console.dir(what);&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/1691661231583466814-4846081545971733127?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4846081545971733127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/how-to-list-all-properties-and-methods.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4846081545971733127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4846081545971733127'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/how-to-list-all-properties-and-methods.html' title='How to list all properties and methods of a Javascript object in Firebug'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6312294986785921718</id><published>2009-12-17T11:36:00.000-08:00</published><updated>2009-12-17T11:37:26.540-08:00</updated><title type='text'>Run jQuery QUnit tests from Java</title><content type='html'>QUnit is a powerful, easy-to-use, JavaScript? test suite. It can be used to test jQuery code and jQuery plugins as well as any generic JavaScript? code. Like JsUnit or any other javascript testing frameworks, QUnit needs to be run in a web browser. How good it is if we could run QUnit from Java code directly and don't need to worry about how to construct a web page and load it up with a browser?&lt;br /&gt;&lt;br /&gt;Here we introduce one way to implement the above idea. The basic idea is to use Java 6 http server to run a web page created by Java code. A web page is created dynamically using Java to include QUnit tests and TelluriumJunitTestCase is extended to automatically open the web page in a web browser. &lt;br /&gt;&lt;br /&gt;More details on &lt;br /&gt;&lt;br /&gt;http://code.google.com/p/aost/wiki/RunQUnitFromJava&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6312294986785921718?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6312294986785921718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/run-jquery-qunit-tests-from-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6312294986785921718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6312294986785921718'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/run-jquery-qunit-tests-from-java.html' title='Run jQuery QUnit tests from Java'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5531615820662832256</id><published>2009-12-16T13:15:00.000-08:00</published><updated>2009-12-16T13:18:19.485-08:00</updated><title type='text'>Google’s Safe Browser</title><content type='html'>Just got to know that Google provides a safe browser capability from the blog&lt;br /&gt;&lt;br /&gt;http://webhostinghelpguy.inmotionhosting.com/web-hosting/website-security-part-2-detecting-a-hack/&lt;br /&gt;&lt;br /&gt;The URL pattern is &lt;br /&gt;&lt;br /&gt;http://www.google.com/safebrowsing/diagnostic?site=http://www.yourwebsite.com&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;&lt;br /&gt;http://www.google.com/safebrowsing/diagnostic?site=telluriumsource.org&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5531615820662832256?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5531615820662832256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/googles-safe-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5531615820662832256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5531615820662832256'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/googles-safe-browser.html' title='Google’s Safe Browser'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5684127267356093158</id><published>2009-12-16T12:22:00.000-08:00</published><updated>2009-12-16T12:30:50.996-08:00</updated><title type='text'>Sonar: an open source quality management platform</title><content type='html'>Sonar is an open source quality management platform, dedicated to continuously analyze and measure technical quality. &lt;br /&gt;&lt;br /&gt;http://sonar.codehaus.org/features/&lt;br /&gt;&lt;br /&gt;Sonar is a really powerful tool and it can analyze your code and report various code format problems, potential bugs, test coverage, and a lot more.&lt;br /&gt;&lt;br /&gt;Sonar is very easy to set up, simply unzip, modify the configuration, setup mysql data store, and run it.&lt;br /&gt;&lt;br /&gt;http://docs.codehaus.org/display/SONAR/Install+Sonar&lt;br /&gt;&lt;br /&gt;After that, you can go to your Maven project and simply run&lt;br /&gt;&lt;br /&gt;Maven clean install sonar:sonar&lt;br /&gt;&lt;br /&gt;All results will be pushed to the sonar data store and now you can view all of them from&lt;br /&gt;your web browser, even look at the code snippets that may cause some problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5684127267356093158?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5684127267356093158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/sonar-open-source-quality-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5684127267356093158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5684127267356093158'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/sonar-open-source-quality-management.html' title='Sonar: an open source quality management platform'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7541220288569509315</id><published>2009-12-10T12:26:00.000-08:00</published><updated>2009-12-10T12:30:56.925-08:00</updated><title type='text'>jmap</title><content type='html'>jmap is a command to dump the heap of a running application. Here is a good blog on this topic:&lt;br /&gt;&lt;br /&gt;http://blogs.sun.com/alanb/entry/heap_dumps_are_back_with&lt;br /&gt;&lt;br /&gt;For example, run the following command and you will see the result:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&gt; jmap 5631&lt;br /&gt;Attaching to process ID 5631, please wait...&lt;br /&gt;Debugger attached successfully.&lt;br /&gt;Server compiler detected.&lt;br /&gt;JVM version is 14.3-b01&lt;br /&gt;0x0000000040000000 49K /usr/java/jdk1.6.0_17/bin/java&lt;br /&gt;0x0000003747a00000 180K /lib64/ld-2.11.so&lt;br /&gt;0x0000003747e00000 2348K /lib64/libc-2.11.so&lt;br /&gt;0x0000003748200000 30K /lib64/libdl-2.11.so&lt;br /&gt;0x0000003748600000 199K /lib64/libpthread-2.11.so&lt;br /&gt;0x0000003748a00000 615K /lib64/libm-2.11.so&lt;br /&gt;0x0000003749200000 56K /lib64/librt-2.11.so&lt;br /&gt;0x0000003749600000 1277K /usr/lib64/libX11.so.6.3.0&lt;br /&gt;0x0000003749e00000 12K /usr/lib64/libXau.so.6.0.0&lt;br /&gt;0x000000374a200000 110K /usr/lib64/libxcb.so.1.1.0&lt;br /&gt;0x000000374aa00000 119K /lib64/libresolv-2.11.so&lt;br /&gt;0x000000374ae00000 75K /usr/lib64/libXext.so.6.4.0&lt;br /&gt;0x000000374ba00000 23K /usr/lib64/libXfixes.so.3.1.0&lt;br /&gt;0x000000374d200000 41K /usr/lib64/libXrender.so.1.3.0&lt;br /&gt;0x000000374d600000 61K /usr/lib64/libXi.so.6.1.0&lt;br /&gt;0x000000374de00000 41K /usr/lib64/libXcursor.so.1.0.2&lt;br /&gt;0x000000374ea00000 34K /usr/lib64/libXrandr.so.2.2.0&lt;br /&gt;0x0000003757e00000 25K /usr/lib64/libXtst.so.6.1.0&lt;br /&gt;0x0000003758600000 154K /lib64/libnsl-2.11.so&lt;br /&gt;0x00007f9f426e1000 143K /tmp/jna4030808797710417467.tmp&lt;br /&gt;0x00007f9f43cf9000 29K /lib64/libnss_dns-2.11.so&lt;br /&gt;0x00007f9f680f4000 213K /usr/java/jdk1.6.0_17/jre/lib/amd64/libdcpr.so&lt;br /&gt;0x00007f9f84a1d000 37K /usr/java/jdk1.6.0_17/jre/lib/amd64/libmanagement.so&lt;br /&gt;0x00007f9f85045000 7K /usr/java/jdk1.6.0_17/jre/lib/amd64/libjawt.so&lt;br /&gt;0x00007f9f854d7000 140K /tmp/jna8909216851551683645.tmp&lt;br /&gt;0x00007f9f86407000 43K /usr/java/jdk1.6.0_17/jre/lib/amd64/libnio.so&lt;br /&gt;0x00007f9f86610000 680K /usr/java/jdk1.6.0_17/jre/lib/amd64/libfontmanager.so&lt;br /&gt;0x00007f9f867b4000 383K /usr/java/jdk1.6.0_17/jre/lib/amd64/xawt/libmawt.so&lt;br /&gt;0x00007f9f86902000 741K /usr/java/jdk1.6.0_17/jre/lib/amd64/libawt.so&lt;br /&gt;0x00007f9f86c78000 109K /usr/java/jdk1.6.0_17/jre/lib/amd64/libnet.so&lt;br /&gt;0x00007f9fd4695000 89K /usr/java/jdk1.6.0_17/jre/lib/amd64/libzip.so&lt;br /&gt;0x00007f9fd47a9000 69K /lib64/libnss_files-2.11.so&lt;br /&gt;0x00007f9fd49dd000 54K /usr/java/jdk1.6.0_17/jre/lib/amd64/native_threads/libhpi.so&lt;br /&gt;0x00007f9fd4ae8000 229K /usr/java/jdk1.6.0_17/jre/lib/amd64/libjava.so&lt;br /&gt;0x00007f9fd4c17000 65K /usr/java/jdk1.6.0_17/jre/lib/amd64/libverify.so&lt;br /&gt;0x00007f9fd4e27000 10730K /usr/java/jdk1.6.0_17/jre/lib/amd64/server/libjvm.so&lt;br /&gt;0x00007f9fd583d000 47K /usr/java/jdk1.6.0_17/jre/lib/amd64/jli/libjli.so&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/1691661231583466814-7541220288569509315?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7541220288569509315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/jmap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7541220288569509315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7541220288569509315'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/jmap.html' title='jmap'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5129768041378436273</id><published>2009-12-08T10:10:00.000-08:00</published><updated>2009-12-08T10:18:21.484-08:00</updated><title type='text'>Implicit getter in Groovy caused stackoverflow problem</title><content type='html'>For example, we have a Groovy class A&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class A{&lt;br /&gt;  protected Connector connector;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Groovy will define the default setter and getter for the attribute connector, i.e., &lt;br /&gt;getConnector() and setConnector().&lt;br /&gt;&lt;br /&gt;If you have a subclass such as&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class B extends A{&lt;br /&gt;&lt;br /&gt;   Connector getConnector(){&lt;br /&gt;       return connector;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What will happen? You will get stackoverflow problem. The reason is that when you return connector, the implicit getter getConnector() is called and thus, the above code is same as&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    Connector getConnector(){&lt;br /&gt;       return getConnector();&lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;One way is to rename the attribute "connector" to "conn" to resolve the problem if you need an explicit getter or you need to implement an interface so that you can call it in your Java class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5129768041378436273?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5129768041378436273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/implicity-getter-in-groovy-caused.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5129768041378436273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5129768041378436273'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/implicity-getter-in-groovy-caused.html' title='Implicit getter in Groovy caused stackoverflow problem'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6062467093865763824</id><published>2009-12-08T06:24:00.000-08:00</published><updated>2009-12-08T06:33:56.037-08:00</updated><title type='text'>Transfer cassette tape video to computer</title><content type='html'>I have a camera I bought couple years ago with cassette tapes. I need to transfer the video I recorded to my computer. Of course, I could use 1394 Firewire. But my solution is a tricky one. &lt;br /&gt;&lt;br /&gt;I have a WinTV card installed in my computer. I connected my camera to the WinTV card using the video cable, thus, the camera worked as an external video input. I replayed the video on my camera, selected channel ext1 in winTV 2000, and then started recording. That is all.&lt;br /&gt;&lt;br /&gt;Be aware that you should select the video format as compressed, for instance, MPEG 4, otherwise, you may got the record file at the size of 20G!.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6062467093865763824?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6062467093865763824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/transfer-cassette-tape-video-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6062467093865763824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6062467093865763824'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/transfer-cassette-tape-video-to.html' title='Transfer cassette tape video to computer'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4517014281161099022</id><published>2009-12-07T16:21:00.000-08:00</published><updated>2009-12-07T16:22:18.598-08:00</updated><title type='text'>Tellurium at Rich Web Experience 2009</title><content type='html'>http://code.google.com/p/aost/wiki/TelluriumAtRichWebExperience2009&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4517014281161099022?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4517014281161099022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/tellurium-at-rich-web-experience-2009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4517014281161099022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4517014281161099022'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/12/tellurium-at-rich-web-experience-2009.html' title='Tellurium at Rich Web Experience 2009'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8249193353960796455</id><published>2009-11-24T07:44:00.000-08:00</published><updated>2009-11-24T07:48:34.559-08:00</updated><title type='text'>IntelliJ 9 Beta crashes with error "too many open files"</title><content type='html'>Seems from IntelliJ IDEA 9 SNAPSHOT version, this error keeps occurring, which is really a painful experience. One workaround is to make the number of system open files much bigger, for example, add the following two lines to the file: &lt;br /&gt;&lt;br /&gt;/etc/security/limits.conf &lt;br /&gt;&lt;br /&gt;*    hard nofile 65535&lt;br /&gt;*    soft nofile 65535&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8249193353960796455?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8249193353960796455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/11/intellij-9-beta-crashes-with-error-too.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8249193353960796455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8249193353960796455'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/11/intellij-9-beta-crashes-with-error-too.html' title='IntelliJ 9 Beta crashes with error &quot;too many open files&quot;'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3013180625759979881</id><published>2009-11-23T11:30:00.000-08:00</published><updated>2009-11-23T11:33:54.356-08:00</updated><title type='text'>lua libraries</title><content type='html'>Lua is an interesting language, especially if you work on C++/C project. Lua&lt;br /&gt;has core library and some external libraries. To see what lua libraries you Linux system provides, you can use the following command:&lt;br /&gt;&lt;br /&gt;&lt;prev&gt;&lt;br /&gt;yum search "lua-"&lt;br /&gt;&lt;/prev&gt;&lt;br /&gt;&lt;br /&gt;For instance, you will get the following results in fedora Linux:&lt;br /&gt;&lt;br /&gt;&lt;prev&gt;&lt;br /&gt;emacs-lua.noarch : Lua major mode for GNU Emacs&lt;br /&gt;emacs-lua-el.noarch : Elisp source files for Lua major mode under GNU Emacs&lt;br /&gt;lua-devel.i586 : Development files for lua&lt;br /&gt;lua-devel.x86_64 : Development files for lua&lt;br /&gt;lua-expat.x86_64 : SAX XML parser based on the Expat library&lt;br /&gt;lua-filesystem.x86_64 : File System Library for the Lua Programming Language&lt;br /&gt;lua-json.noarch : JSON Parser/Constructor for Lua&lt;br /&gt;lua-logging.noarch : A simple API to use logging features in Lua&lt;br /&gt;lua-lpeg.x86_64 : Parsing Expression Grammars for Lua&lt;br /&gt;lua-lunit.noarch : Unit testing framework for Lua&lt;br /&gt;lua-posix.x86_64 : A POSIX library for Lua&lt;br /&gt;lua-rex.x86_64 : Regular expression handling library for Lua&lt;br /&gt;lua-socket.x86_64 : Network support for the Lua language&lt;br /&gt;lua-sql.x86_64 : Database connectivity for the Lua programming language&lt;br /&gt;lua-sql-doc.x86_64 : Documentation for LuaSQL&lt;br /&gt;lua-sql-mysql.x86_64 : MySQL database connectivity for the Lua programming language&lt;br /&gt;lua-sql-postgresql.x86_64 : PostgreSQL database connectivity for the Lua programming language&lt;br /&gt;lua-sql-sqlite.x86_64 : SQLite database connectivity for the Lua programming language&lt;br /&gt;lua-static.x86_64 : Static library for lua&lt;br /&gt;&lt;/prev&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3013180625759979881?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3013180625759979881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/11/lua-libraries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3013180625759979881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3013180625759979881'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/11/lua-libraries.html' title='lua libraries'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7902027294384856651</id><published>2009-11-06T10:41:00.000-08:00</published><updated>2009-11-06T10:45:00.844-08:00</updated><title type='text'>Valgrind: debugging and profiling tools</title><content type='html'>Valgrind (http://valgrind.org/) tools that can automatically detect many memory management and threading bugs, and profile your programs in detail.&lt;br /&gt;&lt;br /&gt;To install it in Linux, run&lt;br /&gt;&lt;br /&gt;yum install valgrind&lt;br /&gt;&lt;br /&gt;To see the command options, run&lt;br /&gt;&lt;br /&gt;valgrind --help&lt;br /&gt;&lt;br /&gt;To profile a program, run&lt;br /&gt;&lt;br /&gt;valgrind --leak-check=yes myprog arg1 arg2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7902027294384856651?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7902027294384856651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/11/valgrind-debugging-and-profiling-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7902027294384856651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7902027294384856651'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/11/valgrind-debugging-and-profiling-tools.html' title='Valgrind: debugging and profiling tools'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7210952593148552801</id><published>2009-10-28T22:03:00.001-07:00</published><updated>2009-10-28T22:03:55.078-07:00</updated><title type='text'>locale in Linux</title><content type='html'>To show all supported locale in Linux, run the following command:&lt;br /&gt;&lt;br /&gt;locale -a&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7210952593148552801?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7210952593148552801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/locale-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7210952593148552801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7210952593148552801'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/locale-in-linux.html' title='locale in Linux'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5716793197176285249</id><published>2009-10-28T11:07:00.001-07:00</published><updated>2009-10-28T11:07:52.708-07:00</updated><title type='text'>From Good to Great Developer</title><content type='html'>Good point here: soft dev = development + maintenance &lt;br /&gt;&lt;br /&gt;http://www.infoq.com/presentations/Good-to-Great-Developer-Chris-Hedgate&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5716793197176285249?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5716793197176285249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/from-good-to-great-developer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5716793197176285249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5716793197176285249'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/from-good-to-great-developer.html' title='From Good to Great Developer'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8301630945701328641</id><published>2009-10-27T09:25:00.000-07:00</published><updated>2009-10-27T09:28:36.678-07:00</updated><title type='text'>sh: dot: command not found</title><content type='html'>I tried to use doxygen to generate document files from c++ sources,&lt;br /&gt;&lt;br /&gt;doxygen Doxyfile&lt;br /&gt;&lt;br /&gt;but got the error: "sh: dot: command not found". The reason is that&lt;br /&gt;I did not install graphviz Graph Visualization Tools, after installed it,&lt;br /&gt;the error went away.&lt;br /&gt;&lt;br /&gt;yum install graphviz -y&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8301630945701328641?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8301630945701328641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/sh-dot-command-not-found.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8301630945701328641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8301630945701328641'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/sh-dot-command-not-found.html' title='sh: dot: command not found'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4649472634958850815</id><published>2009-10-15T12:42:00.000-07:00</published><updated>2009-10-15T12:44:58.602-07:00</updated><title type='text'>chm2pdf</title><content type='html'>Linux comes with a very handy tool called "chm2pdf" tool to convert a chm file into a pdf file.&lt;br /&gt;&lt;br /&gt;For example, I have the following command to convert a chm file into a pdf file.&lt;br /&gt;&lt;br /&gt;chm2pdf --book TelluriumUserGuide.chm TelluriumUserGuide.pdf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4649472634958850815?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4649472634958850815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/chm2pdf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4649472634958850815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4649472634958850815'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/chm2pdf.html' title='chm2pdf'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6685740200174822449</id><published>2009-10-13T13:38:00.000-07:00</published><updated>2009-10-13T13:53:52.486-07:00</updated><title type='text'>couple C++ problems</title><content type='html'>I start to use C++ again and run into couple compilation problems. &lt;br /&gt;&lt;br /&gt;One is "error: 'INT_MAX' was not declared in this scope"&lt;br /&gt;&lt;br /&gt;The solution is to add the following header file:&lt;br /&gt;&lt;br /&gt;#include &amp;lt;limits.h&amp;gt;&lt;br /&gt;&lt;br /&gt;The problem is 64 bit related, for example, I have the code:&lt;br /&gt;&lt;br /&gt;int FOSDL_ThreadFunction(void* data)&lt;br /&gt;{&lt;br /&gt;  int threadnumber = (int)data;&lt;br /&gt;......&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The following error is thrown: "error: cast from 'void*' to 'int' loses precision".&lt;br /&gt;&lt;br /&gt;Seems for 64 bit OS, I should use uintptr_t and following change works.&lt;br /&gt;&lt;br /&gt; uintptr_t threadnumber = (uintptr_t)data;&lt;br /&gt;&lt;br /&gt;More discussion on this topic can be found on&lt;br /&gt;&lt;br /&gt;http://stackoverflow.com/questions/153065/converting-a-pointer-into-an-integer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-6685740200174822449?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6685740200174822449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/couple-c-problems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6685740200174822449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6685740200174822449'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/10/couple-c-problems.html' title='couple C++ problems'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4357316012156823338</id><published>2009-09-29T10:38:00.000-07:00</published><updated>2009-09-29T10:58:08.442-07:00</updated><title type='text'>serializationUID in IntelliJ IDEA 9M1</title><content type='html'>It is really stupid that IntelliJ IDEA 9M1 turns off the serialVersionUID warning by default. &lt;br /&gt;&lt;br /&gt;To turn this on, go to &lt;br /&gt;&lt;br /&gt;settings &gt; Inspections &gt; Serialization Issues&lt;br /&gt;&lt;br /&gt;and check "Serializable class without serialVersionUID".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4357316012156823338?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4357316012156823338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/serializationuid-in-intellij-idea-9m1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4357316012156823338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4357316012156823338'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/serializationuid-in-intellij-idea-9m1.html' title='serializationUID in IntelliJ IDEA 9M1'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5988206153227182330</id><published>2009-09-29T09:02:00.000-07:00</published><updated>2009-09-29T09:04:35.909-07:00</updated><title type='text'>Annotate Enum Type</title><content type='html'>Java provides @XmlEnum and @XmlEnumValue to annotate Enum type, for example, web service exposure.&lt;br /&gt;&lt;br /&gt;Here is a sample.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import javax.xml.bind.annotation.XmlEnum;&lt;br /&gt;import javax.xml.bind.annotation.XmlType;&lt;br /&gt;import javax.xml.bind.annotation.XmlEnumValue;&lt;br /&gt;&lt;br /&gt;@XmlType(name = "EnType", namespace = "http://org.telluriumsource")&lt;br /&gt;@XmlEnum(String.class)&lt;br /&gt;public enum EnType {&lt;br /&gt;    @XmlEnumValue("A") A,&lt;br /&gt;    @XmlEnumValue("B") B,&lt;br /&gt;    @XmlEnumValue("C") C &lt;br /&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/1691661231583466814-5988206153227182330?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5988206153227182330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/annotate-enum-type.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5988206153227182330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5988206153227182330'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/annotate-enum-type.html' title='Annotate Enum Type'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7838314651822529675</id><published>2009-09-16T07:58:00.000-07:00</published><updated>2009-09-16T08:06:24.820-07:00</updated><title type='text'>How to install Tora on Fedora 11 Linux</title><content type='html'>TOra is a Toolkit similar to Toad in Windows. To install TOra, you need first go to &lt;br /&gt;&lt;br /&gt;http://sourceforge.net/projects/tora/files/&lt;br /&gt;&lt;br /&gt;and download tora-2.1.0-1.fc11.x86_64.rpm &lt;br /&gt;&lt;br /&gt;You also need oracle install client. Go to &lt;br /&gt;&lt;br /&gt;http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html&lt;br /&gt;&lt;br /&gt;and download&lt;br /&gt;&lt;br /&gt;oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm&lt;br /&gt;&lt;br /&gt;Then run&lt;br /&gt;&lt;br /&gt;yum localinstall oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm --nogpgcheck&lt;br /&gt;&lt;br /&gt;to install oracle-instantclient11.1-basic and run&lt;br /&gt;&lt;br /&gt;yum localinstall tora-2.1.0-1.fc11.x86_64.rpm --nogpgcheck&lt;br /&gt;&lt;br /&gt;to install tora and some dependencies.&lt;br /&gt;&lt;br /&gt;Go to /usr/lib/oracle/11.1/client64/lib/ and create two symlinks&lt;br /&gt;&lt;br /&gt;ln -s libclntsh.so.11.1 libclntsh.so&lt;br /&gt;ln -s libocci.so.11.1 libocci.so&lt;br /&gt;&lt;br /&gt;You also need to export the oracle instant client path as follows,&lt;br /&gt;&lt;br /&gt;export LD_LIBRARY_PATH=/usr/lib/oracle/11.1/client64/lib&lt;br /&gt;&lt;br /&gt;Now, you are ready to run TOra.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7838314651822529675?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7838314651822529675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/how-to-install-tora-on-fedora-11-linux.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7838314651822529675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7838314651822529675'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/how-to-install-tora-on-fedora-11-linux.html' title='How to install Tora on Fedora 11 Linux'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1094256273360825306</id><published>2009-09-14T20:26:00.000-07:00</published><updated>2009-09-14T20:29:51.002-07:00</updated><title type='text'>pdftk</title><content type='html'>The Linux command "pdftk" is very useful to merge multiple pdf files into one pdf file.&lt;br /&gt;&lt;br /&gt;If you haven't installed it, simply use the following yum command to install it:&lt;br /&gt;&lt;br /&gt;yum install pdftk&lt;br /&gt;&lt;br /&gt;then, use the following command to merge multiple pdf files&lt;br /&gt;&lt;br /&gt;pdftk file1.pdf file2.pdf ... output merged.pdf&lt;br /&gt;&lt;br /&gt;For more options, please use&lt;br /&gt;&lt;br /&gt;man pdftk&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1094256273360825306?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1094256273360825306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/pdftk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1094256273360825306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1094256273360825306'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/pdftk.html' title='pdftk'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-1424744376753040318</id><published>2009-09-09T11:45:00.001-07:00</published><updated>2009-09-09T11:45:23.519-07:00</updated><title type='text'>Maven Build for AIR, Pure MVC, Spring ActionScript, and Flex Unit</title><content type='html'>http://code.google.com/p/jianwikis/wiki/MavenForFlexAirProject&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-1424744376753040318?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/1424744376753040318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/maven-build-for-air-pure-mvc-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1424744376753040318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/1424744376753040318'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/09/maven-build-for-air-pure-mvc-spring.html' title='Maven Build for AIR, Pure MVC, Spring ActionScript, and Flex Unit'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-459174701778033413</id><published>2009-08-26T07:55:00.000-07:00</published><updated>2009-08-26T08:03:29.189-07:00</updated><title type='text'>Compile error: Type was not found or was not a compile-time constant: NativeWindow</title><content type='html'>I tried to Maventize a Flex Air project, but got the following error:&lt;br /&gt;&lt;br /&gt;-compiler.locale en_US&lt;br /&gt;-compiler.namespaces.namespace http://www.adobe.com/2006/mxml /work/&lt;br /&gt;workspace/flex/prototype/simpleProto/target/classes/configs/mxml-&lt;br /&gt;manifest.xml&lt;br /&gt;-compiler.optimize=true&lt;br /&gt;-compiler.source-path /work/workspace/flex/prototype/simpleProto/src/&lt;br /&gt;main/flex&lt;br /&gt;-compiler.strict=true&lt;br /&gt;-compiler.use-resource-bundle-metadata=true&lt;br /&gt;-compiler.verbose-stacktraces=false&lt;br /&gt;-default-background-color 8821927&lt;br /&gt;-default-frame-rate 24&lt;br /&gt;-default-script-limits 1000 60&lt;br /&gt;-default-size 500 375&lt;br /&gt;-metadata.date Thu Aug 20 05:25:50 GMT-05:00 2009&lt;br /&gt;-target-player 9.0.0&lt;br /&gt;-use-network=true&lt;br /&gt;-verify-digests=true -load-config=&lt;br /&gt;[ERROR] /home/jiafan1/.m2/repository/com/adobe/flex/framework/&lt;br /&gt;airframework/3.3.0.4852/airframework-3.3.0.4852.swc(mx/core/IWindow):&lt;br /&gt;[-1,-1] Type was not found or was not a compile-time constant:&lt;br /&gt;NativeWindow.&lt;br /&gt;[INFO]&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt;[ERROR] BUILD ERROR&lt;br /&gt;[INFO]&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt;[INFO] Error compiling!&lt;br /&gt;[INFO]&lt;br /&gt;------------------------------------------------------------------------ &lt;br /&gt;&lt;br /&gt;After posted the error on Flex Mojos Group, I got the answer: "Somehow a player global is sneaking into your build". As a result, I used &lt;br /&gt;&lt;br /&gt;mvn dependency:tree &lt;br /&gt;&lt;br /&gt;to show the dependency tree and then remove all playerglobal dependency. After that, the &lt;br /&gt;problem is solved and my dependency tree is as follows,&lt;br /&gt;&lt;br /&gt;[INFO] [dependency:tree {execution: default-cli}]&lt;br /&gt;[INFO] com.jtv:simpleProto:swf:1.0-SNAPSHOT&lt;br /&gt;[INFO] +- org.springextensions.actionscript:spring-actionscript-core:swc:0.8:external&lt;br /&gt;[INFO] |  \- com.adobe.flex.framework:playerglobal:swc:9-3.2.0.3958:runtime&lt;br /&gt;[INFO] +- org.springextensions.actionscript:spring-actionscript-puremvc-standard:swc:0.8:compile&lt;br /&gt;[INFO] +- org.puremvc:puremvc-as3-standard:swc:2.0.4:compile&lt;br /&gt;[INFO] +- org.as3commons:as3commons-lang:swc:1.0.0-SNAPSHOT:merged&lt;br /&gt;[INFO] |  \- com.adobe.flex.framework:flex-framework:pom:3.2.0.3958:runtime&lt;br /&gt;[INFO] |     \- com.adobe.flex.framework:playerglobal:swc:9:3.2.0.3958:runtime&lt;br /&gt;[INFO] +- org.as3commons:as3commons-logging:swc:1.0.0:merged&lt;br /&gt;[INFO] +- org.as3commons:as3commons-reflect:swc:1.0.0:merged&lt;br /&gt;[INFO] +- com.adobe.flex.framework:air-framework:pom:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:airframework:swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:airglobal:swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:applicationupdater:swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:applicationupdater_ui:swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:servicemonitor:swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:flex:swc:3.2.0.3958:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:framework:swc:3.2.0.3958:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:rpc:swc:3.2.0.3958:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:utilities:swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:airframework:rb.swc:3.3.0.4852:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:rpc:rb.swc:3.2.0.3958:compile&lt;br /&gt;[INFO] |  +- com.adobe.flex.framework:framework:rb.swc:3.2.0.3958:compile&lt;br /&gt;[INFO] |  \- com.adobe.flex.framework:framework:zip:configs:3.3.0.4852:compile&lt;br /&gt;[INFO] +- flexlib:flexlib-bin:swc:2.4:compile&lt;br /&gt;[INFO] +- org.sonatype.flexmojos:flexmojos-unittest-support:swc:3.2.0:test&lt;br /&gt;[INFO] |  +- org.funit:funit:swc:0.50.0245:test&lt;br /&gt;[INFO] |  +- com.swirlyvision:swirly-vision:swc:1.0:test&lt;br /&gt;[INFO] |  +- net.digitalprimates:fluint:swc:v1:test&lt;br /&gt;[INFO] |  +- com.asunit:asunit:swc:20071011:test&lt;br /&gt;[INFO] |  \- advancedflex:debugger:swc:0.2alpha2:test&lt;br /&gt;[INFO] \- com.adobe.flexunit:flexunit:swc:4.0-alpha-1.0:test (scope not updated to runtime)&lt;br /&gt;[INFO]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-459174701778033413?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/459174701778033413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/compile-error-type-was-not-found-or-was.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/459174701778033413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/459174701778033413'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/compile-error-type-was-not-found-or-was.html' title='Compile error: Type was not found or was not a compile-time constant: NativeWindow'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2109733322207138795</id><published>2009-08-13T13:12:00.000-07:00</published><updated>2009-08-13T13:13:32.799-07:00</updated><title type='text'>Setup GFS File Sytem in Redhat/Centos Cluster Environment</title><content type='html'>This is an old document, I put it on the wiki page to get &lt;br /&gt;better format.&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/SetupGFSFileSytem&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2109733322207138795?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2109733322207138795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/setup-gfs-file-sytem-in-redhatcentos.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2109733322207138795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2109733322207138795'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/setup-gfs-file-sytem-in-redhatcentos.html' title='Setup GFS File Sytem in Redhat/Centos Cluster Environment'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3068761228953448789</id><published>2009-08-13T12:45:00.001-07:00</published><updated>2009-08-13T12:45:53.726-07:00</updated><title type='text'>command to find and delete files recurrsively</title><content type='html'>find . -name "FILE-TO-FIND"-exec rm -rf {} \;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-3068761228953448789?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3068761228953448789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/command-to-find-and-delete-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3068761228953448789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3068761228953448789'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/command-to-find-and-delete-files.html' title='command to find and delete files recurrsively'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-5782466898987992774</id><published>2009-08-10T11:31:00.000-07:00</published><updated>2009-08-10T11:57:59.873-07:00</updated><title type='text'>Install AIR on Fedora 11</title><content type='html'>I downloaded the AIR from &lt;br /&gt;&lt;br /&gt;http://get.adobe.com/air/&lt;br /&gt;&lt;br /&gt;and made the file executable&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# chmod +x AdobeAIRInstaller.bin&lt;br /&gt;&lt;br /&gt;Then, tried to install it&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# ./AdobeAIRInstaller.bin&lt;br /&gt;&lt;br /&gt;However, it threw the following error:&lt;br /&gt;&lt;br /&gt;"Adobe AIR could not be installed. Either gnome-keyring or Kwallet must be installed prior to installing Adobe AIR."&lt;br /&gt;&lt;br /&gt;It also had errors such as&lt;br /&gt;&lt;br /&gt;"Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory&lt;br /&gt;Gtk-Message: Failed to load module "gnomebreakpad": libgnomebreakpad.so: cannot open shared object file: No such file or directory"&lt;br /&gt;&lt;br /&gt;The above errors were for the AIR installer and you do not really need to fix them. If you want to, you can use yum to find the appropriate RPMs, such as,&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# yum provides */libpk-gtk-module.so&lt;br /&gt;&lt;br /&gt;Loaded plugins: fastestmirror, presto, refresh-packagekit&lt;br /&gt;Loading mirror speeds from cached hostfile&lt;br /&gt; * livna: rpm.livna.org&lt;br /&gt; * rpmfusion-free: mirror.liberty.edu&lt;br /&gt; * rpmfusion-free-updates: mirror.liberty.edu&lt;br /&gt; * rpmfusion-nonfree: mirror.liberty.edu&lt;br /&gt; * rpmfusion-nonfree-updates: mirror.liberty.edu&lt;br /&gt;PackageKit-gtk-module-0.4.6-8.fc11.x86_64 : Install fonts automatically using PackageKit&lt;br /&gt;Repo        : fedora&lt;br /&gt;Matched from:&lt;br /&gt;Filename    : /usr/lib64/gtk-2.0/modules/libpk-gtk-module.so&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PackageKit-gtk-module-0.4.6-8.fc11.i586 : Install fonts automatically using PackageKit&lt;br /&gt;Repo        : fedora&lt;br /&gt;Matched from:&lt;br /&gt;Filename    : /usr/lib/gtk-2.0/modules/libpk-gtk-module.so&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PackageKit-gtk-module-0.4.8-2.fc11.i586 : Install fonts automatically using PackageKit&lt;br /&gt;Repo        : updates&lt;br /&gt;Matched from:&lt;br /&gt;Filename    : /usr/lib/gtk-2.0/modules/libpk-gtk-module.so&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PackageKit-gtk-module-0.4.8-2.fc11.x86_64 : Install fonts automatically using PackageKit&lt;br /&gt;Repo        : updates&lt;br /&gt;Matched from:&lt;br /&gt;Filename    : /usr/lib64/gtk-2.0/modules/libpk-gtk-module.so&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PackageKit-gtk-module-0.4.8-2.fc11.x86_64 : Install fonts automatically using PackageKit&lt;br /&gt;Repo        : installed&lt;br /&gt;Matched from:&lt;br /&gt;Filename    : /usr/lib64/gtk-2.0/modules/libpk-gtk-module.so&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since the AIR is 32 bit, you need to install the 32 bit version of PackageKit-gtk-module, i.e.,&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# yum install PackageKit-gtk-module-0.4.6-8.fc11.i586&lt;br /&gt;&lt;br /&gt;Go back the original error, seems I missed the gnome-keyring RPM, installed it as follows,&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# yum install gnome-keyring.i586&lt;br /&gt;&lt;br /&gt;Because AIR is for 32 bits, I had to install the 32 bit version even I am on 64 bit Linux.&lt;br /&gt;&lt;br /&gt;Tried to install the AIR again&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# ./AdobeAIRInstaller.bin&lt;br /&gt;&lt;br /&gt;This time, it threw a different error:&lt;br /&gt;&lt;br /&gt;"An error occurred while installing Adobe AIR. Installation may not be allowed by your administrator. Please contact your administrator."&lt;br /&gt;&lt;br /&gt;Really strange, because I used user root to install. Did some Google search again and found some hints from&lt;br /&gt;&lt;br /&gt;http://rootblock.wordpress.com/2009/06/24/fedora-11-adobe-air-installation-not-allowed-by-administrator/&lt;br /&gt;&lt;br /&gt;Seems the actual reason is that I missed a lot of dependencies. The suggested solution is to install the following RPMS:&lt;br /&gt;&lt;br /&gt;yum -y install xterm gtk2-devel gnome-keyring libxml2-devel libxslt rpm-devel nss&lt;br /&gt;&lt;br /&gt;But I am on 64 bit Linux, the default RPMs are 64 bits, thus, I need to use 32 bit versions instead. As a result, I installed the following RPMs:&lt;br /&gt;&lt;br /&gt;yum -y install xterm.i586 gtk2-devel.i586 gnome-keyring.i586 libxml2-devel.i586 libxslt.i586 rpm-devel.i586 nss.i586&lt;br /&gt;&lt;br /&gt;Retried again,&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# ./AdobeAIRInstaller.bin&lt;br /&gt;&lt;br /&gt;This time, no error was thrown.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-5782466898987992774?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/5782466898987992774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/install-air-on-fedora-11.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5782466898987992774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/5782466898987992774'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/install-air-on-fedora-11.html' title='Install AIR on Fedora 11'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-7502980936663530903</id><published>2009-08-07T11:47:00.001-07:00</published><updated>2009-08-07T11:47:27.259-07:00</updated><title type='text'>script to run headless test with Xvfb</title><content type='html'>First, you need to install Xvfb&lt;br /&gt;&lt;br /&gt;In linux, do&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# yum search Xvfb&lt;br /&gt;&lt;br /&gt;you will see which rpm is for your linux os. For example, I found&lt;br /&gt;&lt;br /&gt;xorg-x11-server-Xvfb.x86_64 : A X Windows System virtual framebuffer X&lt;br /&gt;server.&lt;br /&gt;&lt;br /&gt;for my box, then install it.&lt;br /&gt;&lt;br /&gt;[root@Mars ~]# yum install xorg-x11-server-Xvfb.x86_64&lt;br /&gt;&lt;br /&gt;If you use Maven to run test, you can use the following script&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;nohup startx -- `which Xvfb` :20 -screen 0 1024x768x24 &amp; sleep 7&lt;br /&gt;DISPLAY=:20 firefox  &amp;     DISPLAY=:20 mvn test&lt;br /&gt;pkill Xvfb&lt;br /&gt;&lt;br /&gt;For ant, you can replace "mvn test" with your ant task (I didn't test&lt;br /&gt;it).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-7502980936663530903?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/7502980936663530903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/script-to-run-headless-test-with-xvfb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7502980936663530903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/7502980936663530903'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/08/script-to-run-headless-test-with-xvfb.html' title='script to run headless test with Xvfb'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2164876275074936072</id><published>2009-07-21T13:47:00.000-07:00</published><updated>2009-07-21T13:48:38.559-07:00</updated><title type='text'>Java 6 Http Server</title><content type='html'>I created a wiki page on how to leverage Java 6 http server to create a mock http server for Tellurium at&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/aost/wiki/TelluriumMockHttpServer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2164876275074936072?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2164876275074936072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/java-6-http-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2164876275074936072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2164876275074936072'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/java-6-http-server.html' title='Java 6 Http Server'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-2626952624923604359</id><published>2009-07-09T06:09:00.000-07:00</published><updated>2009-07-09T06:11:17.959-07:00</updated><title type='text'>SAcct Server Implementation Experience With Google Guice</title><content type='html'>I write a post about my experience with Google Guice when I used it to implement the Smart Account Manage (SAcct) server. Please check it out here&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/sacct/wiki/SAcctServerImplementationExperienceWithGoogleGuice&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-2626952624923604359?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/2626952624923604359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/sacct-server-implementation-experience.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2626952624923604359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/2626952624923604359'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/sacct-server-implementation-experience.html' title='SAcct Server Implementation Experience With Google Guice'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3742107245162007172</id><published>2009-07-08T07:51:00.000-07:00</published><updated>2009-07-08T07:55:38.224-07:00</updated><title type='text'>yum localinstall rpm</title><content type='html'>I have a rpm downloaded from somewhere and try to install it by running&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;rpm -ivh x.rpm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;but rpm complains about missing dependencies. One quick way to solve&lt;br /&gt;this is to use yum localinstall command, i.e.,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum localinstall x.rpm&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If the rpm package is not pgp signed, you need to skip the gpg signature check in the following way,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;yum localinstall x.rpm --nogpgcheck&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/1691661231583466814-3742107245162007172?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3742107245162007172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/yum-localinstall-rpm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3742107245162007172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3742107245162007172'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/yum-localinstall-rpm.html' title='yum localinstall rpm'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4003569089460538599</id><published>2009-07-07T10:39:00.001-07:00</published><updated>2009-07-07T10:41:48.330-07:00</updated><title type='text'>SAcct 0.1.0 is released today</title><content type='html'>My open source project Smart Account Management (SAcct) is released today. This project is based on the experience and ideas from my past PCI compliance work.&lt;br /&gt;&lt;br /&gt;For more details, please read the announcement &lt;br /&gt;&lt;br /&gt;http://code.google.com/p/sacct/wiki/SAcctAnnouncements#SAcct_0.1.0_is_released&lt;br /&gt;&lt;br /&gt;and SAcct 0.1.0 user guide&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/sacct/wiki/SAcctUserGuide_0_1_0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4003569089460538599?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4003569089460538599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/sacct-010-is-released-today.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4003569089460538599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4003569089460538599'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/sacct-010-is-released-today.html' title='SAcct 0.1.0 is released today'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-8056810556154742684</id><published>2009-07-07T06:32:00.000-07:00</published><updated>2009-07-07T06:33:03.204-07:00</updated><title type='text'>How to Use the Maven Release Plugin to release SAcct</title><content type='html'>I created a wiki page here&lt;br /&gt;&lt;br /&gt;http://code.google.com/p/jianwikis/wiki/UseMavenReleasePlugin&lt;br /&gt;&lt;br /&gt;Really don't like the blog format here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-8056810556154742684?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/8056810556154742684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/how-to-use-maven-release-plugin-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8056810556154742684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/8056810556154742684'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/how-to-use-maven-release-plugin-to.html' title='How to Use the Maven Release Plugin to release SAcct'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-3084071262372851644</id><published>2009-07-06T22:32:00.000-07:00</published><updated>2009-07-06T22:38:31.605-07:00</updated><title type='text'>AES SecretKeyFactory not available</title><content type='html'>I tried to generate a SecretKey from a pass-phrase for AES in the following way,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        KeySpec aesSpec = new KeySpec(key.getBytes(), "AES");&lt;br /&gt;        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("AES");&lt;br /&gt;        SecretKey secretKey = keyFactory.generateSecret(aesSpec);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;But this throws the exception "AES SecretKeyFactory not available".&lt;br /&gt;&lt;br /&gt;The way to get around this problem is to manually apply MD5 hash on the passphrase&lt;br /&gt;and then get the Key instead of the SecretKey. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        MessageDigest digester = MessageDigest.getInstance("MD5");&lt;br /&gt;        char[] password = key.toCharArray();&lt;br /&gt;        for (int i = 0; i &lt; password.length; i++) {&lt;br /&gt;            digester.update((byte) password[i]);&lt;br /&gt;        }&lt;br /&gt;        byte[] passwordData = digester.digest();&lt;br /&gt;&lt;br /&gt;        Key secretkey = new SecretKeySpec(passwordData, "AES");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then, you can use the key to encrypt/decrypt, for instance, the encryption code is as follows,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;       Cipher aesCipher = Cipher.getInstance(AES_ECB_PKC5PADDING);&lt;br /&gt;&lt;br /&gt;        // Initialize the cipher for encryption&lt;br /&gt;        aesCipher.init(Cipher.ENCRYPT_MODE, aesKey);&lt;br /&gt;&lt;br /&gt;        return aesCipher.doFinal(data);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Similarly, here is the decryption code,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;        Cipher aesCipher = Cipher.getInstance(AES_ECB_PKC5PADDING);&lt;br /&gt;&lt;br /&gt;        // Initialize the cipher for Decryption&lt;br /&gt;        aesCipher.init(Cipher.DECRYPT_MODE, aesKey);&lt;br /&gt;       &lt;br /&gt;        return aesCipher.doFinal(data);&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/1691661231583466814-3084071262372851644?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/3084071262372851644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/aes-secretkeyfactory-not-available.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3084071262372851644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/3084071262372851644'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/aes-secretkeyfactory-not-available.html' title='AES SecretKeyFactory not available'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-6067007154274190270</id><published>2009-07-06T20:37:00.000-07:00</published><updated>2009-07-06T20:44:15.008-07:00</updated><title type='text'>how to pass environment variable to log4j</title><content type='html'>If you want to use environment variables in log4j, for example, you want to control the log file output directory, you can use -Dvariable=Environment_Variable as the input parameter to Java to get it passed in. Look at the following example, in the start shell script, I defined an environment variable SERVER_BASE as follows&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;PARENT=$(pwd | sed 's/\/bin$//')&lt;br /&gt;SERVER_BASE=${SERVER_BASE:-${PARENT}} &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then I need to pass this environment variable to Java&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;java  -Dserver.base=${SERVER_BASE} -Dlog4j.configuration=file:${PARENT}/conf/log4j.xml ... &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In the log4j.xml file, you can use "server.base" to refer to the SERVER_BASE environment variable as follows,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; &amp;lt;appender name="SACCT"&lt;br /&gt;  class="org.apache.log4j.FileAppender"$gt;&lt;br /&gt;  $lt;param name="File" value="${server.base}/logs/sacct.log" /$gt;&lt;br /&gt;  $lt;param name="Append" value="true" /$gt;&lt;br /&gt;         ......&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/1691661231583466814-6067007154274190270?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/6067007154274190270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/how-to-pass-environment-variable-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6067007154274190270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/6067007154274190270'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/how-to-pass-environment-variable-to.html' title='how to pass environment variable to log4j'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-675759917210608007</id><published>2009-07-06T17:09:00.000-07:00</published><updated>2009-07-06T17:11:52.210-07:00</updated><title type='text'>IntelliJ IDEA: serialVersionUID</title><content type='html'>I always wonder why IntelliJ IDEA does not prompt me to generate a serialVersionUID for a serializable class. Finally, found the following post&lt;br /&gt;&lt;br /&gt;http://justfiveminutes.wordpress.com/2006/12/20/intellij-idea-serialversionuid-generator/&lt;br /&gt;&lt;br /&gt;Seems this feature is turned off by default, need to go to &lt;br /&gt;&lt;br /&gt;Settings -&gt; Errors -&gt; Serialization issues -&gt; Serializable class without ’serialVersionUID’ to turn it on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-675759917210608007?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/675759917210608007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/intellij-idea-serialversionuid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/675759917210608007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/675759917210608007'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/intellij-idea-serialversionuid.html' title='IntelliJ IDEA: serialVersionUID'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1691661231583466814.post-4768312992253673223</id><published>2009-07-04T20:24:00.000-07:00</published><updated>2009-07-04T20:29:21.235-07:00</updated><title type='text'>Java Class "Runtime"</title><content type='html'>I noticed the Java Runtime class when I looked into Tomcat code to see how it registered the shutdown hook. The tomcat code is very short and clear,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;     // Register shutdown hook&lt;br /&gt;     if (useShutdownHook) {&lt;br /&gt;         if (shutdownHook == null) {&lt;br /&gt;            shutdownHook = new CatalinaShutdownHook();&lt;br /&gt;         }&lt;br /&gt;         Runtime.getRuntime().addShutdownHook(shutdownHook);&lt;br /&gt;         ......&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;i.e., tomcat tries to get hold of the Runtime class and add the shutdown hook to it. &lt;br /&gt;&lt;br /&gt;Look at the Java doc of the Runtime class at&lt;br /&gt;&lt;br /&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html&lt;br /&gt;&lt;br /&gt;"Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method.&lt;br /&gt;&lt;br /&gt;An application cannot create its own instance of this class. "&lt;br /&gt;&lt;br /&gt;More examples could be found here&lt;br /&gt;&lt;br /&gt;http://www.rgagnon.com/javadetails/java-0014.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1691661231583466814-4768312992253673223?l=johnjianfang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://johnjianfang.blogspot.com/feeds/4768312992253673223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/java-class-runtime.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4768312992253673223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1691661231583466814/posts/default/4768312992253673223'/><link rel='alternate' type='text/html' href='http://johnjianfang.blogspot.com/2009/07/java-class-runtime.html' title='Java Class &quot;Runtime&quot;'/><author><name>John</name><uri>http://www.blogger.com/profile/16815426931189918005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_nGElpBhdiUQ/SlXryMgUiuI/AAAAAAAAAAM/JxBb3x7nluo/S220/johnjianfangsmall.png'/></author><thr:total>0</thr:total></entry></feed>
