感謝網友 xiyuan1999 在csdn上提供的此下載地址。
轉換:
從Date到String |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date d = new Date(); String dstr = Df.format(d); |
從String到日期 |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date d = df.parse("2014-02-19");
|
從date到calendar |
Calendar cd1 = Calendar.getInstance(); Date sd1 = df.parse(startDate); cd1.setTime(sd1); 如: startDate="2014-02-19"; |
從calender到Date |
Calendar cd1 = Calendar.getInstance(); Date d = cd1.getTime();
|
格式化:
格式化Date |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String dstr = df.format(new Date()); |
格式化Calendar |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Calendar cd1 = Calendar.getInstance(); String dstr = df.format(cd1.getTime()); |
格式化日期字符串 |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date d = df.parse("2014-02-19"); DateFormat df1 = new SimpleDateFormat("MM-dd"); String dstr2 = df1.format(d); |
|
|
看如下代碼:
public void destroy() {
super.destroy();
if (runner != null) {
runner.stop();
runner = null;
}
if (thread != null) {
thread.interrupt();
thread = null;
}
}
這是摘錄的一段代碼。應該說對資源釋放時的問題做的比較到位。
if (runner != null)語句可以有效的避免NullPointException異常的拋出
runner.stop();可以釋放運行階段的資源。
runner = null; 把runner對象置空,有利于資源的快速回收。
綜上,此段代碼既有穩健性考慮,又有適當性能提升考慮,在我們寫代碼時值得借鑒。
When inheriting an Ant build file to maintain, it is useful to get a feel for the flow and structure. Sketching the dependencies between targets is a useful way to do this. While it is time consuming to do so by hand, there are a number of tools to help.
I tried three different tools to generate the output. All of them generate a .dot file which needs to be run through the Graphviz tool to be converted to a useful format. Graphviz can covert to all image formats among many others. Each tool is described below with an example of how to call it. I've also included two sample images: from our build script to Pick Winners in the weekly book/software promotion and a contrived example designed to show how antCall and forEach work.
C:\j2re1.4.2_03\bin\java org.apache.xalan.xslt.ProcessOutput of JavaRanch's book promotion pick a winner dependency structure and a contrived sample:
-IN build.xml -XSL ant2dot.xsl -OUT build.dot
<?xml version="1.0"?>Output of JavaRanch's book promotion pick a winner dependency structure and a contrived sample:
<project name="Vizant" basedir="." default="vizant">
<taskdef name="vizant"
classname="net.sourceforge.vizant.Vizant"
classpath="build/vizant.jar" />
<target name="vizant">
<vizant antfile="build.xml" outfile="build.dot" uniqueref="true" />
</target>
</project>
<?xml version="1.0"?>Output of JavaRanch's book promotion pick a winner dependency structure and a contrived sample:
<project name="Grand" basedir="." default="grand">
<typedef resource="net/ggtools/grand/antlib.xml" classpath="grand.jar" />
<target name="grand">
<grand output="grand-build.dot" buildfile="build.xml" />
</target>
</project>
通常,我們可以用update來直接安裝。但是myeclipse限制了中國區的下載和更新。所以我們只能用插件配置的方法來實現。
方法參考自http://blog.csdn.net/jackpk/archive/2010/05/13/5587633.aspx
具體配置方法如下:
安裝subclipse,
SVN 插件
1、從官網下載site-1.6.9.zip文件,網址
是:subclipse.tigris.org,
2、從中解壓出features與plugins文件夾,復制到 /opt/MyEclipse/myPlugin/svn里面,其它的*.xml文件不要。
3、在/opt/MyEclipse/MyEclipse8.5/dropins下新建文件svn.link,內容是:path=/opt/MyEclipse/myPlugin/svn
保存。
4、
刪除/opt/MyEclipse/MyEclipse8.5/configuration/org.eclipse.update文件夾
5、
重啟myeclipse就一切正常了。
目錄 | 所有用戶 | zz |
/ | rw | rw |
/wp |
無權限 | rw |
Repository | 項目目錄 | 用戶 | 權限 | |
myproject |
* |
* |
rw | |
myproject |
/wp |
* |
無權限 |
|
myproject | /wp |
zz | rw |
|
team | * | * | rw |
|
team | /ims | * | 無權限 |
|
team |
/ims |
zz |
r |
|
team |
/ims |
@dev(表示組) |
rw |
laptop:/tmp# cd /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/fonts/
laptop:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/fonts/# mkdir fallback
laptop:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/fonts/# cd fallback
laptop:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/fonts/fallback# ln -s `/usr/share/fonts/fonts/truetype/` .
laptop:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/fonts/fallback# mkfontdir
laptop:/usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/fonts/fallback# mkfontscale