Top Banner
 Python for Teachers Pycon 2009, Chicago Urner / Holden
66

Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

Mar 09, 2018

Download

Documents

ngonguyet
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Python for Teachers

Pycon 2009, ChicagoUrner / Holden

Page 2: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

 

Python for Teachersvs.

Python for Trainers(pedagogy vs. andragogy)

Page 3: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Town–Gown relations:how to bridge

Pointy Haired Bosses vs.

Dilberts

Page 4: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

True FOSS stories:

● FreeGeek and SQL Clinic● Hillsboro Police and SA:● OS Bridge (looking ahead)● [ any story you please ]

Page 5: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

 

Bug: Not Enough Stories (Lore)

Why?"Story problems should be

Meaningless, the more meaningless the better."

Not!

Page 6: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Fix: Use Cases Matter, we really do care about the Real World and/or about the Mnemonic value of our stories.

Page 7: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Rule of Thumb: ok to tell fairy tales (science fiction OK), just don't waste our time (respect your audience)

Page 8: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Remember: Neolithic Math ( web frameworks, ORM divinities )

Page 9: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

The phase space of lore is yours to explore (dreamweaving OK)

don't forget to make your stories mnemonic / cosmogenic

D Conway re Tomb Raider, L Wall re 007 (OSCON)

Page 10: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Lore:  Why am I here?

Skills:  What am I doing?

Page 11: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

xkcd:adding spice

Page 12: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Pythonista

Webus Vancouverous

Subcultures R Us

Page 13: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   http://www.perl.com/lpt/a/956

Page 14: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Where is Python Nation?

... right next to the Republic of Perl

Note Netherlands, quite near

Guido:  BDFL

Page 15: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

The Rise of Structured Programming from the Spaghetti Code West

A more advanced civilization triumphs: the way of the ShaolinKung Fu with David Carradine http://www.imdb.com/title/tt0068093/

Page 16: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

The Rise of SQL (keeping tabs)

A dark talehttp://www.waragainsttheweak.com/

Page 17: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

The Rise of Unicode

Call me Cosmopolitan

Page 18: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 19: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 20: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Public crypto: being private with strangers

One day, Bob had a secret for Alice, one that Eve should not know ...

Page 21: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

GNU heart Linux (a romantic epic)

SCO versus IBM (FOSS wins)

Heroic Epic Genre

Page 22: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Back to the Future or...

Page 23: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

from __future__ import...

Page 24: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

 

The Lost Generation

(thank you ABC.com)

Page 25: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Primordial Soup

● Atoms (primitive types)● Molecules (data structures)● Cells (functions, generators)● Organisms ("am a")● Organs ("have a")● Ecosystems (name spaces)● OK to keep zooming out

Page 26: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

What about Hardware?

● Packets, tcp / ip● Warriors of the Net● Data centers, networks (GIS)● Zoom in to CPU / RAM / ROM● Note: XO has no hard disk● OLPC vs. MDPA (control room)

Page 27: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Your job:  train House M.D. in Python (a busy grumpy guy)

Page 28: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 29: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

<pythonista>

class Patriotic_Snake:

    def __init__(self):        self.proud = True        self.vigilant = True        self.brave = True

    def _watchout(self):        return "I'm semi­private."

    def __backoff(self):        return "Don't tread on me."

</pythonista>

(vary to suit, remember your freedoms)

Using mnemonics:

Page 30: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Track A (lexical)

●Permutations (ascii / unicode)●prime / composite●gcd, lcd ●“modulo numbers”●totative / totients●finite groups, fields (algebra!)●euler's theorem, RSA

Page 31: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Follow your curiosity

Study your heritage

Page 32: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 33: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Track B (graphical)

● animals, shapes, polymorphism ● figurate / polytopal numbers● sphere packing● vectors, trig, XYZ, lat/long etc.● polyhedra as objects

Page 34: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

A business story (unfolding):Portland as ToonTown(where some serious cartooning goes on)

Page 35: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Homer Davenport, from Springfield, Oregon was a student of Thomas Nast, inventor of political Elephant and Donkey icons

“biships”

Full disclosure:  I was a Catholic school teacher in the early 1980s and thought we did a great job

Page 36: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Oregon: home of the real Springfield

Page 37: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Animal zOO

● Biotum class, instances = biota● Monkey, Dog, Snake classes● Eating and pooping (deque?)● Animal class (common ancestor)● Polymorphism: “passing the buck”● The __rib__ cage●“everything's a python in Python”

Page 38: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Your job:  train House M.D. in Python (a busy grumpy guy)

Page 39: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 40: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Track C (synergetic)

● Rich data structures ● SQL (supermarket math) ● GIS / GPS (outdoor activities)● mvps, time dimension ● user requests and events ● web framework (Django?) ● client / server, design patterns

Page 41: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Lots of interconnections between tracks.

Lots of branches off both

Page 42: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Figurate Numbers

Pascal's Triangle (triangular and tetrahedral numbers)

Fibonacci Numbers (converge to phi, pentagon math)

Vectors (VPython -- xyz, spherical coordinates etc.)

Prime Numbers (sieves)

Prime Numbers (trials by division)

Polyhedra (as Python objects: scale, rotate, translate)

Polyhedral Numbers (icosahedral, geodesic spheres)

Modulo Numbers (override __mul__, __add__)

Finite Groups (Python module)

Euclid's Algorithm (Guido's gcd)

Euclid's Extended Algorithm (needed for inverses)

Totient and Totative (gcd based)

Fermat's Little Theorem (assert...)

Euler's Theorem for Totients (assert...)

Mandelbrot Set (chaotic sequences)

Miller-Rabin (or Jython probablePrime)

RSA.encrypt(m, N)

RSA.decrypt(c, N, d=secretkey)

Excerpt from edu­sig

Gnu Math:

What the Bleep!?

Page 43: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

OLPC.XO.pippy includes Fibonacci's and Pascal's

Page 44: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

The Rise of Unicode

Call me Cosmopolitan

Page 45: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 46: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 47: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Pythoneering in the Silicon Forest

Page 48: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

1 + 12 + 42 + 92 spheres, CCP, Linus and Ava Helen Pauling special collection,Oregon Statue University, photo by K. Urner

http://www.flickr.com/photos/17157315@N00/3049399298/in/set­72157612330643992/

Page 49: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 50: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 51: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Track C: SQL + Vpython (Polyhedra on tap!)

Page 52: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   Python 2.5: generator for Pascal's Triangle

Page 53: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   Cite: http://mybizmo.blogspot.com/2009/01/wanderers­2009201.html

Remember me?

Page 54: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   Python 2.5: generator for Golden Ratio

Page 55: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Pentagon Math:

a:b :: b:(a+b)a= 1b= phi

“nclb.polynomial”

Paid work: Python + POV­RayDesign Science Toys; StrangeAttractors project

Note allusion toLost here

Page 56: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   Global Studies:  Compiz on Ubuntu, GIS / GPS, Python, 4D Solutions 

Page 57: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Preparing for “Modulo Numbers”

Page 58: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Page 59: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

http://worldgame.blogspot.com/2009/01/modulo­numbers.html

Page 60: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

New, Improved:  added __pow__

Page 61: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Checking Stuff...

Page 62: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   Totatives Algorithm insufficiently powered to take us into “really big numbers” territory

Page 63: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

A Geometry of Lumps(Karl Menger: dimension theorist)

points are pointylines are lengthyplanes are flat

“everything is an object”

Page 64: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Yakking about NamespacesEinstein . 4D : time as the fourth dimension, imaginary time (Stephen Hawking)

Coxeter . 4D : distinct from einstein.4d per page 119 of Regular Polytopes

Fuller . 4D : everything is a lump, like a tetrahedron (Synergetics dedicated to Coxeter)

See: Linda Dalrymple Henderson, The Fourth Dimension and Non­Euclidean Geometry in Modern Art, Princeton University Press, 1983

Page 65: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

From The Oregonian – October 20, 2008 

Storytelling(lore)in PDX,2008

Page 66: Python for Teachers - 4D Solutions · PDF filePython for Teachers ... Thomas Nast, inventor of political Elephant and Donkey icons ... Polyhedra (as Python objects: scale, rotate,

   

Stickworks (recycle, reuse) :●wrap Vpython's vector with some extra stuff● keep Vector tails at the Origin● define Edges as a pair of Vector tips ● define Faces as sequences of Vectors● define Polyhedra as lists of Faces● rbf volumes OK (encouraged even)

Stickworks is a Python module, also a namespace, also a “meme pool”