- 浏览: 76599 次
- 性别:
- 来自: 上海
最新评论
-
kchiu:
你这个写的太简略
struts2 poi excel -
雨打蕉叶:
有意思
技巧:ArrayList删除元素时, 从尾部开始遍历,可大大提升执行效率 -
hesihua:
算法:数字转换大写 -
vern_jang:
你这个是strut2的吧,strut1怎么用,不好使,可以教一 ...
JSP自定义分页标签(struts1 和struts2等均适用) -
guoyangjie:
谢谢了,我自己去官方下载了下
struts2使用ajax
文章列表
一.必备包
1.commons-collections-3.2.1.jar
2.ejb3-persistence.jar
3.hibernate3.jar
4.hibernate-jpa-2.0-api-1.0.1.Final.jar
5.javassist-3.15.0-GA.jar
6.jboss-logging-3.1.0.GA.jar
7.jboss-transaction-api_1.1_spec-1.0.0.Final.jar
8.slf4j-api-1.6.1.jar
9.数据库驱动包(MySql:mysql-connector ...
一.需求描述
如:180 = 2 * 2 * 3 * 3 * 5, 则180 的质数因子就是 2 2 3 3 5
二.实现思路
1. 180 = 2 * 90
2. 180 = 2 * 2 * 45
3. 180 = 2 * 2 * 3 * 15
4. 180 = 2 * 2 * 3 * 3 * 5
由于2, 3, 5 都是质数,所以结束.
三.代码实现(List)
1. 将 180 放入 list, 此时list:[180];
2. 遍历list,判断180不是质数,则计算他的因子,并且取代他,此时li ...
import java.util.HashMap;
import java.util.Map;
/**
* 思路:到达{M,N}坐标的路径数 = 到达{M-1,N}的路径数 + 到达{M,N-1}的路径数
* 利用容器MAP,存储到达{x,y}的路径数,可以避免一些重复计算,提高效率
*
* @author xiaojianhx
* @date 2012-10-19
*/
public class Demo {
/** X坐标 */
private int maxX;
/** Y坐标 */
private int ...
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Demo {
private List<String> ITEM = Arrays.asList("1", "2", "3");
private int SIZE = 3;
public void array() {
List<String> data = new Ar ...
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Demo {
private List<String> ITEM = Arrays.asList("1", "2", "3", "4", "5", "6", "7", "8", "9");
pr ...
import java.util.ArrayList;
import java.util.List;
public class Demo {
private char ZERO = '0';
private char ZERO_CN = '零';
private String[] NUMBER = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", &quo ...
public class $ {
public static void main(String[] args) {
for (int i = 1; i <= 100; i++) {
if (i == 1) {
System.out.println("1不是素数也不是合数.");
continue;
}
if (check(i)) {
System.o ...
public class $ {
public static void main(String... _) {
test('A', 'B', 'C', 3);
}
/**
* 借助A,移动盘子:B->C
*
* @param a
* 盘子A
* @param b
* 盘子B
* @param c
* 盘子C
* @param n
* ...
private static void test(int num) {
int a = (int) Math.sqrt(num);
for (int i = 2; i < a; i++) {
if (num % i == 0) {
System.out.println(i);
}
}
}
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
public class $ {
private static int[] DAYS = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
public static void main(String... _) {
long l1 = System.currentTimeMillis();
List data ...
UNICODE写的天书
- 博客分类:
- JAVA
\u0070\u0061\u0063\u006b\u0061\u0067\u0065 \u0063\u006f\u006d\u002e\u0063\u006e\u0061\u0073\u003b
\u0070\u0075\u0062\u006c\u0069\u0063 \u0063\u006c\u0061\u0073\u0073 \u0024 {
\u0070\u0075\u0062\u006c\u0069\u0063 \u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006f\u0069\u0064 \u006d\u0061\u006 ...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="JAR_COMMONS_DREAM_LANG" name="commons-dream-lang">
<property name="COMMONS-DREAM-LANG-SRC.DIR" value="src" />
...
1.user.hbm.xml
<set name="stationSet" table="T_USER_STATION" inverse="true" cascade="all" lazy="true">
<key column="I_USER_ID" />
<many-to-many column="I_STATION_ID" class="Station" />
</s ...
1.user.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.ap ...
一.创建PK类
import java.io.Serializable;
public class PKCode implements Serializable {
private Integer code;
private Integer codeType;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
...