# HG changeset patch # User Christian Urban # Date 1385892533 0 # Node ID f5ec7c597c5bb18822f23eafbdb88555a7890d64 # Parent 828303e8e4afbc2383c9ef6cb78d9e525e409a7d updated diff -r 828303e8e4af -r f5ec7c597c5b coursework/cw01.pdf Binary file coursework/cw01.pdf has changed diff -r 828303e8e4af -r f5ec7c597c5b coursework/cw01.tex --- a/coursework/cw01.tex Sun Dec 01 09:58:41 2013 +0000 +++ b/coursework/cw01.tex Sun Dec 01 10:08:53 2013 +0000 @@ -1,8 +1,8 @@ \documentclass{article} -\usepackage{charter} \usepackage{hyperref} \usepackage{amssymb} \usepackage{amsmath} +\usepackage{../langs} \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% \begin{document} @@ -107,10 +107,10 @@ wether the following four strings are matched by this regular expression. Answer yes or no. \begin{enumerate} -\item "/**/" -\item "/*foobar*/" -\item "/*test*/test*/" -\item "/*test/*test*/" +\item \texttt{"/**/"} +\item \texttt{"/*foobar*/"} +\item \texttt{"/*test*/test*/"} +\item \texttt{"/*test/*test*/"} \end{enumerate} \subsection*{Question 4 (marked with 1\%)} @@ -125,15 +125,15 @@ other character. \begin{enumerate} -\item $"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ +\item \texttt{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"$ -\item $"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} +\item \texttt{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"$ -\item$"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} +\item \texttt{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"$ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} \end{enumerate} diff -r 828303e8e4af -r f5ec7c597c5b coursework/cw02.pdf Binary file coursework/cw02.pdf has changed diff -r 828303e8e4af -r f5ec7c597c5b coursework/cw02.tex --- a/coursework/cw02.tex Sun Dec 01 09:58:41 2013 +0000 +++ b/coursework/cw02.tex Sun Dec 01 10:08:53 2013 +0000 @@ -1,65 +1,12 @@ \documentclass{article} -\usepackage{charter} \usepackage{hyperref} \usepackage{amssymb} \usepackage{amsmath} -\usepackage{listings} -\usepackage{xcolor} - +\usepackage{../langs} \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% \begin{document} -\definecolor{javared}{rgb}{0.6,0,0} % for strings -\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments -\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords -\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc - -\lstdefinelanguage{scala}{ - morekeywords={abstract,case,catch,class,def,% - do,else,extends,false,final,finally,% - for,if,implicit,import,match,mixin,% - new,null,object,override,package,% - private,protected,requires,return,sealed,% - super,this,throw,trait,true,try, - type,val,var,while,with,yield}, - otherkeywords={=>,<-,<\%,<:,>:,\#,@}, - sensitive=true, - morecomment=[l]{//}, - morecomment=[n]{/*}{*/}, - morestring=[b]", - morestring=[b]', - morestring=[b]""" -} - -\lstdefinelanguage{while}{ - morekeywords={while, if, then. else, read, write}, - otherkeywords={=>,<-,<\%,<:,>:,\#,@}, - sensitive=true, - morecomment=[l]{//}, - morecomment=[n]{/*}{*/}, - morestring=[b]", - morestring=[b]', - morestring=[b]""" -} - - -\lstset{language=Scala, - basicstyle=\ttfamily, - keywordstyle=\color{javapurple}\bfseries, - stringstyle=\color{javagreen}, - commentstyle=\color{javagreen}, - morecomment=[s][\color{javadocblue}]{/**}{*/}, - numbers=left, - numberstyle=\tiny\color{black}, - stepnumber=1, - numbersep=10pt, - tabsize=2, - showspaces=false, - showstringspaces=false} - - - \section*{Coursework 2} {\bf UPDATE:} There was a typo in Q1 about the regular expressions for comments: diff -r 828303e8e4af -r f5ec7c597c5b coursework/cw03.pdf Binary file coursework/cw03.pdf has changed diff -r 828303e8e4af -r f5ec7c597c5b coursework/cw03.tex --- a/coursework/cw03.tex Sun Dec 01 09:58:41 2013 +0000 +++ b/coursework/cw03.tex Sun Dec 01 10:08:53 2013 +0000 @@ -1,65 +1,12 @@ \documentclass{article} -\usepackage{charter} \usepackage{hyperref} \usepackage{amssymb} \usepackage{amsmath} -\usepackage{listings} -\usepackage{xcolor} - +\usepackage{../langs} \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% \begin{document} -\definecolor{javared}{rgb}{0.6,0,0} % for strings -\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments -\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords -\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc - -\lstdefinelanguage{scala}{ - morekeywords={abstract,case,catch,class,def,% - do,else,extends,false,final,finally,% - for,if,implicit,import,match,mixin,% - new,null,object,override,package,% - private,protected,requires,return,sealed,% - super,this,throw,trait,true,try, - type,val,var,while,with,yield}, - otherkeywords={=>,<-,<\%,<:,>:,\#,@}, - sensitive=true, - morecomment=[l]{//}, - morecomment=[n]{/*}{*/}, - morestring=[b]", - morestring=[b]', - morestring=[b]""" -} - -\lstdefinelanguage{while}{ - morekeywords={while, if, then. else, read, write, for, upto, do}, - otherkeywords={=>,<-,<\%,<:,>:,\#,@}, - sensitive=true, - morecomment=[l]{//}, - morecomment=[n]{/*}{*/}, - morestring=[b]", - morestring=[b]', - morestring=[b]""" -} - - -\lstset{language=Scala, - basicstyle=\ttfamily, - keywordstyle=\color{javapurple}\bfseries, - stringstyle=\color{javagreen}, - commentstyle=\color{javagreen}, - morecomment=[s][\color{javadocblue}]{/**}{*/}, - numbers=left, - numberstyle=\tiny\color{black}, - stepnumber=1, - numbersep=10pt, - tabsize=2, - showspaces=false, - showstringspaces=false} - - - \section*{Coursework 3} \noindent