??xml version="1.0" encoding="utf-8" standalone="yes"?>久久国产成人亚洲精品影院,国产亚洲精品美女久久久久,亚洲性线免费观看视频成熟 http://www.tkk7.com/yuhaibo736/zh-cnMon, 12 May 2025 16:36:22 GMTMon, 12 May 2025 16:36:22 GMT60javasvg囄转换为png格式囄http://www.tkk7.com/yuhaibo736/archive/2015/10/19/427819.htmlyuhaibo736yuhaibo736Mon, 19 Oct 2015 07:17:00 GMThttp://www.tkk7.com/yuhaibo736/archive/2015/10/19/427819.htmlhttp://www.tkk7.com/yuhaibo736/comments/427819.htmlhttp://www.tkk7.com/yuhaibo736/archive/2015/10/19/427819.html#Feedback0http://www.tkk7.com/yuhaibo736/comments/commentRss/427819.htmlhttp://www.tkk7.com/yuhaibo736/services/trackbacks/427819.html有时候在客户端用svgdQ而在服务器端需要同L囄Q在服务器端重新M遍是非常费事的。这时候我们就可以利用已有的svg直接通过下面的类转换成png格式?/p>

使用q个Ҏ需要引用batic相关的包Qmaven pom文g如下Q?br />

<!-- svg 生成png格式囄  -->
<dependency><groupId>batik</groupId><artifactId>batik-svggen</artifactId><version>1.6</version></dependency>        
<dependency><groupId>batik</groupId><artifactId>batik-awt-util</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-bridge</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-css</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-dom</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-gvt</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-parser</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-script</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-svg-dom</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-transcoder</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-util</artifactId><version>1.6</version></dependency>
<dependency><groupId>batik</groupId><artifactId>batik-xml</artifactId><version>1.6</version></dependency>
<!-- 此处不能使用2.9.1版本Q?.9.1生成png会失?-->
<dependency><groupId>xerces</groupId><artifactId>xercesImpl</artifactId><version>2.5.0</version></dependency>
<dependency><groupId>xml-apis</groupId><artifactId>xmlParserAPIs</artifactId><version>2.0.2</version></dependency>
<dependency><groupId>org.axsl.org.w3c.dom.svg</groupId><artifactId>svg-dom-java</artifactId><version>1.1</version></dependency>
<dependency><groupId>xml-apis</groupId>    <artifactId>xml-apis</artifactId><version>2.0.0</version></dependency>
<dependency><groupId>org.w3c.css</groupId> <artifactId>sac</artifactId>    <version>1.3</version></dependency>
<!-- svg 生成png格式囄l束  -->
package com.yhb.web.util;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.PNGTranscoder;
public final class FileUtil {
/** 
     *@Description: svg字符串{换ؓpng 
     *@Author: 
     *@param svgCode svg代码 
     *@param pngFilePath  保存的\?nbsp;
     *@throws IOException io异常 
     *@throws TranscoderException svg代码异常 
    */  
public static void convertToPng(String svgCode,String pngFilePath) throws IOException,TranscoderException{  
 
        File file = new File (pngFilePath);  
  
        FileOutputStream outputStream = null;  
        try {  
            file.createNewFile ();  
            outputStream = new FileOutputStream (file);  
            convertToPng (svgCode, outputStream);  
        } finally {  
            if (outputStream != null) {  
                try {  
                    outputStream.close ();  
                } catch (IOException e) {  
                    e.printStackTrace ();  
                }  
            }  
        }  
    }  
/** 
     *@Description: svgCode转换成png文gQ直接输出到中 
     *@param svgCode svg代码 
     *@param outputStream 输出?nbsp;
     *@throws TranscoderException 异常 
     *@throws IOException io异常 
     */  
    public static void convertToPng(String svgCode,OutputStream outputStream) throws TranscoderException,IOException{  
        try {  
        byte[] bytes = svgCode.getBytes ("UTF-8");  
            PNGTranscoder t = new PNGTranscoder ();  
            TranscoderInput input = new TranscoderInput (new ByteArrayInputStream (bytes));  
            TranscoderOutput output = new TranscoderOutput (outputStream);  
            t.transcode (input, output);  
            outputStream.flush ();  
        } finally {  
            if (outputStream != null) {  
                try {  
                    outputStream.close ();  
                } catch (IOException e) {  
                    e.printStackTrace ();  
                }  
            }  
        }  
    }  
}



yuhaibo736 2015-10-19 15:17 发表评论
]]>
Oracle 中汉字排序问?http://www.tkk7.com/yuhaibo736/archive/2014/08/29/417496.htmlyuhaibo736yuhaibo736Fri, 29 Aug 2014 06:13:00 GMThttp://www.tkk7.com/yuhaibo736/archive/2014/08/29/417496.htmlhttp://www.tkk7.com/yuhaibo736/comments/417496.htmlhttp://www.tkk7.com/yuhaibo736/archive/2014/08/29/417496.html#Feedback0http://www.tkk7.com/yuhaibo736/comments/commentRss/417496.htmlhttp://www.tkk7.com/yuhaibo736/services/trackbacks/417496.htmlҎ1: 讑֮环境变量
set NLS_SORT=SCHINESE_RADICAL_M ;export NLS_SORT QshQ?
or setenv NLS_SORT SCHINESE_RADICAL_M (csh)
or regedit 
HKLC/SOFTWARE/ORACLE/home0/NLS_SORT        (win)

Ҏ2: 在session中修?
alter session set NLS_SORT='SCHINESE_RADICAL_M'

Ҏ3: 直接使用NLSSORT函数 (推荐)
select name,id from t
order by NLSSORT(name,'NLS_SORT = SCHINESE_STROKE_M')

讄NLS_SORT?

SCHINESE_RADICAL_M 按照部首Q第一序Q、笔划(W二序Q排?nbsp;

SCHINESE_STROKE_M 按照W划Q第一序Q、部首(W二序Q排?nbsp;

SCHINESE_PINYIN_M 按照拼音排序



yuhaibo736 2014-08-29 14:13 发表评论
]]>
mybatis + oscache结http://www.tkk7.com/yuhaibo736/archive/2014/08/11/416823.htmlyuhaibo736yuhaibo736Mon, 11 Aug 2014 10:22:00 GMThttp://www.tkk7.com/yuhaibo736/archive/2014/08/11/416823.htmlhttp://www.tkk7.com/yuhaibo736/comments/416823.htmlhttp://www.tkk7.com/yuhaibo736/archive/2014/08/11/416823.html#Feedback0http://www.tkk7.com/yuhaibo736/comments/commentRss/416823.htmlhttp://www.tkk7.com/yuhaibo736/services/trackbacks/416823.html    在mybatis中,开发组l只提供了一些默认的二~存实现的机Ӟq没有直接内|的支持OSCache和EHCache{二U缓存机Ӟ而是作ؓ一个集成jar包来提供二~存的实玎ͼ在官方网站上我们可以扑ֈmybatis-ehcache-1.0.1-bundle.zipQmybatis-oscache-1.0.1-bundle.zip{ehcache和oscache提供二~存的独立工具包. q里我就拿oscache在mybatis中的使用来D例说明:

       1.   mybatis-oscache-1.0.1-bundle.zip中涉及到的jar包放入到classpath路径?nbsp;
             maven下可以这样配|?br />               <dependencies>  
                    
... 

                    <dependency> 

                        <groupId>org.mybatis.caches</groupId> 

                        <artifactId>mybatis-oscache</artifactId>      
                         <version>1.0.2-SNAPSHOT</version> 

                    </dependency>             

                    <dependency>
                        <groupId>javax.jms</groupId>
                        <artifactId>jms</artifactId>
                        <version>1.1</version>
                    </dependency>

                    <dependency>
                         <groupId>opensymphony</groupId>
                         <artifactId>oscache</artifactId>
                         <version>2.4</version>
                         <exclusions>       
                               <exclusion>
                                   <groupId>com.sun.jdmk</groupId>
                                   <artifactId>jmxtools</artifactId>
                               </exclusion>
                           <exclusion>
                           <groupId>com.sun.jmx</groupId>
                           <artifactId>jmxri</artifactId>
                       </exclusion>
                     </exclusions>
                </dependency>

                    ... 

                </dependencies>

       2.   在mapper文g中的配置如下Q?/span>

             <mapper namespace="org.test.AuthMapper" >         

                 <cache  type="org.mybatis.caches.oscache.OSCache"/>

             </mapper>
            注意下面两点
             (a)?/span><select id="getAuth" parameterType="Map" resultType="Auth"  useCache="false">中用useCache="false"或useCache="true"来决定是否用二U缓存?nbsp;   
             (b)在增删改?lt;insert id="insertAuth" parameterType="Auth"  flushCache="true">使用flushCache="true"或flushCache="flase"来决定对q些q行操作后清Ixml文g中所有查询语句的二~存?/font> 

       3.  在src目录下创Z个oscache.properties的属性文Ӟ在里面指定缓存的各种属性的讄Q?br />             cache.memory=true             
             cache.path=c:\\myapp\\cache
             cache.persistence.class=com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener
             cache.persistence.overflow.only=true
             cache.capacity=100000

            



yuhaibo736 2014-08-11 18:22 发表评论
]]>
iText生成PDF文ghttp://www.tkk7.com/yuhaibo736/archive/2014/06/24/415071.htmlyuhaibo736yuhaibo736Tue, 24 Jun 2014 08:27:00 GMThttp://www.tkk7.com/yuhaibo736/archive/2014/06/24/415071.htmlhttp://www.tkk7.com/yuhaibo736/comments/415071.htmlhttp://www.tkk7.com/yuhaibo736/archive/2014/06/24/415071.html#Feedback0http://www.tkk7.com/yuhaibo736/comments/commentRss/415071.htmlhttp://www.tkk7.com/yuhaibo736/services/trackbacks/415071.htmlimport java.awt.Color;
import java.io.FileOutputStream;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;

public class CellEvents {


 /**
  * @param args
  */
 public static void main(String[] args) {
  Object[] objArr = new Object[]{100,20,300};
  
  Document document = new Document(PageSize.A4.rotate(),50,50,50,50);
  try{
   //bfSongti = BaseFont.createFont("/simsun.ttc,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
   Font songtiSFivefont = new Font(BaseFont.createFont("/simsun.ttc,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED), 9f);//宋体五号字
         //讄存放位置
         PdfWriter.getInstance(document, new FileOutputStream("D:/test.pdf"));
         document.open();
 
         PdfPTable table = new PdfPTable(5);
   table.setSpacingBefore(10f);
   table.getDefaultCell().setPadding(5);
   //HowbuyBorderPdfPTableEvent event = new HowbuyBorderPdfPTableEvent();
   //table.setTableEvent(event);
   //table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
   table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
   PdfPCell cellTitle = new PdfPCell(new Phrase("总资产\nQ万元)",songtiSFivefont));
   cellTitle.setBorderWidth(2f);
   cellTitle.setBackgroundColor(new BaseColor(new Color(153, 51, 0)));
   cellTitle.setBorderColor(new BaseColor(new Color(153, 51, 0)));
   cellTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
   cellTitle.setVerticalAlignment(Element.ALIGN_MIDDLE);
   cellTitle.setMinimumHeight(25);
   table.addCell(cellTitle);
 
   cellTitle = new PdfPCell(new Phrase(""));
   cellTitle.setBorder(Rectangle.NO_BORDER);
   cellTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
   cellTitle.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cellTitle);
   
   cellTitle = new PdfPCell(new Phrase("当前收益\nQ万元)",songtiSFivefont));
   cellTitle.setBorderWidth(2f);
   cellTitle.setBackgroundColor(new BaseColor(new Color(153, 51, 0)));
   cellTitle.setBorderColor(new BaseColor(new Color(153, 51, 0)));
   cellTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
   cellTitle.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cellTitle);
 
   cellTitle = new PdfPCell(new Phrase("",songtiSFivefont));
   cellTitle.setBorder(Rectangle.NO_BORDER);
   cellTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
   cellTitle.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cellTitle);
   
   
   cellTitle = new PdfPCell(new Phrase("累计收益\nQ万元)",songtiSFivefont));
   cellTitle.setBorderWidth(2f);
   cellTitle.setBackgroundColor(new BaseColor(new Color(153, 51, 0)));
   cellTitle.setBorderColor(new BaseColor(new Color(153, 51, 0)));
   cellTitle.setHorizontalAlignment(Element.ALIGN_CENTER);
   cellTitle.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cellTitle);
   
   float[] widths2 = { 24.5f, 12.25f,24.5f,12.25f,24.5f};

   table.setWidths(widths2);
   
   table.setHorizontalAlignment(Element.ALIGN_LEFT);//
   table.setWidthPercentage(70);
   double zzc = objArr[0]==null ? 0:Double.parseDouble(objArr[0].toString());
   double dqsy = objArr[1]==null ? 0:Double.parseDouble(objArr[1].toString());
   double ljsy = objArr[2]==null ? 0:Double.parseDouble(objArr[2].toString());
   PdfPCell cell1 = new PdfPCell(new Phrase(String.valueOf(zzc),songtiSFivefont));
   cell1.setBorderWidth(2f);
   cell1.setBorderColor(new BaseColor(new Color(153, 51, 0)));
   cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
   cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);
   cell1.setMinimumHeight(20);
   table.addCell(cell1);
   
   cell1 = new PdfPCell(new Phrase("",songtiSFivefont));
   cell1.setBorder(Rectangle.NO_BORDER);
   cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
   cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cell1);
   
   cell1 = new PdfPCell(new Phrase(String.valueOf(dqsy),songtiSFivefont));
   cell1.setBorderWidth(2f);
   cell1.setBorderColor(new BaseColor(new Color(153, 51, 0)));
   cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
   cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cell1);
   
   cell1 = new PdfPCell(new Phrase("",songtiSFivefont));
   cell1.setBorder(Rectangle.NO_BORDER);
   cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
   cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cell1);
   
   cell1 = new PdfPCell(new Phrase(String.valueOf(ljsy),songtiSFivefont));
   cell1.setBorderWidth(2f);
   cell1.setBorderColor(new BaseColor(new Color(153, 51, 0)));
   cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
   cell1.setVerticalAlignment(Element.ALIGN_MIDDLE);
   table.addCell(cell1);
   document.add(table);
  }catch(Exception ex){
   ex.printStackTrace();
  }
        document.close();

 }

}



yuhaibo736 2014-06-24 16:27 发表评论
]]>
tomcatl合nginx使用结http://www.tkk7.com/yuhaibo736/archive/2014/06/17/414845.htmlyuhaibo736yuhaibo736Tue, 17 Jun 2014 07:24:00 GMThttp://www.tkk7.com/yuhaibo736/archive/2014/06/17/414845.htmlhttp://www.tkk7.com/yuhaibo736/comments/414845.htmlhttp://www.tkk7.com/yuhaibo736/archive/2014/06/17/414845.html#Feedback0http://www.tkk7.com/yuhaibo736/comments/commentRss/414845.htmlhttp://www.tkk7.com/yuhaibo736/services/trackbacks/414845.html 说到反向代理Q可能很多h都听_但具体什么是反向代理Q很多h估计׃清楚了。摘一D늙度百U上的描qͼ

Html代码 复制代码 收藏代码
  1. 反向代理QReverse ProxyQ方式是指以代理服务器来接受internet上的q接hQ然后将h转发l内部网l上的服务器Qƈ从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现Z个服务器?nbsp;