slides01.tex
changeset 1 4856ff72a64b
parent 0 8d6145cea799
child 2 baa2e2231f50
equal deleted inserted replaced
0:8d6145cea799 1:4856ff72a64b
    16 \usetikzlibrary{automata}
    16 \usetikzlibrary{automata}
    17 \usetikzlibrary{shapes}
    17 \usetikzlibrary{shapes}
    18 \usetikzlibrary{shadows}
    18 \usetikzlibrary{shadows}
    19 \usetikzlibrary{positioning}
    19 \usetikzlibrary{positioning}
    20 \usetikzlibrary{calc}
    20 \usetikzlibrary{calc}
    21 
       
    22 %%%\usetikzlibrary{mindmap}
       
    23 
       
    24 \usepackage{graphicx} 
    21 \usepackage{graphicx} 
    25 
    22 
    26 \definecolor{javared}{rgb}{0.6,0,0} % for strings
    23 \definecolor{javared}{rgb}{0.6,0,0} % for strings
    27 \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
    24 \definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
    28 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
    25 \definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
    72 	tabsize=2,
    69 	tabsize=2,
    73 	showspaces=false,
    70 	showspaces=false,
    74 	showstringspaces=false}
    71 	showstringspaces=false}
    75 
    72 
    76 % beamer stuff 
    73 % beamer stuff 
    77 \renewcommand{\slidecaption}{Scala, King's College London, 27.~March 2012}
    74 \renewcommand{\slidecaption}{APP 01, King's College London, 25.~September 2012}
    78 
    75 
    79 
    76 
    80 \begin{document}
    77 \begin{document}
    81 
    78 
    82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    83 \mode<presentation>{
    80 \mode<presentation>{
    84 \begin{frame}<1>[t]
    81 \begin{frame}<1>[t]
    85 \frametitle{%
    82 \frametitle{%
    86 \begin{tabular}{@ {\hspace{-3mm}}c@ {}}
    83   \begin{tabular}{@ {}c@ {}}
    87 \\
    84   \LARGE Access Control and \\[-3mm] 
    88 \large \textcolor{black}{PRA, Programming Applications:}\\[5mm]
    85   \LARGE Privacy Policies (1)\\[-6mm] 
    89 \Huge Scala\\[-1mm]
    86   \end{tabular}}
    90 \large ``Better Java'' for Programming the JVM\\[5mm]
    87 
    91 \normalsize \textcolor{black}{Christian Urban}
    88   \begin{center}
    92 \end{tabular}}
    89   \includegraphics[scale=1.3]{pics/barrier.jpg}
       
    90   \end{center}
       
    91 
       
    92 \normalsize
       
    93   \begin{center}
       
    94   \begin{tabular}{ll}
       
    95   Email:  & christian.urban at kcl.ac.uk\\
       
    96   Office: & S1.27 (1st floor Strand Building)\\
       
    97   Slides: & KEATS
       
    98   \end{tabular}
       
    99   \end{center}
       
   100 
       
   101 
    93 \end{frame}}
   102 \end{frame}}
    94  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   103  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    95 
   104 
    96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   105 
    97 \mode<presentation>{
   106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    98 \begin{frame}[c]
   107 \mode<presentation>{
    99 \frametitle{\begin{tabular}{c}1.~Reason\end{tabular}}
   108 \begin{frame}[c]
   100 
   109 \frametitle{\begin{tabular}{@ {}c@ {}}Security Engineers\end{tabular}}
   101 \begin{textblock}{6}(1,3)
   110 
   102 \begin{tabular}{l}
   111 According to Bruce Schneier, {\bf security engineers} require
   103 \mbox{}\hspace{-1mm}\includegraphics[scale=0.36]{twitter.png}\\[-1mm]
   112 a particular {\bf mindset}:\bigskip
   104 \includegraphics[scale=0.30]{linked.png}\\
   113 
   105 \includegraphics[scale=0.30]{guardian.jpg}\\[-3mm]
       
   106 \mbox{}\hspace{-2mm}\includegraphics[scale=0.38]{morgan.png}\\[-3mm]
       
   107 \includegraphics[scale=0.30]{suisse.png}\\
       
   108 \includegraphics[scale=0.20]{edf.png}\\[-1mm]
       
   109 \includegraphics[scale=0.08]{novell.png}\\[-1mm]
       
   110 \includegraphics[scale=0.30]{foursquare.png}\\
       
   111 \includegraphics[scale=0.30]{hsbc.png}\\
       
   112 {\large\bf ...}
       
   113 \end{tabular}
       
   114 \end{textblock}
       
   115  
       
   116 \only<2->{  
       
   117 \begin{textblock}{6}(6,3)
       
   118 \includegraphics[scale=0.35]{jobgraph.png}\\
       
   119 \end{textblock}}  
       
   120   
       
   121 \only<3->{  
       
   122 \begin{textblock}{6}(7.3,9.2)
       
   123 \begin{tabular}{l}
       
   124 \footnotesize 2013: 1$\%$\\[-2mm]
       
   125 \footnotesize 2014: 3$\%$\\[-2mm]
       
   126 \footnotesize 2015: 9$\%$\\[-2mm]
       
   127 \footnotesize 2016: 27$\%$\\[-2mm]
       
   128 \footnotesize 2017: 81$\%$\\[-2mm]
       
   129 \footnotesize 2018: 243$\%$ \raisebox{-1mm}{\includegraphics[scale=0.02]{smiley.jpg}}
       
   130 \end{tabular}
       
   131 \end{textblock}}  
       
   132   
       
   133 \only<3->{  
       
   134 \begin{textblock}{6}(6,9.5)
       
   135 \footnotesize 5 yrs $\begin{cases}\mbox{}\\[1.4cm]\end{cases}$
       
   136 \end{textblock}}
       
   137 
       
   138 \only<4->{  
       
   139 \begin{textblock}{11}(5,14.1)
       
   140 \textcolor{gray}{
       
   141 \footnotesize {\bf in London today:} 1 Scala job for every 30 Java jobs;\\[-2mm]
       
   142 Scala programmers seem to get up to 20\% better salary}
       
   143 \end{textblock}}
       
   144   
       
   145 \end{frame}}
       
   146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   147 
       
   148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   149 \mode<presentation>{
       
   150 \begin{frame}[c]
       
   151 \frametitle{\begin{tabular}{c}2.~Reason\end{tabular}}
       
   152 
       
   153 \begin{textblock}{11}(1,7)
       
   154 \begin{tikzpicture}[scale=1.0]
       
   155 %\draw[step=2mm] (-1,-1) grid (10,1);
       
   156 \draw[->, line width=2mm] (-0.2,0) -- (11,0);
       
   157 \draw[line width=0.8mm] (0,0) -- (0,-0.3);
       
   158 \node at (0,-0.5) [black] {\footnotesize 1985};
       
   159 \draw[line width=0.8mm] (2.8,0) -- (2.8,-0.3);
       
   160 \node at (2.8,-0.5) [black] {\footnotesize 1992};
       
   161 \draw[line width=0.8mm] (1.2,0) -- (1.2,-0.3);
       
   162 \node at (1.2,-0.5) [black] {\footnotesize 1988};
       
   163 \draw[line width=0.8mm] (4.8,0) -- (4.8,-0.3);
       
   164 \node at (4.8,-0.5) [black] {\footnotesize 1997};
       
   165 \draw[line width=0.8mm] (6,0) -- (6,-0.3);
       
   166 \node at (6,-0.5) [black] {\footnotesize 2000};
       
   167 \draw[line width=0.8mm] (7.6,0) -- (7.6,-0.3);
       
   168 \node at (7.6,-0.5) [black] {\footnotesize 2004};
       
   169 \draw[line width=0.8mm] (10.4,0) -- (10.4,-0.3);
       
   170 \node at (10.4,-0.5) [black] {\footnotesize 2011};
       
   171 \end{tikzpicture}
       
   172 \end{textblock}
       
   173 
       
   174 \begin{textblock}{5}(1,9)
       
   175 \small Basic\\[-1mm]
       
   176 Assembler\\
       
   177 \end{textblock}
       
   178 \begin{textblock}{5}(2.8,11)
       
   179 \small Pascal\\[-1mm]
       
   180 C\\
       
   181 \end{textblock}
       
   182 \begin{textblock}{5}(4.3,9)
       
   183 \small Modula 3\\[-1mm]
       
   184 C++\\
       
   185 \end{textblock}
       
   186 \begin{textblock}{5}(6.7,9)
       
   187 \small $\lambda$Prolog\\
       
   188 \end{textblock}
       
   189 \begin{textblock}{5}(8.6,9)
       
   190 \small Ocaml\\[-1mm]
       
   191 \small SMLj\\[-1mm]
       
   192 \small Pizza
       
   193 \end{textblock}
       
   194 \begin{textblock}{5}(10.6,9)
       
   195 \normalsize\bf SML\\[-1mm]
       
   196 \end{textblock}
       
   197 \begin{textblock}{5}(14,9)
       
   198 \small Scala\\
       
   199 \end{textblock}
       
   200 \begin{textblock}{5}(13.2,11)
       
   201 \small \underline{Future?}\\[0mm]
       
   202 \small Python\\[-1mm]
       
   203 \small Ruby\\[-1mm]
       
   204 \small Javascript\\
       
   205 \end{textblock}
       
   206 
       
   207 \begin{textblock}{5}(0.2,2)
       
   208 \includegraphics[scale=0.30]{punch.jpg}\\
       
   209 \end{textblock}
       
   210 \begin{textblock}{5}(0.4,4.5)
       
   211 \includegraphics[scale=0.20]{plus4.jpg}\\
       
   212 \end{textblock}
       
   213 \begin{textblock}{5}(2.8,2.1)
       
   214 \includegraphics[scale=0.15]{robotron.jpg}\\
       
   215 \end{textblock}
       
   216 \begin{textblock}{5}(5.0,3.7)
       
   217 \includegraphics[scale=0.10]{sparc.jpg}\\
       
   218 \end{textblock}
       
   219 \begin{textblock}{5}(8.0,4)
       
   220 \includegraphics[scale=0.40]{titanium.jpg}\\
       
   221 \end{textblock}
       
   222 \begin{textblock}{5}(12,4.5)
       
   223 \includegraphics[scale=0.10]{air.jpg}\\
       
   224 \end{textblock}
       
   225 \end{frame}}
       
   226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
       
   227 
       
   228 
       
   229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   230 \mode<presentation>{
       
   231 \begin{frame}[c]
       
   232 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   233 
       
   234 \large
       
   235 \begin{itemize}
       
   236 \item compiles to JVM (.Net \& Android)\bigskip
       
   237 \item integrates seamlessly with Java (Swing)\bigskip
       
   238 \end{itemize}
       
   239   
       
   240 \end{frame}}
       
   241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   242 
       
   243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   244 \mode<presentation>{
       
   245 \begin{frame}[c]
       
   246 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   247 
       
   248 \large
       
   249 \begin{itemize}
       
   250 \item combines {\bf functional} and {\bf object-oriented} programming
       
   251 \end{itemize}
       
   252   
       
   253 \end{frame}}
       
   254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   255 
       
   256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   257 \mode<presentation>{
       
   258 \begin{frame}[c]
       
   259 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   260 
       
   261 
       
   262 \begin{itemize}
       
   263 \item \large {\bf Actors}:\\
       
   264 \normalsize keep asynchronous concurrency simple 
       
   265 \end{itemize}
       
   266   
       
   267 \end{frame}}
       
   268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   269 
       
   270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   271 \mode<presentation>{
       
   272 \begin{frame}[c]
       
   273 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   274 
       
   275 
       
   276 \begin{itemize}
       
   277 \item \large {\bf Immutability}:\\
       
   278 \normalsize keeps concurrency predictable
       
   279 \end{itemize}
       
   280   
       
   281 \end{frame}}
       
   282 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   283 
       
   284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   285 \mode<presentation>{
       
   286 \begin{frame}[c]
       
   287 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   288 
       
   289 
       
   290 \begin{itemize}
       
   291 \item \large {\bf First-Class Functions}:\\
       
   292 \normalsize powerful idea from functional programming
       
   293 \end{itemize}
       
   294   
       
   295 \end{frame}}
       
   296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   297 
       
   298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   299 \mode<presentation>{
       
   300 \begin{frame}[c]
       
   301 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   302 
       
   303 
       
   304 \begin{itemize}
       
   305 \item \large {\bf Pattern-Matching}:\\
       
   306 \normalsize ``keeps your needles out of the haystacks''
       
   307 \end{itemize}
       
   308   
       
   309 \end{frame}}
       
   310 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   311 
       
   312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   313 \mode<presentation>{
       
   314 \begin{frame}[t]
       
   315 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   316 
       
   317 
       
   318 \begin{itemize}
       
   319 \item \large {\bf You can avoid \textcolor{blue}{\texttt{null}}}:
       
   320 \end{itemize}
       
   321 
       
   322 \begin{textblock}{6}(0.5,5)
       
   323   \begin{tikzpicture}
       
   324   \draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
       
   325   { \begin{minipage}{11cm}\raggedright\small
       
   326   	``I call it my billion-dollar mistake. It was the invention of the null reference in 
       
   327 		1965. At that time, I was designing the first comprehensive type system for references in an 
       
   328 		object oriented language (ALGOL W). My goal was to ensure that all use of references should 
       
   329 		be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist 
       
   330 		the temptation to put in a null reference, simply because it was so easy to implement. This has 
       
   331 		led to innumerable errors, vulnerabilities, and system crashes, which have probably caused 
       
   332 		a billion dollars of pain and damage in the last forty years.'' Sir Tony Hoare\end{minipage}};
       
   333 \end{tikzpicture}
       
   334 \end{textblock}
       
   335   
       
   336 \begin{textblock}{5}(11.8,1)
       
   337 \includegraphics[scale=0.20]{hoare.jpg}\\
       
   338 \end{textblock}
       
   339   
       
   340 \end{frame}}
       
   341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   342 
       
   343 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   344 \mode<presentation>{
       
   345 \begin{frame}[c]
       
   346 \frametitle{\begin{tabular}{c}\texttt{null}\end{tabular}}
       
   347 
       
   348 \lstset{language=java}\footnotesize
       
   349 \texttt{\lstinputlisting{MapJavaTester.java}}
       
   350   
       
   351 \end{frame}}
       
   352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   353 
       
   354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   355 \mode<presentation>{
       
   356 \begin{frame}[c]
       
   357 \frametitle{\begin{tabular}{c}Why Scala?\end{tabular}}
       
   358 
       
   359 
       
   360 \begin{itemize}
       
   361 \item \large The Price You Pay with Scala: \textcolor{red}{\bf Complexity}\\
       
   362 \normalsize But it is worth it!
       
   363 \end{itemize}
       
   364   
       
   365 \end{frame}}
       
   366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   367 
       
   368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   369 \mode<presentation>{
       
   370 \begin{frame}[c]
       
   371 \frametitle{\begin{tabular}{c}Java: A Brief History\end{tabular}}
       
   372 
       
   373 \begin{itemize}
       
   374 \item Released in 1995 by James Gosling from \\Sun Microsystems (work started in 1991)\medskip
       
   375 \item derives much of its syntax from C and C++\medskip
       
   376 \item compiles to JVM (``write once, run everywhere'')\medskip
       
   377 \item no pointers --- instead automatic memory management (has a garbage collector)\medskip
       
   378 \item statically typed\\ (``you cannot compare apples with oranges'')
       
   379 \end{itemize}
       
   380   
       
   381 \begin{textblock}{5}(13,2)
       
   382 \includegraphics[scale=0.20]{java.png}\\
       
   383 \end{textblock}
       
   384   
       
   385 \end{frame}}
       
   386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   387 
       
   388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   389 \mode<presentation>{
       
   390 \begin{frame}[c]
       
   391 
       
   392 \lstset{language=java}\fontsize{8}{10}\selectfont
       
   393 \texttt{\lstinputlisting{FruitMain.java}}
       
   394 
       
   395 \only<2>{
       
   396 \begin{textblock}{6}(5,5)
       
   397 \begin{tikzpicture}
   114 \begin{tikzpicture}
   398   \draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
   115 \draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
   399   {\begin{minipage}{8cm}\raggedright\tt\footnotesize
   116 {\normalsize\color{darkgray}
   400 \begin{tabular}{l}
   117 \begin{minipage}{10cm}\raggedright\small
   401 FruitMain.java:20:~incompatible types\\
   118 ``Security engineers --- at least the good ones --- see the world dif$\!$ferently. 
   402 found: Orange\\
   119 They can't walk into a store without noticing how they might shoplift. They can't 
   403 required: Apple\\
   120 use a computer without wondering about the security vulnerabilities. They can't 
   404         a = o;\\
   121 vote without trying to figure out how to vote twice. They just can't help it.''
   405 1 error\\
       
   406 \end{tabular}
       
   407 \end{minipage}};
   122 \end{minipage}};
   408 \end{tikzpicture}
   123 \end{tikzpicture}
   409 \end{textblock}}
   124 
   410 
   125 \begin{flushright}
   411   
   126 \includegraphics[scale=0.0087]{pics/schneierbook1.jpg}\;
   412 \end{frame}}
   127 \includegraphics[scale=0.0087]{pics/schneierbook2.jpg}\;
   413 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   128 \includegraphics[scale=0.85]{pics/schneier.png}
   414 
   129 \end{flushright}
   415 
   130 
   416 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   131 
   417 \mode<presentation>{
   132 \end{frame}}
   418 \begin{frame}[c]
   133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   419 
   134 
   420 \lstset{language=java}\fontsize{8}{10}\selectfont
   135 
   421 \texttt{\lstinputlisting{FruitArray.java}}
   136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   422 
   137 \mode<presentation>{
   423 \only<2>{
   138 \begin{frame}[c]
   424 \begin{textblock}{8}(1,5)
   139 \frametitle{\begin{tabular}{@ {}c@ {}}Yes\ldots\end{tabular}}
       
   140 
   425 \begin{tikzpicture}
   141 \begin{tikzpicture}
   426   \draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
   142 \draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
   427   {\begin{minipage}{11cm}\raggedright\tt\fontsize{8}{10}\selectfont
   143 {\normalsize\color{darkgray}
   428 \begin{tabular}{l}
   144 \begin{minipage}{10cm}\raggedright\small
   429 {\large \rm runtime exception}\\
   145 The Guardian (2006): ``Chip-and-PIN is so effective in this country that fraudsters are starting to move their activities overseas,'' 
   430 orange\\
   146 said Emile Abu-Shakra, spokesman for Lloyds TSB.
   431 Exception in thread "main" java.lang.ArrayStoreException:~Apple\\
       
   432 at FruitArray.main(FruitArray.java:21)\\
       
   433 \end{tabular}
       
   434 \end{minipage}};
   147 \end{minipage}};
   435 \end{tikzpicture}
   148 \end{tikzpicture}\bigskip
   436 \end{textblock}}
   149 
   437 
   150 
   438 
   151 \begin{itemize}
   439 \end{frame}}
   152 \item mag-stripe cards cannot be cloned anymore
   440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   153 \item stolen or cloned cards need to be used abroad 
   441 
   154 \item fraud on lost, stolen and counterfeit credit cards was down \pounds{}60m (24\%) on 2004's figure
   442 
   155 \end{itemize}
   443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   156 
   444 \mode<presentation>{
   157 
   445 \begin{frame}[c]
   158 \end{frame}}
   446 
   159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   447 \begin{itemize}
   160 
   448 \item {\bf In Java a class for students}
   161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   449 \end{itemize}
   162 \mode<presentation>{
   450 
   163 \begin{frame}[c]
   451 {\lstset{language=java}\fontsize{8}{10}\selectfont
   164 \frametitle{\begin{tabular}{c}BUT\ldots\end{tabular}}
   452 \texttt{\lstinputlisting{Student.java}}}
   165 
   453 
   166 
   454 \onslide<2->{
   167 \begin{textblock}{1}(3,4)
   455 \begin{itemize}
   168 \begin{tabular}{c}
   456 \item {\bf Same in Scala}
   169 \includegraphics[scale=0.3]{pics/bank.png}\\[-2mm]
   457 \end{itemize}
   170 \small Bank
   458 
   171 \end{tabular}
   459 {\lstset{language=Scala}\fontsize{8}{10}\selectfont
   172 \end{textblock}
   460 \texttt{\lstinputlisting{Student.scala}}}}
   173 
   461 
   174 \begin{textblock}{1}(7,4.5)
   462 \end{frame}}
   175 \begin{tabular}{c}
   463 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   176 \includegraphics[scale=3]{pics/store.png}\\[-2mm]
   464 
   177 \end{tabular}
   465 
   178 \end{textblock}
   466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   179 
   467 \mode<presentation>{
   180 \only<2->{  
   468 \begin{frame}[c]
   181 \begin{textblock}{1}(12,6.5)
   469 \frametitle{\begin{tabular}{c}Scala\end{tabular}}
   182 \begin{tabular}{c}
   470 
   183 \includegraphics[scale=0.8]{pics/factory.png}\\[-1mm]
   471 \begin{itemize}
   184 \small terminal\\[-2mm] \small producer
   472 \item First released in 2003 (work started in 2001) by Martin Odersky from EPFL in Lausanne\smallskip
   185 \end{tabular}
   473 \item at the moment 2.9.2 (2012)\smallskip
   186 \end{textblock}}  
   474 \item blend of functional and oo-programming\medskip\medskip
   187 
   475 \item Twitter switched in 2009 from Ruby to Scala
   188 \begin{textblock}{1}(4.5,9.9)
   476 \item Guardian switched in 2011 from Java to Scala
   189 \begin{tabular}{c}
   477 \item UBS approved it for general production usage (2011)
   190 \includegraphics[scale=0.16]{pics/rman.png}\\[-1mm]
   478 \end{itemize}
   191 \small costumer / you
   479 
   192 \end{tabular}
   480 
   193 \end{textblock}  
   481 \end{frame}}
   194   
   482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   195 \end{frame}}
   483 
   196 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   484 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   197 
   485 \mode<presentation>{
   198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   486 \begin{frame}[t]
   199 \mode<presentation>{
   487 
   200 \begin{frame}[c]
   488 \only<1>{
   201 \frametitle{\begin{tabular}{c}Chip-and-PIN\end{tabular}}
   489 Hello World in Java:\medskip
   202 
   490 {\lstset{language=Java}\fontsize{12}{14}\selectfont
   203 
   491 \texttt{\lstinputlisting{Hello.java}}}}
   204 \begin{itemize}
   492 \only<2->{
   205 \item ``tamperesitant'' terminal playing Tetris on 
   493 Hello World in Scala:\medskip
   206 \textcolor{blue}{\href{http://www.youtube.com/watch?v=wWTzkD9M0sU}{youtube}}\\
   494 {\lstset{language=Scala}\fontsize{12}{14}\selectfont
   207 \textcolor{lightgray}{\footnotesize(\url{http://www.youtube.com/watch?v=wWTzkD9M0sU})}
   495 \texttt{\lstinputlisting{Hello.scala}}}\bigskip\medskip
   208 \end{itemize}
   496 
   209  
   497 
   210   
   498 Some curiosities, compared to Java:
   211 \includegraphics[scale=0.2]{pics/tetris.jpg}
   499 \begin{itemize}
   212   
   500 \item<3-> The semicolons are missing.
   213   
   501 \item<4-> The {\bf\texttt{public}} access modifier is missing.
   214 \end{frame}}
   502 \item<5-> The declaration of main starts with {\bf\texttt{def}}.
   215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   503 \item<6-> main returns mysterious type {\bf\texttt{Unit}}.
   216 
   504 \item<7-> In Scala there is {\bf\texttt{object}} and {\bf\texttt{class}}.
   217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   505 \end{itemize}}
   218 \mode<presentation>{
   506 
   219 \begin{frame}[c]
   507 
   220 \frametitle{\begin{tabular}{c}Chip-and-PIN\end{tabular}}
   508 \end{frame}}
   221 
   509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   222 
   510 
   223 \begin{itemize}
   511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   224 \item in 2006, Shell petrol stations stopped accepting Chip-and-PIN after \pounds{}1m had been stolen from customer accounts 
   512 \mode<presentation>{
   225 \item in 2008, hundreds of card readers for use in Britain, Ireland, the Netherlands, Denmark, and Belgium had been 
   513 \begin{frame}[c]
   226 expertly tampered with shortly after manufacture so that details and PINs of credit cards were sent during the 9 months 
       
   227 before over mobile phone networks to criminals in Lahore, Pakistan
       
   228 \end{itemize}
       
   229   
       
   230 \end{frame}}
       
   231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   232 
       
   233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   234 \mode<presentation>{
       
   235 \begin{frame}[c]
       
   236 \frametitle{\begin{tabular}{c}Chip-and-PIN is Broken\end{tabular}}
       
   237 
       
   238 \begin{flushright}
       
   239 \includegraphics[scale=0.01]{pics/andersonbook1.jpg}\;
       
   240 \includegraphics[scale=1.5]{pics/anderson.jpg}
       
   241 \end{flushright}
       
   242 
       
   243 \begin{itemize}
       
   244 \item Man-in-the-middle attacks by the group around Ross Anderson\medskip
       
   245 \end{itemize}
   514 
   246 
   515 \begin{center}
   247 \begin{center}
   516 \textcolor{ProcessBlue}{\LARGE\bf Demo}
   248 \includegraphics[scale=0.5]{pics/chip-attack.png}
   517 \end{center}
   249 \end{center}
   518 \end{frame}}
   250   
   519 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   251 \end{frame}}
   520 
   252 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   253 
   522 \mode<presentation>{
   254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   523 \begin{frame}[c]
   255 \mode<presentation>{
   524 \frametitle{\begin{tabular}{c}Functions\end{tabular}}
   256 \begin{frame}[c]
   525 
   257 \frametitle{\begin{tabular}{@ {}c@ {}}Chip-and-PIN is Really Broken\end{tabular}}
   526 Transformations:\bigskip
   258 
   527 \begin{center}
   259 \begin{flushright}
   528 \LARGE
   260 \includegraphics[scale=0.01]{pics/andersonbook1.jpg}\;
   529 Input(s)  $\Rightarrow$ Output\bigskip\bigskip
   261 \includegraphics[scale=1.5]{pics/anderson.jpg}
   530 \end{center}\pause
   262 \end{flushright}
   531 
   263 
   532 ``Given some input; produce some output.''\\
   264 \begin{itemize}
   533 ``Transform the input into some output.''\\
   265 \item same group successfully attacked last this year card readers and ATM machines
   534 
   266 \item the problem: several types of ATMs generate poor random numbers, which are used as nonces
   535 \end{frame}}
   267 \end{itemize}
   536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   268 
   537 
   269 \end{frame}}
   538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   539 \mode<presentation>{
   271 
   540 \begin{frame}[c]
   272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   541 \frametitle{\begin{tabular}{c}Functions in Scala\end{tabular}}
   273 \mode<presentation>{
   542 
   274 \begin{frame}[c]
   543 \mbox{}\bigskip\bigskip\bigskip\bigskip
   275 \frametitle{\begin{tabular}{c}The Problem\ldots\end{tabular}}
   544 {\lstset{language=Scala}\fontsize{12}{14}\selectfont
   276 
   545 \texttt{\lstinputlisting{max.scala}}}
   277 
   546 
   278 \begin{textblock}{1}(3,4)
   547 \small
   279 \begin{tabular}{c}
   548 \begin{textblock}{8}(1,3)
   280 \includegraphics[scale=0.3]{pics/bank.png}\\[-2mm]
   549 {\bf\texttt{def}} starts a function definition
   281 \small Bank
   550 \end{textblock}
   282 \end{tabular}
   551 \begin{textblock}{8}(2.3,4)
   283 \end{textblock}
   552 function name
   284 
   553 \end{textblock}
   285 \begin{textblock}{1}(7,4.5)
   554 \begin{textblock}{8}(3.8,5)
   286 \begin{tabular}{c}
   555 parameter list in parentheses
   287 \includegraphics[scale=3]{pics/store.png}\\[-2mm]
   556 \end{textblock}
   288 \end{tabular}
   557 \begin{textblock}{8}(6.5,6)
   289 \end{textblock}
   558 function's result type
   290 
   559 \end{textblock}
   291 \begin{textblock}{1}(12,6.5)
   560 \begin{textblock}{8}(11,7)
   292 \begin{tabular}{c}
   561 equal sign
   293 \includegraphics[scale=0.8]{pics/factory.png}\\[-1mm]
   562 \end{textblock}
   294 \small terminal\\[-2mm] \small producer
   563 \begin{textblock}{8}(9,10)
   295 \end{tabular}
   564 function body\\ 
   296 \end{textblock}
   565 in curly braces
   297 
   566 \end{textblock}
   298 \begin{textblock}{1}(4.5,9.9)
   567 
   299 \begin{tabular}{c}
   568 \end{frame}}
   300 \includegraphics[scale=0.13]{pics/rman.png}\\[-1mm]
   569 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   301 \small costumer / you
   570 
   302 \end{tabular}
   571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   303 \end{textblock}  
   572 \mode<presentation>{
   304   
   573 \begin{frame}[c]
   305 \begin{textblock}{14}(1,13.5)
   574 
   306 \begin{itemize}
   575 {\lstset{language=Java}\fontsize{7}{8}\selectfont
   307 \item the burden of proof for fraud and financial liability shifted to the costumer
   576 \texttt{\lstinputlisting{URLReader.java}}}
   308 \end {itemize} 
   577 
   309 \end{textblock}
   578 \only<2>{
   310   
   579 \begin{textblock}{5}(12,2)
   311 \end{frame}}
   580 \includegraphics[scale=0.50]{skeleton.jpg}\\
   312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   581 \end{textblock}}
   313 
   582 \end{frame}}
   314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   315 \mode<presentation>{
   584 
   316 \begin{frame}[c]
   585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   317 \frametitle{\begin{tabular}{c}Screwed Again\end{tabular}}
   586 \mode<presentation>{
   318 
   587 \begin{frame}[t]
   319 
   588 \frametitle{\begin{tabular}{c}Map\end{tabular}}
   320 \begin{flushright}
   589 
   321 \includegraphics[scale=0.3]{pics/rbssecure.jpg}
   590 \begin{itemize}
   322 \end{flushright}
   591 \item {\bf\texttt{map}} takes a function, say f, and applies it to every element of the list:
   323 
   592 \end{itemize}
   324 \begin{itemize}
   593 
   325 \item {\bf Responsibility}\\
   594 \begin{textblock}{15}(2,7)
   326 ``You understand that you are financially responsible for all uses of RBS Secure.''\\
   595 \fontsize{13}{14}\selectfont
   327 \textcolor{lightgray}{\footnotesize\url{https://www.rbssecure.co.uk/rbs/tdsecure/terms_of_use.jsp}}
   596 \bf\texttt{List(1, 2, 3, 4, 5, 6, 7, 8, 9)}
   328 \end{itemize}
   597 \end{textblock}
   329   
   598 
   330 \end{frame}}
   599 \begin{textblock}{15}(2,10)
   331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   600 \fontsize{13}{14}\selectfont
   332 
   601 \bf\texttt{List(1, 4, 9, 16, 25, 36, 49, 64, 81)}
       
   602 \end{textblock}
       
   603 
       
   604 \end{frame}}
       
   605 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   606 
       
   607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   608 \mode<presentation>{
       
   609 \begin{frame}<1-2>[t]
       
   610 \frametitle{\begin{tabular}{c}Filter\end{tabular}}
       
   611 
       
   612 \begin{itemize}
       
   613 \item {\bf\texttt{filter}} takes a condition, say p, and filters out all elements of the list not satisfying p:
       
   614 \end{itemize}
       
   615 
       
   616 \begin{textblock}{15}(2,7)
       
   617 \fontsize{13}{14}\selectfont
       
   618 \bf\texttt{List(1, 2, 3, 4, 5, 6, 7, 8, 9)}
       
   619 \end{textblock}
       
   620 
       
   621 \end{frame}}
       
   622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   623 
       
   624 
       
   625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   626 \mode<presentation>{
       
   627 \begin{frame}[c]
       
   628 \frametitle{\begin{tabular}{c}Conclusion\end{tabular}}
       
   629 
       
   630 \begin{itemize}
       
   631 \item Scala is still under development (compiler is slow)\medskip
       
   632 \item there are at least 5 books on the market\medskip
       
   633 \item {\bf\texttt{http://www.scala-lang.org/}}\medskip
       
   634 \item ``deep'' type-system (computer science)\bigskip\pause
       
   635 \item (for the lazy programmer)\\ programming in Scala is much more fun
       
   636 
       
   637 \end{itemize}
       
   638 \end{frame}}
       
   639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
       
   640 
   333 
   641 
   334 
   642 \end{document}
   335 \end{document}
   643 
   336 
   644 %%% Local Variables:  
   337 %%% Local Variables: