Skip to content

Commit 154d0ea

Browse files
committed
deciding to do a git submodule to demonstrate in class
1 parent d07ea34 commit 154d0ea

12 files changed

+1058
-1
lines changed

AUTHORS.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Authors ordered by first contribution:
2+
3+
David Bindel <bindel@cs.cornell.edu>
4+
Stephen McDowell <sjm324@cornell.edu>

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# How to contribute
2+
3+
Thanks for your interest in contributing to the class material! We
4+
accept GitHub pull requests (for extra credit, if you're taking the
5+
class). All pull requests should be filed against the appropriate
6+
repository. If you feel comfortable with it, feel free to add
7+
yourself to [AUTHORS.txt][authors] if you add text or code examples.
8+
9+
Also, while you retain copyright to all your work, you should feel
10+
comfortable re-distributing code under an [MIT license][mit] or a
11+
similarly liberal license, and documentation under a
12+
[CC-BY-SA-4.0 license][cc]. If you are adding something new, please
13+
do include the appropriate license text.
14+
15+
The class adheres to a [code of conduct][code]. By participating, you
16+
are expected to uphold this code.
17+
18+
[authors]: AUTHORS.txt
19+
[mit]: http://opensource.org/licenses/MIT
20+
[cc]: http://creativecommons.org/licenses/by-sa/4.0/
21+
[code]: http://cs2043-sp16.github.io/conduct.html

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) 2016 Stephen McDowell
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+

Makefile

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# The following Makefile has been adapted from:
2+
#
3+
# https://akdiem.wordpress.com/2013/03/15/the-simplest-most-useful-makefile-latex/
4+
#
5+
# The beamertheme-metropolis package uses special fonts so we must use xelatex instead
6+
# of pdflatex. Compiling with xelatex also allows you use utf-8 characters directly in
7+
# your .tex file, allowing you to directly type things like chinese characters or
8+
# accents. Most of the time, though, you can get away with using pdflatex.
9+
#
10+
# The --shell-escape option is needed for certain code listings e.g. minted, as well as
11+
# some plotting libraries e.g. pgfplot.
12+
LATEX := xelatex --shell-escape
13+
BIBTEX := bibtex
14+
15+
# This Makefile assumes there is a directory structure:
16+
#
17+
# ./
18+
# - Makefile (this one)
19+
# <directory01>/
20+
# - <single source>.tex
21+
# <directory01>/
22+
# - <single source>.tex
23+
# ...
24+
#
25+
# In words, that there are some number of directories with exactly one .tex file n each
26+
# directory. The goal is to compile each <directory>/<single source>.tex into
27+
# <directory>/<single source>.pdf.
28+
SINGLE_SOURCE := $(shell find . -name "*.tex") # find all .tex files
29+
NO_EXTENSIONS := $(basename $(SINGLE_SOURCE)) # make basename gives the path without the extension
30+
COMPILED_PDFS := $(SINGLE_SOURCE:.tex=.pdf) # change <single source>.tex to <single source>.pdf
31+
32+
# Defining the `all` rule enables you to just type `make` in the same directory as the
33+
# Makefile. If it is not defined, the first rule defined will be executed when you
34+
# only type `make`. We make `all` depend on the expansion of COMPILED_PDFS so that
35+
# `all` will not be finished until every one of the rules in COMPILED_PDFS (below) is
36+
# also finished.
37+
all: $(COMPILED_PDFS)
38+
39+
# This defines a rule for each file in the list COMPILED_PDFS. So if COMPILED_PDFS was
40+
# the list
41+
#
42+
# lecture01/lecture01.pdf lecture02/lecture02.pdf
43+
#
44+
# then this would create the targets
45+
#
46+
# lecture01/lecture01.pdf: lecture01/lecture01.tex
47+
# lecture02/lecture02.pdf: lecture02/lecture02.tex
48+
#
49+
# Since we want to compile the results in the respective folders (as opposed to the
50+
# folder where this Makefile is), the jobname needs to be specified as such. Refer to
51+
# the following for what the automatic variables are:
52+
#
53+
# https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
54+
#
55+
# IMPORTANT:
56+
# File path issues with bibtex are common, and there do not exist many simple ways to
57+
# use relative paths from within the .tex file. The solution I use is that each .tex
58+
# file provides a path to the .bib file being used relative to this Makefile. For
59+
# example, if I have the directory structure
60+
#
61+
# ./
62+
# - Makefile (this one)
63+
# lecture01/
64+
# - lecture01.tex
65+
# - references.bib
66+
#
67+
# then in order for me to use references.bib inside of lecture01.tex, I need to use the
68+
# command
69+
#
70+
# \bibliography{lecture01/references}
71+
#
72+
# in order for the references to be included / compiled correctly.
73+
$(COMPILED_PDFS): %.pdf: %.tex
74+
$(LATEX) --jobname=$(basename $@) $<
75+
$(LATEX) --jobname=$(basename $@) $<
76+
77+
@# If no \bibliography is included, we do not want to execute bibtex as it will fail.
78+
@# The following greps for '\bibliography{' in the current .tex file, and counts the
79+
@# number of lines that do not have the comment character '%' before it. See
80+
@#
81+
@# http://unix.stackexchange.com/questions/60994/how-to-grep-lines-which-does-not-begin-with-or
82+
@#
83+
@# for an explanation of the second grep expression. Lastly, see the following
84+
@#
85+
@# https://www.gnu.org/software/make/manual/html_node/Echoing.html
86+
@#
87+
@# for why these comments have an @ in front of them. Normally you do not have to
88+
@# do this for comments, but since these comments are inside of a target definition
89+
@# you do. The make echoing behavior is observed most easily if you execute
90+
@# `make realclean` with this makefile.
91+
if [ "$(shell grep '\\bibliography{' $< | grep -c -v ^[[:space:]]*[\%])" -gt "0" ]; then \
92+
$(BIBTEX) $(basename $@); \
93+
fi
94+
95+
$(LATEX) --jobname=$(basename $@) $<
96+
$(LATEX) --jobname=$(basename $@) $<
97+
98+
# Defining clean targets is a common practice, allowing the user to cleanup the files
99+
# generated during compilation with ease. The `clean` target will get rid of the
100+
# intermediate compilation files, and the `realclean` target will do this as well as
101+
# remove the PDF files.
102+
#
103+
# The EXTENSIONS list is a list of the intermediate files that will be produced. The
104+
# CLEANABLES list is generated by looping over all of the elements in NO_EXTENSIONS
105+
# defined above, and for each one of those will add to the list each one of the
106+
# extensions listed in EXTENSIONS.
107+
EXTENSIONS := .aux .blg .out .bbl .log .nav .snm .toc .vrb
108+
CLEANABLES := $(foreach file, $(NO_EXTENSIONS), \
109+
$(foreach ext, $(EXTENSIONS), \
110+
$(file)$(ext)))
111+
112+
.PHONY: clean realclean
113+
clean:
114+
rm -f $(CLEANABLES)
115+
116+
realclean: clean
117+
rm -f $(COMPILED_PDFS)

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# lecture-slides
2-
Lecture slides for CS 2043.
2+
3+
Lecture slides for [CS 2043][cs2043]. This repository has been designed to accompany the course website in the
4+
form of a git submodule.
5+
6+
Contributions are welcome in the form of Pull Requests.
7+
8+
[cs2043]: http://cs2043-sp16.github.io/
9+
10+
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
11+

lecture01/lecture01.pdf

19.1 KB
Binary file not shown.

lecture01/lecture01.pyg

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
\makeatletter
3+
\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
4+
\let\PY@ul=\relax \let\PY@tc=\relax%
5+
\let\PY@bc=\relax \let\PY@ff=\relax}
6+
\def\PY@tok#1{\csname PY@tok@#1\endcsname}
7+
\def\PY@toks#1+{\ifx\relax#1\empty\else%
8+
\PY@tok{#1}\expandafter\PY@toks\fi}
9+
\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{%
10+
\PY@it{\PY@bf{\PY@ff{#1}}}}}}}
11+
\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
12+
13+
\expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
14+
\expandafter\def\csname PY@tok@gu\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
15+
\expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
16+
\expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf}
17+
\expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
18+
\expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
19+
\expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
20+
\expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
21+
\expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
22+
\expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
23+
\expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit}
24+
\expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
25+
\expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
26+
\expandafter\def\csname PY@tok@cs\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
27+
\expandafter\def\csname PY@tok@cp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}}
28+
\expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
29+
\expandafter\def\csname PY@tok@gh\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
30+
\expandafter\def\csname PY@tok@ni\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}}
31+
\expandafter\def\csname PY@tok@nl\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}}
32+
\expandafter\def\csname PY@tok@nn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
33+
\expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
34+
\expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}}
35+
\expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
36+
\expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
37+
\expandafter\def\csname PY@tok@nd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
38+
\expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}}
39+
\expandafter\def\csname PY@tok@nf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
40+
\expandafter\def\csname PY@tok@si\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
41+
\expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
42+
\expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
43+
\expandafter\def\csname PY@tok@nt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
44+
\expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
45+
\expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
46+
\expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
47+
\expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
48+
\expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
49+
\expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
50+
\expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
51+
\expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
52+
\expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
53+
\expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
54+
\expandafter\def\csname PY@tok@err\endcsname{\def\PY@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
55+
\expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
56+
\expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
57+
\expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
58+
\expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
59+
\expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
60+
\expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
61+
\expandafter\def\csname PY@tok@gp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
62+
\expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
63+
\expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
64+
\expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
65+
\expandafter\def\csname PY@tok@kp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
66+
\expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
67+
\expandafter\def\csname PY@tok@kt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
68+
\expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
69+
\expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
70+
\expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
71+
\expandafter\def\csname PY@tok@se\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}}
72+
\expandafter\def\csname PY@tok@sd\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
73+
74+
\def\PYZbs{\char`\\}
75+
\def\PYZus{\char`\_}
76+
\def\PYZob{\char`\{}
77+
\def\PYZcb{\char`\}}
78+
\def\PYZca{\char`\^}
79+
\def\PYZam{\char`\&}
80+
\def\PYZlt{\char`\<}
81+
\def\PYZgt{\char`\>}
82+
\def\PYZsh{\char`\#}
83+
\def\PYZpc{\char`\%}
84+
\def\PYZdl{\char`\$}
85+
\def\PYZhy{\char`\-}
86+
\def\PYZsq{\char`\'}
87+
\def\PYZdq{\char`\"}
88+
\def\PYZti{\char`\~}
89+
% for compatibility with earlier versions
90+
\def\PYZat{@}
91+
\def\PYZlb{[}
92+
\def\PYZrb{]}
93+
\makeatother
94+

0 commit comments

Comments
 (0)