diff -r a61b50c5d57f -r 7975e4f0d4de handouts/ho01.tex --- a/handouts/ho01.tex Fri Dec 05 01:00:34 2014 +0000 +++ b/handouts/ho01.tex Fri Dec 05 17:13:33 2014 +0000 @@ -69,7 +69,7 @@ disposable.style.email.with+symbol@example.com \end{lstlisting} -Identifiers, or variables, in program text are often required +As mentioned above, identifiers, or variables, in program text are often required to satisfy the constraints that they start with a letter and then can be followed by zero or more letters or numbers and also can include underscores, but not as the first character. @@ -118,7 +118,8 @@ \ref{crawler3}.\footnote{There is an interesting twist in the web-scraper where \pcode{re*?} is used instead of \pcode{re*}.} Note, however, the regular expression for -http-addresses in web-pages is meant to be +http-addresses in web-pages in Figure~\ref{crawler1}, Line 15, is +intended to be \[ \pcode{"https?://[^"]*"} @@ -162,7 +163,7 @@ scaled ticks=false, axis lines=left, width=7cm, - height=5cm, + height=4.5cm, legend entries={Python,Ruby}, legend pos=north west, legend cell align=left] @@ -217,7 +218,7 @@ scaled ticks=false, axis lines=left, width=9cm, - height=5cm] + height=4.5cm] \addplot[green,mark=square*,mark options={fill=white}] table {re2b.data}; \addplot[black,mark=square*,mark options={fill=white}] table {re3.data}; \end{axis} @@ -393,6 +394,8 @@ between the different regular expressions $(r_1 + r_2) + r_3$ and $r_1 + (r_2 + r_3)$\ldots they are not the same regular expression, but they have the same meaning. For example +you can do the following calculation which shows they +have the same meaning: \begin{eqnarray*} L((r_1 + r_2) + r_3) & = & L(r_1 + r_2) \cup L(r_3)\\ @@ -517,7 +520,7 @@ specification and that the corresponding implementations do not contain any bugs. We are close, but not yet quite there. -Despite my fascination, I am also happy to admit that regular +My fascination non withstanding, I am also happy to admit that regular expressions have their shortcomings. There are some well-known ``theoretical'' shortcomings, for example recognising strings of the form $a^{n}b^{n}$. I am not so bothered by them. What I