Skip to content

Commit af005b7

Browse files
committed
a start on week 8 -- and framework for weeks 9 and 10
1 parent 06fb285 commit af005b7

File tree

8 files changed

+362
-21
lines changed

8 files changed

+362
-21
lines changed

week-07/presentation-week07.pdf

299 Bytes
Binary file not shown.

week-07/presentation-week07.tex

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
\documentclass{beamer}
22
%\usepackage[latin1]{inputenc}
33
\usetheme{Warsaw}
4-
\title[Intro to Python: Week 7]{Introduction to Python\\ More OO -- Decorators and Generators}
4+
\title[Intro to Python: Week 7]{Introduction to Python\\ More OO -- Iterators and Generators}
55
\author{Christopher Barker}
66
\institute{UW Continuing Education / Isilon}
77
\date{August 08, 2012}
@@ -640,7 +640,7 @@ \section{Iterators / Generators}
640640
class IterateMe_1(object):
641641
def __init__(self, stop=5):
642642
self.current = 0
643-
self.stop = 5
643+
self.stop = stop
644644
def __iter__(self):
645645
return self
646646
def next(self):
@@ -832,7 +832,12 @@ \section{Iterators / Generators}
832832
%%-------------------------------
833833
\begin{frame}[fragile]{LAB}
834834

835-
{\Large generator lab}
835+
\vfill
836+
{\LARGE generator lab:}
837+
838+
\vfill
839+
{\LARGE \verb| code/primer.py |}
840+
\vfill
836841

837842
\end{frame}
838843

@@ -849,8 +854,8 @@ \section{Iterators / Generators}
849854
four classes)
850855
\item Try to make use or something from today:
851856
\begin{itemize}
852-
\item mix-ins
853-
\item properties
857+
\item Mix-ins
858+
\item Properties
854859
\item Magic methods
855860
\item iterator or generator
856861
\end{itemize}

week-08/presentation-week08.pdf

91.5 KB
Binary file not shown.

week-08/presentation-week08.tex

Lines changed: 131 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
\documentclass{beamer}
22
%\usepackage[latin1]{inputenc}
33
\usetheme{Warsaw}
4-
\title[Intro to Python: Week 8]{Introduction to Python}
4+
\title[Intro to Python: Week 8]{Introduction to Python\\
5+
Decorators -- Debugging -- Packages and Packaging}
56
\author{Christopher Barker}
67
\institute{UW Continuing Education / Isilon}
78
\date{August 22, 2012}
@@ -27,49 +28,170 @@
2728
\section{Review/Questions}
2829

2930
% ---------------------------------------------
30-
\begin{frame}{Review of Previous Class}
31+
\begin{frame}[fragile]{Review of Previous Class}
32+
33+
{\Large Lightning talk today: Peter}
3134

3235
\begin{itemize}
33-
\item ...
36+
\item Some more OO
37+
\begin{itemize}
38+
\item Multiple inheritance / mix-ins
39+
\item Properties
40+
\item \verb|staticmethod| and \verb|classmethod|
41+
\item Special methods (``dunder'')
42+
\end{itemize}
43+
\item Iterators
44+
\item Generators
3445
\end{itemize}
3546

3647
\end{frame}
3748

3849

3950
% header
4051
% ---------------------------------------------
41-
\begin{frame}{Homework review}
52+
\begin{frame}[fragile]{Homework review}
53+
54+
{\Large Who added some classes to some ``real'' code?}
55+
56+
{\Large
57+
\begin{itemize}
58+
\item Multiple inheritance / mix-ins ?
59+
\item Property ?
60+
\item \verb|staticmethod| or \verb|classmethod| ?
61+
\item Special methods ?
62+
\item Iterator or Generators ?
63+
\end{itemize}
64+
}
65+
\end{frame}
66+
67+
\section{Decorators}
68+
69+
% ---------------------------------------------
70+
\begin{frame}[fragile]{Decorators}
71+
72+
{\LARGE Decorators are wrappers around functions}
73+
74+
\vfill
75+
{\LARGE They let you add code before an after the execution of a function}
76+
77+
\vfill
78+
{\LARGE Creating a custom version of that function}
79+
80+
\end{frame}
81+
82+
% ---------------------------------------------
83+
\begin{frame}[fragile]{Decorators}
84+
85+
{\LARGE Syntax:}
86+
87+
\begin{verbatim}
88+
@logged
89+
def add(a, b):
90+
"""add() adds things"""
91+
return a + b
92+
\end{verbatim}
93+
94+
{\Large Demo and Motivation:}
95+
96+
\begin{verbatim}
97+
98+
\end{verbatim}
99+
100+
\end{frame}
101+
102+
103+
%-------------------------------
104+
\begin{frame}{LAB}
105+
106+
\begin{itemize}
107+
\item
108+
\end{itemize}
109+
110+
\end{frame}
111+
112+
% Lightning Talk Slide
113+
%-------------------------------
114+
\begin{frame}{Lightning Talk}
115+
116+
{\centering
42117

43-
{\Large Homework notes }
118+
\vfill
119+
{\LARGE Lightning Talk: }
44120

121+
\vfill
122+
{\Huge Peter}
123+
124+
\vfill
125+
}
45126
\end{frame}
46127

47-
\section{First Section}
128+
129+
\section{Debugging}
48130

49131
% ---------------------------------------------
50132
\begin{frame}[fragile]{First Topic}
51133

52-
{\Large A topicc}
134+
{\Large A topic}
53135

54136
\begin{verbatim}
55137
some code example
56138
\end{verbatim}
57139

58140
\end{frame}
59141

60-
\section{Another Section}
142+
%-------------------------------
143+
\begin{frame}{LAB}
144+
145+
\begin{itemize}
146+
\item
147+
\end{itemize}
148+
149+
\end{frame}
150+
151+
152+
\section{Packages and Packaging}
61153

62154
% ---------------------------------------------
63155
\begin{frame}[fragile]{First Topic}
64156

65-
{\Large A topicc}
157+
{\Large A topic}
66158

67159
\begin{verbatim}
68160
some code example
69161
\end{verbatim}
70162

71163
\end{frame}
72164

165+
%-------------------------------
166+
\begin{frame}{LAB}
167+
168+
\begin{itemize}
169+
\item
170+
\end{itemize}
171+
172+
\end{frame}
173+
174+
%-------------------------------
175+
\begin{frame}{Wrap up}
176+
177+
\begin{itemize}
178+
\item
179+
\end{itemize}
180+
181+
\end{frame}
182+
183+
184+
185+
%-------------------------------
186+
\begin{frame}{Homework}
187+
188+
\begin{itemize}
189+
\item
190+
\end{itemize}
191+
192+
\end{frame}
193+
194+
73195
\end{document}
74196

75197

week-09/presentation-week09.pdf

82.7 KB
Binary file not shown.

week-09/presentation-week09.tex

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ \section{Review/Questions}
2929
% ---------------------------------------------
3030
\begin{frame}{Review of Previous Class}
3131

32+
Lightning talk today: Chris
33+
3234
\begin{itemize}
3335
\item ...
3436
\end{itemize}
@@ -44,7 +46,7 @@ \section{Review/Questions}
4446

4547
\end{frame}
4648

47-
\section{First Section}
49+
\section{Decorators}
4850

4951
% ---------------------------------------------
5052
\begin{frame}[fragile]{First Topic}
@@ -57,19 +59,110 @@ \section{First Section}
5759

5860
\end{frame}
5961

60-
\section{Another Section}
62+
%-------------------------------
63+
\begin{frame}{LAB}
64+
65+
\begin{itemize}
66+
\item
67+
\end{itemize}
68+
69+
\end{frame}
70+
71+
% Lightning Talk Slide
72+
%-------------------------------
73+
\begin{frame}{Lightning Talk}
74+
75+
{\centering
76+
77+
\vfill
78+
{\LARGE Lightning Talk: }
79+
80+
\vfill
81+
{\Huge Peter}
82+
83+
\vfill
84+
}
85+
\end{frame}
86+
87+
88+
\section{Debugging}
6189

6290
% ---------------------------------------------
6391
\begin{frame}[fragile]{First Topic}
6492

65-
{\Large A topicc}
93+
{\Large A topic}
6694

6795
\begin{verbatim}
6896
some code example
6997
\end{verbatim}
7098

7199
\end{frame}
72100

101+
%-------------------------------
102+
\begin{frame}{LAB}
103+
104+
\begin{itemize}
105+
\item
106+
\end{itemize}
107+
108+
\end{frame}
109+
110+
111+
\section{Packages and Packaging}
112+
113+
% ---------------------------------------------
114+
\begin{frame}[fragile]{First Topic}
115+
116+
{\Large A topic}
117+
118+
\begin{verbatim}
119+
some code example
120+
\end{verbatim}
121+
122+
\end{frame}
123+
124+
%-------------------------------
125+
\begin{frame}{LAB}
126+
127+
\begin{itemize}
128+
\item something
129+
\end{itemize}
130+
131+
\end{frame}
132+
133+
%-------------------------------
134+
\begin{frame}{Wrap up}
135+
136+
\begin{itemize}
137+
\item something
138+
\end{itemize}
139+
140+
\end{frame}
141+
142+
143+
144+
%-------------------------------
145+
\begin{frame}[fragile]{Homework}
146+
147+
\begin{itemize}
148+
\item Make sure you've got your compiler working:
149+
\begin{itemize}
150+
\item see: (link to class Wiki)
151+
\item You should be able to run: \\
152+
\verb|week-10/code/setup.py build_ext|
153+
\end{itemize}
154+
\item Install Cython:
155+
\begin{itemize}
156+
\item \verb|pip install cython|\\
157+
or
158+
\item \url{www.cython.org}
159+
\end{itemize}
160+
161+
\end{itemize}
162+
163+
\end{frame}
164+
165+
73166
\end{document}
74167

75168

week-10/presentation-week10.pdf

86.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)