slides01.tex
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Sat, 24 Nov 2012 15:10:43 +0000
changeset 79 fd894e017e12
parent 14 8ef75033f34e
permissions -rw-r--r--
added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
\documentclass[dvipsnames,14pt,t]{beamer}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
\usepackage{beamerthemeplainculight}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
\usepackage[T1]{fontenc}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
\usepackage[latin1]{inputenc}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
\usepackage{mathpartir}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
\usepackage[absolute,overlay]{textpos}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
\usepackage{ifthen}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
\usepackage{tikz}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
\usepackage{pgf}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
\usepackage{calc} 
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
\usepackage{ulem}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
\usepackage{courier}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
\usepackage{listings}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
\renewcommand{\uline}[1]{#1}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
\usetikzlibrary{arrows}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
\usetikzlibrary{automata}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
\usetikzlibrary{shapes}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
\usetikzlibrary{shadows}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
\usetikzlibrary{positioning}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
\usetikzlibrary{calc}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
\usepackage{graphicx} 
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
\definecolor{javared}{rgb}{0.6,0,0} % for strings
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
\lstset{language=Java,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
	basicstyle=\ttfamily,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
	keywordstyle=\color{javapurple}\bfseries,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
	stringstyle=\color{javagreen},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
	commentstyle=\color{javagreen},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
	morecomment=[s][\color{javadocblue}]{/**}{*/},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
	numbers=left,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
	numberstyle=\tiny\color{black},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
	stepnumber=1,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
	numbersep=10pt,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
	tabsize=2,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
	showspaces=false,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
	showstringspaces=false}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
\lstdefinelanguage{scala}{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  morekeywords={abstract,case,catch,class,def,%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    do,else,extends,false,final,finally,%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    for,if,implicit,import,match,mixin,%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
    new,null,object,override,package,%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
    private,protected,requires,return,sealed,%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
    super,this,throw,trait,true,try,%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
    type,val,var,while,with,yield},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
  sensitive=true,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
  morecomment=[l]{//},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
  morecomment=[n]{/*}{*/},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
  morestring=[b]",
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
  morestring=[b]',
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
  morestring=[b]"""
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
\lstset{language=Scala,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
	basicstyle=\ttfamily,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
	keywordstyle=\color{javapurple}\bfseries,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
	stringstyle=\color{javagreen},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
	commentstyle=\color{javagreen},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
	morecomment=[s][\color{javadocblue}]{/**}{*/},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
	numbers=left,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
	numberstyle=\tiny\color{black},
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
	stepnumber=1,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
	numbersep=10pt,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
	tabsize=2,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
	showspaces=false,
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
	showstringspaces=false}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
% beamer stuff 
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    74
\renewcommand{\slidecaption}{AFL 01, King's College London, 26.~September 2012}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
\begin{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
\begin{frame}<1>[t]
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
\frametitle{%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  \begin{tabular}{@ {}c@ {}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    84
  \\[-3mm]
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    85
  \LARGE Automata and \\[-2mm] 
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    86
  \LARGE Formal Languages (1)\\[-3mm] 
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
  \end{tabular}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
  \begin{center}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    90
  \includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    91
  \includegraphics[scale=0.31]{pics/ante2.jpg}\\
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
    92
  \footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
  \end{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
\normalsize
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  \begin{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  \begin{tabular}{ll}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  Email:  & christian.urban at kcl.ac.uk\\
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  Of$\!$fice: & S1.27 (1st floor Strand Building)\\
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
  Slides: & KEATS
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
  \end{tabular}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
  \end{center}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
\begin{frame}[c]
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   111
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   112
\begin{textblock}{1}(2,5)
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   113
\begin{tabular}{c}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   114
\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   115
\small Server
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
\end{tabular}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
\end{textblock}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   119
\begin{textblock}{1}(5.6,4)
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   120
  \begin{tikzpicture}[scale=1.1]
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   121
  \draw[white] (0,1) node (X) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   122
  \draw[white] (2,1) node (Y) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   123
   \draw[white] (0,0) node (X1) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   124
  \draw[white] (2,0) node (Y1) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   125
   \draw[white] (0,-1) node (X2) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   126
  \draw[white] (2,-1) node (Y2) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   127
  \draw[red, <-, line width = 2mm] (X) -- (Y);
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   128
  \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   129
  \draw[red, ->, line width = 2mm] (X1) -- (Y1);
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   130
  \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {};
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   131
  \draw[red, <-, line width = 2mm] (X2) -- (Y2);
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   132
  \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {};
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   133
  \end{tikzpicture}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
\end{textblock}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   135
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   136
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   137
\begin{textblock}{1}(9,5.5)
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   138
\begin{tabular}{c}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   139
\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   140
\small Browser
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   141
\end{tabular}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
\end{textblock}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   143
  
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   144
\only<2>{  
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   145
\begin{textblock}{10}(2,13.5)
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
\begin{itemize}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   147
\item programming languages, compilers
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
\end{itemize}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   149
\end{textblock}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   151
  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   153
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
\begin{frame}[c]
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   158
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   159
transforming strings into structured data\\[10mm]
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   160
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   161
{\LARGE\bf Lexing}\medskip\\
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   162
\hspace{5mm}(recognising ``words'')\\[6mm]
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   164
{\LARGE\bf Parsing}\medskip\\
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   165
\hspace{5mm}(recognising ``sentences'')
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   166
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
\end{frame}}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   168
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   169
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
\begin{frame}[c]
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   175
The subject is quite old:
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
\begin{itemize}
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   178
\item Turing Machines, 1936
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   179
\item first compiler for COBOL, 1957 (Grace Hopper)
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   180
\item but surprisingly research papers are still published now
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
\end{itemize}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   182
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   183
\begin{flushright}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   184
\includegraphics[scale=0.3]{pics/hopper.jpg}\\
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   185
\footnotesize\textcolor{gray}{Grace Hopper}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   186
\end{flushright}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   187
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   188
{\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   190
\end{frame}}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   191
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   192
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   193
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   194
\mode<presentation>{
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   195
\begin{frame}[c]
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   196
\frametitle{\begin{tabular}{c}This Course\end{tabular}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   198
\begin{itemize}
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   199
\item the ultimate goal is to implement a small web-browser (really small one)\bigskip
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   200
\end{itemize}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   201
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   202
Let's start with:
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   203
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   204
\begin{itemize}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   205
\item a web-crawler
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   206
\item an email harvester
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   207
\item a web-scraper
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   208
\end{itemize}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   209
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   210
\end{frame}}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   211
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   212
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   213
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   214
\mode<presentation>{
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   215
\begin{frame}[t]
13
Christian Urban <urbanc@in.tum.de>
parents: 8
diff changeset
   216
\frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   217
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   218
\mbox{}\\[10mm]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   219
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   220
\begin{enumerate}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   221
\item given an URL, read the corresponding webpage
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   222
\item extract all links from it
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   223
\item call the web-crawler again for all these links
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   224
\end{enumerate}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   225
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   226
\end{frame}}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   227
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   228
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   229
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   230
\mode<presentation>{
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   231
\begin{frame}[t]
13
Christian Urban <urbanc@in.tum.de>
parents: 8
diff changeset
   232
\frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}}
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   233
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   234
\mbox{}\\[10mm]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   235
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   236
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   237
\begin{enumerate}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   238
\item given an URL, read the corresponding webpage
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   239
\item if not possible print, out a problem
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   240
\item if possible, extract all links from it
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   241
\item call the web-crawler again for all these links
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   242
\end{enumerate}\bigskip\pause
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   243
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   244
\small (we need a bound for the number of recursive calls)
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   245
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   246
\small (the purpose is to check all links on my own webpage)
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   247
\end{frame}}
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   248
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   249
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   250
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   251
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   252
\begin{frame}[c]
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   253
\frametitle{\begin{tabular}{c}Scala\end{tabular}}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   254
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   255
\footnotesize a simple Scala function for reading webpages\\[-3mm]
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   256
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   257
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   258
\texttt{\lstinputlisting{app0.scala}}}\pause
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   259
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   260
\texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   261
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   262
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   263
\footnotesize slightly more complicated for handling errors properly:\\[-3mm]
2
6e7da958ba8c updated
Christian Urban <urbanc@in.tum.de>
parents: 1
diff changeset
   264
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   265
\footnotesize
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   266
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   267
\texttt{\lstinputlisting{app1.scala}}}
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   268
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   269
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   270
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   271
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   272
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   273
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   274
\mode<presentation>{
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   275
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   276
\frametitle{\begin{tabular}{c}A Regular Expression\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   277
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   278
\begin{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   279
\item \ldots{} is a pattern or template for specifying strings
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   280
\end{itemize}\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   281
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   282
\begin{center}  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   283
\only<1>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   284
\texttt{"https?://[$\hat{\hspace{2mm}}$"]*"}}}%
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   285
\only<2>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   286
\texttt{"""\textbackslash{}"https?://[$\hat{\hspace{2mm}}$\textbackslash{}"]*\textbackslash{}"""".r}}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   287
\end{center}\bigskip\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   288
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   289
matches for example\\  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   290
\;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   291
\texttt{"http://www.foobar.com"}}\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   292
\;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   293
\texttt{"https://www.tls.org"}}\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   294
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   295
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   296
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   297
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   298
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   299
\mode<presentation>{
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   300
\begin{frame}[c]
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   301
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   302
{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   303
\texttt{rexp.findAllIn(string)}}\medskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   304
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   305
returns a list of all (sub)strings that match the regular expression\bigskip\bigskip  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   306
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   307
{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   308
\texttt{rexp.findFirstIn(string)}}\medskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   309
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   310
returns either {\bf\texttt{None}} if no (sub)string matches 
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   311
or {\bf\texttt{Some(s)}} with the first (sub)string
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   313
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   315
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   316
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   318
\begin{frame}[c]
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   319
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   320
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   321
\texttt{\lstinputlisting{app2.scala}}}\medskip
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   323
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   324
\texttt{crawl(some\_start\_URL, 2)}}\
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   325
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   326
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   327
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   328
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   329
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   330
\mode<presentation>{
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   331
\begin{frame}[c]
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   332
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   333
\footnotesize
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   334
a version that only ``crawls'' links in my domain:
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   336
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   337
\texttt{\lstinputlisting{app3.scala}}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   338
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   339
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   340
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   343
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   345
\begin{frame}[c]
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   346
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   347
\footnotesize
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   348
a little email ``harvester'':
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   349
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   350
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   351
\texttt{\lstinputlisting{app4.scala}}}\bigskip
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   352
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   353
\tiny
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   354
\textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   355
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   356
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   357
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   358
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   359
\newcommand{\bl}[1]{\textcolor{blue}{#1}}       
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   360
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   361
\mode<presentation>{
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   362
\begin{frame}[t]
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   363
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   364
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   365
Their inductive definition:\medskip
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   366
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   367
\begin{textblock}{6}(2,5)
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   368
  \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   369
  \bl{r} & \bl{$::=$}  & \bl{$\varnothing$}  & null\\
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   370
         & \bl{$\mid$} & \bl{$\epsilon$}        & empty string / "" / []\\
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   371
         & \bl{$\mid$} & \bl{c}                         & character\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   372
         & \bl{$\mid$} & \bl{r$_1$ $\cdot$ r$_2$} & sequence\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   373
         & \bl{$\mid$} & \bl{r$_1$ + r$_2$}  & alternative / choice\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   374
         & \bl{$\mid$} & \bl{r$^*$}                   & star (zero or more)\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   375
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   376
  \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   377
  
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   378
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   379
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   380
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   381
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   382
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   383
\begin{frame}[t]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   384
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   385
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   386
\small
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   387
In Scala:
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   388
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   389
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   390
{\lstset{language=Scala}\fontsize{8}{10}\selectfont
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
   391
\texttt{\lstinputlisting{app51.scala}}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   392
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   393
  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   394
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   395
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   396
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   397
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   398
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   399
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   400
\begin{frame}[c]
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   401
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   402
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   403
\begin{textblock}{15}(1,4)
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   404
 \begin{tabular}{@ {}rcl}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   405
 \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   406
 \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   407
 \bl{$L$(c)}                         & \bl{$\dn$} & \bl{$\{$"c"$\}$}\\
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   408
 \bl{$L$(r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{$L$(r$_1$) $\cup$ $L$(r$_2$)}\\
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   409
 \bl{$L$(r$_1$ $\cdot$ r$_2$)}  & \bl{$\dn$} & \bl{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ $L$(r$_1$) $\wedge$ s$_2$ $\in$ 
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   410
     $L$(r$_2$) $\}$}\\
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   411
 \bl{$L$(r$^*$)}                   & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{n \ge 0}$ $L$(r)$^n$}}\\
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   412
  \end{tabular}\bigskip
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   413
  
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   414
\onslide<2->{
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   415
\hspace{5mm}\bl{$L$(r)$^0$ $\;\dn\;$ $\{$""$\}$}\\
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   416
\bl{$L$(r)$^{n+1}$ $\;\dn\;$ $L$(r) @ $L$(r)$^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   417
\small\hspace{5cm}\textcolor{gray}{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ $L$(r) $\wedge$ s$_2$ $\in$ 
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   418
     $L$(r)$^n$ $\}$}}
4
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   419
}  
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   420
    \end{textblock}
Christian Urban <urbanc@in.tum.de>
parents: 3
diff changeset
   421
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   422
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   423
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   424
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   425
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   426
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   427
\begin{frame}[c]
8
Christian Urban <urbanc@in.tum.de>
parents: 7
diff changeset
   428
\frametitle{\begin{tabular}{c}The Meaning of Matching\end{tabular}}
5
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   429
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   430
\large
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   431
a regular expression \bl{r} matches a string \bl{s} is defined as
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   432
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   433
\begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   434
\bl{s $\in$ $L$(r)}\\ 
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   435
\end{center}
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   436
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   437
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   438
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 4
diff changeset
   439
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   440
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   441
\mode<presentation>{
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   442
\begin{frame}[c]
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   443
\frametitle{\begin{tabular}{c}This Course\end{tabular}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   444
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
   445
We will have a look at:
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   446
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   447
\begin{itemize}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
   448
\item regular expressions / regular expression matching
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   449
\item automata
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   450
\item the Myhill-Nerode theorem
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   451
\item parsing
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   452
\item grammars
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
   453
\item a small interpreter / web browser
3
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   454
\end{itemize}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   455
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   456
\end{frame}}
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   457
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
Christian Urban <urbanc@in.tum.de>
parents: 2
diff changeset
   458
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   459
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   460
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   461
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   462
\mode<presentation>{
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   463
\begin{frame}[c]
1
b606c9439fa6 new version
Christian Urban <urbanc@in.tum.de>
parents: 0
diff changeset
   464
\frametitle{\begin{tabular}{c}Exam\end{tabular}}
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   465
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   466
\begin{itemize}
7
73cf4406b773 updated
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
   467
\item The question ``Is this relevant for the exam?'' is not appreciated!\bigskip\\
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   468
14
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   469
Whatever is in the homework sheets (and is not marked ``optional'') is relevant for the
Christian Urban <urbanc@in.tum.de>
parents: 13
diff changeset
   470
exam.\\ No code needs to be written in the exam.
0
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   471
\end{itemize}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   472
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   473
\end{frame}}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   474
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   475
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   476
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   477
\end{document}
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   478
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   479
%%% Local Variables:  
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   480
%%% mode: latex
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   481
%%% TeX-master: t
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   482
%%% End: 
3a5e09a2ae54 initial comit
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   483