slides/slides03.tex
author Christian Urban <christian.urban@kcl.ac.uk>
Wed, 01 Dec 2021 07:51:21 +0000
changeset 416 497f67fd4ae0
parent 384 6e1237691307
child 448 db2a3e3287a9
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}
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage{../slides}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage{../graphics}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{../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\\
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    57
    %Office Hours: &  Thursdays 12:00 -- 14:00\\
416
497f67fd4ae0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 384
diff changeset
    58
    %Additionally: & (for Scala) Tuesdays 10:45 -- 11:45\\
497f67fd4ae0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 384
diff changeset
    59
    \multicolumn{2}{c}{\Large\textbf{https://pollev.com/cfltutoratki576}}\\
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  \end{tabular}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
  \end{center}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
\end{frame}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    66
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    67
% \begin{frame}[c]
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    68
% \frametitle{Preliminary 6}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    69
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    70
% Raw marks (261 submissions):\bigskip
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
% \begin{itemize}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    73
% \item 3\%: \hspace{4mm}219
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    74
% \item 2\%: \hspace{4mm}19
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    75
% \item 1\%: \hspace{4mm}0
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    76
% \item 0\%: \hspace{4mm}23 \;(4 no submission)
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    77
% \end{itemize}  
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
    78
% \end{frame}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    79
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    80
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
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    84
\begin{frame}[c,fragile]
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    85
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
    86
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    87
def collatz(n: Long) : Long =
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    88
  {
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    89
    val toReturn = collatzHelper(n, 0)
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    90
    toReturn
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    91
  } 
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    92
\end{lstlisting}
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
\pause
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    95
\bigskip
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    96
\rule{11cm}{0.3mm}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    97
\bigskip
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    98
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    99
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   100
def collatz(n: Long) : Long =
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   101
  collatzHelper(n, 0)
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   102
\end{lstlisting}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   103
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   104
\end{frame}
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
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   107
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
   108
\begin{frame}[c,fragile]
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   109
\frametitle{Default Arguments}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   110
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   111
\small
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   112
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-3mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   113
def collatzHelper(n: Int, a: Int = 0) : Int = ...
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   114
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   115
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   116
collatzHelper(n, 3)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   117
collatzHelper(n, 0)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   118
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   119
collatzHelper(n)   // a = 0   
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
   120
\end{lstlisting}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   121
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   122
\DOWNarrow{1}{10.7}{3.4}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   123
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   124
\end{frame}
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
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   127
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   128
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   129
\frametitle{Last Week: Options \& HO Funs.}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   130
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   131
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   132
List(7,2,3,4,5,6).find(_ < 4)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   133
res: Option[Int] = Some(2)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   134
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   135
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   136
List(5,6,7,8,9).find(_ < 4)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   137
res: Option[Int] = None
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   138
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   139
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   140
List(1,2,3,4,5).map(x => x * x)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   141
res: List[Int] = List(1, 4, 9, 16, 25)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   142
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   143
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   144
  \end{frame}
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
 
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   149
\frametitle{Web-Crawler (1)}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   150
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   151
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   152
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-7mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   153
def get_page(url: String) : String = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   154
Try(fromURL(url)("ISO-8859-1").take(10000).mkString)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   155
   .getOrElse { println(s" Problem with: $url"); ""}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   156
}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   157
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   158
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   159
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   160
 
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   163
\frametitle{Web-Crawler (2)}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   164
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   165
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   166
\begin{lstlisting}[language=Scala, numbers=none, 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   167
                    xleftmargin=-7mm, escapeinside={(*@}{@*)}]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   168
val http_pattern = """(*@\textcolor{codegreen}{"}@*)https?://[\^(*@\textcolor{codegreen}{"}@*)]*(*@\textcolor{codegreen}{"}@*)""".r
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   169
val email_pattern = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   170
 """([a-z\d\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   171
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   172
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   173
def unquote(s: String) = s.drop(1).dropRight(1)
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
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   176
def get_all_URLs(page: String): Set[String] = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   177
  http_pattern.findAllIn(page).map(unquote).toSet
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   178
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   179
  // returns all URLs in a page  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   180
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   181
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   182
  \end{frame}
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
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   187
\frametitle{Web-Crawler (3)}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   188
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   189
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   190
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   191
def crawl(url: String, n: Int) : Unit = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   192
  if (n == 0) ()
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   193
  else {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   194
    println(s"  Visiting: $n $url")
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   195
    val page = get_page(url)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   196
    for (u <- get_all_URLs(page)) 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   197
      crawl(u, n - 1)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   198
  }
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   199
}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   200
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   201
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   202
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   203
  
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   206
\frametitle{Email Harvester}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   207
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   208
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   209
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-3mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   210
def emails(url: String, n: Int) : Set[String] = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   211
 if (n == 0) Set()
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   212
 else {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   213
  println(s"  Visiting: $n $url")
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   214
  val page = get_page(url)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   215
  val new_emails = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   216
    email_pattern.findAllIn(page).toSet
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   217
  new_emails ++ 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   218
    (for (u <- get_all_URLs(page)) 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   219
       yield emails(u, n - 1)).flatten
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   220
 }
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   221
} 
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
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   224
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   225
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   226
  
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
68
8da9e0c16194 updated
Christian Urban <urbanc@in.tum.de>
parents: 67
diff changeset
   230
\begin{frame}[c]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   231
\frametitle{Jumping Towers}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   232
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   233
\begin{center}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   234
\begin{tikzpicture}[scale=1.3]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   235
  \draw[line width=1mm,cap=round] (0,0) -- (5,0);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   236
  \draw[line width=1mm,cap=round] (0,1) -- (5,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   237
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   238
  \draw[line width=1mm,cap=round] (0,0) -- (0,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   239
  \node at (0.5,0.5) {\textbf{\Large 3}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   240
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   241
  \draw[line width=1mm,cap=round] (1,0) -- (1,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   242
  \node at (1.5,0.5) {\textbf{\Large 4}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   243
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   244
  \draw[line width=1mm,cap=round] (2,0) -- (2,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   245
  \node at (2.5,0.5) {\textbf{\Large 2}};
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   246
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   247
  \draw[line width=1mm,cap=round] (3,0) -- (3,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   248
  \node at (3.5,0.5) {\textbf{\Large 0}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   249
  
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   250
  \draw[line width=1mm,cap=round] (4,0) -- (4,1);
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
  \node at (4.5,0.5) {\textbf{\Large 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
  \draw[line width=1mm,cap=round] (5,0) -- (5,1);
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   255
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   256
  \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
   257
  \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
   258
  \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
   259
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] (2.5,0) to (3.5,0);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   261
  \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
   262
217
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] (4.5,1) to (5.7,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   264
  \node at (5.7, 0.8) {End};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   265
\end{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   266
\end{center}\bigskip
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   267
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   268
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   269
shortest: 3 $\rightarrow$ 4 $\rightarrow$ End
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   270
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   271
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   272
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   273
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
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   276
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   277
\begin{frame}[c]
366
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   278
\frametitle{next moves}
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   279
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   280
\begin{center}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   281
  \begin{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   282
    [grow=right,level distance=30mm,child anchor=north,line width=0.5mm]
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   283
  \node {$[3,4,2,0,1]$}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   284
     child {node {$[0,1]$}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   285
     child {node {$[2,0,1]$}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   286
        child {node {$[1]$} child [level distance=13mm] {node {End}}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   287
        child {node {$[0,1]$}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   288
     }
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   289
     child {node {$[4,2,0,1]$\ldots}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   290
\end{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   291
\end{center}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   292
366
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   293
\begin{textblock}{4}(13,12)
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   294
\includegraphics[scale=0.06]{../pics/chess.jpg}
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   295
\end{textblock}
1c829680503e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 365
diff changeset
   296
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   297
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   298
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   299
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   300
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   301
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   302
\frametitle{Reverse Polish Notation}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   303
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   304
{\Large\bl{$(3 + 1) * (2 + 9)$}}\bigskip
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$\Rightarrow$}\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\bl{$3\;\;1\;+\;2\;\;9\;+\;*$}}
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   309
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   310
\begin{textblock}{3}(11,4)
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   311
\begin{onlyenv}<2>
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   312
\begin{lstlisting}[language=JVMIS]
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   313
ldc 3
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   314
ldc 1
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   315
iadd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   316
ldc 2
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   317
ldc 9
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   318
iadd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   319
imul
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   320
\end{lstlisting}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   321
\end{onlyenv} 
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   322
\end{textblock}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   323
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   324
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   325
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   326
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   327
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   328
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   329
% \begin{frame}[c,fragile]
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   330
% \frametitle{Sudoku}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   331
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   332
% A very simple-minded version on 110 problems:\bigskip
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
% \begin{itemize}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   335
% \item 1 core: 800 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   336
% \item 2 cores: 400 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   337
% \item 8 cores: 290 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   338
% \item 18 cores: 142 secs
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   339
% \end{itemize}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   340
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   341
% \end{frame}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   342
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   343
 
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   344
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   345
% \begin{frame}[t]
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   346
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   347
%   \begin{center}  
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   348
%   \includegraphics[scale=0.3]{../pics/blow.png}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   349
%   \end{center}
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   350
  
365
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   351
%   \begin{textblock}{14}(2,11.4)
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   352
%   \large\bf{}Mind-Blowing Programming Languages:\\ 
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   353
%   \centering JavaScript
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   354
%   \end{textblock}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   355
% \end{frame}
fc118ee0fce4 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 323
diff changeset
   356
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   357
382
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   358
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   359
\begin{frame}[t]
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   360
\frametitle{Preliminary 1 (Scala)}
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   361
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   362
Raw marks (298 submissions):\bigskip
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   363
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   364
\begin{itemize}
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   365
\item 3\%: \hspace{4mm}227
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   366
\item 2\%: \hspace{4mm}35
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   367
\item 1\%: \hspace{4mm}9
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   368
\item 0\%: \hspace{4mm}27 
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   369
\end{itemize}
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   370
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   371
367
e6ae724255a8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 366
diff changeset
   372
\end{frame}
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   373
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   374
\begin{frame}[t]
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   375
\frametitle{Preliminary 2 (Scala)}
367
e6ae724255a8 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 366
diff changeset
   376
384
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   377
Raw marks (301 submissions):\bigskip
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   378
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   379
\begin{itemize}
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   380
\item 3.0\%: \hspace{4mm}236
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   381
\item 2.5\%: \hspace{4mm}5
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   382
\item 2.0\%: \hspace{4mm}7
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   383
\item 1.5\%: \hspace{4mm}13
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   384
\item 1.0\%: \hspace{4mm}1
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   385
\item 0.5\%: \hspace{4mm}2
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   386
\item 0.0\%: \hspace{4mm}37
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   387
\end{itemize}
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   388
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   389
6e1237691307 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 382
diff changeset
   390
\end{frame}
382
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   391
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   392
\begin{frame}<1-20>
1bd800376e0c updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 367
diff changeset
   393
\end{frame}
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
\end{document}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   397
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
%%% Local Variables:  
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
%%% mode: latex
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
%%% TeX-master: t
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   401
%%% End: 
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402