# HG changeset patch # User Christian Urban # Date 1565934666 -3600 # Node ID 52faee6d0be265ff4c5ebae136efd5aeb9ed3347 # Parent eb1b4ad23941b20f33fa887bcfb621f758f23913 updated diff -r eb1b4ad23941 -r 52faee6d0be2 README --- a/README Tue Aug 13 10:23:20 2019 +0100 +++ b/README Fri Aug 16 06:51:06 2019 +0100 @@ -6,11 +6,11 @@ chowchingjimkcl -Assignment 6 6 (main) 4 (advanced) -Assignment 7 6 (main) 3 (advanced) -Assignment 8 6 (amin) 4 (advanced) -Assignment 9 5 (main) 4 (advanced) -Assignment 10 6 (main) 4 (advanced) +Assignment 6 3 (basic) 7 (main) +Assignment 7 4 (basic) 6 (main) +Assignment 8 4 (basic) 6 (main) +Assignment 9 4 (basic) 6 (main) +Assignment 10 10 (main) 48 diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw01.pdf Binary file cws/cw01.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw01.tex --- a/cws/cw01.tex Tue Aug 13 10:23:20 2019 +0100 +++ b/cws/cw01.tex Fri Aug 16 06:51:06 2019 +0100 @@ -1,3 +1,4 @@ +% !TEX program = xelatex \documentclass{article} \usepackage{../style} \usepackage{disclaimer} @@ -9,7 +10,7 @@ \mbox{}\hfill\textit{``The most effective debugging tool is still careful thought,}\\ \mbox{}\hfill\textit{coupled with judiciously placed print statements.''}\smallskip\\ -\mbox{}\hfill\textit{ --- Brian W. Kernighan, in Unix for Beginners (1979)}\bigskip +\mbox{}\hfill\textit{ --- Brian W. Kernighan, in Unix for Beginners (1979)}\medskip\bigskip \noindent @@ -194,7 +195,7 @@ the stocks from our portfolio (there might be more stocks available, if companies from our portfolio got listed in that year, or less if some companies went bust or were de-listed). -\item We do this for 40 years until January 2019 and check what would +\item We do this for 41 years until January 2019 and check what would have become out of our \$100. \end{itemize} @@ -339,6 +340,8 @@ \end{document} + +%%%%%%% Historical Stuff \newpage This part is about web-scraping and list-processing in Scala. It uses diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw02.pdf Binary file cws/cw02.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw02.tex --- a/cws/cw02.tex Tue Aug 13 10:23:20 2019 +0100 +++ b/cws/cw02.tex Fri Aug 16 06:51:06 2019 +0100 @@ -11,7 +11,7 @@ \mbox{}\hfill\textit{``What one programmer can do in one month,}\\ \mbox{}\hfill\textit{two programmers can do in two months.''}\smallskip\\ -\mbox{}\hfill\textit{ --- Frederick P.~Brooks (author of The Mythical Man-Month)}\bigskip +\mbox{}\hfill\textit{ --- Frederick P.~Brooks (author of The Mythical Man-Month)}\bigskip\medskip \noindent This coursework is worth 10\%. The basic part is due @@ -71,7 +71,7 @@ integers, \texttt{.max} calculates the maximum of a list.\bigskip \noindent -\textbf{For Part 2 + 3:} use \texttt{.split(",").toList} for splitting +\textbf{For Part 2:} use \texttt{.split(",").toList} for splitting strings according to commas (similarly $\backslash$\texttt{n}), \texttt{.getOrElse(..,..)} allows to querry a Map, but also gives a default value if the Map is not defined, a Map can be `updated' by @@ -102,9 +102,8 @@ \begin{itemize} \item[(1)] Implement a function that `cleans' a string by finding all (proper) words in this string. For this use the regular expression - \texttt{$\backslash$w+} for recognising word characters and the - library function \texttt{findAllIn}. The function should return a - document (a list of + \texttt{\textbackslash{}w+} for recognising words and the library function + \texttt{findAllIn}. The function should return a document (a list of strings).\\ \mbox{}\hfill [1 Mark] diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw03.pdf Binary file cws/cw03.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw04.pdf Binary file cws/cw04.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw05.pdf Binary file cws/cw05.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 cws/cw06.pdf Binary file cws/cw06.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 langs.sty --- a/langs.sty Tue Aug 13 10:23:20 2019 +0100 +++ b/langs.sty Fri Aug 16 06:51:06 2019 +0100 @@ -3,6 +3,28 @@ \setmonofont[Scale=.95]{Consolas} \newfontfamily{\consolas}{Consolas} +\makeatletter +\let\old@lstKV@SwitchCases\lstKV@SwitchCases +\def\lstKV@SwitchCases#1#2#3{} +\makeatother +\usepackage{lstlinebgrd} +\makeatletter +\let\lstKV@SwitchCases\old@lstKV@SwitchCases + +\lst@Key{numbers}{none}{% + \def\lst@PlaceNumber{\lst@linebgrd}% + \lstKV@SwitchCases{#1}% + {none:\\% + left:\def\lst@PlaceNumber{\llap{\normalfont + \lst@numberstyle{\thelstnumber}\kern\lst@numbersep}\lst@linebgrd}\\% + right:\def\lst@PlaceNumber{\rlap{\normalfont + \kern\linewidth \kern\lst@numbersep + \lst@numberstyle{\thelstnumber}}\lst@linebgrd}% + }{\PackageError{Listings}{Numbers #1 unknown}\@ehc}} +\makeatother + + + \definecolor{codered}{rgb}{0.6,0,0} % for strings \definecolor{codegreen}{rgb}{0.25,0.5,0.35} % comments \definecolor{codepurple}{rgb}{0.5,0,0.35} % keywords diff -r eb1b4ad23941 -r 52faee6d0be2 slides.sty --- a/slides.sty Tue Aug 13 10:23:20 2019 +0100 +++ b/slides.sty Fri Aug 16 06:51:06 2019 +0100 @@ -5,7 +5,7 @@ %%%%% CODE FONT %\setmonofont[Scale=.95]{Consolas} \setmonofont[Scale=.88]{Consolas} -\newfontfamily{\consolas}{Consolas} +%\newfontfamily{\consolas}{Consolas} %%%%% MATHFONT \usepackage[sc]{mathpazo} diff -r eb1b4ad23941 -r 52faee6d0be2 slides/slides01.pdf Binary file slides/slides01.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 slides/slides02.pdf Binary file slides/slides02.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 slides/slides03.pdf Binary file slides/slides03.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 slides/slides04.pdf Binary file slides/slides04.pdf has changed diff -r eb1b4ad23941 -r 52faee6d0be2 slides/slides05.pdf Binary file slides/slides05.pdf has changed