自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(0)
  • 资源 (6)
  • 问答 (1)
  • 收藏
  • 关注

空空如也

Aspose, word、excel、PPT 转PDF文件jar包加工具类

实现word、excel、PPT 转PDF文件功能。去插件水印,添加word、excel、pdf 文字与图片水印功能。执行转化方法前会分别先执行loadLicense()、getLicenseExcel()、getLicensePpt() 加载license.xml文件,不会出现插件水印。 主要包含aspose.pdf-17.3.0.jar、aspose.slides-19.3.jar、aspose-cells-8.5.2.jar、aspose-words-15.8.0-jdk16.jar、license.xml、PdfUtil.java

2022-08-03

tensorflow深度学习CNN智能识别车牌

基于深度学习CNN算法,对车牌进行智能识别。包括省市代码、车牌号码。项目分为4个py文件,有详细的函数分类及代码注释,对每一个变量 及 运算步骤都做了注释。 对于刚学习tensorflow的同学来说,是最好不过了的。 项目可以运行,无bug。 下面附几个CNN及tensorflow常用函数的详细API注解 https://www.jianshu.com/p/d58c6c9148cb https://www.cnblogs.com/qggg/p/6832342.html http://www.cnblogs.com/qggg/p/6832705.html https://www.cnblogs.com/wuzhitj/p/6298004.html

2018-05-24

大数据文件查看、分割工具

有时候有些10多个G的日志文件打不开,可以使用这个软件打开及分割 亲测有效! 目录下的LogViewPro.CHS是汉化文件,如果想体验英文原版,把该文件重命名或删除即可。

2017-12-08

js导出前台文件 支持 csv、txt、sql、json、xml、excel、doc、png、pdf 导出

文件夹中包含 base64.js 、html2canvas.js、jquery.base64.js、jspdf.js、sprintf.js、tableExport.js /* * 根据网上的tableExport.js 进行修改 增加中文支持导出及jqgrid、dataTable表格导出 * js导出前台文件 支持 csv、txt、sql、json、xml、excel、doc、png、pdf 导出 * * <!--Options参数 start--> * separator: ',' * ignoreColumn: [2,3], * tableName:'导出文件名称' * type:'csv' * pdfFontSize:14 * pdfLeftMargin:20 * escape:'true' * htmlContent:'false' * consoleLog:'false' * <!--Options参数 end --> * * @author boyer * create date: 2015-12-08 */ 页面中引入Export/tableExport.js 调用案例 表table id="sample-table-2" $('#sample-table-2').tableExport({type: 'excel', escape: 'false',tableName:'资产规模统计表'});

2017-12-08

ganymed-ssh2-build210.jar java远程访问linux服务器操作、上传下载文件

java远程访问linux服务器操作 远程执行shll脚本或者命令、上传下载文件 package com.szkingdom.kfit.bank.ccbDirectShortcut.helper; import ch.ethz.ssh2.Connection; import ch.ethz.ssh2.SCPClient; import ch.ethz.ssh2.Session; import ch.ethz.ssh2.StreamGobbler; import common.Logger; import org.apache.commons.lang.StringUtils; import java.io.*; import java.util.logging.Level; /** * SCP远程访问Linux服务器读取文件 * User: boyer * Date: 17-12-7 * Time: 下午3:22 * To change this template use File | Settings | File Templates. */ public class ScpClient { //字符编码默认是utf-8 private static String DEFAULTCHART="UTF-8"; protected static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(ScpClient.class); static private ScpClient instance; private Connection conn; static synchronized public ScpClient getInstance(String IP, int port, String username, String passward) { if (instance == null) { instance = new ScpClient(IP, port, username, passward); } return instance; } public ScpClient(String IP, int port, String username, String passward) { this.ip = IP; this.port = port; this.username = username; this.password = passward; } private String ip; private int port; private String username; private String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public int getPort() { return port; } public void setPort(int port) { this.port = port; } /** * 远程登录linux的主机 * @author Ickes * @since V0.1 * @return * 登录成功返回true,否则返回false */ public Boolean login(){ boolean flg=false; try { conn = new Connection(ip); conn.connect();//连接 flg=conn.authenticateWithPassword(username, password);//认证 } catch (IOException e) { e.printStackTrace(); } return flg; } /** * 下载文件 * @param remoteFile 远程文件地址 * @param localTargetDirectory 本地目录地址 */ public void getFile(String remoteFile, String localTargetDirectory) { try { if(login()){ SCPClient client = new SCPClient(conn); client.get(remoteFile, localTargetDirectory); conn.close(); } } catch (IOException ex) { log.error(ex); } } /** * 上传文件 * @param localFile 本地目录地址 * @param remoteTargetDirectory 远程目录地址 */ public void putFile(String localFile, String remoteTargetDirectory) { try { if(login()){ SCPClient client = new SCPClient(conn); client.put(localFile, remoteTargetDirectory); conn.close(); } } catch (IOException ex) { log.error(ex); } } /** * 上传文件 * @param localFile 本地目录地址 * @param remoteFileName 重命名 * @param remoteTargetDirectory 远程目录地址 * @param mode 默认0600权限 rw 读写 */ public void putFile(String localFile, String remoteFileName,String remoteTargetDirectory,String mode) { try { if(login()){ SCPClient client = new SCPClient(conn); if((mode == null) || (mode.length() == 0)){ mode = "0600"; } client.put(localFile, remoteFileName, remoteTargetDirectory, mode); //重命名 ch.ethz.ssh2.Session sess = conn.openSession(); String tmpPathName = remoteTargetDirectory +File.separator+ remoteFileName; String newPathName = tmpPathName.substring(0, tmpPathName.lastIndexOf(".")); sess.execCommand("mv " + remoteFileName + " " + newPathName);//重命名回来 conn.close(); } } catch (IOException ex) { log.error(ex); } } public static byte[] getBytes(String filePath) { byte[] buffer = null; try { File file = new File(filePath); FileInputStream fis = new FileInputStream(file); ByteArrayOutputStream byteArray = new ByteArrayOutputStream(1024*1024); byte[] b = new byte[1024*1024]; int i; while ((i = fis.read(b)) != -1) { byteArray.write(b, 0, i); } fis.close(); byteArray.close(); buffer = byteArray.toByteArray(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return buffer; } /** * @author Ickes * 远程执行shll脚本或者命令 * @param cmd * 即将执行的命令 * @return * 命令执行完后返回的结果值 * @since V0.1 */ public String execute(String cmd){ String result=""; try { if(login()){ Session session= conn.openSession();//打开一个会话 session.execCommand(cmd);//执行命令 result=processStdout(session.getStdout(),DEFAULTCHART); //如果为得到标准输出为空,说明脚本执行出错了 if(StringUtils.isBlank(result)){ result=processStdout(session.getStderr(),DEFAULTCHART); } conn.close(); session.close(); } } catch (IOException e) { e.printStackTrace(); } return result; } /** * @author Ickes * 远程执行shll脚本或者命令 * @param cmd * 即将执行的命令 * @return * 命令执行成功后返回的结果值,如果命令执行失败,返回空字符串,不是null * @since V0.1 */ public String executeSuccess(String cmd){ String result=""; try { if(login()){ Session session= conn.openSession();//打开一个会话 session.execCommand(cmd);//执行命令 result=processStdout(session.getStdout(),DEFAULTCHART); conn.close(); session.close(); } } catch (IOException e) { e.printStackTrace(); } return result; } /** * 解析脚本执行返回的结果集 * @author Ickes * @param in 输入流对象 * @param charset 编码 * @since V0.1 * @return * 以纯文本的格式返回 */ private String processStdout(InputStream in, String charset){ InputStream stdout = new StreamGobbler(in); StringBuffer buffer = new StringBuffer();; try { BufferedReader br = new BufferedReader(new InputStreamReader(stdout,charset)); String line=null; while((line=br.readLine()) != null){ buffer.append(line+"\n"); } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return buffer.toString(); } }

2017-12-08

zip4j_1.3.2 java代码压缩、解压文件

/** * 使用给定密码压缩指定文件或文件夹到指定位置. * <p> * dest可传最终压缩文件存放的绝对路径,也可以传存放目录,也可以传null或者"".<br /> * 如果传null或者""则将压缩文件存放在当前目录,即跟源文件同目录,压缩文件名取源文件名,以.zip为后缀;<br /> * 如果以路径分隔符(File.separator)结尾,则视为目录,压缩文件名取源文件名,以.zip为后缀,否则视为文件名. * @param src 要压缩的文件或文件夹路径 * @param dest 压缩文件存放路径 * @param isCreateDir 是否在压缩文件里创建目录,仅在压缩文件为目录时有效.<br /> * 如果为false,将直接压缩目录下文件到压缩文件. * @param passwd 压缩使用的密码 * @return 最终的压缩文件存放的绝对路径,如果为null则说明压缩失败. */ public static String zip(String src, String dest, boolean isCreateDir, String passwd) { File srcFile = new File&#40;src&#41;; ZipParameters parameters = new ZipParameters(); parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); // 压缩方式 parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL); // 压缩级别 if (!StringUtils.isEmpty(passwd)) { parameters.setEncryptFiles(true); parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD); // 加密方式 parameters.setPassword(passwd.toCharArray()); } try { ZipFile zipFile = new ZipFile&#40;dest&#41;; if (srcFile.isDirectory()) { // 如果不创建目录的话,将直接把给定目录下的文件压缩到压缩文件,即没有目录结构 if (!isCreateDir) { File [] subFiles = srcFile.listFiles(); ArrayList<File> temp = new ArrayList<File>(); Collections.addAll(temp, subFiles); zipFile.addFiles(temp, parameters); return dest; } zipFile.addFolder(srcFile, parameters); } else { zipFile.addFile&#40;srcFile, parameters&#41;; } return dest; } catch (ZipException e) { e.printStackTrace(); } return null; } /** * 使用给定密码解压指定的ZIP压缩文件到指定目录 * <p> * 如果指定目录不存在,可以自动创建,不合法的路径将导致异常被抛出 * @param zipFile 指定的ZIP压缩文件 * @param dest 解压目录 * @param passwd ZIP文件的密码 * @return 解压后文件数组 为空则解压到当前目录 * @throws ZipException 压缩文件有损坏或者解压缩失败抛出 */ public static File [] unzip(File zipFile, String dest, String passwd) throws ZipException { ZipFile zFile = new ZipFile&#40;zipFile&#41;; zFile.setFileNameCharset("GBK"); if (!zFile.isValidZipFile&#40;&#41;) { throw new ZipException("压缩文件不合法,可能被损坏."); } if(dest ==null || dest.equals("")){ dest = zipFile.getParentFile&#40;&#41;.getAbsolutePath(); } File destDir = new File&#40;dest&#41;; if (destDir.isDirectory() && !destDir.exists()) { destDir.mkdir(); } if (zFile.isEncrypted()) { zFile.setPassword(passwd.toCharArray()); } zFile.extractAll(dest); List<FileHeader> headerList = zFile.getFileHeaders(); List<File> extractedFileList = new ArrayList<File>(); for(FileHeader fileHeader : headerList) { if (!fileHeader.isDirectory()) { extractedFileList.add(new File&#40;destDir,fileHeader.getFileName(&#41;)); } } File [] extractedFiles = new File[extractedFileList.size()]; extractedFileList.toArray(extractedFiles); return extractedFiles; }

2017-12-08

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除