Java
roddyfeng
这个作者很懒,什么都没留下…
展开
-
Get Difference Between Two Dates
[quote][code="java"]import java.sql.Timestamp;import java.text.ParseException;import java.util.Calendar;import java.util.Date;import java.util.GregorianCalendar;public class BaseModel {...原创 2015-06-10 15:05:24 · 244 阅读 · 0 评论 -
css 控制第二行字段縮進
<div style="margin-left : 18px; text-indent : -18px "> </div>原创 2015-09-22 11:55:33 · 904 阅读 · 0 评论 -
select multi tables join ---Hibernate
[code="java"]String hql = "from A a,B b, C c where a.id=b.id and b.id =c.id";List list = dao.getListByHql(hql);for(int i=0; i原创 2015-10-29 14:05:20 · 81 阅读 · 0 评论 -
mysql 存入 blob类型数据
String content = new String(blob.getBytes((long)1, (int)blob.length())); refrence as : http://knight-black-bob.iteye.com/blog/2213090原创 2016-09-30 14:25:38 · 610 阅读 · 0 评论 -
List do sorting
[code="java"]Collections.sort(newList,new Comparator(){ public int compare(FolderEntity f1,FolderEntity f2){ return f1.getFolderSetting().getNewOrder() - f2.getFolderSetting().getNewOrd...原创 2015-11-20 09:51:26 · 82 阅读 · 0 评论 -
IntelliJ Idea – How to enable zoom of text by CTRL + Mouse wheel
IntelliJ Idea – How to enable zoom of text by CTRL + Mouse wheelYou can zoom-in or out text in editor window of IntelliJ idea (PyCharm) by CTRL + Mouse wheel.The only problem is that ...原创 2015-11-22 17:53:18 · 171 阅读 · 0 评论 -
daysBetween
[code="java"] public int daysBetween(String dateStr) throws ParseException { Date today = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date compareDate = sdf.parse...原创 2015-12-23 09:27:56 · 2869 阅读 · 0 评论 -
解決多線程派任務問題
解決多線程派任務問題:使用: 每次只update 一條記錄的方法來達到派送目的.(取update 記錄ID),如: folder table 為要派送的table, 在folder table有個字段process, process 每update一次就加1,加1后就是取得ID去工作。另一個線程來了就update令一個記錄 加1,不定loop,達到每線線派一個,不會沖突。SQL:...原创 2016-01-08 18:06:23 · 108 阅读 · 0 评论 -
Image Process
import java.awt.AlphaComposite;import java.awt.Graphics2D;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import java.text.SimpleDateFormat;import java...原创 2017-10-31 09:08:16 · 428 阅读 · 0 评论 -
java send email
[code="java"]static int port = 25; //smtp端口 static String server = "smtp.163.com"; //smtp服务器地址 static String from = "XXX@163.com"; //发送者 static String user = "XXXX@163.com"; //发送者地址...原创 2016-08-08 00:47:50 · 286 阅读 · 0 评论 -
phantomjs & casperjs install in l Fedora
phantomjs install in Fedora:if you can not extract phantomjs.tar.bz2 in Fedora, you can extract it in Windowand then do copy.and then to do in Fedora, like that as below:cp phantomjs/bin/phan...原创 2016-08-06 22:33:52 · 109 阅读 · 0 评论 -
Hibernate: lazy load.
About lazy load, before you to get the lazy load property, you need do that likeHibernate.initialize(groups); groups is your lazy load property by hibernate. Pay more attention: Session do not ...原创 2015-08-05 12:27:25 · 70 阅读 · 0 评论 -
Hibernate3 dynamicUpdate
@org.hibernate.annotations.Entity(dynamicUpdate = true)for Hibernate3 Remark: select record from id first and then set value of you want to update value. as below (BaseService): Object objE...原创 2016-06-22 10:07:22 · 165 阅读 · 0 评论 -
HttpClient
[b]Remark: set userAgent[/b][code="java"]package wisers.backend.worker;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.net.URI;i...原创 2016-06-22 10:17:59 · 156 阅读 · 0 评论 -
Java to Excel
Java to Excelhttps://poi.apache.org/download.htmlhttp://blog.csdn.net/xwin1989/article/details/8947077原创 2016-07-15 16:14:29 · 91 阅读 · 0 评论 -
show process in mysql
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST order by info desc;原创 2016-07-22 11:55:26 · 90 阅读 · 0 评论 -
Java to Excel 2
[b]Use Jar:[/b]poi-3.14-20160307.jarpoi-ooxml-3.14-20160307.jarpoi-ooxml-schemas-3.14-20160307.jarmlbeans-2.6.0.jar[code="java"]try { XSSFWorkbook workbook = new XSSFWorkbook(); ...原创 2016-07-26 14:04:24 · 115 阅读 · 0 评论 -
HttpClient Call Website
[b]Need Jar: [/b]htmlunit-2.17-OSGi.jar[code="java"] @SuppressWarnings({ "finally", "deprecation" }) public static String executeGet(String url,String host,String cookie) throws IOException ...原创 2016-07-28 14:14:13 · 246 阅读 · 0 评论 -
Java Read Html
[b]Need Jar:[/b]jsoup-1.8.1.jar[code="java"]public static void main(String[] args) { String content=""; try { content = executeGet("qq.com","t.qq.com","pgv_pvi=2633264128; RK=AWk...原创 2016-07-28 14:37:29 · 388 阅读 · 0 评论 -
Json String to Bean
[b]Need Jar:[/b]gson.jar[code="java"]Gson g = new Gson();FolderArray folders = g.fromJson("{\"folders\":[{\"status\":100,\"b\":200},{\"status\":100,\"b\":200}]}", FolderArray原创 2016-08-03 18:10:50 · 159 阅读 · 0 评论 -
Maven install problem: Unexpected end of ZLIB input stream。
Maven install problem: Unexpected end of ZLIB input stream。Set Maven run properties and to do rebuilt.goals: dependency:purge-local-repository原创 2018-03-08 12:58:48 · 648 阅读 · 0 评论