This file contains hidden or 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
package simulation.util; | |
import java.text.DecimalFormat; | |
/* | |
* The numbers generated by java Random is using Uniform Distribution. | |
* But recently, when I work on Timed-Petri net, it is better to use Exponential Distribution. | |
* Thus, I write a class which is like a exponential calculator. | |
* | |
* INPUT: lamda |
This file contains hidden or 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 code is to describe how to use stack implement adding two numbers. | |
* The key is the while-loop in the addTwoNum() method. | |
*/ | |
import java.util.*; | |
public class StackNumberApp { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub |
This file contains hidden or 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
public void insert(int rand){ | |
int cur = rand; | |
int j = num-1; | |
while(j>=0&&randNum[j]>cur){ | |
randNum[j+1]=randNum[j--]; | |
} | |
randNum[j+1]=cur; | |
num++; | |
} |
This file contains hidden or 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
package arr; | |
import java.util.Random; | |
public class arrTest { | |
public static void main(String[] args) { | |
int[] randNum = new int[100]; | |
int[] count = new int[31]; |
This file contains hidden or 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
package arr; | |
public class insertionSort { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
int[] arr = {5,1,2,10,12,7,8,3,9,100}; | |
sort(arr); | |
This file contains hidden or 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
The issue came up when I import a external big project, some jar files could not be found. Different from Windows OS, Mac OS X doesn't need to deploy class path or JAVA_HOME, but as a new user of Mac I just make this convenience complex. To deal with the issue, I searched for "where is jdk on mac located", "where is Library file on mac". | |
It's hard to operate jdk on Mac, but also, after searching a lot of information, finally I realized that it is unnecessary to know where the jdk is and how to change it. | |
All settings have been deployed automaticly after downloading Eclipse, the additional things that developer needs to do is: if you realize that some .jar files are not included in your jdk /lib file while developing, just download the .jar file from internet and then click on Eclipse <Preference> --> <Java> --> <Installed JREs> --> select your JDK --> <Edit>, then you can see your JRE system libraries. If the jar you want doesn't exist there, click on <Add External JARs to the list>, go to your downloaded |