RE: [Edu-sig] python satacad: class 4
-----Original Message----- From: Kirby Urner [mailto:urnerk@qwest.net] Sent: Monday, February 07, 2005 10:46 PM To: 'Arthur' Cc: edu-sig@python.org Subject: RE: [Edu-sig] python satacad: class 4
It 's moer fun to fight, in some ways. but I gotta have better ammunition than you're giving me of late.
Art
I've got lots of ammo stockpiled, but you'd need to dig for it. Geocaching, ya know -- fun sport.
Kirby
Stockpiling WMI. Should have known. Art
-----Original Message----- From: Arthur [mailto:ajsiegel@optonline.net] Sent: Tuesday, February 08, 2005 7:41 AM To: 'Kirby Urner'; 'Arthur' Cc: edu-sig@python.org Subject: RE: [Edu-sig] python satacad: class 4
-----Original Message----- From: Kirby Urner [mailto:urnerk@qwest.net] Sent: Monday, February 07, 2005 10:46 PM To: 'Arthur' Cc: edu-sig@python.org Subject: RE: [Edu-sig] python satacad: class 4
It 's moer fun to fight, in some ways. but I gotta have better ammunition than you're giving me of late.
Art
I've got lots of ammo stockpiled, but you'd need to dig for it. Geocaching, ya know -- fun sport.
Kirby
Stockpiling WMI.
Weapons of Mass Instruction. Having no good idea of what the hell Kirby was saying, thought I'd take my best shot at a progression ala his Wittgenstein reference of a few posts back. Another fun sport. Art
Stockpiling WMI.
Weapons of Mass Instruction.
That reminds me of a piece of Class 4 I forgot to describe. Remember, this is billed as a math class, with Python programming as a tool, a means to an end. So it's logical that I'd be doing a fair bit of geometry, in addition to a lot of pure/core Pythonic stuff. So I have this plastic box containing, among other goodies, a set of stiff paperboard polyhedra, with black electrical tape along the edges. Thanks to help from my friends Trevor and Russ Chu, they're precisely dimensioned for this demo I do, quite frequently, for audiences of all ages (but mostly kids). First, I take out my tetrahedron. We've already gone over Euler's V + F = E + 2. One face is missing (from all of them) meaning they're containers or "mixing bowls" of a kind. Lining the bottom of my plastic box: some kind of dried white bean (I forget the technical name for them). I say: "OK, this here tetrahedron will be my unit of measure, my cup." Then I go into this riff (how it goes varies from time to time) wherein I fill the other polys in my box with tetra-units of white bean. The pleasing result: cube = 3 tetvols, octahedron = 4, rhombic dodeca = 6, and cubocta = 20. Then there's this whole thing about how the cubocta (tetravolume 20) is really 12 balls around 1 in disguise, then 42, 92, 162 as we pack outward, layer by layer. So really, this whole business about the polyhedra embeds into a sphere packing matrix well known to architects and crystallographers. We call it the concentric hierarchy. We don't know why your high schools don't teach it. But here at Saturday Academy, we're sure to clue you in (because we care). How does all this relate to Python then? Well, per Class 3, by way of the figurate numbers, with the polyhedral numbers being a superclass thereof. We write little Python programs (just a few lines) that spit out these sequences of triangular, tetrahedral, cuboctahedral numbers (which latter are also icosahedral numbers, per Jitterbug Transformation). It's all pretty seamless. Python, geometry, POV-Ray... From the standpoint of these students, this is just run-o-the-mill stuff, more ho hum academics, though admittedly a lot more interesting than what their getting on weekdays. But old timers, teachers, onlookers, may appreciate that this curriculum is 100% subversive of the status quo. The NCTM doesn't stand a chance of keeping its standards unchanged, given this kind of content pumping out and around the Internet in a big way. We're an engine for positive change, armed with simply awesome WMI. Kirby
Art
The core of class 5 was tackling some number and group theory, as the course description advertises that we'll cover such (plus I *like* this stuff and find Python extremely valuable in communicating it). I think the students were amused that I'd actually tackle this stuff with them. It's not like they're being graded (they'll get certificates of completion), so from their point of view, this is a safe space in which to preview some stuff they might encounter again later. We went through Fermat's Theorem (not the famous last one, but this one): If p is prime then pow(b, p-1, p)==1 provided gcd(b,p)==1. Then I presented this as a specific instance of Euler's Theorem: pow(b, phi(n), n)==1 provided gcd(b,n)==1. It's an instance, because phi(p) = p-1. We'd already discussed what phi(n) means -- that's where I started (source code linked below). The sequence I use is something like this: 1. Euclid's Algorithm (Guido's simplest Python version) 2. Totatives of n 3. Phi(n) 4. Fermat's Theorem 5. Euler's Theorem 6. Some hand waving about the relevance of 5 to RSA (plug for 'In Code' by Flannerys) 7. definition of the P class for doing integer multiplication modulo n 8. group theory result that [P(i) for i in tots(n)] forms a group 9. what's a group? CAIN (closure, associative, inverse, neutral element) That was the tough stuff (they stayed with me for the most part). But interleaved was plenty of play and mental relaxation, including: Elastic Interval Geometry java programs: fluidiom.v2.nl (one of the most sophisticated applets ever written) www.springie.com (cute/clever EIG application) I explain how knowing Python is going to make Java seem a lot more accessible, and there're still good reasons for learning Java, including this whole applet technology, which Python does not duplicate. We also played with and projected: Terra server: http://terraserver.microsoft.com/ Kids enjoyed locating their homes and schools etc. Our area happens to be one of those terraserved. One student turned me on to keyhole as a perhaps better alternative: http://www.keyhole.com/ (looking into it) All of this is more fun given the big screen up front. The plan is to project Pygeo and some VPython under this heading of "fun stuff" next week (last class), as well as to delve into the J language some (again per course catalog). Much of the Python source code we've been using over the weeks, plus one student POV-Ray .pov and rendering (used with permission, so long as identity of student held back) are viewable here: http://www.4dsolutions.net/satacad/sa6299/ (I notice that test7.bmp is 2.3 meg -- I'll convert it to compressed format after I post this email (POV-Ray output is defaulting to bmp in our class)). Kirby PS: I spent the rest of Saturday working with Free Geek to migrate data from an Access MDB to Postgres, for an open source Perl app called sql-clinic. That took several hours.
Kirby Urner wrote: ...
(I notice that test7.bmp is 2.3 meg -- I'll convert it to compressed format after I post this email (POV-Ray output is defaulting to bmp in our class)). If you add '+FN' on the command line or the moral equivalent on Windows: [Render] [Edit Settings/Render] == Alt-R Alt-R Return and change the "Command Line Options" to include "+FN", you will generate .PNGs, which are losslessly compressed. Much smaller than .BMP (still larger than .JPG), but preserve everything. Using .PNGs will make it easier for your students to take pictures home.
--Scott David Daniels Scott.Daniels@Acm.Org
[Render] [Edit Settings/Render] == Alt-R Alt-R Return and change the "Command Line Options" to include "+FN", you will generate .PNGs, which are losslessly compressed. Much smaller than .BMP (still larger than .JPG), but preserve everything. Using .PNGs will make it easier for your students to take pictures home.
--Scott David Daniels Scott.Daniels@Acm.Org
Thanks Scott. Yes, this is how I have it set up on my boxes. Just didn't get to it in the Win2000 boxes in the classroom. I might mention something about it next week. As far as taking picture home, the students just take the .pov source on floppy or USB dongle, so they can continue working on them. POV-Ray is a free download. They just re-render. Kirby
I started with a reminder of how Python comes with this huge standard library, but then is routinely supplemented with still more 3rd party libraries. Case in point: Pygeo -- it depends on Numeric (very wide spread) and VPython (less wide spread but still popular). We all installed Pygeo and played with the examples for awhile (Islamic Patterns especially). I extolled the virtues of open source yet again: you may learn from my friend Arthur's source code, just how one throws together an app of this nature. Then I dove head first into a detailed exposition of RSA, using my rsa.py and talking about Bob, Alice and Eve, per usual. Then we dove into vectors for awhile: translation, rotation and scaling being the big 3 computer graphics transformations. I started constructing a vector class, then switched to a fully developed one. That led us back to POV-Ray and some pre-rendered polyhedra downloaded off the netlib library. That took me out to the Internet and George Hart's site (georgehart.com), where we took some time with VRML views of Archimedeans (13), Platonics (5) and Johnson polys (92). That got me into talking about stereo and cross-your-eyes freeviewing techniques (Springie went 3D over this last week, but I couldn't find my stash of glasses). We checked some examples at grunch.net/snelson Then I let them play and explore, handing out evaluations, certificates of completion. My own assessment: I dropped the ball a few times in this final class. The RSA stuff was a reach and needs work. I'm not going to abandon that effort. I think I at least got the gist of it communicated. I had this whole rap about Calculus Mountain and how I was taking a path *around* it to give 'em a sneak preview of stuff usually hidden on the other side. I invoked a scene from 'Lord of the Rings' -- wouldn't been better to have played the actual clip (trying to get over those mountains, before opting for the way beneath: Moria). The vector part was weak and my attempts to connect back to the pre-written stuff was clunky. But the biggest and most important omission was this: I totally spaced diving into J, which I was saving as a kind of mind-expanding farewell experience, a telling reminder that the world of computer languages is big and full of interesting animals. I could feel the void, like the class had ended too soon, with me short on material. That's why. Next time, I need to have a notebook with a script. I'm glad I get to run through this same course again come April. I'll be rereading my notes here on edu-sig, polishing, making things connect better -- provided anyone signs up that is. The weather is getting nice and it's getting harder to imagine anyone willingly spending so many hours on such sunny days in a darkened computer lab. I likely won't do as detailed a post mortem on each and every segment next time. This was a good experience though. Kirby
-----Original Message----- From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On Behalf Of Kirby Urner Sent: Saturday, February 19, 2005 6:26 PM To: edu-sig@python.org Subject: [Edu-sig] python satacad: class 6
Then we dove into vectors for awhile: translation, rotation and scaling being the big 3 computer graphics transformations. I started constructing a vector class, then switched to a fully developed one. That led us back to POV-Ray and some pre-rendered polyhedra downloaded off the netlib library.
""" Gentlemen! The course of lectures which I now begin will be an immediate continuation of, and a supplement to, my course of last Winter. My purpose now, as it was then, is to gather together all the mathematics that you studied during your student years, insofar as this could e of interest for the future teacher, and in particular, so show its bearing on the business of school instruction. """ Felix Klein, Elementary Mathematics from and Advanced Standpoint, 1908 Klein being a Great Mind in mathematics at the dawn of modernity, who turned his attention, intellect and energy to the problem of education at the "school" level. To me, he is a great redactor of modern mathematical ideas to his day, and in that sense in the spirit of Euclid. And what Klein prescribes in the end sounds much like a primer on the underlying mathematics and ideas which we now know as the fundamentals of computer vector graphics. Except that we tend to know these ideas, and teach them, out of the their historical and intellectual context. And there is an argument that one cannot truly understand modern intellectual sensibility without some grasp of these ideas, at least in their spirit. Klein also being instrumental in opening his University's math department to women. And apparently, in the eyes of his students, living up his essential ideal as a teacher - "Never be dull" Side-trip: The quaternion: http://mathworld.wolfram.com/Quaternion.html Quaternions - mid-1800's idea extending the concepts of so-called imaginary numbers to new dimensions, and becoming the basis for the development of vector mathematics, mathematical physics, and - in some sense modernity - itself. And a fundamental tool in the mathematics of 3d computer graphics and probably known most commonly now in that context - but too often - out of its historical context, and without understanding of its historical significance. So my short manifesto is only ratifying the importance of where I think Kirby is already going and what he is already doing. Computer graphics, good. Computer graphics with pretense, better. Art
-----Original Message----- From: Arthur [mailto:ajsiegel@optonline.net] Sent: Saturday, February 19, 2005 6:57 PM To: 'Kirby Urner'; edu-sig@python.org Subject: RE: [Edu-sig] python satacad: class 6
...
And what Klein prescribes in the end sounds much like a primer on the underlying mathematics and ideas which we now know as the fundamentals of computer vector graphics. Except that we tend to know these ideas, and teach them, out of the their historical and intellectual context.
Yeah, I wondered if you were referring to Quaternions and see from your concluding quote that you were. As it happens, the "more fully developed vector class" I was describing is pretentious in just this way: if you multiply by a scalar, the vector elongates or shrinks, like any good little vector. But if you try to multiply by another vector, well then, both suddenly become quaternions at that point -- though the result is returned as a vector. def __mul__(self, other): """ Might be just scalar multiplication, but if the arg is another vector, let's go through the motions of quaternion * quaternion """ if type(other) == type(self): # treat mul as quaternion mul # (v1 x v2) + (s1*v2) + (s2*v1) newv = self.cross(other) + (self.s * other) + (other.s * self) # s1*s2 - v1.v2 where s1 is self.s, v1 is self.v newv.s = (self.s * other.s) - self.dot(other) return newv if type(other) in [type(1.0), type(1)]: # or do scalar mul return Vector3d(self.x * other, self.y * other, self.z * other) __rmul__ = __mul__ http://www.4dsolutions.net/satacad/pytools/ -- see vector.py But I didn't get into this at all with the kids today. There's some excellent book on the history of vectors, one of those Dover books -- talks about how the Gibbs-Heaviside approach gradually took hold and that's what we generally taught in the 1900s. But computer gaming helped quaternions make a come back. I used to post about this stuff quite a bit -- buried in the Math Forum archives probably. Yeah, here's the book, listed in the bibliography on that Quaternions page at MathWorld: http://www.amazon.com/exec/obidos/tg/detail/-/0486679101/ Kirby
Behalf Of Kirby Urner We all installed Pygeo and played with the examples for awhile (Islamic Patterns especially).
Those are from a book called Islamic Patterns by Keith Critchlow, who I think you told be worked with Fuller, What I am playing with there in my own mind - and just playing, nothing very well achieved - are algorithms as patterns realizing visual patterns. I do a "drawing" in a non-algorithmic manner, sort of how one might draw it by hand, and then try to duplicate the same drawing taking an algorithmic approach. Meant something to me at the time, but as I say, wouldn't expect that something would be communicated by what is actually there. As it happens had lunch yesterday with an Islamic friend. Who was explaining to me something about yesterday as a Holy Day in the faith, but one in which Sunni and Shiite practice and ideas diverge vehemently, it being a holiday having something to do with the succession to the Prophet, which is in particular, apparently, the branches diverge. And why it seems to be a day of fraternal fighting. He was also trying to convince me it was an important Jewish holiday, because I believe in the context of the event being celebrated in the Islamic faith, it was considered to coincide with an event in the Jewish calendar. Wasn't aware of yesterday as a significant day in the Jewish calendar, but that doesn't necessarily mean it wasn't. Python. I it was really a business discussion. He has a technology background. Oracle sys admin mostly. But he has lost touch as a hands on guy, is having trouble making a living, and this was something of a strategy session. He wanted me to look at a product that he is interested in supporting and selling. It's a Business Mapping tool, part of a Business Process Management suite developed out of New Zealand. Hot stuff. And we start it up, and I see in the status bar, quite out of the blue "...initializing Python". More digging, it is developed in Delphi, with Python embedded as a glue piece, and with a wonderful little tool to walk people who may not know Python through the process of writing Python glue scripts. Anyway... Art
Arthur wrote on 2005-02-20:
He was also trying to convince me it was an important Jewish holiday, because I believe in the context of the event being celebrated in the Islamic faith, it was considered to coincide with an event in the Jewish calendar. Wasn't aware of yesterday as a significant day in the Jewish calendar, but that doesn't necessarily mean it wasn't.
A Jewish holiday for some definition of a Holiday :-). This Saturday was the first day ("Rosh Hodesh" = "Head of a Month") of Adar II (this year being a leap year with a second Adar month added). Friday was the 30th day of the previous month (Adar I), which is also considered a Rosh Hodesh (but not all monthes have a 30th day). A Rosh Hodesh is not really celebrated, it only has some extended/different prayers (it was a more important event long ago, when (1) there was a temple in Jerusalem and (2) it was determined from observing the new moon and the news were distributed to the whole nation to start counting a new month). Anyway, the Rosh Hodesh of Adar (II) is slightly special, Adar (II) being the month containing the Purim holiday is held to be merry month. "Mishenichnas Adar marbim besimcha" - "Since Adar enters, be more joyful". But it's still not really celebrated (except by students perhaps). Also, the Islamic holiday cannot always coincide with a Jewish holiday because the Islamic calendar constantly drifts relative to the Sun (having no leap monthes it misses about 11 days per year). Some years from now it will occur in the summer, while Adar is always in the winter. So he could only mean the coincidence to have some meaning at this specific year. [Pardon me if I'm explaining the obvisous, when I'm don't know the correspondent's level I tend to err on the side of too much details] -- Beni Cherniavsky <cben@users.sf.net> Note that I can only read emails on week-ends.
-----Original Message----- From: Beni Cherniavsky [mailto:cben@users.sf.net]
Arthur wrote on 2005-02-20:
Also, the Islamic holiday cannot always coincide with a Jewish holiday because the Islamic calendar constantly drifts relative to the Sun (having no leap monthes it misses about 11 days per year). Some years from now it will occur in the summer, while Adar is always in the winter. So he could only mean the coincidence to have some meaning at this specific year. [Pardon me if I'm explaining the obvisous, when I'm don't know the correspondent's level I tend to err on the side of too much details]
Well I am Jewish, and the explanation as to Adar is interesting, and new, to me - so I doubt you are stating the obvious to a more general population. Though I did know that Purim is a holiday where the faithful are supposed to let loose a bit and have one (or two) too many - a vestige of old school religion - intoxication as a religious rite being core to religious experience to, say, the American Indian but outside the experience of the Christian and Islamic faiths, as far as I am aware. The issues of calendar (and more particularly time) synchronization happens to be of current interest to me. I am the kind of Jew who celebrates High Holy Days, in some manner - and not much more. Ekrem and I used to work at the same firm, He is more observant in his faith than I am in mine, and therefore keeps with him a calendar which gives the prayer times on a daily basis. I would ask him for the time of sundown on holidays I do observe (in my way) - knowing that probably even on the question of the time of sundown our faiths depart, but that his time was good enough for my purposes. The history of science being a keen interest of mine - I had just picked up the book: Einstein's Clocks and Poincare's Maps by Peter Galison just out in paperback. Have not gotten too far into it, but I think Galison is making and following the point - as to Einstein - that it is no small matter that he was working at a Patent Office in Switzerland when formulating his ideas - the accuracy of clocks and the synchronization of time among clocks being a very active concern of the applied technologists of his time, and particularly within his jurisdiction - which Galison thinks, logically, helped provoke Einstein's thinking. Of course Anna will nail all this down for us with her presentation at PyCon: """ The Time of Day """ walking us through, I think, the Python tools available for keeping ourselves in sync. Art
participants (4)
-
Arthur
-
Beni Cherniavsky
-
Kirby Urner
-
Scott David Daniels