??xml version="1.0" encoding="utf-8" standalone="yes"?>在线观看一级片,88xx成人永久免费观看,jzzjzzjzz亚洲成熟少妇http://www.aygfsteel.com/wangflood/category/47232.html_ֿl护一个技术blogQؓ了工作,也是爱好?/description>zh-cnThu, 31 Mar 2011 14:20:45 GMTThu, 31 Mar 2011 14:20:45 GMT60走近Systemc?/title><link>http://www.aygfsteel.com/wangflood/articles/System.html</link><dc:creator>wangflood</dc:creator><author>wangflood</author><pubDate>Wed, 30 Mar 2011 09:52:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangflood/articles/System.html</guid><wfw:comment>http://www.aygfsteel.com/wangflood/comments/347316.html</wfw:comment><comments>http://www.aygfsteel.com/wangflood/articles/System.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangflood/comments/commentRss/347316.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangflood/services/trackbacks/347316.html</trackback:ping><description><![CDATA[我依然记?曄在听马士늚J2SE的课E时Q讲到regexӞ有个Ҏ(gu)?lookat"Q一向温和的马兄大怒,说SUNq个后知后觉的土?q个名字取得多么垃圾。这个的混在sun里面Q可以想见sun里面有多这L货色。又一q_sun被oracle收购Q我大惊马士늚预见?br /> 后来我在?lt;<thinking in java>>Ӟ发现BruceQ也在骂SUN。居焉的话和马士兵一?br /> q么当然是马士兵抄袭了。技术员也就q么点乐。无语。。。。。?br /> 不要怿那谁谁的。只I一手鞋Q我后来惟뀂似乎此话也引自马士兵,不知马士兵引自谁的?br /> 从研I源码开始吧。。。。。?br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000;">/**</span><span style="color: #008000;"><br />  * <br />  </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">package</span><span style="color: #000000;"> com.wang.test;<br /> <br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.BufferedReader;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.File;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.FileInputStream;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.IOException;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.InputStreamReader;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.PrintStream;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.nio.channels.Channel;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Calendar;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Iterator;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Map;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Map.Entry;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Properties;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.util.Set;<br /> <br /> </span><span style="color: #008000;">/**</span><span style="color: #008000;"><br />  * </span><span style="color: #808080;">@author</span><span style="color: #008000;"> Sam Wang<br />  * </span><span style="color: #808080;">@since</span><span style="color: #008000;"> Mar 22, 2011<br />  </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> TestSystem {<br /> <br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> main(String[] args) </span><span style="color: #0000ff;">throws</span><span style="color: #000000;"> IOException {<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> java居然可以打印错误。很用到。Console下是U色的。估计java.util.logger是在其上包装的?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        System.err.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">err</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 得到pȝ的环境?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        Map</span><span style="color: #000000;"><</span><span style="color: #000000;">String, String</span><span style="color: #000000;">></span><span style="color: #000000;"> envs </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.getenv();<br />         Set</span><span style="color: #000000;"><</span><span style="color: #000000;">Entry</span><span style="color: #000000;"><</span><span style="color: #000000;">String, String</span><span style="color: #000000;">>></span><span style="color: #000000;"> sets </span><span style="color: #000000;">=</span><span style="color: #000000;"> envs.entrySet();<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (Iterator</span><span style="color: #000000;"><</span><span style="color: #000000;">Entry</span><span style="color: #000000;"><</span><span style="color: #000000;">String, String</span><span style="color: #000000;">>></span><span style="color: #000000;"> iterator </span><span style="color: #000000;">=</span><span style="color: #000000;"> sets.iterator(); iterator<br />                 .hasNext();) {<br />             Entry</span><span style="color: #000000;"><</span><span style="color: #000000;">String, String</span><span style="color: #000000;">></span><span style="color: #000000;"> entry </span><span style="color: #000000;">=</span><span style="color: #000000;"> (Entry</span><span style="color: #000000;"><</span><span style="color: #000000;">String, String</span><span style="color: #000000;">></span><span style="color: #000000;">) iterator<br />                     .next();<br />             System.out.println(entry.getKey().toLowerCase() </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">:</span><span style="color: #000000;">"</span><span style="color: #000000;"><br />                     </span><span style="color: #000000;">+</span><span style="color: #000000;"> entry.getValue().toLowerCase());<br /> <br />         }<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 得到pȝ的Properties,大致的打印情况和getenv()差不多?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        Properties props </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.getProperties();<br />         System.out.println(props);<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 安全理Q神马玩艺?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        SecurityManager man </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.getSecurityManager();<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 对于特定的数字,打印的HashCode是一L?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 有时间再了解了解HashCode</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        System.out.println(System.identityHashCode(</span><span style="color: #000000;">0</span><span style="color: #000000;">));</span><span style="color: #008000;">//</span><span style="color: #008000;"> 19621457<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> q个Channel是java.nio里面的。用作流处理的一cȝ东西的?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 大致上和Input,System.io相关?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        Channel channel </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.inheritedChannel();<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 得到pȝ以long形式表示的当前时间?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        </span><span style="color: #0000ff;">long</span><span style="color: #000000;"> time </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.nanoTime();<br />         System.out.println(time);<br />         Calendar c </span><span style="color: #000000;">=</span><span style="color: #000000;"> Calendar.getInstance();<br />         c.setTimeInMillis(time);<br />         System.out.println(c.getTime());<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 不太常见Q表CZ理解</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        System.runFinalization();<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> System.err的包装?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        System.setErr(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> PrintStream(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> File(</span><span style="color: #000000;">"</span><span style="color: #000000;">err.txt</span><span style="color: #000000;">"</span><span style="color: #000000;">)));<br />         System.err.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">我犯错了?/span><span style="color: #000000;">"</span><span style="color: #000000;">);<br />         System.setOut(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> PrintStream(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> File(</span><span style="color: #000000;">"</span><span style="color: #000000;">out.txt</span><span style="color: #000000;">"</span><span style="color: #000000;">)));<br />         System.out.println(</span><span style="color: #000000;">"</span><span style="color: #000000;">turn console to out.txt</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> System.in的包装?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        System.setIn(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> FileInputStream(</span><span style="color: #000000;">"</span><span style="color: #000000;">film.txt</span><span style="color: #000000;">"</span><span style="color: #000000;">));<br />         InputStreamReader isr </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> InputStreamReader(System.in);<br />         BufferedReader br </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> BufferedReader(isr);<br />         String str </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">""</span><span style="color: #000000;">;<br />         </span><span style="color: #0000ff;">while</span><span style="color: #000000;"> ((str </span><span style="color: #000000;">=</span><span style="color: #000000;"> br.readLine()) </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;">) {<br />             System.out.println(str);<br />         }<br /> <br />         Properties prop </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Properties();<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> prop.load(new FileReader("test.properties"));</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        prop.loadFromXML(</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> FileInputStream(</span><span style="color: #000000;">"</span><span style="color: #000000;">prop.xml</span><span style="color: #000000;">"</span><span style="color: #000000;">));<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> q个也没什么用Q得到系l配|,然后ql设C个prop.xml中?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 其实也可以手动做?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 有些人就是怀疑系l(JVMQ是不是能给我们做更多的事?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 其实pȝ不完?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        System.setProperties(prop);<br />         Properties props2 </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.getProperties();<br />         System.out.println(props2);<br /> <br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 见名知义。这个方法参数我都不惛_了?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> Sytemc肯定是java开发api时最先想到要开发的cM?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> q个Ҏ(gu)攑֜System里面<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> 而不是在Arrays里面。是个历史遗留问题?br />         </span><span style="color: #008000;">//</span><span style="color: #008000;"> System.arraycopy(src, srcPos, dest, destPos, length)</span><span style="color: #008000;"><br /> </span><span style="color: #000000;"><br />     }<br /> }<br /> </span></div> <br /> <br /> <br /> <br /> <img src ="http://www.aygfsteel.com/wangflood/aggbug/347316.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangflood/" target="_blank">wangflood</a> 2011-03-30 17:52 <a href="http://www.aygfsteel.com/wangflood/articles/System.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>走近Cloneablehttp://www.aygfsteel.com/wangflood/articles/Cloneable.htmlwangfloodwangfloodWed, 30 Mar 2011 09:29:00 GMThttp://www.aygfsteel.com/wangflood/articles/Cloneable.htmlhttp://www.aygfsteel.com/wangflood/comments/347313.htmlhttp://www.aygfsteel.com/wangflood/articles/Cloneable.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347313.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347313.html
package com.wang.test;

/**
 * 
@author Sam Wang
 * 
@since Mar 22, 2011
 
*/
// 实现了Cloneable接口Qjava不要求你实现MҎ(gu) it's a marker
public class TestObject implements Cloneable {

    
public static void main(String[] args) throws Exception {
        TestObject test 
= new TestObject();
        test.clone();
// 实现了Cloneable接口的Test对象可以调用Cloneable
        int[] arr = { 2141234234, };
        arr.clone();
        
boolean is = arr.getClass() == arr.clone().getClass();
        System.out.println(is);
// true
        Object o = new Object();
        o.clone();
// Object虽然提供cloneҎ(gu)Q但是无法调用。因为是native修饰的?br />
        
// 对于String来说Q?/span>
        String str = new String("34534");
        str.clone();
// 不行Q没有实现Cloneable接口?/span>
    }
}
// 可以惌Cloneable接口只是一个marker.所有的c都从Objectl承Q而且protectedQ?br /> // 所以所有的c都有cloneҎ(gu)Q但是无法没有marker的话Q就不能调用cloneҎ(gu)?br /> // 无法了解到int[]的实玎ͼ但是int[]可以clone.
// 但是String的类gclone的功能的methodq少吗?
q个混ؕ的状态有点像size和length。居然还有变态的面试考List取长度是size()Q还是length(),亦或是length,或是size?记得ruby语言有q种混ؕ。比javaqؕ.各种方言版的rubyQ؜战?br /> 玩dotaӞ大家常说:各种各样的SBh。呵c?br />


wangflood 2011-03-30 17:29 发表评论
]]>
走近DecimalFormathttp://www.aygfsteel.com/wangflood/articles/DecimalFormat.htmlwangfloodwangfloodWed, 30 Mar 2011 09:16:00 GMThttp://www.aygfsteel.com/wangflood/articles/DecimalFormat.htmlhttp://www.aygfsteel.com/wangflood/comments/347309.htmlhttp://www.aygfsteel.com/wangflood/articles/DecimalFormat.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347309.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347309.htmlimport java.math.BigDecimal;
import java.text.DecimalFormat;

/**
 * 
@author Sam Wang
 * 
@since Mar 22, 2011
 
*/
public class TestFormat {

    
public static void main(String[] args) {
        String str 
= "215713485.000000";
        BigDecimal de 
= new BigDecimal(str);
        String s 
= new DecimalFormat().format(de);
        System.out.println(s);
    }
}
 





wangflood 2011-03-30 17:16 发表评论
]]>
用trycatch写了一D늉别垃圄代码http://www.aygfsteel.com/wangflood/articles/trycatch.htmlwangfloodwangfloodWed, 30 Mar 2011 09:07:00 GMThttp://www.aygfsteel.com/wangflood/articles/trycatch.htmlhttp://www.aygfsteel.com/wangflood/comments/347307.htmlhttp://www.aygfsteel.com/wangflood/articles/trycatch.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347307.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347307.html
在这个方法里面,取得参数?得作cd转换。所以必LU定的顺序{换,比如序?String,Integer,Integer).取参很丑陋吧?br />
l这个方法传参的时候,需要确定好cdQ比如是从xml中读取出q组参数,那么是个Sting[]Q类型,直接传参Q取参的时候会报错。所以投q去的时候,必须以确定的cd?br /> 以下q段代码是q么q的?br />
import java.util.Arrays;

public class TestDoubleParse {

    
public static void main(String[] args) {
        String[] strs 
= new String[] { "EMA""14""0.001" };
        Object[] arg 
= new Object[3];
        
for (int i = 0; i < strs.length; i++) {
            
try {
                
int temp = Integer.parseInt(strs[i]);
                arg[i] 
= temp;
            } 
catch (NumberFormatException e) {
                
try {
                    
double d = Double.parseDouble(strs[i]);
                    arg[i] 
= d;
                } 
catch (NumberFormatException nfe) {
                    arg[i] 
= strs[i];
                }

            }

        }
        System.out.println(Arrays.toString(arg));
    }
}

try{try{}}的作用就相当于另一UŞ式的if了。很无奈Q?zhn)剧l重演。。。。?br />


wangflood 2011-03-30 17:07 发表评论
]]>
关于动态代理的混ؕ设计http://www.aygfsteel.com/wangflood/articles/Refelect.htmlwangfloodwangfloodWed, 30 Mar 2011 04:48:00 GMThttp://www.aygfsteel.com/wangflood/articles/Refelect.htmlhttp://www.aygfsteel.com/wangflood/comments/347269.htmlhttp://www.aygfsteel.com/wangflood/articles/Refelect.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347269.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347269.html
public interface Bird {

    
public void fly();
    
public void song();
}

public class TinyBird implements Bird {

    
private static final TinyBird instance = new TinyBird();

    
static final TinyBird getDefault() {
        
return instance;
    }

    @Override
    
public void fly() {
        System.out.println(
"bird flying .");

    }

    @Override
    
public void song() {
        System.out.println(
"bird songing .");

    }

}


public class BirdHandler implements InvocationHandler {

    
private Object deledate;

    
public BirdHandler(TinyBird deledate) {
        
this.deledate = deledate;
    }

    @Override
    
public Object invoke(Object proxy, Method method, Object[] args)
            
throws Throwable {
        doBefore();
        Object result 
= method.invoke(deledate, args);
        doAfter();
        
return result;
    }

    
private void doBefore() {
        System.out.println(
"before.");
    }

    
private void doAfter() {
        System.out.println(
"after.");
    }
}



public class Factory {

    
private static Bird instance = newInstance(TinyBird.getDefault());

    
public static Bird getDefaultSettings() {
        
return instance;
    }

    
public static Bird newSettings() {
        
return newInstance(new TinyBird());
    }

    
private static Bird newInstance(TinyBird real) {
        Class
<?> c = TinyBird.class;
        
return (Bird) Proxy.newProxyInstance(c.getClassLoader(),
                c.getInterfaces(), 
new BirdHandler(real));
    }

}


Factory.getDefaultSettings()和Factory.newSettings()Z么要同时出现。。。。。。?/span>





wangflood 2011-03-30 12:48 发表评论
]]>
你敢说你真正理解了java变量定义吗?http://www.aygfsteel.com/wangflood/articles/Variable.htmlwangfloodwangfloodTue, 29 Mar 2011 12:50:00 GMThttp://www.aygfsteel.com/wangflood/articles/Variable.htmlhttp://www.aygfsteel.com/wangflood/comments/347233.htmlhttp://www.aygfsteel.com/wangflood/articles/Variable.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347233.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347233.html 晚上和群里面兄弟又讨ZQ没有结果。脓(chung)出来Q等我以后长q了Q也好看看,自己当初是多么地菜?br /> 当然Q最重要的就是和blog读者分享了?br />
public class Test {
    
static int x;
    
static {
        
int x = 0;

    }
    {
        
int x = 0;
    }

    
public static void main(String[] args) {
        
int x = 0;
        
while (true) {
            
// ~译错误
            
// Doplicate local valiable x
            int x = 0;
        }
    }
}
static不是只在data segment上分配内存吗Q如果是的话Qstatic代码块里的int x=0Q是如何分配?。。。。。。。。?br /> 很晕。求高手指教?br />


wangflood 2011-03-29 20:50 发表评论
]]>
List的toArrayҎ(gu)http://www.aygfsteel.com/wangflood/articles/toArray.htmlwangfloodwangfloodTue, 29 Mar 2011 12:43:00 GMThttp://www.aygfsteel.com/wangflood/articles/toArray.htmlhttp://www.aygfsteel.com/wangflood/comments/347232.htmlhttp://www.aygfsteel.com/wangflood/articles/toArray.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347232.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347232.html
import java.util.ArrayList;
import java.util.List;

public class TestList {

    
public static void main(String[] args) {
        List
<String> list = new ArrayList<String>();
        list.add(
"wang");
        list.add(
"hello");
        list.add(
"world");
        
// list不能做ؓString params的参?br />         // test(list);
        
// 不能转换成功。why ?
        
//test((String[]) list.toArray());
        String[] arr = list.toArray(new String[list.size()]);
        test(arr);
        
//源码代看不太懂,toArrayҎ(gu)里面Z么不自己
        
//new String[list.size()];N不是做缓冲的吗?
        String[] arr2 = list.toArray(new String[1]);//一个长度也成功。这不是耍我吗?
        test(arr2);
    }

    
public static void test(String params) {
        
for (int i = 0; i < params.length; i++) {
            System.out.println(params[i]);
        }
    }
}
1.Z?String[])list.toArray()转换会出错?br /> 2.实践证明list.toArray(new String[xx])括号里面的是用作~冲的。当然分配得多速度׃快了。这个媄响会有多大了?br />    javaq个设计再次让程序参与到性能中,JVM优化边界在哪Q什么时候,我们需要考虑到分配一个和N的内存单元缓Ԍ在速度上的不同?
   q样的时候多吗?如果有,什么时候?



wangflood 2011-03-29 20:43 发表评论
]]>
for (int i = 0, size = c.size(); i < size; i++)http://www.aygfsteel.com/wangflood/articles/for.htmlwangfloodwangfloodTue, 29 Mar 2011 04:46:00 GMThttp://www.aygfsteel.com/wangflood/articles/for.htmlhttp://www.aygfsteel.com/wangflood/comments/347203.htmlhttp://www.aygfsteel.com/wangflood/articles/for.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/347203.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/347203.html
package com.wang.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class Test {
    
private final static int Length = 1000;

    
public static void main(String[] args) {
        
int length = 1000;
        List
<Double> c = new ArrayList<Double>();
        initSet(c);
        
long t1 = System.currentTimeMillis();
        test1(c);
        
long t2 = System.currentTimeMillis();
        test2(c);
        
long t3 = System.currentTimeMillis();
        test3(c);
        
long t4 = System.currentTimeMillis();
        test4(c);
        
long t5 = System.currentTimeMillis();
        System.out
                .println(
"*******************************************************************");
        System.out.println(t2 
- t1);
        System.out.println(t3 
- t2);
        System.out.println(t4 
- t3);
        System.out.println(t5 
- t4);
    }

    
private static void test3(List<Double> c) {
        
for (Iterator<Double> iterator = c.iterator(); iterator.hasNext();) {
            System.out.println(iterator.next());

        }

    }

    
private static void test2(List<Double> c) {
        
for (int i = 0; i < c.size(); i++) {
            System.out.println(c.get(i));
        }

    }

    
private static void test4(List<Double> c) {
        
for (int i = c.size() - 1; i >= 0; i--) {
            System.out.println(c.get(i));
        }

    }

    
private static void test1(List<Double> c) {
        
for (int i = 0, size = c.size(); i < size; i++) {
            System.out.println(c.get(i));
        }
    }

    
private static void initSet(List<Double> c) {
        
for (int i = 0; i < Length; i++) {
            c.add(Math.random());
        }

    }

}
Length==1000?
94
62
32
31
Length==10000?
516
406
375
344

Length==100000?
3563
3453
3641
3453
Length==1000000?
35109
34625
36469
34891


JVM到底有没有优化呢。我没有打开汇编看。但臛_我得出结?for (int i = 0, size = c.size(); i < size; i++)q种写法没有必要。数据量不大的时候,反而效率低很多?br />
各位高手l徏议。。。。。。。Why





wangflood 2011-03-29 12:46 发表评论
]]>
亲近验证?/title><link>http://www.aygfsteel.com/wangflood/articles/341535.html</link><dc:creator>wangflood</dc:creator><author>wangflood</author><pubDate>Sat, 25 Dec 2010 15:10:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangflood/articles/341535.html</guid><wfw:comment>http://www.aygfsteel.com/wangflood/comments/341535.html</wfw:comment><comments>http://www.aygfsteel.com/wangflood/articles/341535.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangflood/comments/commentRss/341535.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangflood/services/trackbacks/341535.html</trackback:ping><description><![CDATA[        最q在做一个面试题Q断断箋l地忙了?ji)天。终于赶在圣诞节前,q个好的晚上完成。不仅把SSH架构复习一遍,displaytag也应用上了?br /> 完成q个目Q生了几个衍生品。其中验证码是其中一个?br /> <br /> 一般大d和注册页面上存在验证Q以前觉得很秘。可能是接触得多Q高度就高了Q再看验证码Q其实就是response一个contentType="image/jpeg"cd的html而已?br /> 下面是我和awt方式生成q张囄的源?<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.BorderLayout;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.Button;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.Color;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.Font;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.Frame;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.Graphics;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.event.ActionEvent;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.event.ActionListener;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.event.WindowAdapter;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.event.WindowEvent;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.awt.image.BufferedImage;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.Random;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.concurrent.TimeUnit;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_426_2103_Open_Image" onclick="this.style.display='none'; Codehighlighter1_426_2103_Open_Text.style.display='none'; Codehighlighter1_426_2103_Closed_Image.style.display='inline'; Codehighlighter1_426_2103_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_426_2103_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_426_2103_Closed_Text.style.display='none'; Codehighlighter1_426_2103_Open_Image.style.display='inline'; Codehighlighter1_426_2103_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Test </span><span style="color: #0000ff">extends</span><span style="color: #000000"> Frame </span><span id="Codehighlighter1_426_2103_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_426_2103_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_444_896_Open_Image" onclick="this.style.display='none'; Codehighlighter1_444_896_Open_Text.style.display='none'; Codehighlighter1_444_896_Closed_Image.style.display='inline'; Codehighlighter1_444_896_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_444_896_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_444_896_Closed_Text.style.display='none'; Codehighlighter1_444_896_Open_Image.style.display='inline'; Codehighlighter1_444_896_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Test() </span><span id="Codehighlighter1_444_896_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_444_896_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Button b </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Button(</span><span style="color: #000000">"</span><span style="color: #000000">下一?/span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        setBounds(</span><span style="color: #000000">300</span><span style="color: #000000">, </span><span style="color: #000000">300</span><span style="color: #000000">, </span><span style="color: #000000">400</span><span style="color: #000000">, </span><span style="color: #000000">400</span><span style="color: #000000">);<br /> <img id="Codehighlighter1_558_646_Open_Image" onclick="this.style.display='none'; Codehighlighter1_558_646_Open_Text.style.display='none'; Codehighlighter1_558_646_Closed_Image.style.display='inline'; Codehighlighter1_558_646_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_558_646_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_558_646_Closed_Text.style.display='none'; Codehighlighter1_558_646_Open_Image.style.display='inline'; Codehighlighter1_558_646_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">this</span><span style="color: #000000">.addWindowListener(</span><span style="color: #0000ff">new</span><span style="color: #000000"> WindowAdapter() </span><span id="Codehighlighter1_558_646_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_558_646_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            @Override<br /> <img id="Codehighlighter1_617_642_Open_Image" onclick="this.style.display='none'; Codehighlighter1_617_642_Open_Text.style.display='none'; Codehighlighter1_617_642_Closed_Image.style.display='inline'; Codehighlighter1_617_642_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_617_642_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_617_642_Closed_Text.style.display='none'; Codehighlighter1_617_642_Open_Image.style.display='inline'; Codehighlighter1_617_642_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> windowClosing(WindowEvent e) </span><span id="Codehighlighter1_617_642_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_617_642_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                System.exit(</span><span style="color: #000000">0</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000">);<br /> <img id="Codehighlighter1_693_780_Open_Image" onclick="this.style.display='none'; Codehighlighter1_693_780_Open_Text.style.display='none'; Codehighlighter1_693_780_Closed_Image.style.display='inline'; Codehighlighter1_693_780_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_693_780_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_693_780_Closed_Text.style.display='none'; Codehighlighter1_693_780_Open_Image.style.display='inline'; Codehighlighter1_693_780_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        b.addActionListener(</span><span style="color: #0000ff">new</span><span style="color: #000000"> ActionListener() </span><span id="Codehighlighter1_693_780_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_693_780_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            @Override<br /> <img id="Codehighlighter1_755_776_Open_Image" onclick="this.style.display='none'; Codehighlighter1_755_776_Open_Text.style.display='none'; Codehighlighter1_755_776_Closed_Image.style.display='inline'; Codehighlighter1_755_776_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_755_776_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_755_776_Closed_Text.style.display='none'; Codehighlighter1_755_776_Open_Image.style.display='inline'; Codehighlighter1_755_776_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> actionPerformed(ActionEvent e) </span><span id="Codehighlighter1_755_776_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_755_776_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                repaint();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        repaint();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">this</span><span style="color: #000000">.setLayout(</span><span style="color: #0000ff">new</span><span style="color: #000000"> BorderLayout());<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">this</span><span style="color: #000000">.add(b, BorderLayout.SOUTH);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">this</span><span style="color: #000000">.setVisible(</span><span style="color: #0000ff">true</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    @Override<br /> <img id="Codehighlighter1_945_1750_Open_Image" onclick="this.style.display='none'; Codehighlighter1_945_1750_Open_Text.style.display='none'; Codehighlighter1_945_1750_Closed_Image.style.display='inline'; Codehighlighter1_945_1750_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_945_1750_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_945_1750_Closed_Text.style.display='none'; Codehighlighter1_945_1750_Open_Image.style.display='inline'; Codehighlighter1_945_1750_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> paint(Graphics headG) </span><span id="Codehighlighter1_945_1750_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_945_1750_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> width </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">400</span><span style="color: #000000">, height </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">400</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        BufferedImage image </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> BufferedImage(width, height,<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                BufferedImage.TYPE_INT_RGB);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Graphics g </span><span style="color: #000000">=</span><span style="color: #000000"> image.getGraphics();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Random random </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Random();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        g.setColor(getRandColor(</span><span style="color: #000000">200</span><span style="color: #000000">, </span><span style="color: #000000">250</span><span style="color: #000000">));<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        g.fillRect(</span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #000000">0</span><span style="color: #000000">, width, height);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        g.setFont(</span><span style="color: #0000ff">new</span><span style="color: #000000"> Font(</span><span style="color: #000000">"</span><span style="color: #000000">Arial</span><span style="color: #000000">"</span><span style="color: #000000">, Font.BOLD, </span><span style="color: #000000">120</span><span style="color: #000000">));<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        g.setColor(getRandColor(</span><span style="color: #000000">160</span><span style="color: #000000">, </span><span style="color: #000000">200</span><span style="color: #000000">));<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_1330_1504_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1330_1504_Open_Text.style.display='none'; Codehighlighter1_1330_1504_Closed_Image.style.display='inline'; Codehighlighter1_1330_1504_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1330_1504_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1330_1504_Closed_Text.style.display='none'; Codehighlighter1_1330_1504_Open_Image.style.display='inline'; Codehighlighter1_1330_1504_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">550</span><span style="color: #000000">; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_1330_1504_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1330_1504_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">int</span><span style="color: #000000"> x </span><span style="color: #000000">=</span><span style="color: #000000"> random.nextInt(width);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">int</span><span style="color: #000000"> y </span><span style="color: #000000">=</span><span style="color: #000000"> random.nextInt(height);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">int</span><span style="color: #000000"> xl </span><span style="color: #000000">=</span><span style="color: #000000"> random.nextInt(</span><span style="color: #000000">12</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">int</span><span style="color: #000000"> yl </span><span style="color: #000000">=</span><span style="color: #000000"> random.nextInt(</span><span style="color: #000000">12</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            g.drawLine(x, y, x </span><span style="color: #000000">+</span><span style="color: #000000"> xl, y </span><span style="color: #000000">+</span><span style="color: #000000"> yl);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        String sRand </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">""</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_1557_1708_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1557_1708_Open_Text.style.display='none'; Codehighlighter1_1557_1708_Closed_Image.style.display='inline'; Codehighlighter1_1557_1708_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1557_1708_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1557_1708_Closed_Text.style.display='none'; Codehighlighter1_1557_1708_Open_Image.style.display='inline'; Codehighlighter1_1557_1708_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">4</span><span style="color: #000000">; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_1557_1708_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1557_1708_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            String rand </span><span style="color: #000000">=</span><span style="color: #000000"> String.valueOf(random.nextInt(</span><span style="color: #000000">10</span><span style="color: #000000">));<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            sRand </span><span style="color: #000000">+=</span><span style="color: #000000"> rand;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            g.setColor(</span><span style="color: #0000ff">new</span><span style="color: #000000"> Color(</span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #000000">0</span><span style="color: #000000">));<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            g.drawString(rand, </span><span style="color: #000000">110</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000"> i </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">3</span><span style="color: #000000">, </span><span style="color: #000000">250</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        headG.drawImage(image, </span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #0000ff">this</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_1793_1812_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1793_1812_Open_Text.style.display='none'; Codehighlighter1_1793_1812_Closed_Image.style.display='inline'; Codehighlighter1_1793_1812_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1793_1812_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1793_1812_Closed_Text.style.display='none'; Codehighlighter1_1793_1812_Open_Image.style.display='inline'; Codehighlighter1_1793_1812_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span id="Codehighlighter1_1793_1812_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1793_1812_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">new</span><span style="color: #000000"> Test();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img id="Codehighlighter1_1858_2100_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1858_2100_Open_Text.style.display='none'; Codehighlighter1_1858_2100_Closed_Image.style.display='inline'; Codehighlighter1_1858_2100_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_1858_2100_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1858_2100_Closed_Text.style.display='none'; Codehighlighter1_1858_2100_Open_Image.style.display='inline'; Codehighlighter1_1858_2100_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">static</span><span style="color: #000000"> Color getRandColor(</span><span style="color: #0000ff">int</span><span style="color: #000000"> fc, </span><span style="color: #0000ff">int</span><span style="color: #000000"> bc) </span><span id="Codehighlighter1_1858_2100_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_1858_2100_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        Random random </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Random();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (fc </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">255</span><span style="color: #000000">)<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            fc </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">255</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (bc </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">255</span><span style="color: #000000">)<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            bc </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">255</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> r </span><span style="color: #000000">=</span><span style="color: #000000"> fc </span><span style="color: #000000">+</span><span style="color: #000000"> random.nextInt(bc </span><span style="color: #000000">-</span><span style="color: #000000"> fc);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> g </span><span style="color: #000000">=</span><span style="color: #000000"> fc </span><span style="color: #000000">+</span><span style="color: #000000"> random.nextInt(bc </span><span style="color: #000000">-</span><span style="color: #000000"> fc);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> b </span><span style="color: #000000">=</span><span style="color: #000000"> fc </span><span style="color: #000000">+</span><span style="color: #000000"> random.nextInt(bc </span><span style="color: #000000">-</span><span style="color: #000000"> fc);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Color(r, g, b);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <br /> q行情况(截图):<br /> <img alt="" src="http://www.aygfsteel.com/images/blogjava_net/wangflood/c.jpg" border="0" /><br /> <img src ="http://www.aygfsteel.com/wangflood/aggbug/341535.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangflood/" target="_blank">wangflood</a> 2010-12-25 23:10 <a href="http://www.aygfsteel.com/wangflood/articles/341535.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>高仿Windows标准型计器实现http://www.aygfsteel.com/wangflood/articles/Cal.htmlwangfloodwangfloodSat, 13 Nov 2010 00:03:00 GMThttp://www.aygfsteel.com/wangflood/articles/Cal.htmlhttp://www.aygfsteel.com/wangflood/comments/337964.htmlhttp://www.aygfsteel.com/wangflood/articles/Cal.html#Feedback0http://www.aygfsteel.com/wangflood/comments/commentRss/337964.htmlhttp://www.aygfsteel.com/wangflood/services/trackbacks/337964.html阅读全文

wangflood 2010-11-13 08:03 发表评论
]]>
歌词整理的程序实?/title><link>http://www.aygfsteel.com/wangflood/articles/337963.html</link><dc:creator>wangflood</dc:creator><author>wangflood</author><pubDate>Fri, 12 Nov 2010 23:43:00 GMT</pubDate><guid>http://www.aygfsteel.com/wangflood/articles/337963.html</guid><wfw:comment>http://www.aygfsteel.com/wangflood/comments/337963.html</wfw:comment><comments>http://www.aygfsteel.com/wangflood/articles/337963.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/wangflood/comments/commentRss/337963.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/wangflood/services/trackbacks/337963.html</trackback:ping><description><![CDATA[     摘要:     10月底到深x扑ַ作,一直没有给人念惟뀂然后我在国际文化大厦宇商|做起了销售,一Ҏ(gu)着工作?我想我没有机会(因ؓ是二本U)Q就自己创造机会吧。每搞定一个客户就x他当作自q一个机会?所以一直跟客户套近乎?其中有一个蓝天科技的公司,问我能不能写个程序来整理歌词。如果行Q我可以取得面试ZQ还会注册ؓ我们宇商|的会员?我花了二个小Ӟ搞定了?...  <a href='http://www.aygfsteel.com/wangflood/articles/337963.html'>阅读全文</a><img src ="http://www.aygfsteel.com/wangflood/aggbug/337963.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/wangflood/" target="_blank">wangflood</a> 2010-11-13 07:43 <a href="http://www.aygfsteel.com/wangflood/articles/337963.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">ݳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ά</a>| <a href="http://" target="_blank">̩</a>| <a href="http://" target="_blank">տ</a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank">̽</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̶</a>| <a href="http://" target="_blank">̴</a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank">ͷ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">·</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ũ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>