Skip to content

Commit cd70128

Browse files
committed
completed project1
0 parents  commit cd70128

File tree

28 files changed

+1553
-0
lines changed

28 files changed

+1553
-0
lines changed

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.metadata
2+
bin/
3+
tmp/
4+
*.tmp
5+
*.bak
6+
*.swp
7+
*~.nib
8+
local.properties
9+
.settings/
10+
.loadpath
11+
.recommenders
12+
.DS_Store
13+
14+
# External tool builders
15+
.externalToolBuilders/
16+
17+
# Locally stored "Eclipse launch configurations"
18+
*.launch
19+
20+
# CDT- autotools
21+
.autotools
22+
23+
# Java annotation processor (APT)
24+
.factorypath
25+
26+
# PDT-specific (PHP Development Tools)
27+
.buildpath
28+
29+
# sbteclipse plugin
30+
.target
31+
32+
# Tern plugin
33+
.tern-project
34+
35+
# TeXlipse plugin
36+
.texlipse
37+
38+
# STS (Spring Tool Suite)
39+
.springBeans
40+
41+
# Code Recommenders
42+
.recommenders/
43+
44+
# Annotation Processing
45+
.apt_generated/
46+
47+
# Scala IDE specific (Scala & Java development for Eclipse)
48+
.cache-main
49+
.worksheet

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ParallelProgrammingJava
2+
Based on Parallel Programming in Java course by Rice University (Coursera)
3+
4+
Projects covering task (1), functional (2), loop (3) and data flow (4) parallelism.

miniproject_0/.classpath

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
<attribute name="test" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
22+
<attributes>
23+
<attribute name="maven.pomderived" value="true"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
31+
<classpathentry kind="output" path="target/classes"/>
32+
</classpath>

miniproject_0/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>miniproject_0</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>

miniproject_0/hamcrest-core-1.3.jar

44 KB
Binary file not shown.

miniproject_0/junit-4.12.jar

308 KB
Binary file not shown.
30.1 KB
Binary file not shown.

miniproject_0/pom.xml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>edu.coursera.parallel</groupId>
6+
<artifactId>miniproject_0</artifactId>
7+
<packaging>jar</packaging>
8+
<version>0.0</version>
9+
<name>miniproject_0</name>
10+
11+
<properties>
12+
<pcdp.version>0.0.4-SNAPSHOT</pcdp.version>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
</properties>
15+
16+
<repositories>
17+
<repository>
18+
<id>pcdp-repo</id>
19+
<url>https://raw.github.com/habanero-maven/hjlib-maven-repo/mvn-repo-pcdp-${pcdp.version}/</url>
20+
<snapshots>
21+
<enabled>true</enabled>
22+
<updatePolicy>always</updatePolicy>
23+
</snapshots>
24+
</repository>
25+
</repositories>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-resources-plugin</artifactId>
31+
<version>2.4.3</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>edu.rice.pcdp</groupId>
35+
<artifactId>pcdp-core</artifactId>
36+
<version>${pcdp.version}</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>junit</groupId>
40+
<artifactId>junit</artifactId>
41+
<version>3.8.2</version>
42+
<scope>test</scope>
43+
</dependency>
44+
</dependencies>
45+
46+
<build>
47+
<pluginManagement>
48+
<plugins>
49+
<plugin>
50+
<!-- specify the java version to use during compilation -->
51+
<groupId>org.apache.maven.plugins</groupId>
52+
<artifactId>maven-compiler-plugin</artifactId>
53+
<version>3.1</version>
54+
<configuration>
55+
<source>1.8</source>
56+
<target>1.8</target>
57+
</configuration>
58+
</plugin>
59+
<plugin>
60+
<!-- populates the properties for dependency jar paths -->
61+
<groupId>org.apache.maven.plugins</groupId>
62+
<artifactId>maven-dependency-plugin</artifactId>
63+
<version>2.9</version>
64+
<executions>
65+
<execution>
66+
<goals>
67+
<goal>properties</goal>
68+
</goals>
69+
</execution>
70+
</executions>
71+
</plugin>
72+
<plugin>
73+
<!-- executes test with -Xmx option -->
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-surefire-plugin</artifactId>
76+
<version>2.17</version>
77+
<configuration>
78+
<forkMode>pertest</forkMode>
79+
<argLine>-Xmx4g</argLine>
80+
<useSystemClassLoader>true</useSystemClassLoader>
81+
<testFailureIgnore>true</testFailureIgnore>
82+
</configuration>
83+
</plugin>
84+
<plugin>
85+
<groupId>org.apache.maven.plugins</groupId>
86+
<artifactId>maven-checkstyle-plugin</artifactId>
87+
<version>2.17</version>
88+
<executions>
89+
<execution>
90+
<id>checkstyle</id>
91+
<phase>validate</phase>
92+
<configuration>
93+
<configLocation>${basedir}/src/main/resources/checkstyle.xml</configLocation>
94+
<encoding>UTF-8</encoding>
95+
<consoleOutput>true</consoleOutput>
96+
<failsOnError>true</failsOnError>
97+
<failOnViolation>true</failOnViolation>
98+
</configuration>
99+
<goals>
100+
<goal>check</goal>
101+
</goals>
102+
</execution>
103+
</executions>
104+
</plugin>
105+
</plugins>
106+
</pluginManagement>
107+
</build>
108+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package edu.coursera.parallel;
2+
3+
import static edu.rice.pcdp.PCDP.finish;
4+
import static edu.rice.pcdp.PCDP.async;
5+
6+
/**
7+
* A simple class for testing compilation of an PCDP project.
8+
*/
9+
public final class Setup {
10+
11+
/**
12+
* Default constructor.
13+
*/
14+
private Setup() {
15+
}
16+
17+
/**
18+
* A simple method for testing compilation of an PCDP project.
19+
* @param val Input value
20+
* @return Dummy value
21+
*/
22+
public static int setup(final int val) {
23+
final int[] result = new int[1];
24+
finish(() -> {
25+
async(() -> {
26+
result[0] = val;
27+
});
28+
});
29+
return result[0];
30+
}
31+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Source code from the Java Parallel Programming Coursera course.
3+
*/
4+
package edu.coursera.parallel;

0 commit comments

Comments
 (0)