slides/slides03.tex
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 25 Nov 2022 00:03:15 +0000
changeset 448 db2a3e3287a9
parent 416 497f67fd4ae0
child 449 d67c5f7177a6
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
     1
% !TEX program = xelatex
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
     2
\documentclass[dvipsnames,14pt,t,xelatex,aspectratio=169,xcolor={table}]{beamer}
448
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
     3
\usepackage{../styles/slides}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
     4
\usepackage{../styles/mygraphs}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
     5
\usepackage{../styles/langs}
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
     6
%%\usepackage{../data}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
     7
\usetikzlibrary{shapes}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
     8
\usepackage[export]{adjustbox}
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\hfuzz=220pt 
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
%\setmonofont[Scale=.88]{Consolas}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
%\newfontfamily{\consolas}{Consolas}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\lstset{language=Scala,
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
        style=mystyle,
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
        numbersep=0pt,
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
        numbers=none,
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
        xleftmargin=0mm}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\newcommand{\bl}[1]{\textcolor{blue}{#1}}     
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
% beamer stuff 
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    24
\renewcommand{\slidecaption}{PEP (Scala) 03, King's College London}
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    26
\newcommand{\UParrow}[3]{%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    27
\begin{textblock}{0}(#2,#3)%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    28
\onslide<#1>{%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    29
\begin{tikzpicture}%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    30
\node at (0,0) [single arrow, shape border rotate=90, fill=red,text=red]{a};%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    31
\end{tikzpicture}}%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    32
\end{textblock}}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    33
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    34
\newcommand{\DOWNarrow}[3]{%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    35
\begin{textblock}{0}(#2,#3)%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    36
\onslide<#1>{%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    37
\begin{tikzpicture}%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    38
\node at (0,0) [single arrow, shape border rotate=270, fill=red,text=red]{a};%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    39
\end{tikzpicture}}%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    40
\end{textblock}}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    41
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
\begin{document}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
\begin{frame}[t]
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
\frametitle{%
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  \begin{tabular}{@ {}c@ {}}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
  \\[5mm]
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    48
  \huge PEP Scala (3) 
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
  \end{tabular}}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  \normalsize
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  \begin{center}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  \begin{tabular}{ll}
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
    54
    Email:  & christian.urban at kcl.ac.uk\\
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    55
    %Office: & N\liningnums{7.07} (North Wing, Bush House)\bigskip\\
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    56
    Slides \& Code: & KEATS\bigskip\\
448
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
    57
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
    58
    Office Hour: &  Fridays 11:00 -- 12:00\\
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
    59
    Location: & N7.07 (North Wing, Bush House)\bigskip\\
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
    60
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
    61
    Pollev: & \texttt{\alert{https://pollev.com/cfltutoratki576}}\\  \\
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
  \end{tabular}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
  \end{center}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
\end{frame}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    68
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    69
% \begin{frame}[c]
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    70
% \frametitle{Preliminary 6}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    71
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    72
% Raw marks (261 submissions):\bigskip
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    73
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    74
% \begin{itemize}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    75
% \item 3\%: \hspace{4mm}219
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    76
% \item 2\%: \hspace{4mm}19
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    77
% \item 1\%: \hspace{4mm}0
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    78
% \item 0\%: \hspace{4mm}23 \;(4 no submission)
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    79
% \end{itemize}  
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    80
% \end{frame}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    81
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    82
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    83
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    84
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    86
\begin{frame}[c,fragile]
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    87
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
    88
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    89
def collatz(n: Long) : Long =
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    90
  {
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    91
    val toReturn = collatzHelper(n, 0)
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    92
    toReturn
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    93
  } 
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    94
\end{lstlisting}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    95
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    96
\pause
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    97
\bigskip
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    98
\rule{11cm}{0.3mm}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    99
\bigskip
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   100
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   101
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   102
def collatz(n: Long) : Long =
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   103
  collatzHelper(n, 0)
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   104
\end{lstlisting}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   105
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   106
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   107
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   108
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   109
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
   110
\begin{frame}[c,fragile]
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   111
\frametitle{Default Arguments}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   112
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   113
\small
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   114
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-3mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   115
def collatzHelper(n: Int, a: Int = 0) : Int = ...
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   116
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   117
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   118
collatzHelper(n, 3)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   119
collatzHelper(n, 0)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   120
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   121
collatzHelper(n)   // a = 0   
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
   122
\end{lstlisting}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   123
448
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   124
\DOWNarrow{1}{8.3}{3.4}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   125
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   126
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   127
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   128
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   129
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   130
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   131
\frametitle{Last Week: Options \& HO Funs.}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   132
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   133
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   134
List(7,2,3,4,5,6).find(_ < 4)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   135
res: Option[Int] = Some(2)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   136
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   137
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   138
List(5,6,7,8,9).find(_ < 4)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   139
res: Option[Int] = None
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   140
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   141
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   142
List(1,2,3,4,5).map(x => x * x)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   143
res: List[Int] = List(1, 4, 9, 16, 25)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   144
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   145
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   146
  \end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   147
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   148
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   149
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   150
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   151
\frametitle{Web-Crawler (1)}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   152
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   153
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   154
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-7mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   155
def get_page(url: String) : String = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   156
Try(fromURL(url)("ISO-8859-1").take(10000).mkString)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   157
   .getOrElse { println(s" Problem with: $url"); ""}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   158
}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   159
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   160
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   161
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   162
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   163
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   164
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   165
\frametitle{Web-Crawler (2)}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   166
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   167
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   168
\begin{lstlisting}[language=Scala, numbers=none, 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   169
                    xleftmargin=-7mm, escapeinside={(*@}{@*)}]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   170
val http_pattern = """(*@\textcolor{codegreen}{"}@*)https?://[\^(*@\textcolor{codegreen}{"}@*)]*(*@\textcolor{codegreen}{"}@*)""".r
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   171
val email_pattern = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   172
 """([a-z\d\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   173
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   174
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   175
def unquote(s: String) = s.drop(1).dropRight(1)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   176
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   177
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   178
def get_all_URLs(page: String): Set[String] = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   179
  http_pattern.findAllIn(page).map(unquote).toSet
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   180
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   181
  // returns all URLs in a page  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   182
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   183
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   184
  \end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   185
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   186
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   187
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   188
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   189
\frametitle{Web-Crawler (3)}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   190
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   191
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   192
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   193
def crawl(url: String, n: Int) : Unit = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   194
  if (n == 0) ()
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   195
  else {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   196
    println(s"  Visiting: $n $url")
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   197
    val page = get_page(url)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   198
    for (u <- get_all_URLs(page)) 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   199
      crawl(u, n - 1)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   200
  }
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   201
}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   202
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   203
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   204
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   205
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   206
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   207
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   208
\frametitle{Email Harvester}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   209
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   210
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   211
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-3mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   212
def emails(url: String, n: Int) : Set[String] = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   213
 if (n == 0) Set()
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   214
 else {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   215
  println(s"  Visiting: $n $url")
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   216
  val page = get_page(url)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   217
  val new_emails = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   218
    email_pattern.findAllIn(page).toSet
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   219
  new_emails ++ 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   220
    (for (u <- get_all_URLs(page)) 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   221
       yield emails(u, n - 1)).flatten
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   222
 }
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   223
} 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   224
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   225
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   226
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   227
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   228
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   229
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   230
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   231
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
68
8da9e0c16194 updated
Christian Urban <urbanc@in.tum.de>
parents: 67
diff changeset
   232
\begin{frame}[c]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   233
\frametitle{Jumping Towers}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   234
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   235
\begin{center}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   236
\begin{tikzpicture}[scale=1.3]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   237
  \draw[line width=1mm,cap=round] (0,0) -- (5,0);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   238
  \draw[line width=1mm,cap=round] (0,1) -- (5,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   239
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   240
  \draw[line width=1mm,cap=round] (0,0) -- (0,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   241
  \node at (0.5,0.5) {\textbf{\Large 3}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   242
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   243
  \draw[line width=1mm,cap=round] (1,0) -- (1,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   244
  \node at (1.5,0.5) {\textbf{\Large 4}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   245
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   246
  \draw[line width=1mm,cap=round] (2,0) -- (2,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   247
  \node at (2.5,0.5) {\textbf{\Large 2}};
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   248
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   249
  \draw[line width=1mm,cap=round] (3,0) -- (3,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   250
  \node at (3.5,0.5) {\textbf{\Large 0}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   251
  
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   252
  \draw[line width=1mm,cap=round] (4,0) -- (4,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   253
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   254
  \node at (4.5,0.5) {\textbf{\Large 1}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   255
  
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   256
  \draw[line width=1mm,cap=round] (5,0) -- (5,1);
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   257
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   258
  \draw[->,line width=0.5mm,cap=round,out=90,in=90,relative] (0.5,1) to (1.5,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   259
  \draw[->,line width=0.5mm,cap=round,out=90,in=90,relative] (0.5,1) to (2.5,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   260
  \draw[->,line width=0.5mm,cap=round,out=90,in=90,relative] (0.5,1) to (3.5,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   261
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   262
  \draw[->,line width=0.5mm,cap=round,out=-90,in=-90,relative] (2.5,0) to (3.5,0);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   263
  \draw[->,line width=0.5mm,cap=round,out=-90,in=-90,relative] (2.5,0) to (4.5,0);
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   264
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   265
  \draw[->,line width=0.5mm,cap=round,out=90,in=90,relative] (4.5,1) to (5.7,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   266
  \node at (5.7, 0.8) {End};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   267
\end{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   268
\end{center}\bigskip
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   269
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   270
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   271
shortest: 3 $\rightarrow$ 4 $\rightarrow$ End
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   272
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   273
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   274
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   275
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   276
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   277
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   278
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   279
\begin{frame}[c]
366
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   280
\frametitle{next moves}
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   281
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   282
\begin{center}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   283
  \begin{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   284
    [grow=right,level distance=30mm,child anchor=north,line width=0.5mm]
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   285
  \node {$[3,4,2,0,1]$}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   286
     child {node {$[0,1]$}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   287
     child {node {$[2,0,1]$}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   288
        child {node {$[1]$} child [level distance=13mm] {node {End}}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   289
        child {node {$[0,1]$}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   290
     }
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   291
     child {node {$[4,2,0,1]$\ldots}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   292
\end{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   293
\end{center}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   294
366
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   295
\begin{textblock}{4}(13,12)
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   296
\includegraphics[scale=0.06]{../pics/chess.jpg}
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   297
\end{textblock}
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   298
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   299
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   300
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   301
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   302
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   303
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   304
\frametitle{Reverse Polish Notation}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   305
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   306
{\Large\bl{$(3 + 1) * (2 + 9)$}}\bigskip
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   307
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   308
{\Large$\Rightarrow$}\bigskip
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   309
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   310
{\;\;\Large\bl{$3\;\;1\;+\;2\;\;9\;+\;*$}}
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   311
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   312
\begin{textblock}{3}(11,4)
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   313
\begin{onlyenv}<2>
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   314
\begin{lstlisting}[language=JVMIS]
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   315
ldc 3
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   316
ldc 1
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   317
iadd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   318
ldc 2
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   319
ldc 9
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   320
iadd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   321
imul
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   322
\end{lstlisting}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   323
\end{onlyenv} 
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   324
\end{textblock}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   325
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   326
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   327
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   328
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   329
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   330
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   331
% \begin{frame}[c,fragile]
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   332
% \frametitle{Sudoku}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   333
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   334
% A very simple-minded version on 110 problems:\bigskip
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   335
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   336
% \begin{itemize}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   337
% \item 1 core: 800 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   338
% \item 2 cores: 400 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   339
% \item 8 cores: 290 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   340
% \item 18 cores: 142 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   341
% \end{itemize}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   342
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   343
% \end{frame}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   344
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   345
 
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   346
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   347
% \begin{frame}[t]
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   348
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   349
%   \begin{center}  
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   350
%   \includegraphics[scale=0.3]{../pics/blow.png}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   351
%   \end{center}
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   352
  
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   353
%   \begin{textblock}{14}(2,11.4)
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   354
%   \large\bf{}Mind-Blowing Programming Languages:\\ 
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   355
%   \centering JavaScript
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   356
%   \end{textblock}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   357
% \end{frame}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   358
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   359
382
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   360
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
448
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   361
%\begin{frame}[t]
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   362
%\frametitle{Preliminary 1 (Scala)}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   363
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   364
%Raw marks (298 submissions):\bigskip
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   365
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   366
%\begin{itemize}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   367
%\item 3\%: \hspace{4mm}227
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   368
%\item 2\%: \hspace{4mm}35
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   369
%\item 1\%: \hspace{4mm}9
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   370
%\item 0\%: \hspace{4mm}27 
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   371
%\end{itemize}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   372
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   373
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   374
%\end{frame}
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   375
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
448
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   376
%\begin{frame}[t]
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   377
%\frametitle{Preliminary 2 (Scala)}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   378
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   379
%Raw marks (301 submissions):\bigskip%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   380
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   381
%\begin{itemize}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   382
%\item 3.0\%: \hspace{4mm}236
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   383
%\item 2.5\%: \hspace{4mm}5
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   384
%\item 2.0\%: \hspace{4mm}7
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   385
%\item 1.5\%: \hspace{4mm}13
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   386
%\item 1.0\%: \hspace{4mm}1
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   387
%\item 0.5\%: \hspace{4mm}2
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   388
%\item 0.0\%: \hspace{4mm}37
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   389
%\end{itemize}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   390
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   391
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   392
%\end{frame}
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   393
%
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   394
%\begin{frame}<1-20>
db2a3e3287a9 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 416
diff changeset
   395
%\end{frame}
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   397
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
\end{document}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
%%% Local Variables:  
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
%%% mode: latex
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
%%% TeX-master: t
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   403
%%% End: 
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   404