From murtuzainn at gmail.com Wed Mar 2 13:14:02 2005 From: murtuzainn at gmail.com (Murtuza Ali) Date: Wed Mar 2 13:14:06 2005 Subject: [Edu-sig] How to use gtk + in python Message-ID: <988e3a80503020414682b1ec0@mail.gmail.com> I m using windows xp, i have installed python 2.4 and also pygtk....its working well. Now i need to install gtk so i have installed gtk run time environment for win 32. But problem is that i m unable to use gtk libraries as i type the command import gtk it gives error that no module name gtk found i think i have not make the refrence of gtk in python... can any one help me out my Python is installed in c:\Python2.4 and gtk in c:\GTK From winstonw at stratolab.com Wed Mar 2 16:25:32 2005 From: winstonw at stratolab.com (Winston Wolff) Date: Wed Mar 2 16:25:38 2005 Subject: [Edu-sig] Re: visual programming In-Reply-To: <42234C40.1080707@gmx.de> References: <20050228110003.C3C3C1E400B@bag.python.org> <42234C40.1080707@gmx.de> Message-ID: <081484cc3361689e5c9b4ae9cffb3da4@stratolab.com> I think Delphi is a great language, and I would say Python and Delphi are similarly easy to teach. The more important question is how you teach programming, not what language. But some languages put more obstacles in your way, like C++'s complicated syntax and memory management. -winston On Feb 28, 2005, at 11:52 AM, Christian Mascher wrote: > Hi, > > why is it that delphi isn't mentioned very often in this context on > this list? At least in german high-schools delphi is the strongest > competitor with java (and a share of python and other exotica). > > I know it is not free, but you can download it for private use from > borland and it certainly is a very sophisticated visual environment > plus a fullblown objectoriented language. It is amazingly easy to use, > even if you don't like pascal (I don't). And the compiler is very > quick. > > I sure prefer Python, but if I have to choose between Java and > Delphi/Kylix I don't know. The delphi-ide takes away much of the > stupid syntax-teaching-chore - which tends to be a much smaller > problem with Python. With three 3/4-hours a week I actually shouldn't > have the time to teach real programming (the syntax stuff), ideas are > more important. Thus my interest for tools which get out of the way. > > Of course the problem with delphi is: can you interest your students > for the behind-the-scenes-stuff (for instance: how the GUI works), if > the program is already a "finished" GUI right away? > > And: when forced to use Delphi, I miss IDLE and the simple print > statement most. For examining algorithms this is simply the best. > > Any one else used/teached with Delphi? > > Christian > > > Kirby wrote: >> Also, on the GUI front, I think a nice compromise, if you're not >> wanting to >> code up inside of Tk (e.g. with John's graphics.py) or wx, is to do >> cgi and >> use the browser as your GUI. >> Even with a whiz bang GUI, there's still a question: what does your >> program >> *do*? i.e. what's the GUI about? One needs at least *some* guts >> behind the >> cosmetics. >> As a FoxPro programmer, I know the appeal of dragging widgets from >> palettes >> the Microsoft way. Speaking of FoxPro, I'd choose VFP over VB any >> day for teaching. > > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > _________________________________________ winston wolff - (646) 827-2242 - http://www.stratolab.com - learning by creating -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2579 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050302/d70c00d0/attachment.bin From florian.reichl at gmail.com Wed Mar 2 16:37:29 2005 From: florian.reichl at gmail.com (Florian Reichl) Date: Wed Mar 2 16:37:32 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinter documentation (like the Java documentation) Message-ID: Hello everybody, before using Python I was using Java in class. I really like Python. It has a lot of advantages. But I am missing the good documentation provided with Java! Look at this: http://java.sun.com/j2se/1.5.0/docs/api/index.html Here you find every class. And if you look at a class you see all its methods, constructors and fields. You find the class hierachy it inherited and all the subclasses. That makes it easy to use and navigate. Is there anything like that made for Python??? Thank you for all pointers, links and ideas! Best regards, Florian P.S.: Where do I find the official Tkinter documentation? From florian.reichl at gmail.com Wed Mar 2 17:03:54 2005 From: florian.reichl at gmail.com (Florian Reichl) Date: Wed Mar 2 17:03:58 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinter documentation (like the Java documentation) Message-ID: Hello everybody, before using Python I was using Java at school. I really like Python. It has a lot of advantages. But I am missing the good documentation provided with Java! Look at this: http://java.sun.com/j2se/1.5.0/docs/api/index.html Here you find every class. And if you look at a class you see all its methods, constructors and fields. You find the class hierachy it inherited (and their methods) and all the subclasses. That makes it easy to use and navigate. Is there anything like that made for Python??? Thank you for all pointers, links and ideas! Best regards, Florian P.S.: Where do I find the official Tkinter documentation? From dooms at info.ucl.ac.be Wed Mar 2 18:09:25 2005 From: dooms at info.ucl.ac.be (=?ISO-8859-1?Q?Gr=E9goire_Dooms?=) Date: Wed Mar 2 17:12:37 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinter documentation (like the Java documentation) In-Reply-To: References: Message-ID: <4225F345.5090603@info.ucl.ac.be> Florian Reichl wrote: >Look at this: >http://java.sun.com/j2se/1.5.0/docs/api/index.html >Here you find every class. And if you look at a class you see all its >methods, constructors and fields. >You find the class hierachy it inherited and all the subclasses. >That makes it easy to use and navigate. > >Is there anything like that made for Python??? > > The most comprehensive documentation I know for Tkinter is http://infohost.nmt.edu/tcc/help/pubs/tkinter.pdf It's very useful but I dislike the minimal application example at the beginning because it inherits from Frame and does self.grid() in __init__ Hope this helps. -- Gr?goire Dooms From david at handysoftware.com Wed Mar 2 17:35:05 2005 From: david at handysoftware.com (David Handy) Date: Wed Mar 2 17:34:53 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinter documentation (like the Java documentation) In-Reply-To: References: Message-ID: <20050302163505.GA17764@arno2> On Wed, Mar 02, 2005 at 05:03:54PM +0100, Florian Reichl wrote: > before using Python I was using Java at school. > I really like Python. It has a lot of advantages. > But I am missing the good documentation provided with Java! > > ... > > Is there anything like that made for Python??? > > ... > > P.S.: Where do I find the official Tkinter documentation? Have you ever run pydoc? On windows: Programs->Python 2.4->Module Docs Click the "browse" button and look through documentation automatically extracted from all the module files in your PYTHONPATH -- the standard Python library plus whatever else you have installed. Then of course there are the official online docs for the Python standard library, which I find quite useful and at least as good as the corresponding online Java API documentation: http://docs.python.org/ As for Tkinter, well, that happens to be the weakest point. Unlike the other standard Python packages, it is not fully documented in the "official" docs -- for example, you won't find a complete description of Tkinter.Canvas there. Instead, when you go to http://docs.python.org/lib/module-Tkinter.html you'll find some general overview and examples, and then you're referred to other resources. I found John Grayson's "Python and Tkinter Programming" book most useful; I wouldn't be using Tkinter without it. I wouldn't complain too much about them not filling up the online docs with hundreds of pages of Tkinter material. Most graphical frameworks are complex enough to merit a book of some kind; I wouldn't try to learn Swing from the online Java API documents! David H. From florian.reichl at gmail.com Wed Mar 2 18:16:15 2005 From: florian.reichl at gmail.com (Florian Reichl) Date: Wed Mar 2 18:16:19 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinter documentation (like the Java documentation) In-Reply-To: <20050302163505.GA17764@arno2> References: <20050302163505.GA17764@arno2> Message-ID: On Wed, 2 Mar 2005 11:35:05 -0500, David Handy wrote: > Have you ever run pydoc? No, I didn't. > On windows: Programs->Python 2.4->Module Docs On (Debian) Linux: /usr/lib/python2.3/pydoc.py -g Wow - I didn't know that something like this exists. If I knew I would not not have asked about the documentation in "the Java way". > http://docs.python.org/ Of course I know them but I think they are hard to navigate - at least I'm not used to reading them. > As for Tkinter, well, that happens to be the weakest point. Unlike the other > standard Python packages, it is not fully documented in the "official" docs But I found a lot of Tkinter information using pydoc. > I found John Grayson's "Python and Tkinter Programming" > book most useful; I wouldn't be using Tkinter without it. I'll have a look at it. The best introduction for Tkinter for me was http://www.ferg.org/thinking_in_tkinter/ > I wouldn't complain too much about them not filling up the online docs with > hundreds of pages of Tkinter material. Most graphical frameworks are complex > enough to merit a book of some kind; I wouldn't try to learn Swing from the > online Java API documents! Of course not - but it helps if you can reference the libs it later. Thanks a lot - this war really helpful to me! Best regards, Florian From drlinux at columbus.rr.com Wed Mar 2 19:20:57 2005 From: drlinux at columbus.rr.com (Dave Reed) Date: Wed Mar 2 19:21:04 2005 Subject: [Edu-sig] Re: How to use gtk + in python In-Reply-To: <988e3a80503020414682b1ec0@mail.gmail.com> References: <988e3a80503020414682b1ec0@mail.gmail.com> Message-ID: <200503021320.57141.drlinux@columbus.rr.com> On Wednesday 02 March 2005 07:14, Murtuza Ali wrote: > I m using windows xp, i have installed python 2.4 and also > pygtk....its working well. Now i need to install gtk so i have > installed gtk run time environment for win 32. But problem is that i m > unable to use gtk libraries as i type the command > import gtk > it gives error that no module name gtk found > i think i have not make the refrence of gtk in python... > can any one help me out > my Python is installed in c:\Python2.4 > and gtk in c:\GTK > It's been a while since I've tried to get pygtk running on Windows. You need to set some enviornment variables. Follow the directions at: http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&sd=tech and set the PATH environment variable so it includes both the lib and bin directory where gtk/pygtk is installed. HTH, Dave From urnerk at qwest.net Thu Mar 3 17:08:12 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 3 17:08:16 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinterdocumentation (like the Java documentation) In-Reply-To: Message-ID: <20050303160815.119CC1E4004@bag.python.org> > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Florian Reichl > Sent: Wednesday, March 02, 2005 9:16 AM > To: David Handy; Edu-sig@python.org > Subject: Re: [Edu-sig] Looking for a comprehensive Python and > Tkinterdocumentation (like the Java documentation) > > On Wed, 2 Mar 2005 11:35:05 -0500, David Handy > wrote: > > Have you ever run pydoc? > > No, I didn't. > > > On windows: Programs->Python 2.4->Module Docs > > On (Debian) Linux: /usr/lib/python2.3/pydoc.py -g You can run pydoc as a server and hit it with your browser: """ Run "pydoc -p " to start an HTTP server on a given port on the local machine to generate documentation web pages. """ However, I'm having trouble getting this to work in Python 2.4 on WinXP, per the traceback below: D:\Python24\Lib>python pydoc.py -p 7887 Traceback (most recent call last): File "pydoc.py", line 55, in ? import sys, imp, os, re, types, inspect, __builtin__ File "D:\Python24\Lib\re.py", line 5, in ? from sre import * File "D:\Python24\Lib\sre.py", line 97, in ? import sre_compile File "D:\Python24\Lib\sre_compile.py", line 17, in ? assert _sre.MAGIC == MAGIC, "SRE module mismatch" AssertionError: SRE module mismatch On the other hand, when I change to Python 2.3 and try the same thing, it works: D:\Python24\Lib>cd.. D:\Python24>cd .. D:\>cd python23 D:\Python23>cd lib D:\Python23\Lib>python pydoc.py -p 7887 pydoc server ready at http://localhost:7887/ Anyone able to get the 2.4 pydoc server working in Windows? Kirby From david at handysoftware.com Thu Mar 3 17:18:05 2005 From: david at handysoftware.com (David Handy) Date: Thu Mar 3 17:17:58 2005 Subject: [Edu-sig] Looking for a comprehensive Python and Tkinterdocumentation (like the Java documentation) In-Reply-To: <200503031608.j23G8Did016875@handysoftware.com> References: <200503031608.j23G8Did016875@handysoftware.com> Message-ID: <20050303161805.GA20061@arno2> On Thu, Mar 03, 2005 at 08:08:12AM -0800, Kirby Urner wrote: > You can run pydoc as a server and hit it with your browser: > > """ > Run "pydoc -p " to start an HTTP server on a given port on the > local machine to generate documentation web pages. > """ > > However, I'm having trouble getting this to work in Python 2.4 on WinXP, per > the traceback below: > > D:\Python24\Lib>python pydoc.py -p 7887 > Traceback (most recent call last): > File "pydoc.py", line 55, in ? > import sys, imp, os, re, types, inspect, __builtin__ > File "D:\Python24\Lib\re.py", line 5, in ? > from sre import * > File "D:\Python24\Lib\sre.py", line 97, in ? > import sre_compile > File "D:\Python24\Lib\sre_compile.py", line 17, in ? > assert _sre.MAGIC == MAGIC, "SRE module mismatch" > AssertionError: SRE module mismatch > > > On the other hand, when I change to Python 2.3 and try the same thing, it > works: > > D:\Python24\Lib>cd.. > > D:\Python24>cd .. > > D:\>cd python23 > > D:\Python23>cd lib > > D:\Python23\Lib>python pydoc.py -p 7887 > pydoc server ready at http://localhost:7887/ > > Anyone able to get the 2.4 pydoc server working in Windows? > > Kirby It works great for me: C:\Python24>python -m pydoc -p 3999 pydoc server ready at http://localhost:3999/ (Using the nice new -m flag to run a module from the command line.) Just a thought - do you still have Python23 in your PATH? It looks like you might be trying to run the 2.4 version of pydoc using the 2.3 version of python. David H. From damonbryant at msn.com Thu Mar 3 17:36:03 2005 From: damonbryant at msn.com (damon bryant) Date: Thu Mar 3 18:36:05 2005 Subject: [Edu-sig] Computer-Adaptive Test of Python Message-ID: Is anyone interested in making a computer-adaptive test of the Python programming language for use in education? I have conducted research at the Educational Testing Service in Princeton (New Jersey, USA) on computer-adaptive testing. Being totally new to programming, I was able to learn the language in about 2 months and used Python to complete my dissertation (i.e., presenting the proposal, conducting the research, writing up the results, and orally defending the dissertation) in about six months! After using Python for about a year, I am convinced that the language will have lots of application in education and industry. However, I have not found any web-based tests for industry or education on the open-source language. Because science will soon become a mandatory part of K-12 assessment in all US states, I would like to assist in positioning Python as a first computer science language to be taught in middle and high school by providing standard assessments to support the teaching of the language. If an assessment is provided online where teachers or proctors can register and log in students at a website, students can take the test and teachers will be provided feedback immediately about student's performance in different content areas (e.g., functions, exceptions, inheritance, lists, dictionaries, strings, and other OO concepts). This ultimately gives teachers more time to teach and allows student to receive questions that are appropriate for their ability: paper and pencil tests with fixed content or randomized content fails in this regard. In addition, the time it takes to grade tests in the traditional classroom sense is a day or two; this time is reduced to the time it takes to check your e-mail. To experiment with the concept of having an online computer-adaptive test, I developed a site, https://adaptivetestingservices.net/sign_in.html . It is by no means complete, but it is functional to get an idea of the possibility (Note: I'm a newbie in CS so forgive me if the are some errors.) The site allows you to register an examinee, and automatically sends a username and password to the provided email address. Once the user enters the site, he/she can take a sample demo of president and US currency knowledge (simple content to demonstrate). In operation, the item pool would be much larger and the item parameters would be calibrated. The ability estimate is shown at the bottom right with the error in the estimate under it; this will be removed in operation. Imagine Python content! If anyone is interested either post a message or send me an e-mail at damon_bryant2004@yahoo.com. By the way, the entire site is HTML and Python! Regards, DB -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/edu-sig/attachments/20050303/9cb77a5f/attachment.html From urnerk at qwest.net Thu Mar 3 19:56:26 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 3 19:56:30 2005 Subject: [Edu-sig] Looking for a comprehensive Python andTkinterdocumentation (like the Java documentation) In-Reply-To: <20050303161805.GA20061@arno2> Message-ID: <20050303185628.927D81E4004@bag.python.org> > C:\Python24>python -m pydoc -p 3999 > pydoc server ready at http://localhost:3999/ > (Using the nice new -m flag to run a module from the command line.) > Just a thought - do you still have Python23 in your PATH? It looks like > you might be trying to run the 2.4 version of pydoc using the 2.3 version > of python. > > David H. I think you're right. Without using the -m switch, I found myself down in /lib, and booting pydoc from there, which triggered a path search, which found 2.3. Now if I go in python24 directory and use -m switch, it finds the right Python without using the path. Cool. And thank you. Kirby PS: on another note, I see Danny Yoo's new scanf module seems to not be in the 2.4 standard library, though it was in 2.3. From Scott.Daniels at Acm.Org Fri Mar 4 00:47:08 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Fri Mar 4 00:48:34 2005 Subject: [Edu-sig] Re: Computer-Adaptive Test of Python In-Reply-To: References: Message-ID: <4227A1FC.90403@Acm.Org> damon bryant wrote: > ... experiment[ing] with the concept of an online computer-adaptive test, ... Take a look at research done in the 1970s at the Institute for Mathematical Studies in the Social Sciences (a Stanford University research institute). They did a lot of strong work on keeping the student at 80% correct in several kinds of subject areas. The learning rate they found on those systems was substantially greater than one grade-level per year without extra contact hours. --Scott David Daniels Scott.Daniels@Acm.Org From ajsiegel at optonline.net Sat Mar 5 16:05:09 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 5 16:05:44 2005 Subject: [Edu-sig] From Nand to Tetris in 12 Steps Message-ID: <0ICV00IKZWKQVD@mta3.srv.hcvlny.cv.net> Exciting stuff, in my view - which once gain I became aware of by monitoring PlanetPython. This cite by Ned Batchelder http://www.nedbatchelder.com/blog/ I would hope that folks will at least get as far as looking at the presentation: "From Nand to Tetris in 12 Steps" that is linked from Ned's site. Further exploration of the surrounding resources, authors, institutions involved in this effort I discover an educational approach that seems refreshingly 'reasonable', which doesn't sound like particularly high praise, though I mean it to be. Among other things: A very interesting effort to provide tools to teach the low-level view of using a high level language - a step which in my self-directed approached I skipped, but certainly not without consequences. "Lite" version, which might make an excellent early stage of a introductory cs course using Python - giving orientation a bit to the forest, before the look at the trees. http://www1.idc.ac.il/vic/ """ What is Vic? The Visual Computer (Vic) is an interactive simulation of a general-purpose digital computer. The objective of Vic is to walk the student through some of the most fundamental ideas underlying the design of modern computers. As a side effect of this tour, the student also gains a hands-on and friendly introduction to programming. In Vic, everything is done, taught, and illustrated through computer programs, written in the Vic language. This language has ten commands that can be mastered in just a few minutes. Yet behind this simplicity lies a great power: every program, written in any language, can be translated into an equivalent Vic program that produces precisely the same results. """ Not totally dissimilar - I think - in approach to GvRobot (and its successor) but with different lower level goals >From the same institute and author, the recently published "The Elements of Computing Systems: Building a Modern Computer From First Principles" http://www1.idc.ac.il/tecs/ which is more heavyweight, geared to CS and engineering students at the college level and graduate level. From murtuzainn at gmail.com Mon Mar 7 05:50:34 2005 From: murtuzainn at gmail.com (Murtuza Ali) Date: Mon Mar 7 05:50:37 2005 Subject: [Edu-sig] Networking in DOSEMU Message-ID: <988e3a8050306205042530ff4@mail.gmail.com> Hi, I want to ask something not concerning python. actualy i want to know how can i connect to my novel server thru dosemu. i m using fedora core 2 , i can connect to my novel server from my linux box using ipx protocol..but my need is that i want to connect to my novel server from dos emulator (free dos) i m using dosemu ver 1.2. plz if u can do me any favour..it will be very helpful thanks Murtuza From gen2n at seznam.cz Mon Mar 7 10:31:15 2005 From: gen2n at seznam.cz (gen2n) Date: Mon Mar 7 10:32:28 2005 Subject: [Edu-sig] How to use gtk + in python In-Reply-To: <988e3a80503020414682b1ec0@mail.gmail.com> References: <988e3a80503020414682b1ec0@mail.gmail.com> Message-ID: <422C1F63.8060602@seznam.cz> I think your pygtk is not well done. Check in your site-packages if there is folder gtk-2.0, ?inside is gtk and type import sys sys.path and in this list you must have path to gtk-2.0 folder. If not, the problem is as I said, in your pygtk installation. Hope it works gen2n ICQ 176015287 Murtuza Ali napsal(a): >I m using windows xp, i have installed python 2.4 and also >pygtk....its working well. Now i need to install gtk so i have >installed gtk run time environment for win 32. But problem is that i m >unable to use gtk libraries as i type the command >import gtk >it gives error that no module name gtk found >i think i have not make the refrence of gtk in python... >can any one help me out >my Python is installed in c:\Python2.4 >and gtk in c:\GTK >_______________________________________________ >Edu-sig mailing list >Edu-sig@python.org >http://mail.python.org/mailman/listinfo/edu-sig > > > From sandysj at juno.com Mon Mar 7 21:43:26 2005 From: sandysj at juno.com (Jeff Sandys) Date: Mon Mar 7 21:44:35 2005 Subject: [Edu-sig] NCCE Seattle Mar 16-19 Message-ID: <20050307.124406.15302.73046@webmail24.nyc.untd.com> Is anyone from this group going to attend the Northwest Council for Computer Education in Seattle, March 16 thru 20th? http://www.ncce.org/ncce2005/index.html These conferences tend to be more of the how to use Powerpoint in the classroom level, than how to learn programming and understand computers, but I get a lot of ideas anyway. If you are going let me know so we can get together. Thanks, Jeff Sandys ___________________________________________________________________ Speed up your surfing with Juno SpeedBand. Now includes pop-up blocker! Only $14.95/month -visit http://www.juno.com/surf to sign up today! From missive at hotmail.com Wed Mar 9 02:45:20 2005 From: missive at hotmail.com (Lee Harr) Date: Wed Mar 9 02:45:24 2005 Subject: [Edu-sig] Re: Networking in DOSEMU Message-ID: >I want to ask something not concerning python. Here, you give yourself an excellent hint that this is the wrong place to ask this question. >actualy i want to know how can i connect to my novel server thru dosemu. Here, I am wondering if you mean Novell. Searching is facilitated by correct spelling of the thing you seek. Let's take a look... http://www.google.com/search?q=dosemu+mailing+list Strangely, not the first hit on google, but the 3rd hit looks pretty good: http://dosemu.sourceforge.net/mailinglist.html good luck! _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.com/ From urnerk at qwest.net Fri Mar 11 18:43:25 2005 From: urnerk at qwest.net (Kirby Urner) Date: Fri Mar 11 18:43:27 2005 Subject: [Edu-sig] Hypertoons! In-Reply-To: Message-ID: <20050311174326.488E51E400A@bag.python.org> I've made some headway implementing a primitive hypertoon using VPython. I came up with the hypertoon concept some years back, per this 1996 web page: http://www.grunch.net/synergetics/hypertoon.html The basic idea is you have this set of key frames, say A-F, and a set of cartoons or "scenarios" which always start and finish with one of the key frames. In between you have some transformation that takes you smoothly from the starting key frame to the ending one. A dictionary of scenarios might look like this: scenarios = {} # Scenario( function, starting frame, ending frame) scenarios['sc0'] = Scenario(trans0, 'A', 'B') scenarios['sc1'] = Scenario(trans1, 'A', 'C') scenarios['sc2'] = Scenario(trans2, 'A', 'D') scenarios['sc3'] = Scenario(trans3, 'B', 'C') scenarios['sc4'] = Scenario(trans4, 'C', 'D') scenarios['sc5'] = Scenario(trans5, 'D', 'B') ... So you get this spaghetti ball, or network, of interconnected nodes (the key frames), all interconnected by transformations (the scenarios). At each node, you may randomize the selection process, as to where to go next. def play(self, n): node = keyframes[0] lastthing = None for i in xrange(n): nodelist = self.nodes[node] # list of candidate toons nextsc = nodelist[randint(0,len(nodelist)-1)] # random pick lastthing = self.scenarios[nextsc].play(lastthing) # play it node = self.scenarios[nextsc].finish # here's where you end up The result is a continuous smooth motion visualization, with a lot of repetition, and with a lot of random sequencing. If the network is quite large, then you might keep seeing new stuff even after quite some time. Per my interest in geometry, my theme for my first VPython hypertoon is polyhedra and their interrelationships per what Bucky Fuller called the concentric hierarchy (or cosmic hierarchy when he was being cosmic). I started out with the following key frames: # A: rh dodeca all alone # B: octahedron all alone # C: cube all alone # D: tetra all alone Later I added: # E: cubocta all alone # F: Icosa all alone Not sure what's with this "all alone" -- emphasizing that we end up with nothing else on stage I guess. The first thing I did was script scenarios among the initial four key frames. I wrote a transformation in each direction, e.g. if there's a toon from A to B, there's also one from B to A. By transformation I don't mean anything very fancy. I basically just trace out edges (they progressively elongate, so each scenario takes a few seconds -- I adjust the frame rate). For example: def trans10(thing): print "trans10: tetra -> cube" tet = rbf.Tetra() # D: tetra all alone tet.draw() if thing is not None: thing.delete() invtet = rbf.Invtetra() invtet.draw(trace=True) cb = rbf.Cube() cb.draw(trace=True) tet.delete() invtet.delete() # C: cube all alone return cb Here we're going from the tetrahedron key frame to the cube key frame. I do this by drawing an inverted tetrahedron (black), intersecting the first one's mid edges, then connecting the resulting 8 points by tracing out a (green) cube. Then I delete the two tetrahedral, leaving only the cube. There's one subtlety here: each scenario returns the final polyhedron as an object, and this gets passed in to the next scenario as an argument. The next scenario then superimposes an identical shape, before deleting the one that got passed in. The purpose is to create overlap, so there's no point at which the stage is entirely empty. The fanciest I've gotten with the transformations so far is between E and F (the icosahedron and the cuboctahedron). For those of you familiar with Bucky's geometry (actually a philosophy), there's this thing called the jitterbug transformation that relates the two. I found this somewhat difficult to implement in VPython and ended up with a kind of double-buffering, where two polyhedra progressively draw and delete themselves as the vertices shift position. I'm posting the source code to my web site, in case you want to eyeball it in any detail (or even run it). I'll be changing it of course, as time permits. This version requires Python 2.4, meaning I'm using the VPython 2.4 experimental. However, it'd take only minor tweaks to make it run in 2.3 (I treat 'set' as a built-in and use 'sorted' is all). hypertoons.py -- the main module wherein all the scenarios are defined and from whence the hypertoon is launched rbf.py -- a library of concentric hierarchy shapes, repurposed from POV-Ray work to support VPython vectors instead. The repurposing is incomplete and fuzzy around the edges. coords.py -- where I've rolled my own vector classes, except now I hardly need 'em cuz I'm using VPython's native class. See: http://www.4dsolutions.net/ocn/python/hypertoons/ The only reason coords.py is still in the picture is I get the whole show rolling by defining a large set of vertices as globals within rbf.py. These are the key "points of interest" within the concentric hierarchy, out of which all the polyhedra are built. For historical reasons, these key points start out being defined in this weird coordinate system defined by four rays emanating from the center of a tetrahedron to its four corners, labeled (1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1) -- a coordinate system that requires no negative numbers. It so happens that our points of interest are very easily expressed as vector sums (linear combinations) of these four. I immediately convert these weirdo vectors to traditional XYZ vectors in rbf.py, but I'm still using the old coords.py to start with with "Qvectors" (Q for Quadrays)[1]. Here's what that looks like in more detail (defining A-Z): ORIGIN = vector(0,0,0) A = vector(Qvector((1,0,0,0)).xyz) # center to corner of tetrahedron B = vector(Qvector((0,1,0,0)).xyz) # " C = vector(Qvector((0,0,1,0)).xyz) # " D = vector(Qvector((0,0,0,1)).xyz) # " # tetrahedron's dual (also a tetrahedron i.e. inverted tet) E,F,G,H = B+C+D,A+C+D,A+B+D,A+B+C # tetrahedron + dual (inverted tet) = duo-tet cube # octahedron vertices from pairs of tetrahedron radials I,J,K,L,M,N = A+B, A+C, A+D, B+C, B+D, C+D # octahedron + dual (cube) = rhombic dodecahedron # cuboctahedron vertices from pairs of octahedron radials O,P,Q,R,S,T = I+J, I+K, I+L, I+M, N+J, N+K U,V,W,X,Y,Z = N+L, N+M, J+L, L+M, M+K, K+J Kirby PS: Something I've discovered about VPython: apparently copy.deepcopy doesn't work reliably to copy vector objects. [1] http://www.grunch.net/synergetics/quadintro.html From urnerk at qwest.net Fri Mar 11 22:38:15 2005 From: urnerk at qwest.net (Kirby Urner) Date: Fri Mar 11 22:38:18 2005 Subject: [Edu-sig] Hypertoons! In-Reply-To: <20050311174326.488E51E400A@bag.python.org> Message-ID: <20050311213817.7BE0D1E4005@bag.python.org> > hypertoons.py > rbf.py ... > coords.py... > See: http://www.4dsolutions.net/ocn/python/hypertoons/ There was another dependency I spaced mentioning: colors.py -- just a mapping between color words and associated RGB strings, used in various programs I've got. I've added that to my site. Kirby From cben at users.sf.net Sat Mar 12 21:56:34 2005 From: cben at users.sf.net (Beni Cherniavsky) Date: Sat Mar 12 21:56:47 2005 Subject: [Edu-sig] python satacad: class 6 In-Reply-To: <0IC700CHKVRHLJ@mta3.srv.hcvlny.cv.net> References: <0IC700CHKVRHLJ@mta3.srv.hcvlny.cv.net> Message-ID: 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 Note that I can only read emails on week-ends. From cben at users.sf.net Sat Mar 12 22:49:29 2005 From: cben at users.sf.net (Beni Cherniavsky) Date: Sat Mar 12 22:49:33 2005 Subject: [Edu-sig] Re: Edu-sig Digest, Vol 19, Issue 22 In-Reply-To: <20050226112053.22037.qmail@web54610.mail.yahoo.com> References: <20050226112053.22037.qmail@web54610.mail.yahoo.com> Message-ID: Darren Payne wrote on 2005-02-26: > This year I have changed and moved to Gamemaker. I > have read huge amounts of material advocating > programming games as a way to encourage kids to think > - (analyse, synthesise, evaluate, plan, design, > manage, communicate) ... AND I have never seen such > enthusiasm for programming, smiles from ear to ear - > even the girls love it! BTW Gamemaker written in > Delphi - I think - and has its roots in Pascal. > Game Maker is real fun but quickly one bumps into the need to "real" programming operations that are more awkward than in a real language like Python. I'd like one day to develop ^H^H^H see (I don't want to commit to anything so big ;-)) a Python-based GameMaker. Presently, I think many nice things can be done with pygame and perhaps a bit of code wrapping it. -- Beni Cherniavsky Note that I can only read emails on week-ends. From john.zelle at wartburg.edu Sat Mar 12 23:37:35 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Sat Mar 12 23:38:28 2005 Subject: [Edu-sig] Hypertoons! In-Reply-To: <20050311213817.7BE0D1E4005@bag.python.org> References: <20050311213817.7BE0D1E4005@bag.python.org> Message-ID: <42336F2F.4060103@wartburg.edu> Kirby, Thanks for the update. I had tried to run this earlier and noticed the missing dependency, but had not yet tracked down what was up. I've got it running now (with a couple tweaks for Python 2.3). This is a nifty application for demonstrating stereo visualization. Just set scene2.stereo = 'redblue' and scene2.stereodepth = 1.5, slip on the red-blue glasses, and enjoy the show. Awesome. It's even better with active or passive stereo, but I know must of you don't have that option. Thanks loads for the posting. --John ps. For stereo, it generally works a bit better to set the background to medium gray (.5, .5, .5) rather than black or white. Kirby Urner wrote: >>hypertoons.py >>rbf.py ... >>coords.py... >>See: http://www.4dsolutions.net/ocn/python/hypertoons/ > > > There was another dependency I spaced mentioning: > > colors.py -- just a mapping between color words and associated RGB strings, > used in various programs I've got. > > I've added that to my site. > > Kirby > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > > From ajsiegel at optonline.net Sun Mar 13 13:46:46 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 13 13:46:55 2005 Subject: [Edu-sig] python satacad: class 6 In-Reply-To: Message-ID: <0IDA00INZJIA8J@mta1.srv.hcvlny.cv.net> > -----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 From ajsiegel at optonline.net Sun Mar 13 15:01:28 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 13 15:01:36 2005 Subject: [Edu-sig] Re: Edu-sig Digest, Vol 19, Issue 22 In-Reply-To: Message-ID: <0IDA0020NMYDAE@mta8.srv.hcvlny.cv.net> > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Beni Cherniavsky > Sent: Saturday, March 12, 2005 4:49 PM > > Presently, I think many nice things can be done with pygame and > perhaps a bit of code wrapping it. Lee Harr's pygsear not only provides the wrapping, but a curriculum based on it. http://www.nongnu.org/pygsear/doc/index.html I only wish that pygame was named otherwise - thinking that its general utility for educational purposes (and otherwise) is significantly broader that game making, and that the name misdirects folks. To me the "game" is in getting the computer to respond to one's instructions, and that directing the end product to be in particular a "game" in any normal sense of the word is unnecessarily limiting, and - IMO - not as generally appealing to beginners as seems to be assumed. I do think that visual and/or sound feedback is a great way to go, and in that sense, in particular, pygame provides a nice platform. Art From urnerk at qwest.net Sun Mar 13 18:43:46 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Mar 13 18:43:47 2005 Subject: [Edu-sig] Pygame, gameMaker etc. In-Reply-To: <0IDA0020NMYDAE@mta8.srv.hcvlny.cv.net> Message-ID: <20050313174346.BE0741E4006@bag.python.org> Arthur: > To me the "game" is in getting the computer to respond to one's > instructions, and that directing the end product to be in particular a > "game" in any normal sense of the word is unnecessarily limiting, and - > IMO - not as generally appealing to beginners as seems to be assumed. > Perhaps the solution is to get "game" to mean anything/everything, when we need it to. Wittgenstein: language games (anything we do with language) Bucky Fuller: world game (anything we do on Earth) That's a good start, i.e. you're in good company here. Kirby From ajsiegel at optonline.net Mon Mar 14 02:18:01 2005 From: ajsiegel at optonline.net (Arthur) Date: Mon Mar 14 02:18:14 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDA0063DX8XDH@mta25.srv.hcvlny.cv.net> Message-ID: <0IDB000CQIA2EI@mta8.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > Arthur: > > To me the "game" is in getting the computer to respond to one's > > instructions, and that directing the end product to be in particular a > > "game" in any normal sense of the word is unnecessarily limiting, and - > > IMO - not as generally appealing to beginners as seems to be assumed. > > > > Perhaps the solution is to get "game" to mean anything/everything, when we > need it to. There are head games and mind games and semantic games. And there are Purim games: http://www.bus.ualberta.ca/yreshef/purim/clown.html My father's game was boxing. Tough game. He won a tournament at college and came home proudly with the medal he earned. His stern and studious father reacted - in Yiddish. "" This, a medal? Mathematics is a medal! "" Guess I'm stuck in the same groove as grandpa, a bit. Art From urnerk at qwest.net Mon Mar 14 04:23:50 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Mar 14 04:23:52 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDB000CQIA2EI@mta8.srv.hcvlny.cv.net> Message-ID: <20050314032351.0B60A1E4006@bag.python.org> > My father's game was boxing. > Not mine. > Tough game. > Bet so. > He won a tournament at college and came home proudly with the medal he > earned. > > His stern and studious father reacted - in Yiddish. > > "" > This, a medal? > > Mathematics is a medal! > "" > Yiddish equally tough as boxing, if not more so. > Guess I'm stuck in the same groove as grandpa, a bit. > > Art > Or were you the guy who got hit? Kirby From urnerk at qwest.net Mon Mar 14 05:01:11 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Mar 14 05:01:12 2005 Subject: [Edu-sig] Hypertoons! In-Reply-To: <42336F2F.4060103@wartburg.edu> Message-ID: <20050314040111.D50B61E400C@bag.python.org> Thank you for these pointers John. I'm hungry to play this in stereo, primitive as it is, but a source of frustration in my life is I've lost that whole stack of paper 3d glasses I handed out (and collected back) at OSCON 2004. So this project to view in stereo is on hold. I'll search for the glasses again soon (box?), and/or invest in another stack (I want to at least have them by April, for use in class). On another front, of course I've fantasized about firing off two Hypertoon classes, each within the same domain of scenarios, but each running on its own thread, traveling the network solo (with threading essentially giving equal time to each). Once you've got two threads, you can get any number (processor limits make too many impractical). Given the way these toons are designed (they all traverse within what Fuller called the concentric hierarchy in synergetics), multiple play heads would play well together, adding to the intricacy of the effect. Plus I need more scenarios to begin with (growing and shrinking balls, stuff unfolding/refolding, tetrahedron inside-outing, more complete jitterbug...). Hopefully this Hypertoon idea goes open source in a big way. I've been trying to get it going since 1996, but people only really start to get it when they have working source code, i.e. obviously what I'm talking about is highly doable. And not just in Python (but hey, what a wonderful world in which to prototype!). Kirby > -----Original Message----- > From: John Zelle [mailto:john.zelle@wartburg.edu] > Sent: Saturday, March 12, 2005 2:38 PM > To: Kirby Urner > Cc: edu-sig@python.org > Subject: Re: [Edu-sig] Hypertoons! > > Kirby, > > Thanks for the update. I had tried to run this earlier and noticed the > missing dependency, but had not yet tracked down what was up. I've got > it running now (with a couple tweaks for Python 2.3). > > This is a nifty application for demonstrating stereo visualization. Just > set scene2.stereo = 'redblue' and scene2.stereodepth = 1.5, slip on the > red-blue glasses, and enjoy the show. Awesome. It's even better with > active or passive stereo, but I know must of you don't have that option. > > Thanks loads for the posting. > > --John > > ps. For stereo, it generally works a bit better to set the background to > medium gray (.5, .5, .5) rather than black or white. > From ajsiegel at optonline.net Mon Mar 14 13:56:36 2005 From: ajsiegel at optonline.net (Arthur) Date: Mon Mar 14 13:57:19 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDB002SSO3PPU@mta12.srv.hcvlny.cv.net> Message-ID: <0IDC004PLEMI32@mta6.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > He won a tournament at college and came home proudly with the medal he > > earned. > > > > His stern and studious father reacted - in Yiddish. > > > > "" > > This, a medal? > > > > Mathematics is a medal! > > "" > > > > Yiddish equally tough as boxing, if not more so. > > > Guess I'm stuck in the same groove as grandpa, a bit. > > > > Art > > > > Or were you the guy who got hit? > Certainly not by Dad, who was (and is) the gentlest of men. But I hit and got hit along the way. Being in the smart kids track, we tended to attract the attention of bullies. Having been born with boxing gloves in my crib, I was not ill-equipped to defend myself and my friends. Though I certainly took a few shots along the way. But of course this was in the days before one had to concern oneself with whether one's fifteen year-old adversary might be carrying a weapon. As you well know, my tendency toward pugilism has not disappeared - just evolved. For example -- I have been until now resisting sparring with you as to Fullerian geometry. There seems to be an obsession with regularity - in the Euclidian sense. Rigid motions of regular shapes - and in that sense it always seems to me to represent a pre-modern (non-Kleinian) conception of geometry. So whereas our interests, obsessions seem to have some commonality - it is always interesting to - as well - trade some shots, over what appear to be our differences. Though perhaps here is not the place. Art From urnerk at qwest.net Mon Mar 14 17:21:26 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Mar 14 17:21:29 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDC004PLEMI32@mta6.srv.hcvlny.cv.net> Message-ID: <20050314162127.CC0081E4006@bag.python.org> > As you well know, my tendency toward pugilism has not disappeared - just > evolved. > > For example -- > > I have been until now resisting sparring with you as to Fullerian > geometry. There seems to be an obsession with regularity - in the > Euclidian sense. Rigid motions of regular shapes - and in that sense it > always seems to me to represent a pre-modern (non-Kleinian) conception > of geometry. Sparring OK by me. There's a filter here: what's easy enough for Kirby to program? That narrows things drastically. I focus on the regular stuff because that's what's easiest for me to code. Fuller's goal, on the other hand, was to come up with a coherent geometric language (a prose form) that'd describe whatever: trees, stars, dust mites... The concentric hierarchy stuff I dwell on in my hypertoons is regular/rigid (except the jitterbug plays on joint flexibility) and embeds in a frozen lattice of CCP spheres. Crystallography mostly. Plus a basic grounding in coordinate systems and spatial relationships. Geometry 101. http://www.mathforum.com/kb/plaintext.jspa?messageID=3696497 Kirby From ajsiegel at optonline.net Mon Mar 14 18:15:37 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Mon Mar 14 18:15:50 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. Message-ID: <3b66ec3b6428.3b64283b66ec@optonline.net> ----- Original Message ----- From: Kirby Urner Date: Monday, March 14, 2005 11:21 am Subject: RE: [Edu-sig] RE: Pygame, gameMaker etc. > > > As you well know, my tendency toward pugilism has not > disappeared - just > > evolved. > > > > For example -- > > > > I have been until now resisting sparring with you as to Fullerian > > geometry. There seems to be an obsession with regularity - in > the > > Euclidian sense. Rigid motions of regular shapes - and in that > sense it > > always seems to me to represent a pre-modern (non-Kleinian) > conception > > of geometry. > > Sparring OK by me. Sidetrip: Maybe a book about men of science and athletics. Niels Bohr, for example, was on the Danish National soccer team. His brother, a physicist colleague, while overshadowed by Niels in the laboratory - apparently outshown him on the field, being considered the premier soccer player in Denmark at the time. All according to my sources - which I hope I can reconstruct if challenged. Einstein I suspect, on the other hand, is not someone yuo would want batting clean-up. Art > > There's a filter here: what's easy enough for Kirby to program? That > narrows things drastically. I focus on the regular stuff because > that'swhat's easiest for me to code. > > Fuller's goal, on the other hand, was to come up with a coherent > geometriclanguage (a prose form) that'd describe whatever: trees, > stars, dust > mites... > > The concentric hierarchy stuff I dwell on in my hypertoons is > regular/rigid(except the jitterbug plays on joint flexibility) and > embeds in a frozen > lattice of CCP spheres. Crystallography mostly. Plus a basic > grounding in > coordinate systems and spatial relationships. Geometry 101. > > http://www.mathforum.com/kb/plaintext.jspa?messageID=3696497 > > Kirby > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > From urnerk at qwest.net Tue Mar 15 00:23:55 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 15 00:23:58 2005 Subject: [Edu-sig] Hypertoons! (upgrade available) Message-ID: <20050314232356.EA1B51E4002@bag.python.org> I upgraded my hypertoons module at http://www.4dsolutions.net/ocn/python/hypertoons/ I'm down to just two modules, plus VPython of course. This still has those couple 2.4 idioms. Went from 16 scenarios to 29! I've GOT to find those stereo glasses. Kirby """ Creates a network of VPython animations connected through key frames, with a random selection at each frame. Like a network of subway tunnels, and a choice of where to go next at each station (tunnel = scenario, nodelist = options of where to go next i.e. any scenario starting with current key frame. The theme of this hypertoon is Buckminster Fuller's concentric hierarchy of polyhedra, complete with jitterbug transformation and allusions to the CCP. =============================================================== History Last modified: March 14 2005 29 scenarios, 8 key frames Fixed bugs in jitterbug by refreshing rbf canonical points Sped it up, other aesthetic improvements Added more five-fold shapes place balls growing/shrinking Removed dependencies on colors.py coords.py First posted: March 11 2005 16 scenarios, 6 key frames Original proof of concept Background posted to Python/edu-sig http://mail.python.org/pipermail/edu-sig/2005-March/004499.html John Zelle gets it in stereo! http://mail.python.org/pipermail/edu-sig/2005-March/004503.html Kirby Urner 4D Solutions """ From urnerk at qwest.net Tue Mar 15 04:04:09 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 15 04:04:12 2005 Subject: [Edu-sig] Hypertoons! In-Reply-To: <42336F2F.4060103@wartburg.edu> Message-ID: <20050315030410.CA93D1E4006@bag.python.org> > This is a nifty application for demonstrating stereo visualization. Just > set scene2.stereo = 'redblue' and scene2.stereodepth = 1.5, slip on the > red-blue glasses, and enjoy the show. Awesome. It's even better with > active or passive stereo, but I know must of you don't have that option. > > Thanks loads for the posting. > > --John OK, found my 3d glasses. My daughter and I were just blissing out for awhile. Way cool, that feature. Kirby From urnerk at qwest.net Tue Mar 15 07:33:13 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 15 07:33:15 2005 Subject: [Edu-sig] Hypertoons! In-Reply-To: <20050314040111.D50B61E400C@bag.python.org> Message-ID: <20050315063313.D7A711E4006@bag.python.org> > Kirby Urner > Sent: Sunday, March 13, 2005 8:01 PM > Cc: edu-sig@python.org > Subject: RE: [Edu-sig] Hypertoons! <> > On another front, of course I've fantasized about firing off two Hypertoon > classes, each within the same domain of scenarios, but each running on its > own thread, traveling the network solo (with threading essentially giving > equal time to each). Once you've got two threads, you can get any number > (processor limits make too many impractical). OK, one last set of tweaks for the day, and I'll give it a rest for awhile. Got to work on some other projects. But (drum roll), I *did* get the two hypertoons to run in their own threads, sharing the same display. It's pretty cool to watch. Had to change the goofy way I was making so many key vertices global -- better to work with copies of the key vertices, and stuff them in a class (changes to rbf.py -- also made the icosahedron cyan). http://www.4dsolutions.net/ocn/python/hypertoons/ My proposal to speak at OSCON this year was accepted. This Hypertoon concept will be a part of my talk, along with Elastic Interval Geometry and some other stuff. Kirby From ajsiegel at optonline.net Tue Mar 15 17:31:32 2005 From: ajsiegel at optonline.net (Arthur) Date: Tue Mar 15 17:31:40 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <20050314162127.CC0081E4006@bag.python.org> Message-ID: <0IDE0043NJ8EU9@mta8.srv.hcvlny.cv.net> > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Kirby Urner > > Fuller's goal, on the other hand, was to come up with a coherent geometric > language (a prose form) that'd describe whatever: trees, stars, dust > mites... Help me. Can you recommend source material that might help me understand what you are saying? What might you mean by "coherent geometric language"? If it is to be coherent, presumably it is also accessible. I am not unwilling to dig, but have not so far found that coherence. What I tend to see is a focus on regular polyhedra and their properties. And in Fuller's famous domes he seems to have discovered structural properties - in the engineering sense - of certain regular space lattices that had been formerly overlooked. Overlooked by human engineers, that is - apparently they are being found in nature at the microcosmic level. How am I doing, and what am I missing? Am I looking at it in the wrong way, looking for coherence in the manner of the mathematical traditional, where in the end the actual focus of Fuller is more descriptive and engineering related? > > The concentric hierarchy stuff I dwell on in my hypertoons is > regular/rigid > (except the jitterbug plays on joint flexibility) and embeds in a frozen > lattice of CCP spheres. Crystallography mostly. Plus a basic grounding > in > coordinate systems and spatial relationships. Geometry 101. I guess that's a little what bothers me. A) It is pleasing, but not necessarily easy. B) Geometry, to me, needs to be presented as purposeful. Purposeful being very different from practical. But purposeful in being the working out of the logical implications of a limited set of propositions. That's what makes it geometry, not drawing or engineering. And I guess that the part not necessarily getting through to me from Fuller and Kirby. FWIW. Art From urnerk at qwest.net Tue Mar 15 19:36:15 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 15 19:36:15 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDE0043NJ8EU9@mta8.srv.hcvlny.cv.net> Message-ID: <20050315183614.72CF81E4003@bag.python.org> > Help me. Can you recommend source material that might help me understand > what you are saying? What might you mean by "coherent geometric > language"? If it is to be coherent, presumably it is also accessible. > I am not unwilling to dig, but have not so far found that coherence. http://www.rwgrayprojects.com/synergetics/synergetics.html http://synergeticists.org/synergetics/synergetics.html (mirror) For example, take this prose description of a tree: """ 793.04 Enormous amounts of water are continuously being elevated through the one-way, antigravity valving system. The tree feeds the rain-forming atmosphere by leaking atomized water out through its leaves while at the same time sucking in fresh water through its roots. The tree's high-tensile fiber cell sacs are everywhere full of liquid. Liquids are noncompressible; they distribute their local stress loadings evenly in all directions to all the fiber cell sacs. The hydraulic compression function firmly fills out the predesigned overall high-tensile fiber shaping of the tree. In between the liquid molecules nature inserts tiny gaseous molecules that are highly compressible and absorb the tree's high-shock loadings, such as from the gusts of hurricanes. The branches can wave wildly, but they rarely break off unless they are dehydratively dying -- which means they are losing the integrity of their hydraulic, noncompressible load-distribution system. Sometimes in an ice storm the tree freezes so that the liquids cannot distribute their loads; then the branches break off and fall to the ground. """ It takes some getting used to, but it's readable prose. > > What I tend to see is a focus on regular polyhedra and their properties. > And in Fuller's famous domes he seems to have discovered structural > properties - in the engineering sense - of certain regular space lattices > that had been formerly overlooked. Overlooked by human engineers, that is > apparently they are being found in nature at the microcosmic level. > > How am I doing, and what am I missing? Fuller's deeper commitment was to invention *in language* i.e. to come up with an integrative way of thinking about everything using geometry as the principal source of metaphors. Per the quote at my synergetics page: The integration of geometry and philosophy in a single conceptual system providing a common language and accounting for both the physical and metaphysical Synergetics 251.50 http://www.grunch.net/synergetics/ What I think the culture misses in general about Fuller (I'm not picking on you in particular) is that he was an interesting 20th century philosopher and literary figure, not just some architect/engineer and maybe an amateur mathematician. > > > > The concentric hierarchy stuff I dwell on in my hypertoons is > > regular/rigid > > (except the jitterbug plays on joint flexibility) and embeds in a frozen > > lattice of CCP spheres. Crystallography mostly. Plus a basic grounding > > in > > coordinate systems and spatial relationships. Geometry 101. > > I guess that's a little what bothers me. Everything is bothersome at some level. What bothers me about my hypertoon code is the kludgey way I implement some of the transformations (the jitterbugs in particular). It works, but there's gotta be a better way. I can't resist trying to tinker. More experiments scheduled for this evening. > A) It is pleasing, but not necessarily easy. The concentric hierarchy is an absurdly easy way of integrating a huge amount of geometric info in a memorable way. We just need the right teaching tools to communicate it. Hypertoons may help. I've done several live presentations in classrooms, including to very young kids, and they really like getting this. It's truly shocking and amazing to me that this one particular "language game" (Wittgenstein reference) has such an up-hill battle being accepted into the mainstream. It's just mind-boggling. I say that as a former high school teacher, a good one, who covered geometry thru calculus. There's a lot in Fuller that's speculative and "out there," and of primary interest to scholars who've chosen to specialize in this branch of literature (as with James Joyce or Shakespeare -- there's a lot of minutiae and stuff that doesn't need widespread attention). But the concentric hierarchy is a piece that deserves adoption on a much broader basis, as an intrinsic part of just about any well-rounded curriculum, or so it seems to me. > B) Geometry, to me, needs to be presented as purposeful. Purposeful being > very different from practical. But purposeful in being the working out of > the logical implications of a limited set of propositions. That's what > makes it geometry, not drawing or engineering. And I guess that the part > not necessarily getting through to me from Fuller and Kirby. > > FWIW. > > Art I think the right way to look at Fuller is his philosophy *overlaps* geometry in a very big way, but ultimately it shouldn't be pigeon-holed as geometry, the academic field, as that brings up too many expectations that won't be fulfilled. We still need geometry as you describe it, i.e. I don't represent Fuller's stuff as a way of "getting beyond" geometry, as if now geometry were obsolete or something. That'd be foolishness. Indeed, Fuller dedicated his magnum opus to Coxeter, probably the premier geometer of the 20th century, or certainly one of the top ones. He was paying homage to a leading light in a related/overlapping discipline. That being said, I find in Fuller's work much that's worth *exporting* to geometry-the-school-subject. And to other disciplines. Kirby From ajsiegel at optonline.net Tue Mar 15 21:56:01 2005 From: ajsiegel at optonline.net (Arthur) Date: Tue Mar 15 21:56:06 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDE001BQP0CNP@mta25.srv.hcvlny.cv.net> Message-ID: <0IDE00E9QVHBGT@mta9.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > > It takes some getting used to, but it's readable prose. Of course there are infinite valid ways of describing a tree. Its readable prose, but not particularly pretty prose. It ain't science, it ain't poetry. It is a perspective, a way of looking at a tree. And I think I appreciate that in its time a perspective - wholistic/holistic - that was lost or well on its way to being so. And therefore of importance. But I would contend that Fuller was much more successful in getting his message out than you seem to feel. So much so that someone who was not around when he was pressing his points, and able to understand the milieu in which he was functioning, might not see why we might be honoring him. Any good consultant's goal to make himself/herself obsolete. As a philosopher, I think he was in the tradition of pragmatism - and would come out on the side of Popper in the debate between Popper and Wittgenstein as to whether philosophy actually mattered. His idea had and have practical implications. And I believe those ideas have been quite influential. So it is anything but an insult to Fuller to consider him to have obsoleted himself, at least a bit. Reconciling Wittgenstein and Fuller, though, would certainly take an Urner. > Fuller's deeper commitment was to invention *in language* i.e. to come up > with an integrative way of thinking about everything using geometry as the > principal source of metaphors. Per the quote at my synergetics page: > Indeed, Fuller dedicated his magnum opus to Coxeter, probably the premier > geometer of the > 20th century, or certainly one of the top ones. He was paying homage to a > leading light in a related/overlapping discipline. You and I seem to take slightly different things away from the dedication to Coxeter. Perhaps Fuller is saying something not too different from Plato, in pointing to Coxeter. Which gets us back to our argument of some 5 year's standing now. Me thinking that you want to push folks ahead to the ideas of the Master, while allowing them to skip most of the prerequisites. Can't happen. I assume that I can't really fully appreciate Fullers ideas until I know a decent amount of what he knew, as background. Certainly a task in itself. And he is giving us a very good clue as to what he himself considers as prerequisite to his ideas, in his dedication to Coxeter. And I am hard at work. Though it is taking me well beyond Geometry 101. Art From urnerk at qwest.net Wed Mar 16 00:49:23 2005 From: urnerk at qwest.net (Kirby Urner) Date: Wed Mar 16 00:49:27 2005 Subject: [Edu-sig] RE: Pygame, gameMaker etc. In-Reply-To: <0IDE00E9QVHBGT@mta9.srv.hcvlny.cv.net> Message-ID: <20050315234926.1F5CE1E4003@bag.python.org> > But I would contend that Fuller was much more successful in getting his > message out than you seem to feel. So much so that someone who was not Curious: were you aware of 'Synergetics' (links last post), that it was online (the context for that 'tree' quote). When I showed the hardcover to mom some years back in Jersey City, her reaction was "I didn't know he wrote anything like that" (and yet she knew about the domes and like that). He did hold the Elliot Norton Chair for Poetry at Harvard at one time, and one of his most insightful commentators/biographers was Hugh Kenner, the famous James Joyce scholar (and later a columnist for BYTE magazine). > Any good consultant's goal to make himself/herself obsolete. As a > philosopher, I think he was in the tradition of pragmatism - and would > come out on the side of Popper in the debate between Popper and > Wittgenstein as to whether philosophy actually mattered. I'm not a big fan of the popularizations which make "Wittgenstein versus Popper" the boxing match of the day, the incident with the poker notwithstanding. > Reconciling Wittgenstein and Fuller, though, would certainly take an > Urner. > Yeah, right on. > You and I seem to take slightly different things away from the dedication > to Coxeter. > > Perhaps Fuller is saying something not too different from Plato, in > pointing to Coxeter. I have access to some of the correspondence between the two. Cordial, friendly. They overlapped in a good way. > I assume that I can't really fully appreciate Fullers ideas until I know a > decent amount of what he knew, as background. Certainly a task in itself. > And he is giving us a very good clue as to what he himself considers as > prerequisite to his ideas, in his dedication to Coxeter. > > And I am hard at work. Though it is taking me well beyond Geometry 101. > > Art But just the concentric hierarchy piece: you've got these few polyhedra, they organize this way, and the relative volumes are like this. It's not that big -- something we can share in K-12 no problem (and I do so). I hope this thread continues -- the hypertoon in Python gives me a strong foothold with edu-sig@python.org I'd think. But right now, gotta get the 10 year old to her piano lesson. Later, Kirby From urnerk at qwest.net Wed Mar 16 20:17:47 2005 From: urnerk at qwest.net (Kirby Urner) Date: Wed Mar 16 20:19:33 2005 Subject: [Edu-sig] Re: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <20050315234926.1F5CE1E4003@bag.python.org> Message-ID: <20050316191932.90AE61E4004@bag.python.org> Kirby: > But just the concentric hierarchy piece: you've got these few polyhedra, > they organize this way, and the relative volumes are like this. It's not > that big -- something we can share in K-12 no problem (and I do so). > So I walk into this classroom with a box of polyhedra. Stiff paperboard jobbers with one face missing, so they serve as mixing bowls, measuring cups (a pre-K girl called 'em that, and it works). We're in the kitchen, measuring for a recipe (boys too). In the bottom of my plastic carrying case: about 3 inches of fava beans (I think that's what they are, dried white beans -- I tried corn meal but that was a disaster, got everywhere, in the floorboards even). I pick up my tetrahedron (black electrical tape on the edges, good contrast), and say "Measuring cup!" (I probably say more). Then I scoop up a boat load of beans. Now it's full. In my other hand, Cube. How many tetrahedron cups to fill my Cube? Guesses, kids calling out. Well, let's see... one.... two.... three. Done. It's brimming with beans, no room for more. Is the ratio exact? You betcha. So stop right here. How can this be? There's the hidden (wrong in this case) assumption that the cube edge and tetra edge must be the same length. But that's not the only logical relationship. You can intersect two tetrahedra to get what Kepler called his Stella Octangula (a star with eight points). Connect those 8 points and you have a cube. The tets inscribe as criss-crossing face diagonals. *That's* the relationship we want to burn in. *That's* how we get our 1:3 ratio. So, did anyone ever teach you, in like 3rd grade, about this simple 1:3 relationship? Do you need to study Klein or Coxeter to get that? Do *they* even tell you? It's not that they wouldn't agree, but this is just simple baby stuff, so why bother? Except why don't we tell the babies even? Moving on: here's a rhombic dodecahedron. Kepler loved it. Did you know it fills space without gaps? Plato's pentagonal dodeca is more famous. The Platonic Five. Heck, this rhombic guy ain't even an Archimedian. But look, trace the short diagonals (of its 12 diamond faces) with your finger: you get a cube. Let's make that the *same* cube of volume 3, the *duo-tet* cube, as Fuller called it. So what's the volume of this guy then, this other space-filler? Pouring a cube into the rhombic dodeca. One... two... Done. Cube was 3, so rh dodeca is 6. Simple, easy, memorable -- and never shared in any K-12 geometry book I've ever come across. But wait, there's more. Trace the *long* diagonals of our rhombic dodeca with your finger. An octahedron. Dual to the cube (we'll explain what that means later). Let's find out the volume of this very octahedron. We'll go back to our tetrahedral measuring cup (the unit). One... two... three... four. Done. Four. So what do we have so far: Tetrahedron = 1 Duo-Tet Cube = 3 Octahedron = 4 Rh Dodeca = 6 But wait, there's more. Remember Rh Dodecas fill space? Imagine a sphere or ball inside each one, perfectly encased (ball touches each diamond face center -- where the cube and octa criss-cross). Pack those babies together. Hey, that's CCP (= FCC). Kepler's Conjecture: densest possible (finally proved, 300+ years later). CCP is a branch point to a whole other set of cool topics. Another time. But hey we're there, ready to rumble. OK, so 12 rhombic dodecas snuggling around a central one, corresponds to some shape. Which one? Cuboctahedron. I've lost you ASCII readers, but in the classroom, this is all visual and/or tactile. I've got ping pong balls, I've got hypertoons (written in Python + VPython -- improved yet again as of late last night). And what's the volume of this 12-around-1 CCP embedded cuboctahedron, dual to the rhombic dodeca? Pour beans (your choice as to which combo of measuring cups). Answer: 20. So... Tetrahedron = 1 Duo-Tet Cube = 3 Octahedron = 4 Rh Dodeca = 6 Cubocta = 20 And yes, there's more. I've got a simple transformation of the cubocta that takes my to the icosahedron (incommensurable volume, and that's OK), and on to the octahedron (volume 4). Links to viruses, geodesic domes. Pentagonal dodeca comes back (yay Plato) as the dual of the icosa. And the rhombic triacontahedron, so very very close to volume 5 when shrink-wrapped around a CCP sphere -- but that's for another day, another grade maybe. Plus we can break the tetra and octa into more basic slivers of equal volume and assemble the rest of the not five-fold (other mods for them). My point: this is a very memorable spatial construct. It could be in there between the ears, along with the alphabet, the multiplication tables, and a gazillion other factoids we ask kids to remember, to learn by heart. But this one is visual, right brained, spatial, geometric. It addresses an imbalance (so much of what we remember are lists, algebraic rules, identities, with no pictures, especially not *spatial* pictures). If you commit this concentric hierarchy to memory, learn it in your bones, you'll have something rational, wholesome, and fun to build on. The concepts embedded here connect everywhichway to other curriculum topics (Pascal's triangle, great circles, crystals, octet truss, Kepler, Alexander Graham Bell, cartography, navigation, spinning, Euler, coordinate systems, Fuller...). >From my point of view, it's mind-boggling that we don't share the above ultra basic information with kids, at any level in their academic careers. Sure, *I* do, but why just me and a few others? It's just shocking, crazy-making. The best retort mathematicians seem to come up with is: trivial (sniff). Well yeah, duh, it *is* trivial. So is: there's a tiger behind you, ready to jump! Why bother sharing that if it's so obvious, right? Kirby Hypertoon about the concentric hierarchy (required viewing, K-12): http://www.4dsolutions.net/ocn/python/hypertoons/ (new improved version: John Zelle made it sense if you're using 2.3 instead of 2.4, and implement the necessary workarounds, plus defaults to not-fullscreen so is now friendlier in Linux). From urnerk at qwest.net Thu Mar 17 19:09:47 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 17 19:09:49 2005 Subject: [Edu-sig] Hypertoon better if your machine has oomph In-Reply-To: <20050316191932.90AE61E4004@bag.python.org> Message-ID: <20050317180947.E603F1E4005@bag.python.org> > Hypertoon about the concentric hierarchy (required viewing, K-12): > http://www.4dsolutions.net/ocn/python/hypertoons/ (new improved version: > John Zelle made it sense if you're using 2.3 instead of 2.4, and implement > the necessary workarounds, plus defaults to not-fullscreen so is now > friendlier in Linux). I just ran this for the first time on my 1.2 Ghz AMD laptop (Compaq Presario 700), versus the 2.8 Ghz P4 with hyperthreading I'd been using 'til now. Rather disappointing. With the dual play heads, some of the transformations aren't even visible -- just a jump from start to finish with none of the in-betweening. Probably the frame rate is too high. I haven't tried single playhead mode yet. Anyway, one gets spoiled by these better machines (having a gig of DDR might help too). I just scheduled myself to talk for 30 mins re this Hypertoon app at Pycon. Probably the Presario is what I'll use. It dual boots to Linux -- maybe it'll run faster there (faint/fading hope)? Kirby From urnerk at qwest.net Thu Mar 17 21:25:32 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 17 21:25:37 2005 Subject: [Edu-sig] Hypertoon better if your machine has oomph In-Reply-To: <20050317180947.E603F1E4005@bag.python.org> Message-ID: <20050317202536.1B7391E4004@bag.python.org> > I just scheduled myself to talk for 30 mins re this Hypertoon app at > Pycon. Probably the Presario is what I'll use. It dual boots to Linux -- > maybe it'll run faster there (faint/fading hope)? > > Kirby > Actually, the deeper problem with the Presario is it's been overheating and spontaneously shutting down, sometimes after only a few minutes of use. Given I'm to lead a 3 hour Python training for ESRI the day after I get back from Pycon, I really needed a more reliable laptop. Solution: just ordered a "remanufactured" Toshiba A60 (2.8 Ghz 256 DDR) for about $770, plus 2nd day shipping. I hope this proves a viable solution. It's not like my ESRI gig will pay enough compensate. And I think they're expecting more win32all type examples, so I'm going to have to track down that Mark Hammond book (ISBN 1565926218)and cram (I not a big COM/MFC user, that I can tell you). So, whaddya think Arthur: should we be sharing Fuller's concentric hierarchy with grade schoolers? See you (and who else on edu-sig?) at Pycon. Kirby From ajsiegel at optonline.net Sat Mar 19 14:46:20 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 19 14:46:31 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDG00MTKLOJPN@mta20.srv.hcvlny.cv.net> Message-ID: <0IDL00II4Q9GA1@mta4.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > > I pick up my tetrahedron (black electrical tape on the edges, good > contrast), and say "Measuring cup!" (I probably say more). Then I scoop > up > a boat load of beans. Now it's full. In my other hand, Cube. How many > tetrahedron cups to fill my Cube? Guesses, kids calling out. Well, let's > see... one.... two.... three. Done. It's brimming with beans, no room > for > more. Is the ratio exact? You betcha. Might they also be interested that in Egypt, long-ago, in the shadow of the Pyramids, folks not only understood this to be true, but were not content with this knowledge. A way of thinking was developed that allowed them to become satisfied that the truth of this observation "makes sense" - that we should in fact *expect* it to be true. http://babbage.clarku.edu/~djoyce/java/elements/bookXIII/propXIII15.html What seems surprising - given a logical progression of thought - can be found to be not surprising, really. What is the lesson to be learned from that? To me, it *is* the lesson. Art From urnerk at qwest.net Sat Mar 19 17:06:47 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sat Mar 19 17:06:46 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDL00II4Q9GA1@mta4.srv.hcvlny.cv.net> Message-ID: <20050319160644.A88311E4007@bag.python.org> > Might they also be interested that in Egypt, long-ago, in the shadow of > the Pyramids, folks not only understood this to be true, but were not > content with this knowledge. A way of thinking was developed that allowed > them to become satisfied that the truth of this observation "makes sense" > - that we should in fact *expect* it to be true. > > http://babbage.clarku.edu/~djoyce/java/elements/bookXIII/propXIII15.html > > What seems surprising - given a logical progression of thought - can be > found to be not surprising, really. > > What is the lesson to be learned from that? > > To me, it *is* the lesson. > > Art Yeah, once the relationships are established ("burned in") as I put it, there's every reason to go over the reasoning in various ways. There's not just one way to cover this ground, but certainly a goal is to supply any logical apparatus (including Euclid's) that works. Basically, once you've got a tetrahedron inscribed in a parallelepiped as face diagonals, various affine transformations of said sculpture preserves the 1:3 volume relationship, i.e. this is not just about the regular tet and cube. Once you've accepted the octahedron of volume 4 (same edge length as tetrahedron), it's easy to do the tet:cube in special case: fragment the octa into eight equal chunks around the central angle of 90-90-90 (1/2 volume each) and apply four of them to the faces of a regular tet to build a cube (1 + 4*1/2 = 3). http://www.rwgrayprojects.com/synergetics/plates/figs/plate03z.html (there's a theorem you need for the octahedron in this picture: that tetrahedra with equal bases of the same height have equal volume -- you can pull that out of Euclid if you like). But with the pre-K groups etc., I find the measuring cups work well. My attitude is *not* that they should be surprised. I'm very matter of fact. My surprise is over the adults not teaching this material, not over the fact that spatial geometry has a simple, rational, whole number core. Kirby PS: ordered a new laptop (Toshiba Satellite A60), which should arrive either this morning or Monday morning (leaving for Pycon on Tuesday). From ajsiegel at optonline.net Sat Mar 19 19:47:12 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 19 19:47:23 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDL006MBWR7BN@mta11.srv.hcvlny.cv.net> Message-ID: <0IDM00CWM46QUG@mta9.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > Sent: Saturday, March 19, 2005 11:07 AM > To: 'Arthur'; edu-sig@python.org > Subject: RE: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame > etc.) > Basically, once you've got a tetrahedron inscribed in a parallelepiped as > face diagonals, various affine transformations of said sculpture preserves > the 1:3 volume relationship, i.e. this is not just about the regular tet > and > cube. We can eventually get them to Klein's fusionist approach - fusing the algebraic and geometric, as well as the flat and spatial. Part One, Page 1 of the Klein "Elementary Geometry" book I have been referencing introduces us to the progression of formations of 2,3 + 4 points, which brings us from the line to the triangle to the tetrahedron. The length, area, and volume of the fundamental formations are a simple function of the determinate of the matrix of the rectangular point coordinates on the line, on the plane, and in space - respectively. He then points out that even further generalization can be achieved by giving significance to the sign of the determinate - so that given a consistent ordering of points, one can readily ascertain the volume of arbitrary polygons/ polyhedra by composing them into component triangles/tetrahedron from a given reference point either within or outside the form, and then by adding the volumes (which may be negative) of the fundamental forms. Klein's approach to geometry is to find approaches that move between dimensions and forms in such a way that best avoids the need to except any special case. Which is why projective geometry becomes the (nearly) fundamental geometry, and other geometries - affine, Euclidian - are specializations. In this view, a regular tetrahedron is a bit of a freak - perfectly placed and formed. And at least in some important senses is of much less interest than what can be said - and there is indeed a lot than can be said - of the geometry of 4 balls tossed arbitrarily into space. I choose to rarely think in terms regular forms. Besides seeming inherently less interesting to me, I truly get confused as to what traits I am observing (or calculating) which derive themselves from the regularity and which might be more general. Regularity is therefore dangerous, and potentially confusing - rather than comforting. No major mind damage is going to be done by a different presentation. But I would like to disassociate the notion of geometry and the regularity of forms as completely and as early as possible. And this is where I seem to be most non-Fullerian. Art From urnerk at qwest.net Sat Mar 19 22:20:35 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sat Mar 19 22:20:38 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDM00CWM46QUG@mta9.srv.hcvlny.cv.net> Message-ID: <20050319212036.B076A1E4005@bag.python.org> > No major mind damage is going to be done by a different presentation. > > But I would like to disassociate the notion of geometry and the regularity > of forms as completely and as early as possible. And this is where I seem > to be most non-Fullerian. > > Art > Not claiming to follow, but yes, we appear to diverge here. The thing is, we don't disassociate "playing with blocks" from architecture, and by extension from geometry, at all, in current childhood education. We most intimately link a rectilinear format, with various cylinders, cones and balls, into the young (very young) imagination. Cubes are both prevalent and regular, without any doing from me. So Fuller's innovation is *not* with respect to linking shapes and geometry early (regular shapes included, in the form of blocks, toys using them), but in the particular assortment of shapes and their canonical relationships. It's much more 60 degree than we're used to (what with all the equiangular triangles everywhere), from a classical western perspective, which is more 90 degree, more into post and lintel perpendicularity. So where I think Fuller and our concentric hierarchy challenges the status quo is in the manifest non-rectilinearity of this approach (NOT that this conflicts with Euclid in any way -- it really doesn't, except when we get into abstruse territory, such as absolute and infinite continua versus discrete and definite manifolds and such (analog vs. discrete stuff)). My view is he went up against a huge bias, but since he based himself outside of academia, in a sort of business world place, it wasn't like he could be shut out of the game. He was independently capable of mobilizing a large network. This has relevance in that a lot of what we call the open source movement may be traced to his anticipatory design science revolution concepts of the 1970s and 80s. Engineering and a focus on artifacts trumps political efforts to block basic innovations in math teaching. There's really no stopping us, politically speaking (because we really don't care about politics that much (like, we're popular already)). Kirby From urnerk at qwest.net Sun Mar 20 06:02:46 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Mar 20 06:02:48 2005 Subject: [Edu-sig] Hypertoons! (version differences) In-Reply-To: <20050315063313.D7A711E4006@bag.python.org> Message-ID: <20050320050247.AEB1D1E4002@bag.python.org> As might be expected, my hypertoon has generated some interest on Synergeo, one of the eGroups frequented by Fuller Schoolers. One user found something interesting, and to me surprising. Some of the smooth motion "jitterbugging" I incorporate, where rods smoothly change position (the whole rod does, versus the progressive elongation of individual rod tips -- another kind of animation I employ) ONLY seems to work well in Python 2.4 with the experimental VPython 2.4. There's a thread on this: http://groups.yahoo.com/group/synergeo/message/21263 (is one part of it). He's responding to my: http://groups.yahoo.com/group/synergeo/message/21262 I thought it was a problem with frame rate and his Celeron 2.2, or video card. But it turns out that as soon as he changed to the experimental VPython, everything worked as I'd described. Certain kinds of motion that hadn't been apparent before, now were. Interesting. I haven't done the necessary experiments on my end to verify this is the problem. I've got everything to my satisfaction on the newest VPython on my faster computer, and tried Python 2.3 + VPython on the slower laptop. But I never tried Python 2.4 + Experimental on the laptop. Kirby From ajsiegel at optonline.net Sun Mar 20 14:47:54 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 20 14:48:04 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDM00KHYBAB23@mta26.srv.hcvlny.cv.net> Message-ID: <0IDN00843KZI36@mta8.srv.hcvlny.cv.net> > From: Kirby Urner [mailto:urnerk@qwest.net] > > > No major mind damage is going to be done by a different presentation. > > > > But I would like to disassociate the notion of geometry and the > regularity > > of forms as completely and as early as possible. And this is where I > seem > > to be most non-Fullerian. > > > > Art > > > > Not claiming to follow, but yes, we appear to diverge here. I suspect this exchange is more interesting to you and I than to others on the list and that it would be most appropriate to table it to a face-to-face at PyCon breaks - except that my schedule is conspiring against it, it now looking that I won't be able to make it there. The best I can hope for at the moment is attending Friday's sessions. > > The thing is, we don't disassociate "playing with blocks" from > architecture, > and by extension from geometry, at all, in current childhood education. > We > most intimately link a rectilinear format, with various cylinders, cones > and > balls, into the young (very young) imagination. Cubes are both prevalent > and regular, without any doing from me. > > So Fuller's innovation is *not* with respect to linking shapes and > geometry > early (regular shapes included, in the form of blocks, toys using them), > but > in the particular assortment of shapes and their canonical relationships. > It's much more 60 degree than we're used to (what with all the equiangular > triangles everywhere), from a classical western perspective, which is more > 90 degree, more into post and lintel perpendicularity. Well certainly Klein presentation makes the (not necessarily regular) tetrahedron the fundamental space form - so that Klein and Fuller are thinking in the same manner in some fundamental respects. And I happen to have a great fondness for 60 degrees - gained via the folding of flexagons, introduced to me in 4th grade by a brilliant teacher. I still can't resist making one when I see a roll of adding machine tape. I think they would be a great addition to your repertoire. I think the real competition to the tetrahedron in space is the sphere, and the real revelation is the perspective that makes the tetra more useful than it as the fundamental space form. But I guess I shouldn't forget that Klein's matrix algebra for lengths, areas, and volumes is working via a regular rectilinear coordinate system. I know you and others have thought about a coordination of space via a regular tetrahedron. *That* I find fascinating, and would probably be my best way in to more Fullerist geometric thinking. Art From ajsiegel at optonline.net Sun Mar 20 16:20:31 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 20 16:20:38 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDM00KHYBAB23@mta26.srv.hcvlny.cv.net> Message-ID: <0IDN009M8PA40Z@mta9.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] >Engineering and a focus on artifacts > trumps > political efforts to block basic innovations in math teaching. There's > really no stopping us, politically speaking (because we really don't care > about politics that much (like, we're popular already)). The tragedy I see is that it is in fact the technologists - specifically those immersed in IT - who are emerging as the most formidable obstacle to progress, as I would define it. I follow the debian edu mailinglist, and what I seem to see is a complete lack of critical analysis as to the use of technology. The starting assumption is the more the merrier, and the prevailing motivation seems to be beating Microsoft at the thoughtless use of technology in the school systems. There are all kinds of ways of beating Microsoft, I guess. Art From urnerk at qwest.net Sun Mar 20 17:18:37 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Mar 20 17:18:35 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDN00843KZI36@mta8.srv.hcvlny.cv.net> Message-ID: <20050320161834.777631E4002@bag.python.org> > I suspect this exchange is more interesting to you and I than to others on > the list and that it would be most appropriate to table it to a face-to- > face at PyCon breaks - except that my schedule is conspiring against it, > it now looking that I won't be able to make it there. The best I can hope > for at the moment is attending Friday's sessions. That's sad news. I'll be on the east coast near the end of May too, looks like. Not sure of all the details. Anyway, I'll continue to hope we might overlap on Friday. Kirby From urnerk at qwest.net Sun Mar 20 17:19:59 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Mar 20 17:19:57 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IDN009M8PA40Z@mta9.srv.hcvlny.cv.net> Message-ID: <20050320161955.D41DC1E4002@bag.python.org> Arthur: > The tragedy I see is that it is in fact the technologists - specifically > those immersed in IT - who are emerging as the most formidable obstacle to > progress, as I would define it. More polemics it'd be interesting to use for new threads. But maybe not on edu-sig. More some other time I hope. Kirby From ajsiegel at optonline.net Sun Mar 20 18:33:32 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Sun Mar 20 18:33:34 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) Message-ID: ----- Original Message ----- From: Kirby Urner Date: Sunday, March 20, 2005 11:19 am Subject: RE: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) > Arthur: > > The tragedy I see is that it is in fact the technologists - > specifically> those immersed in IT - who are emerging as the most > formidable obstacle to > > progress, as I would define it. > > More polemics it'd be interesting to use for new threads. But > maybe not on > edu-sig. The problem though, in my view, is that it is on fourms like edu-sig ( and debian edu list) that the exploration of these kinds of "polemics" are both most relevant and least welcome. Which says something in-and-of-itself. The Free Software movement being a particular kind of "threat", in that the tendency to provoke overconsumption is only enhanced by an offering that is free. Though - (god I hope I got this right) - the folks leading the debian education distribution effort did somewhat belatedly reveal that they are working from a business model based on support of the distribution in school systems. > > More some other time I hope. Starting now ;) Art From urnerk at qwest.net Sun Mar 20 20:16:29 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Mar 20 20:16:33 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: Message-ID: <20050320191632.614BF1E4002@bag.python.org> > The problem though, in my view, is that it is on fourms like > edu-sig ( and debian edu list) that the exploration of these kinds > of "polemics" are both most relevant and least welcome. > > Which says something in-and-of-itself. > Let's just put it this way: I'm a technologist immersed in IT and I don't consider myself a formidable obstacle to progress. Nor do I feel that my innovative programming is encountering any effective resistance. Nor do I feel that I'm operating alone or in a vacuum. On top of this, I see a million ways to link up design science (Fuller's name for a disciplined approach to making headway) with open source projects. Of these million ways, I've so far exploited only about 4.5% of them (bogus stat). In other words, I'm loaded with "ammo" (weapons of mass instruction) but have only lightly tapped what's in inventory. > The Free Software movement being a particular kind of "threat", in that > the tendency to provoke overconsumption is only enhanced by > an offering that is free. Mathematics is free too. But to appreciate it to the level required to contribute patches takes work. The Free Software movement represents a promise of interesting hard work. The tools are free, but developing the skills to use them takes time. Making the tools free just means you have more time to practice, versus scrounging in a day job to earn the $10,000 AT&T or SCO would have liked to charge any geek wanting entry level access to an OS. Microsoft was never the real enemy. It never marketed a proprietary UNIX. It only pushed a less attractive substitute that serious geeks didn't want or feel threatened by not having. > Though - (god I hope I got this right) - the folks leading the debian > education distribution effort did somewhat belatedly reveal that they > are working from a business model based on support of the > distribution in school systems. > >From my point of view, not a whole lot hinges on Debian's competence here, though if it proves highly competent, that'll be a big plus. But penetration of free and open source within the schools is already happening at some exponential rate, and Red Hat, Mandrake and others all have a piece of the action. I taught Adventures in Open Source to teenagers last summer for Saturday Academy with Jerritt Collord of linuxfund.org (brilliant guy). Our workstations were all Red Hat 9 boxes. Our language was Python (mixed with a lot of other stuff). Our venue was West Precinct, Hillsboro Police Department. > > More some other time I hope. > > Starting now ;) > > > Art All the more reason I wish we had more time to talk at Pycon. Last point: free and open source does not mean "not Windows" of course. It's all a matter of layers. You've got a stack, like a sandwich piled high with stuff, and each layer may have different rules, about what's open versus what's proprietary and so on. Tons of highly proprietary stuff runs on top of open source (ever hear of IBM?). Per recent OSCONs, the trend is towards super apps that are online, that leverage user input (Google and Amazon both examples). Lots of open source tools gets used, but the overall app is pretty much an inhouse asset i.e. closed to the general public. However, here too I suspect open source will have an impact -- I've already suggested some large scale open source apps myself, related to the fleet of cybervans I intend to unleash from Global Data's garages (or Google's, or ESRI's...). Kirby From ajsiegel at optonline.net Sun Mar 20 21:23:06 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Sun Mar 20 21:23:09 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) Message-ID: <847210846daf.846daf847210@optonline.net> ----- Original Message ----- From: Kirby Urner > > > The problem though, in my view, is that it is on fourms like > > edu-sig ( and debian edu list) that the exploration of these kinds > > of "polemics" are both most relevant and least welcome. > > > > Which says something in-and-of-itself. > > > > Let's just put it this way: I'm a technologist immersed in IT and > I don't > consider myself a formidable obstacle to progress. Nor do I feel > that my > innovative programming is encountering any effective resistance. > Nor do I > feel that I'm operating alone or in a vacuum. > > On top of this, I see a million ways to link up design science > (Fuller'sname for a disciplined approach to making headway) with > open source > projects. Of these million ways, I've so far exploited only about > 4.5% of > them (bogus stat). In other words, I'm loaded with "ammo" > (weapons of mass > instruction) but have only lightly tapped what's in inventory. I am also a technologist of a fashion. But in the business world there are factors that converge toward appropriate use. There is cost and there is benefit, and there is a measuring scale - dollars. I find the business world quite wholesome in that respect. What I see at work in the realm of education and technology is the worst of both worlds - folks working within self-interested frameworks of various kinds and degrees (as in the business world), but without a reasonable framework for defintions of goals, or measurement of costs and benefits, and therefore no ecosystem that it is reasonable to believe will converge us toward a reasonable result. The easiest shortcut, of course, being to simply define "educated" - because there is in fact a lot of leeway to be had in coming to a definition of that word - as fluent in working with computers. In which case - by simple tautology - working with computers becomes a centerpiece of the educational process. Too easy, IMO. Way. Art From urnerk at qwest.net Sun Mar 20 22:34:21 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sun Mar 20 22:34:25 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygameetc.) In-Reply-To: <847210846daf.846daf847210@optonline.net> Message-ID: <20050320213423.5A3C81E4002@bag.python.org> > In which case - by simple tautology - working with computers becomes a > centerpiece of the educational process. > > Too easy, IMO. Way. > > Art I agree, that'd be too easy. And yes, lot's that's frustrating about the status quo. And yes, the business world has much to offer (it's a world I live in as well). Kirby From lgrandel at abo.fi Mon Mar 21 09:50:41 2005 From: lgrandel at abo.fi (Linda Grandell) Date: Mon Mar 21 09:51:10 2005 Subject: [Edu-sig] Best approach to teaching OOP and graphics Message-ID: <1111395041.423e8ae172c08@webmail.abo.fi> Dear all, During the last six months, I have given an introductory programming course to high school students using Python. The course covered the fundaments of programming: data types, conditionals, loops, files, exceptions, modules, functions, and so on (no graphics). At the same time I taught Java to another group of high school students, which turned out to be a really "eye-opening" experience; using both languages at the same time really pointed out the advantages of Python. Starting in mid-April, I will give a continuation course to the same students now including OOP concepts and graphics. Based on my positive experience of Python, I will continue using it as the language of instruction. In addition, I am curious about trying out pair-programming in high school settings, and have therefore decided to use this methodology in the course. So far I have come up with two alternatives for how to go about this course: 1) Use PyGame from the very beginning of the course. 2) Cover OOP in the traditional (text-based) manner, using IDLE as in the basic course, and later in the course introduce a GUI module, e.g. AnyGUI, for graphical programming. Using the first approach, graphics could be introduced already during the first lecture, and no distinction would have to be made between non-graphical and graphical programming. This might, on the other hand not be the case with the second approach; in fact, I feel there may be a risk of the students developing an idea of OOP and graphical programming being two different things if they are introduced separately. As an active lurker on the edu-sig list, I therefore decided to present my small "dilemma" here. How do you think OOP and graphics could best be introduced in high schools? Is one of my alternatives OK, or do you have other suggestions? The fact that the students will be working in pairs will hardly affect the choice of teaching approach. Best Python-regards, Linda Grandell ?bo Akademi University Turku, Finland From urnerk at qwest.net Mon Mar 21 18:18:25 2005 From: urnerk at qwest.net (Kirby Urner) Date: Mon Mar 21 18:18:28 2005 Subject: [Edu-sig] Best approach to teaching OOP and graphics In-Reply-To: <1111395041.423e8ae172c08@webmail.abo.fi> Message-ID: <20050321171827.A1FA01E4003@bag.python.org> > in fact, I feel there may be a risk of the students developing > an idea of OOP and graphical programming being two different > things if they are introduced separately. In my book, OOP and graphical programming *are* two different things. To introduce OOP is to introduce the syntax for classes and forming objects from them e.g. class Foo: pass myobj = Foo() OOP includes ideas of methods & attributes, inheritance, dot notation, operator overloading, method overriding, constructors, static and class methods, various design patterns. You can do all that (or a subset of that) in IDLE if you like. My approach when introducing classes and objects is to emphasize we've been using objects all along, e.g. every list object has all these useful methods by virtue of being of the list type. I do stuff like: >>> dir([]) # spill the guts of an empty list or even >>> dir(1) # spill the guts of the number 1 to show all the "hidden knowledge" any Python object has, owing to the apparatus of built-in types behind it. Then the idea is: as the programmer, you're free to *extend* the tool box with new types (i.e. classes) of your own design. These might have to do with GUI programming in some way, but they certainly don't have to. The first classes I introduce look like this: import random from random import randint class Animal: def __init__(self, name): self.name = name self.state = 'Awake' def sleep(self): print "Zzzzzzz..." self.state = 'Sleeping' def eat(self, food): print "I am eating %s" % (food) def wakeup(self): self.state = 'Awake' def pain(self, location, amount): # <-- student contribution print "My %s hurts!" % (location) self.state = 'In pain' print "It hurts %s!" % (amount) class Dog(Animal): def bark(self, times): print "Woof woof! " * times def jump(self, object): # <-- one of my students wrote this method fallchance = randint(1,10) if fallchance == 10: print "I tripped over a %s!" % (object) self.pain('head', 'a lot') if fallchance != 10: print "I jumped over a %s." % (object) The fact that OOP has proved especially useful when it comes to GUI programming is very true, but then that's all the more reason to not confuse the two. In my high school level Python classes, I've done quite a bit with OOP, and with graphics (POV-Ray especially, with a Python front end for generating scene description language), but to date I have never yet taught any GUI or widget programming. John Zelle's Tkinter-based graphics.py is an attractive option, if I *do* start getting into teaching that stuff. It's easy to use and gives the right idea, but without getting too complicated too quickly. Kirby From ajsiegel at optonline.net Tue Mar 22 18:53:20 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Tue Mar 22 18:53:29 2005 Subject: [Edu-sig] Undergraduation Message-ID: Paul Graham's recent essay addressed to college CS students: http://www.paulgraham.com/college.html has a discussion of where he sees math fitting in. saying, on one hand, that math is *not* a core skill for a hacker and on the other: """ It's a valuable source of metaphors for almost any kind of work """ and therefore """ One of the most valuable things you could do in college would be to learn what math is really about. This may not be easy, because a lot of good mathematicians are bad teachers. And while there are many popular books on math, few seem good. The best I can think of are W. W. Sawyer's. And of course Euclid. """ I think I could add a number of works of math literature to that list. What isn't addressed is the intersection of math and hacking, in the other direction: i.e. the usefulness of the some skills of a hacker for someone who takes the advice to "learn what math is really about" as a "most valuable thing" - and the more general and primary goal. I found it a good enough reason to learn to hack, a bit. And it nice to see that Graham seems to understand why that might be true. Art From winstonw at stratolab.com Tue Mar 22 20:25:30 2005 From: winstonw at stratolab.com (Winston Wolff) Date: Tue Mar 22 20:25:35 2005 Subject: [Edu-sig] Best approach to teaching OOP and graphics In-Reply-To: <1111395041.423e8ae172c08@webmail.abo.fi> References: <1111395041.423e8ae172c08@webmail.abo.fi> Message-ID: <2fe43dafa6dd6251bcfceff7f74388f8@stratolab.com> I think graphics is a great way to teach programming, because it gives such strong feedback to the students. How about making a small graphics library that has Shape objects. You create a shape object and manipulate it's attributes such as position, color, size, numOfVertices (triangle, square, pentagram), etc. Then you can teach subclassing a shape object, and finally making your own from scratch. PyGame of course is a great environment to build such a thing. -ww > As an active lurker on the edu-sig list, I therefore decided to present > my small "dilemma" here. How do you think OOP and graphics could best > be > introduced in high schools? Is one of my alternatives OK, or do you > have > other suggestions? The fact that the students will be working in pairs > will hardly affect the choice of teaching approach. > > Best Python-regards, > > Linda Grandell > ?bo Akademi University > Turku, Finland > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > _________________________________________ winston wolff - (646) 827-2242 - http://www.stratolab.com - learning by creating -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1309 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050322/9a482309/attachment.bin From schellenberg at gmail.com Tue Mar 22 22:56:48 2005 From: schellenberg at gmail.com (Dan Schellenberg) Date: Tue Mar 22 22:57:06 2005 Subject: [Edu-sig] GvR and Python in the high school In-Reply-To: References: Message-ID: <00da64f482f008545ceab81fb4f3d870@gmail.com> Hello all. I have posed the following question to Jeffrey Elkner, and thought it would be a suitable topic of discussion here on edu-sig as well. I am a pre-service teacher finishing off the last semester of my degree before venturing into the world of full-time teaching. I will likely be teaching some introductory computer science in the fall, and would like to use Python as my language of choice. Additionally, I am intending to start the semester with a couple of weeks of GvR (Guido van Robot). Due to my lack of experience, I was hoping you could help me with my anticipated timeline... Questions: - how long does it take for your students to work through the 18 steps of GvR? http://gvr.sourceforge.net/lessons/rfrank/ - would you be willing to share your course overview/expected timeline for an introductory CS class with me? Any help you would be willing to give would be much appreciated. Dan -- Dan Schellenberg schellenberg@gmail.com http://www.educationaltechnology.ca/dan/ From inxdr at yahoo.com.au Wed Mar 23 07:59:26 2005 From: inxdr at yahoo.com.au (Darren Payne) Date: Wed Mar 23 07:59:29 2005 Subject: [Edu-sig] 9. Best approach to teaching OOP and graphics In-Reply-To: <20050321085110.8639E1E4011@bag.python.org> Message-ID: <20050323065926.32364.qmail@web54609.mail.yahoo.com> > 9. Best approach to teaching OOP and graphics > (Linda Grandell) I too taught Java and Python to 2 separate classes 2 years ago. Funny, the more Java I taught the less I liked it ... but then you get over it and just put up with Java's ways, plus loads of ppl have coded modules to get around many of the short comings. I still feel very negative about Java - it's so much hype and hot air really. Pair programming is fine and works best when both are of equal ability. I would encourage you to avoid putting a stronger / more able person with a weaker / less able person - the stronger one will get very little out of it and can become quite resentful. I really cannot comment re GUI. ----------------------------------------------------------------------------------- regards Darren Payne Hurlstone Agricultural High School Ph: 9829 9222 Fax: 98292026 Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com From chandrakirti at gmail.com Wed Mar 23 12:36:12 2005 From: chandrakirti at gmail.com (Lloyd Hugh Allen) Date: Wed Mar 23 12:36:15 2005 Subject: [Edu-sig] 9. Best approach to teaching OOP and graphics In-Reply-To: <20050323065926.32364.qmail@web54609.mail.yahoo.com> References: <20050321085110.8639E1E4011@bag.python.org> <20050323065926.32364.qmail@web54609.mail.yahoo.com> Message-ID: <24d253d9050323033661156be3@mail.gmail.com> On Wed, 23 Mar 2005 17:59:26 +1100 (EST), Darren Payne wrote: > Pair programming is fine and works best when both are > of equal ability. I would encourage you to avoid > putting a stronger / more able person with a weaker / > less able person - the stronger one will get very > little out of it and can become quite resentful. Although this is in general true... (and in fact, when I assign pairs I most often do it in one of two ways: * students with the top two grades are partners, next two, next two, and so on * Highest grade gets to pick partner from the class. Next highest grade that is not already on a team gets to pick partner from the class. Kind of like picking teams for team dodgeball, but with smaller teams) ...I remember a few counterexamples from my own experience. In most of these cases the (or three) programmers of heterogenous ability had a good personal relationship going into the project. In one case, the weaker programmer had a support role designing and implementing the procedure that would draw static graphics to the screen, while the stronger programmer wrote the logic etc.; in another case, the programmers had romantic ties that I exploited. For the lovebirds, I told them ahead of time that the weaker programmer (the boy) would have to be able to walk me through the code when they were done, and he was in fact able to do so. But yes, homogenous groups (e.g., the first strategy for picking groups above) definitely have their place. Be prepared to give lots and lots of support to your bottoms if you use that strategy. From lgrandel at abo.fi Wed Mar 23 13:02:15 2005 From: lgrandel at abo.fi (Linda Grandell) Date: Wed Mar 23 13:02:33 2005 Subject: [Edu-sig] 9. Best approach to teaching OOP and graphics In-Reply-To: <24d253d9050323033661156be3@mail.gmail.com> References: <20050321085110.8639E1E4011@bag.python.org> <20050323065926.32364.qmail@web54609.mail.yahoo.com> <24d253d9050323033661156be3@mail.gmail.com> Message-ID: <42415AC7.8070404@abo.fi> How to assign the pairs has also been a question on my mind, so I am very glad this came up. >>Pair programming is fine and works best when both are >>of equal ability. > ... > > * students with the top two grades are partners, next two, next two, and so on > * Highest grade gets to pick partner from the class. Next highest > grade that is not already on a team gets to pick partner from the > class. Kind of like picking teams for team dodgeball, but with smaller > teams) I wonder if letting the students pair up for themselves could work? That would more or less be a variant of the second alternative above. Or does this introduce the risk of weaker students pairing up with strong students doing less work? Even learning less? > ...I remember a few counterexamples from my own experience. In most of > these cases the (or three) programmers of heterogenous ability had a > good personal relationship going into the project. In one case, the > weaker programmer had a support role designing and implementing the > procedure that would draw static graphics to the screen, while the > stronger programmer wrote the logic etc.; in another case, the > programmers had romantic ties that I exploited. For the lovebirds, I > told them ahead of time that the weaker programmer (the boy) would > have to be able to walk me through the code when they were done, and > he was in fact able to do so. Sounds just great! Using heterogenous groups would most certainly be an interesting experience from the teacher's point of view. To examine how the pairs distribute the work, who takes lead and so on. However, this might be outside of the scope of my research :) /Linda From lgrandel at abo.fi Wed Mar 23 13:10:38 2005 From: lgrandel at abo.fi (Linda Grandell) Date: Wed Mar 23 13:10:46 2005 Subject: [Edu-sig] Best approach to teaching OOP and graphics In-Reply-To: <2fe43dafa6dd6251bcfceff7f74388f8@stratolab.com> References: <1111395041.423e8ae172c08@webmail.abo.fi> <2fe43dafa6dd6251bcfceff7f74388f8@stratolab.com> Message-ID: <42415CBE.4020202@abo.fi> > I think graphics is a great way to teach programming, because it gives > such strong feedback to the students. So do I. The students seemed rather happy with the text-based programming in the introductory course... And why shouldn't they? There are so many things to learn about programming itself before one even knows how to realizes if something is missing :) However, as we got closer to the end of the course, comments such as "Could this program be done with graphics?" started to occur. Not often, but still. The post-course survey showed that most students had not missed anything during the course, but some stated that "Graphics would have been fun". So, now I have decided to introduce graphics in one way or another in the continuation course. > How about making a small graphics library that has Shape objects. You > create a shape object and manipulate it's attributes such as position, > color, size, numOfVertices (triangle, square, pentagram), etc. Then you > can teach subclassing a shape object, and finally making your own from > scratch. PyGame of course is a great environment to build such a thing. This sounds like a good idea. I was thinking about using the pygsear package first, mainly because I then would have ready-made material and examples to start from. The course starts in three weeks, so I am not really spoiled with time here. However, your suggestion should not take that long to implement. I will put it on my list of possible alternatives. /Linda From lgrandel at abo.fi Wed Mar 23 13:31:04 2005 From: lgrandel at abo.fi (Linda Grandell) Date: Wed Mar 23 13:31:13 2005 Subject: [Edu-sig] Best approach to teaching OOP and graphics In-Reply-To: <200503211745.j2LHj8pp026822@smtp0.abo.fi> References: <200503211745.j2LHj8pp026822@smtp0.abo.fi> Message-ID: <42416188.9050307@abo.fi> > In my book, OOP and graphical programming *are* two different things. I totally agree on this. What I, however, do see as a potential risk here is that the division might lead to students thinking thoughts such as "So now we quit the OOP part and continue with graphics. OK, so no we don't have to worry about those things anymore" Although thoughts like these would be rare, I still feel I need to consider them when deciding on what approach to take in the course. In my experience, stronger students have no problem in seeing the orthogonality of things introduced, whereas the weaker students might find it difficult to even understand that one can use the fundamental structures just about anywhere (e.g. nesting for-loops), as long as the logic holds and the syntax rules are followed. Students like these might get ideas as the one above. Anyway, whatever approach I choose, I am planning on starting with a brief repetition of the basics before rather quickly moving on to OOP. In my opinion, the way you Kirby go about objects is just about perfect, and I am planning on following the same idea. If we were to use the pygsear module together with PyGame, we could go graphical from the very first class. If we, on the other hand, were to use e.g. Zelle's graphics.py (thanks for reminding me about that one, had somehow managed to forget it) I would probably introduce OOP first and then continue with graphics. But then again, there is nothing stopping me from introducing the graphics in the middle of OOP either... Gosh, I just realized that I have a lot of pondering to do over the Easter holiday :) /Linda From chandrakirti at gmail.com Wed Mar 23 14:12:01 2005 From: chandrakirti at gmail.com (Lloyd Hugh Allen) Date: Wed Mar 23 14:12:03 2005 Subject: [Edu-sig] 9. Best approach to teaching OOP and graphics In-Reply-To: <42415AC7.8070404@abo.fi> References: <20050321085110.8639E1E4011@bag.python.org> <20050323065926.32364.qmail@web54609.mail.yahoo.com> <24d253d9050323033661156be3@mail.gmail.com> <42415AC7.8070404@abo.fi> Message-ID: <24d253d905032305123cc6dedb@mail.gmail.com> On Wed, 23 Mar 2005 14:02:15 +0200, Linda Grandell wrote: > I wonder if letting the students pair up for themselves could work? That > would more or less be a variant of the second alternative above. Or does > this introduce the risk of weaker students pairing up with strong > students doing less work? Even learning less? Generally, I would say that letting students on the K-12 level pair themselves in a totally, totally free fashion leads to less learning. This strategy often leads to a classroom management nightmare. With all heterogenous groups (perhaps all groups), it's a good idea to have assigned tasks (for instance, if the program has already been flowcharted, then this person is responsible for this area and this other person is responsible for this area) or differentiated assessment (in my bf/gf example, to have the weaker student lead you through the code in order to ensure that even if they didn't come up with the code, at least they are able to read it). From john.zelle at wartburg.edu Wed Mar 23 14:34:07 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Wed Mar 23 14:34:50 2005 Subject: [Edu-sig] 9. Best approach to teaching OOP and graphics In-Reply-To: <24d253d905032305123cc6dedb@mail.gmail.com> References: <20050321085110.8639E1E4011@bag.python.org> <20050323065926.32364.qmail@web54609.mail.yahoo.com> <24d253d9050323033661156be3@mail.gmail.com> <42415AC7.8070404@abo.fi> <24d253d905032305123cc6dedb@mail.gmail.com> Message-ID: <4241704F.1040509@wartburg.edu> Lloyd Hugh Allen wrote: > On Wed, 23 Mar 2005 14:02:15 +0200, Linda Grandell wrote: > >>I wonder if letting the students pair up for themselves could work? That >>would more or less be a variant of the second alternative above. Or does >> this introduce the risk of weaker students pairing up with strong >>students doing less work? Even learning less? > > > Generally, I would say that letting students on the K-12 level pair > themselves in a totally, totally free fashion leads to less learning. > This strategy often leads to a classroom management nightmare. > > With all heterogenous groups (perhaps all groups), it's a good idea to > have assigned tasks (for instance, if the program has already been > flowcharted, then this person is responsible for this area and this > other person is responsible for this area) or differentiated > assessment (in my bf/gf example, to have the weaker student lead you > through the code in order to ensure that even if they didn't come up > with the code, at least they are able to read it) I don't have experience with pre-college students, so take this advice with a grain of salt. I use pair (even group) programming frequently in my classes. Educational studies have shown that groups of 2 or 3 help students learn better than just having them work alone. One of the real advantages of pair programming is that students can pick up techniques and useful habits from each other. In order to gain the greatest advantage of this, it's important that teams rotate around. That way students end up working with many others during the course of the term, not just their "favorite". I wouldn't worry too much about the weaker students "coasting". They will learn a lot from assisting stronger students, and if the teams change frequently, they will at some point be the stronger student where they can pass on what they've seen others do. -- John M. Zelle, Ph.D. Wartburg College Professor of Computer Science Waverly, IA john.zelle@wartburg.edu (319) 352-8360 From Scott.Daniels at Acm.Org Wed Mar 23 15:00:02 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Wed Mar 23 15:00:35 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <42415CBE.4020202@abo.fi> References: <1111395041.423e8ae172c08@webmail.abo.fi> <2fe43dafa6dd6251bcfceff7f74388f8@stratolab.com> <42415CBE.4020202@abo.fi> Message-ID: Linda Grandell wrote: >> How about making a small graphics library that has Shape objects. You >> create a shape object and manipulate it's attributes such as position, >> color, size, numOfVertices (triangle, square, pentagram), etc. Then >> you can teach subclassing a shape object, and finally making your own >> from scratch. PyGame of course is a great environment to build such a >> thing. > > This sounds like a good idea. I was thinking about using the pygsear > package first, mainly because I then would have ready-made material and > examples to start from. The course starts in three weeks, so I am not > really spoiled with time here. However, your suggestion should not take > that long to implement. I will put it on my list of possible alternatives. Take a look at VPython. It is the simplest to grasp how to put a few things on the screen; it has a nice small set of 3-D primitives, and a quick intro to get a small display going. Really easier than most 2-D packages I've seen to start with, and you get to roll it around. If you are at PyCon, talk to Kirby about his experiences using it in his classes. > > /Linda -- -- Scott David Daniels Scott.Daniels@Acm.Org From glingl at aon.at Fri Mar 25 03:54:43 2005 From: glingl at aon.at (Gregor Lingl) Date: Fri Mar 25 03:54:45 2005 Subject: [Edu-sig] [Tutor] what? (late nite entertainment) (*) Message-ID: <401838D7.2000000@aon.at> What is this? Another version of the well known ... def what(n): x,y = range(n), [0]*n x[1]= 0 z = 0 while z*z <= n: z+=1 if x[z]: x[z*z:n:z]=y[z*z:n:z] return [z for z in x if z] Regards, Gregor (*) at least in good old Europe _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From delza at blastradius.com Fri Mar 25 03:54:51 2005 From: delza at blastradius.com (Dethe Elza) Date: Fri Mar 25 03:54:52 2005 Subject: [Tutor] Re: [Edu-sig] what? (late nite entertainment) (*) In-Reply-To: <401838D7.2000000@aon.at> References: <401838D7.2000000@aon.at> Message-ID: <9E967B83-5217-11D8-A1EA-0003939B59E8@blastradius.com> Well, it seems to generate primes less than n, but breaks if n < 2 (perhaps it should return an empty list?) Another entry for obfuscated python... %-) --Dethe On 28-Jan-04, at 2:33 PM, Gregor Lingl wrote: > def what(n): > x,y = range(n), [0]*n > x[1]= 0 > z = 0 > while z*z <= n: > z+=1 > if x[z]: x[z*z:n:z]=y[z*z:n:z] > return [z for z in x if z] > This past week, everyday when I opened my Wall Street Journal, I was met with a full page ad from Microsoft. This ad was dominated by three simple words "Protect your PC." This strikes me as something akin to the Saudi government running ads in the New York Times in mid-September of 2001 saying "Protect your Tall Buildings." --Russ McGuire -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2371 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050325/518b2ced/smime.bin -------------- next part -------------- _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From glingl at aon.at Fri Mar 25 03:54:53 2005 From: glingl at aon.at (Gregor Lingl) Date: Fri Mar 25 03:54:56 2005 Subject: [Edu-sig] Re: [Tutor] what? (late nite entertainment) (*) In-Reply-To: <5.1.0.14.0.20040129104059.0395f220@192.168.1.1> References: <5.1.0.14.0.20040129104059.0395f220@192.168.1.1> Message-ID: <4018A3A2.6080103@aon.at> Now: early morning corrections ... Alfred Milgrom wrote: > Hi Gregor: > > Hard to work out what is what :) as there seems to be a typo in one > line of your code: > > if x[z]: x[z*z:n:z]=y[z*z:n:z] > > (At least it doesn't work on my machine with Python 2.2) > Yeah, I had the idea when playing around with some new features of Python 2.3, as I do sometimes late at night - before shutting down my computer. This one I found at: http://www.python.org/doc/2.3.3/whatsnew/section-slices.html and I looked for an example for use of "assignment with extended slices" ... > Also the subroutine breaks for n = 1 or less. > Maybe you need a line at the start to say > if n <2 : return [0] > what() was intended to generate all primes less than n. (In fact it's an implementation of the sieve of Eratosthenes). The bugs came not only from not beeing interested in primes less than 2 ;-) but also from beeing a little tired already. Sorry. I think the following version repairs that - and hopefully uses less obfuscating variable names (which in fact originally was part of the "riddle"): def primes(n): sieve, zeros = range(n), [0]*n sieve[:2]= 0,0 i = 1 while i*i < n: if sieve[i]: sieve[i*i:n:i]=zeros[i*i:n:i] i += 1 return [p for p in sieve if p] Regards, Gregor > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From urnerk at qwest.net Fri Mar 25 03:54:54 2005 From: urnerk at qwest.net (Kirby Urner) Date: Fri Mar 25 03:54:57 2005 Subject: [Edu-sig] Re: [Tutor] what? (late nite entertainment) (*) In-Reply-To: <4018A3A2.6080103@aon.at> Message-ID: > def primes(n): > sieve, zeros = range(n), [0]*n > sieve[:2]= 0,0 > i = 1 > while i*i < n: > if sieve[i]: sieve[i*i:n:i]=zeros[i*i:n:i] > i += 1 > return [p for p in sieve if p] > > Regards, > Gregor Very nice. Here's a slight variation: def primes(n): sieve = [1]*n sieve[:2]= 0,0 i = 1 while i*i < n: if sieve[i]: sieve[i*i:n:i] = len(sieve[i*i:n:i]) * [0] i += 1 return [p for p in range(n) if sieve[p]] Kirby _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor From glingl at aon.at Fri Mar 25 10:57:54 2005 From: glingl at aon.at (Gregor Lingl) Date: Fri Mar 25 10:57:41 2005 Subject: [Edu-sig] reappearance of old postings Message-ID: <4243E0A2.3070506@aon.at> Hi, there just appeared a couple of postings from a Jan 2004 thread (on primes) on this list again. (two of them by me) To me it's completely unclear why and how this could happen. Does anybody know ...? Gregor -- Gregor Lingl Reisnerstrasse 3/19 A-1030 Wien Telefon: +43 1 713 33 98 Mobil: +43 664 140 35 27 Website: python4kids.net From dcrosta at sccs.swarthmore.edu Fri Mar 25 17:52:37 2005 From: dcrosta at sccs.swarthmore.edu (Dan Crosta) Date: Fri Mar 25 17:54:49 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Message-ID: Linda Grandell wrote: > > In my book, OOP and graphical programming *are* two different things. > I totally agree on this. What I, however, do see as a potential risk > here is that the division might lead to students thinking thoughts such > as First of all, I disagree here. Well -- they are. But they really shouldn't be. In my opinion (speaking as a Computer Graphics undergrad), computer graphics are a fundamentally object-oriented task. You're manipulating meshes, polygons, lines or points inside one or more graphical contexts, and each of which share certain attributes (location, color) and methods (translate, draw). This suggests a strong class heirarchy to me, and in fact, when I went about writing my own graphics library last semester, my partner and I took a heavily object-oriented approach (though in C++, not Python). Once we got into the real meat of the assignments, we had a much easier time when we only had to reimplement a few functions, thanks to inheritance, rather than rewriting whole functions from the ground up. Additionally, I think graphics provides a helpful visual metaphor for heirarchical systems, which is, in my opinion, an important part of understanding object orientation. If you have a model heirarchy like: - Model m - SubModel a - SubModel b And you call m.translate(10, 0, 0), the students will see that a and b translate by 10 in x as well. This is metaphorically analagous to changing the impelentation of a method or value of a field in a base class, and having that change reflected in the children. In fact, non-OO graphics systems (I'm thinking OpenGL) basically are object oriented, just without the benefit of living in an OO language. You find, when programming OpenGL, that you do a lot of PushMatrix() and PopMatrix(), which implicitly defines 'objects' in the sense of bits of graphical stuff that move around together. Other begin and end calls work similarly. To finish, I'd say that you should consider what you want the students to get out of the course: if you just want them to have a good time, then programming some procedural stuff with graphics (say, a tron-like game, which I did in Java/AWT/Swing when I was in high school) might be a good idea. If you want them to really learn about object orientation, I think working in an object-oriented modeling system, even if you just end up doing simple 2D stuff, makes a whole lot more sense to me. dsc From urnerk at qwest.net Fri Mar 25 18:42:59 2005 From: urnerk at qwest.net (urnerk@qwest.net) Date: Fri Mar 25 18:43:07 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Message-ID: <168980-220053525174259753@M2W065.mail2web.com> Original Message: ----------------- From: Dan Crosta dcrosta@sccs.swarthmore.edu Date: Fri, 25 Mar 2005 11:52:37 -0500 (EST) To: edu-sig@python.org Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Linda Grandell wrote: > > > In my book, OOP and graphical programming *are* two different things. >> I totally agree on this. What I, however, do see as a potential risk >> here is that the division might lead to students thinking thoughts such >> as >First of all, I disagree here. Well -- they are. But they really shouldn't >be. Although we sound like a disagreeable bunch perhaps, I think we're all in general agreement. Graphics programming is very OOPish in most implementations and it makes a whole lot of sense to do graphical programming (GUIs, games, whatever) using objects. The typical think is to export an API in the form of objects with methods and properties. This is how every Pythonic graphics library I'm aware of works. You import a module and you get access to a lot of GUI widgets in the form of objects with methods. You can subclass these widgets or compose them, the way OOPers always do. Typically, we instantiate a window or frame object (some canvas deal) and populate it with buttons, pull-downs and whatever it is. Typically, clicking or mousing over results in events, which our code traps, often by means of callbacks, but maybe by means of the observable/observer design pattern (like Java's). Typically the events themselves are objects (e.g. mouse over events). I just saw a demo of using Python on the Nokia 60-series (a cell phone model). Same thing: a little phone-specific API is imported and appears to the programmer as objects. >Python). Once we got into the real meat of the assignments, we had a much >easier time when we only had to reimplement a few functions, thanks to >inheritance, rather than rewriting whole functions from the ground up. Absolutely. I bet we all agree. >To finish, I'd say that you should consider what you want the students to >get out of the course: if you just want them to have a good time, then >programming some procedural stuff with graphics (say, a tron-like game, >which I did in Java/AWT/Swing when I was in high school) might be a good >idea. If you want them to really learn about object orientation, I think >working in an object-oriented modeling system, even if you just end up >doing simple 2D stuff, makes a whole lot more sense to me. > >dsc I'm a little confused why you'd bring up Java/AWT/Swing as your example of doing some procedural stuff with graphics, as this language is highly object oriented in the way you described previously. But here's the thing, the question I think we're asking in this thread: how do we make it clear to students that OOP is NOT *just* about graphical programming? You can write highly object oriented code that has no GUI whatsoever, is invoked only from the command line with switches, maybe runs in the background as a daemon process (like a database) and communicates with the outer world only through some ports over TCP/IP. Is there anything less OOP about such code, which has no graphical shell? No. OOP, as a concept, is conceptually distinguishable from doing GUI or game or graphical programming, even though, as a paradigm, it has become probably the most popular way of doing all of those things. Kirby Other fun things at Pycon 2005: Python used to write a prototype Air Traffic Control system (prototype only in the sense that it's not commercial yet -- not in the sense that the "real" version would be written in something else (it'd stay Python)). Python used in a language teaching engine with Unreal Tournament 2003 as the simulator (showing fictional Iraqi town) and a speech recognizer. Soldiers train on this before going to Iraq. The mission is basically one of "take me to your leader" except it's more "Hi, I'm Joe, this is my team, where's your main guy and could you please give me directions" (all in Arabic, with the detailed directions likewise in Arabic). I did a presentation on Hypertoons that generated some interest. -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From ajsiegel at optonline.net Fri Mar 25 19:10:16 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Fri Mar 25 19:10:19 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Message-ID: <1e2e341e2e58.1e2e581e2e34@optonline.net> ----- Original Message ----- From: "urnerk@qwest.net" >But here's the thing, the question I think we're asking in this > thread: > how do we make it clear to students that OOP is NOT *just* about > graphicalprogramming? You can write highly object oriented code > that has no GUI That's where I am being confused. Graphical programming has nothing necessarily to do with a GUI, so I am confused why we are discussing them in any way together. VPython and Povray being 2 examples that immediately come to mind. I don't see GUI programming as a necessarily appropriate environment to introudce OOP. But using the metaphor of geometric objects already *is* the canonical way of introducing OOP. What VPython, for example, allows is pursuit of the canonical methodology, but cutting directly to an actual implementation, rather than working on "as-if" basis. We wee the triangle, derived from our more general geometric object, rather than (or in addition to) only seeing a prompt message saying "I am now a triangle". Hard for me to see anything but upside in this approach. Art From dcrosta at sccs.swarthmore.edu Fri Mar 25 19:11:05 2005 From: dcrosta at sccs.swarthmore.edu (Dan Crosta) Date: Fri Mar 25 19:11:07 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <168980-220053525174259753@M2W065.mail2web.com> References: <168980-220053525174259753@M2W065.mail2web.com> Message-ID: On Fri, 25 Mar 2005, urnerk@qwest.net wrote: > But here's the thing, the question I think we're asking in this thread: > how do we make it clear to students that OOP is NOT *just* about graphical > programming? You can write highly object oriented code that has no GUI > whatsoever, is invoked only from the command line with switches, maybe runs > in the background as a daemon process (like a database) and communicates > with the outer world only through some ports over TCP/IP. Is there > anything less OOP about such code, which has no graphical shell? No. OOP, > as a concept, is conceptually distinguishable from doing GUI or game or > graphical programming, even though, as a paradigm, it has become probably > the most popular way of doing all of those things. Oh -- I think I misunderstood. I took graphics to mean computer graphics, in the sense of 2D or 3D drawings, modeling, rendering, etc, not GUI design. I've never worked with a non-OO gui toolkit (though I think GTK is, if I'm not mistaken). My point about Java/AWT/Swing was not meant to be about the language -- we just made a big Graphics object, and used its drawline/drawrect/etc functions inside a big ol' while loop. It was a pain, we had to maintain a lot of state that would have been better served by using an OO approach to state maintenance (the two players, their histories, etc) rather than lots of arrays, variables, etc. dsc From dcrosta at sccs.swarthmore.edu Fri Mar 25 19:15:27 2005 From: dcrosta at sccs.swarthmore.edu (Dan Crosta) Date: Fri Mar 25 19:18:10 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <1e2e341e2e58.1e2e581e2e34@optonline.net> References: <1e2e341e2e58.1e2e581e2e34@optonline.net> Message-ID: On Fri, 25 Mar 2005 ajsiegel@optonline.net wrote: > > But using the metaphor of geometric objects already *is* the > canonical way of introducing OOP. > Slightly tangent: here, in our Object Oriented Programming/Algorithms class (the curriculum of which I'm not a great fan, I should say) uses the Person -> Student, Person -> Professor paradigm for introducing object orientation. I don't think it's a great example, but I struggle to think of any better. I sort of think that graphics might not be a good introduction, since it requires a lot of associated stuff to understand (graphics contexts, how images work or how to draw on-screen)... and you could say "just use this boilerplate for now, you'll get to understand it later" but I feel like that's just as likely to confuse as to provide a good example. As my prof said: "if you ever figure out how students actually learn to program, be sure to let me know..." :) dsc From lac at strakt.com Fri Mar 25 19:36:40 2005 From: lac at strakt.com (Laura Creighton) Date: Fri Mar 25 19:36:43 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: Message from Dan Crosta of "Fri, 25 Mar 2005 13:15:27 EST." References: <1e2e341e2e58.1e2e581e2e34@optonline.net> Message-ID: <200503251836.j2PIaevS012432@theraft.strakt.com> If you want to teach OOP but don't want to teach GUI programming, it is often convenient to develop some text processing tools, using objects like 'words' 'paragraphs' 'names' and what have you. Laura From ajsiegel at optonline.net Fri Mar 25 19:39:05 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Fri Mar 25 19:39:07 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Message-ID: <210a2c215e76.215e76210a2c@optonline.net> ----- Original Message ----- From: Dan Crosta > As my prof said: "if you ever figure out how students actually > learn to > program, be sure to let me know..." :) With a copy to edu-sig@python.org, if they would be so kind ;). Art From jeff at elkner.net Fri Mar 25 19:47:49 2005 From: jeff at elkner.net (Jeffrey Elkner) Date: Fri Mar 25 19:47:31 2005 Subject: [Edu-sig] Graphical Programming and OOP Message-ID: <1111776469.5256.10.camel@robeson> Couldn't help but add my 2 cents on this GUI and OOP topic: 1. I use a procedural oriented approach first in my classes, and my students don't see classes and objects until the second half of the year. 2. Using the livewires module, students write simple games and do GUI programming *without* any knowledge of OOP. (the originial livewires module can be found at: http://www.livewires.org.uk/python/ or a slightly modified version I've put up is at: http://www.ibiblio.org/obp/pyBiblio/livewires/) 3. I introduce OOP by having them create simple but useful classes using only the command line. 4. Only after they have written several classes do we go back to using our new programming paradigm for writing anything involving a GUI. Most students leave this experience with a fairly clear understanding of what a GUI is and what OOP is, and I don't think any of them confuse the two. -- Jeffrey Elkner Open Book Project From jeff at elkner.net Fri Mar 25 19:58:15 2005 From: jeff at elkner.net (Jeffrey Elkner) Date: Fri Mar 25 19:57:59 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <200503251836.j2PIaevS012432@theraft.strakt.com> References: <1e2e341e2e58.1e2e581e2e34@optonline.net> <200503251836.j2PIaevS012432@theraft.strakt.com> Message-ID: <1111777095.5256.21.camel@robeson> One more note on this topic. I'm quickly coming to the conclusion that the best way to teach any programming, OOP or otherwise, is using Test Driven Development (TDD). DocTest is an absolutely wonderful tool in this regard (thanks to Tim Peters!). I write the assignment as a collection of tests, which the students are asked to pass one at a time. They find it fun and empowering, since it helps them break down complex tasks into simple steps. More students are able to solve the problem, and to better understand difficulties they have along the way. I only discovered DocTest a few weeks ago, but if anyone is interested in seeing my first attempt at writing lessons with it you can see them here: http://linus.yhspatriot.net/cs/cs (note: this site changes rapidly, so the lessons might not be here later, but I plan to refine them a bit and put them on the Python Biblioteca: http://www.ibiblio.org/obp/pyBiblio/ On Fri, 2005-03-25 at 19:36 +0100, Laura Creighton wrote: > If you want to teach OOP but don't want to teach GUI programming, > it is often convenient to develop some text processing tools, using objects > like 'words' 'paragraphs' 'names' and what have you. > > Laura -- Jeffrey Elkner Open Book Project From urnerk at qwest.net Fri Mar 25 20:46:59 2005 From: urnerk at qwest.net (urnerk@qwest.net) Date: Fri Mar 25 20:47:04 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Message-ID: <111100-220053525194659194@M2W071.mail2web.com> >That's where I am being confused. > >Graphical programming has nothing necessarily to do with a GUI, so >I am confused why we are discussing them in any way together. The key word is "necessarily" and I completely agree. I was mentioning several kinds of programming. GUI programming *is* graphical, in the sense that "G" stands for "graphical". It so happens the GUI stuff is almost always OO (I talked about that in terms of the Nokia 60 cell phone). I have very limited experience with OpenGL (or PyOpenGL), but yes, the VPython stuff is obviously OO. POV-Ray isn't so obviously, if at all -- but if we write a Python layer on top of POV-Ray (what I like to do), then it makes sense to use OO. > I don't see GUI programming as a necessarily appropriate > environment to introudce OOP. It's certainly the way a lot of people come into contact with it. But you may be right. I think it's possibly useful as an introductory environment, but it could lead to that problem of not understanding OO concepts generically enough, and getting confused about the difference between GUI programming and OO. That seemed to be a confusion we were worried about in this thread. > But using the metaphor of geometric objects already *is* the > canonical way of introducing OOP. Yes, could be. Another canonical metaphor is animals. The mammal class is subclassed into dogs, cats, humans and so on. I've also seen telephones subclassed as fax-phones, cell phones etc. (all types of phone). > What VPython, for example, allows is pursuit of the canonical > methodology, but cutting directly to an actual implementation, > rather than working on "as-if" basis. We wee the triangle, derived > from our more general geometric object, rather than (or in addition to) > only seeing a prompt message saying "I am now a triangle". > > Hard for me to see anything but upside in this approach. I'd have to see you proposal fleshed out in more detail. What is the triangle a subclass or superclass of? What are its methods and properties? And what is the VPython framework you'd use to introduce OO? Kirby -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From ajsiegel at optonline.net Sat Mar 26 02:21:09 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 26 02:21:19 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <111100-220053525194659194@M2W071.mail2web.com> Message-ID: <0IDX00LA4QFE7V@mta2.srv.hcvlny.cv.net> > -----Original Message----- > From: edu-sig-bounces+ajsiegel=optonline.net@python.org [mailto:edu-sig- > bounces+ajsiegel=optonline.net@python.org] On Behalf Of urnerk@qwest.net > I'd have to see you proposal fleshed out in more detail. What is the > triangle a subclass or superclass of? What are its methods and > properties? Its less of a proposal than an observation. OOP is in fact often introduced by way of classes of geometric objects, and subclasses thereof. Java in a Nutshell Second Edition Chapter 3 "Classes and Object in Java" walks the reader through the creation of a Circle class, explains that "Objects are Instances of Classes" and goes from there in defining constructors, methods, etc. and then eventually subclassing the Circle class with a DrawableCircle class. The point is not that this particular book adopts this approach, but that in so doing it is conforming to something of a convention - or so it seems to me. Like the 3d teapot, or the "Hello World" program. But there is no real point being made beyond that. If one chooses to follow the convention - something like VPython provides a quite convenient way for one to get one's DrawableCircle to actually draw, and without the need to prepare anything in the way of a drawing context - which might otherwise become the most complex, obscure and least relevant portion of the code. > And what is the VPython framework you'd use to introduce OO? Uhm... PyGeo ;) Art From ajsiegel at optonline.net Sat Mar 26 02:34:17 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 26 02:34:24 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <0IDX00LA4QFE7V@mta2.srv.hcvlny.cv.net> Message-ID: <0IDX003ZUR1CFW@mta6.srv.hcvlny.cv.net> > > -----Original Message----- > > From: edu-sig-bounces+ajsiegel=optonline.net@python.org [mailto:edu-sig- > > bounces+ajsiegel=optonline.net@python.org] On Behalf Of urnerk@qwest.net > But there is no real point being made beyond that. If one chooses to > follow > the convention - something like VPython provides a quite convenient way > for > one to get one's DrawableCircle to actually draw, and without the need to > prepare anything in the way of a drawing context - which might otherwise > become the most complex, obscure and least relevant portion of the code. > Actually on a little more thought, it is just the point that Scott already made. VPython provides an environment of instantaneous visual feedback. Visual business can be conducted from the command line. Change the color attribute of the object, and the color of the circle instantaneously changes - not even "no compile cycle", no rerun of code of any kind. The object seems in fact like an object - conveys some sense of tangibility, as an object should. And thereby seems to exist in an environment naturally adaptable to the teaching task at hand. Art From lgrandel at abo.fi Sat Mar 26 10:43:56 2005 From: lgrandel at abo.fi (Linda Grandell) Date: Sat Mar 26 10:43:58 2005 Subject: [Edu-sig] Graphical Programming and OOP In-Reply-To: <1111776469.5256.10.camel@robeson> References: <1111776469.5256.10.camel@robeson> Message-ID: <42452EDC.9050401@abo.fi> Jeffrey Elkner wrote: >Couldn't help but add my 2 cents on this GUI and OOP topic: > >1. I use a procedural oriented approach first in my classes, and my >students don't see classes and objects until the second half of the >year. > >2. Using the livewires module, students write simple games and do GUI >programming *without* any knowledge of OOP. > > Seems we are taking a somewhat same approach to teaching programming. I have already given a basic procedural oriented course to my students (using parts of the livewires sheets) and now it is then time to introduce both OOP and graphical programming. >3. I introduce OOP by having them create simple but useful classes using only the command line. > >4. Only after they have written several classes do we go back to using >our new programming paradigm for writing anything involving a GUI. > >Most students leave this experience with a fairly clear understanding of what a GUI is and what OOP is, and I don't think any of them confuse the two. > > This is one of the approaches I have thought of, the other one, as said, being using PyGame throughout the course. I am glad to hear that the former one works :) The more I teach, the more I come to realize that programming might be one of the most challenging subjects for teachers. The main goal is to help the students develop a basic understanding for the concepts involved in programming, preferrably in a fun and enjoying manner. However, there seems to be so many ways one can go in achieving this goal, and finding the right one is anything but easy.. But then again, this might just as well be something very good, something that leads to many "best practices" instead of only one. From lgrandel at abo.fi Sat Mar 26 11:08:40 2005 From: lgrandel at abo.fi (Linda Grandell) Date: Sat Mar 26 11:08:42 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <1111777095.5256.21.camel@robeson> References: <1e2e341e2e58.1e2e581e2e34@optonline.net> <200503251836.j2PIaevS012432@theraft.strakt.com> <1111777095.5256.21.camel@robeson> Message-ID: <424534A8.1090006@abo.fi> I dived right into your lessons... Looks *very* good. I am always looking for "new" approaches to teaching programming, since this is the very topic of my future PhD-thesis. Giving the students a "standard" which there programs are to meet should indeed be very motivating and pose a positive challenge to all students. My class starts in three weeks, so I have some time (not much :) to try out doctest on my own and see if it would be suitable for my students. Did your students find it difficult to learn and start implementing TDD? Have you considered using this approach in the exam? One thought that came to mind would be to make the grades depend on which test cases the programs pass. The test cases could be divided into groups, and in order to pass the tests in the "higher grade"-groups, the programs would have to be more flexible, advanced and so on than programs passing the basic test cases. In this way the same task could be challenging for all students. Finding suitable exam questions can, in my opinion, sometimes be really tricky, especially when there is great variation in the students' programming skills. /Linda Jeffrey Elkner wrote: >One more note on this topic. I'm quickly coming to the conclusion that >the best way to teach any programming, OOP or otherwise, is using Test >Driven Development (TDD). DocTest is an absolutely wonderful tool in >this regard (thanks to Tim Peters!). I write the assignment as a >collection of tests, which the students are asked to pass one at a time. >They find it fun and empowering, since it helps them break down complex >tasks into simple steps. More students are able to solve the problem, >and to better understand difficulties they have along the way. > >I only discovered DocTest a few weeks ago, but if anyone is interested >in seeing my first attempt at writing lessons with it you can see them >here: > >http://linus.yhspatriot.net/cs/cs > >(note: this site changes rapidly, so the lessons might not be here >later, but I plan to refine them a bit and put them on the Python >Biblioteca: > >http://www.ibiblio.org/obp/pyBiblio/ > > > From john.zelle at wartburg.edu Sat Mar 26 13:56:16 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Sat Mar 26 13:56:46 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <0IDX003ZUR1CFW@mta6.srv.hcvlny.cv.net> References: <0IDX003ZUR1CFW@mta6.srv.hcvlny.cv.net> Message-ID: <42455BF0.6020204@wartburg.edu> Arthur wrote: > >>>-----Original Message----- >>>From: edu-sig-bounces+ajsiegel=optonline.net@python.org [mailto:edu-sig- >>>bounces+ajsiegel=optonline.net@python.org] On Behalf Of urnerk@qwest.net >> >>But there is no real point being made beyond that. If one chooses to >>follow >>the convention - something like VPython provides a quite convenient way >>for >>one to get one's DrawableCircle to actually draw, and without the need to >>prepare anything in the way of a drawing context - which might otherwise >>become the most complex, obscure and least relevant portion of the code. >> > > > Actually on a little more thought, it is just the point that Scott already > made. VPython provides an environment of instantaneous visual feedback. > Visual business can be conducted from the command line. Change the color > attribute of the object, and the color of the circle instantaneously changes > - not even "no compile cycle", no rerun of code of any kind. The object > seems in fact like an object - conveys some sense of tangibility, as an > object should. > I agree that graphics programming is a great, concrete way, to teach about objects. That is the point of my 2D graphics library. VPython is also a great tool. The one caveat I would make here is that many OO designers would say that the approach taken by VPython allowing direct attribute access is not good style. Objects should generally be manipulated through methods, not by twiddling fields. I know this is fairly common in Python, but maybe Vpython is not the best first example of object-oriented design. > And thereby seems to exist in an environment naturally adaptable to the > teaching task at hand. > > Art > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > > -- John M. Zelle, Ph.D. Wartburg College Professor of Computer Science Waverly, IA john.zelle@wartburg.edu (319) 352-8360 From ajsiegel at optonline.net Sat Mar 26 15:21:51 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 26 15:21:57 2005 Subject: [Edu-sig] Graphical Programming and OOP In-Reply-To: <42452EDC.9050401@abo.fi> Message-ID: <0IDY001UPQKIFG@mta4.srv.hcvlny.cv.net> > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Linda Grandell > Sent: Saturday, March 26, 2005 4:44 AM > To: Jeffrey Elkner > > The more I teach, the more I come to realize that programming might be > one of the most challenging subjects for teachers. The main goal is to > help the students develop a basic understanding for the concepts > involved in programming, preferrably in a fun and enjoying manner. > However, there seems to be so many ways one can go in achieving this > goal, and finding the right one is anything but easy.. But then again, > this might just as well be something very good, something that leads to > many "best practices" instead of only one. I know this perspective is a little out of left field (as they say), but... Can't help seeing some analogy between programming and athletics. Won't draw it out except to say that having seen Jeff and his students at PyCon in the past years only seems to validate my sense of things here. I see a team and their coach. Programming is hard, and it takes an interest and aptitude as a starting point, and perhaps one can only coach, not teach in the more traditional sense of what teaching a subject has come to mean. Art From winstonw at stratolab.com Sat Mar 26 15:33:12 2005 From: winstonw at stratolab.com (Winston Wolff) Date: Sat Mar 26 15:33:34 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <1111777095.5256.21.camel@robeson> References: <1e2e341e2e58.1e2e581e2e34@optonline.net> <200503251836.j2PIaevS012432@theraft.strakt.com> <1111777095.5256.21.camel@robeson> Message-ID: This is a great idea, test driven lessons. -ww On Mar 25, 2005, at 1:58 PM, Jeffrey Elkner wrote: > One more note on this topic. I'm quickly coming to the conclusion that > the best way to teach any programming, OOP or otherwise, is using Test > Driven Development (TDD). DocTest is an absolutely wonderful tool in > this regard (thanks to Tim Peters!). I write the assignment as a > collection of tests, which the students are asked to pass one at a > time. > They find it fun and empowering, since it helps them break down complex > tasks into simple steps. More students are able to solve the problem, > and to better understand difficulties they have along the way. > > I only discovered DocTest a few weeks ago, but if anyone is interested > in seeing my first attempt at writing lessons with it you can see them > here: > > http://linus.yhspatriot.net/cs/cs > > (note: this site changes rapidly, so the lessons might not be here > later, but I plan to refine them a bit and put them on the Python > Biblioteca: > > http://www.ibiblio.org/obp/pyBiblio/ > > > On Fri, 2005-03-25 at 19:36 +0100, Laura Creighton wrote: >> If you want to teach OOP but don't want to teach GUI programming, >> it is often convenient to develop some text processing tools, using >> objects >> like 'words' 'paragraphs' 'names' and what have you. >> >> Laura > > -- > Jeffrey Elkner > Open Book Project > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > _________________________________________ winston wolff - (646) 827-2242 - http://www.stratolab.com - learning by creating -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1820 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050326/a86371cc/attachment.bin From Scott.Daniels at Acm.Org Sat Mar 26 15:51:20 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Sat Mar 26 15:51:26 2005 Subject: [Edu-sig] Re: Graphical Programming and OOP In-Reply-To: <42452EDC.9050401@abo.fi> References: <1111776469.5256.10.camel@robeson> <42452EDC.9050401@abo.fi> Message-ID: Linda Grandell wrote: > The more I teach, the more I come to realize that programming might be > one of the most challenging subjects for teachers. Have you read Dijkstra's ACM article "The Cruelty of Teaching Computer Programming"? It gives name to many of the tough problems that make the effort less than simple. --Scott David Daniels Scott.Daniels@Acm.Org From ajsiegel at optonline.net Sat Mar 26 16:40:34 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 26 16:40:42 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <42455BF0.6020204@wartburg.edu> Message-ID: <0IDY003L5U7UFF@mta6.srv.hcvlny.cv.net> > -----Original Message----- > From: John Zelle [mailto:john.zelle@wartburg.edu] > Arthur wrote: > I agree that graphics programming is a great, concrete way, to teach > about objects. That is the point of my 2D graphics library. VPython is > also a great tool. The one caveat I would make here is that many OO > designers would say that the approach taken by VPython allowing direct > attribute access is not good style. Objects should generally be > manipulated through methods, not by twiddling fields. I know this is > fairly common in Python, but maybe Vpython is not the best first example > of object-oriented design. I don't fully grasp what you are saying. Probably mostly because my primary understanding of OOP comes directly from Python, and how and to what extent Python differs from other approaches is not an area of much clarity for me. There are also OOP designers who, I know, would argue that the absence of access modifiers in Python is violation of good OOP. I have heard that argument used as a reason why Java is a more appropriate introductory language than Python - establishing good OOP habits early. I would stay out of the argument as to whether access modifiers are essential to enterprise level development efforts. But would note that I do have Java in a Nutshell, Second Edition, publication date 1996 in my library - because that is where I first started in trying to learn programming. And would say that access modifiers were a key impediment to my taking off with Java. I sensed, I think completely correctly, that I was approaching a language whose structure was complicated by concerns that were no way immediate to my own concerns. If enterprise development were to become an interest it would be many moons from my starting point, and I would be able to deal with the issues involved at that time - a natural ordering in time that a language like Java I don't think allows very well. And I don't think we need to be afraid of teaching Python, exactly as it is, as a developed OOP approach. It has grown enough in stature, I think, to have proven itself to be another fully legitimate approach - trading productivity for what others might consider to be necessary stricture. Which brings us back around to TDD, in some sense. Art From jeff at elkner.net Sat Mar 26 17:18:47 2005 From: jeff at elkner.net (Jeffrey Elkner) Date: Sat Mar 26 17:18:58 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <424534A8.1090006@abo.fi> References: <1e2e341e2e58.1e2e581e2e34@optonline.net> <200503251836.j2PIaevS012432@theraft.strakt.com> <1111777095.5256.21.camel@robeson> <424534A8.1090006@abo.fi> Message-ID: <1111853928.12452.16.camel@localhost.localdomain> On Sat, 2005-03-26 at 12:08 +0200, Linda Grandell wrote: > I dived right into your lessons... Looks *very* good. I am always > looking for "new" approaches to teaching programming, since this is the > very topic of my future PhD-thesis. Giving the students a "standard" > which there programs are to meet should indeed be very motivating and > pose a positive challenge to all students. My class starts in three > weeks, so I have some time (not much :) to try out doctest on my own and > see if it would be suitable for my students. Please note, Laura, that I used doctest in more complicated way than needed. *All* you need to do to use doctest is add this to the bottom of your file: if __name__ == "__main__": import doctest doctest.testmod() Then you simply run the module from the command line, and your testing! > Did your students find it difficult to learn and start implementing TDD? Absolutely not. They found it as natural as can be. I've been hanging around an eXtreme Programming user's group for several years now, and I wanted to find a way to use TDD in the classroom. I had a wonderful experience with it two years back (see http://www.elkner.net/jeff/testFirst/index.html), and I wanted to find a way to use this approach throughout the course, but the existing testing frameworks always got in the way. DocTest has changed all that. It is not hard to understand why this is so if you look at Tim's description of why he created DocTest: http://c2.com/cgi/wiki?DocTest Tim has done a brilliant job of creating a testing mechanism that is completely natural to python. Students have no difficulty using it, since it mirrors the way they were informally testing previously. > Have you considered using this approach in the exam? One thought that > came to mind would be to make the grades depend on which test cases the > programs pass. The test cases could be divided into groups, and in order > to pass the tests in the "higher grade"-groups, the programs would have > to be more flexible, advanced and so on than programs passing the basic > test cases. In this way the same task could be challenging for all > students. Finding suitable exam questions can, in my opinion, sometimes > be really tricky, especially when there is great variation in the > students' programming skills. Great idea. I want to work on a python testing program (probably using Zope3) that works this way. If you are interested in the same type of thing, perhaps we could work together? jeff elkner From jeff at elkner.net Sat Mar 26 17:43:21 2005 From: jeff at elkner.net (Jeffrey Elkner) Date: Sat Mar 26 17:43:26 2005 Subject: [Edu-sig] Graphical Programming and OOP In-Reply-To: <0IDY001UPQKIFG@mta4.srv.hcvlny.cv.net> References: <0IDY001UPQKIFG@mta4.srv.hcvlny.cv.net> Message-ID: <1111855401.12452.35.camel@localhost.localdomain> While your analogy may be out in left field (if baseball is the game we are thinking of), it is still very much in the ball park ;-) The only thing I would add is that the "traditional sense of what teaching a subject has come to mean" is in the process of changing. I am actually only trying to do what I was told to do when I began teaching math 13 years ago. All the math teachers in my school system had a two week long workshop by Discovering Geometry author Michael Serra. I left that experience with two ideas that I think about often: 1. Students learn best by doing, not by hearing. 2. Given 1, the teacher needs to move from being the "sage on the stage" to becoming the "guide on the side". "Guide on the side" sounds a lot like coaching to me ;-) On Sat, 2005-03-26 at 09:21 -0500, Arthur wrote: > I know this perspective is a little out of left field (as they say), but... > > Can't help seeing some analogy between programming and athletics. Won't > draw it out except to say that having seen Jeff and his students at PyCon in > the past years only seems to validate my sense of things here. I see a team > and their coach. Programming is hard, and it takes an interest and aptitude > as a starting point, and perhaps one can only coach, not teach in the more > traditional sense of what teaching a subject has come to mean. > > Art From urnerk at qwest.net Sat Mar 26 21:14:01 2005 From: urnerk at qwest.net (Kirby Urner) Date: Sat Mar 26 21:14:21 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <0IDX00LA4QFE7V@mta2.srv.hcvlny.cv.net> Message-ID: <20050326200822.BBDF399D7@mailrelay.t-mobile.com> > And what is the VPython framework you'd use to introduce OO? Uhm... PyGeo ;) Art Exactly, which is why I was encouraging you to flesh this out. If you don't write it, I doubt it'll happen. Agreed that the shapes metaphor is standard in a lot of intro books. Kirby From ajsiegel at optonline.net Sat Mar 26 21:37:47 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 26 21:37:53 2005 Subject: [Edu-sig] Graphical Programming and OOP In-Reply-To: <1111855401.12452.35.camel@localhost.localdomain> Message-ID: <0IDZ00KXV7Z020@mta2.srv.hcvlny.cv.net> > -----Original Message----- > From: Jeffrey Elkner [mailto:jeff@elkner.net] > Sent: Saturday, March 26, 2005 11:43 AM > To: Arthur > > All the math teachers in my school system had a two week long workshop > by Discovering Geometry author Michael Serra. I left that experience > with two ideas that I think about often: > > 1. Students learn best by doing, not by hearing. > 2. Given 1, the teacher needs to move from being the "sage on the stage" > to becoming the "guide on the side". > > "Guide on the side" sounds a lot like coaching to me ;-) Of course there is the risk of generalizing too far from what is true of the study of geometry and of programming - or so it may seem from the perspective of someone who claims a deeply felt relationship between these studies. Art From david at handysoftware.com Sat Mar 26 22:51:26 2005 From: david at handysoftware.com (David Handy) Date: Sat Mar 26 22:50:52 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics Message-ID: <20050326215126.GA25440@arno2> On Sat, Mar 26, 2005 at 11:18:47AM -0500, Jeffrey Elkner wrote: > On Sat, 2005-03-26 at 12:08 +0200, Linda Grandell wrote: > > I dived right into your lessons... Looks *very* good. I have to echo that sentiment. Jeff, your approach is excellent. Test Driven Development really works, I've proved that myself. But what I'm also impressed with is that you gave the students series of tests to pass, each one adding more functionality. You are teaching your students *incremental* development, which is extremely important IMO. > I wanted to find a way to use this approach throughout the course, but the > existing testing frameworks always got in the way. > > DocTest has changed all that. That has been my experience exactly. Speaking of making good use of doctest, I did a presentation recently at the Triangle Zope/Python user's group (TriZPUG) on Python's new-style classes. I wanted to demonstrate the features using an interactive Python session, but I didn't trust myself not to be too nervous to type the commands right. So I created a module called demotest that does the same thing as doctest, except that it prints each command and response, and it waits for me to press Enter before going on to the next line. I just put: if __name__ == '__main__': import demotest demotest.test() at the bottom of my example module and it steps me through my demonstration. If this sounds interesting, here is the link to the notes from my presentation: http://trizpug.org/Members/dhandy/newclass/ and here is a direct link to my demotest module: http://trizpug.org/Members/dhandy/demotest.py Maybe someone else will find it as useful as I did. It requires Python 2.4 because it uses the "advanced" doctest API: it uses DocTestFinder and extends DocTestRunner. David H. ----- End forwarded message ----- From david at handysoftware.com Sat Mar 26 23:00:00 2005 From: david at handysoftware.com (David Handy) Date: Sat Mar 26 22:59:32 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <20050326215126.GA25440@arno2> References: <20050326215126.GA25440@arno2> Message-ID: <20050326220000.GC25440@arno2> On Sat, Mar 26, 2005 at 04:51:26PM -0500, David Handy wrote: > So I created a module called demotest that does the same thing as doctest, > except that it prints each command and response, and it waits for me to > press Enter before going on to the next line. I just put: > > if __name__ == '__main__': > import demotest > demotest.test() > > at the bottom of my example module and it steps me through my demonstration. Correction: if __name__ == '__main__': import demotest demotest.demo() (The function name is demo(), not test(). You'd think I could get my own API right...) David H. > > If this sounds interesting, here is the link to the notes from my > presentation: > > http://trizpug.org/Members/dhandy/newclass/ > > and here is a direct link to my demotest module: > > http://trizpug.org/Members/dhandy/demotest.py > > Maybe someone else will find it as useful as I did. It requires Python 2.4 > because it uses the "advanced" doctest API: it uses DocTestFinder and > extends DocTestRunner. > > David H. From ajsiegel at optonline.net Sat Mar 26 23:01:12 2005 From: ajsiegel at optonline.net (Arthur) Date: Sat Mar 26 23:01:18 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <20050326200822.BBDF399D7@mailrelay.t-mobile.com> Message-ID: <0IDZ00HJ0BUMQU@mta1.srv.hcvlny.cv.net> > -----Original Message----- > From: Kirby Urner [mailto:urnerk@qwest.net] > Sent: Saturday, March 26, 2005 3:14 PM > To: 'Arthur'; edu-sig@python.org > Subject: RE: RE: [Edu-sig] Re: Best approach to teaching OOP and graphics > > > > And what is the VPython framework you'd use to introduce OO? > > Uhm... PyGeo ;) > > Art > > Exactly, which is why I was encouraging you to flesh this out. If you > don't > write it, I doubt it'll happen. Well I'm reluctant to promote PyGeo until I have a distribution available with which I am more happy. The version on my machine is already quite restructured from what is in cvs on sourceforge. What is downloadable on my site is downright obsolete, from my perspective. Interesting how refractoring works. The more I work at it, the less code there is. Difficult to get it polished off and out there for the same reasons I found it impossible to make it to PyCon. Once there is something out there with which I am happy, you will hear more about PyGeo then you can stand ;) Art > > Agreed that the shapes metaphor is standard in a lot of intro books. > > Kirby > > From ajsiegel at optonline.net Sun Mar 27 15:49:12 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 27 15:49:22 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IE000753IC8X0@mta5.srv.hcvlny.cv.net> Message-ID: <0IE000GQ2JQ9QM@mta7.srv.hcvlny.cv.net> -----Original Message----- > From: Arthur [mailto:ajsiegel@optonline.net] > > -----Original Message----- > > From: Kirby Urner [mailto:urnerk@qwest.net] > > > > I pick up my tetrahedron (black electrical tape on the edges, good > > contrast), and say "Measuring cup!" (I probably say more). Then I scoop > > up > > a boat load of beans. Now it's full. In my other hand, Cube. How many > > tetrahedron cups to fill my Cube? Guesses, kids calling out. Well, > let's > > see... one.... two.... three. Done. It's brimming with beans, no room > > for > > more. Is the ratio exact? You betcha. > > Might they also be interested that in Egypt, long-ago, in the shadow of > the > Pyramids, folks not only understood this to be true, but were not content > with this knowledge. A way of thinking was developed that allowed them to > become satisfied that the truth of this observation "makes sense" - that > we > should in fact *expect* it to be true. > > http://babbage.clarku.edu/~djoyce/java/elements/bookXIII/propXIII15.html > > What seems surprising - given a logical progression of thought - can be > found to be not surprising, really. > > What is the lesson to be learned from that? > > To me, it *is* the lesson. I am reading - among others (I am a committed multitasker) - a book called "In the Wake of Chaos" by Stephen Kellert, which is a treatise on the philosophical implications of Chaos Theory. For Kirby ... Wittgenstein's name comes up in the second paragraph of the Prologue. And as a philosophical work it delves into such things as the "character of understanding". I was struck by reading this morning that the description of "epistemic understanding" - one of 3 broad categories of scientific understanding defined - is defined in almost precisely the same words I found to describe what I think we get (and can transmit) from Euclidian reasoning. "The epistemic conception holds that science advances understanding by making events less surprising, by making phenomena expectable" My position here has been that the importance of transmitting to students an understanding of scientific understanding needs to be a among the most fundamental goals of education. And my question has been to what extent can we tailor the process of teaching programming to contribute to this goal - and thereby, in my mind make it *important*. And to what extent should we let ourselves be satisfied with transmitting the practice of a practice, and convince ourselves it is important. Art From ajsiegel at optonline.net Sun Mar 27 16:42:51 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 27 16:43:01 2005 Subject: [Edu-sig] Latest VPython distribution Message-ID: <0IE000BTGM7JY2@mta5.srv.hcvlny.cv.net> The VPython 3.1.1 release (of 2/25/05) takes a significant step forward toward a sane Windows distribution: """ * The MS Windows installer has been componentized, and will respect an existing installation of Numeric or Numarray. """ Thank goodness. They keep this up and I'll have nothing left to rant about. This is quite important to me, as PyGeo depends on VPython, and I have been reluctant to send anybody over to fetch the distribution - considering it somewhat viral - and have therefore been struggling with the idea of a complex PyGeo distribution that would include the VPython essentials. This is a big step in the direction of mooting those concerns. Art From dragoncow2 at gmail.com Sun Mar 27 22:19:34 2005 From: dragoncow2 at gmail.com (Nicholas Wheeler) Date: Sun Mar 27 22:19:36 2005 Subject: [Edu-sig] Graphical Programming and OOP In-Reply-To: <0IDZ00KXV7Z020@mta2.srv.hcvlny.cv.net> References: <1111855401.12452.35.camel@localhost.localdomain> <0IDZ00KXV7Z020@mta2.srv.hcvlny.cv.net> Message-ID: <9047620b0503271219342b7751@mail.gmail.com> >From a perspective of one of Jeffrey Elkner's former students, I can add my 1.2 cents. The method of teaching from the side is very good for those that are very motivated to learn computer programming, and it is those students who generally go to PyCon, on the other hand, there are also the students who take Computer Science as just another elective, and are not really motivated to learn too much, this must make teaching even harder. I'm glad I'm not a teacher. (Sorry Arthur, 'reply' doesn't reply to the list for some silly reason) On Sat, 26 Mar 2005 15:37:47 -0500, Arthur wrote: > > > > -----Original Message----- > > From: Jeffrey Elkner [mailto:jeff@elkner.net] > > Sent: Saturday, March 26, 2005 11:43 AM > > To: Arthur > > > > All the math teachers in my school system had a two week long workshop > > by Discovering Geometry author Michael Serra. I left that experience > > with two ideas that I think about often: > > > > 1. Students learn best by doing, not by hearing. > > 2. Given 1, the teacher needs to move from being the "sage on the stage" > > to becoming the "guide on the side". > > > > "Guide on the side" sounds a lot like coaching to me ;-) > > Of course there is the risk of generalizing too far from what is true of the > study of geometry and of programming - or so it may seem from the > perspective of someone who claims a deeply felt relationship between these > studies. > > Art > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- Nicholas Wheeler Systems Administrator Development InfoStructure From ajsiegel at optonline.net Sun Mar 27 22:57:13 2005 From: ajsiegel at optonline.net (Arthur) Date: Sun Mar 27 22:57:18 2005 Subject: [Edu-sig] Graphical Programming and OOP In-Reply-To: <9047620b0503271219342b7751@mail.gmail.com> Message-ID: <0IE1009EO3JYH3@mta1.srv.hcvlny.cv.net> > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Nicholas Wheeler > > >From a perspective of one of Jeffrey Elkner's former students, I can > add my 1.2 cents. The method of teaching from the side is very good > for those that are very motivated to learn computer programming, and > it is those students who generally go to PyCon, on the other hand, > there are also the students who take Computer Science as just another > elective, and are not really motivated to learn too much, this must > make teaching even harder. I'm glad I'm not a teacher. I'm not a teacher either. But don't know whether to be glad. But I do think your point is not unrelated to a more general point. That *how* to teach programming cannot be separated from the *why* to teach programming. Art > > (Sorry Arthur, 'reply' doesn't reply to the list for some silly reason) > > On Sat, 26 Mar 2005 15:37:47 -0500, Arthur wrote: > > > > > > > -----Original Message----- > > > From: Jeffrey Elkner [mailto:jeff@elkner.net] > > > Sent: Saturday, March 26, 2005 11:43 AM > > > To: Arthur > > > > > > All the math teachers in my school system had a two week long workshop > > > by Discovering Geometry author Michael Serra. I left that experience > > > with two ideas that I think about often: > > > > > > 1. Students learn best by doing, not by hearing. > > > 2. Given 1, the teacher needs to move from being the "sage on the > stage" > > > to becoming the "guide on the side". > > > > > > "Guide on the side" sounds a lot like coaching to me ;-) > > > > Of course there is the risk of generalizing too far from what is true of > the > > study of geometry and of programming - or so it may seem from the > > perspective of someone who claims a deeply felt relationship between > these > > studies. > > > > Art > > > > _______________________________________________ > > Edu-sig mailing list > > Edu-sig@python.org > > http://mail.python.org/mailman/listinfo/edu-sig > > > > > -- > Nicholas Wheeler > Systems Administrator > Development InfoStructure > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig From john.zelle at wartburg.edu Mon Mar 28 00:04:24 2005 From: john.zelle at wartburg.edu (John Zelle) Date: Mon Mar 28 00:05:40 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <0IDY003L5U7UFF@mta6.srv.hcvlny.cv.net> References: <0IDY003L5U7UFF@mta6.srv.hcvlny.cv.net> Message-ID: <42472DE8.20000@wartburg.edu> Arthur wrote: > >>-----Original Message----- >>From: John Zelle [mailto:john.zelle@wartburg.edu] >>Arthur wrote: >>I agree that graphics programming is a great, concrete way, to teach >>about objects. That is the point of my 2D graphics library. VPython is >>also a great tool. The one caveat I would make here is that many OO >>designers would say that the approach taken by VPython allowing direct >>attribute access is not good style. Objects should generally be >>manipulated through methods, not by twiddling fields. I know this is >>fairly common in Python, but maybe Vpython is not the best first example >>of object-oriented design. > > > I don't fully grasp what you are saying. Probably mostly because my primary > understanding of OOP comes directly from Python, and how and to what extent > Python differs from other approaches is not an area of much clarity for me. > > There are also OOP designers who, I know, would argue that the absence of > access modifiers in Python is violation of good OOP. I have heard that > argument used as a reason why Java is a more appropriate introductory > language than Python - establishing good OOP habits early. > I am not really talking about access modifiers. I am simply saying that most OOD guidelines would suggest that an object should be modified by calling its methods, not by setting fields. In VPython one does mySphere.color = color.red as opposed to something like: mySphere.setColor(color.red) There is a good reason for these traditional guidelines, that is to make the abstraction you are defining independent of its implementation. Down the road, I might want to change the internal representation of color, or remove or rename the color instance variable. If existing code exploits this internal feature of a class, then changing the implementation may break code that uses it. So this is bad design --- in most languages. And yet, this is common in Python. Why? Because of Python's dynamic nature I can still change the implementation should I choose to and I can preserve the old abstraction (interface) using getAttr and setAttr magic. I can't do that in most other languages, which is why they tend to use getter and setter methods. What I am saying, is that if you are teaching programming for the purpose of having students learn general principles of programming, implementation independence is an important concept. But you probably don't want to get into setAttr and getAttr right away. That means you probably want examples of OOD that use methods to change objects. Otherwise you _seem_ to be providing them examples that contradict good practice that you tell them about. If you are just teaching programming as a road to learning some other subject in depth, then I don't see much problem here. But I wouldn't want my students to apply the Python style in, say, Java. > I would stay out of the argument as to whether access modifiers are > essential to enterprise level development efforts. > > But would note that I do have Java in a Nutshell, Second Edition, > publication date 1996 in my library - because that is where I first started > in trying to learn programming. And would say that access modifiers were a > key impediment to my taking off with Java. I sensed, I think completely > correctly, that I was approaching a language whose structure was complicated > by concerns that were no way immediate to my own concerns. If enterprise > development were to become an interest it would be many moons from my > starting point, and I would be able to deal with the issues involved at that > time - a natural ordering in time that a language like Java I don't think > allows very well. Agreed here. Access modifiers are another matter. I think intro programming are much more natural in languages where I don't have to worry about Public, Private, and Protected and the like. > > And I don't think we need to be afraid of teaching Python, exactly as it is, > as a developed OOP approach. It has grown enough in stature, I think, to > have proven itself to be another fully legitimate approach - trading > productivity for what others might consider to be necessary stricture. > I don't disagree with this. And I think there is no reason to avoid VPython per se. I'm just suggesting there is an issue to consider in that it appears (on its surface) to violate an important OOD principle. > Which brings us back around to TDD, in some sense. Not sure I see the connection here. But I agree with others in this thread that TDD is a great way to teach and develop. -- John M. Zelle, Ph.D. Wartburg College Professor of Computer Science Waverly, IA john.zelle@wartburg.edu (319) 352-8360 From delza at livingcode.org Mon Mar 28 07:08:30 2005 From: delza at livingcode.org (Dethe Elza) Date: Mon Mar 28 07:08:30 2005 Subject: [Edu-sig] Re: Best approach to teaching OOP and graphics In-Reply-To: <42472DE8.20000@wartburg.edu> References: <0IDY003L5U7UFF@mta6.srv.hcvlny.cv.net> <42472DE8.20000@wartburg.edu> Message-ID: <73e677429434401dc7d8041d4cf7a256@livingcode.org> On 27-Mar-05, at 2:04 PM, John Zelle wrote: > I am not really talking about access modifiers. I am simply saying > that most OOD guidelines would suggest that an object should be > modified by calling its methods, not by setting fields. In VPython one > does mySphere.color = color.red as opposed to something like: > mySphere.setColor(color.red) > > There is a good reason for these traditional guidelines, that is to > make the abstraction you are defining independent of its > implementation. Down the road, I might want to change the internal > representation of color, or remove or rename the color instance > variable. If existing code exploits this internal feature of a class, > then changing the implementation may break code that uses it. So this > is bad design --- in most languages. > > And yet, this is common in Python. Why? Because of Python's dynamic > nature I can still change the implementation should I choose to and I > can preserve the old abstraction (interface) using getAttr and setAttr > magic. I can't do that in most other languages, which is why they tend > to use getter and setter methods. Or more recently (and cleanly) by using properties (new style classes only). The *only* reason that other languages promote the use of method calls over direct property access is because they don't have properties. Without properties it is very difficult to go in and modify the implementation without changing the interface if you start by using attributes, but in Python that problem just doesn't exist. There are still times when you don't want to expose attributes directly, but getters and setters don't help you there either. For example, if both myObj.x and myObj.y must be changed in synch to stay valid, then they should be set via myObj.setXandY(x,y) not myObj.x = newX, myObj.y = newY. But this is a design problem not a language problem. > What I am saying, is that if you are teaching programming for the > purpose of having students learn general principles of programming, > implementation independence is an important concept. But you probably > don't want to get into setAttr and getAttr right away. That means you > probably want examples of OOD that use methods to change objects. > Otherwise you _seem_ to be providing them examples that contradict > good practice that you tell them about. No, don't get into setAttr and getAttr right away! Avoid them if you can. Go with new style classes (those that inherit from object), and teach them to use attributes to begin with (simple), and properties when needed. > If you are just teaching programming as a road to learning some other > subject in depth, then I don't see much problem here. But I wouldn't > want my students to apply the Python style in, say, Java. Nor Java style in Python. Phillip Eby has a longer (and quite good) piece on this: http://dirtsimple.org/2004/12/python-is-not-java.html. --Dethe "No lesson seems to be so deeply inculcated by experience of life as that you should never trust experts. If you believe doctors, nothing is wholesome; if you believe theologians, nothing is innocent; if you believe soldiers, nothing is safe." --Lord Salisbury, 19th century British prime minister -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/edu-sig/attachments/20050327/cb8c4265/smime-0001.bin From ajsiegel at optonline.net Mon Mar 28 15:28:30 2005 From: ajsiegel at optonline.net (Arthur) Date: Mon Mar 28 15:28:35 2005 Subject: [Edu-sig] RE: Concentric hierarchy / hypertoon (was pygame etc.) In-Reply-To: <0IE000GQ2JQ9QM@mta7.srv.hcvlny.cv.net> Message-ID: <0IE200B5FDFIMG@mta2.srv.hcvlny.cv.net> > -----Original Message----- > From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On > Behalf Of Arthur > > My position here has been that the importance of transmitting to students > an understanding of scientific understanding needs to be a among the most > fundamental goals of education. Wandering, again... But the basis for identifying the importance of this goal can certainly be misinterpreted. The understanding being sought perhaps being more important - in today's world - in providing a legitimate basis to resist illegitimate claims made in the name of science, as it is in appreciating science's legitimate scope. Art From gvwilson at cs.utoronto.ca Mon Mar 28 15:40:21 2005 From: gvwilson at cs.utoronto.ca (Greg Wilson) Date: Mon Mar 28 15:40:24 2005 Subject: [Edu-sig] DrPython In-Reply-To: <20050328050831.074CA1E400F@bag.python.org> References: <20050328050831.074CA1E400F@bag.python.org> Message-ID: Hi everyone. Three of my students have been working with Dan Pozmanter on DrPython, an entry-level IDE for Python programming whose feature set is comparable to that of DrScheme and DrJava. We're coming up on the end of term, so I was wondering who'd be interested in giving it a test drive --- we'd welcome feedback, and if you have any senior undergrads looking for a thesis project, I think further development of DrPython would be an excellent choice. Thanks, Greg Wilson (gvwilson at cs dot utoronto dot ca) From swaroopch at gmail.com Mon Mar 28 15:46:27 2005 From: swaroopch at gmail.com (Swaroop C H) Date: Mon Mar 28 15:46:29 2005 Subject: [Edu-sig] DrPython In-Reply-To: References: <20050328050831.074CA1E400F@bag.python.org> Message-ID: <351e88710503280546614ca262@mail.gmail.com> On Mon, 28 Mar 2005 08:40:21 -0500 (EST), Greg Wilson wrote: > Hi everyone. Three of my students have been working with Dan Pozmanter on > DrPython, an entry-level IDE for Python programming whose feature set is > comparable to that of DrScheme and DrJava. We're coming up on the end of > term, so I was wondering who'd be interested in giving it a test drive --- > we'd welcome feedback, and if you have any senior undergrads looking for a > thesis project, I think further development of DrPython would be an > excellent choice. I've been using DrPython for quite a while now, even though I prefer VIM. I like the simplicity of the GUI as well as the range of plugins (although I haven't tried them yet, I have my eye on the code completion plugin) It's a great IDE :) P.S. I did post once in the DrPython forum that the Linux package doesn't contain important directories but the forum seems awefully quiet. -- Swaroop C H Blog: http://www.swaroopch.info Book: http://www.byteofpython.info From urnerk at qwest.net Tue Mar 29 04:49:19 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 04:49:22 2005 Subject: [Edu-sig] using doctest in intro to Python (good idea) In-Reply-To: <20050326220000.GC25440@arno2> Message-ID: <20050329024922.0FE5E1E4008@bag.python.org> Thanks to Jeff (and others) for reminding me about doctest. I did 3 hours leading a Python training today, for GIS people (ESRI is moving to Python for its scripting language). One of my modules contained this doctest example, which I tweaked to ensure at least one test failed for the cameras: def okfloat(anystring): """ Accept a string and say if it's in float format >>> okfloat(1.2) False >>> okfloat('5.692') True >>> okfloat('abc') False >>> okfloat('1') True >>> okfloat([1]) # make True or invent test to force error report False """ try: # preferred: assert isinstance(anystring, basestring) assert type(anystring)==type('') f = float(anystring) return True except: return False if __name__ == '__main__': import doctest doctest.testmod() All in all, the training went well, but I need to remember that 3 hrs is NOT enough to cover all basic and advanced features of the language. We got to generators, and even decorators, but not, perversely, classes per se. Kirby From urnerk at qwest.net Tue Mar 29 05:05:39 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 05:05:43 2005 Subject: [Edu-sig] More on intro to Python (today's 3 hr training) Message-ID: <20050329030541.566BE1E4008@bag.python.org> So below is a module I tossed up on the big screen in my hotel conference room (the typical scene: breakout rooms, a vendor/exhibitor space, big lunch room with an interesting talk (and it *was* very interesting)). This was probably the most advanced topic I dealt with (decorators) and I didn't even show 'em their archetypal context, inside of classes (talked about it though). But given these were GIS folks (very visual), I thought this'd be a good excuse to at least throw out a couple plots (graphs of curves and their derivatives). I introduced decorators under the heading of "functions as top level" i.e. passable as arguments, valid as returned objects, allowing factory functions returning closures and blah blah. The itertools import shouldn't be there. I was experimenting with giving matplotlib generators to munch on, but that failed -- I think it wants to see the whole list first, to figure out scaling. Makes sense. I quick showed my hypertoon (under a minute I think), just to show off what add-ons can do (i.e. VPython). Didn't even get to my example of using ADO to add a record to the Products table in Northwind.mdb. Pity. And for some reason my feeble pre-talk attempt to open a Word document using COM crashed Python after opening said Greeting.doc (a problem with wrapping Word Objects 11.0 in Office 2003, or is it just me?). Speaking of hypertoons, Scott sent me a cool refactoring of said module using decorators. I just got it this AM and haven't gotten around to actually studying the revisions, but I plan to. That'd really break 2.3 compatibility, but I have reason to think 2.3 isn't showing some of the cartoons properly anyway. BTW, 2.4 experimental VPython failed to work with gcurve in my experiments -- I was going to use its plotting facility in the demo, but ended up switching to matplotlib for this very reason. Could be that I just didn't know how to use it right? If anyone has a working gcurve plot in VPython 2.4 experimental, I'd like to test it on my setup. Kirby ============================= # Decorators (new in 2.4) from itertools import izip import math from pylab import arange, plot, xlabel, ylabel, title, grid, show def adderfactory(n): """ Return an adder function that adds n to its argument """ def adder(x): return x + n return adder def test0(): add2 = adderfactory(2) add10 = adderfactory(10) print "add2(17) : %s" % add2(17) print "add10(17): %s" % add10(17) def derivative(f): """ Factory function: accepts a function, returns a closure """ def df(x, h=1e-8): return (f(x + h) - f(x))/h return df def g(x): return x*x def curve(x): return pow(x, 3) @derivative # same as dg = derivative(dg) def dg(x): return x*x @derivative # same as dcurve = derivative(dcurve) def dcurve(x): return x*x*x @derivative def dcos(x): return math.cos(x) def test1(a=-5,b=6): print "g(x) : %s" % [g(x) for x in range(a,b)] print "dg(x): %s" % [round(dg(x),2) for x in range(a,b)] print "="*30 print "curve(x) : %s" % [curve(x) for x in range(a,b)] print "dcurve(x): %s" % [round(dcurve(x),2) for x in range(a,b)] def test2(): """ Use matplotlib to plot graph """ x = arange(-10,10,0.1) y = [curve(i) for i in x] dy = [dcurve(i) for i in x] plot(x, y, linewidth=1.0) plot(x, dy, linewidth=1.0) xlabel('x') ylabel('y') title('Graph of x**3 & 3*x**2') grid(True) show() def test3(): """ Use matplotlib to plot graph """ x = arange(-10,10,0.1) y = [dcos(i) for i in x] dy = [math.cos(i) for i in x] plot(x, y, linewidth=1.0) plot(x, dy, linewidth=1.0) xlabel('x') ylabel('y') title('Graph of cos & dcos(x)') grid(True) show() From Scott.Daniels at Acm.Org Tue Mar 29 08:05:37 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Tue Mar 29 08:05:45 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: <20050329030541.566BE1E4008@bag.python.org> References: <20050329030541.566BE1E4008@bag.python.org> Message-ID: Kirby Urner wrote: > Speaking of hypertoons, Scott sent me a cool refactoring of said module > using decorators. I just got it this AM and haven't gotten around to > actually studying the revisions, but I plan to. I was actually so pleased with the way it went that I filed a cookbook recipe at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393010 --Scott David Daniels Scott.Daniels@Acm.Org From andre.roberge at gmail.com Tue Mar 29 14:24:24 2005 From: andre.roberge at gmail.com (=?ISO-8859-1?Q?Andr=E9_Roberge?=) Date: Tue Mar 29 14:31:55 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: <20050329030541.566BE1E4008@bag.python.org> References: <20050329030541.566BE1E4008@bag.python.org> Message-ID: Kirby Urner wrote: > [snip] > > > > def derivative(f): > """ > Factory function: accepts a function, returns a closure > """ > def df(x, h=1e-8): > return (f(x + h) - f(x))/h > return df > Sorry for being picky, but while your derivative factory function follows the mathematical definition, it is not the "best" way to do it numerically. The preferred way is: def derivative(f): """ Factory function: accepts a function, returns a closure """ def df(x, h=1e-8): return (f(x + h/2) - f(x - h/2))/h return df This is best seen by doing a graph (say a parabola) and drawing the derivative with a large "h" using both methods near a local minimum. Andr? From urnerk at qwest.net Tue Mar 29 17:05:00 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 17:05:50 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: Message-ID: <20050329150502.71CD91E400C@bag.python.org> > Sorry for being picky, but while your derivative factory > function follows the mathematical definition, it is not the > "best" way to do it numerically. The preferred way is: > > def derivative(f): > """ > Factory function: accepts a function, returns a closure > """ > def df(x, h=1e-8): > return (f(x + h/2) - f(x - h/2))/h > return df > > This is best seen by doing a graph (say a parabola) and drawing > the derivative with a large "h" using both methods near a local > minimum. > > Andr? Hey good to know Andr? and thanks for being picky. Fresh from yesterday's example, I posted something about *integration* to a community college math teacher list last night, which I think is maybe closer to your better way (which I hadn't seen yet). === def integrate(f,a,b,h=1e-3): """ Definite integral with discrete h Accepts whatever function f, runs x from a to b using increments h """ x = a sum = 0 while x <= b: sum += h*(f(x-h)+f(x+h))/2.0 # average f(x)*h x += h return sum >>> def g(x): return pow(x,2) # so this is what we want to investigate >>> integrate(g,0,3,h=1e-4) # h = 0.0001, close to 9 8.9995500350040558 >>> integrate(f,0,3,h=1e-6) # h = 0.000001, even closer to 9 8.9999954998916039 def defintegral(intexp, a, b): return intexp(b) - intexp(a) >>> def intg(x): return (1./3)*pow(x,3) # limit function >>> defintegral(intg, 0, 3) # exactly 9 9.0 === The post (which includes the above but is longer) hasn't showed up in the Math Forum archives yet, or I'd add a link for the record. Maybe later. Kirby From henrik at nada.kth.se Tue Mar 29 20:18:13 2005 From: henrik at nada.kth.se (Henrik Eriksson) Date: Tue Mar 29 20:18:17 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <20050329150502.71CD91E400C@bag.python.org> References: <20050329150502.71CD91E400C@bag.python.org> Message-ID: Kirby got the trapezoidal integration rule wrong. This is the corrected version. def integrate(f,a,b,n=1000): sum = 0 h = (b-a)/float(n) for i in range(1,n): sum += f(a+i*h) return h*(0.5*f(a)+sum+0.5*f(b)) The interval must be divided into n equal parts, so an arbitrary h will not do. With this version, the error in Kirby's integration of x^2 from 0 to 3 will decrease by a factor of 100000. But you never use the trapezoidal rule in real life! Simpson gives much smaller error for the same amount of computation. In fact, it is exact for Kirby's example! Henrik From ajsiegel at optonline.net Tue Mar 29 20:20:46 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Tue Mar 29 20:20:55 2005 Subject: [Edu-sig] Scandroid 1.0 Message-ID: <5253bd52700f.52700f5253bd@optonline.net> >From Charles O. Hartman, Professor of English and Poet in Residence at Conneticut College: http://cherry.conncoll.edu/cohar/COH%20programs%20page.htm """ The Scandroid is a program that scans iambic pentameters. You can load the text file of a poem, or type lines in by hand. As you "Step" through the process, the program explains what it's doing: identifying syllables and lexical stresses, dividing the line into feet and so on. This makes it a self-teaching tool. At the same time, it's suitable for some kinds of research on metrics. Though it uses the traditional foot-based scansion, some of its techniques and principles of construction derive from recent decades' work in generative phonology. There's a Manual that describes both how the program works and why it works that way. """ Sounds like its doing something hard. Written in Python. Haven't tried it yet, but it sure looks interested - maybe most particluarly for some subset of those not buying my geometry based polemics. Art From urnerk at qwest.net Tue Mar 29 20:49:09 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 20:49:13 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: Message-ID: <20050329184911.C39EB1E400C@bag.python.org> > Kirby got the trapezoidal integration rule wrong. Right, I was just doing a simple average, not any trapezoid. My rectangles took the mean between f(x-h) and f(x+h), nothing more. Not the best approximation, I agree, but simple to think about, and some text books show it. > This is the corrected version. > > def integrate(f,a,b,n=1000): > sum = 0 > h = (b-a)/float(n) > for i in range(1,n): > sum += f(a+i*h) > return h*(0.5*f(a)+sum+0.5*f(b)) > So now we should come up with the @integral decorator to wrap any function in its integral. How would that look? Kirby From urnerk at qwest.net Tue Mar 29 20:54:58 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 20:55:00 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: <7528bcdd050329090428603d87@mail.gmail.com> Message-ID: <20050329185459.7DE521E400C@bag.python.org> > So, the "smart" algorithm should be (untested here.... left as an > exercise :-) > > sum = ( f(a) + f(b) ) / 2. > x = a + h > B = b-h/2 # takes care of round-off error at end point. > > .while x <= B: > . sum += f(x) > . x += h > . > . sum *= h > . return sum > ======== > > Andr? Your comments and Henrik's are cogent and valuable and provide definite improvements. Plus the discussion is conceptual i.e. we're dealing with nuts and bolts problems that the calculus deals with. So my general question is, as usual: wouldn't this be an interesting and intelligent way to teach math? You get concepts, and you get programming skills, and you start to think about analyzing and fine tuning algorithms. Plus you grow to appreciate the power of the calculus, which gives us close formed expressions so often -- a way to avoid fast for-loops entirely. Kirby From urnerk at qwest.net Tue Mar 29 21:11:06 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 21:11:18 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: Message-ID: <20050329191117.265321E400C@bag.python.org> > Kirby got the trapezoidal integration rule wrong. > This is the corrected version. > > def integrate(f,a,b,n=1000): > sum = 0 > h = (b-a)/float(n) > for i in range(1,n): > sum += f(a+i*h) > return h*(0.5*f(a)+sum+0.5*f(b)) > Here's the same thing using a generator expression (which is good for situations like this): def integrate2(f,a,b,n=1000): thesum = 0 h = (b-a)/float(n) thesum = sum(f(a+i*h) for i in range(1,n)) return (h/2)*(f(a) + f(b)) + thesum*h Kirby See: "Composite Trapezoidal Rule" http://math.fullerton.edu/mathews/n2003/TrapezoidalRuleMod.html From urnerk at qwest.net Tue Mar 29 22:02:13 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 22:02:16 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: Message-ID: <20050329200215.198711E400C@bag.python.org> > But you never use the trapezoidal rule in real life! > Simpson gives much smaller error for the same amount > of computation. In fact, it is exact for Kirby's example! > > Henrik Here's my implementation of Simpson's, except it divides the interval into 2n segments. >>> def simpson(f,a,b,n): h = float(b-a)/(2*n) sum1 = sum(f(a + 2*k *h) for k in range(1,n)) sum2 = sum(f(a + (2*k-1)*h) for k in range(1,n+1)) return (h/3)*(f(a)+f(b)) + (2*h/3)*sum1 + (4*h/3)*sum2 >>> def g(x): return x*x >>> simpson(g,0,3,10000) 8.9999999999999893 >>> simpson(g,0,3,5000) 8.9999999999999787 Kirby From urnerk at qwest.net Tue Mar 29 22:30:20 2005 From: urnerk at qwest.net (Kirby Urner) Date: Tue Mar 29 22:30:23 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <20050329200215.198711E400C@bag.python.org> Message-ID: <20050329203021.35F4F1E4017@bag.python.org> > Here's my implementation of Simpson's, except it divides the interval into > 2n segments. > > >>> def simpson(f,a,b,n): > h = float(b-a)/(2*n) > sum1 = sum(f(a + 2*k *h) for k in range(1,n)) > sum2 = sum(f(a + (2*k-1)*h) for k in range(1,n+1)) > return (h/3)*(f(a)+f(b)) + (2*h/3)*sum1 + (4*h/3)*sum2 > > >>> def g(x): return x*x > > >>> simpson(g,0,3,10000) > 8.9999999999999893 > >>> simpson(g,0,3,5000) > 8.9999999999999787 > > Kirby And with a decorator: def simpson(f): def defint(a,b,n=1000): h = float(b-a)/(2*n) sum1 = sum(f(a + 2*k *h) for k in range(1,n)) sum2 = sum(f(a + (2*k-1)*h) for k in range(1,n+1)) return (h/3)*(f(a)+f(b)) + (2*h/3)*sum1 + (4*h/3)*sum2 return defint @simpson def g(x): return x*x >>> g(0, 3) 9.0000000000000036 >>> g(0, 4) 21.333333333333329 >>> g(1, 7) 113.99999999999983 >>> g(1, 7, n=10000) 114.0 Kirby From ajsiegel at optonline.net Tue Mar 29 23:52:44 2005 From: ajsiegel at optonline.net (ajsiegel@optonline.net) Date: Tue Mar 29 23:52:46 2005 Subject: [Edu-sig] RE: Integration correction Message-ID: <337158338011.338011337158@optonline.net> From: Kirby Urner > @simpson > def g(x): return x*x > > >>> g(0, 3) > 9.0000000000000036 My resistance to decorators is not unrelated to the fact that I don't seem capable of getting my mind around them. I do find it quite disconcerting that the arguments "g" is expecting cannot be ascertained in the normal manner - that is by looking at "g" for the arguments it is expecting. Ouch, ouch, ouch. I think decorators are a little *too* cool - though do accept they have there real world uses. I am not sure why these are them. And certainly my issue is unrelated to the particular choice of syntax Guido made - which I happen to like, but probably for the wrong reasons. I *particularly* dislike decorators in the context of teaching/learning. Something that is relatively straight forward as executable pseudo-code becomes fancy/schmancy programming. I would probably introduce them first a step or two before metaclasses - in the Python for gurus class. Art From urnerk at qwest.net Wed Mar 30 01:19:51 2005 From: urnerk at qwest.net (Kirby Urner) Date: Wed Mar 30 01:19:53 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <337158338011.338011337158@optonline.net> Message-ID: <20050329231951.C87091E400C@bag.python.org> > From: Kirby Urner > > @simpson > > def g(x): return x*x > > > > >>> g(0, 3) > > 9.0000000000000036 > > My resistance to decorators is not unrelated to the fact that I don't seem > capable of getting my mind around them. > Hi Art -- Actually, I'm with you. The above use is maybe more an example of how *not* to use them. I mean, the function g has a perfect right to exist with its own name, but here gets rebound to another function with its own arguments. The original g is gone, unless we kept a copy. The syntax is equivalent too: g = simpson(g) nothing more. But then simpson, which consumes g, also spits back defint (i.e. is a factory for producing functions), which defint here gets rebound to g, committing g to oblivion. Again, I think you're probably right, that this particular example is perverse. Edu-sig is a scratch pad for bad ideas too. :-D The main reason Guido wanted them was to put something critical about a function at the very top, not after a page of code. But here, my g is a one liner. It makes more sense to just write: def g(x): return x*x intg = simpson(g) dg = derivative(g) That'd keep g around, and give us these new other functions to play with too (I *do* think that taking a function as an argument and spitting one back *is* "the right thing" to do in this context i.e. is mathematically on target -- but decorators?... no, probably not). Now, if g(x) really *did* go on for 30-40 lines, OK, then maybe a decorator adds to readability. Something to think about. Kirby From Scott.Daniels at Acm.Org Wed Mar 30 01:29:12 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Wed Mar 30 01:40:29 2005 Subject: [Edu-sig] Re: Integration correction In-Reply-To: <337158338011.338011337158@optonline.net> References: <337158338011.338011337158@optonline.net> Message-ID: ajsiegel@optonline.net wrote: > From: Kirby Urner >>@simpson >>def g(x): return x*x >>>>>g(0, 3) >>9.0000000000000036 > My resistance to decorators is not unrelated to the fact that I don't > seem capable of getting my mind around them. > > I do find it quite disconcerting that the arguments "g" is expecting > cannot be ascertained in the normal manner - that is by looking > at "g" for the arguments it is expecting. Ouch, ouch, ouch. There is a difference between generators and functional programming. This example is, I think a bit of a misuse of generators: you should be producing the "same" function somehow. So generators that keep a cache of answers to slow questions, generators to do logging, and such like make a lot of sense to me. I think the example above is better written as: def g(x): return x*x f = simpson(g) f(0, 3) It is an example of functional programming, and generators are always about functions of functions, but they are not always the right way to express it. Functional programming is often hard to wrap your head around. I am not sure generators add to the problem, but generators just cannot be used in anything but a functional way. > I *particularly* dislike decorators in the context of teaching/learning. > > Something that is relatively straight forward as executable pseudo-code > becomes fancy/schmancy programming. Well, one natural progression is values, expressions, variables, functions, then one of recursion, objects, or functions of (and returning) functions. I would think generators belong fairly soon after functions of functions. --Scott David Daniels Scott.Daniels@Acm.Org From gvanrossum at gmail.com Wed Mar 30 02:39:17 2005 From: gvanrossum at gmail.com (Guido van Rossum) Date: Wed Mar 30 02:39:21 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <20050329203021.35F4F1E4017@bag.python.org> References: <20050329200215.198711E400C@bag.python.org> <20050329203021.35F4F1E4017@bag.python.org> Message-ID: > And with a decorator: > > def simpson(f): > def defint(a,b,n=1000): > [...] > return defint > > @simpson > def g(x): return x*x > > >>> g(0, 3) > 9.0000000000000036 No matter how cool decorators are, I don't think this is a good example of how to use them. The function g(x) is a perfectly good function in its own right, and I don't think it ought to be tied as closely to the integration routine. Also, adding the nested-function boilerplate to the integration routine distracts from the numeric code. nd finally, it's somewhat confusing to see g() defined as a function taking (x) as its sole argument and then used as the integrator function taking (a, b) as arguments. The way this would be done before decorators is just plain better! -- --Guido van Rossum (home page: http://www.python.org/~guido/) From andre.roberge at gmail.com Wed Mar 30 03:31:09 2005 From: andre.roberge at gmail.com (=?ISO-8859-1?Q?Andr=E9_Roberge?=) Date: Wed Mar 30 03:31:46 2005 Subject: [Edu-sig] Re: Integration correction In-Reply-To: <20050329231951.C87091E400C@bag.python.org> References: <337158338011.338011337158@optonline.net> <20050329231951.C87091E400C@bag.python.org> Message-ID: Kirby Urner wrote: >>From: Kirby Urner >[snip ... Kirby, Art and many others including myself discuss > the possible misuse of decorators in the context of calculating > derivatives and integrals numerically .... end snip] > > Now, if g(x) really *did* go on for 30-40 lines, OK, then maybe a decorator > adds to readability. > > Something to think about. > > Kirby Well, I don't think that decorators would add to readability once you've defined your functions. I've played around with using decorators (and not) for a while, and here's what I would like to submit to this list as a possible "summary". This non-decorator approach is very clean imho. def derivative(f): """ Computes the numerical derivative of a function. Intended to be used as a decorator. """ def df(x, h=0.1e-5): return ( f(x+h/2) - f(x-h/2) )/h return df def simpson_integral(f, a, b, n=1000): """ Computes the numerical integral of a function using the extended Simpson's rule. This gives exact results for polynomials of O(3). """ h = float(b-a)/n sum1 = sum(f(a+k*h) for k in range(1, n, 2)) sum2 = sum(f(a+k*h) for k in range(2, n, 2)) return (h/3)*( f(a)+f(b) + 4*sum1 + 2*sum2 ) # test functions def g2(x): return x*x def g3(x): return x*x*x # first derivatives dg2 = derivative(g2) dg3 = derivative(g3) # second derivatives d2g2 = derivative(derivative(g2)) d2g3 = derivative(derivative(g3)) # integrals intg2 = simpson_integral(g2, 0, 1) intg3 = simpson_integral(g3, 0, 1) print ' functions: ', g2(2.), g3(2.) print ' first derivatives: ', dg2(2.), dg3(2.) print 'second derivatives: ', d2g2(2.), d2g3(2.) print 'numerical integral: ', intg2, intg3 # functions: 4.0 8.0 # first derivatives: 4.00000000012 12.0000000008 #second derivatives: 2.00017780116 12.001066807 #numerical integral: 0.333333333333 0.25 #== WARNING == #-- derivatives computed numerically do not #-- necessarily converge for small h -- h = .1 for i in range(1, 7): h /= 100 print h, 'first = ', dg2(2, h), 'second =', dg3(2, h) #0.001 first = 4.0 second = 12.00000025 #1e-005 first = 3.99999999989 second = 11.9999999997 #1e-007 first = 4.00000000234 second = 12.0000000159 #1e-009 first = 4.00000033096 second = 12.0000009929 #1e-011 first = 4.00000033096 second = 12.0000009929 #1e-013 first = 4.00568467285 second = 12.0170540185 ##################### Andr? From andre.roberge at gmail.com Wed Mar 30 03:44:35 2005 From: andre.roberge at gmail.com (=?ISO-8859-1?Q?Andr=E9_Roberge?=) Date: Wed Mar 30 03:45:30 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: <20050329185459.7DE521E400C@bag.python.org> References: <7528bcdd050329090428603d87@mail.gmail.com> <20050329185459.7DE521E400C@bag.python.org> Message-ID: Kirby Urner wrote: [snip - deleted stuff about numerical integration] > > So my general question is, as usual: wouldn't this be an interesting and > intelligent way to teach math? You get concepts, and you get programming > skills, and you start to think about analyzing and fine tuning algorithms. > Plus you grow to appreciate the power of the calculus, which gives us close > formed expressions so often -- a way to avoid fast for-loops entirely. > > Kirby I think it would be ... were it not for the following "facts": 1) subjects are taught in a compartimentalised way, leading to easy testing/grading ... you don't teach introductory numerical analysis at the same time as you teach introductory computer programming at the same time as you teach introductory calculus at the same time as .... (exception: many learn most of the useful math stuff in their physics class first, at least in North America.) 2) A mathematical limit is not the same as a small but finite numerical precision. Mathematicians would probably cringe at the thought of teaching about using these two side-by-side in the same course. Of course, if one has the freedom to be able to cover many "unrelated" topics to the same group of students, one can get away with it. However, I don't know of many places in North American Universities when you can do such a thing (One exception might be the University of British Columbia where they introduced a general 1st year science course covering biology/math/physics/chemistry.) However, I wish one could try it. (In fact, I'd love to be given that opportunity one day!). Andr? From Scott.Daniels at Acm.Org Wed Mar 30 04:39:01 2005 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Wed Mar 30 04:39:11 2005 Subject: [Edu-sig] Re: Integration correction In-Reply-To: <20050329231951.C87091E400C@bag.python.org> References: <337158338011.338011337158@optonline.net> <20050329231951.C87091E400C@bag.python.org> Message-ID: Kirby Urner wrote: > Again, I think you're probably right, that this particular example is > perverse. Edu-sig is a scratch pad for bad ideas too. :-D Sorry, Kirby, I see we all seemed to jump on top of you here. --Scott David Daniels Scott.Daniels@Acm.Org From ajsiegel at optonline.net Wed Mar 30 14:15:58 2005 From: ajsiegel at optonline.net (Arthur) Date: Wed Mar 30 14:16:04 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <0IE40068QZH2ZC@mta11.srv.hcvlny.cv.net> Message-ID: <0IE500D8IZEMFG@mta2.srv.hcvlny.cv.net> > From: Kirby Urner [mailto:urnerk@qwest.net] > Now, if g(x) really *did* go on for 30-40 lines, OK, then maybe a > decorator > adds to readability. > > Something to think about. From http://www.corante.com/many/archives/2005/03/09/one_world_two_maps_thoughts_ on_the_wikipedia_debate.php """ When thinking about technological change, there are two kinds of people, or rather, people with two kinds of maps of the world - radial, and Cartesian. """ My map is radial: """ Radial people want to know, of any change, how big a change is it from current practice, in what direction, and at what cost. """ I think the introduction of decorators appeal more to the Cartesians: """ Cartesian people want to know, for any change, where you end up, and what the characteristics of the new landscape are. They are less interested in the cost of getting there. """ Guido's recent weblog presents a multimethod decorator. I am fully capable to using it, and fully incapable of understanding exactly how it works. My fear is the evolution of libraries of little black boxes which will indeed change the landscape of Python dramatically - for better and for worse. What I can't and don't understand - as a 'radial" - was why those who purport to most appreciate Python as it is would sign in mass unto an endeavor which could foreseeable alter what it is and how it is used in dramatic ways, and do so irretrievably. Ah well.. Art From chandrakirti at gmail.com Wed Mar 30 14:24:41 2005 From: chandrakirti at gmail.com (Lloyd Hugh Allen) Date: Wed Mar 30 14:24:45 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <24d253d905033004246b5cc311@mail.gmail.com> References: <0IE40068QZH2ZC@mta11.srv.hcvlny.cv.net> <0IE500D8IZEMFG@mta2.srv.hcvlny.cv.net> <24d253d905033004246b5cc311@mail.gmail.com> Message-ID: <24d253d90503300424269c29aa@mail.gmail.com> Oops. meant to reply to all. Sorry. On Wed, 30 Mar 2005 07:24:16 -0500, Lloyd Hugh Allen wrote: > I thought that there already were little black box libraries all over > the place. Just that most of them were in C etc. > > > On Wed, 30 Mar 2005 07:15:58 -0500, Arthur wrote: > > > > My fear is the evolution of libraries of little black boxes which will > > indeed change the landscape of Python dramatically - for better and for > > worse. > > > > What I can't and don't understand - as a 'radial" - was why those who > > purport to most appreciate Python as it is would sign in mass unto an > > endeavor which could foreseeable alter what it is and how it is used in > > dramatic ways, and do so irretrievably. > > > > Ah well.. > > > > Art > > > > > > _______________________________________________ > > Edu-sig mailing list > > Edu-sig@python.org > > http://mail.python.org/mailman/listinfo/edu-sig > > > From ajsiegel at optonline.net Wed Mar 30 14:33:58 2005 From: ajsiegel at optonline.net (Arthur) Date: Wed Mar 30 14:34:03 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <24d253d905033004246b5cc311@mail.gmail.com> Message-ID: <0IE600BEB08N08@mta4.srv.hcvlny.cv.net> > -----Original Message----- > From: Lloyd Hugh Allen [mailto:chandrakirti@gmail.com] > To: Arthur > Subject: Re: RE: [Edu-sig] RE: Integration correction > > I thought that there already were little black box libraries all over > the place. Just that most of them were in C etc. Yes, but... There was a bottom. The bottom has dropped out. Is the best I can express it. Art From henrik at nada.kth.se Wed Mar 30 14:47:28 2005 From: henrik at nada.kth.se (Henrik Eriksson) Date: Wed Mar 30 14:47:31 2005 Subject: [edu-sig] Simpson exact In-Reply-To: <200503292002.j2TK2Ejk013560@mx3.nada.kth.se> References: <200503292002.j2TK2Ejk013560@mx3.nada.kth.se> Message-ID: Kirby, you are working too hard! > >>> simpson(g,0,3,10000) > 8.9999999999999893 Why ten thousand intervals when one interval gives the exact result? >>> simpson(g,0,3,1) 9.0 Henrik From ajsiegel at optonline.net Wed Mar 30 14:59:45 2005 From: ajsiegel at optonline.net (Arthur) Date: Wed Mar 30 14:59:49 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <0IE600BEB08N08@mta4.srv.hcvlny.cv.net> Message-ID: <0IE600CV91EZB1@mta8.srv.hcvlny.cv.net> > From: Arthur [mailto:ajsiegel@optonline.net] > > From: Lloyd Hugh Allen [mailto:chandrakirti@gmail.com] > > To: Arthur > > Subject: Re: RE: [Edu-sig] RE: Integration correction > > > > I thought that there already were little black box libraries all over > > the place. Just that most of them were in C etc. > > Yes, but... > > There was a bottom. The bottom has dropped out. > > Is the best I can express it. And I did say for *better* and for worse, and do recognize this is largely an issue of sensibility, in respect to change. And there are competing interests in the community, not all of which can be consistently and equally satisfied. Probably decorators will in the end give Python more industrial strength. It happens that was never my interest in Python. So I consider myself a loser here. But I see no reason not to try to be a good enough sport about it. And - believe it or not - this is about the best I can do. Art From david at handysoftware.com Wed Mar 30 16:11:18 2005 From: david at handysoftware.com (David Handy) Date: Wed Mar 30 16:10:42 2005 Subject: [Edu-sig] RE: Integration correction Message-ID: <20050330141118.GA2400@arno2> On Wed, Mar 30, 2005 at 07:15:58AM -0500, Arthur wrote: > What I can't and don't understand - as a 'radial" - was why those who > purport to most appreciate Python as it is would sign in mass unto an > endeavor which could foreseeable alter what it is and how it is used in > dramatic ways, and do so irretrievably. I'll try and answer that one. When I learned Python version 1.5.2 back in March of 1999, six years ago, I already had a lot of experience programming in C, C++, Pascal, Perl, etc. Learning Python made me a better programmer. Object-oriented programming concepts that were obscure in C++ became so much clearer in Python, with it's "everything is an object" and "first-class functions and classes." I took that philosophy and began writing better C++ code. But it didn't stop there. After I thoroughly learned Python 1.5.2, it evolved. It got generators and iterators, and I learned those too. By this time I was programming C# and Java. The new things I learned from Python 2.2+ made me a better C# and Java programmer. In 2004 I started using list comprehensions and generator expressions and the more accessible features of new-style classes, including properties and cooperative superclasses. All of these things made my life better. In 2005 (so far) I've now understood descriptors and how they can help me. Metaclasses are next on my list. And with every mind-expanding step I've become a better Java programmer. Even though Java doesn't have Python's features, those "patterns", when learned first in Python, really help. I feel like I'm water skiing, and Python is an intellectual power-boat towing me along. Perhaps you're saying "the boat's going too fast, I want to get off". Well, you may have that luxury, but I don't. I make my *living* doing this stuff. My wife and four hungry children depend on me keeping up with the world-class state of the art. If I were to decide that I've had enough, my brain is full, then I might as well find another line of work. Certainly I have an interest in Python code remaining accessible to entry-level programmers. I am not an elitist. But advanced Python features have made advanced programming accessible to *me*, when otherwise I might not have gotten into it, due to lack of time and perceived barriers to entry. I believe Python offers a lot to programmers at every level. The good old Python 1.5.2 feature set is still great for beginners, and that's the feature set I teach to beginners. But there is no limit to how far you can go in Python. If I taught beginners using, say, Visual Basic, I'm putting a ceiling over their heads. Python scales conceptually. And that's my 2 cents. David H. From chandrakirti at gmail.com Wed Mar 30 16:27:22 2005 From: chandrakirti at gmail.com (Lloyd Hugh Allen) Date: Wed Mar 30 16:27:26 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <20050330141118.GA2400@arno2> References: <20050330141118.GA2400@arno2> Message-ID: <24d253d905033006279e43cdd@mail.gmail.com> If I can toss in one (okay, two) more thought/s (and then I'll go back to llurking again), I particularly remember a java exercise in which the instructor gave us a handful of (intentionally!) black-box functions along with the arguments that they take and the outputs that they gave. We were to string these functions together into a working pong program. We were able to do this (in java! after two weeks!--could do it in Python on the second day then) fairly successfully, and so we were happy because we made a working program without knowing much. In the same way, I often use the random library, but haven't even vaguely considered looking at its inner mechanics (although my students claim, when I use a short routine to pick who goes to the board, that they feel that it favors particular spots in the list of students...I think that that's just their paranoia speaking, but I probably should examine the code at some point anyway). For me to understand each library...for that matter, have you ever made the mistake of hitting "step" from the IDLE debugger on a print line? There's already hella stuff under the hood. Finally, I'll invoke the mantra (again from math education) that all math (/coding) is either trivial or impossible. Problems (or ideas or structures) begin as impossible; then, once comprehension is attained, they are trivial. If it makes you feel better, Art, I blinked and so don't know what this decorator thing is of which you speak (maybe it was in one of those annoyingly long threads that I archived without reading). Don't worry--I'll look up decorators myself--but that you know what a decorator is puts you on a higher level of comprehension than at least one person. But again, the beauty of oop is that you don't need to look under the hood until you actually want to. But that the ability is (theoretically) there once you do have the desire. I fear that I may be contributing to one of those annoyingly long threads that I archive without reading. Oops. Sorry. /out On Wed, 30 Mar 2005 09:11:18 -0500, David Handy wrote: > On Wed, Mar 30, 2005 at 07:15:58AM -0500, Arthur wrote: > > What I can't and don't understand - as a 'radial" - was why those who > > purport to most appreciate Python as it is would sign in mass unto an > > endeavor which could foreseeable alter what it is and how it is used in > > dramatic ways, and do so irretrievably. > > I'll try and answer that one. > > When I learned Python version 1.5.2 back in March of 1999, six years ago, I > already had a lot of experience programming in C, C++, Pascal, Perl, etc. > > Learning Python made me a better programmer. Object-oriented programming > concepts that were obscure in C++ became so much clearer in Python, with > it's "everything is an object" and "first-class functions and classes." I > took that philosophy and began writing better C++ code. > > But it didn't stop there. After I thoroughly learned Python 1.5.2, it > evolved. It got generators and iterators, and I learned those too. By this > time I was programming C# and Java. The new things I learned from Python > 2.2+ made me a better C# and Java programmer. > > In 2004 I started using list comprehensions and generator expressions and > the more accessible features of new-style classes, including properties and > cooperative superclasses. All of these things made my life better. > > In 2005 (so far) I've now understood descriptors and how they can help me. > Metaclasses are next on my list. And with every mind-expanding step I've > become a better Java programmer. Even though Java doesn't have Python's > features, those "patterns", when learned first in Python, really help. > > I feel like I'm water skiing, and Python is an intellectual power-boat > towing me along. > > Perhaps you're saying "the boat's going too fast, I want to get off". Well, > you may have that luxury, but I don't. I make my *living* doing this stuff. > My wife and four hungry children depend on me keeping up with the > world-class state of the art. If I were to decide that I've had enough, my > brain is full, then I might as well find another line of work. > > Certainly I have an interest in Python code remaining accessible to > entry-level programmers. I am not an elitist. But advanced Python features > have made advanced programming accessible to *me*, when otherwise I might > not have gotten into it, due to lack of time and perceived barriers to > entry. > > I believe Python offers a lot to programmers at every level. The good old > Python 1.5.2 feature set is still great for beginners, and that's the > feature set I teach to beginners. But there is no limit to how far you can > go in Python. If I taught beginners using, say, Visual Basic, I'm putting a > ceiling over their heads. Python scales conceptually. > > And that's my 2 cents. > David H. > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > From ajsiegel at optonline.net Wed Mar 30 21:12:58 2005 From: ajsiegel at optonline.net (Arthur) Date: Wed Mar 30 21:13:04 2005 Subject: [Edu-sig] RE: Integration correction In-Reply-To: <20050330135606.GA2341@arno2> Message-ID: <0IE600GJSIP19U@mta8.srv.hcvlny.cv.net> > -----Original Message----- > From: David Handy [mailto:david@handysoftware.com] > > I'll try and answer that one. I won't repeat your post, since it is long - but will say that I understand its sentiments and largely agree with them. Those of us clever enough to have gotten on the bandwagon from 1.5.2 or before have been treated to an exciting and stimulating ride. And I am grateful for it, and do try to express that from time to time. Whether anyone joining the party at 2.4 will be enjoying a similar kind of ride remains to be seen. And the extent to which the price of admission has gone up some since 1.5.2 is - I guess - another matter of conjecture/opinion. Will the mechanics of decorators seem at some point trivial to me. I suspect so. Will I be better off having gotten there than I would if I never had needed to jump the hurdle. No question. But - on the other side - among the frustrations/concerns is the fact that I may feel I really have little guidance to contribute to anyone starting out in Python2.4. It being a very different place to start from then the place where I had started. The fact, for example, that old style classes co-exist with new is just one of many mysteries that confront the initiate at this point. Its like talking about "dialing" a telephone number. I have to wonder what someone my son's age must think about why such a silly phrase might have taken hold. Art From urnerk at qwest.net Thu Mar 31 16:53:53 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 31 16:53:56 2005 Subject: [Edu-sig] Re: Integration correction In-Reply-To: Message-ID: <20050331145355.577961E400D@bag.python.org> > Kirby Urner wrote: > > Again, I think you're probably right, that this particular example is > > perverse. Edu-sig is a scratch pad for bad ideas too. :-D > > Sorry, Kirby, I see we all seemed to jump on top of you here. > > --Scott David Daniels > Scott.Daniels@Acm.Org S'ok. >From my point of view, everyone quickly came to the same conclusion I did when replying to Art. Decorators suck in this instance. Kirby From urnerk at qwest.net Thu Mar 31 20:59:34 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 31 20:59:37 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: Message-ID: <20050331185936.A03061E400E@bag.python.org> > > So my general question is, as usual: wouldn't this be an interesting > > and intelligent way to teach math? <> > I think it would be ... were it not for the following "facts": > > 1) subjects are taught in a compartimentalised way, leading to easy > testing/grading ... > > you don't teach introductory numerical analysis > at the same time as > you teach introductory computer programming > at the same time as > you teach introductory calculus > at the same time as .... > > (exception: many learn most of the useful math stuff in their physics > class first, at least in North America.) Yes, there'd need to be some rewiring, resequencing, that much is clear. In my experience, a lot of people are attracted to programming and would welcome more exposure from a young age. A high school track might mix programming with discrete math topics plus mix in stuff currently considered more college level (some group and number theory), in an introductory way. This would be an alternative to the standard pre-calc/calc track, which dominates and currently leaves little room for serious alternatives. In the old days, a king would hire some Merlin character, a tutor, who presumably had a custom curriculum for his ward. Nowadays, with everything done factory style, we have fewer opportunities to experiment with alternatives -- but it's still feasible. > 2) A mathematical limit is not the same as a small but finite numerical > precision. Mathematicians would probably cringe at the thought of > teaching about using these two side-by-side in the same course. > They shouldn't cringe. The finite numerical precision methods use a sigma, whereas at the limit we get the swoopy Riemann sum notation. The difference is encoded in the notation. Mathematicians have nothing to fear. Having them together helps advertise the power of calculus -- at the limit we often get this closed form other function, amenable to direct evaluation, no for-loop need apply. > Of course, if one has the freedom to be able to cover many "unrelated" > topics to the same group of students, one can get away with it. That's the trick. How might we make this more feasible? Too much lock step, too much enforcement of curriculum designs inherited from a pre-computer age. > However, I don't know of many places in North American Universities when > you can do such a thing (One exception might be the University of > British Columbia where they introduced a general 1st year science course > covering biology/math/physics/chemistry.) > > However, I wish one could try it. (In fact, I'd love to be given that > opportunity one day!). > > Andr? I hope you get it. I have something like this going with high school aged students. I mix Python and math topics however I like, for a few Saturdays. They don't get academic credit, but it looks good on college applications, plus they even learn stuff. Kirby From urnerk at qwest.net Thu Mar 31 23:02:16 2005 From: urnerk at qwest.net (Kirby Urner) Date: Thu Mar 31 23:02:20 2005 Subject: [Edu-sig] Re: More on intro to Python (today's 3 hr training) In-Reply-To: Message-ID: <20050331210219.446261E400E@bag.python.org> I see your recipe made the Daily Python-URL today: http://www.pythonware.com/daily/ I'm including your revisions in hypertoons24.py http://www.4dsolutions.net/ocn/python/hypertoons/ Kirby > Kirby Urner wrote: > > Speaking of hypertoons, Scott sent me a cool refactoring of said module > > using decorators. I just got it this AM and haven't gotten around to > > actually studying the revisions, but I plan to. > > I was actually so pleased with the way it went that I filed a cookbook > recipe at: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393010 > > --Scott David Daniels > Scott.Daniels@Acm.Org