slides/slides01.tex
changeset 308 e86add5a6961
parent 278 0c2481cd8b1c
child 309 b192bc772613
equal deleted inserted replaced
307:3c7ac7836e4f 308:e86add5a6961
       
     1 % !TEX program = xelatex
     1 \documentclass[dvipsnames,14pt,t,xelatex]{beamer}
     2 \documentclass[dvipsnames,14pt,t,xelatex]{beamer}
     2 \usepackage{../slides}
     3 \usepackage{../slides}
     3 \usepackage{../graphics}
     4 \usepackage{../graphics}
     4 \usepackage{../langs}
     5 \usepackage{../langs}
     5 %\usepackage{../data}
     6 %\usepackage{../data}
    36   \begin{center}
    37   \begin{center}
    37   \begin{tabular}{ll}
    38   \begin{tabular}{ll}
    38     Email:  & christian.urban at kcl.ac.uk\\
    39     Email:  & christian.urban at kcl.ac.uk\\
    39     Office: & N\liningnums{7.07} (North Wing, Bush House)\\
    40     Office: & N\liningnums{7.07} (North Wing, Bush House)\\
    40     Slides \& Code: & KEATS\medskip\\
    41     Slides \& Code: & KEATS\medskip\\
    41     Office Hours: &  Mondays 12:00 -- 14:00\\
    42     Office Hours: &  Thursdays 12:00 -- 14:00\\
    42            & \alert{except next week: Tuesday}
    43     Additionally: & (for Scala) Tuesdays 10:45 -- 11:45\\ 
    43   \end{tabular}
    44   \end{tabular}
    44   \end{center}
    45   \end{center}
    45 
    46 
    46   %\tiny
    47   %\tiny
    47   %developed since 2004 bv Martin Odersky
    48   %developed since 2004 bv Martin Odersky
    80 \end{tabular}
    81 \end{tabular}
    81 \end{textblock}
    82 \end{textblock}
    82 
    83 
    83 
    84 
    84 \begin{textblock}{6}(2,12)
    85 \begin{textblock}{6}(2,12)
    85 \begin{bubble}[9cm]
    86 \begin{bubble}[9.4cm]
    86   \small
    87   \small
    87   developed since 2004 by Martin Odersky\\
    88   developed since 2004 by Martin Odersky
    88   (he was behind Generic Java which was included in Java 5
    89   (he was behind Generic Java which was included in Java 5
    89   \ldots I am using it maybe since 2008?)
    90   \ldots I am using Scala since maybe 2008?)
    90 \end{bubble}
    91 \end{bubble}
    91 \end{textblock}
    92 \end{textblock}
    92 
    93 
    93 \end{frame}
    94 \end{frame}
    94 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    95 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   114 \begin{itemize}
   115 \begin{itemize}
   115 \item compiles to the JVM\\
   116 \item compiles to the JVM\\
   116   \textcolor{gray}{(also JavaScript, native X86 in the works)}\medskip
   117   \textcolor{gray}{(also JavaScript, native X86 in the works)}\medskip
   117 \item integrates seamlessly with Java\medskip
   118 \item integrates seamlessly with Java\medskip
   118 \item combines \underline{\bf functional} and {\bf object-oriented} programming\bigskip
   119 \item combines \underline{\bf functional} and {\bf object-oriented} programming\bigskip
   119 \item it is a bit on the ``mathematical'' side\\
   120 \item it is a bit on the ``theory'' / ``mathematical'' side\\
   120   \textcolor{gray}{(no pointers, no \texttt{null}, but expressions)}
   121   \textcolor{gray}{(no pointers, no \texttt{null}, but expressions)}
   121   
   122   
   122 \item often one can write very concise and elegant code
   123 \item often one can write very concise and elegant code
   123 \end{itemize}\bigskip\medskip  
   124 \end{itemize}\bigskip\medskip  
   124 
   125 
   125 \small
   126 %\small
   126 alternatives:\\
   127 %alternatives:\\
   127 Elm, Haskell, Ocaml, F$\sharp$, Erlang, ML, Lisp (Racket), \ldots
   128 %Elm, Haskell, Ocaml, F$\sharp$, Erlang, ML, Lisp (Racket), \ldots
   128 
   129 
   129 \end{frame}
   130 \end{frame}
   130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   131 
   132 
   132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   133 \begin{frame}[c]
   134 \begin{frame}[t]
   134 \frametitle{Java vs Scala}
   135 \frametitle{Java vs Scala}
   135 
   136 
   136 {\lstset{language=java}\fontsize{12}{12}\selectfont
   137 {\lstset{language=java,numbers=right}\fontsize{12}{12}\selectfont
   137 \texttt{\lstinputlisting{Point.java}}}
   138 \texttt{\lstinputlisting{Point.java}}}
   138 
   139 
   139 \rule{11cm}{0.3mm}\\[-2mm]
   140 \rule{11cm}{0.3mm}\\[-3mm]
   140 
   141 
   141 {\lstset{language=scala}\fontsize{12}{12}\selectfont
   142 {\lstset{language=scala}\fontsize{12}{12}\selectfont
   142 \texttt{\lstinputlisting{Point.scala}}}
   143 \texttt{\lstinputlisting{Point.scala}}}
   143 
   144 
   144 \begin{textblock}{6}(13,3)
   145 \begin{textblock}{6}(13,3)
   145 \textbf{\large Java}
   146 \textbf{\large Java}
   146 \end{textblock}
   147 \end{textblock}
   147 
   148 
   148 \begin{textblock}{6}(13,13.6)
   149 \begin{textblock}{6}(13,14.3)
   149 \textbf{\large Scala}
   150 \textbf{\large Scala}
   150 \end{textblock}  
   151 \end{textblock}  
   151 
   152 
   152 \end{frame}
   153 \end{frame}
   153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   168 \begin{frame}[c]
   169 \begin{frame}[c]
   169 \frametitle{First Steps: Scala Tools}
   170 \frametitle{First Steps: Scala Tools}
   170 
   171 
   171 \begin{itemize}
   172 \begin{itemize}
       
   173 \item contains a REPL  
   172 \item I use VS Code and a Scala extension (M'place)
   174 \item I use VS Code and a Scala extension (M'place)
   173 \begin{center}  
   175 \begin{center}  
   174 \includegraphics[scale=0.10]{../pics/vscode.png}\\[-10mm]\mbox{}
   176 \includegraphics[scale=0.10]{../pics/vscode.png}\\[-10mm]\mbox{}
   175 \end{center}\bigskip
   177 \end{center}\bigskip
   176   
   178   
   362   \end{textblock}}
   364   \end{textblock}}
   363 
   365 
   364 \only<3>{
   366 \only<3>{
   365   \begin{textblock}{14.2}(1,13.5)
   367   \begin{textblock}{14.2}(1,13.5)
   366     In FP: Once a variable is created, it is assigned a value and then
   368     In FP: Once a variable is created, it is assigned a value and then
   367     never changed again $\Rightarrow$ no synchronisation\smallskip\\
   369     never changed again $\Rightarrow$ no synchronisation needed\smallskip\\
   368     %%\small\textcolor{gray}{(Andrew's second favourite feature of C++)}
   370     %%\small\textcolor{gray}{(Andrew's second favourite feature of C++)}
   369   \end{textblock}}
   371   \end{textblock}}
   370 
   372 
   371 \end{frame}
   373 \end{frame}
   372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
   374 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
   460 \begin{frame}[c]
   462 \begin{frame}[c]
   461 \frametitle{Coursework}
   463 \frametitle{Coursework}
   462 
   464 
   463 \begin{itemize}
   465 \begin{itemize}
   464 \item Sorry, I might have been a bit wordy:\\
   466 \item Sorry, I might have been a bit wordy:\\
   465   CW description is 7 pages, but
   467   Part 6 of CW description is 7 pages, but
   466   I only needed \mbox{< 100} loc for \emph{all} the CW6.\bigskip
   468   I only needed \mbox{< 100} loc for \emph{all} Part 6.\bigskip
   467 
   469 
   468 \item there is email feedback when pushing code to github\medskip
   470 \item there is feedback when pushing code to github\medskip
   469 
   471 
   470 \item there are \texttt{jar}-files you can use to test my implementation\bigskip
   472 \item there are \texttt{jar}-files you can use to test my implementation\bigskip
   471   
   473   
   472 \item we want you to learn FP: \alert{\bf no vars}, no mutable
   474 \item we want you to learn FP!\\ \alert{\bf no vars}, no mutable
   473   data-structures, e.g.~no \texttt{Arrays}, no \texttt{ListBuffer}
   475   data-structures\\ e.g.~no \texttt{Arrays}, no \texttt{ListBuffer}
   474 \end{itemize}
   476 \end{itemize}
   475 \end{frame}
   477 \end{frame}
   476 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   477 
   479 
   478 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   487 
   489 
   488   {\small
   490   {\small
   489   \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
   491   \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-1mm]
   490     val old_list = List(1, 2, 3, 5)
   492     val old_list = List(1, 2, 3, 5)
   491     val new_list = 0 :: old_list
   493     val new_list = 0 :: old_list
       
   494                 // -> List(0, 1, 2, 3, 4, 5)
   492   \end{lstlisting}}  
   495   \end{lstlisting}}  
   493   
   496   
   494 \item You do not have to be defensive about who can access the data.
   497 \item You do not have to be defensive about who can access the data.
   495 
   498 
   496 \item You can look at your code in isolation.  
   499 \item You can look at your code in isolation.  
   502 
   505 
   503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   506 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   504 \begin{frame}[t]
   507 \begin{frame}[t]
   505 \frametitle{Email: Hate 'val'}
   508 \frametitle{Email: Hate 'val'}
   506 
   509 
   507 \mbox{}\\[-25mm]\mbox{}
   510 \mbox{}\\[-23mm]\mbox{}
   508 
   511 
   509 \begin{center}
   512 \begin{center}
   510   \begin{bubble}[10.5cm]
   513   \begin{bubble}[10.5cm]
   511   Subject: \textbf{Hate '\textbf{\texttt{val}}'}\hfill 01:00 AM\medskip\\
   514   Subject: \textbf{Hate '\textbf{\texttt{val}}'}\hfill 01:00 AM\medskip\\
   512 
   515 
   684     \raisebox{0mm}{\includegraphics[scale=0.1]{../pics/mand3.png}}      
   687     \raisebox{0mm}{\includegraphics[scale=0.1]{../pics/mand3.png}}      
   685   \end{tabular}     
   688   \end{tabular}     
   686 \end{center}
   689 \end{center}
   687 
   690 
   688 \begin{center}
   691 \begin{center}
   689   My Office Hours: Mondays 12 -- 14\\
   692   My Office Hours: Thursdays 12 -- 14\\
   690   except next week: Tuesday 12 -- 14
   693   And specifically for Scala: Tuesday 10:45 -- 11:45
   691 \end{center}
   694 \end{center}
   692 \end{frame}
   695 \end{frame}
   693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   694 \end{document}
   697 \end{document}
   695 
   698