- 浏览: 18287 次
- 性别:
- 来自: 广州
最新评论
文章列表
HttpClient Call Website
- 博客分类:
- Java
Need Jar:
htmlunit-2.17-OSGi.jar
@SuppressWarnings({ "finally", "deprecation" })
public static String executeGet(String url,String host,String cookie) throws IOException {
BufferedReader in = null;
String content = null;
int responseCode = 0;
DefaultHttpClient ...
Java to Excel 2
- 博客分类:
- Java
Use Jar:
poi-3.14-20160307.jar
poi-ooxml-3.14-20160307.jar
poi-ooxml-schemas-3.14-20160307.jar
mlbeans-2.6.0.jar
try {
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet("sheet1");
XSSFRow row = sheet.createRow(0);
...
show process in mysql
- 博客分类:
- Java
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST order by info desc;
Java to Excel
- 博客分类:
- Java
Java to Excel
https://poi.apache.org/download.html
http://blog.csdn.net/xwin1989/article/details/8947077
HttpClient
- 博客分类:
- Java
Remark: set userAgent
package wisers.backend.worker;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import org.apache.http.HttpResponse;
import org.apache.http.client.m ...
Hibernate3 dynamicUpdate
- 博客分类:
- Java
@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 objExist = getObject(className,Integer.parseInt(uid));
objExist = setUpdateValue(objExist,StaticUtil.PAC ...
Linux rm & cp
- 博客分类:
- Linux
rm -rf pf_worker_training
cp -avr [folder or file] ../pf_worker_training/
http://gwokae.mewggle.com/wordpress/2010/06/%E9%87%8B%E6%94%BE%E8%88%87%E6%B8%85%E9%99%A4-linux%E8%A8%98%E6%86%B6%E9%AB%94%E4%B8%AD%E7%9A%84cache-memory/
http://ask.xmodulo.com/check-memory-usage-linux.html
The following command prints the second column in the output of processes which contains oraxpo in their name.
$ ps -ef | grep oraxpo | grep -v grep | awk '{print $2}'
4665
4667
4669
4671
4673
4675
4677
4679
4681
4683
4685
4687
4689
4691
4713
4715
4719
4735
4749
7720
Now al ...
解決多線程派任務問題:
使用: 每次只update 一條記錄的方法來達到派送目的.(取update 記錄ID),
如: folder table 為要派送的table, 在folder table有個字段process, process 每update一次就加1,加1后就是取得ID去工作。另一個線程來了就update令一個記錄 加1,不定loop,達到每線線派一個,不會沖突。
SQL:
set @update_id := 0;
update pf_folder_temp as s, (select id from pf_folder_temp order by process,i ...
daysBetween
- 博客分类:
- Java
public int daysBetween(String dateStr) throws ParseException {
Date today = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date compareDate = sdf.parse(dateStr);
Calendar cal = Calendar.getInstance();
cal.setTime(compareDate);
long time1 = ca ...
IntelliJ Idea – How to enable zoom of text by CTRL + Mouse wheel
You can zoom-in or out text in editor window of IntelliJ idea (PyCharm) by CTRL + Mouse wheel.
The only problem is that this feature is disabled by default. You have to turn it on.
Press CTRL + Alt + S (Settings) and typ ...
Collections.sort(newList,new Comparator<FolderEntity>(){
public int compare(FolderEntity f1,FolderEntity f2){
return f1.getFolderSetting().getNewOrder() - f2.getFolderSetting().getNewOrder();
}});
newOrder is my reset order.
newList as below:
List <FolderEntity> newList = ...
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<list.size();i++){
Object[] objectArray = (Object[]) list.get(i);
A model_a = (A)objectArray[0];
B model_b = (B)objectArray[1];
C model_c = (C)objectArray[ ...