??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美午夜精品一区二区三区电影,国产在线不卡一区,欧美日韩亚洲一区二区http://www.aygfsteel.com/doodoosun/category/31753.html万物皆备于我zh-cnTue, 02 Dec 2014 00:17:44 GMTTue, 02 Dec 2014 00:17:44 GMT60Java 反射机制http://www.aygfsteel.com/doodoosun/articles/420899.htmldoodoosundoodoosunMon, 01 Dec 2014 16:50:00 GMThttp://www.aygfsteel.com/doodoosun/articles/420899.htmlhttp://www.aygfsteel.com/doodoosun/comments/420899.htmlhttp://www.aygfsteel.com/doodoosun/articles/420899.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/420899.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/420899.htmlJava 中,无论生成多个cȝ对象Q这些对象都会对应于同一个Class对象

2.获取某个cL某个对象所对应的Class对象常用?U方?/div>
a)使用Classcȝ静态方法forName:Class.forName("java.lang.String")
b)使用c语法String.class
c)使用对象的getClassQ)ҎQString s ="aa";
Class<?> clazz= s.getClass(); 
  不带参数的构造方法,生成对象
 a)先获得Class对象Q然后通过Class对象newInstance() Ҏ直接生成对象?/div>
 b) 先获得Class对象Q然后通过该对象获得对应的Construtor 对象Q?/div>

package com.doodoosun;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ReflectTest {


    
    public int add (int param1,int param2){
        return param1+param2;
    }
    
    public String echo (String message){
        return "Hello :"+message;
    }
    
    
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
        // TODO Auto-generated method stub
        Class<?> classType = ReflectTest.class;
        
        Object reflectTest = classType.newInstance();
        
        Method addMethod = classType.getMethod("add",new Class[]{int.class,int.class});

        Object result = addMethod.invoke(reflectTest,new Object[]{1,2});
        
        System.out.println("-------"+(Integer)result);
        
        Method echoMethod = classType.getMethod("echo", new Class[]{String.class});
        
        Object result2  = echoMethod.invoke(reflectTest, new Object[]{"tom"});
        
        System.out.println(result2);
        
        
        
    }


doodoosun 2014-12-02 00:50 发表评论
]]>jdk5多线E?? http://www.aygfsteel.com/doodoosun/articles/220436.htmldoodoosundoodoosunWed, 06 Aug 2008 06:27:00 GMThttp://www.aygfsteel.com/doodoosun/articles/220436.htmlhttp://www.aygfsteel.com/doodoosun/comments/220436.htmlhttp://www.aygfsteel.com/doodoosun/articles/220436.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/220436.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/220436.html阅读全文

doodoosun 2008-08-06 14:27 发表评论
]]>
JDK1.5中的U程池用简?/title><link>http://www.aygfsteel.com/doodoosun/articles/220221.html</link><dc:creator>doodoosun</dc:creator><author>doodoosun</author><pubDate>Tue, 05 Aug 2008 08:45:00 GMT</pubDate><guid>http://www.aygfsteel.com/doodoosun/articles/220221.html</guid><wfw:comment>http://www.aygfsteel.com/doodoosun/comments/220221.html</wfw:comment><comments>http://www.aygfsteel.com/doodoosun/articles/220221.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/doodoosun/comments/commentRss/220221.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/doodoosun/services/trackbacks/220221.html</trackback:ping><description><![CDATA[<div id="wmqeeuq" class="postTitle"><a class="postTitle2" id="viewpost1_TitleUrl" href="http://www.aygfsteel.com/surffish/articles/12755.html">JDK1.5中的U程池用简介(无名Q?/a> </div> <p>在多U程大师Doug Lea的A献下Q在JDK1.5中加入了许多对ƈ发特性的支持Q例如:U程池?/p> <p>一、简?br /> U程池类?java.util.concurrent.ThreadPoolExecutorQ常用构造方法ؓQ?br />                <br />     ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, <br />                 long keepAliveTime, TimeUnit unit, <br />                 BlockingQueue<runnable> workQueue, <br />                 RejectedExecutionHandler handler)<br />                 </p> <p>    corePoolSizeQ?nbsp;  U程池维护线E的最数?br />     maximumPoolSizeQ线E池l护U程的最大数?br />     keepAliveTimeQ?nbsp; U程池维护线E所允许的空闲时?br />     unitQ?nbsp;          U程池维护线E所允许的空闲时间的单位<br />     workQueueQ?nbsp;     U程池所使用的缓冲队?br />     handlerQ?nbsp;       U程池对拒绝d的处理策?br />     <br />     一个Q务通过 execute(Runnable)Ҏ被添加到U程池,d是一?Runnablecd的对象,d的执行方法就?Runnablecd对象的run()Ҏ?br />     <br />     当一个Q务通过execute(Runnable)ҎƲ添加到U程池时Q?br />     <br />     如果此时U程池中的数量小于corePoolSizeQ即使线E池中的U程都处于空闲状态,也要创徏新的U程来处理被d的Q务?/p> <p>    如果此时U程池中的数量等?corePoolSizeQ但是缓冲队?workQueue未满Q那么Q务被攑օ~冲队列?/p> <p>    如果此时U程池中的数量大于corePoolSizeQ缓冲队列workQueue满,q且U程池中的数量小于maximumPoolSizeQ徏新的U程来处理被d的Q务?/p> <p>    如果此时U程池中的数量大于corePoolSizeQ缓冲队列workQueue满,q且U程池中的数量等于maximumPoolSizeQ那么通过 handler所指定的策略来处理此Q务?br />     <br />     也就是:处理d的优先为:<br />     核心U程corePoolSize、Q务队列workQueue、最大线EmaximumPoolSizeQ如果三者都满了Q用handler处理被拒l的d?br />     <br />     当线E池中的U程数量大于 corePoolSizeӞ如果某线E空闲时间超qkeepAliveTimeQ线E将被终止。这PU程池可以动态的调整池中的线E数?br />     <br />     unit可选的参数为java.util.concurrent.TimeUnit中的几个静态属性:<br />     NANOSECONDS、MICROSECONDS、MILLISECONDS、SECONDS?br />     <br />     workQueue我常用的是:java.util.concurrent.ArrayBlockingQueue<br />     <br />     handler有四个选择Q?br />     ThreadPoolExecutor.AbortPolicy()        <br />        抛出java.util.concurrent.RejectedExecutionException异常<br />     ThreadPoolExecutor.CallerRunsPolicy()   <br />        重试d当前的Q务,他会自动重复调用execute()Ҏ<br />     ThreadPoolExecutor.DiscardOldestPolicy()<br />        抛弃旧的d<br />     ThreadPoolExecutor.DiscardPolicy()      <br />        抛弃当前的Q?/p> <p>    <br /> 二、一般用法D?br /> //------------------------------------------------------------<br /> //TestThreadPool.java<br /> //package cn.simplelife.exercise;</p> <p>import java.io.Serializable;<br /> import java.util.concurrent.ArrayBlockingQueue;<br /> import java.util.concurrent.ThreadPoolExecutor;<br /> import java.util.concurrent.TimeUnit;</p> <p>public class TestThreadPool {</p> <p>    private static int produceTaskSleepTime = 2;<br />     private static int consumeTaskSleepTime = 2000;<br />     private static int produceTaskMaxNumber = 10;<br />     <br />  public static void main(String[] args) {</p> <p>        //构造一个线E池    <br />         ThreadPoolExecutor threadPool = new ThreadPoolExecutor(2, 4, 3,<br />                 TimeUnit.SECONDS, new ArrayBlockingQueue<runnable>(3),<br />                 new ThreadPoolExecutor.DiscardOldestPolicy());</p> <p>        for(int i=1;i<=produceTaskMaxNumber;i++){<br />             try {               <br />                 //产生一个Q务,q将其加入到U程?br />                 String task = "task@ " + i;<br />     System.out.println("put " + task);<br />     threadPool.execute(new ThreadPoolTask(task));<br />     <br />     //便于观察Q等待一D|?br />                 Thread.sleep(produceTaskSleepTime);<br />             } catch (Exception e) {<br />                 e.printStackTrace();<br />             }<br />         }<br />  }</p> <p> /**<br />   * U程池执行的d<br />   * @author hdpan<br />   */<br />     public static class ThreadPoolTask implements Runnable,Serializable{<br />      private static final long serialVersionUID = 0;<br />      //保存d所需要的数据<br />         private Object threadPoolTaskData;<br />         <br />         ThreadPoolTask(Object tasks){<br />             this.threadPoolTaskData = tasks;<br />         }<br />         public void run(){<br />             //处理一个Q务,q里的处理方式太单了Q仅仅是一个打印语?br />    System.out.println("start .."+threadPoolTaskData);<br />          try {<br />              ////便于观察Q等待一D|?br />                 Thread.sleep(consumeTaskSleepTime);<br />             } catch (Exception e) {<br />                 e.printStackTrace();<br />             }<br />             threadPoolTaskData = null;<br />         }<br />         public Object getTask(){<br />             return this.threadPoolTaskData;<br />         }<br />     }<br /> }<br /> //------------------------------------------------------------<br /> 说明Q?br /> 1、在q段E序中,一个Q务就是一个Runnablecd的对象,也就是一个ThreadPoolTaskcd的对象?/p> <p>2、一般来说Q务除了处理方式外Q还需要处理的数据Q处理的数据通过构造方法传lQ务?/p> <p>3、在q段E序中,main()Ҏ相当于一个残忍的领导Q他z֏多Q务,丢给一个叫 threadPool的Q劳Q怨的组来做?/p> <p>    q个组里面队员臛_有两个,如果他们两个忙不q来Q?dp攑ֈd列表里面?/p> <p>    如果U压的Q务过多,多到d列表都装不下(过3?的时候,雇佣新的队员来帮忙。但是基于成本的考虑Q不能雇佣太多的队员Q?臛_只能雇䄦 4个?/p> <p>    如果四个队员都在忙时Q再有新的Q务, q个组处理不了了QQ务就会被通过一U策略来处理Q我们的处理方式是不停的z֏Q?直到接受q个d为止(更残忍!呵呵)?/p> <p>    因ؓ队员工作是需要成本的Q如果工作很Ԍ闲到 3SECONDS都没有新的Q务了Q那么有的队员就会被解雇了,但是Qؓ了小l的正常q{Q即使工作再Ԍ组的队员也不能于两个?/p> <p>4、通过调整 produceTaskSleepTime?consumeTaskSleepTime的大来实现Ҏ发Q务和处理d的速度的控Ӟ 改变q两个值就可以观察不同速率下程序的工作情况?/p> <p>5、通过调整4中所指的数据Q再加上调整d丢弃{略Q?换上其他三种{略Q就可以看出不同{略下的不同处理方式?/p> <p>6、对于其他的使用ҎQ参看jdk的帮助,很容易理解和使用?/p> <img src ="http://www.aygfsteel.com/doodoosun/aggbug/220221.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/doodoosun/" target="_blank">doodoosun</a> 2008-08-05 16:45 <a href="http://www.aygfsteel.com/doodoosun/articles/220221.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于ClassName.class.getResourceAsStream的\径问?http://www.aygfsteel.com/doodoosun/articles/214699.htmldoodoosundoodoosunMon, 14 Jul 2008 05:07:00 GMThttp://www.aygfsteel.com/doodoosun/articles/214699.htmlhttp://www.aygfsteel.com/doodoosun/comments/214699.htmlhttp://www.aygfsteel.com/doodoosun/articles/214699.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/214699.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/214699.html对ClassName.class.getResourceAsStream的\径问题比较模p,现在把研I的l果写一下:

ClassName是这个Class的名Uͼq里假设为MyClassQ处于MyPackage.MyChildPackage包中Q如果你source.props文g攑֜Classes文g夹中的时候,可以q样写ClassName.class.getResourceAsStream(/source.props)

如果你想把props文g攑֜包中的时候,假设攑ֈMyPackage.MyChildPackage中的res文g夹,可以q样写ClassName.class.getResourceAsStream(/MyPackage/MyChildPackage/res/source.props)Q?代表的是包的.



doodoosun 2008-07-14 13:07 发表评论
]]>
文g上传的全部解x?/title><link>http://www.aygfsteel.com/doodoosun/articles/209381.html</link><dc:creator>doodoosun</dc:creator><author>doodoosun</author><pubDate>Fri, 20 Jun 2008 03:23:00 GMT</pubDate><guid>http://www.aygfsteel.com/doodoosun/articles/209381.html</guid><wfw:comment>http://www.aygfsteel.com/doodoosun/comments/209381.html</wfw:comment><comments>http://www.aygfsteel.com/doodoosun/articles/209381.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/doodoosun/comments/commentRss/209381.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/doodoosun/services/trackbacks/209381.html</trackback:ping><description><![CDATA[<a >JSP/Servlet: Oreilly MultiPartRequest 档案上传</a>  http://caterpillar.onlyfun.net/GossipCN/JSPServlet/FileUpload.htm<br /> <small>使用览器进行档案上传时Q是使用multipart/form-data~码Q然而Servlet容器q不会自动帮我们处理~码Q而必ȝE式设计人员自行处理Q在q个部䆾Q我们可以用Oreilly所提供的上传套件MultiPartRequestQ您可以至以下的|址下蝲Q档案是cos- 05Nov2002.zipQ?br /> <br style="font-family: Courier New,Courier,monospace" /> </small> <div style="margin-left: 40px"><small><span style="font-weight: bold; font-family: Courier New,Courier,monospace">http://www.servlets.com/cos/index.html</span><br /> </small></div> <small><br /> 解开zip档案之后Q在lib目录下可以找到cos.jarQ将它复制至您的Web应用E式的WEB-INF/lib下就可以了,基本上, Oreilly的MultiPartRequest相当的容易用,它可以同时处理多个档案的上传Qƈ且提供多个方法可以让您取得上传档案的相关资讯?br /> <br /> q边提供一个简单的例子Q首先撰写上传的表单Q?</small><br /> <ul> <li>form.htm </li> </ul> <pre><html> <br /> <head> <br /> <title>档案上传</title> <br /> <meta http-equiv="Content-Type"<br /> content="text/html; charset=Big5"> <br /> </head> <br /> <body> <br /> <b>档案上传</b></font></p><br /> <br /> <form name="UploadForm" <br /> enctype="multipart/form-data" <br /> method="post" action="upload.jsp"> <br /> <input type="file" name="File1" size="20" maxlength="20"> <br /> <br> <br /> <input type="file" name="File2" size="20" maxlength="20"> <br /> <br> <br /> <input type="submit"value="上传"> <br /> </form><br /> <br /> </body> <br /> </html> </pre> <br /> <small>q边C两个档案的上传,表单的enctype必须讑֮为multipart/form-dataQ而上传方法是postQ表单元件的输入型态是 fileQ当Ӟ上传的档案数在实际应用时Q是可以用JavaScript{方法来动态进行选择的?br /> <br /> 上传的动作处理,撰写在upload.jsp中: </small><br /> <ul> <li>upload.jsp </li> </ul> <pre><%@page import="com.oreilly.servlet.MultipartRequest" %> <br /> <% <br /> String saveDirectory = "/home/caterpillar/files/"; <br /> // 限制上传之档案大ؓ 5 MB <br /> int maxPostSize = 5 * 1024 * 1024 ; <br /> MultipartRequest multi = new MultipartRequest(request , <br /> saveDirectory , maxPostSize, "MS950"); <br /> out.println("档案上传OK"); <br /> %> </pre> <br /> <small>注意到程式中import了com.oreilly.servlet.MultipartRequestQ?MultipartRequest可以限制档案上传的大,最后一个参数是上传档案名称的编码,如果不设定的话,预设是ISO-8859-1Qؓ了支援繁体中文档名,E式中设定ؓMS950Q如果要支援体中文档名,可以讑֮为GB2312?br /> <br /> 基本上您只要建立MultipartRequest物g完成了档案上传的处理动作,如果要额外取得档案资讯,您可以从 MultipartRequest物g取得Q例如getFileNames()、getContentType()、getFile(){等Q?getFileNames()所取得的是Enumeration型态之物gQ可以这么用:<br /> </small> <div style="margin-left: 40px"><small><span style="font-weight: bold; font-family: Courier New,Courier,monospace">Enumeration filenames = multi.getFileNames(); </span><br style="font-weight: bold; font-family: Courier New,Courier,monospace" /> <span style="font-weight: bold; font-family: Courier New,Courier,monospace">while(filenames.hasMoreElements()) { </span><br style="font-weight: bold; font-family: Courier New,Courier,monospace" /> <span style="font-weight: bold; font-family: Courier New,Courier,monospace">    String filename = (String) filenames.nextElement(); </span><br style="font-weight: bold; font-family: Courier New,Courier,monospace" /> <span style="font-weight: bold; font-family: Courier New,Courier,monospace">     out.println("上传了档? + filename + "<br>"); </span><br style="font-weight: bold; font-family: Courier New,Courier,monospace" /> <span style="font-weight: bold; font-family: Courier New,Courier,monospace">} </span><br /> </small></div> <small> <br /> 其它有关于MultipartRequest的说明,您可以参考下载的zip档中之api说明?</small><br /> <img src ="http://www.aygfsteel.com/doodoosun/aggbug/209381.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/doodoosun/" target="_blank">doodoosun</a> 2008-06-20 11:23 <a href="http://www.aygfsteel.com/doodoosun/articles/209381.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclispe 内存不解决Ҏhttp://www.aygfsteel.com/doodoosun/articles/209058.htmldoodoosundoodoosunThu, 19 Jun 2008 01:06:00 GMThttp://www.aygfsteel.com/doodoosun/articles/209058.htmlhttp://www.aygfsteel.com/doodoosun/comments/209058.htmlhttp://www.aygfsteel.com/doodoosun/articles/209058.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/209058.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/209058.html前一D|间在Eclipse中调试工E的时候,会报出内存不I然后可以取消但是几次之后Eclipse׃d哪里Q不得不l束重启。曾l从资料上看刎ͼ可能是Eclipse的自动构建导致消耗了内存Q但是取消自动构建后每次调试的时候不得不手工构徏Q有时候忘C׃D调试不出l果。今天又学到了一招,怎么解决?br />  
可以增大java虚拟机内存,在Eclipse的安装目录有Eclipse的配|文件eclipse.iniQ修改它可以了
-vmargs
-Xms40m
-Xmx400m
其中-vmargs指这个参数是用于java的虚拟机(virtual machine)的,-Xms表示最|-Xmx表示最大|可以Ҏ机器的具体情况设|最大倹{?br />  
除了修改配置文g的办法之外,q可以通过讄启动参数的办法,新徏一个Eclipse快捷方式Q在快捷方式属性的目标框中后添加:-vmargs -Xmx300M -XX:MaxPermSize=256M
-Xmx400M 表示eclipse分配的内存从默认?56M增加?00M
-XX:MaxPermSize=256M 表示eclipse长期保持的内存由默认?4M增加?56M
注意Q上面两个数字的差必d?Xmx数值的5%?nbsp;
 
2.

打开eclipse,选择Window--Preferences...在对话框左边的树上双击JavaQ再双击Installed JREsQ在双选择前面有对勄JREQ再单击双?#8220;Edit”按钮Q?br /> 出现一?Edit JRE 的对话框Q在其中的Default VM Arguments: 框中输入 -Xms128m -Xmx512m ,q样讄Java拟虚机内存用最是128MQ最大是512MQ再单击“OK”关闭 Edit JRE 对话框,再单?#8220;OK”关闭 Preferences对话框,Eclipse一下子p行快了v来,呵~
或者是
可以在eclipse.ini文g中将默认讄改ؓ-vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M或者更大,q要看你自己机器的内存配|而定Q如果这栯决不了就叛_eclipse快捷方式Q在属?--快捷方式标签?--目标中输入E:\eclipse-SDK-3.2RC7-win32\eclipse\eclipse.exe -clean -vmargs -Xms128M -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M其中E:\eclipse-SDK-3.2RC7-win32\eclipse\eclipse.exe是我的eclipse的位|,可以了

再一U情况就是看看电脑是不是安装了什么恶意插Ӟ把它们都清楚掉就可以了!


3.内存插g

eclipse加速插件keepresident   http://suif.stanford.edu/pub/keepresident 

.eclipse加速插件keepresident   http://suif.stanford.edu/pub/keepresident  如果你的machine内存于700m,那么该插件实在能让你的eclipse快v?不再像以前那?动不动就僵住?  其原理是利用两个 windows api - setprocessworkingsetsize ?virtuallock,实得windows操作pȝ量不把  javaq程的内存pageout到硬?多hold住一些物理内存给javaq程使用.q样当java process定期垃圾回收时就  不会表现得僵住了.



doodoosun 2008-06-19 09:06 发表评论
]]>
i18国际化的研究和proerties 文g?/title><link>http://www.aygfsteel.com/doodoosun/articles/208954.html</link><dc:creator>doodoosun</dc:creator><author>doodoosun</author><pubDate>Wed, 18 Jun 2008 10:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/doodoosun/articles/208954.html</guid><wfw:comment>http://www.aygfsteel.com/doodoosun/comments/208954.html</wfw:comment><comments>http://www.aygfsteel.com/doodoosun/articles/208954.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/doodoosun/comments/commentRss/208954.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/doodoosun/services/trackbacks/208954.html</trackback:ping><description><![CDATA[     摘要: Java Properties c读取配|文件信?nbsp; http://blog.csdn.net/DL88250/archive/2008/02/19/2104561.aspx 在我们^时写E序的时候,有些参数是经常改变的Q而这U改变不是我们预知的。比如说我们开发了一个操作数据库的模块,在开发的时候我们连接本地的数据库那?IP Q数据库名称Q表名称Q数据库L{信息是我们本地的,?..  <a href='http://www.aygfsteel.com/doodoosun/articles/208954.html'>阅读全文</a><img src ="http://www.aygfsteel.com/doodoosun/aggbug/208954.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/doodoosun/" target="_blank">doodoosun</a> 2008-06-18 18:14 <a href="http://www.aygfsteel.com/doodoosun/articles/208954.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>google svn 服务器?/title><link>http://www.aygfsteel.com/doodoosun/articles/207368.html</link><dc:creator>doodoosun</dc:creator><author>doodoosun</author><pubDate>Thu, 12 Jun 2008 06:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/doodoosun/articles/207368.html</guid><wfw:comment>http://www.aygfsteel.com/doodoosun/comments/207368.html</wfw:comment><comments>http://www.aygfsteel.com/doodoosun/articles/207368.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/doodoosun/comments/commentRss/207368.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/doodoosun/services/trackbacks/207368.html</trackback:ping><description><![CDATA[google svn 服务器用:<br />     1. http://code.google.com/ 用gmaild?gt;后点?gt;<strong><a >Project Hosting</a></strong><br />     2. q入>> http://code.google.com/hosting/  >后点?gt;<a >Create a new project</a><br />     3. 填入必要的项目名Q描q等定。就可以?br />     4. 定成功?-><a onclick="cancelBubble=true;" >Source</a><br />     5. 到eclipse的打开新徏一个project->team->share Project->svn<br />     6. 后面Ҏ google source 上的svn提示Q这我就不多说了。一般的svn http url <br /> <br /> <br /> svn 在eclipse 的配|:<br /> 打开eclipse <br /> 1.点击help-> <br /> 2.Software Updates-> <br /> 3.Find and Install-> <br /> 4.Search for new feature to install -> <br /> 5.New Remote Site-> <br /> 6.Name:SubEclipse,URL:http://subclipse.tigris.org/update<br /> 7.定-> <br /> 8.选择SubEclipse-> <br /> 9.finish-> <br /> 10.{待d下蝲文g列表 <br /> 11.选择subeclipse <br /> 12.next <br /> 13.I accept the .....next <br /> 14.finish <br /> 15.开始下?漫长的等待过E?.. <br /> 16.Install al <br /> 17.安装完成后会提示是否重新启动eclipse,点击Yes <br /> <img src ="http://www.aygfsteel.com/doodoosun/aggbug/207368.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/doodoosun/" target="_blank">doodoosun</a> 2008-06-12 14:04 <a href="http://www.aygfsteel.com/doodoosun/articles/207368.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一个{义符的问??http://www.aygfsteel.com/doodoosun/articles/206036.htmldoodoosundoodoosunThu, 05 Jun 2008 06:02:00 GMThttp://www.aygfsteel.com/doodoosun/articles/206036.htmlhttp://www.aygfsteel.com/doodoosun/comments/206036.htmlhttp://www.aygfsteel.com/doodoosun/articles/206036.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/206036.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/206036.htmlx一个字W串中所有的"\"转换?/",xWindows格式的{换成Unix格式.
于是用到String.replaceAll(String regex, String replacement)q个Ҏ.
如果用path = path.replaceAll("\\", "/"); 会报?Z么呢?
 
在字W串里面,\是{义符.
在正则表辑ּ里面,\也是转义W?
 
replaceAll的第一个参数是一个正则表辑ּ?惛_到正则表辑ּ中的\,必ȝ"\\\\".
?用\\来得到字W串中的\,用\\\\卛_得到正则表达式中的\.
 
困扰了几分钟,被钟普一语点?


在java中要一个字W串的中$W号去除。我是这样写的:
String tmp = "-$125402.00";
tmp.replaceAll("$","");
可是执行L的结果ƈ没有?去除。后来找资料才发现要q样?br /> tmp.replaceAll("\\$","")才可以?


public class test {
public static void main(String[] args) {
String str=”F[ACE=color]dddddddddddddd[/FACE]“;
str=str.replaceAll(”[”,”<”);
System.out.print(str);
}
}
在那个”[”q里出现错啦Q?br /> java.util.regex.PatternSyntaxException: Unclosed character class near
index 0
———————————————————————————————?br /> String的replaceAllҎQ第一个参C用的是正则式表达Ҏ。详l可看JDK文档?br /> 上例改ؓreplaceAll(”\\Q[\\E”,”<”);

public class PathTrackle

{
 public static String  existPathTrackle(String path){
  String  tempString = path.replaceAll("\\\\", "/");
  String returnString = tempString.replaceAll("/+|", "/");
  return returnString;
 }
 
  public static void main(String args[]){
   
    String a="ab/cd/";
    String b="\\\\\\dawson\\\\";
    String c="http://///////////c/d//ab//kk//";
    System.out.println(existPathTrackle(c));
  }

}




doodoosun 2008-06-05 14:02 发表评论
]]>
可变参数的用?/title><link>http://www.aygfsteel.com/doodoosun/articles/204075.html</link><dc:creator>doodoosun</dc:creator><author>doodoosun</author><pubDate>Fri, 30 May 2008 06:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/doodoosun/articles/204075.html</guid><wfw:comment>http://www.aygfsteel.com/doodoosun/comments/204075.html</wfw:comment><comments>http://www.aygfsteel.com/doodoosun/articles/204075.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/doodoosun/comments/commentRss/204075.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/doodoosun/services/trackbacks/204075.html</trackback:ping><description><![CDATA[<p>package basic;</p> <p><br /> public class TestVariableArg<br /> {</p> <p>  /**<br />    * @param args<br />    */<br />   <br />   public static String executeToW3CNodeArray (String query, Object... objectarray){<br />        System.out.println("executeToW3CNodeArray "); <br />        System.out.println("objectarray "+objectarray.toString());<br />        return query;<br />   }<br />   public static void main(String[] args)<br />   {<br />     Object a=(Object)"string ";<br />     System.out.println(executeToW3CNodeArray("Tapestry in Action"));</p> <p>  }</p> <p>}</p> <img src ="http://www.aygfsteel.com/doodoosun/aggbug/204075.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/doodoosun/" target="_blank">doodoosun</a> 2008-05-30 14:01 <a href="http://www.aygfsteel.com/doodoosun/articles/204075.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java国际化——资源包的用和构徏http://www.aygfsteel.com/doodoosun/articles/203006.htmldoodoosundoodoosunMon, 26 May 2008 10:19:00 GMThttp://www.aygfsteel.com/doodoosun/articles/203006.htmlhttp://www.aygfsteel.com/doodoosun/comments/203006.htmlhttp://www.aygfsteel.com/doodoosun/articles/203006.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/203006.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/203006.html参考:
1.http://stonexu.spaces.live.com/blog/cns!a02fa9ddd3c7b8cc!115.entry
2.http://blog.163.com/quentin_wjb/blog/static/4726976120083842920
http://blog.donews.com/apalong/archive/2005/08/25/526269.aspx



doodoosun 2008-05-26 18:19 发表评论
]]>
Java反编译工?Eclipse插g--Jode Decompilerhttp://www.aygfsteel.com/doodoosun/articles/135177.htmldoodoosundoodoosunFri, 09 May 2008 08:46:00 GMThttp://www.aygfsteel.com/doodoosun/articles/135177.htmlhttp://www.aygfsteel.com/doodoosun/comments/135177.htmlhttp://www.aygfsteel.com/doodoosun/articles/135177.html#Feedback0http://www.aygfsteel.com/doodoosun/comments/commentRss/135177.htmlhttp://www.aygfsteel.com/doodoosun/services/trackbacks/135177.html 大家也许用过其他的反~译工具Q比?/font>jadQ或者是集成?/font>DJ Java DecompilerQ?/font>jad可能用v来比较麻烦,但是DJ Java Decompilerq是蛮好用的?br /> q里我就不说他们了,有空你们可以自己去down一个来玩玩?br /> 我是非常喜欢用Eclipse的啦Q在q里我就来说说基于Eclipse的Java反编译插Ӟ也许有h用过Jadclipse,实很不错的Q但是在q里我也不说它了Q?br /> 我现在要说的?/font>Jode Decompiler.
安装非常的简单,help => Software Updates => Find and Install... => Search for new features to install,单击"New Remote Site..."
 在URL栏输?
http://www.technoetic.com/eclipse/update然后下一步,可以看?#8220;jode decompiler plugin *.*”了,选上安装可以了Q?br /> ׃Jode Decompiler是纯Java~写的所以也不需要其他的什么组件来支持了,安装好了可以看到Window => Preferences... => Java => Jode Decompiler选项卡?br /> 安装好了再设|一下文件关联就可以了,Window => Preferences... => General => Editors => File Associations扑ֈ"*.class"?Associated editors"里面可以看到
"Jode class file viewer"选中它再单击Default按钮OK?
 现在可以开始用了,建立一个project然后引用你的lg,在组件中扑ֈ你所要反~译的类文g打开可以看到反~译后得到的代码?看到Eclipse昄出来的反~译代码直就是一Un?用DJ Java Decompiler反编译出来的代码也有关键字高亮等的功?但是LEclipse的看h爽吧.嘿嘿......


eclipse 3.3 不能用该工具
可以用jad for eclipse 3.3  的工?br />
jad是java的反~译工具Q是命o行执行,反编译出来的源文件可L较高。可惜用h不太方便。还?

    扑ֈeclipse下的插gQ叫jadclipseQ安装好之后Q只要双凅Rclass文gQ就能直接看源文Ӟ包括jar

    包中的class文gQ也可以直接反编译?/p>

    1.下蝲http://www.kpdus.com/jad.html#download下蝲后解压。解压羃后将jad.exe拯到JRE的bin目录下,如\Java\jre1.5.0_06\bin

    2.下蝲 jadclipse_3.3.jar

    http://jaist.dl.sourceforge.net/sourceforge/jadclipse/net.sf.jadclipse_3.3.0.jarjadclipse_3.1.0.jar复制到DQ\Program Files\eclipse\myplugin\eclipse\plugins目录下(用的?/p>

    link方式安装插g的)?/p>

    3.启动Eclipse后,?a class="channel_keylink" target="_blank">Windows—?gt;Perference—?gt;Java下面应该会多Z个JadClipse目录Q相关的讄?/p>

    以在此修攚w|jadclipseQ设|path to decompiler为jad.exe的全路径Q如QFQ\Java\jre1.5.0_06\bin\jad.exe

    Q在Directory for temporary files中指定时文件的路径Q如QGQ\Java\eclipse-SDK-3.0-win32\temp 4、在Eclipse?a class="channel_keylink" target="_blank">Windows—?gt;Perference—?gt;General->Editors->File Associations中修?#8220;*.class”?/p>

    认关联的~辑器ؓ“JadClipse Class File Viewer”



doodoosun 2008-05-09 16:46 发表评论
]]>
վ֩ģ壺 | ɳ| ƽԭ| | | | ƽ| ʯ| ȫ| | Ӽ| | Ϫ| | | | | ˮ| | ͬ| | | | ¡| | | | | ͨ| ʯɽ| | | º| ͬ| Ϸ| | | | | | |