diff -r d0caa12ab8d8 -r 45557ad18ea6 slides/slides01.tex --- a/slides/slides01.tex Thu Nov 10 01:31:12 2016 +0000 +++ b/slides/slides01.tex Thu Nov 10 04:02:45 2016 +0000 @@ -1,6 +1,6 @@ \documentclass[dvipsnames,14pt,t,xelatex]{beamer} \usepackage{../slides} -%\usepackage{../graphics} +\usepackage{../graphics} \usepackage{../langs} %\usepackage{../data} @@ -79,7 +79,10 @@ \frametitle{Why Scala?} \begin{itemize} -\item bla +\item compiles to the JVM (also JavaScript, X86)\medskip +\item integrates seamlessly with Java\medskip +\item combines {\bf functional} and {\bf object-oriented} programming\medskip +\item allows often to write more elegant code \end{itemize} \end{frame} @@ -87,6 +90,29 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[c] +\frametitle{Java vs Scala} + +{\lstset{language=java}\fontsize{12}{12}\selectfont +\texttt{\lstinputlisting{Point.java}}} + +{\lstset{language=scala}\fontsize{12}{12}\selectfont +\texttt{\lstinputlisting{Point.scala}}} + +\begin{textblock}{6}(13,3) +\textbf{\large Java} +\end{textblock} + +\begin{textblock}{6}(13,13.2) +\textbf{\large Scala} +\end{textblock} + +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[c] \frametitle{Types} \begin{itemize} @@ -124,6 +150,62 @@ \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[c] +\frametitle{An Http Request} + +\begin{textblock}{1}(2,5) +\begin{tabular}{c} +\includegraphics[scale=0.15]{../pics/servers.png}\\[-2mm] +\small Server +\end{tabular} +\end{textblock} + +\begin{textblock}{1}(5.6,4) + \begin{tikzpicture}[scale=1.1] + \draw[white] (0,1) node (X) {}; + \draw[white] (2,1) node (Y) {}; + \draw[white] (0,0) node (X1) {}; + \draw[white] (2,0) node (Y1) {}; + \draw[white] (0,-1) node (X2) {}; + \draw[white] (2,-1) node (Y2) {}; + \draw[red, <-, line width = 2mm] (X) -- (Y); + \node [inner sep=5pt,label=above:\textcolor{black}{GET request}] at ($ (X)!.5!(Y) $) {}; + \draw[red, ->, line width = 2mm] (X1) -- (Y1); + \node [inner sep=5pt,label=above:\textcolor{black}{webpage}] at ($ (X1)!.5!(Y1) $) {}; + \draw[red, <-, line width = 2mm] (X2) -- (Y2); + \node [inner sep=7pt,label=above:\textcolor{black}{POST data}] at ($ (X2)!.5!(Y2) $) {}; + \end{tikzpicture} +\end{textblock} + + +\begin{textblock}{1}(9,5.5) +\begin{tabular}{c} +\includegraphics[scale=0.15]{../pics/laptop.png}\\[-2mm] +\small Browser +\end{tabular} +\end{textblock} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[c] + +{\lstset{language=Java}\fontsize{7}{8}\selectfont +\texttt{\lstinputlisting{URLReader.java}}} + +\only<2>{ +\begin{textblock}{5}(12,2) +\includegraphics[scale=0.50]{../pics/skeleton.jpg}\\ +\end{textblock}} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + \end{document} %%% Local Variables: