摘要: 找/opt/下的所有jsp,拷贝到/dirlinux下 find /opt -name *.jsp|xargs cp -a --target-directory=/dir/ --parents windows 下 for /r e:\t6_chinamaxx %1 in (*.jsp) do copy %1 g:\dir /Ylinux下 find . -name *.jsp|xargs cp -a --target-directory=/dir/ --parentsfind . -name "*.jsp" | xargs egrep -liw "createNe 阅读全文
posted @ 2012-12-03 18:00 悟寰轩-叶秋 阅读(752) 评论(0) 推荐(0) 编辑
摘要: InetAddress[] arr = InetAddress.getAllByName("www.qq.com");for(InetAddress addr :arr) { if(addr instanceof Inet4Address) { System.out.println("ipv4 : "+addr.getHostAddress()); } else if(addr instanceof Inet6Address){ System.out.println("ipv6 : "+addr.getHostAddress()); 阅读全文
posted @ 2012-12-03 17:49 悟寰轩-叶秋 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/cuizhf/archive/2011/08/22/2150046.htmlenum与int、String之间的转换enum<->intenum->int:int i=enumType.value.ordinal();int->enum:enumTypeb=enumType.values()[i];enum<->Stringenum -> String: enumType.name()String -> enum: enumType.valueOf(name);----------------- 阅读全文
posted @ 2012-12-03 17:30 悟寰轩-叶秋 阅读(27131) 评论(0) 推荐(0) 编辑
摘要: 抓取链接里的图片时通常和rss原理的url不是对应的,中间可能会有跳转,用到了如下方法: private String getWebRealPath(String src, String link) {try {if (src.startsWith("/")) {link = getRealLink(link);src = link.substring(0, link.indexOf("/", 7)) + src;}if (src.startsWith("./")) {link = getRealLink(link);src = li 阅读全文
posted @ 2012-12-03 17:29 悟寰轩-叶秋 阅读(546) 评论(0) 推荐(0) 编辑
摘要: Java中getResourceAsStream的用法首先,Java中的getResourceAsStream有以下几种:1. Class.getResourceAsStream(String path) : path 不以’/'开头时默认是从此类所在的包下取资源,以’/'开头则是从ClassPath根下获取。其只是通过path构造一个绝对路径,最终还是由ClassLoader获取资源。2. Class.getClassLoader.getResourceAsStream(String path) :默认则是从ClassPath根下获取,path不能以’/'开头,最终是 阅读全文
posted @ 2012-12-03 17:28 悟寰轩-叶秋 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.iosscripts.com/iosslider/ 阅读全文
posted @ 2012-12-03 17:26 悟寰轩-叶秋 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 1,定时凌晨1点执行(由于Quartz 2.0和spring目前版本不兼容,所以采取如下方法,不知道spring3.2会不会修复这个bug) public void doTask(CheckSpiderService doCheck) {// 获取当前时间Calendar currentDate = Calendar.getInstance();long currentDateLong = currentDate.getTime().getTime();// 计算满足条件的最近一次执行时间Calendar earliestDate = getEarliestDate(currentDate.. 阅读全文
posted @ 2012-12-03 17:25 悟寰轩-叶秋 阅读(764) 评论(1) 推荐(0) 编辑
摘要: 前些天一直在做报表的统计视图,发现一些问题,在此做一个总计:1,枚举最好不要用在插入数据中,windows下没问题,Linux回报jFreeChar 105错误2,插入数据不能为空,从表中查询数据时要判空3,Action直接返回图表的应注意,加载页面时的Action与此不同步……柱形图饼状图 阅读全文
posted @ 2012-12-03 17:24 悟寰轩-叶秋 阅读(289) 评论(1) 推荐(0) 编辑
摘要: 1 import java.awt.Image; 2 import java.awt.image.BufferedImage; 3 import java.io.File; 4 import java.io.FileOutputStream; 5 import java.io.IOException; 6 7 import javax.imageio.ImageIO; 8 9 import org.slf4j.Logger;10 import org.slf4j.LoggerFactory;11 12 import com.sun.image.codec.jpeg.JPEGCodec;1... 阅读全文
posted @ 2012-12-03 17:23 悟寰轩-叶秋 阅读(1506) 评论(0) 推荐(0) 编辑
摘要: 更新服务器字体和jdk字库utf-8。 阅读全文
posted @ 2012-12-03 17:21 悟寰轩-叶秋 阅读(299) 评论(0) 推荐(0) 编辑
摘要: RandomStringUtils随机RandomCommons-lang//产生12位长度的随机字符串RandomStringUtils.random(12);//使用指定的字符生成3位长度的随机字符串RandomStringUtils.random(3, new char[]{'a','b','c','d','e','f,'g'});//生成指定长度的字母和数字的随机组合字符串RandomStringUtils.randomAlphanumeric(12);//生成随机数字字符串Rand 阅读全文
posted @ 2012-12-03 17:17 悟寰轩-叶秋 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.File; 2 import java.io.IOException; 3 import java.io.StringReader; 4 5 import org.apache.lucene.analysis.Analyzer; 6 import org.apache.lucene.analysis.TokenStream; 7 import org.apache.lucene.document.Document; 8 import org.apache.lucene.document.TextField; 9 import org.ap... 阅读全文
posted @ 2012-12-03 16:10 悟寰轩-叶秋 阅读(5649) 评论(0) 推荐(1) 编辑