-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
amanda
committed
May 21, 2016
1 parent
9e40780
commit 479439b
Showing
115 changed files
with
267 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.7 |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.28 KB
TestCode/WebRoot/WEB-INF/classes/InsuranceRateCalculator/Calculator.class
Binary file not shown.
Binary file added
BIN
+1.35 KB
TestCode/WebRoot/WEB-INF/classes/InsuranceRateCalculator/Person$Gender.class
Binary file not shown.
Binary file added
BIN
+1.28 KB
TestCode/WebRoot/WEB-INF/classes/InsuranceRateCalculator/Person.class
Binary file not shown.
Binary file added
BIN
+1.12 KB
TestCode/WebRoot/WEB-INF/classes/InsuranceRateCalculator/RateCalculator.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<style type="text/css"> | ||
tr td{border: solid 1px red;} | ||
</style> | ||
<script type="text/javascript" src="jquery.js"></script> | ||
</head> | ||
<body> | ||
<table id="main"> | ||
|
||
</table> | ||
<script type="text/javascript"> | ||
var arr = '{"red":{"id":1,"name":"mary"},"blue":{"id":2,"name":"u71d5u5b50"}}';//u71d5u5b50这个是php中自动转换的 | ||
var dataObj = eval_r("("+arr+")");//这里要加上加好括号和双引号的原因我也不知道,就当是json语法,只能死记硬背了 | ||
$.each(dataObj,function(idx,item){ | ||
//输出 | ||
alert(item.id+"哈哈"+item.name); | ||
var html="<tr><td>"+"id:"+"</td><td>"+dataObj[idx].id+"</td><td>"+"name:</td><td>"+dataObj[idx].name+"</td></tr>"; | ||
$("#main").html(html); | ||
}) | ||
</script> | ||
<!-- 另外一种读取方法 --> | ||
<!-- | ||
<script type="text/javascript"> | ||
var d1 =[{"text":"王家湾","value":"9"},{"text":"李家湾","value":"10"},{"text":"邵家湾","value":"13"}]; | ||
$(d1).each(function(){ | ||
alert(this.text+" "+this.value); | ||
}); | ||
</script> | ||
--> | ||
</script> | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+679 Bytes
TestCode/WebRoot/WEB-INF/classes/designPattern/FactoryPattern.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+872 Bytes
TestCode/WebRoot/WEB-INF/classes/designPattern/SingltonPattern.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+353 Bytes
TestCode/WebRoot/WEB-INF/classes/interfaceRelation/ChildAbstract.class
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+738 Bytes
TestCode/WebRoot/WEB-INF/classes/interfaceRelation/ChildImpl2.class
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+396 Bytes
TestCode/WebRoot/WEB-INF/classes/interfaceRelation/ParentImpl.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+880 Bytes
TestCode/WebRoot/WEB-INF/classes/multithreading/ThreadCommuication.class
Binary file not shown.
Binary file added
BIN
+975 Bytes
TestCode/WebRoot/WEB-INF/classes/multithreading/Thread_Creat_Thread.class
Binary file not shown.
Binary file added
BIN
+782 Bytes
TestCode/WebRoot/WEB-INF/classes/multithreading/Thread_Multiple_Synchronized_Block.class
Binary file not shown.
Binary file added
BIN
+762 Bytes
TestCode/WebRoot/WEB-INF/classes/multithreading/Thread_Synchronized.class
Binary file not shown.
Binary file added
BIN
+1.13 KB
TestCode/WebRoot/WEB-INF/classes/multithreading/Thread_notify_wait.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1007 Bytes
TestCode/WebRoot/WEB-INF/classes/suanfa/Maximum_Product_Subarray.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package IncomeRateCalculator; | ||
|
||
import java.util.HashSet; | ||
import java.util.Scanner; | ||
import java.util.Set; | ||
|
||
import IncomeRateCalculator.Person.Gender; | ||
|
||
public class APP { | ||
|
||
|
||
public static void main(String[] args){ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Person p1=new Person("Mike",25,500,Gender.Male); | ||
Person p2=new Person("Derek",24,1000,Gender.Male); | ||
Person p3=new Person("Cathy",23,2000,Gender.Female); | ||
|
||
Set<Person> personSet=new HashSet<Person>(); | ||
|
||
personSet.add(p1); | ||
personSet.add(p2); | ||
personSet.add(p3); | ||
personSet.add(new Person("Jero",60,15000,Gender.Male)); | ||
|
||
|
||
Calculator c=new Calculator(); | ||
|
||
for(Person p:personSet){ | ||
int finalRate=c.calculate(p); | ||
System.out.println("Name: "+p.getName()+" Age: "+p.getAge()+" Gender: "+p.getGender()+" Rate: "+finalRate); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package IncomeRateCalculator; | ||
|
||
public class Calculator { | ||
|
||
int personIncome; | ||
int personAge; | ||
String gender; | ||
|
||
int incomeRateByIncome; | ||
|
||
int incomeRateByAge; | ||
int incomeRateByGender; | ||
|
||
public int calculate(Person p){ | ||
|
||
RateCalculator incomeRateCalculator=new RateCalculator(); | ||
|
||
|
||
|
||
|
||
if(p!=null){ | ||
personIncome=p.getIncome(); | ||
personAge=p.getAge(); | ||
gender=p.getGender(); | ||
|
||
incomeRateByIncome=incomeRateCalculator.calculateRateByIncome(personIncome); | ||
incomeRateByGender=incomeRateCalculator.calculateRateByGender(gender); | ||
incomeRateByAge=incomeRateCalculator.calculateRateByAge(personAge); | ||
|
||
|
||
} | ||
|
||
return this.calculateTotal(); | ||
} | ||
|
||
|
||
|
||
public int calculateTotal(){ | ||
|
||
|
||
|
||
return incomeRateByIncome*incomeRateByGender*incomeRateByAge; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package IncomeRateCalculator; | ||
|
||
public class Person { | ||
private String name; | ||
private int age; | ||
private int income; | ||
private Gender gender; | ||
|
||
|
||
|
||
public enum Gender{ | ||
Male("boy"), | ||
Female("girl"); | ||
|
||
private String gender; | ||
|
||
Gender(String gender){ | ||
this.gender=gender; | ||
} | ||
|
||
public String getGender(){ | ||
return gender; | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
public Person(String name, int age, int income,Gender gender) { | ||
super(); | ||
this.gender=gender; | ||
this.name = name; | ||
this.age = age; | ||
this.income = income; | ||
} | ||
|
||
public String getGender(){ | ||
return gender.getGender(); | ||
} | ||
|
||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public int getAge() { | ||
return age; | ||
} | ||
|
||
public void setAge(int age) { | ||
this.age = age; | ||
} | ||
|
||
public int getIncome() { | ||
return income; | ||
} | ||
|
||
public void setIncome(int income) { | ||
this.income = income; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package IncomeRateCalculator; | ||
|
||
import IncomeRateCalculator.Person.Gender; | ||
|
||
public class RateCalculator { | ||
|
||
public int calculateRateByIncome(int income) { | ||
|
||
switch (income > 0 ? (income > 200 ? (income > 500 ? (income > 1000 ? 4 : 3) : 2) : 1) : -1) { | ||
|
||
case 1: | ||
return 1; | ||
case 2: | ||
return 2; | ||
case 3: | ||
return 5; | ||
case 4: | ||
return 10; | ||
case -1: | ||
return 0; | ||
default: | ||
return 0; | ||
} | ||
|
||
} | ||
|
||
public int calculateRateByAge(int age) { | ||
|
||
switch (age > 0 ? (age > 18 ? (age > 25 ? (age > 60 ? 4 : 3) : 2) : 1) : -1) { | ||
case 1: | ||
return 1; | ||
case 2: | ||
return 2; | ||
case 3: | ||
return 3; | ||
case 4: | ||
return 5; | ||
case -1: | ||
return 0; | ||
default: | ||
return 0; | ||
|
||
} | ||
|
||
} | ||
|
||
public int calculateRateByGender(String gender) { | ||
|
||
switch (gender) { | ||
case "boy": | ||
return 1; | ||
case "girl": | ||
return 2; | ||
|
||
default: | ||
return 0; | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.