slides/slides02.tex
changeset 204 9b45dd24271b
parent 202 f7bcb27d1940
child 205 940e70378d90
equal deleted inserted replaced
203:eb188f9ac038 204:9b45dd24271b
    67 \end{frame}
    67 \end{frame}
    68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    68 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    69 
    69 
    70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    70 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    71 \begin{frame}[c]
    71 \begin{frame}[c]
    72 \frametitle{Scala on Lab Computers}
    72 \frametitle{Assignments}
    73 
    73 
    74 Avoid at all costs, even in comments
    74 Don't change anything with the templates!\bigskip
       
    75 
       
    76 Avoid at all costs:
    75 
    77 
    76 \begin{itemize}
    78 \begin{itemize}
    77 \item \texttt{var} \only<2>{$\quad\Rightarrow\;$\texttt{Var}}
    79 \item \texttt{var} 
    78 \item \texttt{return} \only<2>{$\quad\Rightarrow\;$\texttt{Return}}
    80 \item \texttt{return} 
    79 \item \texttt{.par}
       
    80 \item \texttt{ListBuffer}
    81 \item \texttt{ListBuffer}
    81 \item \texttt{mutable}  
    82 \item \texttt{mutable}
    82 \end{itemize}
    83 \item \texttt{.par}  
    83 
    84 \end{itemize}\pause\bigskip
    84 \end{frame}
    85 
    85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    86 
    86 
    87 \mbox{}\hfill\textit{``Scala --- \underline{S}lowly \underline{c}ompiled 
       
    88 \underline{a}cademic \underline{la}nguage''}\smallskip\\
       
    89 \mbox{}\hfill\textit{ --- a joke(?) found on Twitter}\bigskip
       
    90 \end{frame}
       
    91 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    92 
       
    93 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
    94 \begin{frame}[t]
       
    95 \frametitle{Email: Hate 'val'}
       
    96 
       
    97 \mbox{}\\[-25mm]\mbox{}
       
    98 
       
    99 \begin{center}
       
   100   \begin{bubble}[10.5cm]
       
   101   Subject: \textbf{Hate '\textbf{\texttt{val}}'}\hfill 01:00 AM\medskip\\
       
   102 
       
   103   Hello Mr Urban,\medskip\\
       
   104 
       
   105   I just wanted to ask, how are we suppose to work
       
   106   with the completely useless \textbf{\texttt{val}}, that can’t be changed ever? Why is
       
   107   this rule active at all? I’ve spent 4 hours not thinking on the
       
   108   coursework, but how to bypass this annoying rule. What’s the whole
       
   109   point of all these coursework, when we can’t use everything Scala
       
   110   gives us?!?\medskip\\
       
   111 
       
   112   Regards.\\
       
   113   \mbox{}\hspace{5mm}\textcolor{black!50}{<<deleted>>}\\
       
   114   \end{bubble}
       
   115 \end{center}
       
   116 
       
   117 \end{frame}
       
   118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
       
   119 
       
   120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   121 \def\firstcircle{(0,0) circle (1.4cm)}
       
   122 \def\secondcircle{(0:2cm) circle (1.4cm)}
       
   123 \colorlet{circle edge}{blue!50}
       
   124 \colorlet{circle area}{blue!20}
       
   125 
       
   126 \tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
       
   127     outline/.style={draw=circle edge, thick}}
       
   128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       
   129 \begin{frame}[c,fragile]
       
   130 \frametitle{Par: Intersections}
       
   131 
       
   132 \begin{textblock}{6}(1,2)
       
   133 \begin{tikzpicture}
       
   134   \draw[outline] \firstcircle node {$A$};
       
   135   \node[anchor=south] at (current bounding box.north)
       
   136     {$A = \{1,2,3,\ldots,1000\}$};
       
   137 \end{tikzpicture}
       
   138 \end{textblock}
       
   139 
       
   140 \begin{textblock}{6}(8,2)
       
   141 \begin{tikzpicture}
       
   142   \draw[outline] \secondcircle node {$B$};
       
   143   \node[anchor=south] at (current bounding box.north)
       
   144     {$B = \{1,5,9,13,\ldots,997\}$};
       
   145 \end{tikzpicture}
       
   146 \end{textblock}
       
   147 
       
   148 \begin{textblock}{6}(3.3,9)
       
   149 \begin{tikzpicture}
       
   150     \begin{scope}
       
   151         \clip \firstcircle;
       
   152         \fill[filled] \secondcircle;
       
   153     \end{scope}
       
   154     \draw[outline] \firstcircle node {$A$};
       
   155     \draw[outline] \secondcircle node {$B$};
       
   156     \node[anchor=north] at (current bounding box.south)
       
   157     {How many elements are in $A \cap B$?};
       
   158 \end{tikzpicture}
       
   159 \end{textblock}  
       
   160 
       
   161 \end{frame}
       
   162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    87 
   163 
    88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
   164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
    89 \begin{frame}[t]
   165 \begin{frame}[t]
    90 \frametitle{For-Comprehensions Again}
   166 \frametitle{For-Comprehensions Again}
    91 
   167 
   217             boardfontsize=12pt,labelfontsize=8pt,
   293             boardfontsize=12pt,labelfontsize=8pt,
   218             setpieces={Ng7, Nb2},showmover=false]
   294             setpieces={Ng7, Nb2},showmover=false]
   219 \end{center}
   295 \end{center}
   220             
   296             
   221 \begin{center}
   297 \begin{center}
   222 My Scala Office Hours: Thursdays 11 -- 13
   298 My Office Hours: Mondays 12 -- 14
   223 \end{center}
   299 \end{center}
   224 \end{frame}
   300 \end{frame}
   225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
   226 \end{document}
   302 \end{document}
   227 
   303