Skip to content

Instantly share code, notes, and snippets.

View xuechong87's full-sized avatar
🎮
On vacation

宇宙総姐夫 xuechong87

🎮
On vacation
View GitHub Profile
@xuechong87
xuechong87 / some thing about java.txt
Created June 30, 2014 02:09
some thing about java
JVM’s limit of 65536 bytes of bytecode per method.
一个方法只能有255个参数
@xuechong87
xuechong87 / getMethodName.py
Created December 24, 2014 07:08
python 获取方法名
import inspect
class Test1():
@staticmethod
def printMethodName ():
print( "method:" + inspect.stack()[1][3] + "\n")
@xuechong87
xuechong87 / breakline.html
Last active December 15, 2015 08:59
折行
<div style="width:200px;overflow:hidden;word-warp:break-word;word-break:break-all;">
${折行}
</div>
<div style="width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
${截取 }
</div>
<pre style="white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap;word-warp:break-word;word-break:break-all;">
</pre>
@xuechong87
xuechong87 / 中文unicode
Created July 16, 2013 06:43
中文unicode
//13311
//40891
//59412
//64045
@xuechong87
xuechong87 / fast map init
Last active December 19, 2015 19:29
Java thing
Map<String, String> map = new HashMap<String, String>() {
{
put("a", "a");
put("b", "b");
}
};
@xuechong87
xuechong87 / log4j优化
Created July 16, 2013 06:51
log4j优化
有多少人用Log4j的时候会在每一个Debug/Info之前加一个判断?
可能很多人都说了,这有什么关系,我在运行的时候是把Log Level设置成Error的。
那么请看下面这个代码:
String result;
...
...
...
@xuechong87
xuechong87 / catalina
Created July 23, 2013 07:57
catalina
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m
@xuechong87
xuechong87 / outFile.sql
Created August 27, 2013 09:35
mysql out file
SELECT *
INTO OUTFILE 'path'
FIELDS TERMINATED BY ' | '
FROM table
@xuechong87
xuechong87 / dataCountDown.java
Created August 28, 2013 08:38
dataCountDown
private final long day = 1000L*60L*60L*24L;
private final long hour = 1000L*60L*60L;
private final long min = 1000L*60L;
private final long sec = 1000L;
private String countDownTimeStr(Date openDate, Date endDate) {
StringBuilder result = new StringBuilder();
Date now = new Date();
Date deadLine = openDate.after(now)?openDate:endDate;
@xuechong87
xuechong87 / maven.xml
Created September 4, 2013 02:30
maven settings
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository></localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>