﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-天空是蓝色的</title><link>http://www.blogjava.net/bluesky/</link><description>做好软件为中国
#gcc -c helloworld.c -o helloworld.o //编译目标文件
#gcc helloworld.o -o helloworld //编译成可执行exe
#helloworld //运行exe</description><language>zh-cn</language><lastBuildDate>Tue, 28 Apr 2026 10:45:38 GMT</lastBuildDate><pubDate>Tue, 28 Apr 2026 10:45:38 GMT</pubDate><ttl>60</ttl><item><title>契约式开发webservice实践之spring-ws+Xmlbeans</title><link>http://www.blogjava.net/bluesky/archive/2008/09/19/Writing_Contract-First_Web_Services_Use_Spring-ws_and_Xmlbeans.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Fri, 19 Sep 2008 13:44:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2008/09/19/Writing_Contract-First_Web_Services_Use_Spring-ws_and_Xmlbeans.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/230022.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2008/09/19/Writing_Contract-First_Web_Services_Use_Spring-ws_and_Xmlbeans.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/230022.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/230022.html</trackback:ping><description><![CDATA[<p>契约式开发webservice实践之spring-ws+Xmlbeans<br />
1、开发环境<br />
JDK1.4.2.*<br />
Tomcat6.0.*<br />
Spring-2.5.5<br />
Spring-ws-1.5.4<br />
XmlBeans-2.3</p>
<p><br />
2、确定需要请求和应答的xml实例<br />
Request.xml</p>
<p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;wl_request&nbsp; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
&nbsp;&nbsp;&nbsp; xmlns="http://footmarktech.com/samples"&gt;<br />
&lt;flights&gt;<br />
&nbsp;&lt;flight&gt;&lt;segment&gt;PEK-CAN&lt;segment&gt;&lt;ticketNo&gt;7841234656&lt;/ticketNo&gt;&lt;/flight&gt;<br />
&nbsp;&lt;flight&gt;&lt;segment&gt;PEK-CAN&lt;segment&gt;&lt;ticketNo&gt;7841234656&lt;/ticketNo&gt;&lt;/flight&gt;<br />
&lt;/flights&gt;<br />
&lt;/wl_request&gt;</p>
<p>Response.xml</p>
<p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;wl_response&nbsp; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
&nbsp;&nbsp;&nbsp; xmlns="http://footmarktech.com/samples"&gt;<br />
&lt;flights&gt;<br />
&nbsp;&lt;flight&gt;&lt;segment&gt;PEK-CAN&lt;segment&gt;&lt;ticketNo&gt;7841234656&lt;/ticketNo&gt;&lt;/flight&gt;<br />
&nbsp;&lt;flight&gt;&lt;segment&gt;PEK-CAN&lt;segment&gt;&lt;ticketNo&gt;7841234656&lt;/ticketNo&gt;&lt;/flight&gt;<br />
&lt;/flights&gt;<br />
&lt;/wl_response&gt;</p>
<p>3、设置XmlBeans环境<br />
设置XMLBEANS_HOME<br />
并将 %XMLBEANS_HOME%/bin增加到path路径中</p>
<p>4、使用xmlbeans tool准备数据契约xsd<br />
根据上一步骤请求和应答的实例xml执行如下命令<br />
inst2xsd -enumerations never Request.xml Response.xml<br />
将生成的schema0.xsd文件命名为 Airline.xsd</p>
<p>将 Airline.xsd放在 ${web-context}/WEB-INF目录下<br />
5、使用xmlbeans tool生成OXM数据映射对象<br />
需要说明的是这些对象是跟Xmlbeans耦合比较紧的,不是POJO<br />
执行如下命令<br />
scomp -out Airline.jar Airline.xsd</p>
<p>6、准备运行时和编译时jar包</p>
<p><br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/acegi-security-1.0.7.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/activation-1.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/antlr-2.7.7.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/aopalliance-1.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/axiom-api-1.2.6.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/axiom-dom-1.2.6.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/axiom-impl-1.2.6.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/backport-util-concurrent-3.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/bsf-2.3.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/cglib-nodep-2.1_3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-beanutils-1.7.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-codec-1.3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-collections-3.2.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-configuration-1.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-digester-1.8.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-discovery-0.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-el-1.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-fileupload-1.2.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-httpclient-3.0.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-io-1.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-lang-2.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-logging-1.1.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-net-1.2.2.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-pool-1.3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/commons-validator-1.3.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/concurrent-1.3.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/dom4j-1.6.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/ehcache-1.2.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/ezmorph-1.0.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/groovy-all-1.5.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/hibernate-3.2.6.ga.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/hsqldb-1.8.0.7.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/icu4j-3.4.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jasypt-1.4.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/javassist-3.6.ga.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jaxen-1.1.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jaxrpc-1.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jcaptcha-all-1.0-RC6.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jcr-1.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jdom-1.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/json-lib-2.2.1-jdk13.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jta-spec1_0_1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/log4j-1.2.15.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/lucene-core-2.2.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/mail-1.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/ognl-2.7.2.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/oro-2.0.8.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/oscache-2.4.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/pdfbox-0.6.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/poi-3.0.1-FINAL-20070705.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/poi-contrib-3.0.1-FINAL-20070705.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/poi-scratchpad-3.0.1-FINAL-20070705.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/proxool-0.9.0RC3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/serializer-2.7.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/slf4j-api-1.4.3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/slf4j-log4j12-1.4.3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-2.5.5.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/stax-api-1.0.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/wsdl4j-1.6.2.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/wstx-asl-3.2.3.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xalan-2.7.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xercesImpl-2.8.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xfire-all-1.2.6.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xml-apis-1.3.04.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xom-1.1.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xpp3_min-1.1.3.4.0.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xstream-1.2.2.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/axis-saaj-1.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/axis-1.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-oxm-1.5.4.jar" sourcepath="D:/maven-1.0.2/.maven/repository/springframework/srcs/spring-ws-1.5.4-with-dependencies.zip"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-webmvc-2.5.5.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-ws-core-1.5.4.jar" sourcepath="D:/maven-1.0.2/.maven/repository/springframework/srcs/spring-ws-1.5.4-with-dependencies.zip"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-ws-security-1.5.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-ws-support-1.5.4.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/spring-xml-1.5.4.jar" sourcepath="D:/maven-1.0.2/.maven/repository/springframework/srcs/spring-ws-1.5.4-with-dependencies.zip"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/jsr173_1.0_api.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/resolver.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xbean_xpath.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xbean.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xmlbeans-qname.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/xmlpublic.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="lib" path="web/src/context/WEB-INF/lib/Airline.jar"/&gt;<br />
&nbsp;&lt;classpathentry kind="output" path="web/src/context/WEB-INF/classes"/&gt;</p>
<p><br />
Spring-ws1.5.4必须使用springframework2.5版本以上<br />
其对org.springframework.core.io.Resource版本要求较高<br />
必须加入spring-webmvc-2.5.5.jar<br />
org.springframework.web.servlet.FrameworkServlet从2.5版本后被分到spring-webmvc.jar包,并不包含于主spring包内</p>
<p>注,可能有些jar包没有用到<br />
7、书写web.xml</p>
<p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;<br />
&lt;web-app&gt;<br />
&nbsp; &lt;display-name&gt;Web&lt;/display-name&gt;<br />
&nbsp; <br />
&nbsp; <br />
&nbsp; <br />
&nbsp; &lt;context-param&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;<br />
&nbsp; &lt;/context-param&gt;<br />
&nbsp; <br />
&nbsp; <br />
&nbsp; &lt;listener&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br />
&nbsp; &lt;/listener&gt;</p>
<p>&nbsp; &lt;servlet&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;servlet-name&gt;ws-spring-ws&lt;/servlet-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;servlet-class&gt;org.springframework.ws.transport.http.MessageDispatcherServlet&lt;/servlet-class&gt;<br />
&nbsp;&nbsp; &lt;/servlet&gt;<br />
&nbsp;&nbsp; <br />
&nbsp; &lt;servlet-mapping&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;servlet-name&gt;ws-spring-ws&lt;/servlet-name&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;url-pattern&gt;/spring-ws/*&lt;/url-pattern&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/servlet-mapping&gt;&nbsp;&nbsp; <br />
&nbsp; </p>
<p>&lt;/web-app&gt;</p>
<p>8、书写业务实现</p>
<p>package demo1;</p>
<p>public class Order {<br />
&nbsp;private String id;</p>
<p>&nbsp;public String getId() {<br />
&nbsp;&nbsp;return id;<br />
&nbsp;}</p>
<p>&nbsp;public void setId(String id) {<br />
&nbsp;&nbsp;this.id = id;<br />
&nbsp;}<br />
}</p>
<p>package demo1;</p>
<p>public interface OrderService {<br />
&nbsp;Order getOrder(String id);<br />
}</p>
<p>&nbsp;</p>
<p>package demo1;</p>
<p>public class OrderServiceImpl implements OrderService{<br />
&nbsp;public Order getOrder(String id) {<br />
&nbsp;&nbsp;Order order = new Order();<br />
&nbsp;&nbsp;order.setId(id);<br />
&nbsp;&nbsp;return order;<br />
&nbsp;}<br />
&nbsp;<br />
&nbsp;<br />
}</p>
<p>书写spring配置放在classpath下<br />
applicationContext.xml</p>
<p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p>
<p>&lt;!DOCTYPE beans PUBLIC<br />
&nbsp;&nbsp;&nbsp; "-//SPRING//DTD BEAN//EN"<br />
&nbsp;&nbsp;&nbsp; "http://www.springframework.org/dtd/spring-beans.dtd"&gt;</p>
<p>&lt;beans default-autowire="no" default-lazy-init="false" default-dependency-check="none"&gt;<br />
&nbsp; &lt;bean id="orderService" class="demo1.OrderServiceImpl"/&gt;<br />
&lt;/beans&gt;</p>
<p>9、书写Spring-ws EndPoint</p>
<p>package demo1;</p>
<p>import org.springframework.oxm.Marshaller;<br />
import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;</p>
<p>import com.footmarktech.samples.WlRequestDocument;<br />
import com.footmarktech.samples.WlResponseDocument;</p>
<p>public class SampleMarshallingEndpoint extends<br />
&nbsp;&nbsp;AbstractMarshallingPayloadEndpoint {</p>
<p>&nbsp;private final OrderService orderService;</p>
<p>&nbsp;public SampleMarshallingEndpoint(OrderService orderService,<br />
&nbsp;&nbsp;&nbsp;Marshaller marshaller) {<br />
&nbsp;&nbsp;super(marshaller);<br />
&nbsp;&nbsp;this.orderService = orderService;<br />
&nbsp;}</p>
<p>&nbsp;protected Object invokeInternal(Object request) throws Exception {<br />
&nbsp;&nbsp;com.footmarktech.samples.WlRequestDocument ab = null;<br />
&nbsp;&nbsp;ab = (WlRequestDocument)request;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;//TODO invoke orderService<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;WlResponseDocument rs = (WlResponseDocument) WlResponseDocument.Factory.newInstance();<br />
&nbsp;&nbsp;rs.addNewWlResponse().addNewFlights().addNewFlight().setTicketNo(ab.getWlRequest().getFlights().getFlightArray(0).getTicketNo());<br />
&nbsp;&nbsp;return rs;<br />
&nbsp;}<br />
}</p>
<p><br />
10、书写ws-spring-ws-servlet.xml<br />
放置于${web-context}/WEB-INF目录下</p>
<p><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;</p>
<p><br />
&lt;bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"&gt;<br />
&nbsp;&lt;property name="payloadCaching" value="true"/&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;bean id="xmlBeansMarshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" /&gt;</p>
<p>&lt;bean id="orderEndPoint" class="demo1.SampleMarshallingEndpoint"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;constructor-arg&gt;&lt;ref bean="orderService"/&gt;&lt;/constructor-arg&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;constructor-arg&gt;&lt;ref bean="xmlBeansMarshaller"/&gt;&lt;/constructor-arg&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="defaultEndpoint" ref="orderEndPoint"/&gt;<br />
&lt;/bean&gt;</p>
<p>&nbsp; <br />
&nbsp;&nbsp;&nbsp; <br />
&lt;bean id="echo" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"&gt;<br />
&nbsp;&nbsp; &lt;property name="schema"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;bean class="org.springframework.xml.xsd.SimpleXsdSchema"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="xsd" value="/WEB-INF/Airline.xsd"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br />
&nbsp;&nbsp; &lt;/property&gt;<br />
&nbsp;&nbsp; &lt;property name="portTypeName" value="Echo"/&gt;<br />
&nbsp;&nbsp; &lt;property name="locationUri" value="http://localhost:8080/ss1/spring-ws/echo/services"/&gt;<br />
&nbsp;&lt;/bean&gt;</p>
<p>&lt;/beans&gt;</p>
<p>11、开发客户端</p>
<p>配置applicationContext1.xml放置于 classpath demo1.client包内<br />
</p>
<p><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;</p>
<p><br />
&lt;bean id="xmlBeansMarshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMarshaller" /&gt;</p>
<p>&lt;bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"&gt;<br />
&nbsp;&lt;property name="payloadCaching" value="true"/&gt;<br />
&lt;/bean&gt;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; <br />
&lt;bean id="webServiceTemplate1" class="org.springframework.ws.client.core.WebServiceTemplate"&gt;<br />
&lt;constructor-arg ref="messageFactory" /&gt;<br />
&lt;property name="marshaller" ref="xmlBeansMarshaller" /&gt;<br />
&lt;property name="unmarshaller" ref="xmlBeansMarshaller" /&gt;<br />
&lt;property name="messageSender"&gt;<br />
&nbsp;&lt;bean class="org.springframework.ws.transport.http.CommonsHttpMessageSender"&gt;<br />
&nbsp;&nbsp;&lt;property name="readTimeout" value="0" /&gt;<br />
&nbsp;&lt;/bean&gt;<br />
&lt;/property&gt;<br />
&lt;property name="defaultUri" value="http://localhost:8080/ss1/spring-ws/echo/services" /&gt;<br />
&lt;/bean&gt;<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; </p>
<p>&lt;/beans&gt;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>package demo1.client;</p>
<p>import java.io.File;<br />
import java.io.IOException;</p>
<p>import javax.xml.transform.Source;</p>
<p>import org.apache.xmlbeans.XmlException;<br />
import org.apache.xmlbeans.XmlObject;<br />
import org.jdom.JDOMException;<br />
import org.springframework.context.ApplicationContext;<br />
import org.springframework.context.support.ClassPathXmlApplicationContext;<br />
import org.springframework.core.io.Resource;<br />
import org.springframework.ws.client.core.WebServiceTemplate;<br />
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;<br />
import org.springframework.xml.transform.ResourceSource;<br />
import org.springframework.xml.transform.StringResult;</p>
<p>import com.footmarktech.smscenter.webservice.SendSMDocument;<br />
import com.footmarktech.smscenter.webservice.SendSMResponseDocument;<br />
import com.footmarktech.samples.WlRequestDocument;<br />
import com.footmarktech.samples.WlResponseDocument;</p>
<p>public class EchoClient {<br />
&nbsp;public static void RequestSpring() {<br />
&nbsp;&nbsp;ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext1.xml", EchoClient.class);<br />
&nbsp;&nbsp;WebServiceTemplate webServiceTemplate = (WebServiceTemplate) applicationContext<br />
&nbsp;&nbsp;&nbsp;&nbsp;.getBean("webServiceTemplate1");<br />
&nbsp;&nbsp;WlRequestDocument request = WlRequestDocument.Factory.newInstance();<br />
&nbsp;&nbsp;request.addNewWlRequest().addNewFlights().addNewFlight().setTicketNo(new Long(1231235555).longValue());<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;WlResponseDocument response = (WlResponseDocument)webServiceTemplate.marshalSendAndReceive(request);<br />
&nbsp;&nbsp;System.out.println(response.getWlResponse().getFlights().getFlightArray(0).getTicketNo());<br />
&nbsp;}</p>
<p>&nbsp;public static void main(String[] args) throws IOException, JDOMException {<br />
&nbsp;&nbsp;RequestSpring();</p>
<p>&nbsp;}</p>
<p>}</p>
<p>12、参考资料<br />
http://xmlbeans.apache.org/<br />
http://static.springframework.org/spring-ws/sites/1.5/reference/html/index.html<br />
http://mdasgin.blogspot.com/2008/06/web-servisleri-bir-makinede-sunulan.html<br />
http://www.infoq.com/cn/articles/arjen-poutsma-spring-ws<br />
http://www.infoq.com/cn/articles/sosnoski-code-first <br />
<br />
<a href="/Files/bluesky/Writing_Contract-First_Web_Services_Use_Spring-ws_and_Xmlbeans.zip">下载pdf版文档</a></p>
<img src ="http://www.blogjava.net/bluesky/aggbug/230022.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2008-09-19 21:44 <a href="http://www.blogjava.net/bluesky/archive/2008/09/19/Writing_Contract-First_Web_Services_Use_Spring-ws_and_Xmlbeans.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Extension Tapestry4`s restart service to clear my login cookies</title><link>http://www.blogjava.net/bluesky/archive/2008/03/24/188261.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Mon, 24 Mar 2008 07:34:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2008/03/24/188261.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/188261.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2008/03/24/188261.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/188261.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/188261.html</trackback:ping><description><![CDATA[<p>接上篇,自定义一个logout service 把我的login cookies 清楚掉
<p>Tapestry .java
<p>package common.tapestry;
<p>public final&nbsp; class Tapestry {<br />
&nbsp; public static final String LOGOUT_SERVICE = "logout";<br />
}
<p>LogoutService.java<br />
package common.tapestry.engine;
<p>import java.io.IOException;
<p>import org.apache.tapestry.IRequestCycle;<br />
import org.apache.tapestry.engine.RestartService;
<p>import common.tapestry.Tapestry;
<p>public class LogoutService extends RestartService {<br />
&nbsp;private LoginCookiesManager loginCookiesManager;
<p><br />
&nbsp;public void setLoginCookiesManager(<br />
&nbsp;&nbsp; LoginCookiesManager loginCookiesManager) {<br />
&nbsp; this.loginCookiesManager = loginCookiesManager;<br />
&nbsp;}
<p>&nbsp;public void service(IRequestCycle cycle) throws IOException {<br />
&nbsp; loginCookiesManager.removeCookies();<br />
&nbsp; super.service(cycle);<br />
&nbsp;}
<p>&nbsp;public String getName() {<br />
&nbsp; return Tapestry.LOGOUT_SERVICE;<br />
&nbsp;}<br />
}
<p>hivemodule.xml<br />
&lt;?xml version="1.0"?&gt;<br />
&lt;module id="common.tapestry" version="1.0.0"&gt;
<p>&nbsp;&lt;!-- extends tapestry RestartService and clear the login cookies info--&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;service-point id="LogoutService" interface="org.apache.tapestry.engine.IEngineService"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;invoke-factory&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;construct class="common.tapestry.engine.LogoutService"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;set-service property="request" service-id="tapestry.globals.HttpServletRequest" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-service property="response" service-id="tapestry.globals.HttpServletResponse" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-object property="servletPath" value="app-property:org.apache.tapestry.servlet-path" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-object property="linkFactory" value="infrastructure:linkFactory" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-object property="loginCookiesManager" value="service:common.tapestry.LoginCookiesManager"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/construct&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/invoke-factory&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/service-point&gt;
<p>&nbsp;&nbsp;&nbsp; &lt;contribution configuration-id="tapestry.services.ApplicationServices"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;service name="logout" object="service:common.tapestry.LogoutService" /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/contribution&gt;
<p>&lt;/module&gt;
<p>in your Pages<br />
&lt;a jwcid="@ServiceLink" href="#" service="ognl:@common.tapestry.Tapestry@LOGOUT_SERVICE" target="_top"&gt;退出&lt;/a&gt;<br />
<br />
系原创<br />
作者其他blog&nbsp; <a href="http://oxyc.spaces.live.com">http://oxyc.spaces.live.com</a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://hiok.blog.sohu.com">http://hiok.blog.sohu.com</a> <br />
<br />
</p>
<img src ="http://www.blogjava.net/bluesky/aggbug/188261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2008-03-24 15:34 <a href="http://www.blogjava.net/bluesky/archive/2008/03/24/188261.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to use cookies in tapestry4? my Tapestry4.1.5`LoginCookiesManagerImpl</title><link>http://www.blogjava.net/bluesky/archive/2008/03/24/188254.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Mon, 24 Mar 2008 07:26:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2008/03/24/188254.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/188254.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2008/03/24/188254.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/188254.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/188254.html</trackback:ping><description><![CDATA[<p>How to use cookies in tapestry4? my Tapestry4.1.5`LoginCookiesManagerImpl
<p>思路<br />
首先BasePage是需要登陆的 protected ,<br />
BasePage实现org.apache.tapestry.event.PageValidateListener方法,判断asm对象Visit是否已经登陆<br />
如没visit==null,去cookies找回用户名和密码从cycle中获得Login页面<br />
Login页面实现common.tapestry.IConstructVisit接口。LoginPage登陆时保存用户名密码到cookies中,并对cookies的值加密,<br />
cookies的key是baseUrl+key,取回时对cookies值解密,加密解密的password放到Application的meta信息中
<p>实现代码如下<br />
抽象接口LoginCookiesManager
<p>package common.tapestry.engine;
<p>public interface LoginCookiesManager {<br />
&nbsp;<br />
&nbsp;String APPLICATION_META_KEY_DEFAULT_COOKIES_IS_ENCRYPTION = "common.tapestry.default-cookies-encrypt";//是否需要加密,默认加密<br />
&nbsp;String APPLICATION_META_KEY_DEFAULT_COOKIES_ENCRYPTION_KEY = "common.tapestry.default-cookies-encryption-key";//加密的password
<p>&nbsp;public static final String COOKIES_KEY_LOGIN_USERNAME = "USERNAME";<br />
&nbsp;public static final String COOKIES_KEY_LOGIN_PASSWORD = "PASSWORD";<br />
&nbsp;<br />
&nbsp;/**<br />
&nbsp; * 将用户名和密码写入cookies<br />
&nbsp; * @param username<br />
&nbsp; * @param password<br />
&nbsp; * @param maxAge<br />
&nbsp; */<br />
&nbsp;void writeCookies(String username,String password,int maxAge);<br />
&nbsp;/**<br />
&nbsp; * 清除用户名和密码cookies<br />
&nbsp; */<br />
&nbsp;void removeCookies();<br />
&nbsp;/**<br />
&nbsp; * 从cookies中获得用户名<br />
&nbsp; * @return<br />
&nbsp; */<br />
&nbsp;String getUsername();<br />
&nbsp;/**<br />
&nbsp; * 从cookies中获得密码<br />
&nbsp; * @return<br />
&nbsp; */<br />
&nbsp;String getPassword();<br />
}
<p>LoginCookiesManagerImpl 实现
<p>package common.tapestry.engine;
<p>import org.apache.hivemind.ApplicationRuntimeException;<br />
import org.apache.tapestry.engine.IPropertySource;<br />
import org.apache.tapestry.services.AbsoluteURLBuilder;<br />
import org.apache.tapestry.services.CookieSource;<br />
import org.apache.tapestry.web.WebRequest;<br />
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;<br />
import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
<p>public class LoginCookiesManagerImpl implements LoginCookiesManager {<br />
&nbsp;private static StandardPBEStringEncryptor standardPBEStringEncryptor = new StandardPBEStringEncryptor();<br />
&nbsp;private IPropertySource applicationPropertySource;<br />
&nbsp;private CookieSource cookieSource;<br />
&nbsp;private WebRequest request;<br />
&nbsp;private AbsoluteURLBuilder absoluteURLBuilder;
<p>&nbsp;public void setApplicationPropertySource(<br />
&nbsp;&nbsp;&nbsp;IPropertySource applicationPropertySource) {<br />
&nbsp;&nbsp;this.applicationPropertySource = applicationPropertySource;<br />
&nbsp;&nbsp;String encrypKey = getCookiesEncryptionKey();<br />
&nbsp;&nbsp;standardPBEStringEncryptor.setPassword(encrypKey);<br />
&nbsp;}
<p>&nbsp;private String decrypt(String value) {<br />
&nbsp;&nbsp;String tmp = value;<br />
&nbsp;&nbsp;try {<br />
&nbsp;&nbsp;&nbsp;tmp = standardPBEStringEncryptor.decrypt(value);<br />
&nbsp;&nbsp;} catch (EncryptionOperationNotPossibleException e) {<br />
&nbsp;&nbsp;&nbsp;throw new ApplicationRuntimeException("please clear your cookies");<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;return tmp;<br />
&nbsp;}
<p>&nbsp;private String encrypt(String value) {<br />
&nbsp;&nbsp;return standardPBEStringEncryptor.encrypt(value);<br />
&nbsp;}
<p>&nbsp;private String getCookiesEncryptionKey() {<br />
&nbsp;&nbsp;String temp = applicationPropertySource<br />
&nbsp;&nbsp;&nbsp;&nbsp;.getPropertyValue(APPLICATION_META_KEY_DEFAULT_COOKIES_ENCRYPTION_KEY);<br />
&nbsp;&nbsp;return (temp != null) ? temp : "crypassword";<br />
&nbsp;}
<p>&nbsp;private boolean isCookiesEncryption() {<br />
&nbsp;&nbsp;String temp = applicationPropertySource<br />
&nbsp;&nbsp;&nbsp;&nbsp;.getPropertyValue(APPLICATION_META_KEY_DEFAULT_COOKIES_IS_ENCRYPTION);<br />
&nbsp;&nbsp;return (temp != null) ? Boolean.valueOf(temp).booleanValue() : true;<br />
&nbsp;}
<p>&nbsp;public void removeCookies() {<br />
&nbsp;&nbsp;String cookiesKeyLogin_username = generateApplicationCookiesKey_Login__Username();<br />
&nbsp;&nbsp;String cookiesKeyLogin_password = generateApplicationCookiesKey_Login__Password();<br />
&nbsp;&nbsp;cookieSource.removeCookieValue(cookiesKeyLogin_username);<br />
&nbsp;&nbsp;cookieSource.removeCookieValue(cookiesKeyLogin_password);<br />
&nbsp;}
<p>&nbsp;public void writeCookies(String username, String password, int maxAge) {<br />
&nbsp;&nbsp;writeCookiesValue_Login__Username(username, maxAge);<br />
&nbsp;&nbsp;writeCookiesValue_Login__Password(password, maxAge);<br />
&nbsp;}
<p>&nbsp;public String getUsername() {<br />
&nbsp;&nbsp;String value = cookieSource<br />
&nbsp;&nbsp;&nbsp;&nbsp;.readCookieValue(generateApplicationCookiesKey_Login__Username());<br />
&nbsp;&nbsp;if (isCookiesEncryption()) {<br />
&nbsp;&nbsp;&nbsp;value = decrypt(value);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;return value;<br />
&nbsp;}
<p>&nbsp;public String getPassword() {<br />
&nbsp;&nbsp;String value = cookieSource<br />
&nbsp;&nbsp;&nbsp;&nbsp;.readCookieValue(generateApplicationCookiesKey_Login__Password());<br />
&nbsp;&nbsp;if (isCookiesEncryption()) {<br />
&nbsp;&nbsp;&nbsp;value = decrypt(value);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;return value;<br />
&nbsp;}
<p>&nbsp;private void writeCookiesValue_Login__Username(String username, int maxAge) {<br />
&nbsp;&nbsp;String key = generateApplicationCookiesKey_Login__Username();<br />
&nbsp;&nbsp;String value = username;<br />
&nbsp;&nbsp;if (isCookiesEncryption()) {<br />
&nbsp;&nbsp;&nbsp;value = encrypt(username);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;cookieSource.writeCookieValue(key, value, maxAge);<br />
&nbsp;}
<p>&nbsp;private void writeCookiesValue_Login__Password(String password, int maxAge) {<br />
&nbsp;&nbsp;String key = generateApplicationCookiesKey_Login__Password();<br />
&nbsp;&nbsp;String value = password;<br />
&nbsp;&nbsp;if (isCookiesEncryption()) {<br />
&nbsp;&nbsp;&nbsp;value = encrypt(password);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;cookieSource.writeCookieValue(key, value, maxAge);<br />
&nbsp;}
<p>&nbsp;private String generateApplicationCookiesKey_Login__Username() {<br />
&nbsp;&nbsp;return generateApplicationCookiesKey(COOKIES_KEY_LOGIN_USERNAME);<br />
&nbsp;}
<p>&nbsp;private String generateApplicationCookiesKey_Login__Password() {<br />
&nbsp;&nbsp;return generateApplicationCookiesKey(COOKIES_KEY_LOGIN_PASSWORD);<br />
&nbsp;}
<p>&nbsp;private String generateApplicationCookiesKey(String key) {<br />
&nbsp;&nbsp;String contextPath = request.getContextPath();<br />
&nbsp;&nbsp;return absoluteURLBuilder.constructURL(contextPath + "/") + key;<br />
&nbsp;}
<p>&nbsp;public void setCookieSource(CookieSource cookieSource) {<br />
&nbsp;&nbsp;this.cookieSource = cookieSource;<br />
&nbsp;}
<p>&nbsp;public void setRequest(WebRequest request) {<br />
&nbsp;&nbsp;this.request = request;<br />
&nbsp;}
<p>&nbsp;public void setAbsoluteURLBuilder(AbsoluteURLBuilder absoluteURLBuilder) {<br />
&nbsp;&nbsp;this.absoluteURLBuilder = absoluteURLBuilder;<br />
&nbsp;}
<p>}
<p>hivemodule.xml配置
<p>&lt;?xml version="1.0"?&gt;<br />
&lt;module id="common.tapestry" version="1.0.0"&gt;<br />
&lt;service-point id="LoginCookiesManager" interface="common.tapestry.engine.LoginCookiesManager"&gt;<br />
&lt;invoke-factory&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;construct class="common.tapestry.engine.LoginCookiesManagerImpl" &gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-object property="cookieSource" value="infrastructure:cookieSource"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-service property="absoluteURLBuilder" service-id="tapestry.request.AbsoluteURLBuilder"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-service property="request" service-id="tapestry.globals.WebRequest"/&gt;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;set-object property="applicationPropertySource" value="service:tapestry.props.ApplicationPropertySource"/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/construct&gt;<br />
&nbsp;&nbsp;&lt;/invoke-factory&gt;&nbsp;<br />
&lt;/service-point&gt;
<p>&lt;contribution configuration-id="tapestry.Infrastructure"&gt;<br />
&nbsp;&nbsp; &nbsp;&lt;property name="loginCookiesManager" object="service:common.tapestry.LoginCookiesManager"/&gt;<br />
&lt;/contribution&gt;<br />
&lt;/module&gt;
<p>使用
<p>在BasePage中获得该service
<p>public LoginCookiesManager getLoginCookiesManager() {<br />
&nbsp;&nbsp;LoginCookiesManager svc = (LoginCookiesManager) getRequestCycle().getInfrastructure().getProperty("loginCookiesManager");<br />
&nbsp;&nbsp;return svc;<br />
&nbsp;}<br />
&nbsp;<br />
/**<br />
&nbsp; * 判断用户是否已经登陆<br />
&nbsp; * <br />
&nbsp; * @return<br />
&nbsp; */<br />
&nbsp;private boolean isUserLoggedIn() {<br />
&nbsp;&nbsp;Object asmVisit = this.getRequestCycle().getInfrastructure().getApplicationStateManager().get(ASM_VISIT);
<p>&nbsp;&nbsp;if (!(asmVisit instanceof IVisit)) {<br />
&nbsp;&nbsp;&nbsp;throw new ApplicationRuntimeException(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"The visit class must implements " + IVisit.class);<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;IVisit visit = (IVisit) asmVisit;<br />
&nbsp;&nbsp;if (visit == null || (visit != null &amp;&amp; !visit.isLoggedIn())) {<br />
&nbsp;&nbsp;&nbsp;IPage loginPage = getRequestCycle().getPage(PAGE_LOGIN);<br />
&nbsp;&nbsp;&nbsp;if (loginPage instanceof IConstructVisit) {<br />
&nbsp;&nbsp;&nbsp; //从cookies中找回用户名和密码<br />
&nbsp;&nbsp;&nbsp;&nbsp;String cookiesLoginUsername = getLoginCookiesManager().getUsername();<br />
&nbsp;&nbsp;&nbsp;&nbsp;String cookiesLoginPassword = getLoginCookiesManager().getPassword();<br />
&nbsp;&nbsp;&nbsp;&nbsp;IConstructVisit constructVisit = (IConstructVisit) loginPage;<br />
&nbsp;&nbsp;&nbsp;&nbsp;visit = constructVisit.doConstructVisit(this.getRequestCycle(),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookiesLoginUsername, cookiesLoginPassword);<br />
&nbsp;&nbsp;&nbsp;} else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;throw new ApplicationRuntimeException("The " + PAGE_LOGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ " class must implements " + IConstructVisit.class);<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;if (visit == null)<br />
&nbsp;&nbsp;&nbsp;return Boolean.FALSE.booleanValue();<br />
&nbsp;&nbsp;return visit.isLoggedIn();<br />
&nbsp;}&nbsp;
<p><br />
Login类必须实现如下接口<br />
package common.tapestry;
<p>import org.apache.tapestry.IRequestCycle;
<p>public interface IConstructVisit {<br />
&nbsp;public IVisit doConstructVisit(IRequestCycle cycle, String username,String password);<br />
}
<p>&nbsp;<br />
系原创<br />
其他blog地址&nbsp; <a href="http://oxyc.spaces.live.com/">http://oxyc.spaces.live.com/</a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://hiok.blog.sohu.com">http://hiok.blog.sohu.com</a></p>
<img src ="http://www.blogjava.net/bluesky/aggbug/188254.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2008-03-24 15:26 <a href="http://www.blogjava.net/bluesky/archive/2008/03/24/188254.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CheckBox选中所有的项[JavaScript]</title><link>http://www.blogjava.net/bluesky/archive/2006/06/23/54751.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Fri, 23 Jun 2006 09:51:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/06/23/54751.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/54751.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/06/23/54751.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/54751.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/54751.html</trackback:ping><description><![CDATA[
		<p>&lt;html&gt;<br />&lt;head&gt;<br />&lt;title&gt;<br />&lt;/title&gt;<br />&lt;body&gt;<br />&lt;form name="Form1"&gt;</p>
		<p>&lt;input name="allbox" type="checkbox" onClick="TA();" title="选中或清除选中所有的项目" tabindex="105"&gt;选中或清除选中所有的项目</p>
		<p>&lt;br/&gt;<br />&lt;span class="X"&gt;<br />&lt;input type="checkbox" name="ABC" class="A" onClick="TTA(this);"&gt;清明时节&lt;/span&gt;<br />&lt;br/&gt;<br />&lt;span class="X"&gt;<br />&lt;input type="checkbox" name="DEF" class="A" onClick="TTA(this);"&gt;长江水啊&lt;/span&gt;<br />&lt;br/&gt;<br />&lt;span class="X"&gt;<br />&lt;input type="checkbox" name="GHL" class="A" onClick="TTA(this);"&gt;嘿嘿测试&lt;/span&gt;<br />&lt;br/&gt;<br />&lt;/form&gt;</p>
		<p>&lt;script language="javascript"&gt;<br />var frm = document.Form1;<br />&lt;/script&gt;</p>
		<p>
				<br />&lt;script language="JavaScript"&gt;</p>
		<p>function TA(isO,noHL){<br /> var trk = 0;<br /> <br /> <br /> for(var i=0;i&lt;frm.elements.length;i++){<br />  var e=frm.elements[i];</p>
		<p>  if((e.name !='allbox') &amp;&amp; (e.type == 'checkbox')){<br />    e.checked = frm.allbox.checked;<br />   if (frm.allbox.checked){<br />    //e.parentElement.className = "H"; //.parentElement不兼容firefox浏览器 <br />    e.parentNode.className = "H";//调用设置父节点元素class改变背景色<br />   <br />   }else{<br />    e.parentNode.className = "X";//调用设置父节点元素class改变背景色<br />   }<br />  }<br /> }<br />}</p>
		<p>function TTA(CB,noHL){<br /> if (CB.checked){<br />  CB.parentNode.className = "H";<br /> }else{<br />  CB.parentNode.className = "X";<br /> }</p>
		<p> </p>
		<p> var TB=TO=0;<br /> for (var i=0;i&lt;frm.elements.length;i++){<br />  var e=frm.elements[i];<br />  if ((e.name != 'allbox') &amp;&amp; (e.type=='checkbox')){<br />   TB++;<br />  if (e.checked)<br />   TO++;<br />  }<br /> }<br /> frm.allbox.checked=(TO==TB)?true:false;<br /> //如果不是所有项被选中则allbox设定未被选中<br />}</p>
		<p>
				<br />&lt;/script&gt;</p>
		<p>&lt;style&gt;<br />.H{<br /> background: #ADD8E6<br />}<br />.X{<br /> background: #FFFFFF<br />}</p>
		<p>&lt;/style&gt;</p>
		<p>
				<br />&lt;/body&gt;&lt;/html&gt;</p>
<img src ="http://www.blogjava.net/bluesky/aggbug/54751.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-06-23 17:51 <a href="http://www.blogjava.net/bluesky/archive/2006/06/23/54751.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>记一段代码[PHP]迭代读取数据库</title><link>http://www.blogjava.net/bluesky/archive/2006/06/23/54594.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 22 Jun 2006 16:09:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/06/23/54594.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/54594.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/06/23/54594.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/54594.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/54594.html</trackback:ping><description><![CDATA[
		<p>
				<br />&lt;style&gt;</p>
		<p>input, select {<br /> font-size: 14px; <br /> color: #333333; <br /> padding-left:3px; <br /> background:#f6f6f6; <br /> border: #CCCCCC 1px solid;}<br />&lt;/style&gt;<br />&lt;?php<br />require_once dirname(__FILE__) ."/headers.php";</p>
		<p>$i = 0;<br />  </p>
		<p>function category($category_parent_timestamp){<br />   global $db;<br />   global $i;<br />   $result = $db-&gt;get("{category_parent_timestamp} == " . $category_parent_timestamp,null,"categories",false,"category_time","desc"); <br />   sort($result);<br />  <br />   for($index=0;$index&lt;count($result);$index++){          <br />     echo "&lt;option&gt;";<br />     for($x=0;$x&lt;$i;$x++){<br />       echo "--";<br />      }      <br />     echo $result[$index]['category_title'];<br />     echo "&amp;nbsp;";  <br />     $sub = $db-&gt;get("{category_parent_timestamp} == " .$result[$index]['category_timestamp'],null,"categories",false,"category_time","desc"); <br />     if(count($sub)!=0){<br />       $i++;<br />       category($result[$index]['category_timestamp']);//迭代      <br />       $i--;<br />     }<br />     echo "&lt;/option&gt;";<br />   }<br />   <br />}    <br /> <br />echo "&lt;select&gt;";<br />category("0"); <br />echo"&lt;/select&gt;";<br />?&gt;</p>
<img src ="http://www.blogjava.net/bluesky/aggbug/54594.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-06-23 00:09 <a href="http://www.blogjava.net/bluesky/archive/2006/06/23/54594.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>通讯名词解释</title><link>http://www.blogjava.net/bluesky/archive/2006/06/09/51613.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Fri, 09 Jun 2006 01:42:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/06/09/51613.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/51613.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/06/09/51613.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/51613.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/51613.html</trackback:ping><description><![CDATA[<p>&nbsp; WCDMA：指直接扩频的码分多址复用方式，一种适用于数字蜂窝移动通信的新技术。 <br />
&nbsp; CDMA2000：指多载波的码分多址复用方式，一种适用于数字蜂窝移动通信的新技术。 <br />
&nbsp; GSM： 指一种蜂窝数字移动通信系统，起源于泛欧标准，是目前移动通信应用最多的技术体制。 <br />
&nbsp; ATM： 异步传输模式，ATM交换机是未来宽带综合业务数据网中的核心设备 <br />
&nbsp; CATV：指以有线的形式传输、分配电视、调频信号及其它信息给用户的系统。 <br />
&nbsp; IP：一种互联网协议，是分组的非面向连接的数据传输协议 <br />
&nbsp; STP： 信令转换点，在信令网中用于转接信令 <br />
&nbsp; SDH： 是一套可进行同步数字传输、复用和交叉连接的标准化数字信号传输体制 <br />
&nbsp; DWDM： 密集波分复用，指在光纤的同一窗口中信道间隔较小的光波分复用。 <br />
&nbsp; 3G：指第三代移动网络，在用户高速移动状态时的峰值速率可达144Kbps，处于步行状态时峰值速率可达384 Kpbs，处于静止状态时峰值速率可达2 Mbps，不过有些初始网络建设仅支持64 Kbps。ITU通过其IMT-2000项目和一些关键标准组织如3GPP和3GPP2来协调3G标准。&nbsp; <br />
&nbsp; ASIC：指专用集成电路，专门设计以执行一个或多个特定功能的集成电路。&nbsp; <br />
&nbsp; ATM：指异步传输模式，基于固定大小分组数据传输的网络技术。分组长度短小固定，使ATM设备能在同一网络中传输视频、话音和数据，防止任何一种数据信号霸占整个线路。 <br />
&nbsp; 骨干网：指网络中承载高密度大流量信号的组成部分。交换网络的骨干网一般包括主干线路由器和交换机，数据网络的骨干网一般包括本地环间的主链路。&nbsp; <br />
&nbsp; 宽带：指描述一个系统覆盖很宽的频率范围的词汇，比话音信道宽很多，亦称「宽频」。 <br />
&nbsp; BWA：指宽带无线接入，一种宽带点对多点无线通信业务，运行的频带在2GHz到60GHz之间，因应「最后一里」话音、数据和视频业务等高速业务进行优化，作为连接用户和运营商本地交换机的可选择的另一种进网技术。&nbsp; <br />
&nbsp; CDMA：指码分多址，是2G移动通信技术标准之一，属于扩频技术标准，对所有的话音和数据位分配一个伪随机（PN）码，通过扰码方式在空中发送编码话音，并按照原始格式对话音进行译码。对每个发射机分配一个独特的相关码，可以使多个对话共享同一频谱。&nbsp; <br />
&nbsp; CDMA2000 1x：指以CDMAOne标准提供增强话音容量的技术规格，峰值数据速率最高可达2 Mbps，相关的规格包括1xRTT（无线传输技术），1xEVDO（纯数据版）和1xEVDV（话音数据版）。&nbsp; <br />
&nbsp; DWDM：指密集波分复用系统，能够使一根光纤承载多个数据信道（或波长）。商用DWDM系统目前已经达到100个信道。&nbsp; <br />
&nbsp; DSL：指数字用户线，在本地环路或用户线上传送数字数据的技术，亦称xDSL，如ADSL、HDSL、VDSL、MDSL和RDSL。&nbsp; <br />
&nbsp; GPRS：指通用分组无线业务，一种ETSI GSM第2+阶段的数据分组无线接入技术规格，其无线接口支持共享媒介分组接入，而不同于GSM的专用信道拨号接入。GPRS是建设在已有的GSM网络架构之上，需要添加新的网络元素来连接核心网和公众分组网络。&nbsp; <br />
&nbsp; GSM：指起源于欧洲的一种全球蜂窝移动电话通信系统，已经在170多个国家建设网络，使用TDMA无线传播技术。&nbsp; <br />
&nbsp; NGN：指下一代网络，以数据分组为基础的网络，能够提供多种业务，利用多种宽带传送技术，支持用户无限制地接入到不同服务提供商，能够支持普通的移动方式，不间断的向用户提供业务。&nbsp; <br />
&nbsp; PCS：指个人通信系统，为本集团基于PHS技术的无线本地接入系统，目前被中国电信和中国网通采用。&nbsp; <br />
&nbsp; PSTN：指公共交换电话网，沿用已久的国际电话系统，利用铜缆通过电路交换连接传送话音和数据。 路由器：指一种通信设备，可在网络中选择数据的传送路径。&nbsp; <br />
&nbsp; 软交换：指软件交换的缩略语，是一种应用协议接口，用于连接传统的PSTN网和IP网络，并对包括话音、传真、数据和视频的流量进行管理。&nbsp; <br />
&nbsp; TD-SCDMA：指时分同步码分多址，是中国倡导的第三代移动通信技术，支持话音和数据。&nbsp; <br />
&nbsp; WCDMA：指宽带CDMA，是3G数字移动网络的UMTS标准，采用CDMA技术，提供增强的话音容量，理论上数据速率的峰值可到2 Mbps。&nbsp; <br />
&nbsp; 无线本地接入系统：指提供无线接入到固网的设备，支持局部范围内的有限移动。无线本地接入系统的命名根据不同生产厂商或采用的技术不同而有不同命名。如本集团称自身的无线本地接入系统为PCS设备（基于PHS技术而开发），但其它供货商可能称类似设备为PHS或者PAS设备。此外，无线本地接入系统还可以基于其它技术而开发，如CDMA450 WLL和SCDMA。 <br />
</p>
<img src ="http://www.blogjava.net/bluesky/aggbug/51613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-06-09 09:42 <a href="http://www.blogjava.net/bluesky/archive/2006/06/09/51613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>烦心事儿</title><link>http://www.blogjava.net/bluesky/archive/2006/06/06/50842.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Tue, 06 Jun 2006 09:52:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/06/06/50842.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/50842.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/06/06/50842.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/50842.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/50842.html</trackback:ping><description><![CDATA[今天来上班的路上,刚下公交车,乌云密布就下开雨了.<br /><br />我新买的伞被风吹坏了两个撑,新伞啊,花了俺不少银子,买的还是质量挺好的伞,心疼.<br /><br />自己用东西太废了吧,不懂珍惜.<br /><br />小时候父母经常为这说我,说我用东西太废,什么笔啊,橡皮啊,本子啊,用不了多久就报销了.<br /><br />我的伞,回去修理一下吧.<img src ="http://www.blogjava.net/bluesky/aggbug/50842.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-06-06 17:52 <a href="http://www.blogjava.net/bluesky/archive/2006/06/06/50842.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C++libs </title><link>http://www.blogjava.net/bluesky/archive/2006/06/01/49530.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 01 Jun 2006 04:48:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/06/01/49530.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/49530.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/06/01/49530.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/49530.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/49530.html</trackback:ping><description><![CDATA[[c++libs]<a href="http://www.libsdl.org/"><br />http://www.libsdl.org/</a><br /><a href="http://www.wxwidgets.org/">http://www.wxwidgets.org/</a><br /><a href="http://www.fltk.org/">http://www.fltk.org/</a><br /><a href="http://www.boost.org/">http://www.boost.org/</a><br /><a href="http://www.zlib.net/">http://www.zlib.net/</a><br /><a href="http://expat.sourceforge.net/">http://expat.sourceforge.net/</a><br /><a href="http://www.eskimo.com/~weidai/cryptlib.html">http://www.eskimo.com/~weidai/cryptlib.html</a><br /><a href="http://glut.org/">http://glut.org/</a><br /><a href="http://gborg.postgresql.org/project/libpqxx/projdisplay.php">http://gborg.postgresql.org/project/libpqxx/projdisplay.php</a><br /><a href="http://www.sgi.com/tech/stl/">http://www.sgi.com/tech/stl/</a><br /><a href="http://stlport.org/">http://stlport.org/</a><br /><a href="http://sourceforge.net/projects/blitz/">http://sourceforge.net/projects/blitz/</a><br /><a href="http://www.cs.wustl.edu/~schmidt/ACE.html">http://www.cs.wustl.edu/~schmidt/ACE.html</a><br /><a href="http://www.sourceforge.net/projects/tinyxml">http://www.sourceforge.net/projects/tinyxml<br /></a><br /><br /><a href="http://www.tinybutstrong.com/">http://www.tinybutstrong.com/</a> [a php templates engine]<br /><img src ="http://www.blogjava.net/bluesky/aggbug/49530.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-06-01 12:48 <a href="http://www.blogjava.net/bluesky/archive/2006/06/01/49530.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[ZT]XFree86学习笔记</title><link>http://www.blogjava.net/bluesky/archive/2006/06/01/49459.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 01 Jun 2006 02:33:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/06/01/49459.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/49459.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/06/01/49459.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/49459.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/49459.html</trackback:ping><description><![CDATA[
		<p>XFree86学习笔记<br />整理：Jims of 肥肥世家<br />&lt;<a href="mailto:yjnet@21cn.com">yjnet@21cn.com</a>&gt;</p>
		<p>Copyright ? 2004 本文遵从GPL协议，欢迎转载、修改、散布。</p>
		<p>第一次发布时间:2004年8月14日</p>
		<p>
				<br />--------------------------------------------------------------------------------</p>
		<p>Table of Contents</p>
		<p>1. X window 介绍<br />1.1. X 简介<br />1.2. 版本<br />1.3. XFree86项目介绍<br />2. XFree86系统介绍<br />2.1. XFree86安装<br />2.2. XFree86配置<br />2.3. XFree86的文件系统<br />2.4. XFree86字体<br />2.5. 启动X11<br />2.5.1. 启动方法<br />2.5.2. 启用多用户会话<br />2.5.3. 终止X会话<br />3. X11客户程序常用选项<br />3.1. X程序常用选项<br />3.2. 使用客户程序资源<br />4. X window的网络应用<br />4.1. 远程会话<br />4.2. 远程桌面<br />4.3. 安全问题<br />5. X系统客户程序介绍<br />5.1. 环境设置命令<br />5.2. 小工具<br />6. X11多媒体客户程序介绍<br />7. 显示管理器<br />7.1. xdm的配置<br />8. 窗口管理器<br />8.1. WindowMaker<br />8.2. fvwm\fvwm2\fvwm95<br />8.3. enlightenment<br />8.4. mwm<br />8.5. twm<br />8.6. icewm<br />8.7. Sawfish<br />8.8. blackbox<br />9. 桌面环境<br />9.1. GNOMN<br />9.2. KDE<br />9.3. CDE<br />10. X web<br />List of Tables</p>
		<p>2.1. XFree86文件系统目录清单<br />3.1. X程序常用选项<br />Chapter 1. X window 介绍<br />Table of Contents</p>
		<p>1.1. X 简介<br />1.2. 版本<br />1.3. XFree86项目介绍<br />1.1. X 简介<br />X window系统是一个很复杂的网络图形界面系统，它的开发始于1984年，它被应用已有近20年。X也是一个协议，它定义程序(客户程序)如何与另一个在远程机器上运行的程序(服务器程序)交换信息。它最早是由数字设备公司(DEC)的Jim Gettys与麻省理工大学(MIT)的Ron Newman和Bob Scheifler共同开发的。当时DEC和MIT想共同开发一种分布式的计算环境，X系统就是他们研究成果的一部分，这项工作叫作雅典娜工程。现在X的管理机构是X 联盟(<a href="http://www.x.org">www.x.org</a>)。X系统由三部份组成，它们分别是X Server、Xclient和X协议。</p>
		<p>X Server是控制输入输出的程序，它是和底层硬件直接通信的。它接收X client程序的请求做建立窗口、绘制图形等工作。</p>
		<p>X client是基于X Server的客户程序，它请求X Server在指定的窗口进行各种操作。它不负责显示，只是给X Server发送一个请求，由服务器完成动作。</p>
		<p>X 协议是X Server和X Client之间沟通的语言。Xlib库能完成这种通信功能，所以可以基于它进行X client程序的开发。</p>
		<p>以下是X系统的几点优势：</p>
		<p>可移植性。X系统可移植到几乎所有的计算机图形系统下。</p>
		<p>标准化。X window系统提供一个标准的函数库和功能调用集合，抽象了硬件层功能，使程序开发更标准更快捷。</p>
		<p>网络化。它是基于网络的图形界面系统。</p>
		<p>模块化结构。能方便进行功能扩展。</p>
		<p>不嵌入操作系统中，适用于几乎所有的操作系统，如linux、solairs、windows等。</p>
		<p>1.2. 版本<br />1986年发布X10.4版</p>
		<p>1987年9月15日发布X11R1版(X11第一次修订版)。源程序有19MB，可在4种主要的操作系统下运行。 </p>
		<p>1988年发行第二修订版X11R2。该版提供了很多压缩的矢量字体，以及第三方软件商提供的软件工具。</p>
		<p>1991年8月29日发布了X11R5版。为X window系统增加了国际化功能。</p>
		<p>1994年4月21日，X11R6发布。这一版改进窗口管理、资源共享、会话管理等功能。</p>
		<p>1996年3月5日发布了X11R6.1版，支持16种操作系统，包括linux内核1.2.11。</p>
		<p>1996年12月23日发布了X11R6.3版，它是X联盟转换到TOG(开放工作组，一个非盈利机构)前最后的一个X版本。TOG由200个新成员和很多X联盟的原创成员组成。</p>
		<p>1998年1月4日，TOG发布了X11R6.4版。TOG工作组改变X 系统免费的许可证政策，如果从销售X系统中盈利，就须交纳年度注册费，价格是每5万个用户7500美元，随后又增加到至65000美元。由于新许可政策的实施，导致开源社区组成一个XFree86工程公司(一个非盈利的机构)开发了一个基于Intel PC平台的免费X系统XFree86。1998年9月TOG也放弃新许可政策，把X11R6.4版的许可恢复到旧的麻省理工的版本。</p>
		<p>2000年8月15日，X11R6.5.1发布。源文件容量扩充以144Mb，包含8100多个文件、600多种字体、345个手册页、20个程序库、70个图象和60个客户程序。现在最新的版本是X11R6.7.0，可以到<a href="http://www.x.org">http://www.x.org</a>下载。</p>
		<p>1.3. XFree86项目介绍<br />XFree86项目成立于1994年3月19日。最早的开发工作始于1992年，由一个开发小组完成，实现了基于Intel PC平台的X系统。1994年5月18日发布的XFree86 2.1版是第一个支持linxu的XFree86版本。2000年5月7日XFree86 4.0版发布，它是XFree86最重要的一个发布版，增加了很多功能。XFree86的意思是“提供X服务，它是自由的(free)，它是基于Intel的PC平台”。现在最新的XFree86版是4.4.0。可以到<a href="http://www.xfree86.org">http://www.xfree86.org</a>下载。基于windows平台也有X window系统，如：X-Win32、Extra!X、Exceed等。</p>
		<p>Chapter 2. XFree86系统介绍<br />Table of Contents</p>
		<p>2.1. XFree86安装<br />2.2. XFree86配置<br />2.3. XFree86的文件系统<br />2.4. XFree86字体<br />2.5. 启动X11<br />2.5.1. 启动方法<br />2.5.2. 启用多用户会话<br />2.5.3. 终止X会话<br />2.1. XFree86安装<br />安装软件与其它软件大同小异，这里就不详细介绍了。</p>
		<p>2.2. XFree86配置<br />在XFree86中的配置文件是XF86Config-4，下面介绍几种配置的工具：</p>
		<p>xf86config是一个基于文本的配置工具。在控制台运行该命令后按提示配置就可以了。</p>
		<p>reconfig用以把旧版的配置文件转换成4.0.1版的配置文件格式。</p>
		<p>可以用$ XFree86 -configure命令由系统自动生成一个叫XF86Config.new的配置文件，可基于这个文件再修改。最后用$ XFree86 -xf86config XF86Config.new进行测试。如果成功将出现一个带“X”的窗口。最后把正确的配置文件拷贝成/etc/X11/XF86Config-4。</p>
		<p>在XFree86 4.0.1后，还可通过xf86cfg这个图形化程序来进行配置。</p>
		<p>在各linux的发行版中，还包含有各自开发的配置工具，redhat有Xconfigurator；Mandrake 有DrakConf；SuSE 有SaX。</p>
		<p>下面是一个完整的配置文件例子：</p>
		<p>Section "ServerLayout"  ==============配置标识区<br />        Identifier     "XFree86 Configured"<br />        Screen      0  "Screen0" 0 0<br />        InputDevice    "Keyboard0" "CoreKeyboard"<br /># PS/2 Mouse not detected<br />        InputDevice    "Serial Mouse" "CorePointer"<br /># USB Mouse not detected<br />EndSection</p>
		<p>Section "ServerFlags" =================X 选项配置区<br />        Option "AllowMouseOpenFail"  "true"  ====允许在鼠标配置失败的情况下启动X<br />        Option "DontZap"   "true"            ====不能使用Ctrl+Alt+Backspace组合键退出X<br />        Option "DontZoom"  "true"            ====不能使用Ctrl+Alt+小键盘+-来切换显示模式<br />        </p>
		<p>EndSection</p>
		<p>Section "Files"     =========================字体配置区<br />        RgbPath      "/usr/X11R6/lib/X11/rgb"<br />        ModulePath   "/usr/X11R6/lib/modules"<br /># Additional fonts: Locale, Gimp, TTF...<br />#       FontPath     "/usr/X11R6/lib/X11/fonts/latin2/75dpi"<br />#       FontPath     "/usr/X11R6/lib/X11/fonts/latin2/100dpi"<br /># True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!<br />    FontPath    "/usr/X11R6/lib/X11/fonts/misc:unscaled"<br />    FontPath    "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"<br />    FontPath    "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"<br />    FontPath    "/usr/X11R6/lib/X11/fonts/PEX"<br />    FontPath    "/usr/X11R6/lib/X11/fonts/cyrillic"<br />    FontPath    "/usr/X11R6/lib/X11/fonts/TrueType"<br />EndSection</p>
		<p>Section "Module"<br />        Load  "ddc"  # ddc probing of monitor<br />        Load  "dbe"<br />        Load  "dri"<br />        Load  "extmod"<br />        Load  "glx"<br />        Load  "record"<br />        Load  "xtt"<br />EndSection</p>
		<p>Section "InputDevice"     ================键盘配置区<br />        Identifier  "Keyboard0"<br />        Driver      "keyboard"<br />        Option      "CoreKeyboard"<br />        Option "XkbRules" "xfree86"<br />        Option "XkbModel" "pc105"<br />        Option "XkbLayout" "us"</p>
		<p>EndSection</p>
		<p>Section "InputDevice"    =================串口鼠标配置区<br />        Identifier  "Serial Mouse"<br />        Driver      "mouse"<br />        Option      "Protocol" "Microsoft"<br />        Option      "Device" "/dev/ttyS0"<br />        Option      "Emulate3Buttons" "true"<br />        Option      "Emulate3Timeout" "70"<br />        Option      "SendCoreEvents"  "true"<br />EndSection</p>
		<p>Section "InputDevice"    =================ps/2鼠标配置区<br />        Identifier  "PS/2 Mouse"<br />        Driver      "mouse"<br />        Option      "Protocol" "auto"<br />        Option      "ZAxisMapping"          "4 5"<br />        Option      "Device" "/dev/psaux"<br />        Option      "Emulate3Buttons" "true"<br />        Option      "Emulate3Timeout" "70"<br />        Option      "SendCoreEvents"  "true"<br />EndSection</p>
		<p>Section "InputDevice"    =================usb鼠标配置区<br />        Identifier      "USB Mouse"<br />        Driver          "mouse"<br />        Option          "Device"                "/dev/input/mice"<br />        Option          "SendCoreEvents"        "true"<br />        Option          "Protocol"              "IMPS/2"<br />        Option          "ZAxisMapping"          "4 5"<br />        Option          "Buttons"               "5"<br />EndSection</p>
		<p>Section "Monitor"       ==================显示器配置区<br />        Identifier      "Monitor0"<br />        Option  "DPMS"  "true"<br />        VendorName      "MAG"<br />        ModelName       "MAG9705"<br />        HorizSync 30-86# DDC-probed<br />        VertRefresh 50-160# DDC-probed<br />        # These are the DDC-probed settings reported by your monitor.<br />        # 1600x1200, 65.0Hz; hfreq=81.25, vfreq=65.00<br />        ModeLine "1600x1200"    175.50 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync<br />        # 1280x1024, 75.0Hz; hfreq=79.98, vfreq=75.03<br />        ModeLine "1280x1024"    135.00 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync<br />        # 1280x960, 85.0Hz; hfreq=85.40, vfreq=85.00<br />        ModeLine "1280x960"     148.50 1280 1344 1504 1728  960  961  964 1011 +hsync +vsync<br />        # 1024x768, 85.0Hz; hfreq=68.68, vfreq=85.00<br />        ModeLine "1024x768"      94.50 1024 1072 1168 1376  768  769  772  808 +hsync +vsync<br />EndSection</p>
		<p>Section "Device"       ===================显卡配置区           <br />        ### Available Driver options are:-<br /># sw_cursor is needed for some ati and radeon cards<br />Option "sw_cursor"<br />        #Option     "hw_cursor"<br />        #Option     "NoAccel"<br />        #Option     "ShowCache"<br />        #Option     "ShadowFB"<br />        #Option     "UseFBDev"<br />        #Option     "Rotate"<br />        Identifier  "Card0"<br />        Driver      "nv"            =======如果不清楚可选svga或vga<br />        VendorName  "NVidia"<br />        BoardName   "GeForce2 MX DDR"<br />#       BusID       "PCI:1:0:0"<br />EndSection</p>
		<p>Section "Screen"     =====================屏幕配置区<br />        Identifier "Screen0"<br />        Device     "Card0"<br />        Monitor    "Monitor0"<br />        DefaultColorDepth 24  ============用24位色深 <br />        SubSection "Display"<br />                Depth     1<br />                Modes "1024x768" "640x480" <br />                Virtual 0 0<br />        EndSubSection<br />        SubSection "Display"<br />                Depth     4<br />                Modes "1024x768" "640x480" <br />                Virtual 0 0<br />        EndSubSection<br />        SubSection "Display"<br />                Depth     8<br />                Modes "1024x768" "640x480" <br />                Virtual 0 0<br />        EndSubSection<br />        SubSection "Display"<br />                Depth     15<br />                Modes "1024x768" "640x480" <br />                Virtual 0 0<br />        EndSubSection<br />        SubSection "Display"<br />                Depth     16<br />                Modes "1024x768"  <br />                Virtual 0 0<br />        EndSubSection<br />        SubSection "Display"<br />        SubSection "Display"<br />                Depth     24<br />                Modes "1024x768" "640x480" <br />                Virtual 0 0<br />        EndSubSection<br />        SubSection "Display"<br />                Depth     32<br />                Modes "1024x768" "640x480" <br />                Virtual 0 0<br />        EndSubSection<br />EndSection</p>
		<p>2.3. XFree86的文件系统<br />大多数程序，字体和文件都放在/usr/X11R6目录下，而其它组件和配置文件则放在/etc/X11目录下，一些始化程序如xfs字体服务器就放到系统初始化目录/etc/init.d目录下。下面是一个XFree86系统目录列表：</p>
		<p>Table 2.1. XFree86文件系统目录清单</p>
		<p>目录 描述 <br />/etc/X11 X配置文件 <br />/usr/X11R6/bin X程序 <br />/usr/X11R6/include X11程序开发所需的#include文件和图形 <br />/usr/X11R6/lib X程序共享库 <br />/usr/X11R6/lib/X11 配置文件，应用程序资源文件文档、字体及国际化文件 <br />/usr/X11R6/lib/modules XFree86模块(驱动程序、扩展文件、字体文件等) <br />/usr/X11R6/man X手册页 <br />/usr/X11R6/share 各种X客户程序共享的资源文件 </p>
		<p>2.4. XFree86字体<br />可以在本地或远程安装字体。单机上运行的linux的字体目录主要是在/usr/X11R6/lib/X11/fonts目录下。有几个工具用以管理字体，分别是：</p>
		<p>mkfontdir用来在字体目录下创建字体名数据库。</p>
		<p>xlsfonts用来列出已安装字体。</p>
		<p>xfontsel用来显示从字体集中选中的各种字体。</p>
		<p>xfd用来显示在X字体中的字符。</p>
		<p>xset -q可查看字体的路径</p>
		<p>在fonts目录下列有已安装的各种字体目录，如100dpi/、75dpi/、misc/等，每个目录下都有一个fonts.dir和一个fonts.alias文件。fonts.dir文件是字体列表数据库，X 和xfs字体服务器用这个文件查找字体；fonts.alias文件包含两栏信息：名字和别名。可以利用这个文件给已有的字体创建新名字。Encodings目录中的是Type1 (也称TrueType)的字体编码。这些信息用来在显示器上绘制可缩放字体。</p>
		<p>XFree86还可使用远程XFree86 服务器上的字体，从而减少本地的字体存储空间，主要通过配置字体服务器xfs完成。为利用远程服务器上提供的字体，可用xset +fp unix/remote.org:7100命令可把远程X 服务器提供的字体增加到当前显示字体路径中。在单机上运行xfs时，可以用一个单一的设置代替XF86Config文件中列出的字体列表:</p>
		<p>Fontpath "nuix/:7100"</p>
		<p>不过，具体操作还没测试过。</p>
		<p>Xresources文件位于/etc/X11目录下，该文件包含所有客户程序的默认资源管理信息。如emacs,vim。emacs*Background:DarkSlateGray表示把emacs程序的背景设置为灰色。这样任何用户在你计算机上启动emacs编辑器，将使用灰色的背景。除非用本地设置来使之失效。</p>
		<p>2.5. 启动X11<br />X window的启动过程是由xinit客户端程序控制的，先启动X Server,接着启动窗口管理器，最后启动用户应用程序。用户主目录下的.xinitrc文件就是控制xinit程序启动什么窗口管理器、显示管理器和程序的文件。一般启动X window的方法有如下几种：</p>
		<p>2.5.1. 启动方法<br />各种linux的发行版都把运行级别5定为x window模式，所以最简单的方式是修改/etc/inittab文件，把系统的默认运行级别定为5，重启系统就可以了。有关系统运行级别的设置方法和原理可参考有关资料或man手册页。</p>
		<p>我们也可以用startx脚本从shell中手动启动x window。启动startx后，它会进行一些环境变量的测试，它会搜查xclient的位置：$HOME/.xinitrc和/etc/X11/xinit/xinitrc，还有xserver的位置：$HOME/.xserverrc和/etc/X11/xinit/xserverrc。如果主目录有配置文件就会优先使用，首先，xinit先执行.xserverrc的内容，如果找不到该文件，则用/etc/X11/xinit/xinit/xserverrc，如果都没有，就执行 X :0，启动X Server。接着xinit就会执行用户主目录下.xinitrc配置文件的内容。如果没有则到/etc/X11/xinit/下找xinitrc文件，如果都找不到，则执行xterm -geometry +1+1 -n login -display :0。一个简单的.xinitrc配置文件如下：</p>
		<p>export LANG=zh_CN.GB2312               ======这两行是设置中文环境变量<br />export  LC_ALL=zh_CN.GB2312<br />export XMODIFIERS="@im=Chinput"        ======设置Chinput为中文输入法<br />chinput&amp;                               ======启动chinput输入法服务器<br />wmaker&amp;                             ======启动window maker窗口管理器<br />用startx启动X的过程就是这样的。</p>
		<p>还有一个程序叫X，它只是启动X Server进入X环境，所以可用它来测试X Server服务是否成功启动。启动X后，可按Ctrl+Alt+F7切换到X界面。</p>
		<p>2.5.2. 启用多用户会话<br />如果有足够多的内存，可以用startx命令启动多个X会话。首先我们要启动到非X多用户模式下，如运行级别3。运行以下命令：$ startx -display :0 -vt7启动第一个会话，运行$ startx -display :1 -vt8启动第二个会话，可用Ctrl+Alt+F7/F8进行会话切换。</p>
		<p>2.5.3. 终止X会话<br />一种方法是通过窗口管理器的注销功能或在终端中打入logout，一种是通过Ctrl+Alt+Fn切换到其它控制台，再用kill终止。</p>
		<p>Chapter 3. X11客户程序常用选项<br />Table of Contents</p>
		<p>3.1. X程序常用选项<br />3.2. 使用客户程序资源<br />3.1. X程序常用选项<br />Table 3.1. X程序常用选项</p>
		<p>命令行选项 描述 <br />-bg color or -background color 设置背景色 <br />-bd color or -bordercolor color 设置窗口边框色 <br />-bw n or -borderwidth n 设置窗口边框的宽度，n的单位是象素 <br />-fg color 设置前景色 <br />-fn font 设置字体 <br />-geometry 宽X高+/-X偏移量+/-Y偏移量 指定客户程序窗口的宽度，高度和在桌面上的位置 <br />-iconic 以最小化的状态启动客户端程序 <br />-title string 设置窗口标题 </p>
		<p>以上参数只是一些程序常用的，有些程序可能不支持，要详细了解可使用命令的-h或--help参数查询，如rxvt --help。</p>
		<p>3.2. 使用客户程序资源<br />可使用资源设置文件为客户程序设置各种默认的属性，如字体、颜色等。这些客户程序资源文件一般保存在/usr/X11R6/lib/app-defaults目录下。可用$ appres xclock的形式来显示xclock程序的资源文件内容。我们可以用editres程序来更改客户程序的资源。还可以用xrdb来配置系统级别的资源。</p>
		<p>Chapter 4. X window的网络应用<br />Table of Contents</p>
		<p>4.1. 远程会话<br />4.2. 远程桌面<br />4.3. 安全问题<br />X 系统的网络模型是基于客户机/服务器的体系结构。客户机能远程登录进来，进行各种图形显示应用。</p>
		<p>4.1. 远程会话<br />有两台X系统，一台A，一台B。通过X系统的远程会话可以把A的xclock应用程序显示在B的显示器上。具体的操作步骤如下：</p>
		<p>首先要在两台电脑上安装X系统。在A电脑上以不带-nolisten tcp选项启动X(在Xsession里设置)。并在B上执行$ xhost + A，允许A电脑访问。</p>
		<p>在A电脑上执行$ xclock -display B:0.0&amp;，B的显示器上就会显示xclock时钟。</p>
		<p>连接完成后在B上要用$ xhost -A，取消A的远程访问权限。</p>
		<p>利用该功能，我们也可以利用telnet或ssh登录到远程服务器，在远程服务器上运行应用程序，再把显示传回本地显示。</p>
		<p>上面介绍的是基于主机的认证会话方式，还有一种更安全的基于cookis的认证方式，它要用到xauth这个程序，用它可生成一个本机的cookis保存在.Xauthority文件中，要进行认证需把它拷贝到另一台机的.Xauthority文件中。这样两台机就有了相同的cookis，连接时就可用于认证。在xauth里有两个有用的程序，一个是extract用于把cookis导出成一个文件，merge用于把导出的文件导入.Xauthority文件中。</p>
		<p>4.2. 远程桌面<br />可以利用Xvnc软件，实现远程桌面应用。该软件包括服务器和客户端，能让你在一台linux客户机上登录远程系统的桌面。包括windows、Machintosh、Solaris等。Xvnc是由英国剑桥的AT&amp;T研究室研制。使用方法如下：</p>
		<p>在A电脑上运行$ vncserver -geometry 800x600，启动服务器。</p>
		<p>在B电脑上运行$ vncviewer A:1，连接A系统桌面，桌面大小是800x600。</p>
		<p>4.3. 安全问题<br />可利用xterm的安全键盘功能。操作方法如下：</p>
		<p>在本地X会话过程中启动用户系统，$ xterm&amp;。</p>
		<p>然后把光标移到终端窗口内空白地方，按下Ctrl+单击鼠标左键，在弹出的快捷菜单中选中“Secue Keyboard”。这时，终端窗口使用相反的前后景色。这样，只有这个窗口可以输入信息，其它任何程序和窗口都不能输入信息。</p>
		<p>为了加强安全，还可以使用xfwp设置一个X防火墙。</p>
		<p>Chapter 5. X系统客户程序介绍<br />Table of Contents</p>
		<p>5.1. 环境设置命令<br />5.2. 小工具<br />5.1. 环境设置命令<br />用xset进行个性化设置，可以设置屏保、鼠标，显示器的能源之星特性(DPMS)等<br />$ xset -q 可以显示当前设置。</p>
		<p>$ xset s on 打开屏幕保护。</p>
		<p>$ xset s 60 设置屏保激活的时间为1分钟。</p>
		<p>$ xset s off 关闭屏幕保护。</p>
		<p>$ xset m "1 6"，放慢鼠标移动速度，$ xset m "30 10"，加快鼠标移动速度，$ xset m "default"，重置鼠标移动速度。</p>
		<p>用xsetroot设置根窗口显示背景，鼠标图案等。<br />$ xsetroot -solid black，把窗口背景设置为黑色。</p>
		<p>$ xsetroot -bitmap /usr/X11R6/include/X11/bitmaps/test.bmp，用test.bmp作为桌面背景</p>
		<p>$ xsetroot -cursor_name xxx。设置鼠标图案。$ xsetroot -cursor_name X_cursor，重置鼠标图案。</p>
		<p>通过xmodmap来重新排列键盘上的按键。<br />要使用xmodmap这个程序，需要有一个.Xmodmap的配置文件，配置按键的位置。配置文件内容如下：</p>
		<p>remove Lock = Caps_Lock<br />remove Control = Control_L<br />keycode 0x42 = Caps_Lock<br />keycode 0x25 = Control_L<br />add Lock = Control_L<br />add Control = Caps_Lock<br />接着调用$ xmodmap .xmodmap进行设置。</p>
		<p>为了更好设置，可以调用xev程序进行键位测试。</p>
		<p>$ xmodmap -e "pointer = 3 2 1" 可以把鼠标的左右键对调。</p>
		<p>xhost用于控制网络上哪些主机允许存取本地显示屏幕。<br />$ xhost +，允许所有主机存取本机显示屏幕，这样是很不安全，请使用时注意。</p>
		<p>$ xhost -，禁止所有用户存取本机显示屏幕。</p>
		<p>$ xhost + test，允许test这台机存取本机显示屏幕，也可以用IP地址。</p>
		<p>5.2. 小工具<br />xwd and xwud可截取和显示屏幕画面<br />$ xwd -out test.xwd 按下回车后，光标变成一个卷发型，移动光标到要截取的窗口上，按左键就可以了。图形保存在当前目录下。</p>
		<p>$ xwd -root -display B:0.0 -out test.xwd，用-root表示截取整个显示内容。</p>
		<p>$ xwd &lt; test.xwd，显示图形。</p>
		<p>用xbiff提示电子邮件到达信息，用xeyes显示眼睛图像，用xlogo显示X标识，用xclock显示时间,用xmag放大区域。<br />$ xbiff -update 15 -volume 100 -geometry 100x100 -fg white -bg blue。</p>
		<p>$ xeyes -fg red -center yellow。</p>
		<p>$ xlogo -fg black -bg lightgreen。</p>
		<p>$ xclock -d -update 1 -fg black -bg lightgreen，-d表示显示数字时钟。</p>
		<p>$ xmag ，回车后，光标变成一个L型，然后，在你想放大的地方按鼠标左键，则会把该区放大。</p>
		<p>利用Pilot-xfer来与PDA通信。<br />详细内容请参考相关资料。</p>
		<p>xload可显示系统状态。<br />$ xload&amp;</p>
		<p>xman可显示手册页<br />$ xman</p>
		<p>editres可获得和修改Xclient程序的资源信息。<br />$ editres。</p>
		<p>xlsclients可列出当前X Server中运行的客户程序。<br />$ xlsclients</p>
		<p>Chapter 6. X11多媒体客户程序介绍<br />GIMP,一个图象处理软件。</p>
		<p>SANE(Scanner Access Now Easy)，一个扫描仪支持软件包。</p>
		<p>Gun OCR/JOCR，光学字符识别软件。</p>
		<p>gPhoto，数码相机支持软件，支持超过100种相机。</p>
		<p>Xine，xmms，mplayer，realplay，多媒体播放软件</p>
		<p>Krabber，mp3转换工具。</p>
		<p>Chapter 7. 显示管理器<br />Table of Contents</p>
		<p>7.1. xdm的配置<br />显示管理器是负责管理X会话和登录的，在GNOMN中的是gdm，在KDE中的是kdm，还有一个早期使用过的xdm。显示管理器的作用和xinit差不多，都是控制进行X Server时要执行的工作。但显示管理器有以下优势。我们完全可用显示管理器替代xinit。</p>
		<p>显示管理器可同时控制多个X Server。</p>
		<p>它是循环执行的，可确保我们始终以X window图形界面登录。</p>
		<p>它的可配置性很强。能为每个用户配置不同的系统环境。</p>
		<p>为用户提供一种简单的登录方式。</p>
		<p>7.1. xdm的配置<br />xdm的配置文件位于/etc/X11/xdm目录下，首先应查询xdm-config文件。系统会先读取该文件的配置信息。xdm-config文档的内容如下：</p>
		<p>! $Xorg: xdm-conf.cpp,v 1.3 2000/08/17 19:54:17 cpqbld Exp $<br />!<br />! $XFree86: xc/programs/xdm/config/xdm-conf.cpp,v 1.7 2001/01/17 23:45:24 dawes Exp $<br />!<br />DisplayManager.errorLogFile:/var/log/xdm.log            ====出错日志文件路径<br />DisplayManager.pidFile:/var/run/xdm.pid<br />DisplayManager.keyFile:/usr/X11R6/lib/X11/xdm/xdm-keys<br />DisplayManager.servers:/usr/X11R6/lib/X11/xdm/Xservers  ====X Server服务器启动的配置文件<br />DisplayManager.accessFile:/usr/X11R6/lib/X11/xdm/Xaccess  ====控制多个图形终端时的配置文件<br />DisplayManager.authDir:/var/lib/xdm<br />DisplayManager.willing:su nobody -c /usr/X11R6/lib/X11/xdm/Xwilling<br />! All displays should use authorization.<br />! X terminals may not be configured that way, so they will require<br />! individualized resource settings.<br />DisplayManager*authorize:true<br />! Scripts to start the server, start the user session, and reset the server<br />DisplayManager*setup:/usr/X11R6/lib/X11/xdm/Xsetup<br />DisplayManager*startup:/usr/X11R6/lib/X11/xdm/Xstartup<br />DisplayManager*reset:/usr/X11R6/lib/X11/xdm/Xreset<br />DisplayManager*resources:/usr/X11R6/lib/X11/xdm/Xresources  ====启动时的资源配置文件<br />DisplayManager*session:/usr/X11R6/lib/X11/xdm/Xsession      ====启动及周期配置文件<br />DisplayManager*authComplain:true<br />!<br />DisplayManager*userPath:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games<br />DisplayManager*systemPath:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11</p>
		<p>DisplayManager*loginmoveInterval:10</p>
		<p>! SECURITY: do not listen for XDMCP or Chooser requests<br />! Comment out this line if you want to manage X terminals with xdm<br />DisplayManager.requestPort:0</p>
		<p>Xservers中列出xdm所管理的X Server的列表。如：:0 local /usr/X11R6/bin/X -vt7</p>
		<p>Xresourdes中列出了资源的名单，在登录窗口启动之前被xrdb加载。如：可通过该文件修改登录窗口的属性。</p>
		<p>Xsession中列出在一个会话周期内所运行的程序。最后一行所执行的程序可以持续整个管理周期。当该程序结束，则周期结束。需要把除最后一行外的所有程序放在后台运行。如果不这样做，周期将可以会出挂起或出错。如：执行twm行省略了"&amp;"，则它后面的程序将不会运行，直到twm程序结束。另外，最后的一行程序必须是可执行的命令，因为它将不间断地执行且保持你的周期继续活动。如果你把它放在后台运行，虽然它同样会顺利地执行，但此周期程序执行至配置文件结束时将会中断，因而造成周期的结束。如果不用exec引导程序，而且省略“&amp;”。则最后一行的程序也将会顺利地执行且此周期将不断地持续工作，比如:xterm -geometry -0+50 -ls -C。-C表示使xterm成为一个控制台终端，使所有的系统信息在该窗口中显示。-ls表示使它的shell成为login shell。如果可使shell读入你的login或profile，所以你自已设定的环境变量会自动设定。</p>
		<p>Chapter 8. 窗口管理器<br />Table of Contents</p>
		<p>8.1. WindowMaker<br />8.2. fvwm\fvwm2\fvwm95<br />8.3. enlightenment<br />8.4. mwm<br />8.5. twm<br />8.6. icewm<br />8.7. Sawfish<br />8.8. blackbox<br />X Server只负责程序的运行和输入输出，窗口界面它没有定义和管理，它要靠一种叫窗口管理器的软件来负责。这也是X window灵活强大的功能之一。通过不同的窗口管理器，你可以定义出千变万化的窗口环境，突显你的个性，要多酷有多酷。下面对一些常用的窗口管理器进行简单的介绍。</p>
		<p>8.1. WindowMaker</p>
		<p>8.2. fvwm\fvwm2\fvwm95</p>
		<p>8.3. enlightenment</p>
		<p>8.4. mwm</p>
		<p>8.5. twm</p>
		<p>8.6. icewm</p>
		<p>8.7. Sawfish</p>
		<p>8.8. blackbox</p>
		<p>Chapter 9. 桌面环境<br />Table of Contents</p>
		<p>9.1. GNOMN<br />9.2. KDE<br />9.3. CDE<br />桌面环境是一种工作环境，里面有窗口管理器，有系统管理程序，有文件管理程序和一些工具软件的集合。所以它可以说一个集成的环境，用于办公、娱乐等。在linux下比较流行的桌面环境有两个，一个是基于GTK+的GNOMN(GNU Network Object Model Environment)和一个是基于Qt的KDE(K Desktop Environment)。</p>
		<p>9.1. GNOMN</p>
		<p>9.2. KDE</p>
		<p>9.3. CDE</p>
		<p>Chapter 10. X web<br />在X11R6.4中提供了一种基于Web的X window解决方案叫broadway。它能使X window系统具有通过Web协议访问X应用程序能力，即X web。X web的体系结构包括5个关健部分：</p>
		<p>远程执行---提拱远程启动X 应用程序的机制。</p>
		<p>一致性访问---集成X11R6.4和Http协议，提供独立于平台的一致性访问，使它具有广泛的可用性。</p>
		<p>Web浏览器插入---结合远程执行，提供在浏览器中显示应用程序执行结果的功能。</p>
		<p>安全机制---用区分可信(内部)和不可信(外部)应用程序的方法提供安全机制。它的实现包括3部分，第一是扩充的pc机X 服务器功能；第二是增加防火墙的X 代理功能；第三是为用户提供控制在可信和不可信程序间交换数据的界面。</p>
		<p>LBX(窄带X )---用于改进X在广域网和低速拔号网络上的性能，使用的技术包括高速缓冲、数据压缩和简化应答。</p>
		<p>X web是一种分布式的应用，这也是X window系统设计时初衷。但由于当时分布式计算技术环境的不完善，使得它的功能在当时的环境下实现不了。现在，随着计算技术的飞速发展，如低成本宽带网络的迅速扩张，高性，低成本的CPU的使用，操作系统功能的不断完善，开发工具和方法的不断改进等，分布式计算环境已较完善，X window的分布式应用已渐渐成为现实。</p>
		<p>X web是一种较新的技术，具体还没有测试过，有兴趣的朋友可到<a href="http://www.broadwayinfo.com">http://www.broadwayinfo.com</a>网站了解一下。<br /></p>
<img src ="http://www.blogjava.net/bluesky/aggbug/49459.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-06-01 10:33 <a href="http://www.blogjava.net/bluesky/archive/2006/06/01/49459.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>猎人带狗追捕，兔子刚跑80步，猎狗去追兔子，已知猎狗跑2步的时间兔子跑3步，猎狗跑4步的距离与兔子跑7步的距离相等。那么猎狗跑多少步可以捕获这只兔子？</title><link>http://www.blogjava.net/bluesky/archive/2006/05/19/47036.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Fri, 19 May 2006 05:11:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/05/19/47036.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/47036.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/05/19/47036.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/47036.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/47036.html</trackback:ping><description><![CDATA[
		<p>猎人带狗追捕，兔子刚跑80步，猎狗去追兔子，已知猎狗跑2步的时间兔子跑3步，猎狗跑4步的距离与兔子跑7步的距离相等。那么猎狗跑多少步可以捕获这只兔子？ <br />距离80步<br />2a/x = 3b/y<br />-&gt; 2ay = 3bx<br />-&gt; x = 2ay/3b</p>
		<p>4*a = 7*b<br />-&gt;a = 7b/4</p>
		<p>带入x = 2ay/3b<br />x = 2*7by/12b<br />x = 7y/6</p>
		<p> </p>
		<p>b = 4a/7</p>
		<p>
				<br />(n*a - 80*b)/y = n*a/x</p>
		<p>n*a*x - 80*b*x = n*a*y<br />n*a*(x-y) = 80*b*x<br />n = 80*b*x<br />   ------------<br />    a*(x-y)<br />   =  80 *4a/7* 7y/6<br />   ----------------<br />   a* (7y/6 - y)</p>
		<p> = 80*4/7 *7y/6<br /> ---------------<br /> 1y/6<br /> = 80*4=320 </p>
		<p> </p>
		<p> </p>
		<p> </p>
<img src ="http://www.blogjava.net/bluesky/aggbug/47036.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-05-19 13:11 <a href="http://www.blogjava.net/bluesky/archive/2006/05/19/47036.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Minimal wxWidgets sample~~</title><link>http://www.blogjava.net/bluesky/archive/2006/05/15/46144.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Sun, 14 May 2006 16:00:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/05/15/46144.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/46144.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/05/15/46144.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/46144.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/46144.html</trackback:ping><description><![CDATA[
		<p>/////////////////////////////////////////////////////////////////////////////<br />// Name:        minimal.cpp<br />// Purpose:     Minimal wxWidgets sample<br />// Author:      Julian Smart<br />// Modified by:<br />// Created:     04/01/98<br />// RCS-ID:      $Id: minimal.cpp,v 1.67 2005/02/20 16:14:03 JS Exp $<br />// Copyright:   (c) Julian Smart<br />// Licence:     wxWindows licence<br />/////////////////////////////////////////////////////////////////////////////</p>
		<p>// ============================================================================<br />// declarations<br />// ============================================================================</p>
		<p>// ----------------------------------------------------------------------------<br />// headers<br />// ----------------------------------------------------------------------------</p>
		<p>// For compilers that support precompilation, includes "wx/wx.h".<br />#include &lt;string&gt;<br />#include &lt;iostream&gt;<br />#include "wx/wxprec.h"</p>
		<p>#ifdef __BORLANDC__<br />    #pragma hdrstop<br />#endif</p>
		<p>// for all others, include the necessary headers (this file is usually all you<br />// need because it includes almost all "standard" wxWidgets headers)<br />#ifndef WX_PRECOMP<br />    #include "wx/wx.h"<br />#endif<br />// ----------------------------------------------------------------------------<br />// resources<br />// ----------------------------------------------------------------------------</p>
		<p>// the application icon (under Windows and OS/2 it is in resources and even<br />// though we could still include the XPM here it would be unused)<br />#if !defined(__WXMSW__) &amp;&amp; !defined(__WXPM__)<br />    #include "sample.xpm"<br />#endif</p>
		<p>// ----------------------------------------------------------------------------<br />// private classes<br />// ----------------------------------------------------------------------------</p>
		<p>// Define a new application type, each program should derive a class from wxApp<br />class MyApp : public wxApp<br />{<br />public:<br />    // override base class virtuals<br />    // ----------------------------</p>
		<p>    // this one is called on application startup and is a good place for the app<br />    // initialization (doing it here and not in the ctor allows to have an error<br />    // return: if OnInit() returns false, the application terminates)<br />    virtual bool OnInit();<br />};</p>
		<p>// Define a new frame type: this is going to be our main frame<br />class MyFrame : public wxFrame<br />{<br />public:<br />    // ctor(s)<br />    MyFrame(const wxString&amp; title);<br /> wxButton *WxButton1;<br />    wxTextCtrl *wxTextCtrl1;<br />        wxTextCtrl *wxTextCtrl2;<br />    // event handlers (these functions should _not_ be virtual)<br />    void OnQuit(wxCommandEvent&amp; event);<br />    void OnAbout(wxCommandEvent&amp; event);<br />void WxButton1Click(wxCommandEvent&amp; event);<br />private:<br />    // any class wishing to process wxWidgets events must use this macro<br />    DECLARE_EVENT_TABLE()<br />};</p>
		<p>// ----------------------------------------------------------------------------<br />// constants<br />// ----------------------------------------------------------------------------</p>
		<p>// IDs for the controls and the menu commands<br />enum<br />{<br /> ID_WXBUTTON1 = 1001,<br />    // menu items<br />    <br />    Minimal_Quit = wxID_EXIT,</p>
		<p>    // it is important for the id corresponding to the "About" command to have<br />    // this standard value as otherwise it won't be handled properly under Mac<br />    // (where it is special and put into the "Apple" menu)<br />    Minimal_About = wxID_ABOUT</p>
		<p>};</p>
		<p>// ----------------------------------------------------------------------------<br />// event tables and other macros for wxWidgets<br />// ----------------------------------------------------------------------------</p>
		<p>// the event tables connect the wxWidgets events with the functions (event<br />// handlers) which process them. It can be also done at run-time, but for the<br />// simple menu events like this the static method is much simpler.<br />BEGIN_EVENT_TABLE(MyFrame, wxFrame)<br />    EVT_MENU(Minimal_Quit,  MyFrame::OnQuit)<br />    EVT_MENU(Minimal_About, MyFrame::OnAbout)<br />    EVT_BUTTON(ID_WXBUTTON1,MyFrame::WxButton1Click)<br />END_EVENT_TABLE()</p>
		<p>// Create a new application object: this macro will allow wxWidgets to create<br />// the application object during program execution (it's better than using a<br />// static object for many reasons) and also implements the accessor function<br />// wxGetApp() which will return the reference of the right type (i.e. MyApp and<br />// not wxApp)<br />IMPLEMENT_APP(MyApp)</p>
		<p>// ============================================================================<br />// implementation<br />// ============================================================================</p>
		<p>// ----------------------------------------------------------------------------<br />// the application class<br />// ----------------------------------------------------------------------------</p>
		<p>// 'Main program' equivalent: the program execution "starts" here<br />bool MyApp::OnInit()<br />{<br />    // create the main application window<br />    MyFrame *frame = new MyFrame(_T("helloworld-test"));</p>
		<p>    // and show it (the frames, unlike simple controls, are not shown when<br />    // created initially)<br />    frame-&gt;Show(true);</p>
		<p>    // success: wxApp::OnRun() will be called which will enter the main message<br />    // loop and the application will run. If we returned false here, the<br />    // application would exit immediately.<br />    return true;<br />}</p>
		<p>// ----------------------------------------------------------------------------<br />// main frame<br />// ----------------------------------------------------------------------------</p>
		<p>// frame constructor<br />MyFrame::MyFrame(const wxString&amp; title)<br />       : wxFrame(NULL, wxID_ANY, title)<br />{</p>
		<p>    // set the frame icon<br />    SetIcon(wxICON(sample));</p>
		<p>#if wxUSE_MENUS<br />    wxMenu *fileMenu = new wxMenu;<br />    wxMenu *helpMenu = new wxMenu;<br />    helpMenu-&gt;Append(Minimal_About, _T("&amp;About...\tF1"), _T("Show about dialog"));</p>
		<p>    fileMenu-&gt;Append(Minimal_Quit, _T("E&amp;xit\tAlt-X"), _T("Quit this program"));</p>
		<p>
				<br />    wxMenuBar *menuBar = new wxMenuBar();<br />    menuBar-&gt;Append(fileMenu, _T("&amp;系统"));<br />    menuBar-&gt;Append(helpMenu, _T("&amp;帮助"));</p>
		<p>    // ... and attach this menu bar to the frame<br />    SetMenuBar(menuBar);<br />   <br />#endif // wxUSE_MENUS</p>
		<p>#if wxUSE_STATUSBAR<br />    // create a status bar just for fun (by default with 1 pane only)<br />    CreateStatusBar(2);<br />    SetStatusText(_T("helloworld-test"));<br />#endif // wxUSE_STATUSBAR<br /> wxPanel* p = new wxPanel(this, -1);<br />   wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );<br />   <br />   <br />/*    topsizer-&gt;Add(<br />    new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_RIGHT).") ),<br />    wxSizerFlags().Align(wxALIGN_RIGHT).Border(wxALL &amp; ~wxBOTTOM, 5));</p>
		<p>
				<br />  topsizer-&gt;Add(<br />    new wxTextCtrl( p, wxID_ANY, _T("My text (wxEXPAND)."), wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE),<br />    wxSizerFlags(1).Expand().Border(wxALL, 5));</p>
		<p>
				<br />  wxBoxSizer *statsizer = new wxStaticBoxSizer(<br />    new wxStaticBox(p, wxID_ANY, _T("A wxStaticBoxSizer")), wxVERTICAL );<br />  statsizer-&gt;Add(<br />    new wxStaticText(p, wxID_ANY, _T("And some TEXT inside it")),<br />    wxSizerFlags().Center().Border(wxALL, 30));<br />  topsizer-&gt;Add(<br />    statsizer,<br />    wxSizerFlags(1).Expand().Border(wxALL, 10));*/<br />   <br />   <br />    wxGridSizer *gridsizer = new wxGridSizer(2, 5, 5);<br />    <br />    gridsizer-&gt;Add(new wxStaticText(p, wxID_ANY, _T("Label")),<br />                   wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));<br />                   wxTextCtrl1 = new wxTextCtrl(p, wxID_ANY, _T(""));<br />    gridsizer-&gt;Add(wxTextCtrl1,<br />                   wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));<br />    gridsizer-&gt;Add(new wxStaticText(p, wxID_ANY, _T("Another label")),<br />                   wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));<br />                   <br />                   wxTextCtrl2 = new wxTextCtrl(p, wxID_ANY, _T(""));<br />                   <br />    gridsizer-&gt;Add(wxTextCtrl2,<br />                   wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));<br />    gridsizer-&gt;Add(new wxStaticText(p, wxID_ANY, _T("Final label")),<br />                   wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));<br />    gridsizer-&gt;Add(new wxTextCtrl(p, wxID_ANY, _T("")),<br />                   wxSizerFlags().Align(wxGROW | wxALIGN_CENTER_VERTICAL));<br />     topsizer-&gt;Add(<br />        gridsizer,<br />        wxSizerFlags().Proportion(1).Expand().Border(wxALL, 10));<br />        <br />     wxBoxSizer *button_box = new wxBoxSizer( wxHORIZONTAL );<br />  button_box-&gt;Add(<br />     new wxButton( p, wxID_ANY, _T("Two buttons in a box") ),<br />     wxSizerFlags().Border(wxALL, 7));<br />     <br />  <br />   WxButton1 = new wxButton(p, ID_WXBUTTON1, _T("WxButton1"), wxPoint(142,184), wxSize(75,25), 0, wxDefaultValidator, wxT("WxButton1"));<br />  <br />       button_box-&gt;Add(WxButton1,  wxSizerFlags().Border(wxALL, 7));<br />  button_box-&gt;Add(<br />     new wxButton( p, wxID_ANY, _T("(wxCENTER)") ),<br />     wxSizerFlags().Border(wxALL, 7));</p>
		<p>  topsizer-&gt;Add(button_box, wxSizerFlags().Center());</p>
		<p>  p-&gt;SetSizer( topsizer );<br />  </p>
		<p>      topsizer-&gt;SetSizeHints( this );<br />    </p>
		<p>}</p>
		<p>
				<br />// event handlers</p>
		<p>void MyFrame::OnQuit(wxCommandEvent&amp; WXUNUSED(event))<br />{<br />    // true is to force the frame to close<br />    Close(true);<br />}</p>
		<p>void MyFrame::OnAbout(wxCommandEvent&amp; WXUNUSED(event))<br />{<br />    wxString msg;<br />    msg.Printf( _T("helloworld-test.\n")<br />                _T("helloworld-test"));<br />                </p>
		<p>    wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);<br />}<br />void MyFrame::WxButton1Click(wxCommandEvent&amp;  WXUNUSED(event))<br />{<br /> </p>
		<p>
				<br /> wxString n1 = wxTextCtrl1-&gt;GetValue();<br /> wxString n2 = wxTextCtrl1-&gt;GetValue();<br /> std::string nx = (std::string)n1;<br /> std::cout &lt;&lt; nx &lt;&lt;std::endl;<br /> wxString msg;<br /> msg.Printf( _T(n1));</p>
		<p>    wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);<br />}<br /></p>
<img src ="http://www.blogjava.net/bluesky/aggbug/46144.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-05-15 00:00 <a href="http://www.blogjava.net/bluesky/archive/2006/05/15/46144.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用libpqxx总结</title><link>http://www.blogjava.net/bluesky/archive/2006/05/11/45612.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 11 May 2006 02:52:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/05/11/45612.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/45612.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/05/11/45612.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/45612.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/45612.html</trackback:ping><description><![CDATA[<p>Using libpq(c api) and libpqxx(c++ api) to connect postgresql-8.1.3 on WindowsXP<br />need MinGW Msys postgresql-8.1.3 source baggage<br />I use libpqxx-2.5.5 look at the libpqxx-2.5.5\win32\Intall.txt</p>
<p>--------------------------------------------------------------------<br />Getting Started with MinGW and MSYS<br />(based on contribution by Michael J. Pedersen, 2004-08-17)</p>
<p>MSYS is a Unix-like environment for Windows.&nbsp; Once you have this installed,<br />building libpqxx should be a lot more like it is under Unix except that the<br />locations of libraries and such aren't sufficiently standardized.</p>
<p>Packages to download if you don't have them already:<br />1) MinGW (<a href="http://www.mingw.org/">http://www.mingw.org/</a>), plus any updates.<br />2) MSYS (<a href="http://www.mingw.org/">http://www.mingw.org/</a>), again with any updates.<br />3) w32api (<a href="http://www.mingw.org/">http://www.mingw.org/</a>).<br />4) PostgreSQL (<a href="http://www.postgresql.org/">http://www.postgresql.org/</a>).<br />5) zlib (<a href="http://www.zlib.org/">http://www.zlib.org/</a>).</p>
<p>It is generally recommended to get the latest versions of these packages.</p>
<p>Compiling and installing PostgreSQL before you get to libpqxx:<br />1) Install MinGW (install to c:\mingw)<br />2) Install MSYS--but not into MinGW directory tree!<br />3) Run MSYS (Start-&gt;Programs-&gt;MinGW-&gt;MSYS-&gt;msys)<br />4) Extract, compile, and install zlib<br />&nbsp;&nbsp;&nbsp; # From main source directory of zlib:<br />&nbsp;&nbsp;&nbsp; <font color="#ff6600">./configure --prefix=c:/mingw/local &amp;&amp; make &amp;&amp; make install</font><br />5) Extract, compile, and install postgres<br />&nbsp;&nbsp;&nbsp; # From main source directory of PostgreSQL:<br />&nbsp;&nbsp;&nbsp;<font color="#ff0000"> ./configure --prefix=c:/mingw/local --with-includes=c:/mingw/local/include --with-libs=c:/mingw/local/lib&nbsp; &amp;&amp; make &amp;&amp; make install<br /></font>&nbsp;&nbsp; 重要:把C:\mingw\local\bin设置环境变量PATH中<br />6) Extract, compile, and install libpqxx<br />&nbsp;&nbsp;&nbsp; <font color="#ff0000">export LDFLAGS=-lws2_32 &amp;&amp;&nbsp; ./configure --prefix=c:/mingw/local --disable-shared --enable-static --disable-thread-safety &amp;&amp; make &amp;&amp; make install<br /></font>---------------------------------------------------------------------<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;Uing it in eclpise cdt<br />&nbsp;1、设置环境变量PATH C:\mingw\local\lib 使程序能连接到libpq.dll<br />&nbsp;2、&nbsp;-I &quot;C:\MinGW\local\include&quot; <br />&nbsp;&nbsp;-I &quot;C:\MinGW\libpqxx-2.5.5\include&quot;<br />&nbsp;3、&nbsp;-l&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;pqxx<br />&nbsp;&nbsp;&nbsp;pq<br />&nbsp;&nbsp;&nbsp;ws2_32<br />&nbsp;&nbsp;&nbsp;wsock32<br />&nbsp;&nbsp;&nbsp;注意顺序<br />&nbsp;&nbsp;-L&nbsp;<br />&nbsp;&nbsp;&nbsp;&quot;C:\MinGW\local\lib&quot;<br />&nbsp;&nbsp;&nbsp;&quot;C:\MinGW\lib&quot;<br />&nbsp;4、测试代码<br />&nbsp;pqlib C库 \postgresql-8.1.3\src\test\examples<br />&nbsp;pqlibxx C++ libpqxx-2.5.5\test&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; <br /></p><img src ="http://www.blogjava.net/bluesky/aggbug/45612.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-05-11 10:52 <a href="http://www.blogjava.net/bluesky/archive/2006/05/11/45612.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>use eclipse to develope c or c++ On Windows platform</title><link>http://www.blogjava.net/bluesky/archive/2006/05/09/45146.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Tue, 09 May 2006 01:40:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/05/09/45146.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/45146.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/05/09/45146.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/45146.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/45146.html</trackback:ping><description><![CDATA[<p>use eclipse to develope c or c++ On Windows platform <br />of course you need j2sdk<br />1 download eclipse platform and cdt plugins from eclipse official site <a href="http://www.eclipse.org/">http://www.eclipse.org/</a><br />2 download GNU c/c++ compilers I use MinGW <a href="http://www.mingw.org">http://www.mingw.org</a> <br />I use the MinGW-3.1.0-1.exe <br />2.1 Install MinGW say:D:/MinGW<br />2.2 set environment<br />&nbsp;<br />&nbsp;Path D:\MinGW\bin;<br />&nbsp;C_INCLUDE_PATH D:\MinGW\include;<br />&nbsp;CPLUS_INCLUDE_PATH &nbsp;D:\MinGW\include\c++\3.2.3;D:\MinGW\include\c++\3.2.3\mingw32;D:\MinGW\include\c++\3.2.3\backward;D:\MinGW\include;<br />&nbsp;LIBRARY_PATH&nbsp;D:\MinGW\lib;<br />&nbsp;change the D:\MinGW\bin\mingw32-make.exe file name to make.exe<br />&nbsp;<br />3 also download the Msys from MinGW.org<br />3.1 Install Msys</p>
<p>4 downloads wxWidgets-2.6.3.zip from <a href="http://www.wxwidgets.org/">http://www.wxwidgets.org/</a>&nbsp;<br />4.1 building it<br />&nbsp;unzip it first say:D:\MinGW\wxWidgets-2.6.3<br />&nbsp;&gt; cd D:\MinGW\wxWidgets-2.6.3\build\msw<br />&nbsp; &nbsp;&gt; make -f makefile.gcc BUILD=release<br />&nbsp; &nbsp;&gt; cd D:\MinGW\wxWidgets-2.6.3\samples\minimal<br />&nbsp; &nbsp;&gt; make -f makefile.gcc BUILD=release<br />4.2 use wxWidgets-2.6.3 in eclipse <br />&nbsp;Properties for a c++ project<br />&nbsp;GCC C++ Compiler<br />&nbsp;&nbsp;Preprocessor(-D) &nbsp;_WINDOWS<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WIN32<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;__WIN95__<br />&nbsp;&nbsp;Directories&nbsp;&nbsp;&quot;D:\MinGW\lib\gcc-lib\mingw32\3.2.3\include&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;D:\MinGW\wxWidgets-2.6.3\include&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;D:\MinGW\wxWidgets-2.6.3\lib\gcc_lib\msw&quot;<br />&nbsp;GCC C++ Linker<br />&nbsp;&nbsp;Libraries<br />&nbsp;&nbsp;&nbsp;Libraries(-l)<br />&nbsp;&nbsp;&nbsp;&nbsp;wxmsw26_adv<br />&nbsp;&nbsp;&nbsp;&nbsp;wxmsw26_core<br />&nbsp;&nbsp;&nbsp;&nbsp;wxbase26<br />&nbsp;&nbsp;&nbsp;&nbsp;wxtiff<br />&nbsp;&nbsp;&nbsp;&nbsp;wxjpeg<br />&nbsp;&nbsp;&nbsp;&nbsp;wxpng<br />&nbsp;&nbsp;&nbsp;&nbsp;wxzlib<br />&nbsp;&nbsp;&nbsp;&nbsp;wxregex<br />&nbsp;&nbsp;&nbsp;&nbsp;wxexpat<br />&nbsp;&nbsp;&nbsp;&nbsp;kernel32<br />&nbsp;&nbsp;&nbsp;&nbsp;user32<br />&nbsp;&nbsp;&nbsp;&nbsp;gdi32<br />&nbsp;&nbsp;&nbsp;&nbsp;comdlg32<br />&nbsp;&nbsp;&nbsp;&nbsp;winspool<br />&nbsp;&nbsp;&nbsp;&nbsp;winmm<br />&nbsp;&nbsp;&nbsp;&nbsp;shell32<br />&nbsp;&nbsp;&nbsp;&nbsp;comctl32<br />&nbsp;&nbsp;&nbsp;&nbsp;ole32<br />&nbsp;&nbsp;&nbsp;&nbsp;oleaut32<br />&nbsp;&nbsp;&nbsp;&nbsp;uuid<br />&nbsp;&nbsp;&nbsp;&nbsp;rpcrt4<br />&nbsp;&nbsp;&nbsp;&nbsp;advapi32<br />&nbsp;&nbsp;&nbsp;&nbsp;wsock32<br />&nbsp;&nbsp;&nbsp;&nbsp;odbc32<br />&nbsp;&nbsp;&nbsp;Library search path(-L)<br />&nbsp;&nbsp;&nbsp;&nbsp;&quot;D:\MinGW\lib&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&quot;D:\MinGW\wxWidgets-2.6.3\lib\gcc_lib&quot;</p>
<p>5 Install some libs tools on eclpise<br />ACE_wrappers build with Msys &nbsp;<a href="http://www.cs.wustl.edu/~schmidt/ACE.html">http://www.cs.wustl.edu/~schmidt/ACE.html</a><br />mysql++-2.1.1 build with makefile and need the mysql source src zip file&nbsp;<a href="http://www.tangentsoft.net/mysql++/">http://www.tangentsoft.net/mysql++/</a>&nbsp;<br />STLport-4.6.2&nbsp;<a href="http://stlport.org">http://stlport.org</a><br />STLsgi-3.3&nbsp;<a href="http://www.sgi.com/tech/stl">http://www.sgi.com/tech/stl</a><br />boost_1_33_1 &nbsp;&nbsp;<a href="http://www.boost.org/">http://www.boost.org/</a></p>
<p>look the readme file will help you build</p>
<p><br /><a href="http://www.freebyte.com/programming/cpp/">http://www.freebyte.com/programming/cpp/</a></p><img src ="http://www.blogjava.net/bluesky/aggbug/45146.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-05-09 09:40 <a href="http://www.blogjava.net/bluesky/archive/2006/05/09/45146.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Visual C++ ActiveX Control for hosting Office documents in Visual Basic or HTML</title><link>http://www.blogjava.net/bluesky/archive/2006/04/27/43457.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 27 Apr 2006 01:03:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/04/27/43457.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/43457.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/04/27/43457.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/43457.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/43457.html</trackback:ping><description><![CDATA[<a href="http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q311/7/65.asp&amp;NoWebContent=1">http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q311/7/65.asp&amp;NoWebContent=1</a><img src ="http://www.blogjava.net/bluesky/aggbug/43457.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-04-27 09:03 <a href="http://www.blogjava.net/bluesky/archive/2006/04/27/43457.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Free C++ (and C)</title><link>http://www.blogjava.net/bluesky/archive/2006/04/24/42832.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Mon, 24 Apr 2006 06:54:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/04/24/42832.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/42832.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/04/24/42832.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/42832.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/42832.html</trackback:ping><description><![CDATA[<a href="http://www.freebyte.com/programming/cpp/">http://www.freebyte.com/programming/cpp/</a><br /><br />
<table cellspacing="20" width="720" border="0" class="maintable">
    <tbody>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.anjuta.org/" target="_blank"><font color="#660000">Anjuta</font></a></td>
            <td valign="top">Free open-source IDE for C and C++ on <strong>Linux</strong>/GTK/GNOME.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.borland.com/bcppbuilder/freecompiler/" target="_blank"><font color="#660000">Borland C++</font></a></td>
            <td valign="top">This well known compiler from Borland (for <strong>Windows</strong> and DOS) can now be downloaded for free (legally)!</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.codeblocks.org/" target="_blank"><font color="#660000">Code::Blocks Studio</font></a></td>
            <td valign="top">A freeware open-source C++ IDE for Windows and Linux. It supports these compilers: GCC (MingW / Linux GCC), MSVC++, Digital Mars, Borland C++ 5.5, Open Watcom.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.bloodshed.net/devcpp.html" target="_blank"><font color="#660000">Dev-C++</font></a></td>
            <td valign="top">A full-featured Integrated Development Environment (IDE) for the C/C++ programming language. Freeware for <strong>Windows</strong>.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.ibiblio.org/onebase/onebaselinux.com/About/features/developgo.php" target="_blank"><font color="#660000">DevelopGo</font></a></td>
            <td valign="top">For Linux. Over 11 Languages, 5 popular Integrated Development Environments, 4 GUI designers, 5 GUI toolkits, extensive language bindings, wide collection of offline documentation and with core Onebase support all in a Single LiveCD. After signing up for a $10 download account, have free access to all Onebase Products, including upgrades.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.digitalmars.com/" target="_blank"><font color="#660000">Digital Mars</font></a></td>
            <td valign="top">Free C and C++ Compilers and IDE's for Win32, Win16, DOS32 and DOS, command line and GUI versions, tutorials, sample code, online updates, Standard Template Library, etc.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.rhide.com/" target="_blank"><font color="#660000">djgpp</font></a></td>
            <td valign="top">A port of the GNU compiler and programming tools to MS DOS.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.eclipse.org/cdt/" target="_blank"><font color="#660000">Eclipse CDT</font></a></td>
            <td valign="top">C and C++ Integrated Development Environment (IDE) for the Eclipse platform implemented in Java. </td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://msdn.microsoft.com/mobility/othertech/eVisualc/" target="_blank"><font color="#660000">Embedded Visual C++</font></a></td>
            <td valign="top">Free Visual C++ compiler for Windows Mobile and Windows CE.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://gcc.gnu.org/" target="_blank"><font color="#660000">GNU C++/C Compiler</font></a></td>
            <td valign="top">GCC, the GNU Compiler Collection (freeware, open source, multi-platform), includes front ends for C, C++, Objective-C, Fortran, Java, and Ada. The GCC documentation section can be found <a href="http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gcc/index.html" target="_blank"><font color="#660000">here</font></a>.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.intel.com/cd/software/products/asmo-na/eng/compilers/clin/219856.htm" target="_blank"><font color="#660000">Intel C++ compiler</font></a></td>
            <td valign="top">Free <strong>Linux</strong> C++ compiler from Intel. Freeware for non-commercial use. It uses either the command line or the optional Eclipse-based integrated development environment (Eclipse IDE runs on IA-32 only).</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.kdevelop.org/" target="_blank"><font color="#660000">KDevelop</font></a></td>
            <td valign="top">Free open-source IDE for <strong>Linux</strong>/KDE which supports many programming languages. </td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.cs.virginia.edu/~lcc-win32/" target="_blank"><font color="#660000">LCC-Win</font></a></td>
            <td valign="top">Free C compiler/IDE for Windows . Contains compiler, debugger, resource compiler, resource editor, etc etc. Freeware for non-commercial use only.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://developer.apple.com/tools/mpw-tools/" target="_blank"><font color="#660000">Macintosh<br />Programmer's Workshop</font></a></td>
            <td valign="top">Free C++ compilers, debuggers, assemblers, documentation and related tools for the <strong>MAC</strong> platform.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.mingw.org/" target="_blank"><font color="#660000">MinGW</font></a></td>
            <td valign="top">'Minimalist GNU for Windows'. A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MinGW comes with the GNU C++ compiler.<br />See also <a href="http://www.thisiscool.com/gcc_mingw.htm" target="_blank"><font color="#660000">GCC/GCJ for MingW</font></a>.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.parinyasoft.com/" target="_blank"><font color="#660000">MinGW Developer Studio</font></a></td>
            <td valign="top">An IDE for the GNU C/C++ Compiler. Freeware for Windows and Linux.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.openwatcom.org/" target="_blank"><font color="#660000">Open Watcom</font></a></td>
            <td valign="top">Freeware open source C++ (and Fortran) compilers for Windows. Plans for Open Watcom include porting the compiler to the Linux and FreeBSD platforms</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.smorgasbordet.com/pellesc/" target="_blank"><font color="#660000">Pelles C</font></a></td>
            <td valign="top">A complete development kit for Windows and Pocket PC. It contains an IDE, optimizing C compiler, a linker, a resource compiler, a message compiler, a make utility, a debugger, install builders and much more. For Windows and Pocket PC.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.fifsoft.com/relo" target="_blank"><font color="#660000">Relo</font></a></td>
            <td valign="top">A Windows C/C++ IDE for MinGW and Borland C++ compilers. Freeware, open-source for Windows.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.rhide.com/" target="_blank"><font color="#660000">Rhide</font></a></td>
            <td valign="top">An IDE with which you can develop and debug in C, C++, Pascal and other languages and compilers which can be called from Rhide. Suitable for Linux text-console and DOS / DJGPP.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://fabrice.bellard.free.fr/tcc/" target="_blank"><font color="#660000">Tiny C Compiler</font></a></td>
            <td valign="top">Freeware, small and fast C-compiler for Linux.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://upp.sourceforge.net/" target="_blank"><font color="#660000">Ultimate++</font></a></td>
            <td valign="top">Ultimate++ consists of Set of cross-platform <strong>Windows</strong> and <strong>Linux</strong> libraries (&quot;packages&quot;), widgets (user-interface elements) an IDE, a lay-out designer for designing dialogs, image designer for designing graphical elements, language editor for managing internationalized text strings, etc. </td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.objectcentral.com/vide.htm" target="_blank"><font color="#660000">V IDE</font></a></td>
            <td valign="top">Integrated Development Environment for the GNU g++ compiler, Borland C++ 5.5, and the standard Sun Java Development Kit. Suitable for Windows and Linux.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://lab.msdn.microsoft.com/express/visualc/" target="_blank"><font color="#660000">Visual C++ Express</font></a></td>
            <td valign="top">Free Visual C++ compiler for Windows by Microsoft.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://visual-mingw.sourceforge.net/" target="_blank"><font color="#660000">Visual-MinGW</font></a></td>
            <td valign="top">Freeware open-source IDE for Windows. An Integrated Development Environment for MinGW compiler.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.widestudio.org/EE/" target="_blank"><font color="#660000">WideStudio</font></a></td>
            <td valign="top">An open source, Integrated Development Environment for developing GUI applications based on the MWT(Multi-Platform Widget Toolkit). Supported platforms: Windows, WindowsCE, Linux, FreeBSD, SOLARIS, MacOSX, etc. </td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://wxdsgn.sourceforge.net/" target="_blank"><font color="#660000">wx-Devcpp</font></a></td>
            <td valign="top">wxWidgets form designer plugin for Dev-C++ which can help you to create Dialogs and Frames for <a href="http://www.wxwidgets.org/" target="_blank"><font color="#660000">wxWidgets</font></a> visually.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://developer.apple.com/tools/xcode/" target="_blank"><font color="#660000">XCode</font></a></td>
            <td valign="top">Integrated development environment (IDE) for creating <strong>Mac OS X</strong> Universal Binaries that run natively on PowerPC and Intel-based Macintosh computers. Freeware.</td>
        </tr>
    </tbody>
</table>
<br />
<table cellspacing="20" width="720" border="0" class="maintable">
    <tbody>
        <tr>
            <th valign="top" colspan="2">Non-free C++ Compilers and IDE's</th>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.codeforge.com/" target="_blank"><font color="#660000">Code Forge</font></a></td>
            <td valign="top">Professional Integrated Development Environment for Unix/Linux with project management features and edit/compile/debug support for over 30 programming languages. The IDE has preconfigured support for all major free and commercial compilers on the market today, such as GCC.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.newplanetsoftware.com/jcc/" target="_blank"><font color="#660000">Code Crusader</font></a></td>
            <td valign="top">IDE for Linux-Intel, Linux-PPC and Solaris. Supports over 30 programming languages. It comes with the JX GUI Application framework, which is built directly on top of Xlib.</td>
        </tr>
        <tr>
            <td colspan="2"><a name="freecppguilibraries"></a>&nbsp;</td>
        </tr>
        <tr>
            <th valign="top" colspan="2">Free C++ GUI Libraries</th>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.fltk.org/" target="_blank"><font color="#660000">FLTK</font></a></td>
            <td valign="top">A cross-platform C++ GUI toolkit for UNIX/Linux, Windows, and MacOS X providing modern GUI functionality without the usual bloat. It also supports 3D graphics via OpenGL and its built-in GLUT emulation.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.fox-toolkit.org/" target="_blank"><font color="#660000">Fox Toolkit</font></a></td>
            <td valign="top">Cross-platform C++ user-interface library, freeware, open-source.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.memecode.com/lgi.php" target="_blank"><font color="#660000">LGI</font></a></td>
            <td valign="top">Cross-platform C++ framework for abstracting out all the operating system dependencies that you can produce portable code. It handles all the graphical interface functions, threading and semaphores, network connectivity and lots of other bits and pieces to help build small, fast and reliable applications. </td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.trolltech.com/" target="_blank"><font color="#660000">Qt</font></a></td>
            <td valign="top">Cross-platform C++ GUI framework.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.scintilla.org/" target="_blank"><font color="#660000">Scintilla</font></a></td>
            <td valign="top">A free source code editing component. Freeware, open-source for Linux and Windows.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.geocities.com/SiliconValley/Vista/7184/guitool.html" target="_blank"><font color="#660000">The GUI Toolkit,<br />Framework Page</font></a></td>
            <td valign="top">A comprehensive reference on toolkits for building graphical user interfaces (GUIs), with emphasis on resources for Free Software (Open Source)</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.objectcentral.com/vgui/vgui.htm" target="_blank"><font color="#660000">V</font></a></td>
            <td valign="top">V is a free, multiple platform C++ graphical user interface framework designed to make it easy to write C++ GUI applications, commercial, shareware, or freeware. V is available for X Athena, X Motif/Lesstif, all Windows platforms, and OS/2.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://sourceforge.net/projects/whisper2" target="_blank"><font color="#660000">Whisper2</font></a></td>
            <td valign="top">C++ application framework for the Mac, Unix and Windows.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.wxwindows.org/" target="_blank"><font color="#660000">wxWidgets</font></a></td>
            <td valign="top">API for writing GUI applications on multiple platforms. Link with the appropriate library for your platform (Windows/Unix/Mac, others coming shortly) and compiler (almost any popular C++ compiler), and your application will adopt the look and feel appropriate to that platform. Additionally: online help, network programming, streams, clipboard and drag and drop, multi-threading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, etc. Freeware, Open Source</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://zoolib.sourceforge.net/" target="_blank"><font color="#660000">ZooLib</font></a></td>
            <td valign="top">A cross-platform application framework, enables you to write a single set of C++ sources and compile them to native executables to run on MacOS, Windows, BeOS or Unix/Linux.</td>
        </tr>
        <tr>
            <td colspan="2"><a name="freecppdatabaselibraries"></a>&nbsp;</td>
        </tr>
        <tr>
            <th valign="top" colspan="2">Free C++ Database Libraries</th>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.datareel.com/" target="_blank"><font color="#660000">DataReel</font></a></td>
            <td valign="top">A cross-platform C++ development kit used to build multi-threaded database and communications applications. Using DataReel you can build end-user applications, embedded systems, and reusable libraries for multiple operating systems.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.csse.monash.edu.au/~darrenp/diamondbase.html" target="_blank"><font color="#660000">DiamondBase</font></a></td>
            <td valign="top">C++ database engine which is available for free non commercial use, and is negotiable for commercial use.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.tangentsoft.net/mysql++/" target="_blank"><font color="#660000">MySQL++</font></a></td>
            <td valign="top">MySQL++ is a C++ wrapper for <a href="http://www.freebyte.com/programming/database/"><font color="#660000">MySQL's</font></a> API.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.sqlite.org/" target="_blank"><font color="#660000">SQLLite</font></a></td>
            <td valign="top">SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.</td>
        </tr>
        <tr>
            <td colspan="2"><a name="freecppcompressionlibs"></a>&nbsp;</td>
        </tr>
        <tr>
            <th valign="top" colspan="2">Free C++ Compression Libraries</th>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.kyz.uklinux.net/libmspack/" target="_blank"><font color="#660000">libmspack</font></a></td>
            <td valign="top">Portable C++ library which provides compression and decompression of some file formats used by Microsoft (.cab, .hlp, .chm, compress.exe, etc).</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.oberhumer.com/opensource/ucl/" target="_blank"><font color="#660000">UCL</font></a></td>
            <td valign="top">UCL is a portable lossless data compression library written in ANSI C. UCL implements a number of compression algorithms that achieve an excellent compression ratio while allowing *very* fast decompression. Decompression requires no additional memory.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.artpol-software.com/index_zip.html" target="_blank"><font color="#660000">ZipArchive</font></a></td>
            <td valign="top">Free zip/unzip C-library.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.zlib.net/" target="_blank"><font color="#660000">ZLib</font></a></td>
            <td valign="top">Free zip/unzip C-library.</td>
        </tr>
        <tr>
            <td colspan="2"><a name="freecppgraphicslibraries"></a>&nbsp;</td>
        </tr>
        <tr>
            <th valign="top" colspan="2">Free C++ Graphics and Game Libraries</th>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.amanith.org/" target="_blank"><font color="#660000">Amanith Framework</font></a></td>
            <td valign="top">A cross-platform (Linux, Win32, Mac OX X, FreeBSD, Linux and IRIX) open source C++ framework for 2D and 3D vector graphics that includes 2D curves, a 2D font engine, bitmap vectorizer, tessellator, and an OpenGL extensions manager.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.ogre3d.org/" target="_blank"><font color="#660000">OGRE 3D</font></a></td>
            <td valign="top">Open source 3D-graphics and game engine for Linux, MAC and Windows.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.opengl.org/" target="_blank"><font color="#660000">OpenGL</font></a></td>
            <td valign="top">Excellent high-performance cross-platform 3D graphics library. Elegant API. It can be used for a variety of purposes, such as: animations, virtual reality, game-programming, simulations, etc.</td>
        </tr>
        <tr>
            <td valign="top" nowrap="nowrap"><a href="http://www.oscilloscope-lib.com/" target="_blank"><font color="#660000">Real-Time Oscilloscope<br />DLL Library</font></a></td>
            <td valign="top">Freeware real-time Windows Oscilloscope DLL with an API for C++ , Delphi, MathWorks Matlab and Simulink.</td>
        </tr>
    </tbody>
</table><img src ="http://www.blogjava.net/bluesky/aggbug/42832.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-04-24 14:54 <a href="http://www.blogjava.net/bluesky/archive/2006/04/24/42832.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP文本数据库引擎 </title><link>http://www.blogjava.net/bluesky/archive/2006/04/13/40827.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 13 Apr 2006 02:58:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/04/13/40827.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/40827.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/04/13/40827.html#Feedback</comments><slash:comments>179</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/40827.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/40827.html</trackback:ping><description><![CDATA[<a href="http://www.zengrong.net/25/">http://www.zengrong.net/25/</a><br /><br />
<p><a href="http://chibiguy.dotgeek.org/" target="_blank">txtSQL</a></p>
<ul>
    <li><a href="http://txtsql.sourceforge.net/content/demos/txtSQLAdmin/index.php" target="_blank">txtSQLAdmin</a> </li>
    <li><a href="http://chibiguy.dotgeek.org/docs/index.php" target="_blank">帮助文档</a> </li>
    <li><a href="http://chibiguy.dotgeek.org/pages/benchmarks.php?section=3" target="_blank">测试报告</a> </li>
</ul>
<ol>
    <li>速度快（有四个主要的文本数据库速度比较） </li>
    <li>基本上模拟了SQL的所有语法 </li>
    <li>强大的错误处理 </li>
    <li>完善的帮助文档 </li>
    <li>免费使用 </li>
</ol>
<p><a href="http://www.3ants.org/txtdb/" target="_blank">txtdb</a></p>
<p>国人开发的一个小型文本数据库系统。</p>
<p><a href="http://www.myupb.com/ourscripts_textdb.php" target="_blank">Myupb的TextDB</a></p>
<p><a href="http://www.c-worker.ch/txtdbapi/" target="_blank">txt db api</a></p>
<p><a href="http://sourceforge.net/projects/fsql/" target="_blank">Flat-File SQL</a></p>
<p><a href="http://textdb.sourceforge.net/" target="_blank">TextDB</a> </p><img src ="http://www.blogjava.net/bluesky/aggbug/40827.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-04-13 10:58 <a href="http://www.blogjava.net/bluesky/archive/2006/04/13/40827.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用Maven的顺序</title><link>http://www.blogjava.net/bluesky/archive/2006/03/29/38008.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 29 Mar 2006 03:44:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/03/29/38008.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/38008.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/03/29/38008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/38008.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/38008.html</trackback:ping><description><![CDATA[check-out from cvs first<br /><br />修改修改 project.properties<br /><br />1.create-domain<br />2.create-launcher<br />3.启动weblogic<br />4.deploy-datasource<br />5.deploy<br /><br />ok<br /><img src ="http://www.blogjava.net/bluesky/aggbug/38008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-03-29 11:44 <a href="http://www.blogjava.net/bluesky/archive/2006/03/29/38008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>3月15日工作总结 </title><link>http://www.blogjava.net/bluesky/archive/2006/03/16/35536.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Mar 2006 01:04:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/03/16/35536.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/35536.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/03/16/35536.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/35536.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/35536.html</trackback:ping><description><![CDATA[<p>encountered SQLException [weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool cp_baggage to allocate to applications, please increase the size of the pool and retry..]; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool cp_baggage to allocate to applications, please increase the size of the pool and retry..{ exceptionClass=org.springframework.jdbc.UncategorizedSQLException} </p>
<p><br />服务-&gt;连接缓冲池-&gt;最大容量-&gt;5<br /><br /><br />问一下, after checkout a new project from cvs how to use Maven to deploy the web ear to the weblogic? what is the first,second&nbsp; </p>
<p>copy build.properties.sample to build.properties<br />then modify it to fit your environment. </p>
<p>2. install weblogic plugin for weblogic (if not installed ) by <br />maven plugin:download -DartifactId=maven-weblogic-plugin -DgroupId=footmark-plugins -Dversion=0.1.1 </p>
<p>3. invoking maven weblogic:prepare-domain to prepare weblogic runtime&nbsp; </p>
<p>4.invoking maven:create-launcher to create weblogic launcher which can be used to debug or run weblogic application server&nbsp; </p>
<p>that's all&nbsp; </p>
<p>catch me immediately if you have further more questions. </p>
<p>ok,i see </p><img src ="http://www.blogjava.net/bluesky/aggbug/35536.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-03-16 09:04 <a href="http://www.blogjava.net/bluesky/archive/2006/03/16/35536.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WebErp不错~~</title><link>http://www.blogjava.net/bluesky/archive/2006/03/02/33168.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 02 Mar 2006 04:07:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/03/02/33168.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/33168.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/03/02/33168.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/33168.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/33168.html</trackback:ping><description><![CDATA[<br /><br /><br /><a href="http://www.weberp.org/">http://www.weberp.org/</a>&nbsp;主页<br /><br /><br /><a href="http://sourceforge.net/project/showfiles.php?group_id=70949">http://sourceforge.net/project/showfiles.php?group_id=70949</a><br /><br />sourceforge下载不了,<br />找到了下边的这个链接<br /><br /><a href="http://www.interdynamics.com.tw/webERP_3.04.zip">http://www.interdynamics.com.tw/webERP_3.04.zip</a><br /><br />第一步,安装数据库<br />create database weberp;<br />把sql\mysql\weberp-demo.sql 插入数据库<br /><br />第二步<br />修改config.php<br />数据库用户名密码<br /><br />第三步<br />修改includes/LanguageSetup.php<br />第27行<br />This maybe reqiured in some stubborn installations(写死的设置)<br /><br />&nbsp;$Locale = setlocale (LC_CTYPE, $_SESSION['Language']);<br />&nbsp;$Locale = setlocale (LC_MESSAGES, $_SESSION['Language']);<br />屏蔽掉<br /><br />$Locale = setlocale (LC_ALL, $_SESSION['Language']);<br />打开<br />修改<br />$Locale = setlocale (LC_ALL, $_SESSION['en_US']);<br /><br /><br /><a href="http://edwardleen.minidns.net/weberp/">http://edwardleen.minidns.net/weberp/</a><br />这是人家汉化的,好像没有开源汉化包包~~<br /><img src ="http://www.blogjava.net/bluesky/aggbug/33168.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-03-02 12:07 <a href="http://www.blogjava.net/bluesky/archive/2006/03/02/33168.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>但愿人长久 千里共婵娟</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/31091.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 09:50:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/31091.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/31091.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/31091.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/31091.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/31091.html</trackback:ping><description><![CDATA[<p><strong>本文作者：女子嫣然<br />本文标题：但愿人长久 千里共婵娟</strong></p>
<p>又是一年中秋夜，不知又要惹起世人多少相思愁...... <br />但愿人长长久 千里共婵娟...... </p>
<p>一个人来到这个未知的世上，要经历多少呢？那些曾经经历过的&mdash;&mdash;曾经得到过的、曾经失去的、至今还陪伴在我们身边的。想想吧，前世五百年的回眸才换来今生的擦肩而过，前世千年的等待、千年的柔情啊，才换来对方不知道的片刻温存！！所以，我们该要何等的惜缘啊！不要刻意追求那么多，不要苛求难实现的！就让一切美丽着吧！ </p>
<p>有人说，错过的总是最好的，失去的都是最珍贵的，放弃的都是不忍的。 </p>
<p>有人说，爱，不如相知，与其执著痴念，不如化为祝福。不要让你爱的人，被你的爱所磨蚀；反过来，以你的爱，让他得到力量，展翅高飞！就算分隔两地，心仍会在一起。 </p>
<p>有人说，真正爱一个人，必定以他的幸福，当作是你的幸福。若然有人，能比你给予他更大的幸福，你就把他送到那里去。 </p>
<p>有人说，爱情是个模糊的概念，没有人去测量过爱情的长度。也没有任何人得到过具体的结果。如果假定爱情的全程为1公里。那么爱与不爱的距离只有四分之一米。短暂而遥远的旅途。一堵墙的距离，一堵看不见摸不到却实实在在的存在的墙，夹在爱与不爱之间。爱人就在眼前，但无力去拥抱。爱人就在隔壁，在空气中隔离。半步的距离，那怎么也迈不出去的的半步。爱了，勇敢的去追寻，却碰了壁。不爱，毅然的想离去，发现迷了路。原来爱与不爱同在一个屋檐下，如同长椅两边的坐客，只有短短的隔距，然而好象只是一场巧遇，因为疲惫找寻到同一个歇脚处。离去时相眸一眼，意识到这是莫名的缘分，却走向相反的方向。也许面对爱的时候，不爱就站在背后注视着转身的瞬间，当转身与不爱相视的时候，爱依然伫立，流泪，惋惜&hellip;&hellip;原来爱与不爱之间的四分之一米的距离就是自己的身躯&hellip;&hellip; </p>
<p>只有前世有约的人，今生才能相随。 </p>
<p>这世上有谁在凭栏？盈盈横塘畔的楼台上，倚着朱红的栏杆，不经意却是很美地在笑，这个时候我便想起诗书上的话：巧笑倩兮，美目盼兮。说的，就是我罢？ </p>
<p>这世上，有谁在走？也许，那就是你吧？苍凉景物，滚滚红尘，一袭青衫，奔波在如烟的暮雨中，斜斜的伞，遮着黄昏细雨。一条青色砖石路铺就的深巷，由远及近，独自彷徨在悠长，悠长又寂寥的雨巷，希望飘过一个丁香一样地结着愁怨的姑娘。 </p>
<p>一种无从提问无从回答的感觉。 </p>
<p>是一种预感的实现，是一种冥冥之中的昭示，不曾谋面，又似曾相识。 </p>
<p>是永恒也是刹那，是真实也是虚幻，这世间有我不曾明白的神秘。 </p>
<p>轮回中，终于不期然地遇见。在茫茫人海。心与心之间，一下子就没了距离。 假如有一种时刻觉得美好，那一定是谁穿越时空的祝福。 </p>
<p>缘，不是说来就来，却是说走就走的！所以，隔岸而立，所有的美丽因相望而成缘，所有的无奈因相忘而失缘。我们最终都注定要迷失在永恒的轮回之中。 </p>
<p>只有前世有约的人，今生才能相随。 </p>
<p>菩提树下，也许终于有一天，我们会领悟这 </p>
<p>&mdash;&mdash;如梦的尘缘。 </p>
<p>前世积攒多少次的回眸啊，才能换得相识？甚至相知？甚至相爱？<br /></p><img src ="http://www.blogjava.net/bluesky/aggbug/31091.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 17:50 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/31091.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>刺猬的爱情</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/31070.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 07:47:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/31070.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/31070.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/31070.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/31070.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/31070.html</trackback:ping><description><![CDATA[<p>一 </p>
<p>在一个蓝色的星球上，居住着一群刺猬。一群非常非常聪明的刺猬。他们有自己 的秩序，有自己的文明。在他们的社会里，有一个传统---每一只刺猬都必须经过 &ldquo;成熟的考验&rdquo;，是否合格，是由星球上年纪最大的一只老刺猬来认可的。没有 通过考验的刺猬，会被放逐到星球另一端的沙漠中去生活。 背背一出生，妈妈就告诉了他这个传统，&ldquo;通不过成熟的考验，是不会有出息的 。&rdquo;妈妈这么。背背很好奇，它去问那只老刺猬，&ldquo;老爷爷，什么叫成熟呀？&rdquo; 老刺猬很老了，整个星球上，背背只看见老刺猬的刺是白色的，其他刺猬的刺都 是黑色的。除了背背，背背的刺是蓝色的。老刺猬眯着眼睛，看着背背漂亮的蓝 色的刺说：&ldquo;孩子，成熟这个东西是说不清楚的，只有自己成熟的那天，你才会 懂。&rdquo; &ldquo;那我什么时候才能通过成熟的考验呢？&rdquo;背背一知半解地问。 &ldquo;嗯&hellip;&hellip;孩子，当你的刺变成黑色的时候，再来找我，我会告诉你的。&rdquo;老刺猬 似乎很疲倦，说完就闭上眼睛睡了。 背背不是很懂，但他很快就忘了这件事，开心地在树林里玩起来。</p>
<p>&nbsp;二 </p>
<p>背背长得很快，他的刺仍然是蓝色的。他偶尔也会看到别的小刺猬的刺不是黑色 ，但他们总是很快就变成了黑漆漆的。背背有时候挺担心的，但他只要一看到晴晴的天、白白的云、绿色的树林、跳跃的小鸟就会把一切烦恼忘个一干二净，他喜欢 自由，热爱生命。背背觉得每一天都是充满希望的，什么事也不用担心。背背总 是一个人跑到树林里晒着阳光，一边唱着好听的歌，一边在草地上打滚。好快乐 地过一整天。虽然每次他这样开心地回家总会被妈妈骂，但背背还是偷偷地乐着 ，他不明白为什么妈妈总是不喜欢他做这些快乐的事，也不明白为什么每次妈妈 的眼里都会有那么担忧的眼神。背背不管，背背觉得生命那么美好，怎么可以不 快乐的过呢？ 一天又一天，背背仍然是一只漂亮的蓝色的刺猬。快乐的小刺猬。 </p>
<p>三 </p>
<p>背背恋爱了。背背爱上了一只叫晶晶的小刺猬，晶晶很爱听背背唱歌，每次背背 坐在晶晶身边唱起为她写的歌，晶晶就会微笑着梳自己乌黑乌黑的刺，陪背背一 起享受自由的空气。 晶晶第一次对背背说我爱你的那一个晚上，背背兴奋得一夜没睡。 可是晶晶有时候很烦恼，因为她和背背都没有通过成熟的考验，她可不想到星球 另一头的沙漠里去生活，她很担心。可背背不，背背觉得只要能和晶晶在一起， 无论在哪里都是幸福。晶晶为此会跟背背吵架，背背每次都很难过，因为他爱晶 晶，他不想晶晶烦恼，可是他认为晶晶不该把成熟看得比他们的爱情还重要。背 背相信晶晶是真的爱他，所以他把一生一世都放到了这场爱情里。 然而，他们的爱情还有更严重的问题。 </p>
<p>四 </p>
<p>背背和晶晶都是刺猬。他们的身上都长满了会伤人的刺。每一次他们紧紧拥抱的 时候，都会刺伤对方。可是背背和晶晶不怕，他们年轻，他们不怕痛，只怕失去 爱情。于是他们一次又一次紧紧拥抱，一次又一次给彼此留下伤口。 背背很心疼，背背不愿伤害晶晶。而且晶晶因为成熟的考验，最近一直不开心。 背背决定为晶晶做一件事。背背为了晶晶，愿意做任何事。 在一个浓浓大雾的深夜，背背咬着牙，一根一根，把自己身上漂亮的蓝刺，全都 拔了下来。好痛啊。但背背不哭。背背是一只勇敢的小刺猬。 第二天，背背就这样***露着身体去找晶晶。晶晶看见背背在风里瑟缩的样子，心 疼地哭了好久。背背却笑着，因为他再也不会刺伤晶晶了。 他们又一次紧紧拥抱。 </p>
<p>五 </p>
<p>背背被刺伤了，伤得很重。因为他太用力地抱紧晶晶，可是他忘了晶晶身上浓密 的刺。背背被幸福之后跟随而来的巨大痛苦惊呆了，但背背仍然紧紧拥着晶晶， 因为晶晶还在流泪，因为背背宁愿被刺伤，也不愿意放开手，因为背背等这一天 等了好久，等这一次不会伤到晶晶的拥抱等了好久。背背只要晶晶幸福，背背心 甘情愿地承受这痛楚。可是晶晶流着泪，用力地，放开了手。 晶晶很爱背背，但她再不愿意彼此伤害。背背为了她去掉了所有会伤害她的刺， 背背对爱情的执着真的让她好感动，但晶晶无法做到，晶晶从来也不曾想过要拔 掉身上的刺，那该有多疼啊！晶晶觉得这段爱情太痛苦，晶晶流着泪，用力地， 放开了手。 背背失去了他一生中最深爱的女子。 </p>
<p>六 </p>
<p>在那一天夜里，背背默默地，找出他所有蓝色的刺。背背用黑色的漆把刺漆成黑 色，重新按到自己身上，黑色的刺刺破伤口，比拔下来的时候更痛。背背按回一 根刺，就回忆起一天和晶晶一起度过的日子，每回忆到一次快乐的往事，就流一 滴泪。无声地哭泣。背背照着镜子，已经认不出自己。他只觉得全身无力，他睡 下、梦醒、哭泣，再睡、再梦、再醒、再哭。 背背的泪，流了一整夜。全身都湿了，心也湿了。背背变成了一只黑色的刺猬。 一只伤心的刺猬。 </p>
<p>七 </p>
<p>背背又去找那只老刺猬。 路上，他听说，晶晶已经通过了成熟的考验。背背见到了老刺猬，老刺猬看着背 背乌黑的刺，对背背说：&ldquo;你已经成熟了，孩子。你通过了成熟的考验。&rdquo; 每一只刺猬都来祝贺背背，背背知道晶晶不会来，可是背背仍然等了很久。 然后背背心底痛着向大家微笑，大家都很高兴地看着背背伪装的快乐。&ldquo;这孩子 将来一定会有出息的。&rdquo;每一只成熟的刺猬都这么说。 于是背背懂了。 终于懂了成熟是怎么一回事。也终于明白了成熟的代价。 </p>
<p>八 </p>
<p>成熟，为了成熟，必须要放弃很多东西。甚至爱情，甚至快乐。 你懂了吗？ 如果你觉得背背的故事是胡说八道，那么你已经通过了成熟的考验。如果你觉得 和背背一样的忧伤，那你可要小心了，千万不要拔掉自己身上的刺。 刺猬和刺猬之间，还是有点距离的好。<br /></p><img src ="http://www.blogjava.net/bluesky/aggbug/31070.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 15:47 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/31070.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《我不会为你去摘悬崖上的花》</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/31065.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 07:25:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/31065.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/31065.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/31065.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/31065.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/31065.html</trackback:ping><description><![CDATA[<span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">某天</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">...<br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">女孩终于鼓起勇气对男孩说：「我们分手吧」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">男孩问：「为什么？」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">女孩说：「倦了，就不需要理由了」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">一个晚上</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">男孩只抽烟不说话</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">女孩的心也越来越凉</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">『连挽留都不会表达的情人</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">能给我什么样的快乐？』</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">过了许久</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">男孩终忍不住说：「怎么做你才能留下来？」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">女孩慢慢地说：</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">「回答一个问题，如果你能答到我心里就答案，我就留下来。」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br />................................<br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">「比如我非常喜欢悬崖上的一朵花，而你去摘的结果是百分之百</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">的死亡，你会不会摘给我？」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">男孩想了想说：「明天早晨告诉你答案好吗？」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">女孩的心顿时灰了下来</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br />...........................................<br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">早晨醒来，男孩已经不在</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">只有一张写满字的纸压在温热的牛奶杯下</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">第一行，就让女孩的心凉透了</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">「亲爱的，我不会去摘</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">但请容许我陈述不去摘的理由</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">你只会用电脑打字</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">却总把程序弄得一塌糊涂</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">然后对着键盘哭</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我要留着手指给你整理程序</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">你出门总是忘记带钥匙</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我要留着双脚跑回来给你开门</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">酷爱旅游的你</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">在自己的城市里都常常迷路</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我要留着眼睛给你带路</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">每月（亲密好朋友）光临时</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">你总是全身冰凉，还肚子疼</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我要留着掌心温暖你的小腹</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">你不爱出门</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我担心你会患上自闭症</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我要留着嘴巴躯赶你的寂寞</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">你总是盯者电脑</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">眼睛给糟蹋得已不是太好了</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我要好好活着</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">等你老了</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">给你修剪指甲</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">帮你拔掉让你懊恼的白发</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">拉着你的手</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">在海边享受美好的阳光和柔软的沙滩</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">告诉你一朵朵花的颜色</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">像你青春的脸</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&hellip;<br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">所以</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">在我不能确定有人比我更爱你以前</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我不想去摘那朵花</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&hellip;</span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">（女孩泪滴在纸上</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">形成晶莹的花朵）</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">抹净眼泪，女孩继续往下看：</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">「亲爱的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">如果你已经看完了</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">答案还让你满意的话</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">请你开门吧</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我正站在门外</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">手里提着你最喜欢吃的鲜奶面包</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&hellip;</span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">」</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">女孩拉开门</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">看见他的脸</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">紧张得像个孩子</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">只会把拧着面包的手在她眼前晃</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br />...............................<br /><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">我想这就是爱情或者生活</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">被幸福平静的包围时</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">一些平凡的爱意</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">总被渴望激情和浪漫的心忽略</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">爱！在双方引起的许多个微不足道的动作里，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">从来就没有固定的模式</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">只有爱</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">可以是任何一中平淡无奇的形式</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">花朵、浪漫</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">不过是浮在生活表面的浅浅点缀</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">在它们的下面才是我们真真的生活。</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><br /><br />.........................<br /><br /><br /></span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">爱</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">......</span><span style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">平平淡淡才是真</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: brown; LINE-HEIGHT: 200%; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">~~~~~~~~~</span><img src ="http://www.blogjava.net/bluesky/aggbug/31065.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 15:25 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/31065.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>给失落的朋友打气</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/31063.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 07:22:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/31063.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/31063.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/31063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/31063.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/31063.html</trackback:ping><description><![CDATA[<p>国王有七个女儿，这七位美丽的公主是国王的骄傲。<br />&nbsp;<br />她们那一头乌黑亮丽的长发远近皆知。<br />所以国王送给她们每人一百个漂亮的发夹。 </p>
<p>有一天早上，大公主醒来，一如往常地用发夹整理她的秀发，却发现少了一个发夹， <br />于是她偷偷地到了二公主的房里， 拿走了一个发夹。 <br />二公主发现少了一个发夹， 便到三公主房里拿走一个发夹； <br />三公主发现少了一个发夹， 也偷偷地拿走四公主的一个发夹； <br />四公主如法炮制拿走了五公主的发夹； <br />五公主一样拿走六公主的发夹； 六公主只好拿走七公主的发夹。 <br />于是，七公主的发夹只剩下九十九个。 <br />隔天，邻国英俊的王子忽然来到皇宫， <br />他对国王说：「昨天我养的百灵鸟叼回了一个发夹， <br />我想这一定是属于公主们的，而这也真是一种奇妙的缘分， <br />不晓得是哪位公主掉了发夹？」 <br />公主们听到了这件事， 都在心里想说：「是我掉的，是我掉的。」 <br />可是头上明明完整的别着一百个发夹，所以都懊恼得很， 却说不出。 <br />只有七公主走出来说：「我掉了一个发夹。」 <br />话才说完，一头漂亮的长发因为少了一个发夹， <br />全部披散了下来，王子不由得看呆了。 </p>
<p><br />故事的结局， 想当然的是王子与公主从此一起过着幸福快乐的日子。 </p>
<p>为什么一有缺憾就拼命去补足？ <br />一百个发夹，就像是完美圆满的人生，少了一个发夹， <br />这个圆满就有了缺憾； <br />但正因缺憾， 未来就有了无限的转机，无限的可能性， <br />何尝不是一件值得高兴的事！ <br />人生不可免的缺憾，你怎样面对呢？ <br />逃避不一定躲得过 <br />面对不一定最难受 <br />孤单不一定不快乐 <br />得到不一定能长久 <br />失去不一定不再有 <br />转身不一定最软弱 <br />别急着说别无选择 <br />别以为世上只有对与错 <br />许多事情的答案都不是只有一个 <br />所以 ~ 我们永远有路可以走 <br />你能找个理由难过 你也一定能找到快乐的理由 <br />懂得放心的人找到轻松 <br />懂得遗忘的人找到自由 <br />懂得关怀的人找到朋友 <br />天冷不是冷 心寒才是寒 愿你的心都是暖暖的.... <br />人的长大伴随着一些失落,人的成熟附带着一些伤痕. <br />好在有希望这东西,你总还可以去等； <br />好在人与人之间，距离产生美感； <br />好在生命里,快乐比痛苦多； <br />好在这个世界,还有很多美丽； <br />好在当你成熟的时候，你还不算一无所有！</p><img src ="http://www.blogjava.net/bluesky/aggbug/31063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 15:22 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/31063.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>计算机组成原理讲稿( 概述)</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/30915.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 02:10:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/30915.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30915.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/30915.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30915.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30915.html</trackback:ping><description><![CDATA[<p>计 算 机 组 成 原 理 讲 稿<br />主 讲：王健<br /><a href="http://www.seuyc.com.cn/course/kcjg/jsjzcyl/jsjzz.htm">http://www.seuyc.com.cn/course/kcjg/jsjzcyl/jsjzz.htm</a></p>
<p>第一章&nbsp;&nbsp;&nbsp;&nbsp; 概述 <br />1.计算机由运算器、存储器、控制器和输入/输出五个部件组成。<br />2.冯&middot;诺依曼计算机的主要特点： <br />1）计算机由运算器、存储器、控制器和输入/输出五个部件组成。 <br />2）存储器以二进制形式存储指令和数据； <br />3）存储程序工作方式； <br />4）五部件以运算器为中心进行组织；</p>
<p>第2章&nbsp; 数据的表示<br />1.在计算机系统中，凡是要进行处理（包括计算、查找、排序、分类、统计、合并等）、存储和传输的信息，都是用二进制进行编码的。 <br />2.进位计数制及其各进位制数之间的转换<br />3.定点与浮点表示的方法、特点 <br />4.机器数的三种编码表示方式：原码、补码和反码。&nbsp;&nbsp;&nbsp;&nbsp; 定义、特点、用途。<br />5.浮点数的编码表示及规格化<br />6.十进制数的二进制编码表示即 BCD码的特点 <br />7.字符及汉字的编码方法、特点 <br />8.音频、视频的编码方法及特点<br />9.数据校验码的用途</p>
<p>第3章 运算器与运算方法<br />1. 运算器基本组成和功能<br />2.半加器与全加器的逻辑设计<br />3.串行进位与并行进位的比较<br />4.补码定点加、减法<br />5.原码一位乘法<br />6.补码一位乘法<br />7.浮点加、减法</p>
<p>第4章&nbsp; 存储系统 <br />1.存储器的主要性能指标<br />2.存储系统的层次结构<br />3.半导体读写存储器RAM芯片的结构、组成及存储器系统的构成<br />4.半导体只读存储器的特点及分类<br />5.高速缓冲存储器Cache的工作原理、映射方式、替换算法，了解Pentium Cache 结构和Power PC Cache 结构。 <br />. 虚拟存储器的功能、基本管理方法、结构7.磁表面存储器的性能指标、硬磁盘存储器的基本组成、信息分布、硬盘容量和数据传输率的计算</p>
<p>第5章&nbsp; 指令系统 <br />1. 指令格式、指令长度 <br />2.常用的寻址方式种类、特点、用途 <br />3.指令系统的地位、作用，指令类型 <br />4.堆栈的定义、用途和堆栈存取方式 <br />5. CISC与RISC指令各自的特点和比较</p>
<p>第6章&nbsp; 中央处理机组织 <br />1. CPU的组成与操作（单总线组织的数据通路及四种基本功能。<br />2.控制器三种时序控制方式：同步、异步和联合控制方式。<br />3.三种时序信号周期、节拍和脉冲的概念、作用<br />4.控制器的组成和功能<br />5.一条完整指令执行的控制步序列<br />6.决定CPU性能最重要的三个因素：指令的功能强弱、时钟周期的长短、执行每条指令所需时钟周期数。<br />7.指令流水的概念<br />8.组合逻辑控制器的构成与设计步骤<br />9.微程序控制器的原理、基本概念、基本组织和工作流程 <br />10.微指令的两种格式与3种编码<br />11.两种微指令地址的生成方法<br />12.微程序控制器和组合逻辑控制器的比较</p>
<p>第7章&nbsp; 总线及总线互连结构 <br />1.总线的基本概念、作用和分类<br />2.总线的两种传输方式--串行和并行的特点<br />3.总线裁决的意义及分类<br />4.总线定时方式的分类及特点<br />5.影响总线带宽的因素<br />6.单总线结构和多总线分层结构的比较</p>
<p>第8章&nbsp; 输入输出设备</p>
<p>第9章 输入输出组织 <br />1. I/O接口的功能、结构和分类<br />2. I/O端口编址的两种方法的比较<br />3. 四种I/O数据传送控制方式的比较<br />4.程序查询方式的特点<br />5.中断的概念、分类、中断优先级，开关中断和中断屏蔽<br />6.中断过程：中断响应和中断处理<br />7.中断系统的基本结构和功能 <br />8.中断嵌套和向量中断 <br />9.DMA方式的概念和适用范围<br />10.DMA方式和中断方式的比较<br />11.DMA方式的概念和适用范围<br />12.三种DMA方式的特点<br />13. DMA接口的结构和功能<br />14.通道的基本概念、用途和分类</p>
<p>第一章&nbsp;&nbsp;&nbsp;&nbsp; 概述 </p>
<p>计算机是一种能对数字化信息进行自动高速运算的通用处理装置。</p>
<p>1．1&nbsp; 计算机的定义和特性 信息&nbsp; 运算&nbsp; 处理</p>
<p>1.1.1 什么是计算机 <br />1.1.2 计算机的特性 <br />计算机的特性可以归纳为高速、通用、准确、 智能四大特性。</p>
<p>1．2&nbsp; 计算机的发展历程 <br />1.2.1 电子计算机的诞生 <br />第一台电子计算机ENIAC（Electronic Numerical&nbsp; Integrator and Computer）于1946年在美国诞生。 <br />①每秒5000次加法运算；<br />②每秒50次乘法运算； <br />③平方和立方计算； <br />④Sin和Cos函数数值运算；<br />⑤其它更复杂的计算。&nbsp; </p>
<p>1.2.2&nbsp; 第一代计算机&nbsp;&nbsp; （20世纪40年代中到50年代末） <br />第一代计算机为电子管计算机，其逻辑元件采用电子 管，存储器件为声延迟线或磁鼓，典型逻辑结构为定 点运算。<br />计算机&ldquo;软件&rdquo;一词尚未出现，编制程序所用 工具为低级语言。 </p>
<p>1.2.3&nbsp; 第二代计算机（50年代中后期到60年代中） <br />第二代计算机为晶体管计算机。这一代计算机除了逻 辑元件采用晶体管以外，其内存储器由磁芯构成，磁 鼓与磁带成为外存储器。</p>
<p>计算机典型逻辑结构实现了浮点运算， 并提出了变址、中断、I/O处理等新概念。 <br />计算机软件也得到了发展，出现了多种 高级语言及其编译程序。</p>
<p>1.2.4 第三代计算机（60年代中到70年代中） <br />第三代计算机为集成电路计算机，其逻辑元件与存储器 均由集成电路实现，这是微电子与计算机技术相结合的 一大突破。<br />微程序控制、高速缓存、虚拟存储器、流水 线等先进计算机技术开始使用。另一大特点是大型/巨 型机与小型机同时发展。</p>
<p>1.2.5 第四代计算机（70年代中期开始&mdash;） <br />大规模（LSI）和超大规模（VLSI）集成电路 及微处理器为这一代计算机的典型特征。<br />并行处理技术的研究与应用以及众多巨型机的产生也成 为这一时期计算机发展的特点。 <br />四代机时期的一个重要特点是计算机网络的发展与广泛 应用。 </p>
<p>1.2.6 新一代计算机 新器件和非冯&middot;诺依曼结构已成为新一代计算机的公认标志。</p>
<p>1．3&nbsp; 计算机的组成与结构 </p>
<p>1.3.1 计算机系统的层次结构 </p>
<p>6应用系统算法和数字模型<br />---------------------<br />5各种应用程序<br />---------------------<br />4高级程序编译,解释程序<br />---------------------<br />3操作系统<br />---------------------<br />2指令系统<br />---------------------<br />1微程序控制,PLA控制<br />---------------------<br />0逻辑硬件</p>
<p>1.3.2 计算机硬件<br />计算机硬件是指构成计算机的元器件、 部件、设备、以及它们的设计与实现技术。 <br />冯&middot;诺依曼计算机的主要特点： 1）计算机由运算器、存储器、控制器和输入/输出五个&nbsp;&nbsp;&nbsp; 部件组成。</p>
<p>本书讨论的范围涉及第0、1、2共3层， 主要内容如下： <br />1. 高速的算术、逻辑运算方法及ALU的&nbsp;&nbsp;&nbsp; 逻辑设计； <br />2. 高速的指令执行过程及指令部件的设计与实现，&nbsp;&nbsp;&nbsp; 是采用组合逻辑技术、或微程序设计技术，还是&nbsp;&nbsp;&nbsp; PLA技术；<br />是复杂指令集计算机（CISC），还是&nbsp;&nbsp;&nbsp; 精简指令集计算机（RISC）； <br />3. 提高存储器容量与速度的方法，以及如何解决&nbsp;&nbsp;&nbsp; &ldquo;CPU-Cache-MM-外存&rdquo;之间的匹配问题； <br />4. 高效率的输入/输出方法、组织，以及它们之间的&nbsp;&nbsp;&nbsp; 互联技术； <br />5. 计算机五大部件（运算器、控制器、存储器、输入&nbsp;&nbsp;&nbsp; 和输出）之间的相互作用、高效接口（总线）；</p>
<p>2）存储器以二进制形式存储指令和数据； <br />3）存储程序工作方式； <br />4）五部件以运算器为中心进行组织；</p>
<p>1.3.3 计算机软件 <br />1. 软件的作用 <br />一般来说，计算机的工作总是由存储程序来控制的。 </p>
<p>软件的具体作用为：<br />①在计算机系统中起着指挥和管理的作用。 <br />②是计算机用户和硬件的接口界面。 <br />③是计算机体系结构设计的主要依据。</p>
<p>2. 软件的发展过程 三个阶段： <br />1)从第一台计算机上的第一个程序出现到 实用的高级语言出现为第一阶段（1946-1956年）。 <br />2)从实用的高级程序设计语言出现到软件工程出现 以前为第二阶段（1956-1968年）。 <br />3)软件工程出现以后迄今一直为第三阶段（1965&mdash;）。 </p>
<p>3. 软件的分类 <br />① 系统软件：操作系统、编译程序。 <br />② 支撑软件：数据库、各类接口软件和工具组。 <br />③ 应用软件： </p>
<p>1．4&nbsp; 计算机的分类与应用 <br />1.4.1 计算机的分类 <br />按计算机所处理对象的表示形式不同可以&nbsp;&nbsp;&nbsp;&nbsp; 分成模拟计算机与数字计算机两类。 <br />计算机按其用途来分可以分成专用机和通用机两类。<br />其中，通用计算机按其规模、性能和价格来分，又可分为巨型机、大型机、小型机、工作站、微型机等多种类型。</p>
<p>1.4.2 计算机应用 计算机信息处理技术包括了对各种信息媒体的获取、 表示、加工与表现方法和技术，大致有以下几个方 面内容： <br />1．语言与文字的处理。 <br />2．计算机图形学与数字图象处理。 <br />3．多媒体技术。<br />4．计算机辅助技术。 <br />5．计算机信息系统。 <br />6．计算机控制。 计算机应用技术的发展方向为集成化、网络化、智能化</p>
<p><br /></p><img src ="http://www.blogjava.net/bluesky/aggbug/30915.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 10:10 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/30915.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《微机原理与应用》考试大纲</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/30910.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 01:38:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/30910.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30910.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/30910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30910.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30910.html</trackback:ping><description><![CDATA[<p>一、课程内容 </p>
<p>&nbsp;</p>
<p><br />第一章 导论 </p>
<p>&nbsp;</p>
<p><br />第一节：数据的表示与运算。</p>
<p>第二节：微机的基本工作原理及结构。</p>
<p>第三节：微处理器概述。</p>
<p>第二章 8086/8088微处理器 </p>
<p>&nbsp;</p>
<p><br />第一节：微处理器的内部结构及引脚功能。</p>
<p>第二节：微机存储器组织及分段。</p>
<p>第三节：总线结构与总线周期。</p>
<p>第三章 8086/8088指令系统 </p>
<p>&nbsp;</p>
<p><br />第一节：八种寻址方式（立即寻址、直接寻址、寄存器寻址、寄存器间接寻址、寄存器相对寻址、基址变址寻址、基址变址且相对寻址、隐含寻址）</p>
<p>第二节：六类指令系统（数据传输指令、算术运算指令、逻辑运算与移位指令、串操作指令、</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 程序控制类指令、处理器控制指令）</p>
<p>第四章&nbsp;&nbsp;&nbsp; 汇编语言程序设计 </p>
<p>&nbsp;</p>
<p><br />第一节：汇编语言基本概念（语句结构、伪指令、运算符、宏指令、源程序结构等）</p>
<p>第二节：汇编语言程序设计方法（了解汇编语言程序设计的一般步骤,掌握顺序、分支、循环、</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 子程序调用等汇编语言程序设计方法。）</p>
<p>第五章&nbsp;&nbsp;&nbsp; 存储器 </p>
<p>&nbsp;</p>
<p><br />第一节：存储器分类及主要性能指标。</p>
<p>第二节：RAM、ROM简介。</p>
<p>第六章&nbsp;&nbsp; 输入输出与中断系统 </p>
<p>&nbsp;</p>
<p><br />第一节：接口概念、作用和编址方法。</p>
<p>第二节：输入输出传送方式（程序传送方式、中断方式、DMA方式）</p>
<p>第三节：8086/8088中断系统。</p>
<p><br />&nbsp;</p>
<p><br />参考书目： </p>
<p>&nbsp;</p>
<p><br />1．李伯成，侯伯亨，张毅坤.《微型计算机原理及应用》.西安：西安电子科技大学出版社. 1998年第1版. </p>
<p>&nbsp;</p><img src ="http://www.blogjava.net/bluesky/aggbug/30910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 09:38 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/30910.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>中国街头骗术大全（转贴）</title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/30898.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 00:47:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/30898.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30898.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/30898.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30898.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30898.html</trackback:ping><description><![CDATA[骗术一：通常是一男一女带个小孩，遇到模样老实的 (比如我)，上前说，钱丢了，没钱回家，给几块钱坐车吧。还有说是来深圳找亲戚，没找着，钱用光了，给几块钱给他们买点吃的。第一次遇到这种骗术往往容易上当，我在大学时就上当过。骗子骗了几块钱，马上又去骗别人。在深圳路边遇到过多次，广州一般出现在好又多，万佳等超市附近。<br />　　<br />　　　　<br />　　<br />　　　　骗术二：路边某个青年男子，带着个包，坐在地下，用粉笔在地下写一些什么&ldquo;找不到工作，太饿了，请好心人给点钱买东西吃&rdquo;。一样是骗子，如果到深圳、广州所有地方走一圈，保证可以找到上百个这样的骗子。<br />　　<br />　　　　<br />　　<br />　　　　骗术三：大学时室友遇到过一次，来深圳后本人遇到过三次。大概流程是这样的：当你从银行取钱出来，或者到邮政局存钱的话，旁边会有两个串通好的男子，一个假装把一捆钱丢在地上，往前走，后面的骗子故意在你面前将钱捡起来，然后把你拉到一边，把捡到的那叠钱放到你身上。而前面丢钱的骗子则返回，问后面的骗子是否捡到了钱，并且要后面的骗子搜身。后面的骗子说没有，然后把你拉到一边，说捡到的钱平分，现在钱在你身上，我现在跟他去搜身，我怕你在我去搜身后逃之夭夭，所以你要把你身上的部分钱押在我这里。如果你真的将你自己的部分钱押给他们，就再也找不到人了。你打开那捡到的一叠钱，会发现，表面是一张人民币，里面全是白纸。<br />　　<br />　　　　　　<br />　　<br />　　　　骗术四：就是手机短消息了，说什么你中了。。。。奖(比如笔记本电脑)云云，而你如果一个电话打过去，她们会叫你将钱寄到某个帐号，说是奖品的邮寄费。而你真的相信了，寄出去的钱就如同石沉大海。<br />　　<br />　　　　<br />　　<br />　　　　骗术五：路边的押注。几个碗倒盖地下，骗子凭借很快的手法，将一粒棋子放在某个碗下，让你去猜。如果你押50元，猜中了他倒赔你50，猜错了这50元就输了。这样的骗子，往往会有一群骗子来故意充当观众，起哄或者押钱。最近广州太平洋电脑城附近很多。<br />　　<br />　　　　<br />　　<br />　　　　骗术六：想起一个行骗的例子，尤其逢年过节，大家要警惕。我遇到一次，还真的上当了。－－有一个人抗一袋米，然后敲你家门，一张口就说：有一个60 多岁的老太太在我们店买了米，让我先送过来，她还要去其他地方买东西。米50块还没给。我当时心里觉得挺奇怪，我妈没这么老吧？？后来想想可能显老，而且又有这么一袋米，就给了钱。老妈回来一问，才知道上当受骗了。而且米很次，最多也就30搞定。这个骗术比较隐蔽。大家小心。<br />　　<br />　　　　<br />　　<br />　　　　骗术七：坐车去广州,半路上来一家伙,说自己做铅笔生意的,在车上跟别人攀谈,然后开始赌,手上拿红蓝铅笔各一枝,猜橡皮圈套在那枝铅笔上.亲眼看见我旁边那家伙把手表也输了.快到广州,开始参与赌的人全下了车,才知道是骗局.<br />　　<br />　　　　<br />　　<br />　　　　骗术八：还有一种，就是路上卖水果或者别的什么的，当你买他东西的时候，他会找你换钱。他零钱换成整钱。说零钱太多不好放。然后在数钱给了你的时候就少给你一张。如果你自己不细心，看着他明明数了十张给你，你自己一数就只有9张了。<br />　　<br />　　　　　　<br />　　<br />　　　　骗术九：今天坐公车,到站开门后,一个男人突然堵住车门说自己手机不见了,不让人下车.人群哗然.这时旁边有人说打那个男人的手机,看在谁身上响谁就是贼.这个男人就向边上的一个人借了手机要拨自己的号码,突然*近门口的一个人拔腿挤下车就跑,这个男人也没还人家的手机就叫嚣着追了过去,转眼都不见了.于是,这次真的有人丢了手机.....<br />　　<br />　　　　<br />　　<br />　　　　骗术十：还是几年前,我们住在NC的时候.就我家婆一人在家,也是一个男的敲门,说是**(我LG的名字)的同事,刚从上海出差回来,LG托他带了双皮鞋,380元,他现在要去办事身上带的钱不够, 叫家婆能不能先把钱给他,并拿出一双包装的很漂亮的鞋子,家婆说没那么多钱,刚好我媳妇快下班了,你就等一下吧.那人一听,赶紧说去LG单位找他就走了. 幸亏没上当,不过也挺险的,家婆随便让陌生人进门,要是强盗就完了.<br />　　<br />　　　　<br />　　<br />　　　　骗术十一：这是本人亲历。前两天晚上打的，从罗湖到福田一共花了二十多块吧，我给了一张一百块的给司机，他掏摸了半天，说没有零钱，要我凑零钱给他。我大惑问&ldquo;你干了一天怎么一百块都找不开&rdquo;。但我还是凑够零钱给他了，他就把一百块还给我。我一拿过手，大怒：&ldquo;你小子找死呀！&rdquo;，那小子赶快换了一张给我。嘿，那小子竟然偷龙转凤，给了我一张假钞。他不知道，我刚刚给他的那一张是我半个小时前才从提款机摁出来的，全新的。要不，还真给他蒙了。后悔没留意他的车牌，只知道是湖南攸县人<br />　　<br />　　　　<br />　　<br />　　　　骗术十二：和同事去服装店，同事看好了一衣服，很大方的将百元大钞递过去，自己却还站在镜子前比试比试，这时，服务小姐说话了：小姐，麻烦换一张，这张是假钞。我俩纳闷，我们刚从银行取的钱呢（那时还未听说过银行会出假钞），我们接过钱看了看，很镇静地说&ldquo;小姐，别骗了，不然我们报警了，我们刚发工资，钱的号码是都连在一起的&rdquo;，然后我们拿出荷包中所有的钞票，我还将号码念出来了（其实我当时就记下了那张钞票号码），小姐可能心虚，就将另张钞票退给了我们，还白送了我们一件衣服，哈，幸好我俩聪明，下次遇上这样的骗子，大家可以效仿。<br />　　<br />　　　　<br />　　<br />　　　　骗术十三：在路上遇到一个人，问一条较偏的路，然后说车子开不进去了，要你帮忙看一下车上的货，他去接人来卸货。如果你答应了，你就准备着上当吧。因为，你在守货时，会有有来将车开车，说是那人要他们来的，车刚走，那人和一大帮人就过来找你麻烦了，如果不拿出你身上的钱，你是走不掉了。<br />　　<br />　　<br />　　<br />　　　　骗术十五：在路上要有人问你银行怎么走,别搭理他, 他下一句肯定是问如何将手中外汇换成人民币,再后面就有骗子的同伙过来,不知不觉掉进一个骗局;或者在银行门口,有人问你换外汇的事,千万别理.这种骗局经常是天衣无缝,我一个朋友被骗走好几十万,平时看这小子还挺聪明的,也不贪财,可就是上当了,道高一尺,魔高一丈.听公安局的讲,在广东某镇,有好几千人在外从事这种骗术,做案后就换地方,很难抓到.<br />　　<br />　　　　<br />　　<br />　　　　骗术十六：在人来人往，热闹非凡的商铺，大家迫不及待地想快点买了东西就走，商家利用顾客这样的心理，当找回散钱时，竟会在其中夹着十元钱的假币！细心一点的顾客或许能发现什么，但很多人只是瞄一眼就走人了，哎，我就是差点上了那黑心老板的当！！！还好及时拿回了真家伙！各位女士们先生们购物时千万要留意哦！！！<br />　　<br />　　　　<br />　　<br />　　　　骗术十七：我前几天也给人骗了，不过有点无所谓而已，有一男一女学生模样来我家（梅林）推销洗发水，说是刚毕业的深圳大学国际贸易的学生，当时我们俩都在家里，我是深圳大学毕业的，我老婆也是深圳大学毕业的，而且我老婆还是国际贸易的，那个男的当时有点傻了，后来有点苦苦哀求的味道，看他们那么可怜我也就买了他们的产品（说家乐福要买140）给我30，呵呵，可能不好意思给我揭穿吧，骗少一些，我也无所谓，就给了他们30元，按照他们说的家乐福会上市这些洗发水，到现在也没有看到，呵呵，还是给他骗了.<br />　　<br />　　　　　　<br />　　<br />　　　　骗术十八：深圳华为一员工在外地出差的时候，收到深圳的一部手机发送的短信息：&ldquo;请注意：我们将连续六小时内不断地拨打你的电话，请作好心里准备。你可以选择关机，谢谢！&rdquo;在收到这条短信息后，便有一部深圳的小灵通不打来电话，康＊＊一接听，对方就说：&ldquo;我们将在六小时内连续不停拨打你的电话，你可以选择关机&ldquo;。康＊＊问对方为什么这样做，对方回答说是测试；问对方是什么单位，对方不回答，然后挂机。此后，康大约每分钟接到一次由这部小灵通打来的电话，康＊＊每次接听，对方就叫他关机。对方不断地拨打，康＊＊终于不堪忍受，只好关机。就在关机之后不大一会儿，康远在成都的家属打他的另外一部手机，说有人打电话到家里。来电人声称是华为公司人员，有关于康＊＊的急事找他的父母。康＊＊不解，于是向安全管理部总控中心员工求助热线求助。这是一起典型的诈骗未遂案件，其诈骗方法：犯罪嫌疑人狂打当事人的电话，当当事人不堪忍受而关机或拔线（固定电话），然后，犯罪嫌疑人将打电话给当事人的亲友，称当事人突发事故正在抢救，请对方立即汇多少钱到某某帐号，并声称，如果在多长时间内收不到钱将停止抢救。这时，接到电话的亲友会在第一时间内打当事人的电话，而当事人的电话恰恰因前述原因而关机或无法接听这恰恰佐证了当事人出了事故的&ldquo;事实&ldquo;，&ldquo;救人&ldquo;心切的亲友往往因此而上当。启发及忠告：<br />　　<br />　　　　<br />　　<br />　　　　1、当您碰到类似的事情时，请不要慌张，您可以在电话中主动揭穿犯罪嫌疑人的伎俩，以免对方心存幻想而不断来电骚扰。<br />　　<br />　　　　<br />　　<br />　　　　2、立即打电话给自已的亲友，告之此类事件的真伪，提醒亲友切勿上当受骗<br />　　<br />　　　　针对员工的几点预防措施：<br />　　<br />　　　　<br />　　<br />　　　　1、牢记公司24小时应急求助电话，并知会你的家人，任何有需要时均可电话求助，安全管理部会在第一时间受理并调动相关资源处理；<br />　　<br />　　　　2、及时更新你在公司《电话号码查询系统》中的记录，包括手机号码、办公电话及部门信息，这是安全管理部与你联系的主要利用平台；<br />　　<br />　　　　3、及时更新你在公司的人事档案，紧急情况下，安全管理部可以通过SAP系统查询你的相关信息，包括家庭住址及电话。<br />　　<br />　　　　　　<br />　　<br />　　　　骗术十九：2003年02月21日傍晚18：00左右，某公司一员工行走在广州市北京路步行街上,马路边的众多推销人员不断向其递来传单或宣传资料；某员工出于礼貌便接了几张传单，但当其拿着那几张传单数分钟之后，忽然觉得头脑昏眩起来，继而感到头前所未有地痛，此时某员工感到情况不妙，急忙跌跌撞撞地走到文明路口,拦了部出租车直奔附近的省人民医院。医院诊断，该员工是由于接触或吸入了一种混合性麻醉药(学名:达克罗宁，医生称如果过量容易导致死亡!!!!)而导致以上症状。案例分析：这是一起有预谋的抢劫未遂事件，一些图谋不轨的不法分子向路人发放预先喷上类似以上麻醉性药物的传单或宣传资料，然后锁定一些目标(特别是女性)，紧随其后，一旦药物发挥作用，不法分子便伺机对事主进行抢劫。建议：<br />　　<br />　　　　<br />　　<br />　　　　1、尽量不要接受街头派发的传单或宣传资料，特别是在独自一人的情况下，女性尤其要警惕；<br />　　<br />　　<br />　　<br />　　　　2、万一您误接了上述资料，并感觉身体不适，请立即向就近的警察求助，尽快就医。<br />　　<br />　　　　<br />　　<br />　　　　骗术二十：女生一定要看－－可怕的广州火车站和几乎被拐的MM，小姑娘们，小心呀！！！<br />　　<br />　　　　<br />　　<br />　　　　时间：2003年3月3日；地点：广州火车站广场<br />　　<br />　　<br />　　<br />　　　　人物：一个2002年毕业的涉世不深的女孩事件：<br />　　<br />　　　　<br />　　<br />　　　　今天下午，我的一个留校的同学给我突然给我打来电话，说有一个师妹去深圳找工作了，没有找到要从广州回家。让我帮忙请她吃顿饭，把她送上回家的火车我当时就答应了，然后根据同学留给我的电话，马上就给她联系了，电话打通后她告诉我现在已经进站了！因为我住处离火车站比较远，接站已经来不及了，于是就问她以前在广州站下过车吗？她说，每次去深圳都要在广州下车，她问我住哪儿，她下车后直接打的来找我。我听她的口气很自信，而且因为是大白天，我就同意了,然后告诉她一个广州很有名的大厦的名字，告诉她我在那下面等她挂了电话我就开始换衣服，准备出发了。此时这个女孩开始随着人流出站了。出站后她发现她的手机经过刚才的电话已经没有钱了！而在此之前她从来没有见过我，这是她在车站广场上发现了IC卡电话机，她想先给我说一声手机没钱了，然后在问问我穿什么衣服，于是她便拉着箱子走到一部话机旁边。她绝对没有想到，这时一个阴谋已经在悄悄的向她逼近了！<br />　　<br />　　　　<br />　　<br />　　　　她把箱子放在身前，开始拨电话了，这时她后面站了一个男的手里拿着卡，好像在排队打电话。正当她刚刚把我的号码拨完，突然后面那个人伸出手&ldquo;啪&ldquo;的一声把话机的压簧按了下去，电话没有接通。这时女孩转过身很气愤的看着那个人，那个男人立即满脸堆笑，连声说对不起！说不是故意的。然后告诉女孩，你按重播键就可以了！！！这个阴谋像一张网此刻已经张开了！！！女孩满脸疑惑的转过来，按了重播键。这次没有再挂断，通了！但是，是另外一个陌生的声音。女孩问：&ldquo;**在吗？&ldquo;那个声音：&ldquo;对不起，他刚才有急事出去了，连手机都没有拿，他让我去接你。&ldquo;女孩又问&ldquo;他不是让我打的去&times;&times;大厦吗？&ldquo;那个声音：&ldquo;是这样子，我们有车，现在我们去车站接你，你到车站旁边的&times;&times;等我！&ldquo;这是一直站在女孩身后的那个男子说话了：&ldquo;我知道&times;&times;这个地方，离这儿很近的刚才不好意思啊，为了表示歉意我送你去哪儿！！&ldquo;说着就拉起女孩的行李，这是电话那边已经挂了！那个可怜的女孩就傻乎乎的相信了那个人的话，跟着那个男子走，还不时的给那个男子道谢!!!当走到流花车站旁边的时候，那个男子好像遇到了一个熟人，打了个招呼。那个人笑嘻嘻的说：&ldquo;行啊你，这么靓的都搞得到！&ldquo;那个男子立刻板起脸，骂了一句。这时小师妹突然间像是意识到了什么，经过十几秒钟的思考，立刻明白了自己处境。她的腿都软了，但是那个人拉着她的行李，而行李里面装着她的学历学位证。小师妹装作很关心的说，你看你累得，满脸是汗！给擦擦汗吧！说着，便递过一沓纸巾！那个男子装作很憨厚，一边接过纸巾把行李放下，开始擦汗！！！小师妹这时突然拉起行李，像疯子一样飞快的跑起来，一边跑一边叫：&ldquo;救命啊，救命！！！&ldquo;那个男子也反应过来开始追，人很多，小师妹根本跑不快。但是就在这千钧一发之际，一个保安从前面听到喊声跑了过来，跑到小师妹跟前问：&ldquo;怎么了！&ldquo;可是我那可怜的小师妹已经神经高度亢奋了，根本不理保安还是一直跑。但是那个男子已经不敢再追了。小师妹看到前面停有一辆的士，这次作罢。惊魂未定的上了！而我在大厦下面已经等了15分钟了。终于我看到一个披头散发的女孩拉着行李朝我走过来了。我赶过去，问她是不是**.呵呵，她用近乎呆滞的眼神死死盯着我，要我出示身份证。幸好我的身份证总是放在钱包里面随身携带。看过之后，她接过我的手机，给我那个同学打通电话，让我接。之后又拿过电话，给我同学说了几句。挂机之后，拉着我的胳膊好一阵哭啊！！从来没有见到女孩子掉那么多眼泪！当时真把我吓坏了。不管怎么问怎么哄就是一直抱着我的胳膊哭，一句话都没有！！！引得过路的人纷纷侧目。没有办法，我只好带着她回到我的住处，她真的哭了一路！到家里，我让她洗了把脸给她到了杯茶，她的情绪才稳定下来，这时眼睛已经哭肿了。等她边哭边说，把经过讲完之后，我要带着她报警！她说死也不去广州火车站了。不管我怎么劝都不去报警了。歇了一会她让我带着她去东站上车。于是我带她到东站买了火车票，我一直把她送到窝铺车厢，把她安顿好！然后在她感激的眼神中下了车！她给我说的最后一句话是：我再也不来这儿！！！注意：那IC电话是做了手脚的！！！据称武昌、成都、西安火车站都有这样的事情。不要轻易和陌生人说话，不然不久以后你就可能出现在河南的山沟沟里面.<br />　　<br />　　　　<br />　　<br />　　　　骗术二十一：大约一个月前,我看到一个女子站在大型购物中心的入口。女子写了个自己的经历,好警告其它的女子们。几天前,这个女子购物完后走出购物中心,在上车前发现车胎泄气了,于是她从后车箱中拿出千斤顶准备换车胎。一个穿著西装手拿公文包的男士走到她旁边对她说?我看到你在换车胎，需要我帮忙吗?女子欣然的接受了男士的帮助。换车胎时女子与男士相谈甚欢，男士换好新车胎后帮女子将泄气的车胎及千斤顶放入后车箱并盖上车盖，并将手上的尘拍掉。当女子谢谢男士的帮助要进入车内时，男士告诉女子他的车子就在购物中心的附近，希望女子能让男士搭个便车送男士去自己停车的地方。女子有点意外并问男士怎么会将车停在另一边。男士解释说来购物中心和一个不常见面的老朋友饭、见面，离开时却走错出口。但他现在快迟到,而他的车子就在附近而已。女子不想拒绝男士，因为男士才帮自己更换车胎，而换车胎对女子并不容易。女子忽然想起男士在盖上后车盖前，将自己的公文包放入后车箱中，而那是在男士开口请女子让他搭便车之前。女子于是对男士说：自己很乐意载男士去他停车的地方,但自己忘了买一样东西。女子接着说只需要几分钟，男子可以坐在车内等，她很快就会回来。女子进入购物中心后找了安全人员，并将刚刚的事告诉他，安全人员与女子一起回到车旁时，男士已经离开了。女子及安全人员一起将后车箱中男士的公文包带到警察局。警察将公文包打开..(表面上而言是可以看看有没有证件好将公文包还给男士),他们发现里面装的竟然是绳子、胶带及刀子。当警察检查女子泄气的旧轮胎时，发现根本没有问题，只是被放气而已。男士有什么意图很明显，而且事前已经小心计划过。女子幸运的逃过一劫。如果女子当时坐在车里等男士替她换车胎，或者女子有小孩坐在系安全带的儿童安全座椅上，或者当时女子拒绝男士的要求将会发生多可怕的伤害。<br />　　<br />　　　　<br />　　<br />　　　　骗术二十二：是我的高中同学告诉我的。他的一个同事，前几天骑车回家路上，碰到2个男的问路。说完路线之后，男的说记不住。要求用笔记下来，便掏出纸笔给这位朋友。当时这个朋友就觉得有一股怪味从笔里传出来。写完，觉得有些头晕。这是两个男的还找不到，拉这位朋友带路。当时这位朋友心中有一个想法，一定要离开。边说，不行，我一定要走，便骑车走了。随后失去了记忆。好像睡着了。当他醒来，发现自己在去八达岭的京昌高速路上，还骑着车，被后面汽车的喇叭吵醒。已经是一个多小时之后了。于是往回走。在高速入口，管理人员见了他就骂，说刚才让他停他不听话，还以为他要骑车去长城。。。。。好了，大家明白了，关键就是那支笔散发出来的气体，可能导致你任人摆布或者暂时失去记忆.<br /><img src ="http://www.blogjava.net/bluesky/aggbug/30898.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 08:47 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/30898.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转载]程序员的十种级别 </title><link>http://www.blogjava.net/bluesky/archive/2006/02/16/30897.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Thu, 16 Feb 2006 00:46:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/16/30897.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30897.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/16/30897.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30897.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30897.html</trackback:ping><description><![CDATA[程序员的十种级别<br /><br />第一级：神人，天资过人而又是技术狂热者同时还拥有过人的商业头脑，高瞻远瞩，技术过人，大器也。如丁磊，求伯君。<br /><br />第二级：高人，有天赋，技术过人但没有过人的商业头脑，通常此类人不是顶尖黑客就是技术总监之流。<br /><br />第三级：牛人，技术精湛，熟悉行业知识，敢于创新，有自己的公司和软件产品。<br /><br />第四级：工头，技术精湛，有领导团队的能力，此类人大公司项目经理居多。<br /><br />第五级：技术工人，技术精湛，熟悉行业知识但领导能力欠加，此类人大多为系分人员或资深程序员，基本上桀骜不逊，自视清高，不愿于一般技术人员为伍，在论坛上基本以高手面目出现。<br /><br />第六级：熟练工人，技术有广度无深度，喜欢钻研但浅尝辄止。此类人大多为老程序员，其中一部分喜欢利用工具去查找网上有漏洞的服务器，干点坏事以获取成绩感。如果心情好，在论坛上他们会回答菜鸟的大部分问题。此级别为软件业苦力的重要组成部分。<br /><br />第七级：工人，某些技术较熟练但缺乏深度和广度，此类人大多为程序员级别，经常在论坛上提问偶尔也回答菜鸟的问题。为软件产业苦力的主要组成部分。<br /><br />第八级：菜鸟，入门时间不长，在论坛上会反复提问很初级的问题，有一种唐僧的精神。虽然招人烦但基本很可爱。只要认真钻研，一两年后就能升级到上一层。<br /><br />第九级：大忽悠，利用中国教育的弊病，顶着一顶高学历的帽子，在小公司里混个软件部经理，设计不行，代码不行，只会胡乱支配下属，拍领导马屁，在领导面前胡吹海侃，把自己打扮成技术高手的模样。把勾心斗角的办公室文化引入技术部门，实在龌龊！<br /><br />第十级：驴或傻X，会写SELECT语句就说自己精通ORALCE，连寄存器有几种都不知道就说自己懂汇编，建议全部送到日本当IT产业工人，挣了日本人的钱还严重打击日本的软件业！<br /><br />其中又以前两级和后两级最为难得，其余级别只要努力，皆有可能达到。<br /><a href="http://blog.csdn.net/luna8418/archive/2005/09/25/489259.aspx">http://blog.csdn.net/luna8418/archive/2005/09/25/489259.aspx</a><br /><img src ="http://www.blogjava.net/bluesky/aggbug/30897.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-16 08:46 <a href="http://www.blogjava.net/bluesky/archive/2006/02/16/30897.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SCJP模拟题</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30842.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 09:50:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30842.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30842.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30842.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30842.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30842.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: scjp模拟试题（一）&nbsp;Question No: 11.public class test (2. public static void main (String args[]) {3. int i = 0xFFFFFFF1;4. int j = ~i;5.6. }7. )What is the decimal value of j at line 5?A. 0B. 1C. 14...&nbsp;&nbsp;<a href='http://www.blogjava.net/bluesky/archive/2006/02/15/30842.html'>阅读全文</a><img src ="http://www.blogjava.net/bluesky/aggbug/30842.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 17:50 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30842.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>26字母表达爱情</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30830.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 08:28:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30830.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30830.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30830.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30830.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30830.html</trackback:ping><description><![CDATA[<P><IMG height=350 alt=6727-1.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-1.jpg" width=350 border=0><BR>A-Accept(接受)<BR>“世界没有十全十美的人”这句话是千真万确的，尤其是两个人一起并不等如两块合得来的积木，必须互相迁就。记着，你爱他/她，就必须接受他/她的一切，包括他/她的缺点。<BR><IMG height=350 alt=6727-2.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-2.jpg" width=350 border=0></P>
<P>B-Believe（相信）<BR>不信任对方，经常以怀疑的语气盘问对方。这种互相猜度的爱情，就只有分手的下场，既然跟他/她一起，就应该完全信任对方才对。<BR><IMG height=350 alt=6727-3.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-3.jpg" width=350 border=0></P>
<P>C-Care（关心）<BR>关心的程度正好表现你对对方的重视程度。间或打个电话给对方，关心式问候一句，这些关心未必有实际用途，但肯定令对方暖在心头。<BR><IMG height=350 alt=6727-4.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-4.jpg" width=350 border=0></P>
<P>D-Devoted（全心全意）<BR>爱一个人当然要全心全意，一脚踏数船不会是个好办法，结果多数亦是分手。不要令他/她难过，也不要浪费你们两个的时间！<BR><IMG height=350 alt=6727-5.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-5.jpg" width=350 border=0></P>
<P>E-Enjoy（享受）<BR>你应欣赏对方的一切，享受这段爱情带给你的开心、快乐、幸福，这样，你便会爱得更愉快。<BR><IMG height=350 alt=6727-6.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-6.jpg" width=350 border=0></P>
<P>F-Freedom（自由）<BR>虽然大家在一起，也应给予对方应有的自由及保持秘密的权利。你的另一半不是你的奴隶，不要让他/她认为跟你在一起就如被困在笼里的宠物。<BR><IMG height=350 alt=6727-7.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-7.jpg" width=350 border=0></P>
<P>G-Give（付出）<BR>爱情这东西不一定是你付出这么“多”，便会收回这么“多”但不付出，便一定没有收获；对自己的情人，应该像对自己一样毫无保留的付出，这才算得上是真爱。<BR><IMG height=350 alt=6727-8.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-8.jpg" width=350 border=0></P>
<P>H-Heart,Honesty（心，诚实）<BR>爱情最重要的道具是心。你必须真心对待、用心去爱你的另一半，大家有何必要遮遮掩掩呢？没有心，又怎能称得上真心相爱？<BR></P>
<P><IMG height=350 alt=6727-9.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-9.jpg" width=350 border=0>I-Independence（独立）<BR>甜言蜜语的人会说：“ 我是为你而生的。” 其实，每个人都有自己的生存空间。不应过份依赖对方成为对方的沉重负担，甚至负累。<BR></P>
<P><IMG height=350 alt=6727-10.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-10.jpg" width=350 border=0>J-Jealousy（妒忌）<BR>适当的妒忌、吃醋能表示你对对方的重视，但切记是合情合理的吃醋。假如是毫不讲理的大发雷霆地吃醋，导致的必然是惹人反感。</P>
<P><IMG height=350 alt=6727-11.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-11.jpg" width=350 border=0><BR>K-Kiss（吻）<BR>“ 和情人深深一吻来代替讲话，好吗？” 一吻胜过千言万语，轻轻的一吻已能代表你惜他/她，爱护他/她，所以请不要吝啬你的红唇。</P>
<P><IMG height=350 alt=6727-12.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-12.jpg" width=350 border=0><BR>L-Love（爱）<BR>都说是爱情，没有爱又怎会有情呢？爱跟喜欢不同，爱一个人，你必定愿意为他/她做任何事，这是最高的境界。间或不妨跟他/她说一句：“我爱你” 担保比任何礼物来得甜蜜开心。<BR></P>
<P><IMG height=350 alt=6727-13.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-13.jpg" width=350 border=0><BR>M-Mature（成熟）<BR>为什么大多数的人的初恋总会无声无色地惨败？因为年轻人都恋爱得较幼稚。况且，没有人会喜欢对方长年没头没脑地蹦蹦跳。人成熟一点你的爱情亦会早熟一点，直至开花结果！<BR></P>
<P><IMG height=350 alt=6727-14.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-14.jpg" width=350 border=0><BR>N-Natural（自然）<BR>很多人初拍拖的时候都会把一切缺点收起来，变成另一个人。日子久了缺点就一箩箩地出现，令对方吃不消。其实，不做作，流于自然的爱情才会细水长流！<BR></P>
<P><IMG height=350 alt=6727-15.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-15.jpg" width=350 border=0><BR>O-Observe（观察）<BR>经常细心观察对方的喜好，不但能更了解对方， 更能间或给他/她一些惊喜。好像爱侣看杂志时无意赞某明星的表漂亮， 你便可留待他/她生日的时候买给他/她。那份心意一定比礼物来得珍贵。<BR></P>
<P><IMG height=350 alt=6727-16.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-16.jpg" width=350 border=0><BR>P-Protect（保护）<BR>做男朋友的当然要保护女朋友，但做女朋友的亦要保护对方的尊严，不要让他人中伤。<BR></P>
<P><IMG height=350 alt=6727-17.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-17.jpg" width=350 border=0><BR>Q-Quarter（宽恕）<BR>爱情里面怎可以没有宽恕，对他/她的错误你应该以宽大的态度原谅他/她。为什么？因为你是最爱他/她的人嘛。<BR></P>
<P><IMG height=350 alt=6727-18.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-18.jpg" width=350 border=0><BR>R-Receive（接收）<BR>对于爱侣为你做的一切请不要表现得无动于衷，令他/她气馁。他/她付出，你便应该以欣赏的态度去接收，这才能令感情更进一步。<BR></P>
<P><IMG height=350 alt=6727-19.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-19.jpg" width=350 border=0><BR>S-Share（分享）<BR>若你爱他/她，就必需与他/她分享他/她的喜、怒、哀、乐。 不要只顾着自己，这是作为一个伴侣的最简单的责任。<BR></P>
<P><IMG height=350 alt=6727-20.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-20.jpg" width=350 border=0><BR>T-Try（尝试）<BR>两个人一起久了，可能会觉得跟对方一起很沉闷。这是很平常的，但这多数是迈向成功爱情的其中一个阶段，而且是重要的一个，过了这个阶段，你前面就是一条又平又直的大路了。尝试用不同的方式去沟通沟通吧！<BR></P>
<P><IMG height=350 alt=6727-21.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-21.jpg" width=350 border=0><BR>U-Understand（明白）<BR>对于你的另一半，首先请你明白他/她的为人，否则你根本不可以跟他/她好好的在一起。另外，虽然你不是他/她，不知道他/她在想什么。 但是，有时候，也可以猜猜嘛。常常要对方说出来，好像没什么情趣似的。<BR></P>
<P><IMG height=350 alt=6727-22.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-22.jpg" width=350 border=0><BR>V-Vow（誓言）<BR>人人都可以发誓，“我发誓，我爱你一生一世，否则……” 否则有啥用？发誓，是可以令对方觉得你好爱他/她，令对方觉得好甜蜜。可是， 请你们不要当发誓是吃家常菜，否则，就请你不要作出无谓的誓言，带来的效果只会更差！<BR></P>
<P><IMG height=350 alt=6727-23.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-23.jpg" width=350 border=0><BR>W-Willingness（愿意）<BR>有时候你的另一半可能会作出一些要求，这些要求不一定是合理的，就算是合理的也好。假如你不愿意的话，就请你说：“不！” 如果他/她真的是喜欢你的话，他/她亦会乐意接受。<BR></P>
<P><IMG height=350 alt=6727-24.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-24.jpg" width=350 border=0><BR>X-eXpression（表达）<BR>两个人相处，有什么想说的。不管是对的、不对的、关于他/她的。 关于你的、关于大家的你都可以跟他/她表达你的意见或者看法。 虽说有时候可以让对方猜一下你心想的，但如果这样行不通，那你就要尝试表达一下你自己了。<BR></P>
<P><IMG height=350 alt=6727-25.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-25.jpg" width=350 border=0><BR>Y-Yield（退让）<BR>两个人在一起，难免有争拗，“忍一时，风平浪静；退一步，海阔天空”，不要跟你的伴侣计较这么多吧！还有，不要没想清楚就对对方说：“分手吧！”，尝试下跟对方谈一谈，找出解决的方法啊！<BR></P>
<P><IMG height=350 alt=6727-26.jpg src="http://www.blogjava.net/images/blogjava_net/bluesky/images/letter/6727-26.jpg" width=350 border=0><BR>Z-Zest（热情）<BR>大概没有人想他/她的另一半常常好像没有心情似的。有时候对你的另一半热情些，对增加你们之间的感情都会有帮助的。 不过，不要太过份就可以了，免得他/她受不了。</P>
<P><BR>&nbsp;</P><img src ="http://www.blogjava.net/bluesky/aggbug/30830.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 16:28 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30830.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Apache Cocoon入门</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30818.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 07:28:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30818.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30818.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30818.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30818.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30818.html</trackback:ping><description><![CDATA[<P>作者： 周靖 译 <BR><A href="http://www.zdnet.com.cn/developer/tech/story/0,3800067013,39139224-1,00.htm">http://www.zdnet.com.cn/developer/tech/story/0,3800067013,39139224-1,00.htm</A><BR><BR><BR>在某种意义上，可将Cocoon视为一个基于XML的内容管理系统，因其提供了一种机制来描述Web信息项目（内容）的结构和语义、这些项目的关系、它们如何随着时间的推移而发生改变（逻辑）以及在请求时如何向用户呈现（它们的样式）。事实上，Cocoon项目作为Apache Web服务器项目的一部分，它的作用之一就是组织和控制Apache麾下众多项目的文档化过程。</P>
<P>作为对其真实用途的一个比喻，Cocoon（茧）这个名字具有深远的意义。它代表一种包裹结构，其中的某些东西将从幼虫阶段成长为美丽的蝴蝶，并准备展翅飞翔。但在Apache Cocoon的<A href="http://xml.apache.org/cocoon/" target=_target>主页</A>上，没有对这个巧妙的比喻进行说明。相反，它只是对这个项目进行了准确的技术性解释：“Apache Cocoon是一个XML发布框架，它将XML和XSLT技术在服务器应用程序中的应用提升到一个新级别。Cocoon的宗旨是提升管道化SAX处理的性能和扩展性，通过对内容、逻辑和样式的分离来营造一个灵活的环境。”<BR></P>
<H5>
<H5>到底什么是Cocoon?</H5>
<P>Cocoon最初的型态是一个简单的Java servlet，全部使用标准W3C组件：用文档对象模型（DOM）来解析文档，用XML来捕捉和格式化数据，用XSLT来转换数据和合并/操纵XML文档，并用XSL来管理文档的表示以便通过Web传送。但人们很快就要求它为其他类型的内容提供服务（比如程序和文档），所以Cocoon逐渐发展成为一个完整的、基于XML的发布框架及系统。<BR></P>
<P>随着时间的推移，几个新的XML组件问世了，比如SAX。另外，XSL也逐渐细分为几个不同的组件，分别提供Transforms、Formatting Objects和XPath功能。这些新标准直接促成了Cocoon 2在2002年的问世，它定义了一个标准的（而且仍在发展的）内容管理系统，并面向公众开放。<BR><BR>就目前来说，我们可采取几种不同的方式来描述Cocoon：一个XML发布框架，一个数据源聚合器以及一系列管道和组件的集合。</P>
<H5>作为发布框架的Cocoon <BR></H5>
<P>Cocoon基于对SAX事件的管道式处理。Web应用程序如果围绕这个框架来构建，将获得较好的扩展性和性能。利用一个集中式的配置系统，你可以方便地创建、部署和维护Web应用程序。Cocoon使用了一个缓存系统，所有组件都可根据需要进行动态配置。接收到用户请求后，会自动检查缓存，判断请求的URI（统一资源标识符）是否存在。如果存在，就直接传递缓存的内容，不需要通过一个管道来处理它。<BR><BR></P>
<H5>Cocoon作为数据源聚合器<BR></H5>
<P>Cocoon可作为一个抽象的引擎使用（通过一个Java servlet），它基于自定义的协议处理程序，能通过标准URI来访问外部数据源。Cocoon甚至能递归调用自身，使数据流能在多个管道化阶段同时处理，从而提高处理速度和效率。</P>
<P><BR>管道和组件</P>
<P>Cocoon体系结构的核心设计思想是模块化和抽象处理。Cocoon管道在概念上和UNIX系统中使用的管道差不多，只是Cocoon管道中的所有元素都是通过解析XML文档而创建的SAX事件。Cocoon识别3种类型的管道元素（组件），分别是生成器（generators）、转换器（transformers）和序列化器（serializers）。其中，生成器使用一个请求的URI来生成SAX事件；转换器使用SAX事件并生成其他SAX事件；序列化器使用SAX事件并生成一些响应。</P>
<H5>Cocoon的用途<BR></H5>
<P>简单地说，Cocoon管道用于生成和递送内容。内容采用的是某种可识别的形式，由一个生成器和一个序列化器构成。在较典型的Cocoon管道中，生成器之后可能紧接着一个或多个转换器链，而序列化器用于生成不同格式的输出。采取这种方式，同一个源文档可为Web浏览器生成HTML格式的内容，为WAP设备生成WML格式的内容，为打印输出生成PDF格式的内容。<BR><BR>作为一个开发平台，Cocoon最吸引人的地方在于它提供了品种丰富的生成器、转换器和序列化器。人们为Cocoon 2项目开发和捐赠了许多这样的组件。一经捐赠，这些组件就可进行定制，以添加新功能或者进行扩展，从而创建出新的组件。<B>表</B><B>A</B>总结了适用于Cocoon的一些常用生成器、转换器和序列化器。<BR><BR></P>
<P>表A</P>
<P>
<TABLE class=text1 cellSpacing=0 cellPadding=0 width=535 border=1>
<TBODY>
<TR>
<TD vAlign=bottom width=69><STRONG>类别</STRONG></TD>
<TD vAlign=bottom width=154><STRONG>名称</STRONG></TD>
<TD vAlign=bottom width=304><STRONG>说明</STRONG></TD></TR>
<TR>
<TD vAlign=top width=69>生成器</TD>
<TD vAlign=top width=154>DirectoryGenerator</TD>
<TD vAlign=top width=304>将目录列表转换成XML格式，以便从中生成SAX事件</TD></TR>
<TR>
<TD vAlign=top width=69>生成器</TD>
<TD vAlign=top width=154>FileGenerator</TD>
<TD vAlign=top width=304>解析一个文件或URI，并生成SAX事件</TD></TR>
<TR>
<TD vAlign=top width=69>生成器</TD>
<TD vAlign=top width=154>JSPGenerator</TD>
<TD vAlign=top width=304>根据JSP页来生成XML和SAX事件</TD></TR>
<TR>
<TD vAlign=top width=69>生成器</TD>
<TD vAlign=top width=154>ServerPagesGenerator</TD>
<TD vAlign=top width=304>根据XSP页来生成XML和SAX</TD></TR>
<TR>
<TD vAlign=top width=69>转换器</TD>
<TD vAlign=top width=154>i18nTransformer</TD>
<TD vAlign=top width=304>使用i18n字典和语言参数值来转换SAX事件</TD></TR>
<TR>
<TD vAlign=top width=69>转换器</TD>
<TD vAlign=top width=154>XincludeTransformer</TD>
<TD vAlign=top width=304>通过为现有的SAX流添加SAX事件，从而处理<EM>xinclude</EM><EM>命名空间，并包括外部源</EM></TD></TR>
<TR>
<TD vAlign=top width=69>转换器</TD>
<TD vAlign=top width=154>XSLTransformer</TD>
<TD vAlign=top width=304>根据XSLT样式表定义来转换SAX事件流</TD></TR>
<TR>
<TD vAlign=top width=69>序列化器</TD>
<TD vAlign=top width=154>HTMLSerializer</TD>
<TD vAlign=top width=304>根据SAX事件来生成HTML响应</TD></TR>
<TR>
<TD vAlign=top width=69>序列化器</TD>
<TD vAlign=top width=154>PDFSerializer</TD>
<TD vAlign=top width=304>根据SAX事件，使用Apache FOP（格式输出处理器）来生成PDF</TD></TR>
<TR>
<TD vAlign=top width=69>序列化器</TD>
<TD vAlign=top width=154>SVG2JPGSerializer</TD>
<TD vAlign=top width=304>根据SVG SAX事件，使用Apache Batik来生成JPEG图像</TD></TR>
<TR>
<TD vAlign=top width=69>序列化器</TD>
<TD vAlign=top width=154>TextSerializer</TD>
<TD vAlign=top width=304>根据SAX事件来生成纯文本输出，适用于非XML文本，比如CSS或程序语言代码</TD></TR>
<TR>
<TD vAlign=top width=69>序列化器</TD>
<TD vAlign=top width=154>XMLSerializer</TD>
<TD vAlign=top width=304>根据SAX事件来生成XML响应</TD></TR></TBODY></TABLE></P>
<H5>可由Cocoon使用的部分组件<BR></H5>
<P>如所你见，Cocoon的功能并非只是简单地将数据格式化成HTML。在未来的文章中，我们将研究如何在Cocoon环境中创建和处理文档，并更详细地介绍在这个环境中工作所牵涉的问题。就目前来说，你只需理解Cocoon是针对多种目的来捕捉、呈现和递送Web内容的一种方式。</P>
<P>&nbsp;</P></H5><img src ="http://www.blogjava.net/bluesky/aggbug/30818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 15:28 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30818.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转载]Java性能优化技巧集锦</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30812.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 07:08:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30812.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30812.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30812.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30812.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30812.html</trackback:ping><description><![CDATA[<P>&nbsp;</P>
<P><BR>===================================<BR>提纲:<BR>===================================<BR>一、通用篇<BR>　　1.1 不用new关键词创建类的实例<BR>　　1.2 使用非阻塞I/O<BR>　　1.3 慎用异常<BR>　　1.4 不要重复初始化变量<BR>　　1.5 尽量指定类的final修饰符<BR>　　1.6 尽量使用局部变量<BR>　　1.7 乘法和除法<BR>二、J2EE篇<BR>　　2.1 使用缓冲标记<BR>　　2.2 始终通过会话Bean访问实体Bean<BR>　　2.3 选择合适的引用机制<BR>　　2.4 在部署描述器中设置只读属性<BR>　　2.5 缓冲对EJB Home的访问<BR>　　2.6 为EJB实现本地接口<BR>　　2.7 生成主键<BR>　　2.8 及时清除不再需要的会话<BR>　　2.9 在JSP页面中关闭无用的会话<BR>　　2.10 Servlet与内存使用<BR>　　2.11 HTTP Keep-Alive<BR>　　2.12 JDBC与Unicode<BR>　　2.13 JDBC与I/O<BR>　　1.14 内存数据库<BR>三、GUI篇<BR>　　3.1 用JAR压缩类文件<BR>　　3.2 提示Applet装入进程<BR>　　3.3 在画出图形之前预先装入它<BR>　　3.4 覆盖update方法<BR>　　3.5 延迟重画操作<BR>　　3.6 使用双缓冲区<BR>　　3.7 使用BufferedImage<BR>　　3.8 使用VolatileImage<BR>　　3.9 使用Window Blitting<BR>四、补充资料<BR>===================================</P>
<P>正文:<BR>===================================</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>一、通用篇</P>
<P><BR>"通用篇"讨论的问题适合于大多数Java应用。</P>
<P><BR>1.1 不用new关键词创建类的实例</P>
<P><BR>用new关键词创建类的实例时，构造函数链中的所有构造函数都会被自动调用。但如果一个对象实现了Cloneable接口，我们可以调用它的clone()方法。clone()方法不会调用任何类构造函数。</P>
<P><BR>在使用设计模式（Design Pattern）的场合，如果用Factory模式创建对象，则改用clone()方法创建新的对象实例非常简单。例如，下面是Factory模式的一个典型实现：</P>
<P><BR>public static Credit getNewCredit() {return new Credit();} <BR>&nbsp;</P>
<P><BR>改进后的代码使用clone()方法，如下所示：</P>
<P><BR>private static Credit BaseCredit = new Credit();public static Credit getNewCredit() {return (Credit) BaseCredit.clone();} <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>上面的思路对于数组处理同样很有用。</P>
<P><BR>1.2 使用非阻塞I/O</P>
<P><BR>版本较低的JDK不支持非阻塞I/O API。为避免I/O阻塞，一些应用采用了创建大量线程的办法（在较好的情况下，会使用一个缓冲池）。这种技术可以在许多必须支持并发I/O流的应用中见到，如Web服务器、报价和拍卖应用等。然而，创建Java线程需要相当可观的开销。</P>
<P><BR>JDK 1.4引入了非阻塞的I/O库（java.nio）。如果应用要求使用版本较早的JDK，在这里有一个支持非阻塞I/O的软件包。</P>
<P><BR>请参见Sun中国网站的《调整Java的I/O性能》。</P>
<P><BR>1.3 慎用异常</P>
<P><BR>异常对性能不利。抛出异常首先要创建一个新的对象。Throwable接口的构造函数调用名为fillInStackTrace()的本地（Native）方法，fillInStackTrace()方法检查堆栈，收集调用跟踪信息。只要有异常被抛出，VM就必须调整调用堆栈，因为在处理过程中创建了一个新的对象。</P>
<P><BR>异常只能用于错误处理，不应该用来控制程序流程。</P>
<P><BR>1.4 不要重复初始化变量</P>
<P><BR>默认情况下，调用类的构造函数时， Java会把变量初始化成确定的值：所有的对象被设置成null，整数变量（byte、short、int、long）设置成0，float和double变量设置成0.0，逻辑值设置成false。当一个类从另一个类派生时，这一点尤其应该注意，因为用new关键词创建一个对象时，构造函数链中的所有构造函数都会被自动调用。</P>
<P><BR>1.5 尽量指定类的final修饰符</P>
<P><BR>带有final修饰符的类是不可派生的。在Java核心API中，有许多应用final的例子，例如java.lang.String。为String类指定final防止了人们覆盖length()方法。</P>
<P><BR>另外，如果指定一个类为final，则该类所有的方法都是final。Java编译器会寻找机会内联（inline）所有的final方法（这和具体的编译器实现有关）。此举能够使性能平均提高50%。</P>
<P><BR>1.6 尽量使用局部变量</P>
<P><BR>调用方法时传递的参数以及在调用中创建的临时变量都保存在栈（Stack）中，速度较快。其他变量，如静态变量、实例变量等，都在堆（Heap）中创建，速度较慢。另外，依赖于具体的编译器/JVM，局部变量还可能得到进一步优化。请参见《尽可能使用堆栈变量》。</P>
<P><BR>1.7 乘法和除法</P>
<P><BR>考虑下面的代码：</P>
<P><BR>for (val = 0; val &lt; 100000; val +=5) { alterX = val * 8; myResult = val * 2; } <BR>&nbsp;</P>
<P><BR>用移位操作替代乘法操作可以极大地提高性能。下面是修改后的代码：</P>
<P><BR>for (val = 0; val &lt; 100000; val += 5) { alterX = val &lt;&lt; 3; myResult = val &lt;&lt; 1; } <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>修改后的代码不再做乘以8的操作，而是改用等价的左移3位操作，每左移1位相当于乘以2。相应地，右移1位操作相当于除以2。值得一提的是，虽然移位操作速度快，但可能使代码比较难于理解，所以最好加上一些注释。</P>
<P><BR>二、J2EE篇</P>
<P><BR>前面介绍的改善性能技巧适合于大多数Java应用，接下来要讨论的问题适合于使用JSP、EJB或JDBC的应用。</P>
<P><BR>2.1 使用缓冲标记</P>
<P><BR>一些应用服务器加入了面向JSP的缓冲标记功能。例如，BEA的WebLogic Server从6.0版本开始支持这个功能，Open Symphony工程也同样支持这个功能。JSP缓冲标记既能够缓冲页面片断，也能够缓冲整个页面。当JSP页面执行时，如果目标片断已经在缓冲之中，则生成该片断的代码就不用再执行。页面级缓冲捕获对指定URL的请求，并缓冲整个结果页面。对于购物篮、目录以及门户网站的主页来说，这个功能极其有用。对于这类应用，页面级缓冲能够保存页面执行的结果，供后继请求使用。</P>
<P><BR>对于代码逻辑复杂的页面，利用缓冲标记提高性能的效果比较明显；反之，效果可能略逊一筹。</P>
<P><BR>请参见《用缓冲技术提高JSP应用的性能和稳定性》。</P>
<P><BR>2.2 始终通过会话Bean访问实体Bean</P>
<P><BR>直接访问实体Bean不利于性能。当客户程序远程访问实体Bean时，每一个get方法都是一个远程调用。访问实体Bean的会话Bean是本地的，能够把所有数据组织成一个结构，然后返回它的值。</P>
<P><BR>用会话Bean封装对实体Bean的访问能够改进事务管理，因为会话Bean只有在到达事务边界时才会提交。每一个对get方法的直接调用产生一个事务，容器将在每一个实体Bean的事务之后执行一个"装入-读取"操作。</P>
<P><BR>一些时候，使用实体Bean会导致程序性能不佳。如果实体Bean的唯一用途就是提取和更新数据，改成在会话Bean之内利用JDBC访问数据库可以得到更好的性能。</P>
<P><BR>2.3 选择合适的引用机制</P>
<P><BR>在典型的JSP应用系统中，页头、页脚部分往往被抽取出来，然后根据需要引入页头、页脚。当前，在JSP页面中引入外部资源的方法主要有两种：include指令，以及include动作。</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>include指令：例如。该指令在编译时引入指定的资源。在编译之前，带有include指令的页面和指定的资源被合并成一个文件。被引用的外部资源在编译时就确定，比运行时才确定资源更高效。</P>
<P>include动作：例如。该动作引入指定页面执行后生成的结果。由于它在运行时完成，因此对输出结果的控制更加灵活。但时，只有当被引用的内容频繁地改变时，或者在对主页面的请求没有出现之前，被引用的页面无法确定时，使用include动作才合算。</P>
<P>&nbsp;</P>
<P><BR>2.4 在部署描述器中设置只读属性</P>
<P><BR>实体Bean的部署描述器允许把所有get方法设置成"只读"。当某个事务单元的工作只包含执行读取操作的方法时，设置只读属性有利于提高性能，因为容器不必再执行存储操作。</P>
<P><BR>2.5 缓冲对EJB Home的访问</P>
<P><BR>EJB Home接口通过JNDI名称查找获得。这个操作需要相当可观的开销。JNDI查找最好放入Servlet的init()方法里面。如果应用中多处频繁地出现EJB访问，最好创建一个EJBHomeCache类。EJBHomeCache类一般应该作为singleton实现。</P>
<P><BR>2.6 为EJB实现本地接口</P>
<P><BR>本地接口是EJB 2.0规范新增的内容，它使得Bean能够避免远程调用的开销。请考虑下面的代码。</P>
<P><BR>PayBeanHome home = (PayBeanHome)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; javax.rmi.PortableRemoteObject.narrow&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ctx.lookup ("PayBeanHome"), PayBeanHome.class); PayBean bean = (PayBean)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; javax.rmi.PortableRemoteObject.narrow&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (home.create(), PayBean.class); <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>第一个语句表示我们要寻找Bean的Home接口。这个查找通过JNDI进行，它是一个RMI调用。然后，我们定位远程对象，返回代理引用，这也是一个RMI调用。第二个语句示范了如何创建一个实例，涉及了创建IIOP请求并在网络上传输请求的stub程序，它也是一个RMI调用。</P>
<P><BR>要实现本地接口，我们必须作如下修改：</P>
<P><BR>&nbsp;</P>
<P>&nbsp;</P>
<P>方法不能再抛出java.rmi.RemoteException异常，包括从RemoteException派生的异常，比如TransactionRequiredException、TransactionRolledBackException和NoSuchObjectException。EJB提供了等价的本地异常，如TransactionRequiredLocalException、TransactionRolledBackLocalException和NoSuchObjectLocalException。</P>
<P>所有数据和返回值都通过引用的方式传递，而不是传递值。</P>
<P>本地接口必须在EJB部署的机器上使用。简而言之，客户程序和提供服务的组件必须在同一个JVM上运行。</P>
<P>如果Bean实现了本地接口，则其引用不可串行化。</P>
<P>&nbsp;</P>
<P><BR>请参见《用本地引用提高EJB访问效率》。</P>
<P><BR>2.7 生成主键</P>
<P><BR>在EJB之内生成主键有许多途径，下面分析了几种常见的办法以及它们的特点。</P>
<P><BR>利用数据库内建的标识机制（SQL Server的IDENTITY或Oracle的SEQUENCE）。这种方法的缺点是EJB可移植性差。</P>
<P><BR>由实体Bean自己计算主键值（比如做增量操作）。它的缺点是要求事务可串行化，而且速度也较慢。</P>
<P><BR>利用NTP之类的时钟服务。这要求有面向特定平台的本地代码，从而把Bean固定到了特定的OS之上。另外，它还导致了这样一种可能，即在多CPU的服务器上，同一个毫秒之内生成了两个主键。</P>
<P><BR>借鉴Microsoft的思路，在Bean中创建一个GUID。然而，如果不求助于JNI，Java不能确定网卡的MAC地址；如果使用JNI，则程序就要依赖于特定的OS。</P>
<P><BR>还有其他几种办法，但这些办法同样都有各自的局限。似乎只有一个答案比较理想：结合运用RMI和JNDI。先通过RMI注册把RMI远程对象绑定到JNDI树。客户程序通过JNDI进行查找。下面是一个例子：</P>
<P><BR>public class keyGenerator extends UnicastRemoteObject implements Remote { private static long KeyValue = System.currentTimeMillis(); public static synchronized long getKey() throws RemoteException { return KeyValue++; } <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>2.8 及时清除不再需要的会话</P>
<P><BR>为了清除不再活动的会话，许多应用服务器都有默认的会话超时时间，一般为30分钟。当应用服务器需要保存更多会话时，如果内存容量不足，操作系统会把部分内存数据转移到磁盘，应用服务器也可能根据"最近最频繁使用"（Most Recently Used）算法把部分不活跃的会话转储到磁盘，甚至可能抛出"内存不足"异常。在大规模系统中，串行化会话的代价是很昂贵的。当会话不再需要时，应当及时调用HttpSession.invalidate()方法清除会话。HttpSession.invalidate()方法通常可以在应用的退出页面调用。</P>
<P><BR>2.9 在JSP页面中关闭无用的会话</P>
<P><BR>对于那些无需跟踪会话状态的页面，关闭自动创建的会话可以节省一些资源。使用如下page指令：</P>
<P><BR>&nbsp;<BR>&nbsp;</P>
<P>&nbsp;</P>
<P><BR>2.10 Servlet与内存使用</P>
<P><BR>许多开发者随意地把大量信息保存到用户会话之中。一些时候，保存在会话中的对象没有及时地被垃圾回收机制回收。从性能上看，典型的症状是用户感到系统周期性地变慢，却又不能把原因归于任何一个具体的组件。如果监视JVM的堆空间，它的表现是内存占用不正常地大起大落。</P>
<P><BR>解决这类内存问题主要有二种办法。第一种办法是，在所有作用范围为会话的Bean中实现HttpSessionBindingListener接口。这样，只要实现valueUnbound()方法，就可以显式地释放Bean使用的资源。</P>
<P><BR>另外一种办法就是尽快地把会话作废。大多数应用服务器都有设置会话作废间隔时间的选项。另外，也可以用编程的方式调用会话的setMaxInactiveInterval()方法，该方法用来设定在作废会话之前，Servlet容器允许的客户请求的最大间隔时间，以秒计。</P>
<P><BR>2.11 HTTP Keep-Alive</P>
<P><BR>Keep-Alive功能使客户端到服务器端的连接持续有效，当出现对服务器的后继请求时，Keep-Alive功能避免了建立或者重新建立连接。市场上的大部分Web服务器，包括iPlanet、IIS和Apache，都支持HTTP Keep-Alive。对于提供静态内容的网站来说，这个功能通常很有用。但是，对于负担较重的网站来说，这里存在另外一个问题：虽然为客户保留打开的连接有一定的好处，但它同样影响了性能，因为在处理暂停期间，本来可以释放的资源仍旧被占用。当Web服务器和应用服务器在同一台机器上运行时，Keep-Alive功能对资源利用的影响尤其突出。</P>
<P><BR>2.12 JDBC与Unicode</P>
<P><BR>想必你已经了解一些使用JDBC时提高性能的措施，比如利用连接池、正确地选择存储过程和直接执行的SQL、从结果集删除多余的列、预先编译SQL语句，等等。</P>
<P><BR>除了这些显而易见的选择之外，另一个提高性能的好选择可能就是把所有的字符数据都保存为Unicode（代码页13488）。Java以Unicode形式处理所有数据，因此，数据库驱动程序不必再执行转换过程。但应该记住：如果采用这种方式，数据库会变得更大，因为每个Unicode字符需要2个字节存储空间。另外，如果有其他非Unicode的程序访问数据库，性能问题仍旧会出现，因为这时数据库驱动程序仍旧必须执行转换过程。</P>
<P><BR>2.13 JDBC与I/O</P>
<P><BR>如果应用程序需要访问一个规模很大的数据集，则应当考虑使用块提取方式。默认情况下，JDBC每次提取32行数据。举例来说，假设我们要遍历一个5000行的记录集，JDBC必须调用数据库157次才能提取到全部数据。如果把块大小改成512，则调用数据库的次数将减少到10次。</P>
<P><BR>在一些情形下这种技术无效。例如，如果使用可滚动的记录集，或者在查询中指定了FOR UPDATE，则块操作方式不再有效。</P>
<P><BR>1.14 内存数据库</P>
<P><BR>许多应用需要以用户为单位在会话对象中保存相当数量的数据，典型的应用如购物篮和目录等。由于这类数据可以按照行/列的形式组织，因此，许多应用创建了庞大的Vector或HashMap。在会话中保存这类数据极大地限制了应用的可伸缩性，因为服务器拥有的内存至少必须达到每个会话占用的内存数量乘以并发用户最大数量，它不仅使服务器价格昂贵，而且垃圾收集的时间间隔也可能延长到难以忍受的程度。</P>
<P><BR>一些人把购物篮/目录功能转移到数据库层，在一定程度上提高了可伸缩性。然而，把这部分功能放到数据库层也存在问题，且问题的根源与大多数关系数据库系统的体系结构有关。对于关系数据库来说，运行时的重要原则之一是确保所有的写入操作稳定、可靠，因而，所有的性能问题都与物理上把数据写入磁盘的能力有关。关系数据库力图减少I/O操作，特别是对于读操作，但实现该目标的主要途径只是执行一套实现缓冲机制的复杂算法，而这正是数据库层第一号性能瓶颈通常总是CPU的主要原因。</P>
<P><BR>一种替代传统关系数据库的方案是，使用在内存中运行的数据库（In-memory Database），例如TimesTen。内存数据库的出发点是允许数据临时地写入，但这些数据不必永久地保存到磁盘上，所有的操作都在内存中进行。这样，内存数据库不需要复杂的算法来减少I/O操作，而且可以采用比较简单的加锁机制，因而速度很快。</P>
<P><BR>三、GUI篇</P>
<P><BR>这一部分介绍的内容适合于图形用户界面的应用（Applet和普通应用），要用到AWT或Swing。</P>
<P><BR>3.1 用JAR压缩类文件</P>
<P><BR>Java档案文件（JAR文件）是根据JavaBean标准压缩的文件，是发布JavaBean组件的主要方式和推荐方式。JAR档案有助于减少文件体积，缩短下载时间。例如，它有助于Applet提高启动速度。一个JAR文件可以包含一个或者多个相关的Bean以及支持文件，比如图形、声音、HTML和其他资源。</P>
<P><BR>要在HTML/JSP文件中指定JAR文件，只需在Applet标记中加入ARCHIVE = "name.jar"声明。</P>
<P><BR>请参见《使用档案文件提高 applet 的加载速度》。</P>
<P><BR>3.2 提示Applet装入进程</P>
<P><BR>你是否看到过使用Applet的网站，注意到在应该运行Applet的地方出现了一个占位符？当Applet的下载时间较长时，会发生什么事情？最大的可能就是用户掉头离去。在这种情况下，显示一个Applet正在下载的信息无疑有助于鼓励用户继续等待。</P>
<P><BR>下面我们来看看一种具体的实现方法。首先创建一个很小的Applet，该Applet负责在后台下载正式的Applet：</P>
<P>&nbsp;</P>
<P>import java.applet.Applet;import java.applet.AppletStub;import java.awt.Label;import java.awt.Graphics;import java.awt.GridLayout; public class PreLoader extends Applet implements Runnable, AppletStub {&nbsp;&nbsp;&nbsp; String largeAppletName;&nbsp;&nbsp;&nbsp; Label label;&nbsp;&nbsp;&nbsp; public void init() {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 要求装载的正式Applet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; largeAppletName = getParameter("applet");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // "请稍等"提示信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label = new Label("请稍等..." + largeAppletName);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add(label);&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp; public void run(){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 获得待装载Applet的类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Class largeAppletClass = Class.forName(largeAppletName);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 创建待装载Applet的实例&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Applet largeApplet = (Applet)largeAppletClass.newInstance();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 设置该Applet的Stub程序&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; largeApplet.setStub(this);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 取消"请稍等"信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; remove(label);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 设置布局&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setLayout(new GridLayout(1, 0));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add(largeApplet);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 显示正式的Applet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; largeApplet.init();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; largeApplet.start();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception ex) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 显示错误信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label.setText("不能装入指定的Applet");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 刷新屏幕&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validate();&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; public void appletResize(int width, int height) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 把appletResize调用从stub程序传递到Applet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resize(width, height);&nbsp;&nbsp; }}<BR>&nbsp;</P>
<P>&nbsp;</P>
<P>编译后的代码小于2K，下载速度很快。代码中有几个地方值得注意。首先，PreLoader实现了AppletStub接口。一般地，Applet从调用者判断自己的codebase。在本例中，我们必须调用setStub()告诉Applet到哪里提取这个信息。另一个值得注意的地方是，AppletStub接口包含许多和Applet类一样的方法，但appletResize()方法除外。这里我们把对appletResize()方法的调用传递给了resize()方法。</P>
<P><BR>3.3 在画出图形之前预先装入它</P>
<P><BR>ImageObserver接口可用来接收图形装入的提示信息。ImageObserver接口只有一个方法imageUpdate()，能够用一次repaint()操作在屏幕上画出图形。下面提供了一个例子。</P>
<P>&nbsp;</P>
<P>public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((flags &amp; ALLBITS) !=0 {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repaint();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (flags &amp; (ERROR |ABORT )) != 0) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error = true;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 文件没有找到，考虑显示一个占位符&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repaint();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (flags &amp; (ALLBITS | ERROR| ABORT)) == 0;} <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>当图形信息可用时，imageUpdate()方法被调用。如果需要进一步更新，该方法返回true；如果所需信息已经得到，该方法返回false。</P>
<P><BR>3.4 覆盖update方法</P>
<P><BR>update()方法的默认动作是清除屏幕，然后调用paint()方法。如果使用默认的update()方法，频繁使用图形的应用可能出现显示闪烁现象。要避免在paint()调用之前的屏幕清除操作，只需按照如下方式覆盖update()方法：</P>
<P><BR>public void update(Graphics g) {&nbsp;&nbsp;&nbsp;&nbsp; paint(g);} <BR>&nbsp;</P>
<P><BR>更理想的方案是：覆盖update()，只重画屏幕上发生变化的区域，如下所示：</P>
<P><BR>public void update(Graphics g) {&nbsp;&nbsp;&nbsp;&nbsp; g.clipRect(x, y, w, h);&nbsp;&nbsp;&nbsp;&nbsp; paint(g);} <BR>&nbsp;</P>
<P><BR>3.5 延迟重画操作</P>
<P><BR>对于图形用户界面的应用来说，性能低下的主要原因往往可以归结为重画屏幕的效率低下。当用户改变窗口大小或者滚动一个窗口时，这一点通常可以很明显地观察到。改变窗口大小或者滚动屏幕之类的操作导致重画屏幕事件大量地、快速地生成，甚至超过了相关代码的执行速度。对付这个问题最好的办法是忽略所有"迟到"的事件。</P>
<P><BR>建议在这里引入一个数毫秒的时差，即如果我们立即接收到了另一个重画事件，可以停止处理当前事件转而处理最后一个收到的重画事件；否则，我们继续进行当前的重画过程。</P>
<P><BR>如果事件要启动一项耗时的工作，分离出一个工作线程是一种较好的处理方式；否则，一些部件可能被"冻结"，因为每次只能处理一个事件。下面提供了一个事件处理的简单例子，但经过扩展后它可以用来控制工作线程。</P>
<P><BR>&nbsp;</P>
<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.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">public&nbsp;static&nbsp;void&nbsp;runOnce(String&nbsp;id</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">&nbsp;final&nbsp;long&nbsp;milliseconds)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;synchronized(e_queue)&nbsp;{&nbsp;//&nbsp;e_queue:&nbsp;所有事件的集合&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!e_queue.containsKey(id))&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e_queue.put(token</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">&nbsp;new&nbsp;LastOne())</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;final&nbsp;LastOne&nbsp;lastOne&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(LastOne)&nbsp;e_queue.get(token)</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;final&nbsp;long&nbsp;time&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;System.currentTimeMillis()</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;//&nbsp;获得当前时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;lastOne.time&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;time</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;(new&nbsp;Thread()&nbsp;{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;run()&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(milliseconds&nbsp;&gt;&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(milliseconds)</SPAN><SPAN style="COLOR: #008000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;//&nbsp;暂停线程&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch&nbsp;(Exception&nbsp;ex)&nbsp;{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;synchronized(lastOne.running)&nbsp;{&nbsp;//&nbsp;等待上一事件结束&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(lastOne.time&nbsp;!</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;time)&nbsp;//&nbsp;只处理最后一个事件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;).start()</SPAN><SPAN style="COLOR: #008000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;static&nbsp;Hashtable&nbsp;e_queue&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;new&nbsp;Hashtable()</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;static&nbsp;class&nbsp;LastOne&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;long&nbsp;time</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #008000">;</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;Object&nbsp;running&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;new&nbsp;Object()</SPAN><SPAN style="COLOR: #008000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</SPAN></DIV>
<P><BR>&nbsp;</P>
<P>&nbsp;</P>
<P>3.6 使用双缓冲区</P>
<P><BR>在屏幕之外的缓冲区绘图，完成后立即把整个图形显示出来。由于有两个缓冲区，所以程序可以来回切换。这样，我们可以用一个低优先级的线程负责画图，使得程序能够利用空闲的CPU时间执行其他任务。下面的伪代码片断示范了这种技术。</P>
<P><BR>Graphics myGraphics;Image myOffscreenImage = createImage(size().width, size().height);Graphics offscreenGraphics = myOffscreenImage.getGraphics(); offscreenGraphics.drawImage(img, 50, 50, this);myGraphics.drawImage(myOffscreenImage, 0, 0, this); <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>3.7 使用BufferedImage</P>
<P><BR>Java JDK 1.2使用了一个软显示设备，使得文本在不同的平台上看起来相似。为实现这个功能，Java必须直接处理构成文字的像素。由于这种技术要在内存中大量地进行位复制操作，早期的JDK在使用这种技术时性能不佳。为解决这个问题而提出的Java标准实现了一种新的图形类型，即BufferedImage。</P>
<P><BR>BufferedImage子类描述的图形带有一个可访问的图形数据缓冲区。一个BufferedImage包含一个ColorModel和一组光栅图形数据。这个类一般使用RGB（红、绿、蓝）颜色模型，但也可以处理灰度级图形。它的构造函数很简单，如下所示：</P>
<P><BR>public BufferedImage (int width, int height, int imageType) <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>ImageType允许我们指定要缓冲的是什么类型的图形，比如5-位RGB、8-位RGB、灰度级等。</P>
<P><BR>3.8 使用VolatileImage</P>
<P><BR>许多硬件平台和它们的操作系统都提供基本的硬件加速支持。例如，硬件加速一般提供矩形填充功能，和利用CPU完成同一任务相比，硬件加速的效率更高。由于硬件加速分离了一部分工作，允许多个工作流并发进行，从而缓解了对CPU和系统总线的压力，使得应用能够运行得更快。利用VolatileImage可以创建硬件加速的图形以及管理图形的内容。由于它直接利用低层平台的能力，性能的改善程度主要取决于系统使用的图形适配器。VolatileImage的内容随时可能丢失，也即它是"不稳定的（volatile）"。因此，在使用图形之前，最好检查一下它的内容是否丢失。VolatileImage有两个能够检查内容是否丢失的方法：</P>
<P><BR>public abstract int validate(GraphicsConfiguration gc);public abstract Boolean contentsLost(); <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>每次从VolatileImage对象复制内容或者写入VolatileImage时，应该调用validate()方法。contentsLost()方法告诉我们，自从最后一次validate()调用之后，图形的内容是否丢失。</P>
<P><BR>虽然VolatileImage是一个抽象类，但不要从它这里派生子类。VolatileImage应该通过Component.createVolatileImage()或者GraphicsConfiguration.createCompatibleVolatileImage()方法创建。</P>
<P><BR>3.9 使用Window Blitting</P>
<P><BR>进行滚动操作时，所有可见的内容一般都要重画，从而导致大量不必要的重画工作。许多操作系统的图形子系统，包括WIN32 GDI、MacOS和X/Windows，都支持Window Blitting技术。Window Blitting技术直接在屏幕缓冲区中把图形移到新的位置，只重画新出现的区域。要在Swing应用中使用Window Blitting技术，设置方法如下：</P>
<P><BR>setScrollMode(int mode); <BR>&nbsp;</P>
<P>&nbsp;</P>
<P>在大多数应用中，使用这种技术能够提高滚动速度。只有在一种情形下，Window Blitting会导致性能降低，即应用在后台进行滚动操作。如果是用户在滚动一个应用，那么它总是在前台，无需担心任何负面影响。</P>
<P>&nbsp;</P><img src ="http://www.blogjava.net/bluesky/aggbug/30812.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 15:08 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30812.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows Media Player 播放问题~~Windows Media Player 无法播放 刻录或同步此文件</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30788.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 04:55:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30788.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30788.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30788.html#Feedback</comments><slash:comments>17</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30788.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30788.html</trackback:ping><description><![CDATA[Windows Media Player 无法播放、刻录或同步此文件，因为您的计算机上未安装必需的音频编解码器。<BR><BR>您尝试将文件刻录（复制）到 CD，但您以前从未在计算机上播放该文件。播放该文件，播放机应该尝试自动下载所需的编解码器。 <BR>播放机未配置为自动下载编解码器。要将播放机配置为自动下载编解码器，请在“工具”菜单上单击“选项”，再单击“播放机”选项卡，然后选中“自动下载编解码器”复选框。请注意，您必须以管理员或管理员组的成员身份登录才能完成上述过程。<BR><BR>OK~~<BR><A href="http://www.flickr.com/photos/chinawangliang/99626266/"><IMG height=232 src="http://static.flickr.com/42/99626266_e97913f50d_m.jpg" width=240 border=0></A><img src ="http://www.blogjava.net/bluesky/aggbug/30788.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 12:55 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30788.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[struts]MVC</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30783.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 04:22:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30783.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30783.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30783.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30783.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30783.html</trackback:ping><description><![CDATA[<A title="Photo Sharing" href="http://www.flickr.com/photos/chinawangliang/99581845/"></A><IMG src="http://static.flickr.com/26/99581845_d5513b1cbb.jpg">&nbsp;<BR>Struts is an open-source framework for building Model 2 web applications. 
<P>MVC框架</P>
<P>A controller servlet that dispatches requests to appropriate action classes<BR>provided by the application developer.</P>
<P>All requests are dispatched through a single controller servlet that is part of the<BR>framework.</P>
<P>单独的控制器把所有的请求集中分发</P>
<P>This controller provides numerous application-wide services, such as<BR>database connection pooling and automatic request dispatching. The controller<BR>creates action classes, which are built by the developer to perform the work of the<BR>application. These action classes extend the Struts Action class. This is a perfect<BR>example of a reusable framework part—the controller is designed to create<BR>Action subclasses to perform work. This aspect of Struts is based on the Command<BR>design pattern, which allows for parameterizing activities.</P>
<P>控制器提供了众多的应用程序范围的服务,例如数据库连接池,请求自动分发.控制器创建开发者提供解决业务问题的action业务类<BR>这些action类包括Struts Action class.控制器可以重复创建Action类是复用框架</P>
<P>The action instances create model beans that perform domain-specific activities.<BR>Examples of these activities include executing business logic, connecting to<BR>databases, and calling other bean methods. The model beans encapsulate the real<BR>work of the application, just as in Model 2. Once the action instance has utilized<BR>the model beans to perform work, it forwards the models that contribute to the<BR>display via the controller to a view component, generally a JSP (although other<BR>view options are possible; see the discussion on Velocity in chapter 9). The view<BR>extracts the model beans and presents the visual results to the user. As you can<BR>see, this is the same general information flow described in Model 2. Struts provides<BR>a great deal of the infrastructure to make it easy to accommodate this information<BR>flow.</P>
<P>Struts handles other details of application development as well. The framework<BR>includes numerous custom JSP tags to help you construct the view. It also<BR>provides classes that aid in internationalization, database connection pooling, and<BR>flexible resource mapping.</P>
<P>Struts is a fairly lightweight framework whose primary job is to facilitate building<BR>web applications using Model 2. I estimate that Struts saves from 35 to 40 percent<BR>of the typical amount of effort to build a Model 2 application. One of Struts’<BR>strengths is its cohesiveness—it doesn’t supply services outside those needed for<BR>building Model 2 applications. Other frameworks are much more extensive; the<BR>Turbine framework is one of them.<BR><BR>摘自&lt;ARTOF<BR>JAVA WEB<BR>DEVELOPMENT&gt;</P><img src ="http://www.blogjava.net/bluesky/aggbug/30783.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 12:22 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30783.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>抑郁症测试</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30752.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 02:02:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30752.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30752.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30752.html#Feedback</comments><slash:comments>194</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30752.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30752.html</trackback:ping><description><![CDATA[关键词： <A href="http://search.puson.com/search.aspx?query=" target=_blank></A><BR>如果您自己，或者您的亲属，比较长时间的心情不好、失眠、不爱说话，不爱活动等，您可以用我们介绍的心理测查方法，进行初步的测查一下，可以给您一个早期的、初步的评价，提供一个是不是得了抑郁症的线索。 <BR><BR>　　抑郁自评量表（简称SDS）是1965年仲氏发表的，一种病人自己进行的，抑郁自我评定量表。（详见Zung氏抑郁自评量表） <BR><BR>　　此量表简短，一般在十分钟之内就可以完成，不用任何仪器设备，方法简单。由20个问题组成，每一个问题代表着抑郁症的一个症状特点，合起来，可以反映出抑郁症的抑郁，心情、躯体不舒服的症状，精神运动，行为症状以及心理方面的症状。而且可以判断出抑郁的轻重的不同程度及有没有抑郁症状。 <BR><BR>　　由于可以判定抑郁的程度的轻重，因此，不仅用来进行辅助诊断，还可以用来观察用药后的疗效，是否好转，以及好转的程度，是不是已经恢复正常。 <BR><BR>　　此量表在使用前应注意以下几点： <BR><BR>　　这是个自我评定量表，因此，要病人或怀疑心情不好的人自己评定，别人不要提醒，更不要加以帮助评定或提出意见，来改变病人的看法。如果看不懂内容时，别人可以给念，由病人自己评价是什么水平，有还是没有…… <BR><BR>　　此量表评定的时间，不是几小时，1-2天内的体会，时间范围一般应该至少是1周的时间，如果是第一次评定，最好是两周的时间为合适。 <BR><BR>　　此量表20个题目中（请先看一下量表），有一半（10个）题目的问题是按症状的有无来提问的，如："我夜间睡眠不好"。评分时，从无、有时、经常到持续共四个等级，评分从1分到4分，逐渐加重，无--代表没有失眠（1分）；有时--代表一周之内有1～2天有失眠（2分）；经常--代表一周之内有3一4天失眠（3分）；持续--代表天天失眠（4分）。另一半题目的问题，是与症状相反提问的，如"我吃饭像平时一样多"。实际上，抑郁病人有食欲下降的症状，但问题却是反向的，在评分时，从无、有时、经常、持续的四个等级评分，也正好相反，是逐步减轻的，无--代表不是和平时一样多，而且是天天都吃得比平时少，为4分；有时--代表有时，一周内l～2天吃得和平时一样多（3分）；经常---一周内3～4天吃得和平时一样多（2分）；持续--天天吃得和平时一样多，无食欲下降的症状（1分），所以，在进行评定时，千万要注意，是属于正向的，还是反向的问题。 <BR><BR>　　此量表最后结果的计算方法如下：先把20个题目综合相加，得出总分，再转换成百分指数，方法见公式： <BR><BR>　　　　　　　　　　　　 <BR><BR>　　指数计算公式：指数= 总分（得分）/总分满分（80）x100 <BR><BR>　　 <BR>　　作者指出：指数与抑郁症状的严重程度的关系如下：指数在50%以下：正常范围（无抑郁症状）；指数在 50%～59%：轻度抑郁；指数在 60%一69%：中度抑郁；指数在 70%及以上为重度至严重抑郁。 <BR><BR>　　此量表虽然可以测出抑郁的轻重程度，却不能判断抑郁的分类，测出有抑郁症之后，应该及时到精神科门诊进行详细的检查、诊断及治疗 <BR><BR>　　抑郁自评量表 <BR><BR>　　此表是1965年仲氏发表制定的，不仅可以测查出抑郁心情的程基，是轻还是重，还可以帮助一部分以身体各种不舒适体验为主的病人．判断出有无抑郁症状，有助于隐匿性抑郁症的诊断。因此，适用于情绪低落，常常感觉无兴趣，活着没意思的人的测查。也适用于各种慢性身体疾病的病人者进行测查。 <BR><BR>　　此量表极为简单，由20道题组成，是自己根据自己一个星期之内的感觉来回答的。20个题目之中，分别反映出抑郁心情，身体症状，精神运动行为及心理方面的症状体验，因为是自我评价，不要别人参加评价，也不用别人提醒。如果是文盲，可以由别人给念题目，不由别人代答，由自己判定轻重程度。 <BR><BR>　　在回答时，应注意，有的题目的陈述是相反的意思，例如，心情忧郁的病人常常感到生活没有意思，但题目之中的问题是感觉生活很有意思，那么评分时应注意得分是相反的。这类题目之前加上*号，提醒各位检查及被检查者注意。 <BR>　　 <BR><BR>　　　　　　　　　　　　　　ZUNG氏抑郁量表 <BR><BR><BR>请根据您近一周的感觉来进行评分，数字的顺序依次为从无、有时、经常、持续 <BR><BR>1、我感到情绪沮丧，郁闷 1 2 3 4 <BR>*2、我感到早晨心情最好 4 3 2 1 <BR>3、我要哭或想哭 1 2 3 4 <BR>4、我夜间睡眠不好 1 2 3 4 <BR>*5、我吃饭象平时一样多 4 3 2 1 <BR>*6、我的性功能正常 4 3 2 1 <BR>7、我感到体重减轻 1 2 3 4 <BR>8、我为便秘烦恼． 1 2 3 4 <BR>9．我的心跳比平时快 1 2 3 4 <BR>10、我无故感到疲劳 1 2 3 4 <BR>*11．我的头脑象往常一样清楚 4 3 2 1 <BR>*12、我做事情象平时一样不感到困难 4 3 2 1 <BR>13、我坐卧不安，难以保持平静 1 2 3 4 <BR>*14、我对未来感到有希望 4 3 2 1 <BR>15、我比平时更容易激怒 1 2 3 4 <BR>*16、我觉得决定什么事很容易 4 3 2 1 <BR>*17．我感到自已是有用的和不可缺少的人 4 3 2 1 <BR>*18、我的生活很有意义 4 3 2 1 <BR>19、假若我死了别人会过得更好 1 2 3 4 <BR>*20、我仍旧喜爱自己平时喜爱的车西 4 3 2 1 <BR><BR>结果分析：指标为总分。将20个项目的各个得分相加，即得粗分。标准分等于粗分乘以1.25后的整数部分。总粗分的正常上限为41分，标准总分为53分。仅做参考。 <BR><BR>此评定量表不仅可以帮助诊断是否有抑郁症状，还可以判定抑郁程度的轻重。因此，一方面可以用来作为辅助诊断的工具，另一方面也可以用来观察在治疗过程中抑郁的病情变化，用来作为疗效的判定指标。但是，此评定量表不能用来判断抑郁的性质，所以不是抑郁症的病因及疾病诊断分类用表。<BR><A href="http://www.puson.com/psychology/200409/974_31977.aspx">http://www.puson.com/psychology/200409/974_31977.aspx<BR></A><BR>60 中度抑郁了~~<img src ="http://www.blogjava.net/bluesky/aggbug/30752.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 10:02 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30752.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>抑郁症</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30749.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 01:52:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30749.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30749.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30749.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30749.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30749.html</trackback:ping><description><![CDATA[</FONT>什么是抑郁症<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;抑郁症是情感性精神障碍的一种情感状态，情感性精神障碍是指以心境显著而持久的改变（高涨或低落）为基本临床表现，并伴有相应思维和行为异常的一类精神障碍。抑郁症的主要表现为：心境抑郁、悲观失望、兴致丧失、精力减退和行动迟缓，心境抑郁是最核心的症状。若能明确诊断，治疗效果较好。&lt;br&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;抑郁症发病常缓慢起病，往往先有失眠，食欲不振以及各种躯体不适感。而主要由精神因素诱发抑郁的病例起病较急。秋冬季抑郁发作多见，少数病人似有自己的好发季节。本病病程呈发作性，间歇发作或与躁狂症交替发作，有较为明鲜的缓解期。每次发作持续时间因人而异，多数为6个月，少数发作持续长达1-2年。病程的长短与年龄、病情严重度以及发病次数有关，一般发作次数越多或年龄越大，病程持续时间就越长，缓解期也相对缩短。<BR>&nbsp;&nbsp;&nbsp;<BR>
<P>抑郁症的症状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; （一）、生理方面症状：胃口变差、食欲减退或增加、体重明显减轻或增加、失眠或嗜睡、几乎整天都极度疲劳与缺乏能量、精神或动作反应激动或迟滞、性欲降低、头痛、头昏、眼睛疲劳、眼角酸痛、口渴、颈部酸痛、胸闷、呼吸不畅、胸痛、腹胀、频尿、身体酸痛、腰酸痛、盗汗与便秘感或一天数次大便等。 <BR>　　（二）、心理方面症状：忧郁、心情沮丧或掉到谷底、无望、易流泪、悲伤、激动易怒、害怕与恐惧、寂寞、无聊、感情淡薄、对自己不满意、满足感减少、兴趣明显减退、失去幽默感、低估自己能力、悲观、自我谴责（常感到罪恶感或无价值感）、低自尊、容易感到挫折、社交退缩、时常健忘、思考、注意、决断力减退或犹豫不决、意志丧失、作业效率或生产力皆减少、自杀意念及行为、胸部沉重苦闷与强迫回想旧事等。</P>
<P>　　（三）、下列行为改变可能是孩童与青少年期常见的症状：功课突然退步、突然开始坐立不安、身体动作突然变慢、讲话音调变单调或变得沉默不语、无法解释地情绪激躁、无法解释地常常哭泣、常常显得很害怕或紧张、突然变得有攻击性、有反社会行为、开始使用酒精或其它成瘾性物质、不停地抱怨身体某部位疼痛不适，却又找不到病因。</P>
<P>　　（四）、严重的忧郁症患者则因伴随：无用妄想、罪恶妄想、惩罚妄想、疾病妄想、贫穷妄想、幻听等症状，常易使医师误诊为精神分裂症。<BR></P><img src ="http://www.blogjava.net/bluesky/aggbug/30749.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 09:52 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30749.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[歌词]迷恋&lt;郑伊健&gt;</title><link>http://www.blogjava.net/bluesky/archive/2006/02/15/30734.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Wed, 15 Feb 2006 01:07:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/15/30734.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30734.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/15/30734.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30734.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30734.html</trackback:ping><description><![CDATA[<P><FONT face=Arial size=2>迷恋---郑伊健<BR>迷恋你的眼睛已经很挂念你<BR>迷恋你的细胞倍增有否危机<BR>让我逐吋逐吋的爱惜你<BR>用浪漫分泌令四周气氛<BR>弥漫特别的美谁也妒嫉我<BR>被你幸福紧抱的我</FONT></P>
<P><FONT size=2><FONT face=Arial>如果九州火山有天不再热暖<BR>若有天澳洲海边看不见歌剧院<BR>如若世上贵重的都消失了<BR>还为甚么打算没太多意思<BR>留下独自嗟怨<BR>如我没有遇你甚么都不应叫优美<BR>恳请天与地同为证于此一世都深爱你<BR>天甚么高情一般的高<BR>我只有一世确不足爱你<BR>不需参透任何玄机迷信我爱的只有你<BR>天怎么高情一般的高<BR>还于这生相约下生相爱</FONT><BR></FONT></P><img src ="http://www.blogjava.net/bluesky/aggbug/30734.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-15 09:07 <a href="http://www.blogjava.net/bluesky/archive/2006/02/15/30734.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>男友把女友推进了海里!</title><link>http://www.blogjava.net/bluesky/archive/2006/02/14/30682.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Tue, 14 Feb 2006 13:09:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/14/30682.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30682.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/14/30682.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30682.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30682.html</trackback:ping><description><![CDATA[有一对情侣，男的非常懦弱，做什么事情之前都让女友先试。女友对此十分不满。&nbsp;一次，两人出海，返航时，飓风将小艇摧毁，幸亏女友抓住了一块木板才保住了两人的性命。女友问男友："你怕吗？"男友从怀中掏出一把水果刀，说：怕，但有鲨鱼来，我就用这个对付它。"女友只是摇头苦笑。&nbsp;不久，一艘货轮发现了他们，正当他们欣喜若狂时，一群鲨鱼出现了，女友大叫：'我们一起用力游，会没事的！"男友却突然用力将女友推进海里，*扒着木板朝货轮了,并喊道："这次我先试！"女友惊呆了，望着男友的背影，感到非常绝望。鲨鱼正在靠近，可对女友不感兴趣而径直向男友游去，男友被鲨鱼凶猛地撕咬着，他发疯似地冲女友喊道："我爱你！"&nbsp;女友获救了，甲板上的人都在默哀，船长坐到女友身边说："小姐,他是我见过最勇敢的人。我们为他祈祷！","不，他是个胆小鬼。"女友冷冷地说。&nbsp;"您怎么这样说呢？刚才我一直用望远镜观察你们，我清楚地看到他把你推开后用刀子割破了自己的手腕。鲨鱼对血腥味很敏感，如果他不这样做来争取时间，恐怕你永远不会出现在这艘船上.....&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;<img src ="http://www.blogjava.net/bluesky/aggbug/30682.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-14 21:09 <a href="http://www.blogjava.net/bluesky/archive/2006/02/14/30682.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenGL</title><link>http://www.blogjava.net/bluesky/archive/2006/02/14/30641.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Tue, 14 Feb 2006 09:23:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/14/30641.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30641.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/14/30641.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30641.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30641.html</trackback:ping><description><![CDATA[<P>main.cpp<BR>/**************************<BR>&nbsp;* Includes<BR>&nbsp;*<BR>&nbsp;**************************/</P>
<P>#include &lt;windows.h&gt;<BR>#include &lt;gl/gl.h&gt;</P>
<P><BR>/**************************<BR>&nbsp;* Function Declarations<BR>&nbsp;*<BR>&nbsp;**************************/</P>
<P>LRESULT CALLBACK WndProc (HWND hWnd, UINT message,<BR>WPARAM wParam, LPARAM lParam);<BR>void EnableOpenGL (HWND hWnd, HDC *hDC, HGLRC *hRC);<BR>void DisableOpenGL (HWND hWnd, HDC hDC, HGLRC hRC);</P>
<P><BR>/**************************<BR>&nbsp;* WinMain<BR>&nbsp;*<BR>&nbsp;**************************/</P>
<P>int WINAPI WinMain (HINSTANCE hInstance,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HINSTANCE hPrevInstance,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LPSTR lpCmdLine,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int iCmdShow)<BR>{<BR>&nbsp;&nbsp;&nbsp; WNDCLASS wc;<BR>&nbsp;&nbsp;&nbsp; HWND hWnd;<BR>&nbsp;&nbsp;&nbsp; HDC hDC;<BR>&nbsp;&nbsp;&nbsp; HGLRC hRC;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; MSG msg;<BR>&nbsp;&nbsp;&nbsp; BOOL bQuit = FALSE;<BR>&nbsp;&nbsp;&nbsp; float theta = 0.0f;</P>
<P>&nbsp;&nbsp;&nbsp; /* register window class */<BR>&nbsp;&nbsp;&nbsp; wc.style = CS_OWNDC;<BR>&nbsp;&nbsp;&nbsp; wc.lpfnWndProc = WndProc;<BR>&nbsp;&nbsp;&nbsp; wc.cbClsExtra = 0;<BR>&nbsp;&nbsp;&nbsp; wc.cbWndExtra = 0;<BR>&nbsp;&nbsp;&nbsp; wc.hInstance = hInstance;<BR>&nbsp;&nbsp;&nbsp; wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);<BR>&nbsp;&nbsp;&nbsp; wc.hCursor = LoadCursor (NULL, IDC_ARROW);<BR>&nbsp;&nbsp;&nbsp; wc.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH);<BR>&nbsp;&nbsp;&nbsp; wc.lpszMenuName = NULL;<BR>&nbsp;&nbsp;&nbsp; wc.lpszClassName = "GLSample";<BR>&nbsp;&nbsp;&nbsp; RegisterClass (&amp;wc);</P>
<P>&nbsp;&nbsp;&nbsp; /* create main window */<BR>&nbsp;&nbsp;&nbsp; hWnd = CreateWindow (<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "GLSample", "OpenGL Sample", <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, 0, 256, 256,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL, NULL, hInstance, NULL);</P>
<P>&nbsp;&nbsp;&nbsp; /* enable OpenGL for the window */<BR>&nbsp;&nbsp;&nbsp; EnableOpenGL (hWnd, &amp;hDC, &amp;hRC);</P>
<P>&nbsp;&nbsp;&nbsp; /* program main loop */<BR>&nbsp;&nbsp;&nbsp; while (!bQuit)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* check for messages */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (PeekMessage (&amp;msg, NULL, 0, 0, PM_REMOVE))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* handle or dispatch messages */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (msg.message == WM_QUIT)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bQuit = TRUE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TranslateMessage (&amp;msg);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DispatchMessage (&amp;msg);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* OpenGL animation code goes here */</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glClearColor (0.0f, 0.0f, 0.0f, 0.0f);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glClear (GL_COLOR_BUFFER_BIT);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glPushMatrix ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glRotatef (theta, 0.0f, 0.0f, 1.0f);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glBegin (GL_TRIANGLES);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glColor3f (1.0f, 0.0f, 0.0f);&nbsp;&nbsp; glVertex2f (0.0f, 1.0f);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glColor3f (0.0f, 1.0f, 0.0f);&nbsp;&nbsp; glVertex2f (0.87f, -0.5f);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glColor3f (0.0f, 0.0f, 1.0f);&nbsp;&nbsp; glVertex2f (-0.87f, -0.5f);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glEnd ();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glPopMatrix ();</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SwapBuffers (hDC);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theta += 1.0f;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sleep (1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp; /* shutdown OpenGL */<BR>&nbsp;&nbsp;&nbsp; DisableOpenGL (hWnd, hDC, hRC);</P>
<P>&nbsp;&nbsp;&nbsp; /* destroy the window explicitly */<BR>&nbsp;&nbsp;&nbsp; DestroyWindow (hWnd);</P>
<P>&nbsp;&nbsp;&nbsp; return msg.wParam;<BR>}</P>
<P><BR>/********************<BR>&nbsp;* Window Procedure<BR>&nbsp;*<BR>&nbsp;********************/</P>
<P>LRESULT CALLBACK WndProc (HWND hWnd, UINT message,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WPARAM wParam, LPARAM lParam)<BR>{</P>
<P>&nbsp;&nbsp;&nbsp; switch (message)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; case WM_CREATE:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>&nbsp;&nbsp;&nbsp; case WM_CLOSE:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PostQuitMessage (0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;</P>
<P>&nbsp;&nbsp;&nbsp; case WM_DESTROY:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;</P>
<P>&nbsp;&nbsp;&nbsp; case WM_KEYDOWN:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (wParam)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case VK_ESCAPE:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PostQuitMessage(0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;</P>
<P>&nbsp;&nbsp;&nbsp; default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return DefWindowProc (hWnd, message, wParam, lParam);<BR>&nbsp;&nbsp;&nbsp; }<BR>}</P>
<P><BR>/*******************<BR>&nbsp;* Enable OpenGL<BR>&nbsp;*<BR>&nbsp;*******************/</P>
<P>void EnableOpenGL (HWND hWnd, HDC *hDC, HGLRC *hRC)<BR>{<BR>&nbsp;&nbsp;&nbsp; PIXELFORMATDESCRIPTOR pfd;<BR>&nbsp;&nbsp;&nbsp; int iFormat;</P>
<P>&nbsp;&nbsp;&nbsp; /* get the device context (DC) */<BR>&nbsp;&nbsp;&nbsp; *hDC = GetDC (hWnd);</P>
<P>&nbsp;&nbsp;&nbsp; /* set the pixel format for the DC */<BR>&nbsp;&nbsp;&nbsp; ZeroMemory (&amp;pfd, sizeof (pfd));<BR>&nbsp;&nbsp;&nbsp; pfd.nSize = sizeof (pfd);<BR>&nbsp;&nbsp;&nbsp; pfd.nVersion = 1;<BR>&nbsp;&nbsp;&nbsp; pfd.dwFlags = PFD_DRAW_TO_WINDOW | <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;<BR>&nbsp;&nbsp;&nbsp; pfd.iPixelType = PFD_TYPE_RGBA;<BR>&nbsp;&nbsp;&nbsp; pfd.cColorBits = 24;<BR>&nbsp;&nbsp;&nbsp; pfd.cDepthBits = 16;<BR>&nbsp;&nbsp;&nbsp; pfd.iLayerType = PFD_MAIN_PLANE;<BR>&nbsp;&nbsp;&nbsp; iFormat = ChoosePixelFormat (*hDC, &amp;pfd);<BR>&nbsp;&nbsp;&nbsp; SetPixelFormat (*hDC, iFormat, &amp;pfd);</P>
<P>&nbsp;&nbsp;&nbsp; /* create and enable the render context (RC) */<BR>&nbsp;&nbsp;&nbsp; *hRC = wglCreateContext( *hDC );<BR>&nbsp;&nbsp;&nbsp; wglMakeCurrent( *hDC, *hRC );</P>
<P>}</P>
<P><BR>/******************<BR>&nbsp;* Disable OpenGL<BR>&nbsp;*<BR>&nbsp;******************/</P>
<P>void DisableOpenGL (HWND hWnd, HDC hDC, HGLRC hRC)<BR>{<BR>&nbsp;&nbsp;&nbsp; wglMakeCurrent (NULL, NULL);<BR>&nbsp;&nbsp;&nbsp; wglDeleteContext (hRC);<BR>&nbsp;&nbsp;&nbsp; ReleaseDC (hWnd, hDC);<BR>}<BR></P><img src ="http://www.blogjava.net/bluesky/aggbug/30641.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-14 17:23 <a href="http://www.blogjava.net/bluesky/archive/2006/02/14/30641.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转载]C++: Hello, C++/CLI </title><link>http://www.blogjava.net/bluesky/archive/2006/02/14/30638.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Tue, 14 Feb 2006 09:02:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/14/30638.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30638.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/14/30638.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30638.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30638.html</trackback:ping><description><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width="50%"><IMG class=clsImgButton id=contentbtn onclick="ToggleMenu(contentbtn, contentmenu);" height=9 alt="" hspace=5 src="http://msdn.microsoft.com/msdnmag/images/minus.gif" width=9 align=absMiddle vspace=2><A onclick="ToggleMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#void" target=_self name=contents><B>Contents</B></A><BR>
<DIV id=contentmenu style="MARGIN-TOP: 10px; DISPLAY: block; MARGIN-LEFT: 20px"><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S1" target=_self>What is C++/CLI?</A><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S2" target=_self>Learning C++/CLI </A><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S3" target=_self>Mapping C++/CLI to the CTS?</A><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S4" target=_self>CLI Level of Detail </A><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S5" target=_self>What Are the Issues?</A><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S6" target=_self>Additional Functionality </A><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#S7" target=_self>So, What Did You Say About C++/CLI?</A><BR></DIV></TD></TR></TBODY></TABLE>
<HR>
<BR>
<DIV class=articletext>
<P class=clsNoIndent><SPAN class=clsGloss>C++/CLI is a self-contained,</SPAN>&nbsp; component-based dynamic programming language that, like C# or Java, is derived from C++. Unlike those languages, however, we have worked hard to integrate C++/CLI into ISO-C++, using the historical model of evolving the C/C++ programming language to support modern programming paradigms. You can say that C++/CLI is to C++ as C++ is to C. More generally, you can view the evolution leading to C++/CLI in the following historical context: 
<UL>
<LI>BCPL (Basic Computer Programming Language) 
<LI>B (Ken Thompson, original UNIX work) 
<LI>C (Dennis Ritchie, adding type and control structure to B) 
<LI>C with Classes (~1979) 
<LI>C84 (~1984) 
<LI>Cfront, release E (~1984-to universities) 
<LI>Cfront, release 1.0 (1985-to the world )—20th birthday 
<LI>Multiple/Virtual Inheritance (MI) programming (~1988) 
<LI>Generic Programming (~1991) (templates) 
<LI>ANSI C++/ ISO-C++ (~1996) 
<LI>Dynamic Component programming (~2005) (C++/CLI)</LI></UL>
<P></P><BR><A name=S1></A><SPAN class=clsSubhead>What is C++/CLI?</SPAN><BR>
<P>C++/CLI represents a tuple. C++ refers, of course, to the C++ programming language invented by Bjarne Stroustrup at Bell Laboratories. It supports a static object model that is optimized for the speed and size of its executables. However, it doesn't support run-time modification of the program other than heap allocation. It allows unlimited access to the underlying machine, but very little access to the types active in the running program and no real access to the associated infrastructure of that program. Herb Sutter, a former colleague of mine at Microsoft and the chief architect of C++/CLI, refers to C++ as a concrete language.</P>
<P>CLI refers to the Common Language Infrastructure, a multitiered architecture supporting a dynamic component programming model. In many ways, this represents a complete reversal of the C++ object model. A runtime software layer, the virtual execution system, runs between the program and the underlying operating system. Access to the underlying machine is fairly constrained. Access to the types active in the executing program and the associated program infrastructure—both as discovery and construction—is supported. The slash (/) represents a binding between C++ and the CLI. The details surrounding this binding make up the general topic of this column.</P>
<P>So, a first approximation of an answer to what is C++/CLI is that it is a binding of the static C++ object model to the dynamic component object model of the CLI. In short, it is how you do .NET programming using C++ rather than C# or Visual Basic®. Like C# and the CLI itself, C++/CLI is undergoing standardization under the European Computer Manufacturers Association (ECMA) and eventually under ISO.</P>
<P>The common language runtime (CLR) is the Microsoft version of the CLI that is specific to the Windows® operating system. Similarly, Visual C++® 2005 is the implementation of C++/CLI.</P>
<P>As a second approximation of an answer, I would say that C++/CLI integrates the .NET programming model within C++ in the same way as, back at Bell Laboratories, we integrated generic programming using templates within the then existing C++. In both of these cases your investment in an existing C++ codebase and in your existing C++ expertise are preserved. This was an essential baseline requirement of the design of C++/CLI.</P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><A name=S2></A><SPAN class=clsSubhead>Learning C++/CLI </SPAN><BR>
<P>There are three aspects in the design of a CLI language that hold true across all languages: a mapping of language-level syntax to the underlying Common Type System (CTS), the choice of a level of detail to expose the underlying CLI infrastructure to the manipulation of the programmer, and the choice of additional functionality to provide, beyond that supported directly by the CLI.</P>
<P>The first item is largely the same across all CLI languages. The second and third items are where one CLI language distinguishes itself from another. Depending on the kinds of problems you need to solve, you'll choose one or another language, or possibly combine multiple CLI languages. Learning C++/CLI involves understanding each of these aspects of its design.</P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><A name=S3></A><SPAN class=clsSubhead>Mapping C++/CLI to the CTS?</SPAN><BR>
<P>It is important when programming C++/CLI to learn the underlying CTS, which includes these three general class types: 
<UL>
<LI>The polymorphic reference type, which is what you use for all class inheritance. 
<LI>The non-polymorphic value type, which is used for implementing concrete types requiring runtime efficiency, such as the numeric types. 
<LI>The abstract interface type, which is used for defining a set of operations common to a set of either reference or value types that implement the interface.</LI></UL>
<P></P>
<P>This design aspect, the mapping of the CTS to a set of built-in language types, is common across all CLI languages although, of course, the syntax varies in each CLI language. So, for example, in C#, you would write <PRE class=clsCode>abstract class Shape { ... } // C#
</PRE>to define an abstract Shape base class from which specific geometric objects are to be derived, while in C++/CLI you write <PRE class=clsCode>ref class Shape abstract { ... }; // C++/CLI
</PRE>to indicate the exact same underlying CLI reference type. The two declarations are represented exactly the same way in the underlying IL. Similarly, in C#, you write <PRE class=clsCode>struct Point2D { ... } // C#
</PRE>to define a concrete Point2D class, while in C++/CLI you write: <PRE class=clsCode>value class Point2D { ... }; // C++/CLI
</PRE>
<P></P>
<P>The family of class types supported with C++/CLI represents an integration of the CTS with the native facilities, and that determines your choice of syntax. For example: <PRE class=clsCode>class native {};
value class V {};
ref class R {};
interface class I {};
</PRE>
<P></P>
<P>The CTS also supports an enumeration class type that behaves somewhat differently from the native enumeration, and support is provided for both of those as well: <PRE class=clsCode>enum native { fail, pass }; 
enum class CLIEnum : char { fail, pass}; 
</PRE>Similarly, the CTS supports its own array type that again behaves differently from the native array. And again Microsoft provides support for both: <PRE class=clsCode>int native[] = { 1,1,2,3,5,8 }; 
array&lt;int&gt;^ managed = { 1,1,2,3,5,8 };
</PRE>
<P></P>
<P>No CLI language is closer to or more nearly a mapping to the underlying CTS than another. Rather, each CLI language represents a view into the underlying CTS object model.</P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><A name=S4></A><SPAN class=clsSubhead>CLI Level of Detail </SPAN><BR>
<P>The second design aspect that must be considered when designing a CLI language is the level of detail of the underlying CLI implementation model to incorporate into the language. What kind of problems will the language be tasked to solve? Does the language have the tools necessary to do this? Also, what sort of programmers is the language likely to attract?</P>
<P>Take, for example, the issue of value types occurring on the managed heap. Value types can find themselves on the managed heap in a number of circumstances: 
<UL>
<LI>Through implicit boxing, when an instance of a value type is assigned to an Object or when a virtual method is invoked through a value type that is not overridden. 
<LI>When that value type is serving as a member of a reference class type. 
<LI>When that value type is being stored as the element type of a CLI array.</LI></UL>Whether the programmer should be allowed to manipulate the address of a value type of this sort is a CLI language design consideration that must be addressed. 
<P></P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><A name=S5></A><SPAN class=clsSubhead>What Are the Issues?</SPAN><BR>
<P>Any object located on the managed heap is subject to relocation during the compaction phase of a sweep of the garbage collector. Any pointers to that object must be tracked and updated by the runtime; the programmer cannot manually track it herself. Therefore, if you were allowed to take the address of a value type that might be on the managed heap, there would need to be a tracking form of pointer in addition to the existing native pointer.</P>
<P>What are the trade-offs to consider? On the one hand, there's simplicity and safety. Directly introducing support in the language for either one or a family of tracking pointers makes it a more complicated language. By not supporting this, the available pool of programmers is expanded because less sophistication is required. In addition, allowing the programmer access to these ephemeral value types increases the possibility of programmer error—she may purposely or inadvertently do dangerous things to the memory. By not supporting tracking pointers, a potentially safer runtime environment is created.</P>
<P>On the other hand, efficiency and flexibility must be considered. Each time you assign the same Object with a value type, a new boxing of the value occurs. Allowing access to the boxed value type allows in-memory update, which may provide significant performance improvements. Without a form of tracking pointer, you cannot iterate over a CLI array using pointer arithmetic. This means that the CLI array cannot participate in the Standard Template Library (STL) iterator pattern and work with the generic algorithms. Allowing access to the boxed value type allows significant design flexibility.</P>
<P>Microsoft chose to provide a collection of addressing modes that handle value types on the managed heap in C++/CLI: <PRE class=clsCode>int ival = 1024;
int^ boxedi = ival; 

array&lt;int&gt;^ ia = gcnew array&lt;int&gt;{1,1,2,3,5,8};
interior_ptr&lt;int&gt; begin = &amp;ia[0];

value struct smallInt { int m_ival; ... } si;
pin_ptr&lt;int&gt; ppi = &amp;si.m_ival;
</PRE>
<P></P>
<P>The typical C++/CLI developer is a sophisticated system programmer tasked with providing infrastructure and organizationally critical applications that serve as the foundation over which a business builds its future. She must address both scalability and performance concerns and must therefore have a system-level view into the underlying CLI. The level of detail of a CLI language reflects the face of its programmer.</P>
<P>Complexity is not in itself a negative quality. Human beings are more complicated than single-cell bacteria, and that is certainly not a bad thing. However, when the expression of a simple concept is made complicated, that is usually considered to be a bad thing. In C++/CLI, the CLI team has tried to provide an elegant way to express complex subject matter.</P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><A name=S6></A><SPAN class=clsSubhead>Additional Functionality </SPAN><BR>
<P>A third design aspect is a language-specific layer of functionality above and beyond what is directly supported by the CLI. This may require a mapping between the language-level support and the underlying implementation model of the CLI. In some cases, this just isn't possible because the language cannot intercede with the behavior of the CLI. One example of this is the virtual function resolution in the constructor and destructor of a base class. To reflect ISO-C++ semantics in this case would require a resetting of the virtual table within each base class constructor and destructor. This is not possible because virtual table handling is managed by the runtime and not by the individual language.</P>
<P>So this design aspect is a compromise between what would be preferable to do, and what is feasible. The three primary areas of additional functionality that are provided by C++/CLI are the following: 
<UL>
<LI>A form of Resource Acquisition is Initialization (RAII) for reference types, in particular, to provide an automated facility for what is referred to as deterministic finalization of garbage- collected types that hold scarce resources. 
<LI>A form of deep-copy semantics associated with the C++ copy constructor and copy assignment operator; however, these semantics could not be extended to value types. 
<LI>Direct support of C++ templates for CTS types in addition to the CLI generic mechanism. In addition, a verifiable version of the STL for CLI types is provided.</LI></UL>
<P></P>
<P>Let's look at a brief example: the issue of deterministic finalization. Before the memory associated with an object is reclaimed by the garbage collector, an associated Finalize method, if present, is invoked. You can think of this method as a kind of super-destructor since it is not tied to the program lifetime of the object. This is called finalization. The timing of just when or even whether a Finalize method is invoked is undefined. This is what is meant by nondeterministic finalization of the garbage collector.</P>
<P>Nondeterministic finalization works well with dynamic memory management. When available memory gets sufficiently scarce, the garbage collector kicks in and solves the problem. Nondeterministic finalization does not work well, however, when an object maintains a critical resource such as a database connection, a lock of some sort, or perhaps native heap memory. In this case, it would be great to release the resource as soon as it is no longer needed. The solution that is currently supported by the CLI is for a class to free the resources in its implementation of the Dispose method of the IDisposable interface. The problem here is that Dispose requires an explicit invocation, and therefore is not likely to be invoked.</P>
<P>A fundamental design pattern in C++ is the aforementioned Resource Acquisition is Initialization, which means that a class acquires resources within its constructor. Conversely, a class frees its resources within its destructor. This is managed automatically within the lifetime of the class object.</P>
<P>Here's what reference types should do in terms of the freeing of scarce resources: 
<UL>
<LI>Use the destructor to encapsulate the necessary code for the freeing of any resources associated with the class. 
<LI>Have the destructor invoked automatically, tied with the lifetime of the class object.</LI></UL>
<P></P>
<P>The CLI has no notion of the class destructor for a reference type. So the destructor has to be mapped to something else in the underlying implementation. Internally, then, the compiler performs the following transformations: 
<UL>
<LI>The class has its base class list extended to inherit from the IDisposable interface. 
<LI>The destructor is transformed into the Dispose method of IDisposable.</LI></UL>
<P></P>
<P>That represents half of the goal. A way to automate the invocation of the destructor is still needed. A special stack-based notation for a reference type is supported; that is, one in which its lifetime is associated within the scope of its declaration. Internally, the compiler transforms the notation to allocate the reference object on the managed heap. With the termination of the scope, the compiler inserts an invocation of the Dispose method—the user-defined destructor. Reclamation of the actual memory associated with the object remains under the control of the garbage collector. <A class=clsFigs onclick="OpenUrl('default.aspx?fig=true#fig1'); return false;" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx?fig=true#fig1" target=_self xmlns:user="http://msdn.microsoft.com">Figure&nbsp;1</A> shows an example.</P>
<P>C++/CLI is not just an extension of C++ into the managed world. Rather, it represents a fully integrated programming paradigm similar in extent to the earlier integration of the multiple inheritance and generic programming paradigms into the language. I think the team has done an outstanding job.</P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><A name=S7></A><SPAN class=clsSubhead>So, What Did You Say About C++/CLI?</SPAN><BR>
<P>C++/CLI represents an integration of native and managed programming. In this iteration, that has been done through a kind of separate but equal community of source-level and binary elements, including Mixed mode (source-level mix of native and CTS types, plus a binary mix of native and CIL object files), Pure mode (source-level mix of native and CTS types, all compiled to CIL object files), Native classes (can hold CTS types through a special wrapper class only), and CTS classes (can hold native types only as pointers). Of course, the C++/CLI programmer can also choose to program in the CLI types alone, and in this way provide verifiable code that can be hosted, for example, as a stored procedure in SQL Server<SUP class=clsSmall>™</SUP> 2005.</P>
<P>So, returning to the question, what is C++/CLI? It is a first-class entry visa into the .NET programming model. With C++/CLI, there is a C++ migration path not just for the C++ source base but for C++ expertise as well. I find great satisfaction in that.</P>
<DIV style="MARGIN-TOP: 5px" align=right><A class=clsSmall onclick="OpenMenu(contentbtn, contentmenu);" href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx#contents" target=_self>Back to Contents</A><IMG style="MARGIN-LEFT: 5px" height=8 alt="Back to top" src="http://msdn.microsoft.com/msdnmag/images/top.gif" width=18 align=bottom border=0></DIV><BR><SPAN class=clsGloss>Send your questions and comments to &nbsp;<A href="mailto:purecpp@microsoft.com">purecpp@microsoft.com</A>.</SPAN><BR></DIV>
<HR>
<SPAN class=clsBio><B>Stanley B. Lippman</B> began working on C++ with its inventor Bjarne Stroustrup back in 1984 within Bell Laboratories. Later, Stan worked in feature animation both at Disney and DreamWorks and served as a Software Technical Director on Fantasia 2000. He has since served as Distinguished Consultant with JPL and as an Architect with the Visual C++ team at Microsoft.</SPAN><BR><A href="http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx">http://msdn.microsoft.com/msdnmag/issues/06/00/PureC/default.aspx</A><img src ="http://www.blogjava.net/bluesky/aggbug/30638.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-14 17:02 <a href="http://www.blogjava.net/bluesky/archive/2006/02/14/30638.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C语言取得windows操作系统信息</title><link>http://www.blogjava.net/bluesky/archive/2006/02/14/30610.html</link><dc:creator>bluesky</dc:creator><author>bluesky</author><pubDate>Tue, 14 Feb 2006 06:53:00 GMT</pubDate><guid>http://www.blogjava.net/bluesky/archive/2006/02/14/30610.html</guid><wfw:comment>http://www.blogjava.net/bluesky/comments/30610.html</wfw:comment><comments>http://www.blogjava.net/bluesky/archive/2006/02/14/30610.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/bluesky/comments/commentRss/30610.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/bluesky/services/trackbacks/30610.html</trackback:ping><description><![CDATA[<P>#include &lt;windows.h&gt;<BR>#include &lt;stdio.h&gt;</P>
<P>#define BUFSIZE 80</P>
<P>BOOL GetOSVer(char *szOSName);</P>
<P>int main()<BR>{<BR>&nbsp;char szname[MAX_PATH];<BR>&nbsp;memset(szname,0,MAX_PATH);</P>
<P>&nbsp;BOOL bRet = GetOSVer(szname);</P>
<P>&nbsp;printf("Your Os version is %s\n ",szname);</P>
<P>&nbsp;return 0;<BR>}</P>
<P>BOOL GetOSVer(char *szname)<BR>{<BR>&nbsp;&nbsp; OSVERSIONINFOEX osvi;<BR>&nbsp;&nbsp; BOOL bOsVersionInfoEx;</P>
<P>&nbsp;&nbsp; // Try calling GetVersionEx using the OSVERSIONINFOEX structure.<BR>&nbsp;&nbsp; // If that fails, try using the OSVERSIONINFO structure.</P>
<P>&nbsp;&nbsp; ZeroMemory(&amp;osvi, sizeof(OSVERSIONINFOEX));<BR>&nbsp;&nbsp; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);</P>
<P>&nbsp;&nbsp; if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &amp;osvi)) )<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (! GetVersionEx ( (OSVERSIONINFO *) &amp;osvi) ) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return FALSE;<BR>&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp; switch (osvi.dwPlatformId)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for the Windows NT product family.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case VER_PLATFORM_WIN32_NT:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for the specific product family.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 2 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows Server 2003 family, ");<BR>&nbsp;&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 1 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows XP ");</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows 2000 ");</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.dwMajorVersion &lt;= 4 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows NT ");</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for specific product on Windows NT 4.0 SP6 and later.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( bOsVersionInfoEx )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for the workstation type.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.wProductType == VER_NT_WORKSTATION )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( osvi.dwMajorVersion == 4 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Workstation 4.0 " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if( osvi.wSuiteMask &amp; VER_SUITE_PERSONAL )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Home Edition " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname,&nbsp; "Professional " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for the server type.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( osvi.wProductType == VER_NT_SERVER )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 2 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( osvi.wSuiteMask &amp; VER_SUITE_DATACENTER )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Datacenter Edition " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Enterprise Edition " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( osvi.wSuiteMask == VER_SUITE_BLADE )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Web Edition " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Standard Edition " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( osvi.wSuiteMask &amp; VER_SUITE_DATACENTER )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Datacenter Server " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Advanced Server " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Server " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else&nbsp; // Windows NT 4.0 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname,"Server 4.0, Enterprise Edition " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Server 4.0 " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else&nbsp; // Test for specific product on Windows NT 4.0 SP5 and earlier<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HKEY hKey;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char szProductType[BUFSIZE];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DWORD dwBufLen=BUFSIZE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LONG lRet;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "SYSTEM\\CurrentControlSet\\Control\\ProductOptions",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, KEY_QUERY_VALUE, &amp;hKey );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( lRet != ERROR_SUCCESS )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return FALSE;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lRet = RegQueryValueEx( hKey, "ProductType", NULL, NULL,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (LPBYTE) szProductType, &amp;dwBufLen);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( (lRet != ERROR_SUCCESS) || (dwBufLen &gt; BUFSIZE) )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return FALSE;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RegCloseKey( hKey );</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( lstrcmpi( "WINNT", szProductType) == 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Workstation " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( lstrcmpi( "LANMANNT", szProductType) == 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname, "Server " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( lstrcmpi( "SERVERNT", szProductType) == 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname,"Advanced Server " );</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "%d.%d ", osvi.dwMajorVersion, osvi.dwMinorVersion );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Display service pack (if any) and build number.</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( osvi.dwMajorVersion == 4 &amp;&amp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lstrcmpi( osvi.szCSDVersion, "Service Pack 6" ) == 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HKEY hKey;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LONG lRet;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for SP6 versus SP6a.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0, KEY_QUERY_VALUE, &amp;hKey );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( lRet == ERROR_SUCCESS )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "Service Pack 6a (Build %d)\n", osvi.dwBuildNumber &amp; 0xFFFF );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else // Windows NT 4.0 prior to SP6a<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "%s (Build %d)\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osvi.szCSDVersion,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osvi.dwBuildNumber &amp; 0xFFFF);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RegCloseKey( hKey );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else // Windows NT 3.51 and earlier or Windows 2000 and later<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf( "%s (Build %d)\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osvi.szCSDVersion,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osvi.dwBuildNumber &amp; 0xFFFF);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Test for the Windows 95 product family.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case VER_PLATFORM_WIN32_WINDOWS:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (osvi.dwMajorVersion == 4 &amp;&amp; osvi.dwMinorVersion == 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows 95 ");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname,"OSR2 " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (osvi.dwMajorVersion == 4 &amp;&amp; osvi.dwMinorVersion == 10)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows 98 ");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( osvi.szCSDVersion[1] == 'A' )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcat(szname,"SE " );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (osvi.dwMajorVersion == 4 &amp;&amp; osvi.dwMinorVersion == 90)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strcpy(szname,"Microsoft Windows Millennium Edition\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case VER_PLATFORM_WIN32s:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf ("Microsoft Win32s\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp; }<BR>&nbsp; // getchar();<BR>&nbsp;&nbsp; return TRUE; <BR>}</P>
<P><BR>&nbsp;</P><img src ="http://www.blogjava.net/bluesky/aggbug/30610.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/bluesky/" target="_blank">bluesky</a> 2006-02-14 14:53 <a href="http://www.blogjava.net/bluesky/archive/2006/02/14/30610.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>