
[ Pursuant to: http://mybizmo.blogspot.com/2007/07/sa-8144-day-one.html ] I thought I'd do this one in a more premeditated style, outlining my lesson plan for the day, then following up later with a brief report on how I'd deviated from the script, how it all went. That won't be right after class, as I need to report for duty at another job in the early PM, where I've been nominated within a new grant proposal that just *might* involve MySQL and Python. We'll know more in November. Aside (recalling EuroPython 2007): I learned a lot about Pylons from that guy from the Ukraine (the one who uses Mako, hosts a blog site). Now they're saying TurboGears is moving to it, along with SQLAlchemy out the back end (lots of peak interest in the session on Canonical's Storm, just why SQLAlchemy wasn't "mature enough" for Canonical -- I protest "innocent bystander" on that one, not having used either yet (the MySQL keynoter seemed somewhat amused we're so in to our object-relational mappers these days)). My aim is to dive into Python as a language, less context and history, by means of 2-level scaffolding: stickworks.py, introduced in the Showmedo series, and polyhedra.py on top of that. Both get imported to menu-driven demo mods, so you *could* say 3-level, but I'm going to start in the IDLE shell importing stuff just from the first two levels (giving you a capable Vector and Edge, plus some canned data organizing these into familiar enough wireframes (we already talked Icosahedra on the first day)). Get used to low level vector arithmetic & graphics against an XYZ backdrop, in the opening hours. Pythonic Math features a one pass approach, straight to vectors per http://www.4dsolutions.net/ocn/numeracy1.html By the time we get to viztoyz, povtoyz and x3dtoyz, they'll already be fluent readers of basic Python grammar, complete with classes, functions & generators, and data structures. And this is only Day Two. But these aren't your usual students: a self selecting bunch willing to do something hard in the summer, in a college context, with some Silicon Forest weirdo named Kirby Urner, just back from Vilnius ("where's that again?"). Kirby PS: up early, with a living room full of kids sleeping, so off to the local breakfast nook, but it's closed, because we only *pretend* to be working class in this neighborhood (Richmonders might straggle in from b'fast around 7 AM earliest -- about now in fact, so time to return).

On 7/18/07, kirby urner <kirby.urner@gmail.com> wrote:
[
Pursuant to: http://mybizmo.blogspot.com/2007/07/sa-8144-day-one.html
]
I thought I'd do this one in a more premeditated style, outlining my lesson plan for the day, then following up later with a brief report on how I'd deviated from the script, how it all went.
I obtained the remote for the projector from the desk clerk this time, so no standing on Omar's chair. That victory was more than offset by the $30 parking ticket (shades of my last gig, back to haunt me). Immersion (recog) mixed with recall (blank canvas exercises) seems to be working well enough. Some students are anxious to show me they're able to write gobs of code quickly, some of it a little broken, such as one guy using parens for indexing into a tuple. Easily fixed. I think some people's expectation of a "programming class" is they're going to be staring at long swatches of code. Any shell intensive approach is discomfiting at first, as it engenders a "where's the beef?" sort of tension. Downloading stickworks.py etc. relieves this tension, as in "ah, *there's* the beef." Others have no problem just going along at the suggested pace, a guided downloading of stickworks.py, polyhedra.py and viztoyz.py from the Internet via a web browser, immediately launching the tests (at the bottom of each module). This was immersion phase, with imports coming from all over the map: visual (= VPython), math, random, plus my own 3rd party modules, e.g. looking at viztoyz.py: from visual import sphere, color, display, cylinder # native VPython from random import randint # standard library from stickworks import Vector, Edge # 3rd party (4dsolutions.net) from polyhedra import Tetrahedron, Icosahedron # 3rd party (4dsolutions.net) from math import sqrt # standard library My Vector class wraps visual.cylinder, always pointing from the origin. Many vectors = sea urchin looking prickly thing. So if you want Polyhedra, that'll take Edge objects, which connect any two vector tips as in e0 = Edge(v0, v1). I often cite a specific Linear Algebra book for laying groundwork for this approach (Wayne Bishop of Mathematically Correct a co-author of this text book that used to have BASIC in the back, but not in the later editions). Some of this stickworks stuff gets spelled out some at showmedo.com -- we actually watched the projected version (only a few minutes long). Should any of you wish to take advantage of my scaffolding, you're more than welcome: http://www.4dsolutions.net/ocn/python/ Since we're focusing on Polyhedra as Model, real time and rendering Views, with Python as Controller (MVC), I inserted my little "remedial geometry" lecture sometime between two play sessions (2.5 hours leaves plenty of time for both). Gotta anchor those Polyhedra (not always clear their regular schools are really doing that). This is the little talk about the rhombic dodecahedron (not the pentagonal) having an octahedron and cube (qyoob) embedded as long and short rhomb-face diagonals respectively, with relative volumes 6:4:3. I had my plastic box of beans along, stocked with paperboard shapes. I poured beans from one to the other, highlighting these volume relationships. A lot of them worked with color tuples during the play/exploration time. Without having full mastery of the Vpython API (doc address shared), you can start looking for color-tuples and messing with them. There's lots to discover e.g. about a (1,1,1) convention versus a (255, 255, 255) convention. Ratios matter in VPython. One students thought of wiring color tuples to randints (my code hints at such possibilities), even dividing by 100 to keep the R,G,B values <= 1. We watched Warriors of the Net (I provide my own more powerful speakers). Class over. More tomorrow. I used the Windows laptop today (vs. Ubuntu yesterday). Makes no essential difference as far is this particular curriculum is concerned. IDLE is much the same either way, thanks to CP4E, as is VPython, thanks to Bruce Sherwood et al @ Carnegie Mellon. Kirby PS from Omar, who wanted to share: http://uncyclopedia.org/wiki/Monty_Python (cracks him up) Example: """ John Cleese and Eric Idle created the programming language Python in 91 AD. The Snakes of America (SoA) strongly approve the language because it makes snakes more [awesome]. "Python" is a direct rip off of Monty Python and there are many references to the British humour group in everything about it. ... """

On 7/18/07, kirby urner <kirby.urner@gmail.com> wrote:
On 7/18/07, kirby urner <kirby.urner@gmail.com> wrote:
[
Pursuant to: http://mybizmo.blogspot.com/2007/07/sa-8144-day-one.html
]
I thought I'd do this one in a more premeditated style, outlining my lesson plan for the day, then following up later with a brief report on how I'd deviated from the script, how it all went.
Sounds like a great class. I'm envious of your students. ;-)
Downloading stickworks.py etc. relieves this tension, as in "ah, *there's* the beef."
I'll have to check that out. Thanks for the info. -- cordially, Anna -- It is fate, but call it Italy if it pleases you, Vicar!
participants (2)
-
Anna Ravenscroft
-
kirby urner