Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Assignment1/FirstThread/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This program demonstrates how thread execution works.
A given (input) number of threads are run, each with a given (input) sleep time.
11 changes: 11 additions & 0 deletions Assignment1/FirstThread/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apply plugin: 'application'
application {
mainClassName = 'FirstThread'
description = "FirstThread Example"
}

run {
// default arguments
args '5' // repeat times
args '5' // sleep delay
}
44 changes: 44 additions & 0 deletions Assignment1/FirstThread/src/main/java/FirstThread.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
class Worker425 implements Runnable {
protected int id;
protected int sleepDelay;

public Worker425 (int assignedID, int sd) {
id = assignedID;
sleepDelay = sd;
}

public void run() {
for (int loop=0; loop < 5; loop++) {
System.out.println("Hello from " + id + " loop=" + loop);
try {
Thread.sleep(sleepDelay);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
}

class FirstThread {
public static void main(String args[]) {
if (args.length != 2) {
System.out.println("Expected Arguments: <repeat(int)> <sleep(int)>");
System.exit(0);
}
int times = 5; // default repeat count
int sleepDelay = 5; // default sleep delay
try {
times = Integer.parseInt(args[0]);
sleepDelay = Integer.parseInt(args[1]);
} catch (NumberFormatException nfe) {
System.out.println("[repeat|sleep] must be integer");
System.exit(2);
}

for (int loop = 0; loop < times; loop++) {
Runnable worker = new Worker425(loop, sleepDelay*loop);
Thread task = new Thread(worker, "Task#"+loop);
task.start();
}
}
}
Empty file.
1 change: 1 addition & 0 deletions Assignment1/cli_assignment/final/average.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
64.7152
Empty file.
5 changes: 5 additions & 0 deletions Assignment1/cli_assignment/final/draft.remove/stuff.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is line one.
This is line two.
This is line three.
This is line four.
Another one!
5 changes: 5 additions & 0 deletions Assignment1/cli_assignment/final/stuff.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is line one.
This is line two.
This is line three.
This is line four.
Another one!
100 changes: 100 additions & 0 deletions Assignment1/cli_assignment/logs_bottom_100.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
dd24-056.compuserve.com - - [31/Aug/1995:23:55:50 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
cys-cap-9.wyoming.com - - [31/Aug/1995:23:55:51 -0400] "GET /shuttle/missions/sts-71/movies/sts-71-launch-3.mpg HTTP/1.0" 200 49152
tia1.eskimo.com - - [31/Aug/1995:23:55:53 -0400] "GET /software/winvn/wvsmall.gif HTTP/1.0" 200 13372
dd24-056.compuserve.com - - [31/Aug/1995:23:55:53 -0400] "GET /images/MOSAIC-logosmall.gif HTTP/1.0" 200 363
dd23-056.compuserve.com - - [31/Aug/1995:23:55:54 -0400] "GET /shuttle/missions/sts-69/endeavour-pad-prelaunch-8-31-95.gif HTTP/1.0" 200 55051
dd24-056.compuserve.com - - [31/Aug/1995:23:55:57 -0400] "GET /images/USA-logosmall.gif HTTP/1.0" 200 234
pc021.branz.org.nz - - [31/Aug/1995:23:55:58 -0400] "GET /shuttle/technology/images/sts_body_2-small.gif HTTP/1.0" 200 30067
alpc6.mpimf-heidelberg.mpg.de - - [31/Aug/1995:23:56:00 -0400] "GET /htbin/cdt_main.pl HTTP/1.0" 200 3873
beta.xerox.com - - [31/Aug/1995:23:56:00 -0400] "GET /history/apollo/apollo-1/apollo-1-info.html HTTP/1.0" 200 1434
dd24-056.compuserve.com - - [31/Aug/1995:23:56:01 -0400] "GET /images/WORLD-logosmall.gif HTTP/1.0" 200 669
beta.xerox.com - - [31/Aug/1995:23:56:09 -0400] "GET /history/apollo/apollo-1/images/ HTTP/1.0" 200 1190
mailgw.aix.or.jp - - [31/Aug/1995:23:56:12 -0400] "GET /shuttle/missions/sts-70/movies/woodpecker.mpg HTTP/1.0" 200 190269
hpbs100.boi.hp.com - - [31/Aug/1995:23:56:18 -0400] "GET /shuttle/technology/sts-newsref/sts-av.html HTTP/1.0" 200 117168
piweba4y.prodigy.com - - [31/Aug/1995:23:56:18 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
piweba4y.prodigy.com - - [31/Aug/1995:23:56:20 -0400] "GET /images/KSC-logosmall.gif HTTP/1.0" 200 1204
aitadmin.exit109.com - - [31/Aug/1995:23:56:27 -0400] "GET / HTTP/1.0" 200 7089
ad03-032.compuserve.com - - [31/Aug/1995:23:56:29 -0400] "GET /shuttle/technology/sts-newsref/stsref-toc.html HTTP/1.0" 200 84905
aitadmin.exit109.com - - [31/Aug/1995:23:56:29 -0400] "GET /images/ksclogo-medium.gif HTTP/1.0" 200 5866
dd24-056.compuserve.com - - [31/Aug/1995:23:56:29 -0400] "GET /shuttle/countdown/ HTTP/1.0" 200 4745
cust58.max2.washington.dc.ms.uu.net - - [31/Aug/1995:23:56:30 -0400] "GET / HTTP/1.0" 200 7089
aitadmin.exit109.com - - [31/Aug/1995:23:56:30 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
aitadmin.exit109.com - - [31/Aug/1995:23:56:30 -0400] "GET /images/MOSAIC-logosmall.gif HTTP/1.0" 200 363
aitadmin.exit109.com - - [31/Aug/1995:23:56:31 -0400] "GET /images/USA-logosmall.gif HTTP/1.0" 200 234
aitadmin.exit109.com - - [31/Aug/1995:23:56:31 -0400] "GET /images/WORLD-logosmall.gif HTTP/1.0" 200 669
pc021.branz.org.nz - - [31/Aug/1995:23:56:32 -0400] "GET /shuttle/technology/images/crew_compartment_13-small.gif HTTP/1.0" 200 79088
beta.xerox.com - - [31/Aug/1995:23:56:33 -0400] "GET /history/apollo/apollo-1/images/66HC1519.gif HTTP/1.0" 200 65240
cust58.max2.washington.dc.ms.uu.net - - [31/Aug/1995:23:56:35 -0400] "GET /images/ksclogo-medium.gif HTTP/1.0" 200 5866
dnet005.sat.texas.net - - [31/Aug/1995:23:56:36 -0400] "GET /htbin/cdt_main.pl HTTP/1.0" 200 3873
dnet005.sat.texas.net - - [31/Aug/1995:23:56:38 -0400] "GET /shuttle/countdown/images/countclock.gif HTTP/1.0" 304 0
ppptky467.asahi-net.or.jp - - [31/Aug/1995:23:56:38 -0400] "GET /ksc.html HTTP/1.0" 200 7089
dnet005.sat.texas.net - - [31/Aug/1995:23:56:39 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 304 0
ppptky467.asahi-net.or.jp - - [31/Aug/1995:23:56:42 -0400] "GET /images/ksclogo-medium.gif HTTP/1.0" 200 5866
cust58.max2.washington.dc.ms.uu.net - - [31/Aug/1995:23:56:43 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
cust58.max2.washington.dc.ms.uu.net - - [31/Aug/1995:23:56:44 -0400] "GET /images/MOSAIC-logosmall.gif HTTP/1.0" 200 363
cust58.max2.washington.dc.ms.uu.net - - [31/Aug/1995:23:56:44 -0400] "GET /images/USA-logosmall.gif HTTP/1.0" 200 234
cust58.max2.washington.dc.ms.uu.net - - [31/Aug/1995:23:56:44 -0400] "GET /images/WORLD-logosmall.gif HTTP/1.0" 200 669
tia1.eskimo.com - - [31/Aug/1995:23:56:44 -0400] "GET /images/MOSAIC-logosmall.gif HTTP/1.0" 200 363
tia1.eskimo.com - - [31/Aug/1995:23:56:45 -0400] "GET /images/KSC-logosmall.gif HTTP/1.0" 200 1204
ppptky467.asahi-net.or.jp - - [31/Aug/1995:23:56:45 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
ppptky467.asahi-net.or.jp - - [31/Aug/1995:23:56:45 -0400] "GET /images/MOSAIC-logosmall.gif HTTP/1.0" 200 363
ppptky467.asahi-net.or.jp - - [31/Aug/1995:23:56:46 -0400] "GET /images/USA-logosmall.gif HTTP/1.0" 200 234
ppptky467.asahi-net.or.jp - - [31/Aug/1995:23:56:46 -0400] "GET /images/WORLD-logosmall.gif HTTP/1.0" 200 669
tia1.eskimo.com - - [31/Aug/1995:23:56:50 -0400] "GET /images/USA-logosmall.gif HTTP/1.0" 200 234
tia1.eskimo.com - - [31/Aug/1995:23:56:52 -0400] "GET /images/WORLD-logosmall.gif HTTP/1.0" 200 669
pc021.branz.org.nz - - [31/Aug/1995:23:56:54 -0400] "GET /shuttle/technology/images/aft_fuselage_2-small.gif HTTP/1.0" 200 45632
dd24-056.compuserve.com - - [31/Aug/1995:23:57:03 -0400] "GET /shuttle/missions/sts-69/count69.gif HTTP/1.0" 200 46053
dffl6-14.gate.net - - [31/Aug/1995:23:57:21 -0400] "GET /history/gemini/gemini.html HTTP/1.0" 200 2522
dd14-052.compuserve.com - - [31/Aug/1995:23:57:23 -0400] "GET /shuttle/technology/sts-newsref/stsover-prep.html HTTP/1.0" 200 142213
dffl6-14.gate.net - - [31/Aug/1995:23:57:23 -0400] "GET /images/gemini-logo.gif HTTP/1.0" 200 4452
dffl6-14.gate.net - - [31/Aug/1995:23:57:25 -0400] "GET /images/ksclogosmall.gif HTTP/1.0" 200 3635
dffl6-14.gate.net - - [31/Aug/1995:23:57:25 -0400] "GET /history/apollo/images/apollo-logo.gif HTTP/1.0" 200 3047
ip206.pom.primenet.com - - [31/Aug/1995:23:57:38 -0400] "GET /shuttle/countdown/images/countclock.gif HTTP/1.0" 200 13994
beta.xerox.com - - [31/Aug/1995:23:57:40 -0400] "GET /history/apollo/apollo-1/images/67HC33a.gif HTTP/1.0" 200 79452
crc4-fddi.cris.com - - [31/Aug/1995:23:57:40 -0400] "GET /software/winvn/winvn.html HTTP/1.0" 200 9630
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:57:40 -0400] "GET /htbin/wais.pl HTTP/1.0" 200 308
dd24-056.compuserve.com - - [31/Aug/1995:23:57:47 -0400] "GET /images/KSC-logosmall.gif HTTP/1.0" 200 1204
dffl6-14.gate.net - - [31/Aug/1995:23:57:52 -0400] "GET /history/gemini/gemini-goals.txt HTTP/1.0" 200 871
koriel.sun.com - - [31/Aug/1995:23:57:52 -0400] "GET /shuttle/missions/sts-50/50fltcd2.gif HTTP/1.0" 200 28830
dd24-056.compuserve.com - - [31/Aug/1995:23:57:56 -0400] "GET /cgi-bin/imagemap/countdown69?183,288 HTTP/1.0" 302 110
melcogw.melit.melco.co.jp - - [31/Aug/1995:23:57:58 -0400] "GET /facts/about_ksc.html HTTP/1.0" 200 3977
dd24-056.compuserve.com - - [31/Aug/1995:23:57:58 -0400] "GET /shuttle/missions/sts-69/movies/movies.html HTTP/1.0" 200 1748
shoal.islandnet.com - - [31/Aug/1995:23:58:00 -0400] "GET /history/apollo/flight-summary.txt HTTP/1.0" 200 5086
cys-cap-9.wyoming.com - - [31/Aug/1995:23:58:01 -0400] "GET /shuttle/missions/sts-71/movies/sts-71-launch-3.mpg HTTP/1.0" 200 130724
dd24-056.compuserve.com - - [31/Aug/1995:23:58:02 -0400] "GET /shuttle/missions/sts-69/sts-69-patch-small.gif HTTP/1.0" 200 8083
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:58:02 -0400] "GET /htbin/wais.pl?oms HTTP/1.0" 200 5440
ip206.pom.primenet.com - - [31/Aug/1995:23:58:08 -0400] "GET /shuttle/missions/sts-69/count69.gif HTTP/1.0" 200 46053
137.229.105.152 - - [31/Aug/1995:23:58:08 -0400] "GET /shuttle/countdown/countdown.html HTTP/1.0" 200 4745
alpc6.mpimf-heidelberg.mpg.de - - [31/Aug/1995:23:58:10 -0400] "GET /htbin/cdt_main.pl HTTP/1.0" 200 3873
137.229.105.152 - - [31/Aug/1995:23:58:18 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
137.229.105.152 - - [31/Aug/1995:23:58:18 -0400] "GET /images/KSC-logosmall.gif HTTP/1.0" 200 1204
137.229.105.152 - - [31/Aug/1995:23:58:20 -0400] "GET /shuttle/missions/sts-69/count69.gif HTTP/1.0" 200 46053
koriel.sun.com - - [31/Aug/1995:23:58:27 -0400] "GET /shuttle/missions/sts-50/images/ HTTP/1.0" 200 1048
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:58:33 -0400] "GET /shuttle/missions/sts-71/mission-sts-71.html HTTP/1.0" 200 13591
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:58:42 -0400] "GET /shuttle/missions/sts-71/sts-71-patch-small.gif HTTP/1.0" 200 12054
beta.xerox.com - - [31/Aug/1995:23:58:45 -0400] "GET /history/apollo/apollo-1/images/67HC33.gif HTTP/1.0" 200 107469
www-e6.proxy.aol.com - - [31/Aug/1995:23:58:55 -0400] "GET /history/history.html HTTP/1.0" 200 1602
ts1-019.jaxnet.com - - [31/Aug/1995:23:58:56 -0400] "GET /shuttle/countdown/ HTTP/1.0" 200 4745
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:58:57 -0400] "GET /facilities/lc39a.html HTTP/1.0" 200 7008
ts1-019.jaxnet.com - - [31/Aug/1995:23:59:01 -0400] "GET /images/NASA-logosmall.gif HTTP/1.0" 200 786
ts1-019.jaxnet.com - - [31/Aug/1995:23:59:01 -0400] "GET /images/KSC-logosmall.gif HTTP/1.0" 200 1204
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:59:03 -0400] "GET /images/lc39a-logo.gif HTTP/1.0" 200 13116
ts1-019.jaxnet.com - - [31/Aug/1995:23:59:07 -0400] "GET /shuttle/missions/sts-69/count69.gif HTTP/1.0" 200 46053
163.135.16.62 - - [31/Aug/1995:23:59:09 -0400] "GET /facts/about_ksc.html HTTP/1.0" 200 3977
ix-dfw16-11.ix.netcom.com - - [31/Aug/1995:23:59:09 -0400] "GET /images/kscmap-tiny.gif HTTP/1.0" 200 2537
melcogw.melit.melco.co.jp - - [31/Aug/1995:23:59:12 -0400] "GET /images/launchpalms-small.gif HTTP/1.0" 200 11473
melcogw.melit.melco.co.jp - - [31/Aug/1995:23:59:27 -0400] "GET /images/KSC-logosmall.gif HTTP/1.0" 200 1204
www-c8.proxy.aol.com - - [31/Aug/1995:23:59:31 -0400] "GET /images/ HTTP/1.0" 200 17688
beta.xerox.com - - [31/Aug/1995:23:59:36 -0400] "GET /history/apollo/apollo-1/images/67HC31.gif HTTP/1.0" 200 199746
www-c8.proxy.aol.com - - [31/Aug/1995:23:59:42 -0400] "GET /icons/menu.xbm HTTP/1.0" 200 527
www-c8.proxy.aol.com - - [31/Aug/1995:23:59:42 -0400] "GET /icons/blank.xbm HTTP/1.0" 304 0
www-c8.proxy.aol.com - - [31/Aug/1995:23:59:42 -0400] "GET /icons/image.xbm HTTP/1.0" 304 0
198.146.93.224 - - [31/Aug/1995:23:59:45 -0400] "GET /shuttle/countdown/lps/back.gif HTTP/1.0" 200 1289
cindy.yamato.ibm.co.jp - - [31/Aug/1995:23:59:47 -0400] "GET /facilities/tour.html HTTP/1.0" 200 3826
gatekeeper.uccu.com - - [31/Aug/1995:23:59:47 -0400] "GET /facilities/lc39a.html HTTP/1.0" 304 0
gatekeeper.uccu.com - - [31/Aug/1995:23:59:49 -0400] "GET /images/kscmap-tiny.gif HTTP/1.0" 304 0
gatekeeper.uccu.com - - [31/Aug/1995:23:59:49 -0400] "GET /images/ksclogosmall.gif HTTP/1.0" 304 0
gatekeeper.uccu.com - - [31/Aug/1995:23:59:49 -0400] "GET /images/lc39a-logo.gif HTTP/1.0" 304 0
cys-cap-9.wyoming.com - - [31/Aug/1995:23:59:52 -0400] "GET /shuttle/missions/sts-71/movies/sts-71-launch-3.mpg HTTP/1.0" 200 57344
www-c8.proxy.aol.com - - [31/Aug/1995:23:59:52 -0400] "GET /icons/unknown.xbm HTTP/1.0" 200 515
cindy.yamato.ibm.co.jp - - [31/Aug/1995:23:59:53 -0400] "GET /images/kscmap-small.gif HTTP/1.0" 200 39017
Loading