java¶ÁÈ¡XMLÎļþ
1.¶ÁÈ¡XMLÎļþµÄÀࣺ
public class XMLUtils {
private final String DB_XML_FILE = "/XMLSetting.xml";
public Properties getPropertiesfromXML() {
URL url = XMLUtils.class.getResource(dBXMLFILE);
URI uri;
try {
uri = url.toURI();
InputSource xmlfile = new InputSource(uri.getPath());
MyDefaultHandler handler = new MyDefaultHandler ();
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
SAXParser parser = parserFactory.newSAXParser();
parser.parse(xmlfile, handler);
return handler.getProps();
} catch (ParserConfigurationException e) {
System.out.println(e.getMessage());
return null;
} catch (SAXException e) {
System.out.println(e.getMessage());
return null;
} catch (IOException e) {
System.out.println(e.getMessage());
return null;
} catch (URISyntaxException e) {
System.out.println(e.getMessage());
return null;
}
}
}
2.´¦ÀíXMLÎļþµÄÀࣺ
import java.util.Properties;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import com.app.common.Constants;
public class MyDefaultHandler extends DefaultHandler {
private Properties props;
private String key = "";
private StringBuffer value = new StringBuffer();
public MyDefaultHandler() {
props = new Properties();
}
@Override
public void characters(char[] ch, int start, int length)
throws SAXException {
value.append(ch, start, length);
}
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
props.put(key, value.toString().trim());
}
@Override
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
value.delete(0, value.length());
key = attributes.getValue(Constants.KEY);
}
public Properties getProps() {
return this.props;
}
}
3.main£º
import java.util.Properties;
pu
Ïà¹ØÎĵµ£º
/**
* ¶ÑÅÅÐò
*
* */
public void heapSort(double[] a){
double temp;
initCreateHeap(a);
for(int i = a.length - 1; i > 0; i --){
temp = a[0];
a[0] = a[i];
a[i] = temp;
createHeap(a, i, 0);
}
}
/**
* ½«Êý×é¿´³ÉÍêÈ«¶þ²æÊ÷£¬½¨Á¢×î´ó¶Ñ
* */
private ......
ÕâÒ»ÓÐ¹Ø Java ±à³Ì¶¯Ì¬·½ÃæµÄеÄϵÁÐÎÄÕÂÑо¿ÁËÖ´ÐÐ Java Ó¦ÓóÌÐòʱĻºóËù·¢ÉúµÄÊÂÇé¡£ÆóÒµ Javaר¼Ò
Dennis Sosnoski ÌṩÁË Java ¶þ½øÖÆÀà¸ñʽÒÔ¼°ÔÚ JVM
ÄÚ²¿ÀàËù·¢ÉúµÄÇé¿öµÄÄÚÄ»¡£½Ó×Å£¬Ëû½«ÌÖÂÛÀà×°ÈëÎÊÌ⣬Æ䷶ΧÉæ¼°´ÓÔËÐмòµ¥µÄ Java Ó¦ÓóÌÐòËùÐèµÄÀàµÄÊýÁ¿µ½¿ÉÄÜÔì³É J2EE
¼°ÀàËƵĸ´ÔÓÌåϵ½á¹¹³öÏÖÎÊÌâµÄ ......
javaʵÏֵĶàÏîʽ¼Ó·¨£¬¼õ·¨£¬³Ë·¨£¬³ý·¨ÔËË㣬ÆäÖжàÏîʽµÄ±íʾÐÎʽΪ°´Ãݴӵ͵½¸ßµÄϵÊýÊý×飬Êý×éµÄ³¤¶È¼´ÊǶàÏîʽµÄÃÝ
¼´ Êý×é{1,2,3,4} ±íʾ¶àÏîʽ4x3+3x2+2x+1
ÔËËãÔÚ¹¤¾ßÀàPolynÖнøÐÐ ³õʼ»¯Polyn±ØÐëÒª´«Á½¸ö²ÎÊý ¼´±»³ýÊýºÍ³ýÊý
ÆäÖмӷ¨£¬¼õ·¨ºÍ³Ë·¨ÊǾ²Ì¬·½·¨ ²»ÐèʵÀý¼´¿ÉʹÓÃ
³ý·¨ÐèÒª²úÉúÉ̺ÍÓàÊ ......
Java¼¯ÈºÖ®session¹²Ïí½â¾ö·½°¸
À´Ô´£ºhttp://blog.csdn.net/crskyp/archive/2009/11/19/4836685.aspx
Ëæ×Å»¥ÁªÍøµÄÈÕÒæ׳´ó,ÍøÕ¾µÄpvºÍuv³ÉÏßÐÔ»òÕßÖ¸Êý±¶µÄÔö¼Ó.µ¥·þÎñÆ÷µ¥Êý¾Ý¿âÔçÒѾ²»ÄÜÂú×ãʵ¼ÊÐèÇó.±ÈÈçÏñÊ¢´ó,ÌÔ±¦ÕâÑùµÄ´óÐÍÍøÂ繫˾,¸üÊÇÈç´Ë.
¼¯Èº,Ò²¾ÍÊÇÈÃÒ»×é¼ÆËã»ú·þÎñÆ÷Ðͬ¹¤×÷ ......
½ñÍíÔÚ¹äCSDNµÄʱºò·¢ÏÖÁË£¬ÓÐÈËÓÃjavaдÁËÉú³Émyeclipse×¢²áÂëµÄ´úÂ룬ËùÒԾͳ¼ÁËÏÂÀ´¡£ o(∩_∩)o ¹þ¹þ
package gggg;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class MyEclipseGen {
private static final ......