updated
authorChristian Urban <urbanc@in.tum.de>
Sat, 21 Jan 2017 00:43:35 +0000
changeset 99 e10a9b2fd35a
parent 98 8f03f0dc3065
child 100 93260be6770f
updated
README
marking/drumb_test2.scala
marking/mark01b
--- a/README	Wed Jan 11 14:42:46 2017 +0000
+++ b/README	Sat Jan 21 00:43:35 2017 +0000
@@ -32,4 +32,11 @@
 
 LC_ALL=C sed -i.2 -- 's|println(matcher(EVIL,|//println(matcher(EVIL,|g' k*/re.scala.bak
 
-LC_ALL=C sed -i.2 -- 's|for (i <- 1 to 5000001 by 500000)|for (i <- 1 to 11 by 10)|g' k*/re.scala.bak
\ No newline at end of file
+LC_ALL=C sed -i.2 -- 's|for (i <- 1 to 5000001 by 500000)|for (i <- 1 to 11 by 10)|g' k*/re.scala.bak
+
+
+
+ontime:
+k1502660
+k1502705
+k1502679
\ No newline at end of file
--- a/marking/drumb_test2.scala	Wed Jan 11 14:42:46 2017 +0000
+++ b/marking/drumb_test2.scala	Sat Jan 21 00:43:35 2017 +0000
@@ -5,10 +5,21 @@
 import ExecutionContext.Implicits.global
 import scala.language.postfixOps 
 
+val urban_prices = List(List(Some(71.539941), None), 
+                        List(Some(76.974614), None), 
+                        List(Some(65.226685), Some(6.35)), 
+                        List(Some(78.354649), Some(12.241)), 
+                        List(Some(85.517645), Some(38.188)))
+
+val urban_deltas = List(List(Some(0.07596697626574789), None), 
+                        List(Some(-0.152620823795232), None), 
+                        List(Some(0.20126676681483952), Some(0.9277165354330709)), 
+                        List(Some(0.09141762603007778), Some(2.119679764725104)))
+
+
 lazy val f = Future {
-  assert(get_prices(List("BIDU"), 2004 to 2008) == List(List(None), List(None), 
-                                                        List(Some(6.35)), List(Some(12.241)), 
-                                                        List(Some(38.188))))
+  //assert(get_deltas(urban_prices) == urban_deltas)
+  assert (get_deltas(get_prices(List("IBM", "BIDU"), 2004 to 2008)) == urban_deltas)
 }
 
 
--- a/marking/mark01b	Wed Jan 11 14:42:46 2017 +0000
+++ b/marking/mark01b	Sat Jan 21 00:43:35 2017 +0000
@@ -1,7 +1,7 @@
 #!/bin/bash
 set -e
 
-out=${1:-output}
+out=${1:-output2}
 
 echo "" > $out
 
@@ -55,7 +55,7 @@
   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
 
-  if (scala_assert "drumb.scala" "../drumb_test1.scala")
+  if (scala_assert "drumb.scala" "../../../marking/drumb_test1.scala")
   then
     echo "  --> success" | tee -a $out
     marks=$(( marks + 1 ))
@@ -74,7 +74,7 @@
   echo "       List(Some(0.20126676681483952), Some(0.9277165354330709))," | tee -a $out
   echo "       List(Some(0.09141762603007778), Some(2.119679764725104)))" | tee -a $out
   
-  if (scala_assert "drumb.scala" "../drumb_test2.scala") 
+  if (scala_assert "drumb.scala" "../../../marking/drumb_test2.scala") 
   then
     echo "  --> success" | tee -a $out
     marks=$(( marks + 1 ))
@@ -93,7 +93,7 @@
   echo "  yearly_yield(IBM + BIDU, 04 - 08, 100, 3) - 210).abs <= 2 " | tee -a $out
   echo "  investment(List(\"IBM\", \"BIDU\"), 2004 to 2008, 100) - 298).abs <= 10" | tee -a $out
   
-  if (scala_assert "drumb.scala" "../drumb_test3.scala") 
+  if (scala_assert "drumb.scala" "../../../marking/drumb_test3.scala") 
   then
     echo "  --> success" | tee -a $out
     marks=$(( marks + 1 ))