Initial Commit

This commit is contained in:
2012-01-22 16:14:32 -05:00
commit f5e306f67f
155 changed files with 5097 additions and 0 deletions

6
Java/IsPrime/.classpath Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>

17
Java/IsPrime/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IsPrime</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>

View File

@@ -0,0 +1,62 @@
10
dir
180
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime/.settings
svn+ssh://tcdevsvn1/svn/test
2010-11-21T15:30:21.130254Z
108
ricky.barrette
svn:special svn:externals svn:needs-lock
9a5aac6f-9f22-4a63-bd53-bef70477a034
org.eclipse.jdt.core.prefs
file
2012-01-22T19:47:00.000000Z
d25cfe62b7ff12e295da66a35642af8b
2010-11-21T15:30:21.130254Z
108
ricky.barrette
has-props
617

View File

@@ -0,0 +1,5 @@
K 13
svn:mime-type
V 10
text/plain
END

View File

@@ -0,0 +1,12 @@
#Sun Oct 31 20:11:09 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
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.6

View File

@@ -0,0 +1,12 @@
#Sun Oct 31 20:11:09 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
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.6

105
Java/IsPrime/.svn/entries Normal file
View File

@@ -0,0 +1,105 @@
10
dir
180
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime
svn+ssh://tcdevsvn1/svn/test
2010-11-21T15:33:27.340663Z
111
ricky.barrette
svn:special svn:externals svn:needs-lock
9a5aac6f-9f22-4a63-bd53-bef70477a034
.classpath
file
2012-01-22T19:47:00.000000Z
0feefca3562e5167ed8224d805b3b922
2010-11-21T15:30:21.130254Z
108
ricky.barrette
has-props
295
.project
file
2012-01-22T19:47:00.000000Z
3fe9afba4d2403c478ac165804542a88
2010-11-21T15:30:21.130254Z
108
ricky.barrette
has-props
366
.settings
dir
bin
dir
src
dir

View File

@@ -0,0 +1,5 @@
K 13
svn:mime-type
V 10
text/plain
END

View File

@@ -0,0 +1,5 @@
K 13
svn:mime-type
V 10
text/plain
END

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IsPrime</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>

View File

@@ -0,0 +1,62 @@
10
dir
180
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime/bin
svn+ssh://tcdevsvn1/svn/test
2010-11-21T15:30:21.130254Z
108
ricky.barrette
svn:special svn:externals svn:needs-lock
9a5aac6f-9f22-4a63-bd53-bef70477a034
IsPrime.class
file
delete
2012-01-22T19:47:00.000000Z
e79e996b5b85364052888227f589016a
2010-11-21T15:30:21.130254Z
108
ricky.barrette
has-props
1518

View File

@@ -0,0 +1,5 @@
K 13
svn:mime-type
V 24
application/octet-stream
END

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,62 @@
10
dir
180
svn+ssh://tcdevsvn1/svn/test/trunk/Examples/IsPrime/src
svn+ssh://tcdevsvn1/svn/test
2010-11-21T15:30:21.130254Z
108
ricky.barrette
svn:special svn:externals svn:needs-lock
9a5aac6f-9f22-4a63-bd53-bef70477a034
IsPrime.java
file
2012-01-22T19:47:00.000000Z
4b8c36f33e4ec6860a8d7dc7c9f9ace5
2010-11-21T15:30:21.130254Z
108
ricky.barrette
has-props
1252

View File

@@ -0,0 +1,5 @@
K 13
svn:mime-type
V 10
text/plain
END

View File

@@ -0,0 +1,63 @@
/**
* @author Twenty Codes, LLC
* @author ricky barrette
* @date Oct 31, 2010
*/
import java.util.Scanner;
/**
* this is my example class for is prime
* @author ricky barrette
*/
public class IsPrime {
/*
* this is the main method of the class
*
* @param args from command line
*
* @author ricky.barrette
*/
public static void main(String[] args) {
int input = 0;
boolean isPrime = true;
boolean isNumber;
/*
* we ask the user for input
* if they don't enter an int, ask for input again
*/
do{
Scanner scan = new Scanner(System.in);
System.out.print("Enter an Integer: ");
isNumber = true;
try {
input = scan.nextInt();
} catch (Exception e) {
System.out.println("Please try agian");
isNumber = false;
}
}while(! isNumber);
System.out.println("number, index, mod");
// process the input
for (int i = 2; i < input; i++) {
System.out.println(input +", "+ i +", "+ (input % i));
if ((input % i) == 0) {
isPrime = false;
// there is not point of continuing, break the loop (aka stop)
break;
}
}
// display the results
if (isPrime)
System.out.println("The number is prime");
else
System.out.println("The number is not prime");
}
}

View File

@@ -0,0 +1,63 @@
/**
* @author Twenty Codes, LLC
* @author ricky barrette
* @date Oct 31, 2010
*/
import java.util.Scanner;
/**
* this is my example class for is prime
* @author ricky barrette
*/
public class IsPrime {
/*
* this is the main method of the class
*
* @param args from command line
*
* @author ricky.barrette
*/
public static void main(String[] args) {
int input = 0;
boolean isPrime = true;
boolean isNumber;
/*
* we ask the user for input
* if they don't enter an int, ask for input again
*/
do{
Scanner scan = new Scanner(System.in);
System.out.print("Enter an Integer: ");
isNumber = true;
try {
input = scan.nextInt();
} catch (Exception e) {
System.out.println("Please try agian");
isNumber = false;
}
}while(! isNumber);
System.out.println("number, index, mod");
// process the input
for (int i = 2; i < input; i++) {
System.out.println(input +", "+ i +", "+ (input % i));
if ((input % i) == 0) {
isPrime = false;
// there is not point of continuing, break the loop (aka stop)
break;
}
}
// display the results
if (isPrime)
System.out.println("The number is prime");
else
System.out.println("The number is not prime");
}
}