183 |
213 |
184 \end{frame} |
214 \end{frame} |
185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
186 |
216 |
187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
188 \begin{frame}[c] |
218 % \begin{frame}[c] |
189 \frametitle{Preliminary 7} |
219 % \frametitle{Preliminary 7} |
190 |
220 |
191 Raw marks (261 submissions):\bigskip |
221 % Raw marks (261 submissions):\bigskip |
192 |
222 |
193 \begin{itemize} |
223 % \begin{itemize} |
194 \item 4\%: \hspace{4mm}236 |
224 % \item 4\%: \hspace{4mm}236 |
195 \item 3\%: \hspace{4mm}10 |
225 % \item 3\%: \hspace{4mm}10 |
196 \item 2\%: \hspace{4mm}1 |
226 % \item 2\%: \hspace{4mm}1 |
197 \item 1\%: \hspace{4mm}0 |
227 % \item 1\%: \hspace{4mm}0 |
198 \item 0\%: \hspace{4mm}15 |
228 % \item 0\%: \hspace{4mm}15 |
199 \end{itemize}\bigskip\bigskip |
229 % \end{itemize}\bigskip\bigskip |
200 |
230 |
201 \footnotesize |
231 % \footnotesize |
202 (plagiarism/collusion interviews ongoing!) |
232 % (plagiarism/collusion interviews ongoing!) |
203 |
233 |
204 \end{frame} |
234 % \end{frame} |
205 |
235 |
206 |
236 |
207 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
208 |
238 |
209 |
239 |
210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
211 \begin{frame}[c,fragile] |
241 % \begin{frame}[c,fragile] |
212 \small |
242 % \small |
213 |
243 |
214 \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
244 % \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
215 def is_legal(dim: Int, p: Path, x: Pos) = { |
245 % def is_legal(dim: Int, p: Path, x: Pos) = { |
216 if (...some_really_long_condition...) false |
246 % if (...some_really_long_condition...) false |
217 else true |
247 % else true |
218 } |
248 % } |
219 \end{lstlisting} |
249 % \end{lstlisting} |
220 |
250 |
221 \pause |
251 % \pause |
222 \bigskip |
252 % \bigskip |
223 \rule{11cm}{0.3mm} |
253 % \rule{11cm}{0.3mm} |
224 \bigskip |
254 % \bigskip |
225 |
255 |
226 \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
256 % \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
227 def is_legal(dim: Int, p: Path, x: Pos) = |
257 % def is_legal(dim: Int, p: Path, x: Pos) = |
228 !(...some_really_long_condition...) |
258 % !(...some_really_long_condition...) |
229 \end{lstlisting} |
259 % \end{lstlisting} |
230 |
260 |
231 \end{frame} |
261 % \end{frame} |
232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
233 |
263 |
234 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
235 \begin{frame}[c,fragile] |
265 % \begin{frame}[c,fragile] |
236 \small |
266 % \small |
237 |
267 |
238 \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
268 % \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
239 def foobar(...) = { |
269 % def foobar(...) = { |
240 val cs = for (c <- str) yield c.toLowerCase |
270 % val cs = for (c <- str) yield c.toLowerCase |
241 ... |
271 % ... |
242 } |
272 % } |
243 \end{lstlisting} |
273 % \end{lstlisting} |
244 |
274 |
245 \pause |
275 % \pause |
246 \bigskip |
276 % \bigskip |
247 \rule{11cm}{0.3mm} |
277 % \rule{11cm}{0.3mm} |
248 \bigskip |
278 % \bigskip |
249 |
279 |
250 \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
280 % \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=1mm] |
251 def foobar(...) = { |
281 % def foobar(...) = { |
252 val cs = str.map(_.toLowerCase) |
282 % val cs = str.map(_.toLowerCase) |
253 ... |
283 % ... |
254 } |
284 % } |
255 \end{lstlisting} |
285 % \end{lstlisting} |
256 |
286 |
257 \end{frame} |
287 % \end{frame} |
258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
259 |
289 |
260 |
290 |
261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
291 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
262 \begin{frame}[c,fragile] |
292 % \begin{frame}[c,fragile] |
263 \small |
293 % \small |
264 |
294 |
265 \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-7mm] |
295 % \begin{lstlisting}[language=Scala, numbers=none, xleftmargin=-7mm] |
266 def RomanNumeral2Int(rs: RomanNumeral): Int = |
296 % def RomanNumeral2Int(rs: RomanNumeral): Int = |
267 rs match { |
297 % rs match { |
268 case Nil => 0 |
298 % case Nil => 0 |
269 case M::r => 1000 + RomanNumeral2Int(r) |
299 % case M::r => 1000 + RomanNumeral2Int(r) |
270 case C::M::r => 900 + RomanNumeral2Int(r) |
300 % case C::M::r => 900 + RomanNumeral2Int(r) |
271 case D::r => 500 + RomanNumeral2Int(r) |
301 % case D::r => 500 + RomanNumeral2Int(r) |
272 case C::D::r => 400 + RomanNumeral2Int(r) |
302 % case C::D::r => 400 + RomanNumeral2Int(r) |
273 case C::r => 100 + RomanNumeral2Int(r) |
303 % case C::r => 100 + RomanNumeral2Int(r) |
274 case X::C::r => 90 + RomanNumeral2Int(r) |
304 % case X::C::r => 90 + RomanNumeral2Int(r) |
275 case L::r => 50 + RomanNumeral2Int(r) |
305 % case L::r => 50 + RomanNumeral2Int(r) |
276 case X::L::r => 40 + RomanNumeral2Int(r) |
306 % case X::L::r => 40 + RomanNumeral2Int(r) |
277 case X::r => 10 + RomanNumeral2Int(r) |
307 % case X::r => 10 + RomanNumeral2Int(r) |
278 case I::X::r => 9 + RomanNumeral2Int(r) |
308 % case I::X::r => 9 + RomanNumeral2Int(r) |
279 case V::r => 5 + RomanNumeral2Int(r) |
309 % case V::r => 5 + RomanNumeral2Int(r) |
280 case I::V::r => 4 + RomanNumeral2Int(r) |
310 % case I::V::r => 4 + RomanNumeral2Int(r) |
281 case I::r => 1 + RomanNumeral2Int(r) |
311 % case I::r => 1 + RomanNumeral2Int(r) |
282 } |
312 % } |
283 \end{lstlisting} |
313 % \end{lstlisting} |
284 |
314 |
285 \end{frame} |
315 % \end{frame} |
286 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
287 |
317 |
288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
289 \begin{frame}[c,fragile] |
319 \begin{frame}[c,fragile] |
290 \frametitle{Last Week: Pattern Matching} |
320 \frametitle{Last Week: Pattern Matching} |
329 |
359 |
330 \end{frame} |
360 \end{frame} |
331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
332 |
362 |
333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
334 \begin{frame}[c,fragile] |
364 % \begin{frame}[c,fragile] |
335 \frametitle{Sudoku} |
365 % \frametitle{Sudoku} |
336 |
366 |
337 A very simple-minded version on 110 problems:\bigskip |
367 % A very simple-minded version on 110 problems:\bigskip |
338 |
368 |
339 \begin{itemize} |
369 % \begin{itemize} |
340 \item 1 core: 800 secs |
370 % \item 1 core: 800 secs |
341 \item 2 cores: 400 secs |
371 % \item 2 cores: 400 secs |
342 \item 8 cores: 290 secs |
372 % \item 8 cores: 290 secs |
343 \item 18 cores: 142 secs |
373 % \item 18 cores: 142 secs |
344 \end{itemize} |
374 % \end{itemize} |
345 |
375 |
346 \end{frame} |
376 % \end{frame} |
347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
377 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
348 |
378 |
349 |
379 |
350 |
380 |
351 \begin{frame}[t] |
381 % \begin{frame}[t] |
352 |
382 |
353 \begin{center} |
383 % \begin{center} |
354 \includegraphics[scale=0.3]{../pics/blow.png} |
384 % \includegraphics[scale=0.3]{../pics/blow.png} |
355 \end{center} |
385 % \end{center} |
356 |
386 |
357 \begin{textblock}{14}(2,11.4) |
387 % \begin{textblock}{14}(2,11.4) |
358 \large\bf{}Mind-Blowing Regular Expressions:\\ |
388 % \large\bf{}Mind-Blowing Regular Expressions:\\ |
359 \centering in Python, JavaScript, Java |
389 % \centering in Python, JavaScript, Java |
360 \end{textblock} |
390 % \end{textblock} |
361 \end{frame} |
391 % \end{frame} |
362 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
363 |
393 |
364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
365 \begin{frame}[c,fragile] |
395 \begin{frame}[c,fragile] |
366 \frametitle{Regular Expressions} |
396 \frametitle{Regular Expressions} |
404 ymax=35, |
436 ymax=35, |
405 ytick={0,5,...,30}, |
437 ytick={0,5,...,30}, |
406 scaled ticks=false, |
438 scaled ticks=false, |
407 axis lines=left, |
439 axis lines=left, |
408 width=5.5cm, |
440 width=5.5cm, |
409 height=5cm, |
441 height=5cm, |
410 legend entries={\small{}Python, \small{}Java 8, \small{}JavaScript}, |
442 legend entries={Java 8,Python,JavaScript,Swift,Dart}, |
|
443 %legend entries={\small{}Python, \small{}Java 8, \small{}JavaScript}, |
411 legend pos=north west, |
444 legend pos=north west, |
412 legend cell align=left] |
445 legend cell align=left] |
413 \addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data}; |
446 \addplot[blue,mark=*, mark options={fill=white}] table {re-python2.data}; |
414 \addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data}; |
447 \addplot[cyan,mark=*, mark options={fill=white}] table {re-java.data}; |
415 \addplot[red,mark=*, mark options={fill=white}] table {re-js.data}; |
448 \addplot[red,mark=*, mark options={fill=white}] table {re-js.data}; |
|
449 \addplot[magenta,mark=*, mark options={fill=white}] table {re-swift.data}; |
|
450 \addplot[brown,mark=*, mark options={fill=white}] table {re-dart.data}; |
416 \end{axis} |
451 \end{axis} |
417 \end{tikzpicture}}}% |
452 \end{tikzpicture}}}% |
418 \only<2>{\raisebox{0mm}{\begin{tikzpicture} |
453 \only<2>{\raisebox{0mm}{\begin{tikzpicture} |
419 \begin{axis}[ |
454 \begin{axis}[ |
420 xlabel={$n$}, |
455 xlabel={$n$}, |