slides/slides03.tex
author Christian Urban <urbanc@in.tum.de>
Fri, 22 Nov 2019 16:41:45 +0000
changeset 323 1f8005b4cdf6
parent 320 cdfb2ce30a3d
child 365 fc118ee0fce4
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
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\documentclass[dvipsnames,14pt,t,xelatex]{beamer}
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\\
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    55
    Office: & N\liningnums{7.07} (North Wing, Bush House)\bigskip\\
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    56
    Slides \& Code: & KEATS\bigskip\\
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    57
    Office Hours: &  Thursdays 12:00 -- 14:00\\
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    58
    Additionally: & (for Scala) Tuesdays 10:45 -- 11:45\\ 
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  \end{tabular}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  \end{center}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
\end{frame}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    65
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    66
\begin{frame}[c]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    67
\frametitle{Preliminary 6}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    68
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    69
Raw marks (261 submissions):\bigskip
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    70
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    71
\begin{itemize}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    72
\item 3\%: \hspace{4mm}219
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    73
\item 2\%: \hspace{4mm}19
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    74
\item 1\%: \hspace{4mm}0
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
    75
\item 0\%: \hspace{4mm}23 \;(4 no submission)
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    76
\end{itemize}  
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    77
\end{frame}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    78
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
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    83
\begin{frame}[c,fragile]
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    84
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
    85
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    86
def collatz(n: Long) : Long =
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    87
  {
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    88
    val toReturn = collatzHelper(n, 0)
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    89
    toReturn
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
\end{lstlisting}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    92
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    93
\pause
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    94
\bigskip
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    95
\rule{11cm}{0.3mm}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    96
\bigskip
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
    97
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    98
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    99
def collatz(n: Long) : Long =
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   100
  collatzHelper(n, 0)
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   101
\end{lstlisting}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   102
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   103
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   104
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
   107
\begin{frame}[c,fragile]
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   108
\frametitle{Default Arguments}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   109
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   110
\small
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   111
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-3mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   112
def collatzHelper(n: Int, a: Int = 0) : Int = ...
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   113
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   114
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   115
collatzHelper(n, 3)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   116
collatzHelper(n, 0)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   117
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   118
collatzHelper(n)   // a = 0   
155
371acb50643d updated
Christian Urban <urbanc@in.tum.de>
parents: 140
diff changeset
   119
\end{lstlisting}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   120
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   121
\DOWNarrow{1}{10.7}{3.4}
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   122
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   123
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   124
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   127
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   128
\frametitle{Last Week: Options \& HO Funs.}
67
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{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   131
List(7,2,3,4,5,6).find(_ < 4)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   132
res: Option[Int] = Some(2)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   133
 
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
List(5,6,7,8,9).find(_ < 4)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   136
res: Option[Int] = None
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
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   139
List(1,2,3,4,5).map(x => x * x)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   140
res: List[Int] = List(1, 4, 9, 16, 25)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   141
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   142
  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   143
  \end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   144
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   148
\frametitle{Web-Crawler (1)}
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
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   151
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-7mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   152
def get_page(url: String) : String = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   153
Try(fromURL(url)("ISO-8859-1").take(10000).mkString)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   154
   .getOrElse { println(s" Problem with: $url"); ""}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   155
}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   156
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   157
\end{frame}
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
 
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   162
\frametitle{Web-Crawler (2)}
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
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   165
\begin{lstlisting}[language=Scala, numbers=none, 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   166
                    xleftmargin=-7mm, escapeinside={(*@}{@*)}]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   167
val http_pattern = """(*@\textcolor{codegreen}{"}@*)https?://[\^(*@\textcolor{codegreen}{"}@*)]*(*@\textcolor{codegreen}{"}@*)""".r
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   168
val email_pattern = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   169
 """([a-z\d\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})""".r
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   170
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
def unquote(s: String) = s.drop(1).dropRight(1)
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 get_all_URLs(page: String): Set[String] = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   176
  http_pattern.findAllIn(page).map(unquote).toSet
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
  // returns all URLs in a page  
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   179
\end{lstlisting}
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
  \end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   182
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   186
\frametitle{Web-Crawler (3)}
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
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   189
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   190
def crawl(url: String, n: Int) : Unit = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   191
  if (n == 0) ()
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   192
  else {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   193
    println(s"  Visiting: $n $url")
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   194
    val page = get_page(url)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   195
    for (u <- get_all_URLs(page)) 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   196
      crawl(u, n - 1)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   197
  }
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
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   200
\end{frame}
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
  
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
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   205
\frametitle{Email Harvester}
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
\small
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   208
\begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-3mm]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   209
def emails(url: String, n: Int) : Set[String] = {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   210
 if (n == 0) Set()
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   211
 else {
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   212
  println(s"  Visiting: $n $url")
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   213
  val page = get_page(url)
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   214
  val new_emails = 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   215
    email_pattern.findAllIn(page).toSet
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   216
  new_emails ++ 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   217
    (for (u <- get_all_URLs(page)) 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   218
       yield emails(u, n - 1)).flatten
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   219
 }
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
\end{lstlisting}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   223
\end{frame}
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
  
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
68
8da9e0c16194 updated
Christian Urban <urbanc@in.tum.de>
parents: 67
diff changeset
   229
\begin{frame}[c]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   230
\frametitle{Jumping Towers}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   231
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   232
\begin{center}
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   233
\begin{tikzpicture}[scale=1.3]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   234
  \draw[line width=1mm,cap=round] (0,0) -- (5,0);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   235
  \draw[line width=1mm,cap=round] (0,1) -- (5,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   236
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   237
  \draw[line width=1mm,cap=round] (0,0) -- (0,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   238
  \node at (0.5,0.5) {\textbf{\Large 3}};
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] (1,0) -- (1,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   241
  \node at (1.5,0.5) {\textbf{\Large 4}};
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] (2,0) -- (2,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   244
  \node at (2.5,0.5) {\textbf{\Large 2}};
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   245
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   246
  \draw[line width=1mm,cap=round] (3,0) -- (3,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   247
  \node at (3.5,0.5) {\textbf{\Large 0}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   248
  
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   249
  \draw[line width=1mm,cap=round] (4,0) -- (4,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   250
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   251
  \node at (4.5,0.5) {\textbf{\Large 1}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   252
  
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   253
  \draw[line width=1mm,cap=round] (5,0) -- (5,1);
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   254
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   255
  \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
   256
  \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
   257
  \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
   258
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] (2.5,0) to (3.5,0);
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 (4.5,0);
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   261
217
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] (4.5,1) to (5.7,1);
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   263
  \node at (5.7, 0.8) {End};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   264
\end{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   265
\end{center}\bigskip
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   266
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
shortest: 3 $\rightarrow$ 4 $\rightarrow$ End
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   269
67
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   270
\end{frame}
ca5884c2e3bd updated
Christian Urban <urbanc@in.tum.de>
parents: 66
diff changeset
   271
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
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   275
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   276
\begin{frame}[c]
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   277
\frametitle{``Children'' / moves}
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   278
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   279
\begin{center}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   280
  \begin{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   281
    [grow=right,level distance=30mm,child anchor=north,line width=0.5mm]
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   282
  \node {$[3,4,2,0,1]$}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   283
     child {node {$[0,1]$}}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   284
     child {node {$[2,0,1]$}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   285
        child {node {$[1]$} child [level distance=13mm] {node {End}}}
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
     }
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   288
     child {node {$[4,2,0,1]$\ldots}};
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   289
\end{tikzpicture}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   290
\end{center}
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   291
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   292
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   293
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   294
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   295
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   296
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   297
\frametitle{Reverse Polish Notation}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   298
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   299
{\Large\bl{$(3 + 1) * (2 + 9)$}}\bigskip
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
{\Large$\Rightarrow$}\bigskip
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
{\;\;\Large\bl{$3\;\;1\;+\;2\;\;9\;+\;*$}}
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   304
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   305
\begin{textblock}{3}(11,4)
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   306
\begin{onlyenv}<2>
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   307
\begin{lstlisting}[language=JVMIS]
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   308
ldc 3
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   309
ldc 1
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   310
iadd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   311
ldc 2
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   312
ldc 9
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   313
iadd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   314
imul
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   315
\end{lstlisting}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   316
\end{onlyenv} 
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   317
\end{textblock}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   318
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   319
\end{frame}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   320
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   321
 
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   322
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   323
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   324
\begin{frame}[c,fragile]
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   325
\frametitle{Sudoku}
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
A very simple-minded version on 110 problems:\bigskip
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
\begin{itemize}
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   330
\item 1 core: 800 secs
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   331
\item 2 cores: 400 secs
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   332
\item 8 cores: 290 secs
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   333
\item 18 cores: 142 secs
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   334
\end{itemize}
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   335
70
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   336
\end{frame}
6024381415cb updated
Christian Urban <urbanc@in.tum.de>
parents: 68
diff changeset
   337
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320
cdfb2ce30a3d updated
Christian Urban <urbanc@in.tum.de>
parents: 218
diff changeset
   338
 
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   339
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   340
\begin{frame}[t]
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   341
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   342
  \begin{center}  
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   343
  \includegraphics[scale=0.3]{../pics/blow.png}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   344
  \end{center}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   345
  
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   346
  \begin{textblock}{14}(2,11.4)
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   347
  \large\bf{}Mind-Blowing Programming Languages:\\ 
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   348
  \centering JavaScript
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   349
  \end{textblock}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   350
\end{frame}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents: 320
diff changeset
   351
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
e689375abcc1 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
   352
66
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   353
\end{document}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   354
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   355
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
\end{document}
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   358
%%% Local Variables:  
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   359
%%% mode: latex
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   360
%%% TeX-master: t
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   361
%%% End: 
3506b681c191 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   362