slides/slides01.tex
changeset 95 dbe49327b6c5
parent 93 4794759139ea
child 97 60a3ba90dd53
equal deleted inserted replaced
94:9ea667baf097 95:dbe49327b6c5
     1 \documentclass[dvipsnames,14pt,t]{beamer}
     1 \documentclass[dvipsnames,14pt,t,xelatex]{beamer}
     2 \usepackage{beamerthemeplainculight}
     2 \usepackage{beamerthemeplaincu}
     3 \usepackage[T1]{fontenc}
     3  \usepackage{fontenc,xltxtra,xunicode}
     4 \usepackage[latin1]{inputenc}
     4 \defaultfontfeatures{Mapping=tex-text}
     5 \usepackage{mathpartir}
     5 \usepackage{mathpartir}
     6 \usepackage[absolute,overlay]{textpos}
     6 \usepackage[absolute,overlay]{textpos}
     7 \usepackage{ifthen}
     7 \usepackage{ifthen}
     8 \usepackage{tikz}
     8 \usepackage{tikz}
     9 \usepackage{pgf}
     9 \usepackage{pgf}
    10 \usepackage{calc} 
    10 \usepackage{calc} 
    11 \usepackage{ulem}
    11 \usepackage{ulem}
    12 \usepackage{courier}
    12 %%\usepackage{courier}
    13 \usepackage{listings}
    13 \usepackage{listings}
    14 \renewcommand{\uline}[1]{#1}
    14 \renewcommand{\uline}[1]{#1}
    15 \usetikzlibrary{arrows}
    15 \usetikzlibrary{arrows}
    16 \usetikzlibrary{automata}
    16 \usetikzlibrary{automata}
    17 \usetikzlibrary{shapes}
    17 \usetikzlibrary{shapes}
    22 
    22 
    23 \definecolor{javared}{rgb}{0.6,0,0} % for strings
    23 \definecolor{javared}{rgb}{0.6,0,0} % for strings
    24 \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
    24 \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
    25 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
    25 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
    26 \definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
    26 \definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
       
    27 
       
    28 \makeatletter
       
    29 \lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
       
    30 \@empty\z@\@empty
       
    31 \makeatother
    27 
    32 
    28 \lstset{language=Java,
    33 \lstset{language=Java,
    29 	basicstyle=\ttfamily,
    34 	basicstyle=\ttfamily,
    30 	keywordstyle=\color{javapurple}\bfseries,
    35 	keywordstyle=\color{javapurple}\bfseries,
    31 	stringstyle=\color{javagreen},
    36 	stringstyle=\color{javagreen},
    94 
    99 
    95 \normalsize
   100 \normalsize
    96   \begin{center}
   101   \begin{center}
    97   \begin{tabular}{ll}
   102   \begin{tabular}{ll}
    98   Email:  & christian.urban at kcl.ac.uk\\
   103   Email:  & christian.urban at kcl.ac.uk\\
    99   Of$\!$fice: & S1.27 (1st floor Strand Building)\\
   104   Office: & S1.27 (1st floor Strand Building)\\
   100   Slides: & KEATS
   105   Slides: & KEATS
   101   \end{tabular}
   106   \end{tabular}
   102   \end{center}
   107   \end{center}
   103 
   108 
   104 
   109 
   194 \mode<presentation>{
   199 \mode<presentation>{
   195 \begin{frame}[c]
   200 \begin{frame}[c]
   196 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
   201 \frametitle{\begin{tabular}{c}This Course\end{tabular}}
   197 
   202 
   198 \begin{itemize}
   203 \begin{itemize}
   199 \item the ultimate goal is to implement a small web-browser (really small one)\bigskip
   204 \item the ultimate goal is to implement a small compiler (really small one)\bigskip
   200 \end{itemize}
   205 \end{itemize}
   201 
   206 
   202 Let's start with:
   207 Let's start with:
   203 
   208 
   204 \begin{itemize}
   209 \begin{itemize}
   253 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
   258 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
   254 
   259 
   255 \footnotesize a simple Scala function for reading webpages\\[-3mm]
   260 \footnotesize a simple Scala function for reading webpages\\[-3mm]
   256 
   261 
   257 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   262 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   258 \texttt{\lstinputlisting{app0.scala}}}\pause
   263 \texttt{\lstinputlisting{../progs/app0.scala}}}\pause
   259 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   264 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   260 \texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
   265 \texttt{\lstinline{get_page("""http://www.inf.kcl.ac.uk/staff/urbanc/""")}}}\pause\bigskip
   261 
   266 
   262 
   267 
   263 \footnotesize slightly more complicated for handling errors properly:\\[-3mm]
   268 \footnotesize slightly more complicated for handling errors properly:\\[-3mm]
   264 
   269 
   265 \footnotesize
   270 \footnotesize
   266 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   271 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   267 \texttt{\lstinputlisting{app1.scala}}}
   272 \texttt{\lstinputlisting{../progs/app1.scala}}}
   268 
   273 
   269 
   274 
   270 \end{frame}}
   275 \end{frame}}
   271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   272 
   277 
   316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   317 \mode<presentation>{
   322 \mode<presentation>{
   318 \begin{frame}[c]
   323 \begin{frame}[c]
   319 
   324 
   320 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   325 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   321 \texttt{\lstinputlisting{app2.scala}}}\medskip
   326 \texttt{\lstinputlisting{../progs/app2.scala}}}\medskip
   322 
   327 
   323 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   328 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   324 \texttt{crawl(some\_start\_URL, 2)}}\
   329 \texttt{crawl(some\_start\_URL, 2)}}\
   325 
   330 
   326 \end{frame}}
   331 \end{frame}}
   332 
   337 
   333 \footnotesize
   338 \footnotesize
   334 a version that only ``crawls'' links in my domain:
   339 a version that only ``crawls'' links in my domain:
   335 
   340 
   336 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   341 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   337 \texttt{\lstinputlisting{app3.scala}}}
   342 \texttt{\lstinputlisting{../progs/app3.scala}}}
   338 
   343 
   339 
   344 
   340 \end{frame}}
   345 \end{frame}}
   341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   342 
   347 
   346 
   351 
   347 \footnotesize
   352 \footnotesize
   348 a little email ``harvester'':
   353 a little email ``harvester'':
   349 
   354 
   350 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   355 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   351 \texttt{\lstinputlisting{app4.scala}}}\bigskip
   356 \texttt{\lstinputlisting{../progs/app4.scala}}}\bigskip
   352 
   357 
   353 \tiny
   358 \tiny
   354 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
   359 \textcolor{gray}{\url{http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/}}
   355 
   360 
   356 \end{frame}}
   361 \end{frame}}
   386 \small
   391 \small
   387 In Scala:
   392 In Scala:
   388 
   393 
   389 
   394 
   390 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   395 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   391 \texttt{\lstinputlisting{app51.scala}}}
   396 \texttt{\lstinputlisting{../progs/app51.scala}}}
   392 
   397 
   393   
   398   
   394 \end{frame}}
   399 \end{frame}}
   395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   396 
   401