author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Fri, 01 Nov 2013 11:57:04 +0000 | |
changeset 173 | 7cfb7a6f7c99 |
parent 98 | 1f3d89fe9820 |
child 215 | 828303e8e4af |
permissions | -rw-r--r-- |
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t,xelatex]{beamer} |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
2 |
\usepackage{beamerthemeplaincu} |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
3 |
\usepackage{fontenc,xltxtra,xunicode} |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
4 |
\defaultfontfeatures{Mapping=tex-text} |
0 | 5 |
\usepackage{mathpartir} |
6 |
\usepackage[absolute,overlay]{textpos} |
|
7 |
\usepackage{ifthen} |
|
8 |
\usepackage{tikz} |
|
9 |
\usepackage{pgf} |
|
10 |
\usepackage{calc} |
|
11 |
\usepackage{ulem} |
|
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
12 |
%%\usepackage{courier} |
0 | 13 |
\usepackage{listings} |
14 |
\renewcommand{\uline}[1]{#1} |
|
15 |
\usetikzlibrary{arrows} |
|
16 |
\usetikzlibrary{automata} |
|
17 |
\usetikzlibrary{shapes} |
|
18 |
\usetikzlibrary{shadows} |
|
19 |
\usetikzlibrary{positioning} |
|
20 |
\usetikzlibrary{calc} |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
21 |
\usetikzlibrary{plotmarks} |
0 | 22 |
\usepackage{graphicx} |
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
23 |
\usepackage{pgfplots} |
0 | 24 |
|
25 |
\definecolor{javared}{rgb}{0.6,0,0} % for strings |
|
26 |
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments |
|
27 |
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords |
|
28 |
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc |
|
29 |
||
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
30 |
\makeatletter |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
31 |
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}} |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
32 |
\@empty\z@\@empty |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
33 |
\makeatother |
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
34 |
|
0 | 35 |
\lstset{language=Java, |
36 |
basicstyle=\ttfamily, |
|
37 |
keywordstyle=\color{javapurple}\bfseries, |
|
38 |
stringstyle=\color{javagreen}, |
|
39 |
commentstyle=\color{javagreen}, |
|
40 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
41 |
numbers=left, |
|
42 |
numberstyle=\tiny\color{black}, |
|
43 |
stepnumber=1, |
|
44 |
numbersep=10pt, |
|
45 |
tabsize=2, |
|
46 |
showspaces=false, |
|
47 |
showstringspaces=false} |
|
48 |
||
49 |
\lstdefinelanguage{scala}{ |
|
50 |
morekeywords={abstract,case,catch,class,def,% |
|
51 |
do,else,extends,false,final,finally,% |
|
52 |
for,if,implicit,import,match,mixin,% |
|
53 |
new,null,object,override,package,% |
|
54 |
private,protected,requires,return,sealed,% |
|
55 |
super,this,throw,trait,true,try,% |
|
56 |
type,val,var,while,with,yield}, |
|
57 |
otherkeywords={=>,<-,<\%,<:,>:,\#,@}, |
|
58 |
sensitive=true, |
|
59 |
morecomment=[l]{//}, |
|
60 |
morecomment=[n]{/*}{*/}, |
|
61 |
morestring=[b]", |
|
62 |
morestring=[b]', |
|
63 |
morestring=[b]""" |
|
64 |
} |
|
65 |
||
66 |
\lstset{language=Scala, |
|
67 |
basicstyle=\ttfamily, |
|
68 |
keywordstyle=\color{javapurple}\bfseries, |
|
69 |
stringstyle=\color{javagreen}, |
|
70 |
commentstyle=\color{javagreen}, |
|
71 |
morecomment=[s][\color{javadocblue}]{/**}{*/}, |
|
72 |
numbers=left, |
|
73 |
numberstyle=\tiny\color{black}, |
|
74 |
stepnumber=1, |
|
75 |
numbersep=10pt, |
|
76 |
tabsize=2, |
|
77 |
showspaces=false, |
|
78 |
showstringspaces=false} |
|
79 |
||
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
80 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
81 |
\begin{filecontents}{interpreted2.data} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
82 |
%1 0.00503 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
83 |
200 1.005863 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
84 |
400 7.8296765 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
85 |
600 27.2321885 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
86 |
800 65.249271 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
87 |
1000 135.4493445 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
88 |
1200 232.134097 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
89 |
1400 382.527227 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
90 |
\end{filecontents} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
91 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
92 |
\begin{filecontents}{compiled2.data} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
93 |
200 0.222058 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
94 |
400 0.215204 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
95 |
600 0.202031 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
96 |
800 0.21986 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
97 |
1000 0.205934 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
98 |
1200 0.1981615 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
99 |
1400 0.207116 |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
100 |
\end{filecontents} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
101 |
|
0 | 102 |
% beamer stuff |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
103 |
\renewcommand{\slidecaption}{AFL 01, King's College London, 25.~September 2013} |
0 | 104 |
|
105 |
||
106 |
\begin{document} |
|
107 |
||
108 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
109 |
\mode<presentation>{ |
|
110 |
\begin{frame}<1>[t] |
|
111 |
\frametitle{% |
|
112 |
\begin{tabular}{@ {}c@ {}} |
|
1 | 113 |
\\[-3mm] |
114 |
\LARGE Automata and \\[-2mm] |
|
115 |
\LARGE Formal Languages (1)\\[-3mm] |
|
0 | 116 |
\end{tabular}} |
117 |
||
118 |
\begin{center} |
|
1 | 119 |
\includegraphics[scale=0.3]{pics/ante1.jpg}\hspace{5mm} |
120 |
\includegraphics[scale=0.31]{pics/ante2.jpg}\\ |
|
121 |
\footnotesize\textcolor{gray}{Antikythera automaton, 100 BC (Archimedes?)} |
|
0 | 122 |
\end{center} |
123 |
||
124 |
\normalsize |
|
125 |
\begin{center} |
|
126 |
\begin{tabular}{ll} |
|
127 |
Email: & christian.urban at kcl.ac.uk\\ |
|
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
128 |
Office: & S1.27 (1st floor Strand Building)\\ |
0 | 129 |
Slides: & KEATS |
130 |
\end{tabular} |
|
131 |
\end{center} |
|
132 |
||
133 |
||
134 |
\end{frame}} |
|
135 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
136 |
||
137 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
138 |
\mode<presentation>{ |
|
139 |
\begin{frame}[c] |
|
140 |
||
1 | 141 |
\begin{textblock}{1}(2,5) |
0 | 142 |
\begin{tabular}{c} |
1 | 143 |
\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm] |
144 |
\small Server |
|
0 | 145 |
\end{tabular} |
146 |
\end{textblock} |
|
147 |
||
1 | 148 |
\begin{textblock}{1}(5.6,4) |
149 |
\begin{tikzpicture}[scale=1.1] |
|
150 |
\draw[white] (0,1) node (X) {}; |
|
151 |
\draw[white] (2,1) node (Y) {}; |
|
152 |
\draw[white] (0,0) node (X1) {}; |
|
153 |
\draw[white] (2,0) node (Y1) {}; |
|
154 |
\draw[white] (0,-1) node (X2) {}; |
|
155 |
\draw[white] (2,-1) node (Y2) {}; |
|
156 |
\draw[red, <-, line width = 2mm] (X) -- (Y); |
|
157 |
\node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {}; |
|
158 |
\draw[red, ->, line width = 2mm] (X1) -- (Y1); |
|
159 |
\node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {}; |
|
160 |
\draw[red, <-, line width = 2mm] (X2) -- (Y2); |
|
161 |
\node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {}; |
|
0 | 162 |
\end{tikzpicture} |
163 |
\end{textblock} |
|
164 |
||
165 |
||
1 | 166 |
\begin{textblock}{1}(9,5.5) |
0 | 167 |
\begin{tabular}{c} |
1 | 168 |
\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm] |
169 |
\small Browser |
|
0 | 170 |
\end{tabular} |
171 |
\end{textblock} |
|
172 |
||
1 | 173 |
\only<2>{ |
174 |
\begin{textblock}{10}(2,13.5) |
|
0 | 175 |
\begin{itemize} |
1 | 176 |
\item programming languages, compilers |
0 | 177 |
\end{itemize} |
1 | 178 |
\end{textblock}} |
0 | 179 |
|
180 |
||
181 |
\end{frame}} |
|
182 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
183 |
||
184 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
185 |
\mode<presentation>{ |
|
186 |
\begin{frame}[c] |
|
1 | 187 |
|
188 |
transforming strings into structured data\\[10mm] |
|
0 | 189 |
|
1 | 190 |
{\LARGE\bf Lexing}\medskip\\ |
191 |
\hspace{5mm}(recognising ``words'')\\[6mm] |
|
0 | 192 |
|
1 | 193 |
{\LARGE\bf Parsing}\medskip\\ |
194 |
\hspace{5mm}(recognising ``sentences'') |
|
195 |
||
0 | 196 |
\end{frame}} |
1 | 197 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
198 |
||
0 | 199 |
|
200 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
201 |
\mode<presentation>{ |
|
202 |
\begin{frame}[c] |
|
203 |
||
1 | 204 |
The subject is quite old: |
0 | 205 |
|
206 |
\begin{itemize} |
|
1 | 207 |
\item Turing Machines, 1936 |
208 |
\item first compiler for COBOL, 1957 (Grace Hopper) |
|
209 |
\item but surprisingly research papers are still published now |
|
0 | 210 |
\end{itemize} |
211 |
||
1 | 212 |
\begin{flushright} |
213 |
\includegraphics[scale=0.3]{pics/hopper.jpg}\\ |
|
214 |
\footnotesize\textcolor{gray}{Grace Hopper} |
|
215 |
\end{flushright} |
|
216 |
||
217 |
{\footnotesize\textcolor{gray}{(she made it to David Letterman's Tonight Show, \url{http://www.youtube.com/watch?v=aZOxtURhfEU})}} |
|
0 | 218 |
|
1 | 219 |
\end{frame}} |
220 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
221 |
||
222 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
223 |
\mode<presentation>{ |
|
224 |
\begin{frame}[c] |
|
225 |
\frametitle{\begin{tabular}{c}This Course\end{tabular}} |
|
0 | 226 |
|
1 | 227 |
\begin{itemize} |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
228 |
\item the ultimate goal is to implement a small compiler (a really small one for the JVM)\bigskip |
1 | 229 |
\end{itemize} |
230 |
||
231 |
Let's start with: |
|
232 |
||
233 |
\begin{itemize} |
|
234 |
\item a web-crawler |
|
235 |
\item an email harvester |
|
236 |
\item a web-scraper |
|
237 |
\end{itemize} |
|
238 |
||
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
239 |
\begin{textblock}{6}(10,7) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
240 |
\begin{tikzpicture}[scale=0.38] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
241 |
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs, |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
242 |
xlabel=n, |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
243 |
enlargelimits=0.05, |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
244 |
ybar interval=0.7, legend style=small] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
245 |
\addplot file {interpreted2.data}; |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
246 |
\addplot file {compiled2.data}; |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
247 |
%\legend{interpreted, compiled} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
248 |
\end{axis} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
249 |
\end{tikzpicture} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
250 |
\end{textblock} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
251 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
252 |
|
1 | 253 |
\end{frame}} |
254 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
0 | 255 |
|
2 | 256 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
257 |
\mode<presentation>{ |
|
3 | 258 |
\begin{frame}[t] |
13 | 259 |
\frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}} |
2 | 260 |
|
3 | 261 |
\mbox{}\\[10mm] |
262 |
||
2 | 263 |
\begin{enumerate} |
264 |
\item given an URL, read the corresponding webpage |
|
265 |
\item extract all links from it |
|
266 |
\item call the web-crawler again for all these links |
|
267 |
\end{enumerate} |
|
268 |
||
269 |
\end{frame}} |
|
270 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
271 |
||
272 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
273 |
\mode<presentation>{ |
|
3 | 274 |
\begin{frame}[t] |
13 | 275 |
\frametitle{\begin{tabular}{c}A Web-Crawler\end{tabular}} |
2 | 276 |
|
3 | 277 |
\mbox{}\\[10mm] |
278 |
||
279 |
||
2 | 280 |
\begin{enumerate} |
281 |
\item given an URL, read the corresponding webpage |
|
282 |
\item if not possible print, out a problem |
|
283 |
\item if possible, extract all links from it |
|
284 |
\item call the web-crawler again for all these links |
|
285 |
\end{enumerate}\bigskip\pause |
|
286 |
||
3 | 287 |
\small (we need a bound for the number of recursive calls) |
2 | 288 |
|
289 |
\small (the purpose is to check all links on my own webpage) |
|
290 |
\end{frame}} |
|
291 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
292 |
||
0 | 293 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
294 |
\mode<presentation>{ |
|
295 |
\begin{frame}[c] |
|
1 | 296 |
\frametitle{\begin{tabular}{c}Scala\end{tabular}} |
297 |
||
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
298 |
\small a simple Scala function for reading webpages\\[-3mm] |
0 | 299 |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
300 |
\footnotesize |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
301 |
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app0.scala}}}\pause |
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
302 |
{\lstset{language=Scala}\texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip |
0 | 303 |
|
3 | 304 |
|
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
305 |
\small slightly more complicated for handling errors properly:\\[-3mm] |
2 | 306 |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
307 |
\footnotesize |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
308 |
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app1.scala}}} |
1 | 309 |
|
0 | 310 |
|
311 |
\end{frame}} |
|
312 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
313 |
||
314 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
315 |
\mode<presentation>{ |
|
98
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
316 |
\begin{frame}[c] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
317 |
\frametitle{\begin{tabular}{c}Why Scala?\end{tabular}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
318 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
319 |
\begin{textblock}{6}(1,3) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
320 |
\begin{tabular}{l} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
321 |
\mbox{}\hspace{-1mm}\includegraphics[scale=0.36]{pics/twitter.png}\\[-1mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
322 |
\includegraphics[scale=0.30]{pics/linked.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
323 |
\includegraphics[scale=0.30]{pics/guardian.jpg}\\[-3mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
324 |
\mbox{}\hspace{-2mm}\includegraphics[scale=0.38]{pics/morgan.png}\\[-3mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
325 |
\includegraphics[scale=0.30]{pics/suisse.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
326 |
\includegraphics[scale=0.20]{pics/edf.png}\\[-1mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
327 |
\includegraphics[scale=0.08]{pics/novell.png}\\[-1mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
328 |
\includegraphics[scale=0.30]{pics/foursquare.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
329 |
\includegraphics[scale=0.30]{pics/hsbc.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
330 |
{\large\bf ...} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
331 |
\end{tabular} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
332 |
\end{textblock} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
333 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
334 |
\only<2->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
335 |
\begin{textblock}{6}(6,3) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
336 |
\includegraphics[scale=0.35]{pics/jobgraph.png}\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
337 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
338 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
339 |
\only<3->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
340 |
\begin{textblock}{6}(7.3,9.2) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
341 |
\begin{tabular}{l} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
342 |
\footnotesize 2013: 1$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
343 |
\footnotesize 2014: 3$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
344 |
\footnotesize 2015: 9$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
345 |
\footnotesize 2016: 27$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
346 |
\footnotesize 2017: 81$\%$\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
347 |
\footnotesize 2018: 243$\%$ \raisebox{-1mm}{\includegraphics[scale=0.02]{pics/smiley.jpg}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
348 |
\end{tabular} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
349 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
350 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
351 |
\only<3->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
352 |
\begin{textblock}{6}(6,9.5) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
353 |
\footnotesize 5 yrs $\begin{cases}\mbox{}\\[1.4cm]\end{cases}$ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
354 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
355 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
356 |
\only<4->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
357 |
\begin{textblock}{11}(5,14.1) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
358 |
\textcolor{gray}{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
359 |
\footnotesize {\bf in London today:} 1 Scala job for every 30 Java jobs;\\[-2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
360 |
Scala programmers seem to get up to 20\% better salary} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
361 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
362 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
363 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
364 |
\only<5->{ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
365 |
\begin{textblock}{1}(3,6) |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
366 |
\begin{tikzpicture} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
367 |
\draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
368 |
{\normalsize\color{darkgray} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
369 |
\begin{minipage}{8.5cm}\raggedright\normalsize |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
370 |
Scala is a functional and object-oriented programming language; compiles to the JVM; does not |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
371 |
need null-pointer exceptions; a course on Coursera\\ |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
372 |
\mbox{}\hfill\textcolor{blue}{\url{http://www.scala-lang.org}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
373 |
\end{minipage}}; |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
374 |
\end{tikzpicture} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
375 |
\end{textblock}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
376 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
377 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
378 |
\end{frame}} |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
379 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
380 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
381 |
|
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
382 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1f3d89fe9820
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
97
diff
changeset
|
383 |
\mode<presentation>{ |
3 | 384 |
\begin{frame}[t] |
385 |
\frametitle{\begin{tabular}{c}A Regular Expression\end{tabular}} |
|
386 |
||
387 |
\begin{itemize} |
|
388 |
\item \ldots{} is a pattern or template for specifying strings |
|
389 |
\end{itemize}\bigskip |
|
390 |
||
391 |
\begin{center} |
|
392 |
\only<1>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf |
|
393 |
\texttt{"https?://[$\hat{\hspace{2mm}}$"]*"}}}% |
|
394 |
\only<2>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf |
|
395 |
\texttt{"""\textbackslash{}"https?://[$\hat{\hspace{2mm}}$\textbackslash{}"]*\textbackslash{}"""".r}}} |
|
396 |
\end{center}\bigskip\bigskip |
|
397 |
||
398 |
matches for example\\ |
|
399 |
\;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf |
|
400 |
\texttt{"http://www.foobar.com"}}\\ |
|
401 |
\;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf |
|
402 |
\texttt{"https://www.tls.org"}}\\ |
|
403 |
||
404 |
\end{frame}} |
|
405 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
406 |
||
407 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
408 |
\mode<presentation>{ |
|
0 | 409 |
\begin{frame}[c] |
410 |
||
3 | 411 |
{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf |
412 |
\texttt{rexp.findAllIn(string)}}\medskip |
|
413 |
||
414 |
returns a list of all (sub)strings that match the regular expression\bigskip\bigskip |
|
415 |
||
416 |
{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf |
|
417 |
\texttt{rexp.findFirstIn(string)}}\medskip |
|
418 |
||
419 |
returns either {\bf\texttt{None}} if no (sub)string matches |
|
420 |
or {\bf\texttt{Some(s)}} with the first (sub)string |
|
0 | 421 |
|
422 |
\end{frame}} |
|
423 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
424 |
||
425 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
426 |
\mode<presentation>{ |
|
427 |
\begin{frame}[c] |
|
428 |
||
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
429 |
\small |
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
430 |
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app2.scala}}}\medskip |
0 | 431 |
|
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
432 |
{\lstset{language=Scala}\texttt{crawl(some\_start\_URL, 2)}}\ |
0 | 433 |
|
434 |
\end{frame}} |
|
435 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
436 |
||
437 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
438 |
\mode<presentation>{ |
|
3 | 439 |
\begin{frame}[c] |
0 | 440 |
|
3 | 441 |
\footnotesize |
442 |
a version that only ``crawls'' links in my domain: |
|
0 | 443 |
|
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
444 |
\small |
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
445 |
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app3.scala}}} |
0 | 446 |
|
447 |
||
448 |
\end{frame}} |
|
449 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
450 |
||
451 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
452 |
\mode<presentation>{ |
|
453 |
\begin{frame}[c] |
|
3 | 454 |
|
455 |
\footnotesize |
|
456 |
a little email ``harvester'': |
|
457 |
||
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
458 |
\small |
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
459 |
{\lstset{language=Scala}\texttt{\lstinputlisting{../progs/app4.scala}}}\bigskip |
3 | 460 |
|
461 |
\tiny |
|
462 |
\textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}} |
|
463 |
||
464 |
\end{frame}} |
|
465 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
466 |
||
467 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
|
468 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
469 |
\mode<presentation>{ |
|
14 | 470 |
\begin{frame}[t] |
3 | 471 |
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
0 | 472 |
|
14 | 473 |
Their inductive definition:\medskip |
474 |
||
475 |
\begin{textblock}{6}(2,5) |
|
3 | 476 |
\begin{tabular}{@ {}rrl@ {\hspace{13mm}}l} |
477 |
\bl{r} & \bl{$::=$} & \bl{$\varnothing$} & null\\ |
|
5 | 478 |
& \bl{$\mid$} & \bl{$\epsilon$} & empty string / "" / []\\ |
3 | 479 |
& \bl{$\mid$} & \bl{c} & character\\ |
480 |
& \bl{$\mid$} & \bl{r$_1$ $\cdot$ r$_2$} & sequence\\ |
|
481 |
& \bl{$\mid$} & \bl{r$_1$ + r$_2$} & alternative / choice\\ |
|
482 |
& \bl{$\mid$} & \bl{r$^*$} & star (zero or more)\\ |
|
483 |
\end{tabular} |
|
484 |
\end{textblock} |
|
485 |
||
486 |
\end{frame}} |
|
487 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
488 |
||
489 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
490 |
\mode<presentation>{ |
|
491 |
\begin{frame}[t] |
|
492 |
\frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}} |
|
493 |
||
14 | 494 |
\small |
495 |
In Scala: |
|
496 |
||
497 |
||
3 | 498 |
{\lstset{language=Scala}\fontsize{8}{10}\selectfont |
95
dbe49327b6c5
added new stuff
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
499 |
\texttt{\lstinputlisting{../progs/app51.scala}}} |
0 | 500 |
|
501 |
||
502 |
\end{frame}} |
|
503 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
504 |
||
3 | 505 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
0 | 506 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
507 |
\mode<presentation>{ |
|
508 |
\begin{frame}[c] |
|
3 | 509 |
\frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}} |
0 | 510 |
|
4 | 511 |
\begin{textblock}{15}(1,4) |
3 | 512 |
\begin{tabular}{@ {}rcl} |
513 |
\bl{$L$($\varnothing$)} & \bl{$\dn$} & \bl{$\varnothing$}\\ |
|
514 |
\bl{$L$($\epsilon$)} & \bl{$\dn$} & \bl{$\{$""$\}$}\\ |
|
515 |
\bl{$L$(c)} & \bl{$\dn$} & \bl{$\{$"c"$\}$}\\ |
|
516 |
\bl{$L$(r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{$L$(r$_1$) $\cup$ $L$(r$_2$)}\\ |
|
4 | 517 |
\bl{$L$(r$_1$ $\cdot$ r$_2$)} & \bl{$\dn$} & \bl{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ $L$(r$_1$) $\wedge$ s$_2$ $\in$ |
518 |
$L$(r$_2$) $\}$}\\ |
|
5 | 519 |
\bl{$L$(r$^*$)} & \bl{$\dn$} & \onslide<4->{\bl{$\bigcup_{n \ge 0}$ $L$(r)$^n$}}\\ |
4 | 520 |
\end{tabular}\bigskip |
3 | 521 |
|
4 | 522 |
\onslide<2->{ |
523 |
\hspace{5mm}\bl{$L$(r)$^0$ $\;\dn\;$ $\{$""$\}$}\\ |
|
5 | 524 |
\bl{$L$(r)$^{n+1}$ $\;\dn\;$ $L$(r) @ $L$(r)$^n$}\hspace{9mm}\onslide<3->{\small\textcolor{gray}{(append on sets)}\\ |
525 |
\small\hspace{5cm}\textcolor{gray}{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ $L$(r) $\wedge$ s$_2$ $\in$ |
|
526 |
$L$(r)$^n$ $\}$}} |
|
4 | 527 |
} |
528 |
\end{textblock} |
|
529 |
||
0 | 530 |
\end{frame}} |
531 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
532 |
||
5 | 533 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
534 |
\mode<presentation>{ |
|
535 |
\begin{frame}[c] |
|
8 | 536 |
\frametitle{\begin{tabular}{c}The Meaning of Matching\end{tabular}} |
5 | 537 |
|
538 |
\large |
|
539 |
a regular expression \bl{r} matches a string \bl{s} is defined as |
|
540 |
||
541 |
\begin{center} |
|
542 |
\bl{s $\in$ $L$(r)}\\ |
|
543 |
\end{center} |
|
544 |
||
545 |
\end{frame}} |
|
546 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
547 |
||
3 | 548 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
549 |
\mode<presentation>{ |
|
550 |
\begin{frame}[c] |
|
551 |
\frametitle{\begin{tabular}{c}This Course\end{tabular}} |
|
552 |
||
7 | 553 |
We will have a look at: |
3 | 554 |
|
555 |
\begin{itemize} |
|
7 | 556 |
\item regular expressions / regular expression matching |
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
557 |
\item derivatives |
3 | 558 |
\item automata |
559 |
\item parsing |
|
560 |
\item grammars |
|
97
60a3ba90dd53
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
95
diff
changeset
|
561 |
\item a small interpreter / compiler |
3 | 562 |
\end{itemize} |
563 |
||
564 |
\end{frame}} |
|
565 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
566 |
||
0 | 567 |
|
568 |
||
569 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
570 |
\mode<presentation>{ |
|
571 |
\begin{frame}[c] |
|
1 | 572 |
\frametitle{\begin{tabular}{c}Exam\end{tabular}} |
0 | 573 |
|
574 |
\begin{itemize} |
|
7 | 575 |
\item The question ``Is this relevant for the exam?'' is not appreciated!\bigskip\\ |
0 | 576 |
|
14 | 577 |
Whatever is in the homework sheets (and is not marked ``optional'') is relevant for the |
578 |
exam.\\ No code needs to be written in the exam. |
|
0 | 579 |
\end{itemize} |
580 |
||
581 |
\end{frame}} |
|
582 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
583 |
||
584 |
||
585 |
\end{document} |
|
586 |
||
587 |
%%% Local Variables: |
|
588 |
%%% mode: latex |
|
589 |
%%% TeX-master: t |
|
590 |
%%% End: |
|
591 |