Skip to content

Instantly share code, notes, and snippets.

View fankay's full-sized avatar
🚀
loading...

fankay

🚀
loading...
  • kaishengit
  • China.Jiaozuo
  • X @fankay
View GitHub Profile
@fankay
fankay / Student.java
Created July 23, 2012 02:01
Hibernate Annotation 中多对多的配置
@Entity
@Table(name="t_student")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Student {
private int id;
private String name;
private Set<Teacher> teacherSet;
@Id
@fankay
fankay / Card.java
Created July 23, 2012 03:14
Hibernate Annotation 一对一配置
@Entity
@Table(name="t_card")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Card {
private int id;
private String cardnum;
private User user;
@Id
@fankay
fankay / inde.html
Created July 23, 2012 08:17
EL表达式获取URL中的参数
<c:choose>
<c:when test="${param.code == 10001}">
<div style="color:red">用户名或密码错误</div>
</c:when>
</c:choose>
@fankay
fankay / Test.java
Created July 23, 2012 10:35
利用CommonsIO读取网页文件
package com.kaishengit.commons.io;
import java.io.InputStream;
import java.net.URL;
import org.apache.commons.io.IOUtils;
public class IOUtilsTest {
public static void main(String[] args) throws Exception {
@fankay
fankay / server.xml
Created July 27, 2012 14:01
Tomcat JNDI数据源
<Context>
<!-- maxActive: Maximum number of database connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to -1 for no limit.
-->
<!-- maxIdle: Maximum number of idle database connections to retain in pool.
@fankay
fankay / gist:3193598
Created July 28, 2012 14:23
MySQL日期格式化函数:获取月份和天数
SELECT brithday FROM t_customer
WHERE
DATE_FORMAT(brithday,'%m-%d') >= '08-07' AND DATE_FORMAT(brithday,'%m-%d') <= '09-29'
@fankay
fankay / PinYin4JTest.java
Created July 31, 2012 02:58
PinYin4J的用法
public static void main(String[] args){
String str = "凯盛软件";
System.out.println(stringToPinYin(str));
}
public static String charToPinYin(char c) {
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
@fankay
fankay / BaseDao.java
Created August 1, 2012 03:58
SSH中BaseDao的写法
package com.kaishengit.dao.core;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;
import org.hibernate.Criteria;
import org.hibernate.Query;
@fankay
fankay / test.html
Created August 5, 2012 10:44
Flot画饼图
<div id="persons" style="width:300px;height:300px"></div>
<div id="moneys" style="width:300px;height:300px"></div>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/flot/jquery.flot.min.js" type="text/javascript"></script>
<script src="js/flot/jquery.flot.pie.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var data = [
@fankay
fankay / map.html
Created August 6, 2012 10:57
调用GMaps根据地址显示对应的Google地图
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input type="text" name="" id="address" /><input type="button" value="显示地图" id="btn" />
<div id="map" style="width:700px;height:500px">