updated
authorChristian Urban <urbanc@in.tum.de>
Tue, 03 Dec 2019 11:07:09 +0000
changeset 328 0e591f806290
parent 327 fb4cd144a9e6
child 329 8a34b2ebc8cc
updated
pics/mind2.jpg
progs/lecture5.scala
slides/slides05.pdf
slides/slides05.tex
Binary file pics/mind2.jpg has changed
--- a/progs/lecture5.scala	Tue Dec 03 01:58:19 2019 +0000
+++ b/progs/lecture5.scala	Tue Dec 03 11:07:09 2019 +0000
@@ -21,7 +21,7 @@
 def peop(n: BigInt): Boolean = peop(n + 1) 
 
 val a = "foo"
-val b = "foo"
+val b = "bar"
 
 if (a == b || peop(0)) println("true") else println("false")
 
@@ -31,6 +31,7 @@
 // does not need to be re-calculated.
 
 // A useful example is
+
 def time_needed[T](i: Int, code: => T) = {
   val start = System.nanoTime()
   for (j <- 1 to i) code
@@ -156,7 +157,7 @@
 
 
 enum(LazyList(ZERO, ONE, CHAR('a'), CHAR('b'))).take(200).force
-enum(LazyList(ZERO, ONE, CHAR('a'), CHAR('b'))).take(5000000)
+enum(LazyList(ZERO, ONE, CHAR('a'), CHAR('b'))).take(5_000_000)
 
 
 val is = 
@@ -165,6 +166,7 @@
     .take(10).foreach(println))
 
 
+
 // Polymorphic Types
 //===================
 
@@ -539,6 +541,17 @@
 //
 // http://www.latkin.org/blog/2017/05/02/when-the-scala-compiler-doesnt-help/
 
+val two   = 0.2
+val one   = 0.1
+val eight = 0.8
+val six   = 0.6
+
+two - one == one
+eight - six == two
+
+
+
+
 List(1, 2, 3).contains("your cup")
 
 
Binary file slides/slides05.pdf has changed
--- a/slides/slides05.tex	Tue Dec 03 01:58:19 2019 +0000
+++ b/slides/slides05.tex	Tue Dec 03 11:07:09 2019 +0000
@@ -462,6 +462,25 @@
 \end{frame}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
 
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ 
+
+
+\begin{frame}[t]
+
+  \begin{center}  
+  \includegraphics[scale=0.4]{../pics/mind2.jpg}
+  \end{center}
+  
+  \begin{textblock}{14}(2,11.4)
+  \large\bf{}Mind-Blowing Programming Languages:\\ 
+  \centering Scala\;\;?
+  \end{textblock}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
 \end{document}