diff -r eb188f9ac038 -r 9b45dd24271b slides/slides02.tex --- a/slides/slides02.tex Thu Nov 15 14:23:55 2018 +0000 +++ b/slides/slides02.tex Fri Nov 16 02:06:03 2018 +0000 @@ -69,22 +69,98 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[c] -\frametitle{Scala on Lab Computers} +\frametitle{Assignments} -Avoid at all costs, even in comments +Don't change anything with the templates!\bigskip + +Avoid at all costs: \begin{itemize} -\item \texttt{var} \only<2>{$\quad\Rightarrow\;$\texttt{Var}} -\item \texttt{return} \only<2>{$\quad\Rightarrow\;$\texttt{Return}} -\item \texttt{.par} +\item \texttt{var} +\item \texttt{return} \item \texttt{ListBuffer} -\item \texttt{mutable} -\end{itemize} +\item \texttt{mutable} +\item \texttt{.par} +\end{itemize}\pause\bigskip + + +\mbox{}\hfill\textit{``Scala --- \underline{S}lowly \underline{c}ompiled +\underline{a}cademic \underline{la}nguage''}\smallskip\\ +\mbox{}\hfill\textit{ --- a joke(?) found on Twitter}\bigskip +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[t] +\frametitle{Email: Hate 'val'} + +\mbox{}\\[-25mm]\mbox{} + +\begin{center} + \begin{bubble}[10.5cm] + Subject: \textbf{Hate '\textbf{\texttt{val}}'}\hfill 01:00 AM\medskip\\ + + Hello Mr Urban,\medskip\\ + + I just wanted to ask, how are we suppose to work + with the completely useless \textbf{\texttt{val}}, that can’t be changed ever? Why is + this rule active at all? I’ve spent 4 hours not thinking on the + coursework, but how to bypass this annoying rule. What’s the whole + point of all these coursework, when we can’t use everything Scala + gives us?!?\medskip\\ + + Regards.\\ + \mbox{}\hspace{5mm}\textcolor{black!50}{<>}\\ + \end{bubble} +\end{center} + +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\firstcircle{(0,0) circle (1.4cm)} +\def\secondcircle{(0:2cm) circle (1.4cm)} +\colorlet{circle edge}{blue!50} +\colorlet{circle area}{blue!20} + +\tikzset{filled/.style={fill=circle area, draw=circle edge, thick}, + outline/.style={draw=circle edge, thick}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}[c,fragile] +\frametitle{Par: Intersections} + +\begin{textblock}{6}(1,2) +\begin{tikzpicture} + \draw[outline] \firstcircle node {$A$}; + \node[anchor=south] at (current bounding box.north) + {$A = \{1,2,3,\ldots,1000\}$}; +\end{tikzpicture} +\end{textblock} + +\begin{textblock}{6}(8,2) +\begin{tikzpicture} + \draw[outline] \secondcircle node {$B$}; + \node[anchor=south] at (current bounding box.north) + {$B = \{1,5,9,13,\ldots,997\}$}; +\end{tikzpicture} +\end{textblock} + +\begin{textblock}{6}(3.3,9) +\begin{tikzpicture} + \begin{scope} + \clip \firstcircle; + \fill[filled] \secondcircle; + \end{scope} + \draw[outline] \firstcircle node {$A$}; + \draw[outline] \secondcircle node {$B$}; + \node[anchor=north] at (current bounding box.south) + {How many elements are in $A \cap B$?}; +\end{tikzpicture} +\end{textblock} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{frame}[t] \frametitle{For-Comprehensions Again} @@ -219,7 +295,7 @@ \end{center} \begin{center} -My Scala Office Hours: Thursdays 11 -- 13 +My Office Hours: Mondays 12 -- 14 \end{center} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%