博文

目前显示的是 一月, 2013的博文

Androidpn推送

基于XMPP的推送服务

Logback

pom.xml


     <!--通用日志接口-->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.2</version>
        </dependency>

     <!--commons-log to slf4j-->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.2</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.0.9</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.0.9</version>
        </depende…

Apache Mina

importjava.io.IOException;importjava.net.InetSocketAddress;importjava.nio.charset.Charset;importorg.apache.mina.core.service.IoAcceptor;importorg.apache.mina.core.session.IdleStatus;importorg.apache.mina.filter.codec.ProtocolCodecFilter;importorg.apache.mina.filter.codec.textline.TextLineCodecFactory;importorg.apache.mina.filter.logging.LoggingFilter;importorg.apache.mina.transport.socket.nio.NioSocketAcceptor;publicclassMinaTimeServer{privatestaticfinalintPORT=9123;publicstaticvoidmain(String[]args)throwsIOException{IoAcceptoracceptor=newNioSocketAcceptor(); // 日志拦截器 acceptor.getFilterChain().addLast("logger",newLoggingFilter());acceptor.getFilterChain().addLast("codec",newProtocolCodecFilter(newTextLineCodecFactory(Charset.forName("UTF-8"))));acceptor.setHandler(newTimeServerHandler());acceptor.getSessionConfig().setReadBufferSize(2048);acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE,10);acceptor.bind(newInetSocketAddress(PO…

数据库表行列转置

图片
Select name,   SUM( DECODE ( subject,’语文’, result,0 )) 城语文,   SUM( DECODE ( subject,’数学’, result,0 )) 数学,   SUM( DECODE ( subject,’物理’, result,0 )) 物理  FROM cj  GROUP BY name;注:在不使用聚合函数的时候,group by 子句中必须包含所有的列。除聚集函数外的列必须全部包含在子句中。