tag:blogger.com,1999:blog-83143843707784292452023-03-15T19:25:11.637+08:00记事本(My Notes)记录那些值得记录的东西
Record the valuable stuffAnonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.comBlogger70125tag:blogger.com,1999:blog-8314384370778429245.post-41609543312731888572015-07-21T09:32:00.002+08:002015-07-21T09:37:52.048+08:00Daemon hell in Jenkins<span style="font-family: Courier New, Courier, monospace;">Recently I wrote a Linux like <a href="https://gist.github.com/zxkane/b55033bd519334d57c13" target="_blank">initd script</a> to start/stop my web application.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">The script works well when running it in shell of linux. The web application will run in background by daemon.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">However I found both daemon and web application(java) exited immediately if I started the script in Jenkins as a shell step of build process.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="background-color: white; color: #222222;"><span style="font-family: Courier New, Courier, monospace;">I put below simple script in 'Execute shell' block,</span></span><br />
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;"><br /><i><b>daemon --name=test-daemon -- sleep 200</b></i><i><b>sleep 60</b></i></span></div>
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;"><b><i><br /></i></b>The process 'daemon' and 'sleep 200' should exit after 200 seconds the 'sleep' exits. The jenkins job will be finished in 60 secs.<br /><i><br /></i></span></div>
<div style="background-color: white;">
<span style="color: #6aa84f; font-family: Courier New, Courier, monospace;"><i>jenkins 9954 9950 0 21:48 ? 00:00:00 sleep 60</i></span><br />
<span style="color: #6aa84f; font-family: Courier New, Courier, monospace;"><i>jenkins 9955 1 0 21:48 ? 00:00:00 daemon —name=test-daemon — sleep 200</i></span><br />
<span style="color: #6aa84f; font-family: Courier New, Courier, monospace;"><i>jenkins 9956 9955 0 21:48 ? 00:00:00 sleep 200</i></span></div>
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;"><i><br /></i>Above is the process info queried via ps command. The father pid of daemon is 1, not the script generated by Jenkins.<br />But both the process 'daemon' and 'sleep 200' immediately exited when the script finished. Should be something wrong in Jenkins to cause daemon exited unexpected.</span></div>
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;">It's something really frustrating to use daemon to stop/start the web application in Jenkins.</span></div>
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="background-color: white; color: #222222;">
<span style="font-family: Courier New, Courier, monospace;">Finally I used **docker** container to run my web application, which easily can be stopped/started via script in Jenkins.</span></div>
Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com1tag:blogger.com,1999:blog-8314384370778429245.post-15691478123952139922015-07-13T19:11:00.000+08:002015-07-13T19:11:03.515+08:00The symptoms of Java broken in Mac OSX 10.10 and fix solutionAfter uninstalling some applications from my Mac OSX, I found the applications that depends on JRE totally does not work. I noticed below symptoms,<br />
<br />
<br />
<ol>
<li>Eclipse Mars can not be launched, even though I specified the launching vm to another one(`java -version` still work). The SWT native library failed to resolve the dependencies to '/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM' which does not exists.</li>
<li>I tried to reinstall Oracle 1.8.0_u45 via both brew and dmg image downloaded from Oracle website, both ways were failed as well.</li>
<li>The Mac pkg Installer can not be started due to dylib broken. It means I can't install any pkg via GUI. The command line(such as `<span class="s1">sudo </span><span class="s2">installer</span><span class="s1"> -verboseR -target / -pkg /Volumes/OS\ X\ 10.10.4\ Update\ Combo/OSXUpdCombo10.10.4.pkg`) still works.</span></li>
</ol>
<div>
Finally I realized the problem was caused by I uninstalled the out of date Apple Java 6. Looks like all of above failures are required the system built-in Java. It really does not make sense the Oracle 1.8 installer script to depend on the out of date Java.</div>
<div>
<br /></div>
<div>
Finally I reinstalled <a href="https://support.apple.com/kb/DL1572?locale=en_US" target="_blank">Java for OS X 2014-001</a> to make everything working again. The GUI installer for pkg still does not work, you need use below command to use the pkg.</div>
<div>
<br /></div>
<div>
</div>
<br />
<div class="p1">
<span class="s1">sudo </span><span class="s2">installer</span><span class="s1"> -verboseR -target / -pkg /Volumes/Java\ for\ OS\ X\ 2014-001/JavaForOSX.pkg</span></div>
Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-38160722822434217502013-05-13T13:44:00.000+08:002013-05-13T13:44:08.342+08:00Run groovy script via Jenkins CLIJenkins supports <a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+SSH" target="_blank">ssh authentication</a> in CLI.<br />
<br />
Below is a command to verify that I am authenticated: <br />
<div style="background-color: white; border: 0px; color: #222222; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 19.984375px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #444444;">java -jar jenkins-cli.jar -s <a href="http://myserver/jenkins" id="" shape="rect" style="border: 0px; cursor: pointer; line-height: 1.428571em; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://myserver/jenkins</a> who-am-i</span></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #f3f3f3; color: #38761d;"> Authenticated as: myuser</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #f3f3f3; color: #38761d;"> Authorities:</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #f3f3f3; color: #38761d;"> authenticated</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #f3f3f3; color: #38761d;"><br /></span></div>
However you still would meet permission error when running groovy script in CLI.</div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #444444;">java -jar jenkins-cli.jar -s <a href="http://vbuild06.atld1:8080/jenkins" id="" shape="rect" style="border: 0px; cursor: pointer; line-height: 1.428571em; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;" target="_blank">http://myserver/jenkins</a> groovysh 'jenkins.model.Jenkins.instance.pluginManager.plugins.each { println("${it.longName} - ${it.version}") };'</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline;">
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #38761d;"><br /></span></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #38761d;">Exception in thread "main" java.lang.reflect.UndeclaredThrowableException</span></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #38761d;"><span style="border: 0px; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"> </span>at $Proxy2.main(Unknown Source)</span></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #38761d;"><span style="border: 0px; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"> </span>at hudson.cli.CLI.execute(CLI.java:271)</span></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #38761d;"><span style="border: 0px; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"> </span>at hudson.cli.CLI._main(CLI.java:417)</span></div>
<div style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">
<span style="background-color: #eeeeee; color: #38761d;"><span style="border: 0px; line-height: 1.428571em; margin: 0px; padding: 0px; vertical-align: baseline; white-space: pre-wrap;"> </span>at hudson.cli.CLI.main(CLI.java:322)</span></div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
It's a bug of Jenkins. The workaround is create a groovy script, then run that script via Jenkins CLI.</div>
<div style="font-size: 14px;">
<br /></div>
<div>
<span style="background-color: #eeeeee; color: #444444;"><span style="line-height: 19.984375px;">java -jar jenkins-cli.jar -s </span>http://myserver/jenkins/<span style="line-height: 19.984375px;"> groovy test_script.gsh</span></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-31406712617591703902013-05-11T13:16:00.002+08:002013-05-11T13:16:42.835+08:00Solr boost examplesThe index has a field named 'create_time' that is the timestamp of document created time. The query string can boost the latest created document like below,<br />
<br />
<span style="color: #444444;"><span style="background-color: #eeeeee;"><span style="font-family: "Courier New",Courier,monospace;">{!boost b=recip(ms(NOW,create_time),3.16e-11,0.08,0.05)}name:keyword</span></span></span><br />
<br />
There is another field named 'important' that indicates whether the document is important or not. The query string can boost the document is important like below,<br />
<br />
<span style="color: #444444;"><span style="background-color: #eeeeee;"><span style="font-family: "Courier New",Courier,monospace;">q={!boost b=$importfunc}name:keyword&importfunc=query({!v='important:true'}) </span></span></span><br />
<br />Above query string uses a sub query in boost function.<br />
<br />
Finally I want to boost both above two fields, and 'important' field has higher priority. The query string looks like below,<br />
<br />
<span style="color: #444444;"><span style="background-color: #eeeeee;"><span style="font-family: "Courier New",Courier,monospace;">defType=edismax&q=name:keyword&bf=query({!v='import:true'})^20.0 recip(ms(NOW,create_time),3.16e-11,0.08,0.05)^10.0")</span></span></span>Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-37798608608480468582012-08-16T09:11:00.000+08:002012-08-16T09:11:06.274+08:00Django's unicdoe encode errorIt's a common and ugly problem when using non-ascii characters in Django.<br />
<br />
The general solution is below,<br />
<br />
<ol>
<li>put <b style="background-color: #cccccc;"># -*- coding: utf-8 -*-</b> at beginning of every python source files that are using utf-8 characters</li>
<li>declare every string variable as unicode, such as <b style="background-color: #cccccc;">str_var = u'中文字符'</b></li>
<li>add <a href="https://docs.djangoproject.com/en/1.4/ref/models/instances/#django.db.models.Model.__unicode__">a __unicode__</a> method in your model classes</li>
<li>if you are running server on apache/mod_wsgi or ngnix, you need <a href="https://docs.djangoproject.com/en/1.4/howto/deployment/modpython/#if-you-get-a-unicodeencodeerror">configure web server to use utf-8 encoding</a></li>
</ol>
Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-91132012999883863942012-07-28T20:49:00.001+08:002012-07-28T20:49:25.979+08:00The workaround of making Zend CE/Zend debugger work on mountain lion<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">I installed both Zend CE and zend debugger of Eclipse on my Mac. Both of them work well in Mac lion.
However they don't work any more after I upgraded my Mac to mountain lion. </span></div>
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">After some investigation I found some extensions of Zend PHP can't be loaded due to shared library </span><span style="font-size: large;">dependency</span><span style="font-size: large;"> can't be found in mountain lion.
The <b>xslt</b> module of PHP depends on some system libraries(suc as </span><u><span style="background-color: #cccccc;">/usr/local/libxslt-1.1.23/lib/libxslt.1.dylib</span></u><span style="font-size: large;">) that have been removed by mountain lion.</span></div>
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">The temporary solution is disabling <b>xlst module</b> of zend PHP if your application doesn't need them. </span></div>
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">The workaround fix of Zend CE on Mac, </span></div>
<blockquote class="tr_bq">
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">rename <i><b>/usr/local/zend/lib/php_extensions/xsl.so</b></i> to any other name</span></div>
</blockquote>
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">The workaround fix of zend debugger for Eclipse, </span></div>
<div style="font-family: Verdana,sans-serif;">
<br /></div>
<blockquote class="tr_bq">
<div style="font-family: Verdana,sans-serif;">
<span style="font-size: large;">Delete the line <i><strike>extension=xsl.so</strike></i> from file <b><your eclipse=""><your eclipse>/plugins/org.zend.php.debug.debugger.macosx_5.3.18.v20110322/resources/php53/php.ini</your></b></span></div>
</blockquote>Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-31780549316678824672012-03-19T20:04:00.000+08:002012-03-19T20:04:25.120+08:00Dual monitors on UbuntuI had two monitors for my workstation. One is 22' and the another is 17'. I used the small one as a extend desktop. <br />
<br />
Today I get a another 23' monitor to replace the small one. However the resolution of the 23' monitor can't be changed after pluging it in. It always used the resolution matching the 17' one.<br />
<br />
Both 'Setting - Display' and 'AMD Catalyst control' can't adjust it as higher resolution.<br />
<br />
After some tuning, I found a workaround.<br />
<br />
I totally remove all config of small one from <b>/etc/X11/xorg.conf</b>. Then change its resolution in 'AMD Catalyst control', it works!Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-18812820949275859062012-03-05T19:25:00.000+08:002012-03-05T19:25:28.362+08:00Embedding an HTTP server in EquinoxI want to create a test server for my application. Using embedding Http server in equinox is my first option.<br />
<br />
I had experience using simple http service implementation of equinox, however I want to play with Jetty this time. <br />
<br />
Following <a href="http://www.eclipse.org/equinox/server/http_in_equinox.php">the guide</a> of Equinox server, I can't running a Jetty server with my servlet in Eclipse Indigo. Obviously <a href="http://www.eclipse.org/equinox/server/http_in_equinox.php">the guide</a> is out of date.<br />
<br />
After tuning it, I found below bundles are minimum collection to run Jetty inside OSGi runtime.<br />
<script src="https://gist.github.com/1977922.js?file=embedded-jetty-osgi">
</script><br />
<br />
You only need create a run configuration of OSGi framework, add your bundles with servlets and above bundles.Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-46850818954730657402012-02-17T17:47:00.003+08:002012-02-21T22:32:48.717+08:00Acess Intranet without VPNSometimes I need access the Intranet of company, however I don't like to create VPN connection. The connection is slow, waste time to create the connection and have to change password due to security policy.<br />
<br />
My workstation is Linux, which has a lot of utility tools to help me access Intranet at home without VPN.<br />
<br />
Firstly I set up a ssh server on my personal computer. It's quite easy if you are using Linux, for Windows I installed <a href="https://www.itefix.no/i2/copssh">Copssh</a>.<br />
Then register a free domain name and configure it in my router. And let router forward port 22(or any port you wan to use) to my personal computer.<br />
In my working Linux machine, create a ssh tunnel to my personal computer. Must use the <a href="http://kane-mx.blogspot.com/2009/12/ssh-key.html">public/private key for authenticating</a>. For example,<br />
<script src="https://gist.github.com/1876750.js?file=ssh-tunnel0.sh"></script><br />
It means remote server can access my workstation's port 22 via accessing its port 1002 after the ssh tunnel is created successfully. Above command line also forwards the ports 5900 and 6500. The default VNC session will listen the port 5900.<br />
But it only works when my personal computer is running. And the connection can't be reconnected after it fails once.<br />
The graceful solution is installing 'autossh' in my Linux, which is an utility to retry the ssh connection with an interval if it's disconnected or failed.<br />
<script src="https://gist.github.com/1876750.js?file=ssh-tunnel1.sh"></script><br />
Then create a script and running it when OS is booted. The script will be executed by root user, so we need configure it ran by the normal user.<br />
<script src="https://gist.github.com/1876750.js?file=ssh-tunnel2.sh"></script><br />
After my personal computer is booted a while(the default interval of autossh is 300 seconds), I can use localhost:10002 to login my workstation, localhost:5900 to access my VNC session. Of course you can use 'froxyproxy' of Firefox via a localport to access web page of Intranet.Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-23673755718139923332012-02-15T11:36:00.000+08:002012-02-15T11:36:03.890+08:00How to reuse the existing OpenID accounts after the host name of Gerrit server is changedAn internal Gerrit server was moved, so the hostname of server is changed. However we are using OpenID for user control, the OpenID provider(such as Google account) will generate a new token for the new server(hostname changing will impact the identity token of Google account) when we login Gerrit with same OpenID account. Gerrit will create a new internal account by default even though my OpenID account has existed in the system and has a lot of activities.<br />
<br />
The solution is updating the 'ACCOUNT_EXTERNAL_IDS' table of Gerrit via gsql. Setting the 'ACCOUNT_ID' to your existing account_id for the new record whose 'EXTERNAL_ID' is the new token gotten from Google.<br />
<br />
<blockquote class="tr_bq">update ACCOUNT_EXTERNAL_IDS set ACCOUNT_ID='1000001' where EXTERNAL_ID='https://www.google.com/accounts/o8/id?id=xxxxxxxxxx';</blockquote><br />
Then search the documentation of Gerrit, I find a configuration property looks like supporting such a migration for OpenID authentication.<br />
<blockquote class="tr_bq">auth.allowGoogleAccountUpgrade </blockquote><dl><dd> <blockquote><div class="paragraph">Allows Google Account users to automatically update their Gerrit account when/if their Google Account OpenID identity token changes. Identity tokens can change if the server changes hostnames, or for other reasons known only to Google. The upgrade path works by matching users by email address if the identity is not present, and then changing the identity.</div><div class="paragraph">This setting also permits old Gerrit 1.x users to seamlessly upgrade from Google Accounts on Google App Engine to OpenID authentication.</div><div class="paragraph">Having this enabled incurs an extra database query when Google Account users register with the Gerrit server.</div><div class="paragraph">By default, unset/false.</div></blockquote></dd></dl>Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-69559893046781371582011-11-24T15:58:00.001+08:002011-11-24T16:16:31.642+08:00JRE/JDK's certificate issue and solutionThe problem came from I tried to set up send mail server(SMTP) for my Gerrit server. My Gerrit server is using OpenID for user authorization, so I registered a new email account to send notification from Gerrit.<br />
<br />
Most of email service providers require the secure authorization when using its SMTP server to send mail. However the root CA of my email provider is not added into the default certificate of JRE. So Gerrit always failed to send email due to ssl verification exception.<br />
<br />
My solution is adding the certificate of SMTP server into the certificate used by JRE.<br />
<br />
The detail steps are below,<br />
<br />
<ol>
<li>Use <b>open_ssl</b> utility to the certificate of SMTP server or its root CA of email provider. Below command can list the certificate of SMTP and its chain. You can paste any of them into a file.<br /><pre class="py" name="code"> openssl s_client -connect smtp.163.com:465 </pre>
</li>
<li>Then import the certificate saved in previous step into my JRE's key store. The default password of JRE's default keystore is '<b>changeit</b>'. You can find the <i>cacerts</i> under jre/lib/security folder.<br /><pre class="py" name="code"> sudo keytool -import -keystore cacerts -alias Smtp163com -file /tmp/smtp.163.PEM </pre>
</li>
</ol>
<br />
<br />Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-64622947361122424422011-11-08T16:16:00.000+08:002011-11-15T14:35:45.341+08:00The tips of Maven/Tycho building crossplatform RCP and repositoryI successfully converted our product build from PDE build to Maven/Tycho. Something is worth to be documented here.<br />
<br />
There are several examples and posts to demonstrate how using Tycho building your Eclipse plug-ins, features, applications and products. The most helpful example is the <a href="http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-demo">demo</a> of Tycho project.<br />
<br />
Below are some traps I met when building my project by Tycho,<br />
<br />
<ol>
<li><b>product build</b><br /> Our product is based on plug-ins, however we added the '<b>featurelist</b>' in build.properties of PDE build to include some root binary for the product. However Tycho doesn't support this type of build, we create some features as the placeholder of plug-ins. Then change the product as features based. You have to manually remove the <b>plugins</b> tag in .product definition file, otherwise Tycho will fail on strange error if the .produce has both <b>features</b> and <b>plugins</b> tag. Then configure the director plugin as not installing features.<br />
<pre class="xml" name="code"> <plugin>
<groupid>org.eclipse.tycho</groupid>
<artifactid>tycho-p2-director-plugin</artifactid>
<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
<configuration>
<installfeatures>false</installfeatures>
<profile>myappprofile</profile>
</configuration>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</pre>
And I used below way to customize the qualifier string of our build.<br /> <pre class="xml" name="code"> <plugin>
<groupid>org.eclipse.tycho</groupid>
<artifactid>tycho-packaging-plugin</artifactid>
<version>${tycho-version}</version>
<configuration>
<format>'${qualifier-prefix}_'yyyyMMddHHmm</format>
</configuration>
</plugin></pre>
<br />An limitation of director plugin is that no way using different profile name for the application installed on different hosts. I contributed a patch on <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=362550">bug 362550</a> for this enhancement.</li>
<li><b>feature build</b><br />We have some features to pack some binary files as root files. But Tycho doesn't support root folder that is recognized by PDE build. The workaround is creating an additional folder, then put the root files into it.<br />Meanwhile Tycho doesn't support wildcard to other native touch points, such as changing the files permission. For static file list use comma separated list as workaround.</li>
<li><b>eclipse test plug-in</b><br />I have a plug-in whose scope is 'test', but it doesn't have test case and no dependency for any test framework, such as junit 3.8 or junit 4. And it's used for mocking test server. Configure surefire plugin to let it build as test plug-in as well.<br /><pre class="xml" name="code"> <build>
<plugins>
<plugin>
<groupid>org.eclipse.tycho</groupid>
<artifactid>tycho-surefire-plugin</artifactid>
<version>${tycho-version}</version>
<configuration>
<dependencies>
<dependency>
<groupid>junit</groupid>
<artifactid>junit</artifactid>
<version>4.1</version>
</dependency>
</dependencies>
<failifnotests>false</failifnotests>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupid>junit</groupid>
<artifactid>junit</artifactid>
<version>4.1</version>
</dependency>
</dependencies></pre>
And configure the surefire plugin like below to test code in Maven build.<br />
<pre class="xml" name="code"> <build>
<plugins>
<plugin>
<groupid>org.eclipse.tycho</groupid>
<artifactid>tycho-surefire-plugin</artifactid>
<version>${tycho-version}</version>
<configuration>
<dependencies>
<dependency>
<groupid>my.group</groupid>
<artifactid>
my.feature
</artifactid>
<version>${version}</version>
<type>eclipse-feature</type>
</dependency>
<dependency>
<groupid>my.group</groupid>
<artifactid>
my.testserver
</artifactid>
<version>1.0.0</version>
<type>eclipse-plugin</type>
</dependency>
</dependencies>
<testsuite>${testSuiteName}</testsuite>
<testclass>${testClassName}</testclass>
<argline>-Dcom.sun.management.jmxremote</argline>
<appargline>-consoleLog</appargline>
<bundlestartlevel>
<bundle>
<id>org.eclipse.equinox.ds</id>
<level>1</level>
<autostart>true</autostart>
</bundle>
</bundlestartlevel>
</configuration>
</plugin>
</plugins>
</build>
</pre>
</li>
<li><b>sign jars</b><br />Add below signjar plugin into parent pom.xml, however I met the md5 error when materializing the repository built on .product. There is a workaround mentioned on <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=344691#c11">Bug 344691</a>.<br />
<pre class="xml" name="code"> <plugin>
<groupid>org.apache.maven.plugins</groupid>
<artifactid>maven-jarsigner-plugin</artifactid>
<version>1.2</version>
<configuration>
<keystore>${keystore}</keystore>
<alias>MyCompany</alias>
<storepass>${storepass}</storepass>
<keypass>${keypass}</keypass>
<verify>true</verify>
<skip>${skip.jar.signing}</skip>
<arguments>
<argument>-tsa</argument>
<argument>https://timestamp.geotrust.com/tsa</argument>
</arguments>
<excludes>
<exclude>**/artifacts.jar</exclude>
<exclude>**/content.jar</exclude>
</excludes>
<includeclassifiers>
<includeclassifier>jar</includeclassifier>
<includeclassifier>eclipse-plugin</includeclassifier>
<includeclassifier>eclipse-feature</includeclassifier>
<includeclassifier>eclipse-test-plugin</includeclassifier>
</includeclassifiers>
</configuration>
<executions>
<execution>
<id>sign</id>
<goals>
<goal>sign</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</pre>
</li>
</ol>Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-82808031968860180152011-10-25T19:45:00.000+08:002011-10-25T19:50:47.786+08:00Migration Clearcase to Git -- part 2Several days ago I had a post to record the unsuccessful experience to migrate source code from Clearcase to Git.<br />
<br />
We have a new way after doing some brain storms. This way still is not a perfect solution, but it's much better than previous trial. <br />
<ol>
<li>Use <b>clearexport_ccase</b> to export the source folder to intermittent data. See <a href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearcase.cc_ref.doc/topics/clearexport_ccase.htm">documentation</a> of Clearcase admin.</li>
<li>Create a temporary vob for importing the data later. See <a href="http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearcase.tutorial.doc/a_cr_storagecomp_fcc_ux.htm">example</a>.</li>
<li>Import the data into temporary vob. See <a href="http://www.philforhumanity.com/ClearCase_Support_38.html">example</a>.</li>
<li>Repeat step 1 to 3 for importing all necessary data into temporary vob.</li>
<li>Use the SVN Importer to import the temporary vob as Subversion repository. </li>
<li>Last steps refer to a documentation of <a href="http://www.winklerweb.net/index.php/blog/4-eclipse/16-migrating-the-cdo-svn-repository-to-git">succeeded migration case</a> of one of Eclipse project from Subversion to Git.</li>
</ol>
Git definitely is greatest SCM tool now. The size of Subversion repository is around 10GB, finally the Git repository is less than 700MB, which saves more than 10 times disk space. It's awesome!<br />
<br />
The flaw of this way is that the removed elements in Clearcase(said using Main/LATEST as cspec of Clearcase vob when exporting) would lose after importing into a temporary vob. So switching to a maintenance branch or tag like 1.0/2.0 in Git, the source code is incomplete. The files existed in that branch or tag, then removed in latest code base are lost. The workaround could be manually checking in GA version to have complete code.<br />
<br />
If anybody have graceful and perfect solution to migrate Clearcase to Git, I think he could start a new business. :)Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-83781046088385572122011-10-17T19:50:00.002+08:002011-10-25T19:50:31.651+08:00Migrate Clearcase to GitI tried to migrate the source code of project from Clearcase to Git repository. As far as I know there is no elegant solution for such migration. For purpose of this migration, I want to keep the history and label of files in Clearcase after migrating to Git repository.<br />
<br />
There are mature tools to migrate CVS/SVN repository to Git, so I tried to use Subversion as a bridge for my migration.<br />
<br />
I used a free software '<a href="http://www.polarion.com/products/svn/svn_importer.php">SVN Importer</a>' to import the Clearcase vobs to Subversion. The tool is great, and it keeps the history of files, labels and branches. The entire size of new Subversion repository has near 50GB which is unacceptable size of Git repository. The subversion repository contains a lot of legacy code and unwanted binaries, so removing those revisions could significantly reduce the size of subversion repository. And subversion provides some admin tools to manipulate the metadata of subversion, it's possible to remove the unnecessary revisions and re-create a subversion repository with refined content. But I don't have any experience to use the admin tool of subversion before, I failed to filter the unwanted data. It's not worthy of costing too much effects on it. Finally I failed to filter the subversion repository.<br />
<br />
Actually the detail history of files is rarely used. If need, we still can find it in Clearcase. At last I manually checked in the released version of our project into Git repository, and tagged them.<br />
<br />
Wrote this unsuccessful idea here for elapsed efforts.<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-27853139443484375812011-10-17T19:34:00.001+08:002011-10-25T19:51:07.790+08:00p2 query performanceOur p2 based on installer suffered performance issue when querying IUs from repositories. Though the repositories have a large number of IUs to be queried, but we find the performance of using QL is unacceptable in some special scenarios.<br />
<br />
I <a href="https://docs.google.com/document/d/1wfnr2d2TF4vIYDCMmWPuYd0kQA32WiWaXTiaCoJovho/edit?pli=1">published several different methods</a> to find the expected IUs. Thomas pointed out the better expression of QL and finally helped us to find out the our repository without <b>IIndexProvider</b> implementation.<br />
<br />
<b>IIndexProvider</b> implementation of a repository is quite important to improve the performance of QL, especially use the 'traverse' clause to query something.<br />
<br />
And Slicer API is an alternative method when querying the complete dependencies.<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-63614289353690184272011-08-12T10:51:00.000+08:002011-08-12T10:51:41.392+08:00Create an import library for building application in MinGWYesterday I modified an existing c++ application for Windows. And its default build environment is Makefile and MinGW.<br />
<br />
However I used a newly Windows API that is not included by header files of MinGW.<br />
<br />
First of all, I copied the constant definition from header file of Windows SDK, and defined the Windows API method as a extern C method. So it's no problem to compile the code in MinGW.<br />
<br />
Secondly I have to fix the link issue. Because the symbol of the Windows API also can't be found by gcc link.<br />
<br />
Here great thanks to Google. It's quite easy to get the knowledge from others.<br />
<br />
I found a way to create an library by using dlltool. Dlltool is a utility to create an library with specified methods from existing dll library, which can be used by gcc link later.<br />
<br />
Below are links I referred to create an import library,<br />
<br />
[1] http://www.emmestech.com/moron_guides/moron1.html<br />
[2] http://www.mingw.org/wiki/CreateImportLibraries<br />
[3] http://lists-archives.org/mingw-users/19461-import-library-for-c.htmlAnonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-23068445038024207512011-07-22T13:59:00.000+08:002011-07-22T13:59:08.852+08:00Customize PDE build<a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_customization.htm">The documentation of PDE</a> has a chapter for this topic. Basically it's simply. Copy the template scripts what you want from <i><tt>templates/headless-build</tt></i> folder under <i><tt>org.eclipse.pde.build</tt></i> plug-in to your build configuration directory that is the folder has <i>build.properties</i> file.<br />
<br />
However I found the variables listed in template '<i>customAssembly.xml</i>' can't be used in the runtime. I filed bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=346370">346370</a> against it.Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-13827996988786917702011-07-18T21:03:00.000+08:002013-06-21T15:13:13.553+08:00Using the certificate of Windows code signing to sign jarsI did sign the jars via reusing the existing certificate of Windows code signing several months ago. Writing it down for further reference.<br />
<br />
Whatever your purpose of reusing the existing Windows code certificate, I only document the way from technical perspective.<br />
<br />
After buying the certificate of Windows code signing from CA, you will get a .pvk file that stores both the certificate and private key. PVK file is the PKCS12 format[1], however java uses JKS format by default. So you need convert the pvk file to JKS keystore and certificate.<br />
<small><a href="http://www.blogger.com/blogger.g?blogID=8314384370778429245" name="keytool"><small></small></a></small><br />
<br />
Since 6.0 JDK supports PKCS12 directly, you can use 'jarsigner' and PVK file to sign jars directly[2].<br />
<br />
<span style="background-color: black; color: white;">jarsigner -keystore /working/mystore.pvk -storetype pkcs12 -storepass myspass -keypass j638klm -signedjar sbundle.jar bundle.jar jane</span><br />
<br />
Or using keytool to convert the PKCS#12 to JKS format[3] if using Eclipse PDE build to sign your jars.<br />
<br />
<span style="background-color: black; color: white;">keytool -importkeystore -srckeystore KEYSTORE.pvk -destkeystore KEYSTORE.jks -srcstoretype PKCS12 -deststoretype JKS -srcstorepass mysecret -deststorepass mysecret -srcalias myalias -destalias myalias -srckeypass mykeypass -destkeypass mykeypass -noprompt </span><span style="background-color: black; color: white;"></span><br />
[1] http://en.wikipedia.org/wiki/PKCS<br />
[2] http://download.oracle.com/javase/6/docs/technotes/tools/solaris/jarsigner.html<br />
[3] http://shib.kuleuven.be/docs/ssl_commands.shtml#keytoolAnonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-90910914544263834932011-05-11T13:19:00.000+08:002011-05-11T13:20:38.599+08:00Unlock the locked profile if firefox/thunderbird crashI met that firefox/thunderbird complained another its instance running even if no a running firefox/thunderbird process. Finally let them run again after removing the '.parentlock' file in their default profile.<br> <br>strace utility helps me a lot to find the solution.<br><br><b>strace -f -e file firfox</b><br> Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-67271130800527821862011-04-22T15:56:00.000+08:002011-04-22T15:56:27.204+08:00Eclipse P2's import/export capabilityI implemented the <a href="http://kane-mx.blogspot.com/2009/12/p2-replication-plug-in.html">replication tool</a> at the end of 2009, then published it to <a href="http://kane-mx.blogspot.com/2010/05/p2-replication-tool-lives-on-eclipse.html">Eclipse Marketplace</a> in May 2010. However it's not pervasively used due to users have to install that plug-in firstly.<br />
<br />
I searched a similar <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=282419">request</a> on bugzilla, then I initialized my contribution in the early of this year. Finally it was accepted and will release as part of eclipse itself since Eclipse 3.7 M7! I hope it would benefit the users of Eclipse more and more.<br />
<br />
And I was nominated and elected as the committer of Equinox p2, it's a great honor for me. :)Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-78429916375525568362011-01-05T14:25:00.001+08:002011-01-05T14:25:56.534+08:00[vim] delete the lines not contain words:g!/some expression/d<br> Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-65534841301583862642010-12-28T11:33:00.000+08:002010-12-28T11:33:15.336+08:00Inside P2's profile (2) - the fragment matches all osgi bundlesRecently our installer met a strange bug, it didn't uninstall all legacy bundles after updating to new version. Finally I found it's due to a magic fragment is missing in the profile due to some causes.<br />
<br />
<span style="background-color: #cccccc; color: #38761d;"> <unit id='tooling.osgi.bundle.default' version='1.0.0' singleton='false'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <hostRequirements size='1'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <required namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' range='0.0.0' multiple='true' greedy='false'/></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </hostRequirements></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <properties size='1'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <property name='org.eclipse.equinox.p2.type.fragment' value='true'/></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </properties></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <provides size='2'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <provided namespace='org.eclipse.equinox.p2.iu' name='tooling.osgi.bundle.default' version='1.0.0'/></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <provided namespace='org.eclipse.equinox.p2.flavor' name='tooling' version='1.0.0'/></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </provides></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <requires size='1'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <required namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' range='0.0.0' multiple='true' greedy='false'/></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </requires></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <touchpoint id='null' version='0.0.0'/></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <touchpointData size='1'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <instructions size='4'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <instruction key='install'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> installBundle(bundle:${artifact})</span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </instruction></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <instruction key='uninstall'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> uninstallBundle(bundle:${artifact})</span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </instruction></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <instruction key='unconfigure'></span><br style="background-color: #cccccc; color: #38761d;" /><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </instruction></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> <instruction key='configure'></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> setStartLevel(startLevel:4);</span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </instruction></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </instructions></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </touchpointData></span><br style="background-color: #cccccc; color: #38761d;" /><span style="background-color: #cccccc; color: #38761d;"> </unit></span><br />
<br />
It has '<span style="background-color: #cccccc; color: #38761d;">hostRequirements</span>' element that represents it's a fragment IU and match all the eclipse's plug-ins in that profile. And this fragment defines the touch point actions for its hosts that will do installBundle action during 'install' phrase and uninstallBundle action during 'uninstall' phrase. It's a very good way to remove the duplicate touch point definitions for all eclipse's plug-ins in the profile.<br />
<br />
BTW, p2's engine also doesn't attach this fragment to the eclipse's plug-in IU if the top level IU doesn't have the STRICT rule. I'm not sure the root cause of designing for it, but it's the fact.Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-75908649053671455772010-12-28T11:13:00.007+08:002010-12-28T11:18:14.421+08:00Inside P2's profile (1) - inclusion rulesYou would see some interesting properties at the bottom of eclipse's profile.<br />
<br />
For example,<br />
<div style="background-color: #cccccc; color: #38761d;"><iuProperties id='org.eclipse.sdk.ide' version='3.6.1.M20100909-0800'><br />
<properties size='2'><br />
<property name='org.eclipse.equinox.p2.internal.inclusion.rules' value='STRICT'/><br />
</properties><br />
</iuProperties><iuproperties id="org.eclipse.sdk.ide" version="3.6.1.M20100909-0800"><iuproperties id="org.eclipse.sdk.ide" version="3.6.1.M20100909-0800"><properties size="2"><property name="org.eclipse.equinox.p2.internal.inclusion.rules" value="STRICT"></property></properties><properties size="1"><property name="org.eclipse.equinox.p2.internal.inclusion.rules" value="STRICT"><br />
</property></properties></iuproperties></iuproperties></div><br />
It attaches a property named 'org.eclipse.equinox.p2.internal.inclusion.rules' with value 'STRICT' on the IU 'org.eclipse.sdk.ide' with version 3.6.1.M20100909-0800.<br />
<br />
It's a very important property for the p2 engine. It means the IU 'org.eclipse.sdk.ide' has been explicitly installed into the profile, so it's not allowed be implicitly updated or removed.<br />
<br />
For example,<br />
We have top feature IU 'org.eclipse.sdk.ide' that represents the Eclipse SDK, 'org.eclipse.pde.feature' that represents the Plug-in Development Tool and 'org.eclipse.jdt.feature' that represents the Java Development Tool. And both JDT and PDT are part of Eclipse SDK, so 'org.eclipse.pde.feature' and 'org.eclipse.jdt.feature' are required by 'org.eclipse.sdk.ide'.<br />
<br />
If the profile only has the STRICT rule for 'org.eclipse.sdk.ide', 'org.eclipse.jdt.feature' and 'org.eclipse.pdt.feature' will implicitly be updated to 3.6.2 when updating 'org.eclipse.sdk.ide' from 3.6.1 to 3.6.2.<br />
<br />
However the profile has below STRICT rule for PDT feature,<br />
<span style="background-color: #cccccc; color: #38761d;"><iuproperties id="org.eclipse.pdt.feature" version="3.6.1.M20100909-0800"></iuproperties></span><br />
<span style="background-color: #cccccc; color: #38761d;"><properties size="1"></properties></span><br />
<div style="background-color: #cccccc; color: #38761d;"><iuProperties id='org.eclipse.pdt.feature' version='3.6.1.M20100909-0800'><br />
<properties size='2'><br />
<property name='org.eclipse.equinox.p2.internal.inclusion.rules' value='STRICT'/><br />
</properties><br />
</iuProperties><iuproperties id="org.eclipse.pdt.feature" version="3.6.1.M20100909-0800"><properties size="2"><property name="org.eclipse.equinox.p2.internal.inclusion.rules" value="STRICT"><br />
</property></properties></iuproperties></div><br />
<span style="background-color: #cccccc; color: #38761d;"> </span><br />
The p2 engine will report errors due to 'org.eclipse.pdt.feature' has STRICT rule for updating. Hence third-party must explicitly update both 'org.eclipse.sdk.ide' and 'org.eclipse.pdt.feature' from 3.6.1 to 3.6.2.Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-24229479584649179492010-12-23T13:25:00.001+08:002010-12-23T13:25:52.836+08:00stack overflow protectorLatest gcc compiler enables the stack overflow protector that is since GLIBC 2.4. So the library or executable is compiled by latest gcc could be loaded or executed in RHEL4 or Solaris 9 that only have GLIBC 2.3. Hence using option '-fno-stack-protector' to compile the library or executable to make sure it could be executed in older linux release.<br> <br>g++ -fno-stack-protector -o test.o test<br> Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0tag:blogger.com,1999:blog-8314384370778429245.post-70288139158760369402010-09-21T10:46:00.000+08:002010-09-21T10:47:09.281+08:00the loop name for 'for' clause in javaRecently I just know such a useful syntax usage of java.<br><br><pre class="prettyprint"><code><span class="pln">aLoopName</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(;;)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> </span><span class="com">// ...</span><span class="pln"><br> </span><span class="kwd">while</span><span class="pln"> </span><span class="pun">(</span><span class="pln">someCondition</span><span class="pun">)</span><span class="pln"><br> </span><span class="com">// ...</span><span class="pln"><br> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">otherCondition</span><span class="pun">)</span><span class="pln"><br> </span><span class="kwd">continue</span><span class="pln"> aLoopName</span><span class="pun">;</span><span class="pln"><br></span></code></pre><br> Anonymoushttp://www.blogger.com/profile/10573571155356194109noreply@blogger.com0