source: doc/theses/andrew_beach_MMath/thesis.tex @ 734c9664

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 734c9664 was 21f914e, checked in by Peter A. Buhr <pabuhr@…>, 4 years ago

first pass over Chapter 1

  • Property mode set to 100644
File size: 14.9 KB
Line 
1% Main tex file for thesis document.
2\documentclass[digital]{uw-ethesis}
3\usepackage{comment}
4\usepackage{fullpage}
5\setlength{\textheight}{8.75in}
6
7\usepackage{listings}                           % format program code
8% Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore
9% removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR
10% AFTER HYPERREF.
11%\DeclareTextCommandDefault{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}
12\renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}
13% parindent is relative, i.e., toggled on/off in environments like itemize, so store the value for
14% use rather than use \parident directly.
15\newlength{\parindentlnth}
16\setlength{\parindentlnth}{\parindent}
17
18% CFA programming language, based on ANSI C (with some gcc additions)
19\lstdefinelanguage{CFA}[ANSI]{C}{
20        morekeywords={
21                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
22                auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__,
23                coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally,
24                __float80, float80, __float128, float128, forall, ftype, generator, _Generic, _Imaginary, __imag, __imag__,
25                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
26                otype, restrict, resume, __restrict, __restrict__, __signed, __signed__, _Static_assert, suspend, thread,
27                _Thread_local, throw, throwResume, timeout, trait, try, ttype, typeof, __typeof, __typeof__,
28                virtual, __volatile, __volatile__, waitfor, when, with, zero_t},
29        moredirectives={defined,include_next},
30        % replace/adjust listing characters that look bad in sanserif
31        literate={-}{\makebox[1ex][c]{\raisebox{0.5ex}{\rule{0.8ex}{0.1ex}}}}1 {^}{\raisebox{0.6ex}{$\scriptstyle\land\,$}}1
32                {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 % {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
33                {<}{\textrm{\textless}}1 {>}{\textrm{\textgreater}}1
34                {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1ex][c]{\raisebox{0.5ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex{\textrm{\textgreater}}}2,
35}
36
37\lstset{
38language=CFA,
39columns=fullflexible,
40basicstyle=\linespread{0.9}\tt,                 % reduce line spacing and use sanserif font
41stringstyle=\tt,                                % use typewriter font
42tabsize=5,                                      % N space tabbing
43xleftmargin=\parindentlnth,                     % indent code to paragraph indentation
44%mathescape=true,                               % LaTeX math escape in CFA code $...$
45escapechar=\$,                                  % LaTeX escape in CFA code
46keepspaces=true,
47showstringspaces=false,                         % do not show spaces with cup
48showlines=true,                                 % show blank lines at end of code
49aboveskip=4pt,                                  % spacing above/below code block
50belowskip=3pt,
51moredelim=**[is][\color{red}]{`}{`},
52}% lstset
53
54\lstnewenvironment{cfa}[1][]
55{\lstset{#1}}
56{}
57% inline code @...@
58
59% Commands used in documenting how to use the template. To remove.
60\newcommand{\package}[1]{\textbf{#1}}
61\newcommand{\cmmd}[1]{\textbackslash\texttt{#1}}
62\newcommand{\href}[1]{#1}
63
64% For a nomenclature (optional; available from ctan.org)
65%\usepackage{nomencl}
66% Lots of math symbols and environments
67\usepackage{amsmath,amssymb,amstext}
68% For including graphics, sets the pdftex graphics driver.
69\usepackage[pdftex]{graphicx}
70
71\usepackage{cfalab}
72
73\usehyperrefpackage[pdftex,pagebackref=false]{
74    pdftitle={Exception Handling in CFA},
75    pdfauthor={Andrew James Beach},
76    pdfsubject={Programming Languages},
77    pdfkeywords={exceptions,implementation},
78}
79
80% The \phantomsection is used to help the hyperref package create links.
81
82% Maybe only package that should be loaded after the hyperref package.
83% From http://ctan.org/pkg/glossaries-extra, extends glossaries which replaces
84% glossary and builds off of the makeindex system.
85\usepackage[toc,abbreviations]{glossaries-extra}
86
87% Main glossary entries -- definitions of relevant terminology
88\newglossaryentry{computer}
89{
90name=computer,
91description={A programmable machine that receives input data,
92               stores and manipulates the data, and provides
93               formatted output}
94}
95
96% Nomenclature glossary entries -- New definitions, or unusual terminology
97\newglossary*{nomenclature}{Nomenclature}
98\newglossaryentry{dingledorf}
99{
100type=nomenclature,
101name=dingledorf,
102description={A person of supposed average intelligence who makes incredibly
103               brainless misjudgments}
104}
105
106% List of Abbreviations (abbreviations are from the glossaries-extra package)
107\newabbreviation{aaaaz}{AAAAZ}{American Association of Amature Astronomers
108               and Zoologists}
109
110% List of Symbols
111\newglossary*{symbols}{List of Symbols}
112\newglossaryentry{rvec}
113{
114name={$\mathbf{v}$},
115sort={label},
116type=symbols,
117description={Random vector: a location in n-dimensional Cartesian space, where
118               each dimensional component is determined by a random process}
119}
120
121% Must be here of cause problems with glossaries-extra.
122\lstMakeShortInline$%
123
124% Generate the glossaries defined above.
125\makeglossaries
126
127\begin{document}
128
129%----------------------------------------------------------------------
130% FRONT MATERIAL
131%----------------------------------------------------------------------
132\input{thesis-frontpgs}
133
134%----------------------------------------------------------------------
135% MAIN BODY
136%----------------------------------------------------------------------
137\input{unwinding}
138
139%======================================================================
140\chapter{Introduction}
141%======================================================================
142In the beginning, there was $\pi$:
143
144\begin{equation}
145   e^{\pi i} + 1 = 0  \label{eqn_pi}
146\end{equation}
147A \gls{computer} could compute $\pi$ all day long. In fact, subsets of digits
148of $\pi$'s decimal approximation would make a good source for psuedo-random
149vectors, \gls{rvec} .
150
151%----------------------------------------------------------------------
152\section{State of the Art}
153%----------------------------------------------------------------------
154
155See equation \ref{eqn_pi} on page \pageref{eqn_pi}.\footnote{A famous equation.}
156
157\section{Some Meaningless Stuff}
158
159The credo of the \gls{aaaaz} was, for several years, several paragraphs of gibberish, until the \gls{dingledorf} responsible for the \gls{aaaaz} Web site realized his mistake:
160
161"Velit dolor illum facilisis zzril ipsum, augue odio, accumsan ea augue molestie lobortis zzril laoreet ex ad, adipiscing nulla. Veniam dolore, vel te in dolor te, feugait dolore ex vel erat duis nostrud diam commodo ad eu in consequat esse in ut wisi. Consectetuer dolore feugiat wisi eum dignissim tincidunt vel, nostrud, at vulputate eum euismod, diam minim eros consequat lorem aliquam et ad. Feugait illum sit suscipit ut, tation in dolore euismod et iusto nulla amet wisi odio quis nisl feugiat adipiscing luptatum minim nisl, quis, erat, dolore. Elit quis sit dolor veniam blandit ullamcorper ex, vero nonummy, duis exerci delenit ullamcorper at feugiat ullamcorper, ullamcorper elit vulputate iusto esse luptatum duis autem. Nulla nulla qui, te praesent et at nisl ut in consequat blandit vel augue ut.
162
163Illum suscipit delenit commodo augue exerci magna veniam hendrerit dignissim duis ut feugait amet dolor dolor suscipit iriure veniam. Vel quis enim vulputate nulla facilisis volutpat vel in, suscipit facilisis dolore ut veniam, duis facilisi wisi nulla aliquip vero praesent nibh molestie consectetuer nulla. Wisi nibh exerci hendrerit consequat, nostrud lobortis ut praesent dignissim tincidunt enim eum accumsan. Lorem, nonummy duis iriure autem feugait praesent, duis, accumsan tation enim facilisi qui te dolore magna velit, iusto esse eu, zzril. Feugiat enim zzril, te vel illum, lobortis ut tation, elit luptatum ipsum, aliquam dolor sed. Ex consectetuer aliquip in, tation delenit dignissim accumsan consequat, vero, et ad eu velit ut duis ea ea odio.
164
165Vero qui, te praesent et at nisl ut in consequat blandit vel augue ut dolor illum facilisis zzril ipsum. Exerci odio, accumsan ea augue molestie lobortis zzril laoreet ex ad, adipiscing nulla, et dolore, vel te in dolor te, feugait dolore ex vel erat duis. Ut diam commodo ad eu in consequat esse in ut wisi aliquip dolore feugiat wisi eum dignissim tincidunt vel, nostrud. Ut vulputate eum euismod, diam minim eros consequat lorem aliquam et ad luptatum illum sit suscipit ut, tation in dolore euismod et iusto nulla. Iusto wisi odio quis nisl feugiat adipiscing luptatum minim. Illum, quis, erat, dolore qui quis sit dolor veniam blandit ullamcorper ex, vero nonummy, duis exerci delenit ullamcorper at feugiat. Et, ullamcorper elit vulputate iusto esse luptatum duis autem esse nulla qui.
166
167Praesent dolore et, delenit, laoreet dolore sed eros hendrerit consequat lobortis. Dolor nulla suscipit delenit commodo augue exerci magna veniam hendrerit dignissim duis ut feugait amet. Ad dolor suscipit iriure veniam blandit quis enim vulputate nulla facilisis volutpat vel in. Erat facilisis dolore ut veniam, duis facilisi wisi nulla aliquip vero praesent nibh molestie consectetuer nulla, iriure nibh exerci hendrerit. Vel, nostrud lobortis ut praesent dignissim tincidunt enim eum accumsan ea, nonummy duis. Ad autem feugait praesent, duis, accumsan tation enim facilisi qui te dolore magna velit, iusto esse eu, zzril vel enim zzril, te. Nisl illum, lobortis ut tation, elit luptatum ipsum, aliquam dolor sed minim consectetuer aliquip.
168
169Tation exerci delenit ullamcorper at feugiat ullamcorper, ullamcorper elit vulputate iusto esse luptatum duis autem esse nulla qui. Volutpat praesent et at nisl ut in consequat blandit vel augue ut dolor illum facilisis zzril ipsum, augue odio, accumsan ea augue molestie lobortis zzril laoreet. Ex duis, te velit illum odio, nisl qui consequat aliquip qui blandit hendrerit. Ea dolor nonummy ullamcorper nulla lorem tation laoreet in ea, ullamcorper vel consequat zzril delenit quis dignissim, vulputate tincidunt ut."
170
171%======================================================================
172\chapter{Observations}
173%======================================================================
174
175This would be a good place for some figures and tables.
176
177Some notes on figures and photographs\ldots
178
179\begin{itemize}
180\item A well-prepared PDF should be
181  \begin{enumerate}
182    \item Of reasonable size, {\it i.e.} photos cropped and compressed.
183    \item Scalable, to allow enlargment of text and drawings.
184  \end{enumerate}
185\item Photos must be bit maps, and so are not scaleable by definition. TIFF and
186BMP are uncompressed formats, while JPEG is compressed. Most photos can be
187compressed without losing their illustrative value.
188\item Drawings that you make should be scalable vector graphics, \emph{not}
189bit maps. Some scalable vector file formats are: EPS, SVG, PNG, WMF. These can
190all be converted into PNG or PDF, that pdflatex recognizes. Your drawing
191package probably can export to one of these formats directly. Otherwise, a
192common procedure is to print-to-file through a Postscript printer driver to
193create a PS file, then convert that to EPS (encapsulated PS, which has a
194bounding box to describe its exact size rather than a whole page).
195Programs such as GSView (a Ghostscript GUI) can create both EPS and PDF from
196PS files. Appendix~\ref{AppendixA} shows how to generate properly sized Matlab
197plots and save them as PDF.
198\item It's important to crop your photos and draw your figures to the size that
199you want to appear in your thesis. Scaling photos with the
200includegraphics command will cause loss of resolution. And scaling down
201drawings may cause any text annotations to become too small.
202\end{itemize}
203 
204For more information on \LaTeX\, see the uWaterloo Skills for the
205Academic Workplace \href{https://uwaterloo.ca/information-systems-technology/services/electronic-thesis-preparation-and-submission-support/ethesis-guide/creating-pdf-version-your-thesis/creating-pdf-files-using-latex/latex-ethesis-and-large-documents}{course notes}.
206\footnote{
207Note that while it is possible to include hyperlinks to external documents,
208it is not wise to do so, since anything you can't control may change over time.
209It \emph{would} be appropriate and necessary to provide external links to
210additional resources for a multimedia ``enhanced'' thesis.
211But also note that if the \package{hyperref} package is not included,
212as for the print-optimized option in this thesis template, any \cmmd{href}
213commands in your logical document are no longer defined.
214A work-around employed by this thesis template is to define a dummy
215\cmmd{href} command (which does nothing) in the preamble of the document,
216before the \package{hyperref} package is included.
217The dummy definition is then redifined by the
218\package{hyperref} package when it is included.
219}
220
221The classic book by Leslie Lamport \cite{lamport.book}, author of \LaTeX , is
222worth a look too, and the many available add-on packages are described by
223Goossens \textit{et al} \cite{goossens.book}.
224
225%----------------------------------------------------------------------
226% END MATERIAL
227%----------------------------------------------------------------------
228
229%----------------------------------------------------------------------
230% BIBLIOGRAPHY
231%----------------------------------------------------------------------
232
233% Use \clearpage instead if the document class uses the "oneside" argument.
234\cleardoublepage
235\phantomsection
236
237% Bibliography setup and creation, renamed to References.
238\addcontentsline{toc}{chapter}{\textbf{\bibname}}
239\bibliographystyle{plain}
240\bibliography{thesis}
241
242% Include all uncited entries in the bibliography.
243\nocite{*}
244
245% Begin the appendix, add a title and table of contents entry.
246\appendix
247\chapter*{APPENDICES}
248\addcontentsline{toc}{chapter}{APPENDICES}
249%======================================================================
250\chapter[PDF Plots From Matlab]{Matlab Code for Making a PDF Plot}
251\label{AppendixA}
252% Tip 4: Example of how to get a short chapter title for the Table of Contents
253%======================================================================
254\section{Using the GUI}
255Properties of Matab plots can be adjusted from the plot window via a graphical
256interface. Under the Desktop menu in the Figure window, select the Property
257Editor. You may also want to check the Plot Browser and Figure Palette for
258more tools. To adjust properties of the axes, look under the Edit menu and
259select Axes Properties.
260
261To set the figure size and to save as PDF or other file formats, click the
262Export Setup button in the figure Property Editor.
263
264\section{From the Command Line}
265All figure properties can also be manipulated from the command line. Here's an
266example:
267\begin{verbatim}
268x=[0:0.1:pi];
269hold on % Plot multiple traces on one figure
270plot(x,sin(x))
271plot(x,cos(x),'--r')
272plot(x,tan(x),'.-g')
273title('Some Trig Functions Over 0 to \pi') % Note LaTeX markup!
274legend('{\it sin}(x)','{\it cos}(x)','{\it tan}(x)')
275hold off
276set(gca,'Ylim',[-3 3]) % Adjust Y limits of "current axes"
277set(gcf,'Units','inches') % Set figure size units of "current figure"
278set(gcf,'Position',[0,0,6,4]) % Set figure width (6 in.) and height (4 in.)
279cd n:\thesis\plots % Select where to save
280print -dpdf plot.pdf % Save as PDF
281\end{verbatim}
282
283\end{document}
Note: See TracBrowser for help on using the repository browser.