updated
authorChristian Urban <urbanc@in.tum.de>
Thu, 01 Dec 2016 22:08:00 +0000
changeset 81 ff8d075842d5
parent 80 ea0d0a862a9c
child 82 28c8e17ab83a
updated
marking/drumb_test1.scala
marking/mk
progs/drumb_sol.scala
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/marking/drumb_test1.scala	Thu Dec 01 22:08:00 2016 +0000
@@ -0,0 +1,16 @@
+//println("starting test now")
+
+import scala.concurrent._
+import scala.concurrent.duration._
+import ExecutionContext.Implicits.global
+import scala.language.postfixOps 
+
+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))))
+}
+
+
+Await.result(f, 180 second)
+
--- a/marking/mk	Thu Dec 01 17:08:12 2016 +0000
+++ b/marking/mk	Thu Dec 01 22:08:00 2016 +0000
@@ -1,14 +1,13 @@
 #!/bin/sh
 ###set -e
 
-
+trap "exit" INT
 for sd in k*; do
   cd $sd
   echo $sd
-  ../mark
+  #../mark
+  ../mark01b
   cd ..
 done
 
 
-#scala -i collatz.scala -e "println(\"test\")"
-#
--- a/progs/drumb_sol.scala	Thu Dec 01 17:08:12 2016 +0000
+++ b/progs/drumb_sol.scala	Thu Dec 01 22:08:00 2016 +0000
@@ -45,6 +45,7 @@
 val p_fb = get_prices(List("FB"), 2012 to 2014)
 val p = get_prices(List("GOOG", "AAPL"), 2005 to 2012)
 
+get_prices(List("BIDU"), 2004 to 2008)
 
 // (2) The first function below calculates the change factor (delta) between
 // a price in year n and a price in year n+1. The second function calculates