slides01.tex
changeset 3 df423d3b7fa1
parent 2 6e7da958ba8c
child 4 27c0abdb39d5
equal deleted inserted replaced
2:6e7da958ba8c 3:df423d3b7fa1
   194 \mode<presentation>{
   194 \mode<presentation>{
   195 \begin{frame}[c]
   195 \begin{frame}[c]
   196 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
   196 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
   197 
   197 
   198 \begin{itemize}
   198 \begin{itemize}
       
   199 \item the ultimate goal is to implement a small web-browser (really small one)\bigskip
       
   200 \end{itemize}
       
   201 
       
   202 Let's start with:
       
   203 
       
   204 \begin{itemize}
       
   205 \item a web-crawler
       
   206 \item an email harvester
       
   207 \item a web-scraper
       
   208 \end{itemize}
       
   209 
       
   210 \end{frame}}
       
   211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   212 
       
   213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   214 \mode<presentation>{
       
   215 \begin{frame}[t]
       
   216 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}}
       
   217 
       
   218 \mbox{}\\[10mm]
       
   219 
       
   220 \begin{enumerate}
       
   221 \item given an URL, read the corresponding webpage
       
   222 \item extract all links from it
       
   223 \item call the web-crawler again for all these links
       
   224 \end{enumerate}
       
   225 
       
   226 \end{frame}}
       
   227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   228 
       
   229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   230 \mode<presentation>{
       
   231 \begin{frame}[t]
       
   232 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}}
       
   233 
       
   234 \mbox{}\\[10mm]
       
   235 
       
   236 
       
   237 \begin{enumerate}
       
   238 \item given an URL, read the corresponding webpage
       
   239 \item if not possible print, out a problem
       
   240 \item if possible, extract all links from it
       
   241 \item call the web-crawler again for all these links
       
   242 \end{enumerate}\bigskip\pause
       
   243 
       
   244 \small (we need a bound for the number of recursive calls)
       
   245 
       
   246 \small (the purpose is to check all links on my own webpage)
       
   247 \end{frame}}
       
   248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   249 
       
   250 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   251 \mode<presentation>{
       
   252 \begin{frame}[c]
       
   253 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
       
   254 
       
   255 \footnotesize a simple Scala function for reading webpages\\[-3mm]
       
   256 
       
   257 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   258 \texttt{\lstinputlisting{app0.scala}}}\pause
       
   259 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   260 \texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
       
   261 
       
   262 
       
   263 \footnotesize slightly more complicated for handling errors properly:\\[-3mm]
       
   264 
       
   265 \footnotesize
       
   266 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   267 \texttt{\lstinputlisting{app1.scala}}}
       
   268 
       
   269 
       
   270 \end{frame}}
       
   271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   272 
       
   273 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   274 \mode<presentation>{
       
   275 \begin{frame}[t]
       
   276 \frametitle{\begin{tabular}{c}A Regular Expression\end{tabular}}
       
   277 
       
   278 \begin{itemize}
       
   279 \item \ldots{} is a pattern or template for specifying strings
       
   280 \end{itemize}\bigskip
       
   281   
       
   282 \begin{center}  
       
   283 \only<1>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   284 \texttt{"https?://[$\hat{\hspace{2mm}}$"]*"}}}%
       
   285 \only<2>{{\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   286 \texttt{"""\textbackslash{}"https?://[$\hat{\hspace{2mm}}$\textbackslash{}"]*\textbackslash{}"""".r}}}
       
   287 \end{center}\bigskip\bigskip
       
   288 
       
   289 matches for example\\  
       
   290 \;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
       
   291 \texttt{"http://www.foobar.com"}}\\
       
   292 \;{\lstset{language=Scala}\fontsize{12}{14}\selectfont\bf
       
   293 \texttt{"https://www.tls.org"}}\\
       
   294 
       
   295 \end{frame}}
       
   296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   297 
       
   298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   299 \mode<presentation>{
       
   300 \begin{frame}[c]
       
   301 
       
   302 {\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   303 \texttt{rexp.findAllIn(string)}}\medskip
       
   304   
       
   305 returns a list of all (sub)strings that match the regular expression\bigskip\bigskip  
       
   306   
       
   307 {\lstset{language=Scala}\fontsize{18}{19}\selectfont\bf
       
   308 \texttt{rexp.findFirstIn(string)}}\medskip
       
   309   
       
   310 returns either {\bf\texttt{None}} if no (sub)string matches 
       
   311 or {\bf\texttt{Some(s)}} with the first (sub)string
       
   312   
       
   313 \end{frame}}
       
   314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   315 
       
   316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   317 \mode<presentation>{
       
   318 \begin{frame}[c]
       
   319 
       
   320 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   321 \texttt{\lstinputlisting{app2.scala}}}\medskip
       
   322 
       
   323 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   324 \texttt{crawl(some\_start\_URL, 2)}}\
       
   325 
       
   326 \end{frame}}
       
   327 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   328 
       
   329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   330 \mode<presentation>{
       
   331 \begin{frame}[c]
       
   332 
       
   333 \footnotesize
       
   334 a version that only ``crawls'' links in my domain:
       
   335 
       
   336 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   337 \texttt{\lstinputlisting{app3.scala}}}
       
   338 
       
   339 
       
   340 \end{frame}}
       
   341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   342 
       
   343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   344 \mode<presentation>{
       
   345 \begin{frame}[c]
       
   346 
       
   347 \footnotesize
       
   348 a little email ``harvester'':
       
   349 
       
   350 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   351 \texttt{\lstinputlisting{app4.scala}}}\bigskip
       
   352 
       
   353 \tiny
       
   354 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
       
   355 
       
   356 \end{frame}}
       
   357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   358 
       
   359 \newcommand{\bl}[1]{\textcolor{blue}{#1}}       
       
   360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   361 \mode<presentation>{
       
   362 \begin{frame}[c]
       
   363 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
       
   364 
       
   365 \begin{textblock}{6}(2,4)
       
   366   \begin{tabular}{@ {}rrl@ {\hspace{13mm}}l}
       
   367   \bl{r} & \bl{$::=$}  & \bl{$\varnothing$}  & null\\
       
   368          & \bl{$\mid$} & \bl{$\epsilon$}        & empty string / ""\\
       
   369          & \bl{$\mid$} & \bl{c}                         & character\\
       
   370          & \bl{$\mid$} & \bl{r$_1$ $\cdot$ r$_2$} & sequence\\
       
   371          & \bl{$\mid$} & \bl{r$_1$ + r$_2$}  & alternative / choice\\
       
   372          & \bl{$\mid$} & \bl{r$^*$}                   & star (zero or more)\\
       
   373   \end{tabular}
       
   374   \end{textblock}
       
   375   
       
   376 \end{frame}}
       
   377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   378 
       
   379 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   380 \mode<presentation>{
       
   381 \begin{frame}[t]
       
   382 \frametitle{\begin{tabular}{c}Regular Expressions\end{tabular}}
       
   383 
       
   384 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   385 \texttt{\lstinputlisting{app4.scala}}}
       
   386 
       
   387   
       
   388 \end{frame}}
       
   389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   390 
       
   391 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions
       
   392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   393 \mode<presentation>{
       
   394 \begin{frame}[c]
       
   395 \frametitle{\begin{tabular}{c}The Meaning of a\\[-2mm] Regular Expression\end{tabular}}
       
   396 
       
   397 \begin{textblock}{6}(2,4)
       
   398  \begin{tabular}{@ {}rcl}
       
   399  \bl{$L$($\varnothing$)}  & \bl{$\dn$} & \bl{$\varnothing$}\\
       
   400  \bl{$L$($\epsilon$)}        & \bl{$\dn$} & \bl{$\{$""$\}$}\\
       
   401  \bl{$L$(c)}                         & \bl{$\dn$} & \bl{$\{$"c"$\}$}\\
       
   402  \bl{$L$(r$_1$ + r$_2$)} & \bl{$\dn$} & \bl{$L$(r$_1$) $\cup$ $L$(r$_2$)}\\
       
   403  \bl{$L$(r$_1$ $\cdot$ r$_2$)}  & \bl{$\dn$} & \bl{$\{$ s$_1$ @ s$_2$ $|$ s$_1$ $\in$ }\\
       
   404  \bl{$L$(r$^*$)}                   & \bl{$\dn$} \\
       
   405   \end{tabular}
       
   406   \end{textblock}
       
   407   
       
   408 \end{frame}}
       
   409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   410 
       
   411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   412 \mode<presentation>{
       
   413 \begin{frame}[c]
       
   414 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
       
   415 
       
   416 We will have a look at
       
   417 
       
   418 \begin{itemize}
   199 \item regular expression / regular expression matching
   419 \item regular expression / regular expression matching
   200 \item a bit of sets (of strings)
   420 \item a bit of sets (of strings)
   201 \item automata
   421 \item automata
   202 \item the Myhill-Nerode theorem
   422 \item the Myhill-Nerode theorem
   203 \item parsing
   423 \item parsing
   206 \end{itemize}
   426 \end{itemize}
   207 
   427 
   208 \end{frame}}
   428 \end{frame}}
   209 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   210 
   430 
   211 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   212 \mode<presentation>{
       
   213 \begin{frame}[c]
       
   214 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
       
   215 
       
   216 \begin{itemize}
       
   217 \item the ultimate goal is to implement a small web-browser (really small)\bigskip
       
   218 \end{itemize}
       
   219 
       
   220 Let's start with:
       
   221 
       
   222 \begin{itemize}
       
   223 \item a web-crawler
       
   224 \item an email harvester
       
   225 \item a web-scraper
       
   226 \end{itemize}
       
   227 
       
   228 \end{frame}}
       
   229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   230 
       
   231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   232 \mode<presentation>{
       
   233 \begin{frame}[c]
       
   234 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}}
       
   235 
       
   236 \begin{enumerate}
       
   237 \item given an URL, read the corresponding webpage
       
   238 \item extract all links from it
       
   239 \item call the web-crawler again for all these links
       
   240 \end{enumerate}
       
   241 
       
   242 \end{frame}}
       
   243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   244 
       
   245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   246 \mode<presentation>{
       
   247 \begin{frame}[c]
       
   248 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}}
       
   249 
       
   250 \begin{enumerate}
       
   251 \item given an URL, read the corresponding webpage
       
   252 \item if not possible print, out a problem
       
   253 \item if possible, extract all links from it
       
   254 \item call the web-crawler again for all these links
       
   255 \end{enumerate}\bigskip\pause
       
   256 
       
   257 \small (we need to bound the number of recursive calls)
       
   258 
       
   259 \small (the purpose is to check all links on my own webpage)
       
   260 \end{frame}}
       
   261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   262 
       
   263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   264 \mode<presentation>{
       
   265 \begin{frame}[c]
       
   266 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
       
   267 
       
   268 \footnotesize a simple Scala function for reading webpages\\[-3mm]
       
   269 
       
   270 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   271 \texttt{\lstinputlisting{app0.scala}}}\pause\bigskip
       
   272 
       
   273 \footnotesize slightly more complicated for handling errors:\\[-3mm]
       
   274 
       
   275 \footnotesize
       
   276 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   277 \texttt{\lstinputlisting{app1.scala}}}
       
   278 
       
   279 
       
   280 \end{frame}}
       
   281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   282 
       
   283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   284 \mode<presentation>{
       
   285 \begin{frame}[c]
       
   286 
       
   287 
       
   288   
       
   289 \end{frame}}
       
   290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   291 
       
   292 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   293 \mode<presentation>{
       
   294 \begin{frame}[c]
       
   295 \frametitle{\begin{tabular}{c}Cookies\end{tabular}}
       
   296 
       
   297 
       
   298 \begin{textblock}{1}(1.5,5)
       
   299 \begin{tabular}{c}
       
   300 %\includegraphics[scale=0.15]{pics/servers.png}\\[-2mm]
       
   301 \small Servers from\\[-2mm] 
       
   302 \small Dot.com Inc.
       
   303 \end{tabular}
       
   304 \end{textblock}
       
   305 
       
   306 \begin{textblock}{1}(5.6,5.6)
       
   307   \begin{tikzpicture}[scale=2.5]
       
   308   \draw[white] (0,0) node (X) {};
       
   309   \draw[white] (1,0) node (Y) {};
       
   310   \draw[white] (0.05,-0.3) node (X1) {};
       
   311   \draw[white] (0.95,-0.3) node (Y1) {};
       
   312   \only<1-2>{\draw[red, <-, line width = 2mm] (X) -- (Y);
       
   313   \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {};}
       
   314   \only<1>{\draw[white, <-, line width = 1mm] (X1) -- (Y1);
       
   315   \node [inner sep=2pt,label=below:\textcolor{white}{read a cookie}] at ($ (X1)!.5!(Y1) $) {};}
       
   316   \only<2>{\draw[red, <-, line width = 1mm] (X1) -- (Y1);
       
   317   \node [inner sep=2pt,label=below:\textcolor{black}{read a cookie}] at ($ (X1)!.5!(Y1) $) {};}
       
   318   \only<3->{\draw[red, ->, line width = 2mm] (X) -- (Y);
       
   319   \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X)!.5!(Y) $) {};}
       
   320   \only<3->{\draw[red, ->, line width = 1mm] (X1) -- (Y1);
       
   321   \node [inner sep=2pt,label=below:\textcolor{black}{write a cookie}] at ($ (X1)!.5!(Y1) $) {};}
       
   322   \end{tikzpicture}
       
   323 \end{textblock}
       
   324 
       
   325 
       
   326 \begin{textblock}{1}(9.5,5.5)
       
   327 \begin{tabular}{c}
       
   328 %\includegraphics[scale=0.15]{pics/laptop.png}\\[-2mm]
       
   329 \small Client
       
   330 \end{tabular}
       
   331 \end{textblock}
       
   332   
       
   333 \only<4->{  
       
   334 \begin{textblock}{13}(1,11)  
       
   335 \small\begin{itemize}
       
   336 \item cookies: max 4KB data\\[-2mm]
       
   337 \item cookie theft, cross-site scripting attacks\\[-2mm]
       
   338 \item session cookies, persistent cookies, HttpOnly cookies, third-party cookies, zombie cookies 
       
   339 \end{itemize}  
       
   340 \end{textblock}}
       
   341 
       
   342 \only<5>{
       
   343 \begin{textblock}{11}(1,3)
       
   344 \begin{tikzpicture}
       
   345 \draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
       
   346 {\normalsize\color{darkgray}
       
   347 \begin{minipage}{10cm}\raggedright\small
       
   348 {\bf EU Privacy Directive about Cookies:}\smallskip\\
       
   349 ``In May 2011, a European Union law was passed stating that websites that leave non-essential cookies on visitors' devices have to alert the visitor and get acceptance from them. This law applies to both individuals and businesses based in the EU regardless of the nationality of their website's visitors or the location of their web host. It is not enough to simply update a website's terms and conditions or privacy policy. The deadline to comply with the new EU cookie law was 26th May 2012 and failure to do so could mean a fine of up to \pounds{}500,000.''
       
   350 \hfill\small\textcolor{gray}{$\rightarrow$BBC News}
       
   351 \end{minipage}};
       
   352 \end{tikzpicture}
       
   353 \end{textblock}}
       
   354   
       
   355 \end{frame}}
       
   356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   357 
       
   358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   359 \mode<presentation>{
       
   360 \begin{frame}[t]
       
   361 \begin{itemize}
       
   362 \item While cookies are per web-page, this can be easily circumvented.
       
   363 \end{itemize}
       
   364 
       
   365 \begin{textblock}{1}(1.5,4.5)
       
   366 \begin{tabular}{c}
       
   367 %\includegraphics[scale=0.07]{pics/servers.png}\\[-2mm]
       
   368 \small Pet Store\\[-2mm] 
       
   369 \small Dot.com\\[-2mm] 
       
   370 \end{tabular}
       
   371 \end{textblock}
       
   372   
       
   373 \begin{textblock}{1}(1.5,8)
       
   374 \begin{tabular}{c}
       
   375 %\includegraphics[scale=0.07]{pics/servers.png}\\[-2mm]
       
   376 \small Dating.com
       
   377 \end{tabular}
       
   378 \end{textblock}  
       
   379 
       
   380 \begin{textblock}{1}(10.5,7.5)
       
   381 \begin{tabular}{c}
       
   382 %\includegraphics[scale=0.07]{pics/servers.png}\\[-2mm]
       
   383 \small Evil-Ad-No\\[-2mm]
       
   384 \small Privacy.com
       
   385 \end{tabular}
       
   386 \end{textblock}  
       
   387 
       
   388 \begin{textblock}{1}(6,10.5)
       
   389 \begin{tabular}{c}
       
   390 %\includegraphics[scale=0.16]{pics/rman.png}\\[-1mm]
       
   391 \small you
       
   392 \end{tabular}
       
   393 \end{textblock}  
       
   394 
       
   395 \begin{textblock}{1}(4,5)
       
   396   \begin{tikzpicture}[scale=1]
       
   397   \draw[white] (0,0.5) node (X) {};
       
   398   \draw[white] (5.7,-1) node (Y) {};
       
   399   \draw[red, ->, line width = 0.5mm] (X) -- (Y);
       
   400   \node [inner sep=5pt,label=above:\textcolor{black}{}] at ($ (X)!.5!(Y) $) {};
       
   401   \end{tikzpicture}
       
   402 \end{textblock}
       
   403 
       
   404 \begin{textblock}{1}(4,7.9)
       
   405   \begin{tikzpicture}[scale=1]
       
   406   \draw[white] (0,0) node (X) {};
       
   407   \draw[white] (5.7,0) node (Y) {};
       
   408   \draw[red, ->, line width = 0.5mm] (X) -- (Y);
       
   409   \node [inner sep=5pt,label=above:\textcolor{black}{}] at ($ (X)!.5!(Y) $) {};
       
   410   \end{tikzpicture}
       
   411 \end{textblock}
       
   412 
       
   413 \begin{textblock}{1}(3.3,9.3)
       
   414   \begin{tikzpicture}[scale=1.2]
       
   415   \draw[white] (0,0) node (X) {};
       
   416   \draw[white] (1.5,-1) node (Y) {};
       
   417   \draw[red, <->, line width = 2mm] (X) -- (Y);
       
   418   \node [inner sep=5pt,label=above:\textcolor{black}{}] at ($ (X)!.5!(Y) $) {};
       
   419   \draw[white] (0.9,0.3) node (X1) {};
       
   420   \draw[white] (1.9,-1) node (Y1) {};
       
   421   \draw[red, <->, line width = 2mm] (X1) -- (Y1);
       
   422   \node [inner sep=5pt,label=above:\textcolor{black}{}] at ($ (X1)!.5!(Y1) $) {};
       
   423   \end{tikzpicture}
       
   424 \end{textblock}  
       
   425 
       
   426 \begin{textblock}{1}(8.6,10.1)
       
   427   \begin{tikzpicture}[scale=0.9]
       
   428   \draw[white] (0,0) node (X) {};
       
   429   \draw[white] (-2,-1) node (Y) {};
       
   430   \draw[red, <->, line width = 0.5mm] (X) -- (Y);
       
   431   \node [inner sep=5pt,label=above:\textcolor{black}{}] at ($ (X)!.5!(Y) $) {};
       
   432   \end{tikzpicture}
       
   433 \end{textblock}
       
   434 
       
   435 
       
   436 
       
   437 \end{frame}}
       
   438 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   439 
       
   440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   441 \mode<presentation>{
       
   442 \begin{frame}[c]
       
   443 \frametitle{\begin{tabular}{c}My First Webapp\end{tabular}}
       
   444 
       
   445 {\bf GET request:}\smallskip
       
   446 \begin{enumerate}
       
   447 \item read the cookie from client
       
   448 \item if none is present, set \texttt{visits} to \textcolor{blue}{$0$}
       
   449 \item if cookie is present, extract \texttt{visits} counter
       
   450 \item if \texttt{visits} is greater or equal \textcolor{blue}{$10$}, \\
       
   451 print a valued customer message\\
       
   452 otherwise just a normal message
       
   453 \item increase \texttt{visits} by \textcolor{blue}{$1$} and store new cookie with client
       
   454 \end{enumerate}
       
   455 
       
   456   
       
   457 \end{frame}}
       
   458 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   459 
       
   460 
       
   461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   462 \mode<presentation>{
       
   463 \begin{frame}[c]
       
   464 \mbox{}\\[-9mm]
       
   465 
       
   466 %{\lstset{language=Scala}\fontsize{8}{10}\selectfont
       
   467 %\texttt{\lstinputlisting{app2.scala}}}
       
   468 
       
   469 \footnotesize
       
   470 \begin{itemize}
       
   471 \item cookie value encoded as hash
       
   472 \end{itemize}
       
   473 \end{frame}}
       
   474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   475 
       
   476 
   431 
   477 
   432 
   478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   433 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   479 \mode<presentation>{
   434 \mode<presentation>{
   480 \begin{frame}[c]
   435 \begin{frame}[c]