Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
6fcdd56
add journal(week 1)
Viscaria233 Feb 25, 2017
579721b
test
Viscaria233 Feb 25, 2017
ccb758c
test
Viscaria233 Feb 25, 2017
219534f
add journal(week 1)
Viscaria233 Feb 25, 2017
6d51dae
update week1.md
Viscaria233 Feb 25, 2017
65a8409
Update week1.md
Viscaria233 Feb 25, 2017
d8ac85e
修正MyLinkedList
Feb 25, 2017
0bc24b1
Merge remote-tracking branch 'zavier/master'
VictorShim Feb 26, 2017
1c49b05
Merge remote-tracking branch 'zavier/master'
VictorShim Feb 26, 2017
5ec96a8
Merge remote-tracking branch 'refs/remotes/zavier/master'
Feb 26, 2017
0874f23
HomeWork
Feb 26, 2017
41b51df
Merge remote-tracking branch 'upstream/master'
Feb 26, 2017
90cabd0
Merge pull request #1 from zavier/master
Viscaria233 Feb 27, 2017
5e6b06c
Merge remote-tracking branch 'refs/remotes/zavier/master'
PigTS Feb 27, 2017
6f7d223
Merge remote-tracking branch 'refs/remotes/zavier/master'
PigTS Feb 27, 2017
df8a93b
Merge remote-tracking branch 'refs/remotes/zavier/master'
sanmubird Feb 27, 2017
18b7e53
Merge pull request #29 from sanmubird/master
zavier Feb 27, 2017
8c3f450
cs
fei028 Feb 27, 2017
f3909b6
sm
fei028 Feb 27, 2017
fd82b19
move junit test for datastructures
Viscaria233 Feb 27, 2017
943cd36
move junit test for datastructures
Viscaria233 Feb 27, 2017
2cc5c0b
add algorithm practices & junit test
Viscaria233 Feb 27, 2017
d57d618
add litestruts impl
Viscaria233 Feb 27, 2017
790fa25
change "class" in struts.xml
Viscaria233 Feb 27, 2017
968f81d
完成ArrayUtil练习题
thlcly Feb 27, 2017
32e0485
修改测试用例的比较顺序
thlcly Feb 27, 2017
68594df
ArrayUtil
fei028 Feb 27, 2017
00e03b3
Merge pull request #30 from Viscaria233/master
zavier Feb 27, 2017
2b00649
Merge remote-tracking branch 'upstream/master'
Feb 27, 2017
eb02eb0
week2 init
Feb 27, 2017
08923b1
完成lite struts的功能
thlcly Feb 27, 2017
771b2e8
Merge remote-tracking branch 'upstream/master'
thlcly Feb 27, 2017
1d6d299
Merge remote-tracking branch 'refs/remotes/zavier/master'
Feb 27, 2017
362219f
Merge pull request #31 from thlcly/master
zavier Feb 27, 2017
7dbfe04
Merge pull request #32 from xxxxxxttt817/master
zavier Feb 27, 2017
c16be2a
ArrayUtil工具类提交
Feb 27, 2017
433d658
第二周代码作业
zavier Feb 28, 2017
0727c7d
第二次作业提交
Feb 28, 2017
f843ea0
Merge remote-tracking branch 'upstream/master'
Feb 28, 2017
03fa8bf
草稿版(测试已通过)
PigTS Feb 28, 2017
8891599
Merge pull request #33 from GallenZhang/master
zavier Mar 1, 2017
9c4b512
Second week assignment
PigTS Mar 1, 2017
4b80517
网页版对齐code
PigTS Mar 1, 2017
2f386ae
Merge pull request #34 from HuiZhou-Xmu/master
zavier Mar 1, 2017
9c2dc24
重新整理
fei028 Mar 2, 2017
c08f419
tj
fei028 Mar 2, 2017
d2ff5ac
tj
fei028 Mar 2, 2017
be30631
tj
fei028 Mar 2, 2017
4296c49
Merge branch 'master' of https://github.com/fei028/coding2017-1.git
fei028 Mar 2, 2017
550ae37
file path
fei028 Mar 2, 2017
c0377f0
Merge remote-tracking branch 'upstream/master'
fei028 Mar 3, 2017
48ae950
Merge pull request #37 from fei028/master
zavier Mar 3, 2017
a05ad2a
Merge pull request #1 from zavier/master
huaerhly Mar 3, 2017
429c46b
数据结构习题及小型struct
huaerhly Mar 3, 2017
57a9ba4
Merge pull request #38 from huaerhly/master
zavier Mar 3, 2017
d1328d0
Merge remote-tracking branch 'refs/remotes/zavier/master'
xqfGit Mar 3, 2017
c94ca70
Merge remote-tracking branch 'refs/remotes/zavier/master'
xqfGit Mar 3, 2017
5eda14f
第2周
lvxg Mar 4, 2017
4056457
Merge remote-tracking branch 'group1/master'
Mar 4, 2017
ec78c44
Merge remote-tracking branch 'zavier/master'
VictorShim Mar 4, 2017
b9a602b
week2 arrayUtil
Mar 4, 2017
3c7f21d
2
lvxg Mar 4, 2017
f91cf8f
2
lvxg Mar 4, 2017
805b948
parse struts.xml
Mar 4, 2017
e213ec0
第二周数据结构练习
VictorShim Mar 4, 2017
abfd68a
action完成
Mar 5, 2017
a9280d4
Merge remote-tracking branch 'zavier/master'
Mar 5, 2017
334e10c
第二周作业Jim
Mar 5, 2017
43da374
第二周数据结构&读取xml作业
VictorShim Mar 5, 2017
1c0e9e9
添加测试用例
VictorShim Mar 5, 2017
a6ba34e
xqf
xqfGit Mar 5, 2017
41c51b2
Merge pull request #39 from dutekt/master
zavier Mar 5, 2017
2492abb
Merge pull request #40 from lvxg/master
zavier Mar 5, 2017
0161e31
Merge pull request #41 from dfjhde/master
zavier Mar 5, 2017
4f2daf3
Merge pull request #43 from VictorShim/master
zavier Mar 5, 2017
f920c42
Merge pull request #44 from xqfGit/master
zavier Mar 5, 2017
55bcf64
change file directory and commit homework
camilesing Mar 5, 2017
9ddc216
Merge pull request #46 from camilesing/dev
zavier Mar 5, 2017
fa533a5
第二次大作业
sanmubird Mar 5, 2017
8d39112
Merge pull request #48 from onlyliuxin/master
zavier Mar 6, 2017
1710345
Merge remote-tracking branch 'refs/remotes/zavier/master'
sanmubird Mar 6, 2017
edbeb0e
第二次作业
sanmubird Mar 6, 2017
476d420
第二次作业
sanmubird Mar 6, 2017
b73a1c1
Merge remote-tracking branch 'refs/remotes/zavier/master'
sanmubird Mar 6, 2017
72d11ca
Merge pull request #47 from sanmubird/master
zavier Mar 7, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions group01/1298552064/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="src/dom4j-1.6.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions group01/1298552064/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions group01/1298552064/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>1298552064Learning</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
2 changes: 1 addition & 1 deletion group01/1298552064/src/week01/basic/MyLinkedList.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public Object removeLast() {
Node p = head;
for (int i = 0; i < size; i++) {
if (p.next.next == null) {
removeObject = p.next;
removeObject = p.next.data;
p.next = null;
break;
} else {
Expand Down
245 changes: 245 additions & 0 deletions group01/1298552064/src/week02/array/ArrayUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
package week02.array;

import java.util.Arrays;

public class ArrayUtil {

// 工具类,不予许创建实例
private ArrayUtil() {
}

/**
* 给定一个整形数组a , 对该数组的值进行置换 例如: a = [7, 9 , 30, 3] , 置换后为 [3, 30, 9,7] 如果 a =
* [7, 9, 30, 3, 4] , 置换后为 [4,3, 30 , 9,7]
*
* @param origin
* @return
*/
public static void reverseArray(int[] origin) {
if (origin != null && origin.length > 0) {
int temp = 0;

// 数组首尾元素置换
for (int i = 0; i < origin.length / 2; i++) {
temp = origin[i];
origin[i] = origin[origin.length - i - 1];
origin[origin.length - i - 1] = temp;
}
}
}

/**
* 现在有如下的一个数组: int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5}
* 要求将以上数组中值为0的项去掉,将不为0的值存入一个新的数组,生成的新数组为: {1,3,4,5,6,6,5,4,7,6,7,5}
*
* @param oldArray
* @return
*/

public static int[] removeZero(int[] oldArray) {
int[] newArray = null;
if (oldArray != null) {
newArray = new int[oldArray.length];
int size = 0;
for (int i = 0; i < oldArray.length; i++) {
if (oldArray[i] != 0) {
newArray[size] = oldArray[i];
size++;
}
}
newArray = Arrays.copyOf(newArray, size);
}
return newArray;
}

/**
* 给定两个已经排序好的整形数组, a1和a2 , 创建一个新的数组a3, 使得a3 包含a1和a2 的所有元素, 并且仍然是有序的 例如 a1 =
* [3, 5, 7,8] a2 = [4, 5, 6,7] 则 a3 为[3,4,5,6,7,8] , 注意: 已经消除了重复
*
* @param array1
* @param array2
* @return
*/

public static int[] merge(int[] array1, int[] array2) {
int[] newArray = null;
if (array1 != null && array2 != null) {
int size = 0;

// index1、index2表示array1和array2数组的比较索引
int index1 = 0, index2 = 0;
newArray = new int[array1.length + array2.length];

while (index1 < array1.length && index2 < array2.length) {
if (array1[index1] == array2[index2]) {
newArray[size++] = array1[index1];
index1++;
index2++;
} else if (array1[index1] < array2[index2]) {
// 数组array1去重
if (size > 0 && array1[index1] == newArray[size - 1]) {
size--;
}
newArray[size++] = array1[index1];
index1++;
} else {
// 数组array2去重
if (size > 0 && array2[index2] == newArray[size - 1]) {
size--;
}
newArray[size++] = array2[index2];
index2++;
}
}

// 将数组array1剩下的元素放入
while (index1 < array1.length) {
newArray[size++] = array1[index1++];
}

// 将数组array2剩下的元素放入
while (index2 < array2.length) {
newArray[size++] = array2[index2++];
}

// 合并后有序数组
newArray = Arrays.copyOf(newArray, size);
}
return newArray;
}

/**
* 把一个已经存满数据的数组 oldArray的容量进行扩展, 扩展后的新数据大小为oldArray.length + size
* 注意,老数组的元素在新数组中需要保持 例如 oldArray = [2,3,6] , size = 3,则返回的新数组为
* [2,3,6,0,0,0]
*
* @param oldArray
* @param size
* @return
*/
public static int[] grow(int[] oldArray, int size) {
int[] newArray = null;
if (oldArray != null) {
newArray = new int[oldArray.length + size];
for (int i = 0; i < oldArray.length; i++) {
newArray[i] = oldArray[i];
}
}
return newArray;
}

/**
* 斐波那契数列为:1,1,2,3,5,8,13,21...... ,给定一个最大值, 返回小于该值的数列 例如, max = 15 ,
* 则返回的数组应该为 [1,1,2,3,5,8,13] max = 1, 则返回空数组 []
*
* @param max
* @return
*/
public static int[] fibonacci(int max) {

// 计算方法:f(n) = f(n-1) + f(n-2) 采用数组计算
int[] result = null;
if (max <= 1) {
result = new int[] {};
} else {
int i = 2;
result = new int[max];
result[0] = result[1] = 1;
for (; i < max; i++) {
if (result[i - 1] + result[i - 2] < max) {
result[i] = result[i - 1] + result[i - 2];
} else {
break;
}
}
result = Arrays.copyOf(result, i);
}
return result;
}

/**
* 返回小于给定最大值max的所有素数数组 例如max = 23, 返回的数组为[2,3,5,7,11,13,17,19]
*
* @param max
* @return
*/
public static int[] getPrimes(int max) {
int[] newArray = new int[] {};
if (max > 2) {
newArray = new int[max];
int size = 0, j = 0;
for (int i = 2; i < max; i++) {
for (j = 2; j < i / 2 + 1; j++) {
if (i % j == 0) {
break;
}
}

if (j == i / 2 + 1) {
newArray[size++] = i;
}
}
newArray = Arrays.copyOf(newArray, size);
}
return newArray;
}

/**
* 所谓“完数”, 是指这个数恰好等于它的因子之和,例如6=1+2+3 给定一个最大值max, 返回一个数组, 数组中是小于max 的所有完数
*
* @param max
* @return
*/
public static int[] getPerfectNumbers(int max) {
int[] newArray = new int[] {};
if (max > 0) {
newArray = new int[max];
int size = 0, sum = 0;
for (int i = 1; i < max; i++) {
sum = 0;
for (int j = 1; j < i / 2 + 1; j++) {
if (i % j == 0) {
sum += j;
}
}
if (i == sum) {
newArray[size++] = i;
}
}
newArray = Arrays.copyOf(newArray, size);
}
return newArray;
}

/**
* 用seperator 把数组 array给连接起来 例如array= [3,8,9], seperator = "-" 则返回值为"3-8-9"
*
* @param array
* @param seperator
* @return
*/
public static String join(int[] array, String seperator) {
String joinResult = null;
if (array != null) {
joinResult = "";
for (int i = 0; i < array.length; i++) {
joinResult += array[i] + seperator;
}
joinResult = joinResult.equals("") ? "" : joinResult.substring(0, joinResult.length() - 1);
}
return joinResult;
}

public static void main(String[] args) {
int[] a = new ArrayUtil().getPerfectNumbers(1000);
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}

// [2,3,5,7,11,13,17,19]
a = new ArrayUtil().getPrimes(20);
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
}
}
42 changes: 42 additions & 0 deletions group01/1298552064/src/week02/litestruts/LoginAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package week02.litestruts;

/**
* 这是一个用来展示登录的业务类, 其中的用户名和密码都是硬编码的。
*
* @author liuxin
*
*/
public class LoginAction {
private String name;
private String password;
private String message;

public String getName() {
return name;
}

public String getPassword() {
return password;
}

public String execute() {
if ("test".equals(name) && "1234".equals(password)) {
this.message = "login successful";
return "success";
}
this.message = "login failed,please check your user/pwd";
return "fail";
}

public void setName(String name) {
this.name = name;
}

public void setPassword(String password) {
this.password = password;
}

public String getMessage() {
return this.message;
}
}
Loading