Util
textboy
专注于技术与管理并行发展
展开
-
java - mysql连接
前置:mysql-connector-java-x.x.xx-bin.jar (e.g. mysql-connector-java-5.1.26-bin.jar)Get connection: public static Connection getConnection() { Connection conn = null; String url = "jd原创 2015-08-27 10:19:03 · 505 阅读 · 0 评论 -
[Python]不定长矩阵转置
# transpose matrix even length of lines is differentdef transpose(matrix): maxLineLen = 0 tLine = [] tMatrix = [] # compute max length in lines for i in matrix: if maxLine原创 2016-01-20 11:53:32 · 1034 阅读 · 0 评论 -
数据库连接、批量插入
insert(批量插入) public static void insertValue(Connection conn, List transList) { String sql = "insert into bank_trans (" + "no, trans_dt, rec_dt, trans_currency, trans_status, trans_income, t原创 2015-09-16 09:20:23 · 677 阅读 · 0 评论 -
DeepCopy
DeepCopy util:import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.ObjectInputStream;import java.io.ObjectOutputStream;import java.io.Serializable;import net转载 2015-10-12 16:15:40 · 734 阅读 · 0 评论 -
json读取+对象转换+csv读写
注意:json读取已支持中文,csv写出用ultraedit打开中文没问题,但如要在excel中支持中文,要另行把csv file另存为 ascii 格式。package utils;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.Fi原创 2015-11-05 17:04:43 · 4243 阅读 · 2 评论 -
java - properties read write
架构:Get properties: public static Properties getProperties(String fileName) { String filePath = "src/resource/" + fileName + ".properties"; File pFile = new File(filePath); FileInputS原创 2015-08-27 10:25:42 · 560 阅读 · 0 评论 -
java - MD5Util
import java.security.MessageDigest;public class MD5Util { public final static String MD5(String s) { char hexDigits[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};转载 2015-08-18 11:07:37 · 4868 阅读 · 0 评论 -
java - HttpRequest (get&post)
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.PrintWriter;import java.net.URL;import java.net.URLConnection;import java.util.List;impo转载 2015-08-18 11:05:57 · 1653 阅读 · 0 评论 -
java - 日期相减、四舍五入
Sample: public static void convertYearStudy(Connection conn, ResultSet rs, String dateStartStr, String dateEndStr, String updateField) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");原创 2015-08-26 18:17:02 · 2080 阅读 · 0 评论 -
Eclipse版本查看
查看版本数字:{eclipse安装目录}\.eclipseproduct,例如:version=4.2.0版本代号和版本数字对比:http://baike.baidu.com/history/eclipse/94959814#3原创 2016-01-25 15:57:38 · 429 阅读 · 0 评论