Skip to content

Commit e437f70

Browse files
committed
add concurrent programming course and project0
1 parent 2f0099e commit e437f70

File tree

60 files changed

+238
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+238
-55
lines changed
File renamed without changes.

ConcurrentProg/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.concurrent</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.concurrent;
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 Concurrent Programming Coursera course.
3+
*/
4+
package edu.coursera.concurrent;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package edu.coursera.concurrent;
2+
3+
import java.util.Random;
4+
5+
import junit.framework.TestCase;
6+
7+
public class SetupTest extends TestCase {
8+
9+
/*
10+
* A simple test case.
11+
*/
12+
public void testSetup() {
13+
final int result = Setup.setup(42);
14+
assertEquals(42, result);
15+
}
16+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ParallelProg/miniproject_4/.gitignore

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Directories #
2+
/build/
3+
/bin/
4+
target/
5+
# OS Files #
6+
.DS_Store
7+
*.class
8+
# Package Files #
9+
*.jar
10+
*.war
11+
*.ear
12+
*.db
13+
######################
14+
# Windows
15+
######################
16+
# Windows image file caches
17+
Thumbs.db
18+
# Folder config file
19+
Desktop.ini
20+
######################
21+
# OSX
22+
######################
23+
.DS_Store
24+
.svn
25+
# Thumbnails
26+
._*
27+
# Files that might appear on external disk
28+
.Spotlight-V100
29+
.Trashes
30+
######################
31+
# Eclipse
32+
######################
33+
*.pydevproject
34+
.project
35+
.metadata
36+
bin/**
37+
tmp/**
38+
tmp/**/*
39+
*.tmp
40+
*.bak
41+
*.swp
42+
*~.nib
43+
local.properties
44+
.classpath
45+
.settings/
46+
.loadpath
47+
/src/main/resources/rebel.xml
48+
# External tool builders
49+
.externalToolBuilders/
50+
# Locally stored "Eclipse launch configurations"
51+
*.launch
52+
# CDT-specific
53+
.cproject
54+
# PDT-specific
55+
.buildpath
56+
57+
# For Android Project
58+
# built application files
59+
*.apk
60+
*.ap_
61+
62+
# files for the dex VM
63+
*.dex
64+
65+
# Java class files
66+
*.class
67+
68+
# generated files
69+
bin/
70+
gen/
71+
72+
#libraries
73+
libs/
74+
75+
#logs
76+
*.log
77+
78+
# Local configuration file (sdk path, etc)
79+
local.properties
File renamed without changes.
File renamed without changes.

miniproject_4/.classpath

Lines changed: 0 additions & 32 deletions
This file was deleted.

miniproject_4/.project

Lines changed: 0 additions & 23 deletions
This file was deleted.

miniproject_4/hamcrest-core-1.3.jar

-44 KB
Binary file not shown.

miniproject_4/junit-4.12.jar

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

0 commit comments

Comments
 (0)