Apache POI .xlsx 下拉框实现 https://my.oschina.net/u/3035165…
不静之心

Apache反向代理对WebSocket“不支持”的解决方案
Apache反向代理对WebSocket“不支持”的解决方案 https://segmentfault.com…
Spring跟Drools整合
基于Spring + Drools6.4规则引擎代码实例 https://my.oschina.net/xie…
Spring从txt文件注入到bean属性
1 |
<bean id="ProductUtils" class="cn.com.voge.utils.ProductUtils"/> |
[crayon-6816ff6e9fa406…
Jsoup解析Html中文文档
Jsoup解析Html中文文档 http://www.cnblogs.com/jycboy/p/jsoupdo…
Web Notifications API
Web Notifications API http://javascript.ruanyifeng.com/…
Spring 3.x使用websocket, Tomcat7, 原声Websocket
Chrome,Tomcat7、Chrome下web socket的一个例子 http://tyrion.ite…
汉字验证码
汉字验证码 https://my.oschina.net/u/2742034/blog/1499202 [cr…
如何写一个jQuery插件:扩展jQuery的对象
教程1 https://gist.github.com/quexer/3619237 创建一个自定义 jQue…
SpringMVC拦截器
SpringMVC拦截器 https://my.oschina.net/dreambreeze/blog/14…
JavaScript实现十种经典排序算法
http://www.htmleaf.com/ziliaoku/qianduanjiaocheng/20170…
Spring AOP @Aspect 基本用法
https://my.oschina.net/u/3218855/blog/1439368 Spring使用的…
JAVA实现SFTP上传,下载,删除
JAVA实现SFTP上传,下载,删除 https://my.oschina.net/u/2447394/blo…
Servlet3.0 新特性——HttpServletRequest 对文件上传的支持
Servlet3.0 新特性——HttpServletRequest 对文件上传的支持 https://my….
Java中的锁-Lock接口解析
http://blog.csdn.net/canot/article/details/52050633 提到J…
iptables 清空防火墙并设置规则
1 2 3 4 5 6 7 8 9 10 |
[root@localhost~]# iptables -F #清楚防火墙规则 [root@localhost~]# iptables -L #查看防火墙规则 [root@localhost~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT [root@localhost~]# iptables -A INPUT -p tcp --dport 22 -j ACCEPT [root@localhost~]# iptables -A INPUT -p tcp --dport 53 -j ACCEPT [root@localhost~]# iptables -A INPUT -p udp --dport 53 -j ACCEPT [root@localhost~]# iptables -A INPUT -p udp --dport 123 -j ACCEPT [root@localhost~]# iptables -A INPUT -p icmp -j ACCEPT [root@localhost~]# iptables -P INPUT DROP [root@localhost~]# /etc/init.d/iptables save |
lombok的使用
lombok 的官方网址:http://projectlombok.org/ lombok在In…
使用POI 读取 Excel 文件,读取手机号码 变成 科学计数 的解决办法
使用POI 读取 Excel 文件,读取手机号码 变成 科学计数 的解决办法 https://my.oschi…
一步步完成FastDFS + Spring MVC上传下载整合示例
一步步完成FastDFS + Spring MVC上传下载整合示例 https://my.oschina.ne…
行为型模式——中介者模式
行为型模式-中介者模式 http://blog.csdn.net/zhengzhb/article/detai…
行为型模式——迭代器模式
行为型模式-迭代器模式 http://blog.csdn.net/zhengzhb/article/detai…
JAVA多媒体处理库-JAVE
JAVA多媒体处理库-JAVE http://baike.xsoftlab.net/view/746.html…
Birt报表和整合Spring
Spring Framework & BIRT https://spring.io/blog/2012…
CentOS7 mini系统中安装VBoxLinuxAdditions增强功能
向VirtualBox中CentOS7 mini系统中安装VBoxLinuxAdditions增强功能 htt…
HTML5中判断横屏竖屏
HTML5中判断横屏竖屏 https://my.oschina.net/u/2306318/blog/1140…
Linux 使用 wget 命令下载 JDK 的方法
Linux 使用 wget 命令下载 JDK 的方法 https://my.oschina.net/yxzkm…
使用SQL查询所有数据库名和表名
MySQL中查询所有数据库名和表名 查询所有数据库 [crayon-6816ff6ea510041541833…
mybatis+ehcache缓存
前提,整合好springmvc + mybatis + ehcache https://blog.csdn…
树-二叉查找树
二叉查找树(Binary Search Tree)又称二叉排序树(Binary Sort Tre…
很全的前端工具集
转: https://my.oschina.net/Seas0n/blog/995253 前端自动化(Work…
Aspose.Slides for Java 转成pdf和图片等
1 2 3 4 5 6 |
<dependency> <groupId>com.aspose</groupId> <artifactId>aspose-slides</artifactId> <version>16.7.0</version> <!--<version>17.5-jdk16</version>--> </dependency> |
[crayon-6816ff6…
Centos6下安装中文字体,centos6中文字体
先安装字体管理软件
1 |
[root@localhost ~]# yum install fontconfig |
将需要安装的字体放到/u…
用poi把ppt或pptx转为图片
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
public static java.util.List<String> convertPng(File file, File outputFolder, String newFileName) throws Exception { // TODO 校验输入文件是否存在 以及是否为PPT java.util.List<String> newFileList = Lists.newArrayList(); try { if (!outputFolder.exists()) { outputFolder.mkdirs(); } if (StringUtils.isBlank(newFileName)) { newFileName = UUID.randomUUID().toString().replace("-", "")+"_"; } String newFilePath = null; FileInputStream is = new FileInputStream(file); HSLFSlideShow ppt = new HSLFSlideShow(is); is.close(); Dimension pgsize = ppt.getPageSize(); int idx = 1; for (HSLFSlide slide : ppt.getSlides()) { //防止中文乱码 for(HSLFShape shape : slide.getShapes()){ if(shape instanceof HSLFTextShape) { HSLFTextShape tsh = (HSLFTextShape)shape; for(HSLFTextParagraph p : tsh){ for(HSLFTextRun r : p){ r.setFontFamily("宋体"); } } } } newFilePath = outputFolder.getAbsolutePath() + "/" + newFileName + idx + ".png"; File newFile = new File(newFilePath); if (newFile.exists()) { newFile.delete(); } System.out.println("正在处理PPT TO PNG, page=" + idx); BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); // clear the drawing area graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); // render slide.draw(graphics); // save the output FileOutputStream out = new FileOutputStream(newFilePath); javax.imageio.ImageIO.write(img, "png", out); out.close(); System.out.println("处理完成PPT TO PNG, page=" + idx); newFileList.add(newFilePath); idx++; } } catch (FileNotFoundException e) { throw new RuntimeException("没有找到相应的文件"); } catch (IOException e) { throw new RuntimeException("系统出现IO异常,无法继续处理"); }catch (OfficeXmlFileException e){ throw new RuntimeException("请使用2003, 2007的格式PPT"); }catch (Exception e){ e.printStackTrace(); throw new RuntimeException("请使用2003, 2007的格式PPT"); } return newFileList; } |
实现MyBatis Mapper XML文件增量动态刷新,自动加载,热加载,热部署
实现MyBatis Mapper XML文件增量动态刷新,自动加载,热加载,热部署 https://my.os…
java 元组数据支持
一般使用场景: 多个返回值处理 最多支持10个元素: Unit<A> (1 element) Pa…