updated
authorChristian Urban <urbanc@in.tum.de>
Tue, 04 Feb 2020 11:20:31 +0000
changeset 330 c3d3461a5e77
parent 329 8a34b2ebc8cc
child 331 e3878cdd38bc
updated
LINKS
marking1/drumb_test.sh
marking1/mk
marking1/mk-advanced
--- a/LINKS	Mon Jan 27 10:18:13 2020 +0000
+++ b/LINKS	Tue Feb 04 11:20:31 2020 +0000
@@ -1,3 +1,9 @@
+Google index on datasets
+
+https://datasetsearch.research.google.com/
+
+==================
+
 State by itself is quite harmless. However, mutable state is the big offender. Especially if it is shared. What exactly is mutable state? Any state that can change.
 
 ====================
--- a/marking1/drumb_test.sh	Mon Jan 27 10:18:13 2020 +0000
+++ b/marking1/drumb_test.sh	Tue Feb 04 11:20:31 2020 +0000
@@ -1,26 +1,25 @@
 #!/bin/bash
 set -euo pipefail
 
-
 out=${1:-output}
 
 echo "" > $out
 
-echo `date` >> $out
-echo >> $out
-echo "Below is the feedback and provisional marks for your submission" >> $out
-echo "for the Core Part of Assignment 6 .  Please note all marks are provisional until" >> $out
-echo "ratified by the assessment board -- this is not an official" >> $out
-echo "results transcript." >> $out
-echo "" >> $out
+echo -e `date` >> $out
+echo -e "" >> $out
+echo -e "Below is the feedback and provisional marks for your submission" >> $out
+echo -e "for the Core Part of Assignment 6.  Please note all marks are provisional until" >> $out
+echo -e "ratified by the assessment board -- this is not an official" >> $out
+echo -e "results transcript." >> $out
+echo -e "" >> $out
 
 # marks for CW6 main part 
 marks=$(( 0 ))
 
 
-echo "" >> $out
-echo "Below is the feedback for your submission drumb.scala" >> $out
-echo "" >> $out
+echo -e "" >> $out
+echo -e "Below is the feedback for your submission drumb.scala" >> $out
+echo -e "" >> $out
 
 
 # compilation tests
@@ -46,14 +45,14 @@
 
 # var, .par return, ListBuffer test
 #
-echo "drumb.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
+echo -e "drumb.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
 
 if (scala_vars drumb.scala)
 then
-  echo "  --> test failed" | tee -a $out
+  echo -e "  --> TEST FAILED\n" | tee -a $out
   tsts0=$(( 1 ))
 else
-  echo "  --> success" | tee -a $out
+  echo -e "  --> success" | tee -a $out
   tsts0=$(( 0 )) 
 fi
 
@@ -61,14 +60,14 @@
 # compilation test
 if  [ $tsts0 -eq 0 ]
 then 
-  echo "drumb.scala runs?" | tee -a $out
+  echo -e "drumb.scala runs?" | tee -a $out
 
   if (scala_compile drumb.scala)
   then
-    echo "  --> success" | tee -a $out
+    echo -e "  --> success" | tee -a $out
     tsts=$(( 0 ))
   else
-    echo "  --> scala drumb.scala did not run successfully" | tee -a $out
+    echo -e "  --> SCALA DID NOT RUN drumb.scala" | tee -a $out
     tsts=$(( 1 )) 
   fi
 else
@@ -81,15 +80,15 @@
 
 if [ $tsts -eq 0 ]
 then
-  echo "  get_january_data(\"GOOG\", 1980) == List()" | tee -a $out
-  echo "  get_january_data(\"GOOG\", 2010).head == \"2010-01-04,312.204773\"" | tee -a $out
+  echo -e "  get_january_data(\"GOOG\", 1980) == List()" | tee -a $out
+  echo -e "  get_january_data(\"GOOG\", 2010).head == \"2010-01-04,312.204773\"" | tee -a $out
 
   if (scala_assert "drumb.scala" "drumb_test1.scala")
   then
-      echo "  --> success" | tee -a $out
+      echo -e "  --> success" | tee -a $out
       marks=$(( marks + 1 ))
   else
-      echo "  --> test failed" | tee -a $out
+      echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
@@ -97,15 +96,15 @@
 
 if [ $tsts -eq 0 ]
 then
-  echo "  get_first_price(\"GOOG\", 1980) == None" | tee -a $out
-  echo "  get_first_price(\"GOOG\", 2010) == Some(312.204773)" | tee -a $out
+  echo -e "  get_first_price(\"GOOG\", 1980) == None" | tee -a $out
+  echo -e "  get_first_price(\"GOOG\", 2010) == Some(312.204773)" | tee -a $out
 
   if (scala_assert "drumb.scala" "drumb_test2.scala")
   then
-      echo "  --> success" | tee -a $out
+      echo -e "  --> success" | tee -a $out
       marks=$(( marks + 1 ))
   else
-      echo "  --> test failed" | tee -a $out
+      echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
@@ -113,21 +112,21 @@
 
 if [ $tsts -eq 0 ]
 then
-  echo "  get_prices(List(\"BIDU\"), 2004 to 2008) ==" | tee -a $out
-  echo "       List(List(None), List(None), List(Some(6.35)), " | tee -a $out
-  echo "            List(Some(12.241)), List(Some(38.188)))" | tee -a $out
-  echo " " | tee -a $out  
-  echo "  get_prices(List(\"GOOG\", \"AAPL\"), 2010 to 2012) ==" | tee -a $out
-  echo "       List(List(Some(312.204773), Some(26.782711))," | tee -a $out
-  echo "            List(Some(301.0466),   Some(41.244694))," | tee -a $out
-  echo "            List(Some(331.462585), Some(51.464207)))" | tee -a $out
+  echo -e "  get_prices(List(\"BIDU\"), 2004 to 2008) ==" | tee -a $out
+  echo -e "       List(List(None), List(None), List(Some(6.35)), " | tee -a $out
+  echo -e "            List(Some(12.241)), List(Some(38.188)))" | tee -a $out
+  echo -e " " | tee -a $out  
+  echo -e "  get_prices(List(\"GOOG\", \"AAPL\"), 2010 to 2012) ==" | tee -a $out
+  echo -e "       List(List(Some(312.204773), Some(26.782711))," | tee -a $out
+  echo -e "            List(Some(301.0466),   Some(41.244694))," | tee -a $out
+  echo -e "            List(Some(331.462585), Some(51.464207)))" | tee -a $out
 
   if (scala_assert "drumb.scala" "drumb_test3.scala")
   then
-      echo "  --> success" | tee -a $out
+      echo -e "  --> success" | tee -a $out
       marks=$(( marks + 1 ))
   else
-      echo "  --> test failed" | tee -a $out
+      echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
@@ -135,17 +134,17 @@
 
 if [ $tsts -eq 0 ]
 then
-  echo "  get_delta(None, None) == None" | tee -a $out
-  echo "  get_delta(Some(50.0), None) == None" | tee -a $out
-  echo "  get_delta(None, Some(100.0)) == None" | tee -a $out
-  echo "  get_delta(Some(50.0), Some(100.0)) == Some(1.0)" | tee -a $out
+  echo -e "  get_delta(None, None) == None" | tee -a $out
+  echo -e "  get_delta(Some(50.0), None) == None" | tee -a $out
+  echo -e "  get_delta(None, Some(100.0)) == None" | tee -a $out
+  echo -e "  get_delta(Some(50.0), Some(100.0)) == Some(1.0)" | tee -a $out
 
   if (scala_assert "drumb.scala" "drumb_test4.scala")
   then
-      echo "  --> success" | tee -a $out
+      echo -e "  --> success" | tee -a $out
       marks=$(( marks + 1 ))
   else
-      echo "  --> test failed" | tee -a $out
+      echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
@@ -164,10 +163,10 @@
   
   if (scala_assert "drumb.scala" "drumb_test5.scala") 
   then
-     echo "  --> success" | tee -a $out
+     echo -e "  --> success" | tee -a $out
      marks=$(( marks + 1 ))
   else
-     echo "  --> test failed" | tee -a $out
+     echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
@@ -177,15 +176,15 @@
 if [ $tsts -eq 0 ]
 then
   echo -e "  val ds = get_deltas(get_prices(List(\"GOOG\", \"AAPL\"), 2010 to 2012))" | tee -a $out
-  echo -e "  yearly_yield(get_deltas(ds, 100, 0)) == 125" | tee -a $out
-  echo -e "  yearly_yield(get_deltas(ds, 100, 1)) == 117" | tee -a $out
+  echo -e "  yearly_yield(ds, 100, 0) == 125" | tee -a $out
+  echo -e "  yearly_yield(ds, 100, 1) == 117" | tee -a $out
   
   if (scala_assert "drumb.scala" "drumb_test6.scala") 
   then
-      echo "  --> success" | tee -a $out
+      echo -e "  --> success" | tee -a $out
       marks=$(( marks + 1 ))
   else
-      echo "  --> test failed" | tee -a $out
+      echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
@@ -208,14 +207,14 @@
   
   if (scala_assert "drumb.scala" "drumb_test7.scala") 
   then
-    echo "  --> success" | tee -a $out
+    echo -e "  --> success" | tee -a $out
     marks=$(( marks + 1 ))
   else
-    echo "  --> test failed" | tee -a $out
+    echo -e "  --> TEST FAILED\n" | tee -a $out
   fi
 fi
 
 ## final marks
-echo >> $out
-echo "Overall mark for CW 6, Core Part" | tee -a $out
-echo "$marks" | tee -a $out
+echo -e "" >> $out
+echo -e "Overall mark for CW 6, Core Part" | tee -a $out
+echo -e "$marks" | tee -a $out
--- a/marking1/mk	Mon Jan 27 10:18:13 2020 +0000
+++ b/marking1/mk	Tue Feb 04 11:20:31 2020 +0000
@@ -3,28 +3,20 @@
 
 trap "exit" INT
 
-files=${1:-assignment20186-*}
+files=${1:-assignment2019scala-*/Part6}
 
 for sd in $files; do
   cd $sd
   echo $sd
   touch .
-  cp ../../../marking1/*.sh .
-  cp ../../../marking1/collatz_test1.scala .
-  cp ../../../marking1/collatz_test2.scala .
-  cp ../../../marking1/drumb_test1.scala .
-  cp ../../../marking1/drumb_test2.scala .
-  cp ../../../marking1/drumb_test3.scala .
-  cp ../../../marking1/*.csv .
-  ./collatz_test.sh output
-  ./drumb_test.sh output
-  rm *.sh
+  cp ../../../../marking1/collatz_test.sh .
+  cp ../../../../marking1/collatz_test1.scala .
+  cp ../../../../marking1/collatz_test2.scala .
+  ./collatz_test.sh output1
+  rm collatz_test.sh
   rm collatz_test1.scala
   rm collatz_test2.scala
-  rm drumb_test1.scala
-  rm drumb_test2.scala
-  rm drumb_test3.scala
-  rm *.csv
+  cd ..
   cd ..
 done
 
--- a/marking1/mk-advanced	Mon Jan 27 10:18:13 2020 +0000
+++ b/marking1/mk-advanced	Tue Feb 04 11:20:31 2020 +0000
@@ -3,26 +3,34 @@
 
 trap "exit" INT
 
-files=${1:-assignment20186-*}
+files=${1:-assignment2019scala-*/Part6}
+
 
 for sd in $files; do
   cd $sd
   echo $sd
   touch .
-  cp ../../../marking1/*.sh .
-  cp ../../../marking1/drumb_test4.scala .
-  cp ../../../marking1/drumb_test5.scala .
-  cp ../../../marking1/drumb_test6.scala .
-  cp ../../../marking1/drumb_test7.scala .
-  cp ../../../marking1/*.csv .
-  ./drumb_test2.sh output
-  rm *.sh
+  cp ../../../../marking1/drump_test.sh .
+  cp ../../../../marking1/drumb_test1.scala .
+  cp ../../../../marking1/drumb_test2.scala .
+  cp ../../../../marking1/drumb_test3.scala .
+  cp ../../../../marking1/drumb_test4.scala .
+  cp ../../../../marking1/drumb_test5.scala .
+  cp ../../../../marking1/drumb_test6.scala .
+  cp ../../../../marking1/drumb_test7.scala .
+  cp ../../../../marking1/*.csv .
+  ./drumb_test.sh output
+  rm drump_test.sh
+  rm drumb_test1.scala
+  rm drumb_test2.scala
+  rm drumb_test3.scala
   rm drumb_test4.scala
   rm drumb_test5.scala
   rm drumb_test6.scala
   rm drumb_test7.scala
   rm *.csv
   cd ..
+  cd ..
 done