From rnd@onego.ru Sat Sep 1 07:24:46 2001 From: rnd@onego.ru (Roman Suzi) Date: Sat, 1 Sep 2001 10:24:46 +0400 (MSD) Subject: [Edu-sig] would you use PythonCard? In-Reply-To: <22510929678770@mailth4.freenet.co.uk> Message-ID: On Fri, 31 Aug 2001 agauld@crosswinds.net wrote: >On 30 Aug 01, at 11:45, Kevin Altis wrote: >> > GUI builder. Yawn. >> PythonCard is more than a GUI builder, but even so, why would you 'Yawn'? > >Coz there are lots of GUI builders already? >This is true - power has its own penalties. >Same is true of vim and emacs as editors. >Maybe PythonCard has the better approach for occasional users. Well, Alan, have you ever used HyperCard? PythonCard is not just "yet another GUI builder", it is environment. It is higher level than Tkinter, etc. Your opinion on "GUI builders" is probably due to the fact that most of them are lame. While we want PythonCard to be of higher value. And TRULY plus productivity, not minus. And "occasional users" are those who come to Python from successful encounter with superb GUI builder. So, please, do not underestimate PythonCard potential! Sincerely yours, Roman Suzi -- _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Saturday, September 01, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "Brain: The apparatus with which we think that we think." _/ From agauld@crosswinds.net Sat Sep 1 23:36:56 2001 From: agauld@crosswinds.net (agauld@crosswinds.net) Date: Sat, 1 Sep 2001 23:36:56 +0100 Subject: [Edu-sig] would you use PythonCard? In-Reply-To: References: <22510929678770@mailth4.freenet.co.uk> Message-ID: <22442740624610@mailth4.freenet.co.uk> On 1 Sep 01, at 10:24, Roman Suzi wrote: > >Maybe PythonCard has the better approach for occasional users. > Well, Alan, have you ever used HyperCard? I confess never to have used it "hands on". BUt I have project managed a Mac project where Hypercard was used and it was great for getting somehthing out quickly. But within 3 releases all the Hypercard stuff had been rewritten... But then 2 releases later the Mac version itself had stopped being produced but that doesn't mean Macs are bad! :-) Most of my comments are based on general experiences with so called "higher level" GUI toolkits and a read thru' the stuff about PythonCard. They provide a powerful startup tool for straightforward apps but often run out of steam when we push the boundaries. But then there are a lot of straighforward apps out there. I wasn't meaning to be disparaging about either Hypercard or PythonCard, they are worthy products/ideals but I was simply expressing why a previous poster may have felt "yawn" at the thought of another GUI builder/environment. Also I guess pointing out that GUI RAD doesn't need to be visual. Python(and Tcl/Tk) has a very different approach to incremental GUI development. (IMHO Python is superior to Tcl in this respect but I'm sure Tcl fans would disagree). Native Python feels more like early Smalltalk than Hypercard to me, both are productive environments. > Your opinion on "GUI builders" is probably due to the fact that most of > them are lame. Thats possibly true! > And "occasional users" are those who come to Python from > successful encounter with superb GUI builder. I'm not sure what you mean by that. I think there are a lot of occasional users coming at Python from lots of directions - education, Sys admin, Web development and yes maybe GUI work too. > So, please, do not underestimate PythonCard potential! I'll keep an open mind, and probably even have a play with it - I usually do when these things come up. Alan G From rnd@onego.ru Sun Sep 2 09:02:46 2001 From: rnd@onego.ru (Roman Suzi) Date: Sun, 2 Sep 2001 12:02:46 +0400 (MSD) Subject: [Edu-sig] would you use PythonCard? In-Reply-To: <22442740624610@mailth4.freenet.co.uk> Message-ID: On Sat, 1 Sep 2001 agauld@crosswinds.net wrote: >On 1 Sep 01, at 10:24, Roman Suzi wrote: >> >Maybe PythonCard has the better approach for occasional users. >> Well, Alan, have you ever used HyperCard? > >I confess never to have used it "hands on". >BUt I have project managed a Mac project where Hypercard >was used and it was great for getting somehthing out >quickly. But within 3 releases all the Hypercard stuff >had been rewritten... But then 2 releases later the Mac >version itself had stopped being produced but that doesn't >mean Macs are bad! :-) PythonCard is not a clone of HyperCard. As I understand it, it will allow to draw what is drawable (visual GUI parts) and everything else will be in Python scripts. This allows people who do not like GUIs to easily wrap logic into visual shell, making things "easier" for those who is accustomed to GUI. And I see educational uses are best fit for PythonCard. Pure Tkinter is NOT up to the task, because in this case people simply choose different environment. PythonCard is planned to provide simple GUI environment for those who greet things by clothers first. >Most of my comments are based on general experiences >with so called "higher level" GUI toolkits and a read thru' >the stuff about PythonCard. They provide a powerful >startup tool for straightforward apps but often run out of >steam when we push the boundaries. > >But then there are a lot of straighforward apps out there. > >I wasn't meaning to be disparaging about either Hypercard or >PythonCard, they are worthy products/ideals but I was simply >expressing why a previous poster may have felt "yawn" at the >thought of another GUI builder/environment. > >Also I guess pointing out that GUI RAD doesn't need to be >visual. Python(and Tcl/Tk) has a very different approach to >incremental GUI development. It is verbal approach. For me personally it is easier to write apps by language. But for those who learn it presents a great barrier. >(IMHO Python is superior to Tcl in >this respect but I'm sure Tcl fans would disagree). Native Python >feels more like early Smalltalk than Hypercard to me, both are >productive environments. He-he! Hypertalk is also very much like Smalltalk, IMHO. (I also think, that "talk" is there for that reason) >> Your opinion on "GUI builders" is probably due to the fact that most of >> them are lame. > >Thats possibly true! And if we anderstand WHY exactly they are lame, we will see that they have wrong border between drawable and scriptable tasks + stupid object model. >> And "occasional users" are those who come to Python from >> successful encounter with superb GUI builder. > >I'm not sure what you mean by that. I think there are a lot of >occasional users coming at Python from lots of directions - >education, Sys admin, Web development and yes maybe >GUI work too. OK. Right now I can't show nice higher level GUI builder for Python. That means that Python is out of reach for those educational users who need to perform concrete tasks fast. THis is not good. >> So, please, do not underestimate PythonCard potential! > >I'll keep an open mind, and probably even have a play with >it - I usually do when these things come up. PythonCard is in prototype stage. It is planned to rewrite it completely at some future moment. >Alan G Sincerely yours, Roman Suzi -- _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Sunday, September 02, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "Windows: XT emulator for an AT." _/ From pdx4d@teleport.com Sun Sep 2 21:44:45 2001 From: pdx4d@teleport.com (Kirby Urner) Date: Sun, 02 Sep 2001 13:44:45 -0700 Subject: [Edu-sig] would you use PythonCard? In-Reply-To: References: <22442740624610@mailth4.freenet.co.uk> Message-ID: <4.2.0.58.20010902133327.00bce710@pop3.norton.antivirus> > >OK. Right now I can't show nice higher level GUI builder >for Python. That means that Python is out of reach for those educational >users who need to perform concrete tasks fast. >THis is not good. "Concrete tasks" is not the same thing as being able to build a GUI. As Alan pointed out earlier, the IDLE shell is itself a GUI, and within in you can import whatever modules, write your own, and get a lot done interactively. When it comes to educational uses for Python, I can easily envision courses which involve no Tk or Pmw/Tk or wxPython at all, or any other graphical widgets kits. Also, for very simple interfaces, it's possible to just do HTML forms and wire 'em to Python via cgi. So if the goal is to give users shared access to lookup tables or something, the solution is often to just use their browsers, which they're familiar with anyway. You can even have Python generate the forms on the fly, if you need the interface to adjust based on previous inputs (using XML to drive interfaces is starting to be a pretty standard technology, especially in the world of hand-helds). I'm not saying GUIs aren't useful -- of course they are. I just don't think introductory programming or the kind of math-through-programming I do necessitates diving into GUI stuff right away. Your saying "concrete tasks" aren't doable without widgets seems too broad. *Some* concrete tasks. But I resist the tendency to equate programming with GUI development. One of the books I use is "Concrete Mathematics" and I can do a lot of the stuff in that book with no GUI beyond IDLE itself. Even graphics can be done without writing a GUI interface, e.g. the VPython kit pops up real time graphical content in a Tk window, in a modified IDLE. Or for non-real-time graphics (e.g. geometry stuff), you can output a text file and render it in Povray. I do this all the time with no overhead invested in a Tk-style interface (beyond IDLE). Kirby From rnd@onego.ru Mon Sep 3 19:04:08 2001 From: rnd@onego.ru (Roman Suzi) Date: Mon, 3 Sep 2001 22:04:08 +0400 (MSD) Subject: [Edu-sig] would you use PythonCard? In-Reply-To: <4.2.0.58.20010902133327.00bce710@pop3.norton.antivirus> Message-ID: On Sun, 2 Sep 2001, Kirby Urner wrote: >>OK. Right now I can't show nice higher level GUI builder >>for Python. That means that Python is out of reach for those educational >>users who need to perform concrete tasks fast. >>THis is not good. >Your saying "concrete tasks" aren't doable without widgets >seems too broad. *Some* concrete tasks. But I resist the >tendency to equate programming with GUI development. By concrete tasks I had in mind creating programs for methodological support in different subjects by making multimedia-like things easily. Things, which teachers always have their own opinion about. I met many teachers, which were dissatisfied with whatever they saw "ready-maid" and wanted their own CAE courseware... I agree that browsers probably solve more than half of the problem, but more could be easier done with means of traditional applications. >One of the books I use is "Concrete Mathematics" and I >can do a lot of the stuff in that book with no GUI >beyond IDLE itself. Even graphics can be done without >writing a GUI interface, e.g. the VPython kit pops up >real time graphical content in a Tk window, in a modified >IDLE. Or for non-real-time graphics (e.g. geometry stuff), >you can output a text file and render it in Povray. >I do this all the time with no overhead invested in a >Tk-style interface (beyond IDLE). There is usually no problem with programming teachers: they could find suitable tools. The problem is with those who can write, draw and link parts together with GUI, but which programming capability is nearly zero. And this is what PythonCard + Python are going to change. Sincerely yours, Roman Suzi -- _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Monday, September 03, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "...I'm sorry, Reality is not in service at this time." _/ From altis@semi-retired.com Tue Sep 4 05:25:14 2001 From: altis@semi-retired.com (Kevin Altis) Date: Mon, 3 Sep 2001 21:25:14 -0700 Subject: [Edu-sig] choice is good Message-ID: Re the potential flame war over PythonCard and alternative methods of building apps I just want to say that having choices is good. It is not possible to provide a framework or environment that will meet the needs of everyone. I think that it will be just as easy to build GUI apps on the fly in the shell with PythonCard as tk, probably easier, but we aren't quite there yet, nor do I see that as our main focus. I also don't see PythonCard replacing the need for a more general and complete GUI library/framework such as wxPython/wxWindows or Jython with the JFC... Those are more capable for certain types of apps, but much harder to get started with, maintain, etc. but if you need that power, then go for it. It is also too early in the development cycle to completely evaluate PythonCard, we are only on the PythonCardPrototype. Even when we're "done" it won't replace everything else out there in Pythonland for building apps and it isn't intended to, it will simply provide another tool that users and Python programmers will have to leverage Python. At a minimum, it will provide a lot of good ideas, most of them demonstrated in software ten or twenty years ago (or longer), but apparently forgotten by many programmers. For example, separating presention (our .rsrc.py files) from the main source code to simplify doing layouts for different platforms and languages and even allowing a designer to handle layout and a programmer to handle coding. That being said, the "competition" between different solutions for Python acts as an incentive to make PythonCard better. The opinions about what works "best" has to just be written off as opinion and each user has to decide for themselves, hopefully based on trying competing solutions. We'll be trying to present a better face than our competition through samples, documenation, web site, and "marketing" of sorts because we want people to at least try what we think is a great solution. Ultimately, though, PythonCard will just be another solution to choose from. ka --- Kevin Altis altis@semi-retired.com From rnd@onego.ru Tue Sep 4 10:50:12 2001 From: rnd@onego.ru (Roman Suzi) Date: Tue, 4 Sep 2001 13:50:12 +0400 (MSD) Subject: [Edu-sig] choice is good In-Reply-To: Message-ID: On Mon, 3 Sep 2001, Kevin Altis wrote: >Re the potential flame war over PythonCard and alternative methods of >building apps I just want to say that having choices is good. It is not >possible to provide a framework or environment that will meet the needs of Well, we are not at war ;-) I just was curious what makes GUI builder-like apps great or poor. And a dispute is the best way to look at it. Sincerely yours, Roman Suzi -- _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Tuesday, September 04, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "Useless Invention: Fine glass-crystal castanets." _/ From Jason Cunliffe" Hello A lot of interest in simplicity and direct communications these days.. So I thought I would pay a visit to Rebol... http://www.rebol.com/ A lot of great progress this year = fast cheap and out of control -> wonderfull stuff Be sure to download the free Rebol/View from the Products page: http://www.rebol.com/products.html enjoy -Jason From urnerk@qwest.net Wed Sep 5 02:58:21 2001 From: urnerk@qwest.net (Kirby Urner) Date: Tue, 04 Sep 2001 18:58:21 -0700 Subject: [Edu-sig] choice is good In-Reply-To: Message-ID: <4.2.0.58.20010904185522.00c37100@pop3.norton.antivirus> At 09:25 PM 9/3/2001 -0700, you wrote: >Re the potential flame war over PythonCard and alternative >methods of building apps I just want to say that having >choices is good. Yes, choice is good. I didn't sense any incipient flame war though. Feedback was sought and some was offered. PythonCard may well have a bright future, either in its present form or as part of a larger suite, or... in any case, I welcome it and salute those pushing ahead. PyCrust is another alpha/beta I've been meaning to try. I just haven't had sufficient time. So much to learn (which I like -- learning is a fun activity). Kirby From wilson@visi.com Fri Sep 7 02:25:51 2001 From: wilson@visi.com (Timothy Wilson) Date: Thu, 6 Sep 2001 20:25:51 -0500 (CDT) Subject: [Edu-sig] assigning homework Message-ID: Hi everyone, Here's a question from a wet-behind-the-ears programming teacher. (The backs of my ears have been dry for a long time in my physics and chemistry classroom.) I've had a couple days with my Introduction to Computer Programming students and they seem to be a generally motivated bunch. It's going to be fun. I'd like to get some ideas and opinions about homework assignments and projects. It is obviously difficult to prevent students from looking at one another's code when working on projects. My inclination is to assume that they will and try to structure my programming assignments so that group work is encouraged instead of forbidden. I prefer a cooperative arrangement anyway. Any pearls of wisdom from the experienced programming teachers out there? What's best practice in this area? I'd like to avoid making some obvious mistakes because of my inexperience in this particular subject. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From wilson@visi.com Fri Sep 7 02:45:03 2001 From: wilson@visi.com (Timothy Wilson) Date: Thu, 6 Sep 2001 20:45:03 -0500 (CDT) Subject: [Edu-sig] Diving into Python Message-ID: Hi all, Did everyone see this announcement of the latest chapter of "Diving Into Python"? This is the first I've heard of the project. (http://www.diveintopython.org/) Does anyone know Mark Pilgrim (the author)? Mark, are you on the edu-sig list? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From jhrsn@pitt.edu Fri Sep 7 19:45:36 2001 From: jhrsn@pitt.edu (Jim Harrison) Date: Fri, 07 Sep 2001 14:45:36 -0400 Subject: [Edu-sig] assigning homework In-Reply-To: Message-ID: on 9/6/01 9:25 PM, Timothy Wilson at wilson@visi.com wrote: > I'd like to get some ideas and opinions about homework assignments and > projects. It is obviously difficult to prevent students from looking at one > another's code when working on projects. My inclination is to assume that > they will and try to structure my programming assignments so that group work > is encouraged instead of forbidden. I prefer a cooperative arrangement > anyway. Our course is being taught at the graduate level, so somewhat different considerations apply. However, we do assign homework (on a weekly basis). The homework is submitted to the instructors as text or .py files and is required to be extensively commented. The function and strategy of each section of code must be described in the student's own words. Thus the homework assignments are sort of a combination of programming projects and discussion questions. We're early at this--the first time through the course--and the initial assignment is due next Monday by 5 pm. The assignments and discussion are available at . We're anticipating an interesting weekend. :-) Jim ________________________________________________________________________ James H. Harrison, Jr., MD, PhD Associate Director of Pathology Informatics, Department of Pathology CLSI 5807-MT, 200 Lothrop Street Pittsburgh, PA 15213-2582 voice: 412-647-5529 | fax: 412-647-5934 Faculty Member in Residence, Center for Biomedical Informatics University of Pittsburgh Suite 8084 Forbes Tower Pittsburgh, PA 15213-2582 voice: 412-647-7113 | fax: 412-647-7190 "If you want sense, you'll have to make it yourself!!"-Norton Juster ________________________________________________________________________ From dustin@cs.uchicago.edu Sat Sep 8 04:00:20 2001 From: dustin@cs.uchicago.edu (Dustin Mitchell) Date: Fri, 7 Sep 2001 22:00:20 -0500 (CDT) Subject: [Edu-sig] assigning homework In-Reply-To: Message-ID: On Thu, 6 Sep 2001, Timothy Wilson wrote: > Any pearls of wisdom from the experienced programming teachers out > there? What's best practice in this area? I'd like to avoid making > some obvious mistakes because of my inexperience in this particular > subject. Well, coming from a wet-behind-the-ears math and social studies teacher, I can't say I'd try this with my own students, but there's a lot to learn about team programming in terms of program structure. Algorithmic abstraction, functional abstraction, object abstraction, procedural abstraction -- all of these are ways that real programmers break programming problems into smaller chunks for individual team members. Then there's interface design, code review, etc. etc. etc. These concepts all require some level of sophistication from the programmer, but it may be good to introduce them early, and require those working in groups to also submit their interface designs, and the ways they split up the work, etc. Once the students get more sophisticated (on to real functions, and perhaps classes) you can do more talking about various kinds of abstraction. Then toward the end of the course, you can then *require* group work, and make the type of collaboration part of the assignment. Good luck! Dustin -- )O( From agauld@crosswinds.net Sat Sep 8 14:59:42 2001 From: agauld@crosswinds.net (agauld@crosswinds.net) Date: Sat, 8 Sep 2001 14:59:42 +0100 Subject: [Edu-sig] assigning homework In-Reply-To: References: Message-ID: <14064378115011@mailth4.freenet.co.uk> On 7 Sep 01, at 22:00, Dustin Mitchell wrote: > On Thu, 6 Sep 2001, Timothy Wilson wrote: > > Any pearls of wisdom from the experienced programming teachers As a non teacher I was going to stay out of this one but I can't resist... On the subject of students swapping code - I'd see that as inevitable and structure the homeworks around that assumption. Sharing code is a good thing(TM), encourage it. One other thing to encourage is not to create from scratch but take a working program and extend it. - Make it menu driven - Add an extra function to the menu - Improve error handling etc... > about team programming in terms of program structure. Algorithmic > abstraction, functional abstraction, object abstraction, procedural > abstraction -- all of these are ways that real programmers break > programming problems into smaller chunks for individual team members. This is good too but I'd leave it till at least after functions and modules are covered. Then you start giving out homeworks where 4 modules are required to solve the problem, divide the class into 4 and each must solve on quarter, then get the 4 bits to join together. Of course all this does make marking and levelling more difficult for the teacher. > Then there's interface design, code review, etc. etc. etc. I'd leave this till much later. The principles of good interface design can only really be understood after the basics of program design are clear. But it might be a good end of course excercise. > Then toward the end of the course, you can then *require* group work, and > make the type of collaboration part of the assignment. I definitely agree with this, group work is essential - even if the rest of "the group" is on the internet in the form of the module authors on Useless Python or Parnassus... Just some thoughts, Alan G From guido@python.org Sun Sep 9 04:17:48 2001 From: guido@python.org (Guido van Rossum) Date: Sat, 08 Sep 2001 23:17:48 -0400 Subject: [Edu-sig] laptopeducation@yahoo.com: Teaching with the Internet Message-ID: <200109090317.XAA20644@cj20424-a.reston1.va.home.com> I can't decide whether this is spam or not. --Guido van Rossum (home page: http://www.python.org/~guido/) ------- Forwarded Message Date: Sat, 08 Sep 2001 15:59:20 -0400 From: laptopeducation@yahoo.com To: webmaster@python.org Subject: Teaching with the Internet Hey, There is this web page that gives some advice on Teaching with the Internet. I think this will be a good step for us. Let me know what you think. http://home.att.net/~rdally/Teaching_with_the_Internet_List_of_URLs_4-2-99.htm ------- End of Forwarded Message From jeff@elkner.net Sun Sep 9 19:24:01 2001 From: jeff@elkner.net (Jeffrey Elkner) Date: 09 Sep 2001 14:24:01 -0400 Subject: [Edu-sig] assigning homework In-Reply-To: <14064378115011@mailth4.freenet.co.uk> References: <14064378115011@mailth4.freenet.co.uk> Message-ID: <1000059842.1685.82.camel@robeson> On Sat, 2001-09-08 at 09:59, agauld@crosswinds.net wrote: > On 7 Sep 01, at 22:00, Dustin Mitchell wrote: > > On Thu, 6 Sep 2001, Timothy Wilson wrote: > > > Any pearls of wisdom from the experienced programming teachers > > As a non teacher I was going to stay out of this one but > I can't resist... > > On the subject of students swapping code - I'd see that as > inevitable and structure the homeworks around that assumption. > Sharing code is a good thing(TM), encourage it. > > One other thing to encourage is not to create from scratch > but take a working program and extend it. > - Make it menu driven > - Add an extra function to the menu > - Improve error handling > etc... I completely agree with Alan. The most exciting learning happens when students are working on real projects that someone is really going to use. Having them work together and reuse code is what open source is all about. We had 5 students at Yorktown work on a project they called pyIOS. It was a CISCO IOS simulator. They even set up a sourceforge site and got other folks to contribute. That was definitely the most exciting project of the year, but there were several other similar efforts. I always encourage students who get that far (and many do) to reach out to the Python community to help with their projects. That is one of the great strengths of using Python and they way I would like to see them learn to work. > > about team programming in terms of program structure. Algorithmic > > abstraction, functional abstraction, object abstraction, procedural > > abstraction -- all of these are ways that real programmers break > > programming problems into smaller chunks for individual team members. > > This is good too but I'd leave it till at least after functions and > modules are covered. Then you start giving out homeworks > where 4 modules are required to solve the problem, divide > the class into 4 and each must solve on quarter, then get > the 4 bits to join together. I cut the number of computers in my lab in half this year, so that two students share each computer rather than having each student have their own. I did this to make collaboration a necessity. I plan to use peer programming methods (extreme programming) for projects throughout the year. In the beginning I will be the client and the students will be the programmers. Later in the year I would like to try setting up situations where the students can play both client and programmer roles for each other. Tim talked about doing this last year. He convinced me to give it a try. I'll keep you all informed as to how it goes... jeff From altis@semi-retired.com Sun Sep 9 19:51:53 2001 From: altis@semi-retired.com (Kevin Altis) Date: Sun, 9 Sep 2001 11:51:53 -0700 Subject: [Edu-sig] Summary: would you use PythonCard? Message-ID: I got a number of messages off the list about this topic, so I'll try to summarize the responses, skipping over a lot of the discussion that occurred on the list since you probably already read that. There were no specific messages about any of the samples or how those might be useful in education. I thought there might be some regarding the turtle graphics sample if nothing else. Many people expected PythonCard to provide a complete environment like HyperCard. This issue is described nicely by Paul Fernhout: "I looked at PythonCard but it did not correspond to my expectations based on the name and association with "HyperCard" or SuperCVard (which I have used on the Mac years ago). I expected PythonCard to be a GUI development environment where I dragged and dropped buttons and menu items and set backgrounds for cards set up visually using a property editor (ala HyperCard or SuperCard things) and what I saw was that I had to edit program files to define the GUI (although granted there was a simplified structure for these files)." The short answer is that a complete environment is where we're heading, we just aren't there yet because the project is too new. My bad for bringing up a project at the alpha stage. So, I won't post more to edu-sig until we have a full environment for people to use; today, you can use the samples like the resourceEditor which simplify part of the process, but we can do better. If you're interested in contributing ideas to PythonCard, please subscribe to the PythonCard list to keep up with the latest developments. http://lists.sourceforge.net/lists/listinfo/pythoncard-users Thanks for all the responses, ka --- Kevin Altis altis@semi-retired.com From wilson@visi.com Sun Sep 9 22:16:13 2001 From: wilson@visi.com (Timothy Wilson) Date: Sun, 9 Sep 2001 16:16:13 -0500 (CDT) Subject: [Edu-sig] assigning homework In-Reply-To: <1000059842.1685.82.camel@robeson> Message-ID: On 9 Sep 2001, Jeffrey Elkner wrote: > I completely agree with Alan. The most exciting learning happens when > students are working on real projects that someone is really going to > use. Having them work together and reuse code is what open source is > all about. I can't wait to get my students involved in some "real" programs. At least point in the year we're still working on the most basic basics. (We just finished our first week of school in Minnesota.) > I cut the number of computers in my lab in half this year, so that two > students share each computer rather than having each student have their > own. > > I did this to make collaboration a necessity. I plan to use peer > programming methods (extreme programming) for projects throughout the > year. In the beginning I will be the client and the students will be > the programmers. Later in the year I would like to try setting up > situations where the students can play both client and programmer roles > for each other. This is great. I'm planning to do a lot of work using only half of my computers. (I've got 30 machines in the lab with 30 students.) I think I will buy one of the Extreme Programming books and look it over so I can pick up some of the basic ideas. Anyone have a recommendation on which to read? This is the first course I've taught that includes a roughly equal number of students in the 9th-12th grades. It will also be a challenge to deal with the varying math abilities in the class. I specified algebra as a prerequisite for the course, but I had about 10 students get through who've only had pre-algebra. That could make things a bit tricky, but we'll see how it goes. Thanks to all the suggestion about projects, but I don't think anyone really addressed the heart of my question. I'm not sure how to go about assessing their work. That's the hard part. (Thinking back, maybe I didn't mention assessment specifically.) I'm going to be giving some quizzes and tests, but I'm not sure how much to weight the rest of their work. I think I'll probably just have to play it by ear and see how it goes. Would anyone who's taught Python (or any programming course for that matter) care to summarize briefly how they break down their grading for the course? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From mats@laplaza.org Fri Sep 14 11:18:52 2001 From: mats@laplaza.org (Mats Wichmann) Date: Fri, 14 Sep 2001 06:18:52 -0400 Subject: [Edu-sig] assigning homework In-Reply-To: <1000059842.1685.82.camel@robeson> References: <14064378115011@mailth4.freenet.co.uk> <14064378115011@mailth4.freenet.co.uk> Message-ID: <5.1.0.14.1.20010914061232.00abbc78@204.151.72.2> Drifted a bit from the subject line, but... At 02:24 PM 9/9/2001 -0400, Jeffrey Elkner wrote: >I cut the number of computers in my lab in half this year, so that two >students share each computer rather than having each student have their >own. The training outfit I teach for (and developed the Python course for) has used this model successfully for many years. Our environment is somewhat different - four or five intensive days, and you're hitting up against the limits of what people can absorb. Learning with a partner, if managed a bit (making sure both students type, and that they really /do/ collaborate: we keep instructing them to READ the problem out loud and talk about it) takes some of the focus off of syntax and typing mechanics and puts it onto understanding the concepts. And it's just plain more fun. In effect, the partners teach each other, as they "get" different things at different times. There are a number of studies that back this up; my comments are based on my own observations, however. Mats From wilson@visi.com Fri Sep 14 16:04:46 2001 From: wilson@visi.com (Timothy Wilson) Date: Fri, 14 Sep 2001 10:04:46 -0500 (CDT) Subject: [Edu-sig] My Python class homepage Message-ID: Hi everyone, We've just finished our second week of classes at Sibley and I'm very pleased with how well my students are picking up Python. Some are struggling more than others obviously, but most of them are really doing well. I've got a Web page for our class at http://www.isd197.org/sibley/cs/icp/ that all of you are welcome to check out. I'll be posting all of my classes programming assignments as well as anything else I think would be useful to them. I can't promise anything too useful, but some may be interested. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From Jonathan Pennington Fri Sep 14 16:36:16 2001 From: Jonathan Pennington (Jonathan Pennington) Date: Fri, 14 Sep 2001 11:36:16 -0400 Subject: [Edu-sig] Periodic table Message-ID: <20010914113616.A9695@fiddlersnest.org> I need to develop some software for teaching that uses the periodic table in a number of ways. Does anyone have the entire periodic in list/dictionary/tuple format (Or even delimited file)? I'd hate to retype everything if it's out there already. -J -- Jonathan Pennington | john@coastalgeology.org "It's hard to take life too seriously when you realize yours is a joke." -me From rob@jam.rr.com Fri Sep 14 16:51:44 2001 From: rob@jam.rr.com (Rob) Date: Fri, 14 Sep 2001 10:51:44 -0500 Subject: [Edu-sig] Periodic table References: <20010914113616.A9695@fiddlersnest.org> Message-ID: <3BA22790.7A910C03@jam.rr.com> Jonathan Pennington wrote: > > I need to develop some software for teaching that uses the periodic > table in a number of ways. Does anyone have the entire periodic in > list/dictionary/tuple format (Or even delimited file)? I'd hate to > retype everything if it's out there already. > I'd think that the periodic table would be excellently rendered using classes. This would (I imagine) make it a relatively simple process to write simple scripts that work with the elemental attributes in a manner consistent with our scientific understanding of their natural behavior. However, I haven't done it. I tend to write more Useless Python. 3;-> Rob -- Aw, c'mon.... You indent ANYWAY! Useless Python! http://www.lowerstandard.com/python From delza@alliances.org Fri Sep 14 17:42:10 2001 From: delza@alliances.org (Dethe Elza) Date: Fri, 14 Sep 2001 09:42:10 -0700 Subject: [Edu-sig] Periodic table References: <20010914113616.A9695@fiddlersnest.org> Message-ID: <3BA23362.8050300@alliances.org> Jonathan Pennington wrote: > I need to develop some software for teaching that uses the periodic > table in a number of ways. Does anyone have the entire periodic in > list/dictionary/tuple format (Or even delimited file)? I'd hate to > retype everything if it's out there already. > > -J > Elliotte Rusty Harold has it in XML on his site: http://www.ibiblio.org/xml/examples/periodic_table/allelements.xml Hope that helps. --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From csmith@blakeschool.org Fri Sep 14 18:12:07 2001 From: csmith@blakeschool.org (Christopher Smith) Date: Fri, 14 Sep 2001 12:12:07 -0500 Subject: [Edu-sig] Re: Periodic table In-Reply-To: References: Message-ID: > >I need to develop some software for teaching that uses the periodic >table in a number of ways. Does anyone have the entire periodic in >list/dictionary/tuple format (Or even delimited file)? I'd hate to >retype everything if it's out there already. At the Web Elements site you can download a PDF periodic table (at least I know you can print it so I assume you can download it) that has the elements and their atomic masses. You can copy the data from it. I also am pasting a script which will return a dictionary with the keys being the atomic number...double check it. The "string" at the beginning is just a copy of the spreadsheet that I created for my chemistry classes. /c #### table='''1 2 H He hydrogen helium 1.008 4.003 3 4 5 6 7 8 9 10 Li Be B C N O F Ne lithium beryllium boron carbon nitrogen oxygen fluorine neon 6.941 9.012 10.81 12.01 14.01 16 19 20.18 11 12 13 14 15 16 17 18 Na Mg Al Si P S Cl Ar sodium magnesium aluminum silicon phosphorus sulfur chlorine argon 22.99 24.3 26.98 28.09 30.97 32.1 35.45 39.95 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr potassium calcium scandium titanium vanadium chromium manganese iron cobalt nickel copper zinc gallium germanium arsenic selenium bromine krypton 39.1 40.08 44.96 47.88 50.94 52 54.94 55.85 58.93 58.69 63.55 65.39 69.72 72.61 74.92 78.96 79.9 83.8 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe rubidium strontium yttrium zirconium niobium molybdenum technetium ruthenium rhodium palladium silver cadmium indium tin antimony tellurium iodine xenon 85.47 87.62 88.91 91.22 92.91 95.94 (97.91) 101.07 102.9 106.4 107.9 112.4 114.8 118.7 121.8 127.6 126.9 131.3 55 56 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 Cs Ba Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn cesium barium lutetium hafnium tantalum tungsten rhenium osmium iridium platinum gold mercury thallium lead bismuth polonium astatine radon 132.9 137.3 175 178.5 180.9 183.8 186.2 190.2 192.2 195.1 197 200.6 204.4 207.2 209 (209.0) (210.0) (222.0) 87 88 103 104 105 106 107 108 109 110 111 112 114 116 118 Fr Ra Lr Rf Db Sg Bh Hs Mt Uun Uuu Uub francium radium lawrencium rutherfordium dubnium seaborgium bohrium hassium meitnerium ununnilium unununium ununbium (223.0) (226.0) (262.1) (261.1) (262.1) (263.1) (262.1) (265.1) (266.1) (269.1) (272.1) (277.1) 57 58 59 60 61 62 63 64 65 66 67 68 69 70 La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb lanthanum cerium praseodymium neodymium promethium samarium europium gadolinium terbium dysprosium holmium erbium thulium ytterbium 138.9 140.1 140.9 144.2 (144.9) 150.4 152 157.2 158.9 162.5 164.9 167.3 168.9 173 89 90 91 92 93 94 95 96 97 98 99 100 101 102 Ac Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No actinium thorium protactinium uranium neptunium plutonium americium curium berkelium californium einsteinium fermium mendelevium nobelium (227.0) 232 231 238 (237.0) (244.1) (243.1) (247.1) (251.1) (251.1) (252.1) (257.1) (258.1) (259.1) ''' rows=table.split('\n') n=[] ab=[] nam=[] mass=[] for i in range(0,len(rows)-4,4): n+=rows[i].split('\t') ab+=rows[i+1].split('\t') nam+=rows[i+2].split('\t') mass+=rows[i+3].split('\t') r=zip(n,ab,nam,mass) pt={} for ri in r: pt[ri[0]]=(ri[1],ri[2],ri[3]) for k in pt.keys(): print k,pt[k] #### From rnd@onego.ru Fri Sep 14 21:43:51 2001 From: rnd@onego.ru (Roman Suzi) Date: Sat, 15 Sep 2001 00:43:51 +0400 (MSD) Subject: [Edu-sig] Re: Periodic table In-Reply-To: Message-ID: I remember I saw the whole periodic table in XML format. (But I do not remeber where). Also, 2 years ago I d/l a program which had LOTs of data about every element... (it was an open source program... gperiodic maybe... Maybe some other (it was ~ 8Mb do d/l!) Sincerely yours, Roman Suzi -- _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Friday, September 14, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "URA Redneck if you own a homemade fur coat." _/ From Jonathan Pennington Sat Sep 15 23:07:58 2001 From: Jonathan Pennington (Jonathan Pennington) Date: Sat, 15 Sep 2001 18:07:58 -0400 Subject: [Edu-sig] Periodic table In-Reply-To: <3BA23362.8050300@alliances.org>; from delza@alliances.org on Fri, Sep 14, 2001 at 09:42:10AM -0700 References: <20010914113616.A9695@fiddlersnest.org> <3BA23362.8050300@alliances.org> Message-ID: <20010915180757.A4050@fiddlersnest.org> * Dethe Elza [010914 12:38]: > Elliotte Rusty Harold has it in XML on his site: > > http://www.ibiblio.org/xml/examples/periodic_table/allelements.xml > > Hope that helps. That's exactly what I need. I was going to parse everything into xml anyway. Thanks. -Q -- Jonathan Pennington | john@coastalgeology.org "It's hard to take life too seriously when you realize yours is a joke." -me From urnerk@qwest.net Sun Sep 16 01:04:18 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 15 Sep 2001 17:04:18 -0700 Subject: [Edu-sig] Re: [Tutor] SMTPLIB module - how to add subject ? In-Reply-To: <5FEF7E62AE5@kserver.org> References: <3BA3D9FE.30092.76C3D5@localhost> <3BA3D9FE.30092.76C3D5@localhost> Message-ID: <4.2.0.58.20010915170254.00b73cd0@pop3.norton.antivirus> > >I've pasted the example below. Actually, I really dislike this example. >They are using >"\r\n" >as a character for newlines. Whose idea was that??? >It should be just >"\n" Sounds like a concession to the Windows way of doing things. Isn't that how lines of text get separated in that OS? Kirby From gritsch@iue.tuwien.ac.at Sun Sep 16 13:50:16 2001 From: gritsch@iue.tuwien.ac.at (Markus Gritsch) Date: Sun, 16 Sep 2001 14:50:16 +0200 Subject: [Edu-sig] Re: [Tutor] SMTPLIB module - how to add subject ? References: <3BA3D9FE.30092.76C3D5@localhost> <3BA3D9FE.30092.76C3D5@localhost> <4.2.0.58.20010915170254.00b73cd0@pop3.norton.antivirus> Message-ID: <001801c13eae$23b23e00$c2f023c0@tuwien.ac.at> > >I've pasted the example below. Actually, I really dislike this example. > >They are using > >"\r\n" > >as a character for newlines. Whose idea was that??? > >It should be just > >"\n" > > > Sounds like a concession to the Windows way of doing > things. Isn't that how lines of text get separated > in that OS? Of course it is. UNIX (Linux) uses \n, MacOS uses \r, and Windows uses \r\n - as you can see, in Windows you get the best of both worlds ;-) Markus From mkeller@noos.fr Sun Sep 16 17:49:29 2001 From: mkeller@noos.fr (Marc Keller) Date: Sun, 16 Sep 2001 18:49:29 +0200 Subject: [Edu-sig] Re: [Tutor] SMTPLIB module - how to add subject ? References: <3BA3D9FE.30092.76C3D5@localhost> <3BA3D9FE.30092.76C3D5@localhost> <4.2.0.58.20010915170254.00b73cd0@pop3.norton.antivirus> <001801c13eae$23b23e00$c2f023c0@tuwien.ac.at> Message-ID: <3BA4D819.E7E182AF@noos.fr> Markus Gritsch wrote: > > >I've pasted the example below. Actually, I really dislike this example. > > >They are using > > >"\r\n" > > >as a character for newlines. Whose idea was that??? > > >It should be just > > >"\n" > > > > > > Sounds like a concession to the Windows way of doing > > things. Isn't that how lines of text get separated > > in that OS? > > Of course it is. UNIX (Linux) uses \n, MacOS uses \r, and Windows uses > \r\n - as you can see, in Windows you get the best of both worlds ;-) > > Markus > There are two scripts in the Python distribution: Python-2.1.1/Tools/scripts/crlf.py et Python-2.1.1/Tools/scripts/lfcr.py for conversion between Window's files and Linux ones. Marc > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig From WHITSTON@ltu.edu Mon Sep 17 15:42:58 2001 From: WHITSTON@ltu.edu (WHITSTON@ltu.edu) Date: Mon, 17 Sep 2001 10:42:58 -0400 (EDT) Subject: [Edu-sig] Function Question -- I'm confused... Message-ID: <01K8FVB12MV894DSHH@LTU.EDU> To all: Over the weekend I was reading a Python textbook and in the chapter on functions it mentioned that Python functions could have embedded functions like Pascal. Since other textbooks don't mention this "feature", I'm wondering whether it is true or not (or was/is part of a particular version). Thank you for your help -- you could reply to me privately unless other newbies are interested in this. Howard Whitston Lawrence Tech. University whitston@ltu.edu From john@idcc.net Mon Sep 17 16:48:50 2001 From: john@idcc.net (John Fronckowiak) Date: Mon, 17 Sep 2001 11:48:50 -0400 Subject: [Edu-sig] Python in The Classroom... Message-ID: <5.1.0.14.2.20010917114528.09c130b0@buffnet.net> I'm new to this list. I'm trying to find out some information about the use of Python in the classroom. I'd like to teach Python as our introductory programming language. I'd be interested in hearing from anyone that is currently teaching Python and what class their teaching it in (please feel free to reply to my request off of the list). Or if you know of any resources that list classes where Python is being used, Id love to hear about it. Thanks in advance! John Fronckowiak Lecturer Department of Computer Information Systems Medaille College // 18 Agassiz Circle // Buffalo // NY //14214 Phone: 716-884-3281 // Web: http://www.idcc.net/medaille From wilson@visi.com Mon Sep 17 17:07:35 2001 From: wilson@visi.com (Timothy Wilson) Date: Mon, 17 Sep 2001 11:07:35 -0500 (CDT) Subject: [Edu-sig] Python in The Classroom... In-Reply-To: <5.1.0.14.2.20010917114528.09c130b0@buffnet.net> Message-ID: On Mon, 17 Sep 2001, John Fronckowiak wrote: > I'm new to this list. I'm trying to find out some information about the use > of Python in the classroom. I'd like to teach Python as our introductory > programming language. I'd be interested in hearing from anyone that is > currently teaching Python and what class their teaching it in (please feel > free to reply to my request off of the list). Or if you know of any > resources that list classes where Python is being used, Id love to hear > about it. Hi John, There are a number of us on the list who are using Python in an introductory programming class. I'm using the book "How To Think Like a Computer Scientist" which is available at http://www.ibiblio.org/obp/thinkCSpy/. A suggestion was made a couple weeks ago to make a list of teachers and schools who are using Python. Anyone know what became of it. Last I heard someone was going to approach the ibiblio folks to see if they would host it. You've obviously seen the edu-sig page at python.org. If you've got questions, fire away. We'll do our best to help. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From jhrsn@pitt.edu Mon Sep 17 19:34:51 2001 From: jhrsn@pitt.edu (Jim Harrison) Date: Mon, 17 Sep 2001 14:34:51 -0400 Subject: [Edu-sig] Python in The Classroom... In-Reply-To: <5.1.0.14.2.20010917114528.09c130b0@buffnet.net> Message-ID: on 9/17/01 11:48 AM, John Fronckowiak at john@idcc.net wrote: > I'm trying to find out some information about the use > of Python in the classroom. I'd like to teach Python as our introductory > programming language. I'd be interested in hearing from anyone that is > currently teaching Python and what class their teaching it in (please feel > free to reply to my request off of the list). We're using python in an introductory programming course at the graduate level, "Problem-oriented Programming in Medical Informatics." Information on the course is available at http://jhh.cbmi.upmc.edu/pop Note also that the links down the right side list four other college-level courses in Python taught around the country. Jim ________________________________________________________________________ James H. Harrison, Jr., MD, PhD Associate Director of Pathology Informatics, Department of Pathology CLSI 5807-MT, 200 Lothrop Street Pittsburgh, PA 15213-2582 voice: 412-647-5529 | fax: 412-647-5934 Faculty Member in Residence, Center for Biomedical Informatics University of Pittsburgh Suite 8084 Forbes Tower Pittsburgh, PA 15213-2582 voice: 412-647-7113 | fax: 412-647-7190 "If you want sense, you'll have to make it yourself!!"-Norton Juster ________________________________________________________________________ From dyoo@hkn.eecs.berkeley.edu Mon Sep 17 21:37:21 2001 From: dyoo@hkn.eecs.berkeley.edu (Danny Yoo) Date: Mon, 17 Sep 2001 13:37:21 -0700 (PDT) Subject: [Edu-sig] Function Question -- I'm confused... In-Reply-To: <01K8FVB12MV894DSHH@LTU.EDU> Message-ID: On Mon, 17 Sep 2001 WHITSTON@ltu.edu wrote: > Over the weekend I was reading a Python textbook and in the chapter on > functions it mentioned that Python functions could have embedded > functions like Pascal. Since other textbooks don't mention this > "feature", I'm wondering whether it is true or not (or was/is part of > a particular version). Yes, it's possible to nest functions in functions: >>> def function1(): ... def function2(): ... print "Hey, ho, the wind and the rain" ... function2() ... function2() ... >>> function1() Hey, ho, the wind and the rain Hey, ho, the wind and the rain >>> function2() Traceback (most recent call last): File "", line 1, in ? NameError: name 'function2' is not defined ### Note that, outside of function1(), the global environment doesn't know what function2() looks like. We can think of function2() as if it were a local variable. Here's a somewhat more complicated, but powerful, example of using functions within functions: ### from __future__ import nested_scopes from operator import isSequenceType def deepen(f): """Given a function 'f' that takes a single argument, returns a new function that can deeply apply 'f' across sequences.""" def deep_function(thing): if isSequenceType(thing): return map(deep_function, thing) return f(thing) return deep_function ### And here it is in action: ### >>> def square(x): return x * x >>> deep_squarer = deepen(square) ## We create a "deep" version of ## square(). >>> deep_squarer(5) ## It still knows how to deal with ## single elements... 25 >>> deep_squarer( [5, 6, [7, 8], [[9]]] ) ## But things get interesting [25, 36, [49, 64], [[81]]] ## when we give it larger ## structures! In most cases, I don't nest functions because it makes it impossible to call them from outside of the enclosing function. This makes it difficult to directly test them. However, nested functions become more interesting when we have lexical ("nested") scoping. If you have more questions, please feel free to ask! From agauld@crosswinds.net Mon Sep 17 21:55:07 2001 From: agauld@crosswinds.net (agauld@crosswinds.net) Date: Mon, 17 Sep 2001 21:55:07 +0100 Subject: [Edu-sig] Function Question -- I'm confused... In-Reply-To: <01K8FVB12MV894DSHH@LTU.EDU> Message-ID: <21021521808939@mailth4.freenet.co.uk> On 17 Sep 01, at 10:42, WHITSTON@ltu.edu wrote: > Over the weekend I was reading a Python textbook and in the chapter on > functions it mentioned that Python functions could have embedded functions > like Pascal. Since version 2 thats true. Its whats called embedded scopes Thus you can do this: def foo(): def bar(): print "Hello from bar" bar() Now calling foo will print the messsaage but if you try to call bar() from outside foo() your get a name error. In earlier versions of Python I think you could still type the code but bar would still be seen at the module level. > Thank you for your help -- you could reply to me privately unless other > newbies are interested in this. I would imagine newbies will be interested but you are more likely to find them on the python-tutor mailing list rather than edu-sig which is targetted at educators rather than students... There's a hint there somewhere Alan G From com-nospam@ccraig.org Tue Sep 18 13:21:27 2001 From: com-nospam@ccraig.org (Christopher A. Craig) Date: 18 Sep 2001 08:21:27 -0400 Subject: [Edu-sig] Function Question -- I'm confused... In-Reply-To: <21021521808939@mailth4.freenet.co.uk> References: <21021521808939@mailth4.freenet.co.uk> Message-ID: <878zfc6660.fsf@elbereth.ccraig.org> agauld@crosswinds.net writes: > Since version 2 thats true. Its whats called embedded scopes > Thus you can do this: > > def foo(): > def bar(): > print "Hello from bar" > bar() [stuff deleted] > In earlier versions of Python I think you could still type > the code but bar would still be seen at the module level. This example does not use nested scoping, and will work correctly Python 1.5 Nested scopes allow an embedded function to see the variables of its parent. For example this code: def foo(input): def factorial(a): if a==0: return 1 else: return a*factorial(a-1) return factorial(input) would give an error without nested scoping (which must be explicitly turned on in 2.1 BTW), because the function 'factorial' is defined in foo, but not in factorial itself. This also caused problems with the use of lambdas because you frequently had to do things like map(lambda a, var=var: a+var, list) to get them to work (because var would not be defined in the scope of the lambda unless it was explicitly passed in). -- Christopher A. Craig "Have you ever commented: 'If I drive fast enough at the red light, it'll appear green.'" - The Nerdity Test From Jonathan Pennington Tue Sep 18 15:26:12 2001 From: Jonathan Pennington (Jonathan Pennington) Date: Tue, 18 Sep 2001 10:26:12 -0400 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body. Message-ID: <20010918102612.B2566@fiddlersnest.org> Given the recent talk about using Python to teach mathematics, I have the following question for the math gurus: Given > 3 points on a plane, how would one use Python to calculate the surface area of that plane. I'm assuming numpy would be used because it's going to run quite frequently. To give more of an explaination, I'm trying to develop an educational program that is adding mathematics to my existing attempt to merge science(geology) and programming. Students will take coordinate data (either in lat/lon or UTM format) and enter the data into their programs to manipulate it, so the points will probably be in lat/lon format. If a program already exisits with such a solution, I wouldn't mind reading the code. Otherwise, I'd like a math guru's opinion on well-formed solutions. Thanks -J -- Jonathan Pennington | john@coastalgeology.org "It's hard to take life too seriously when you realize yours is a joke." -me From Jonathan Pennington Tue Sep 18 15:31:43 2001 From: Jonathan Pennington (Jonathan Pennington) Date: Tue, 18 Sep 2001 10:31:43 -0400 Subject: [Edu-sig] Chemistry program Message-ID: <20010918103143.C2566@fiddlersnest.org> Sorry, Forgot about this. I have the first methods done of a chemistry program that I'm working on. Right now, it parses an XML file of the periodic table and pulls elemental data from it for viewing or manipulation. My plans for this are for manipulating basic chemical and geochemical formulae, and later adding the ability to predict eutectics and such. Since I figure this might be useful to others, I was going to ask if there was any other work going on in this field, or what teachers/others might find useful in a program such as this. Collaboration is welcome as well. Cheers, -J -- Jonathan Pennington | john@coastalgeology.org "It's hard to take life too seriously when you realize yours is a joke." -me From wilson@visi.com Tue Sep 18 18:16:40 2001 From: wilson@visi.com (Timothy Wilson) Date: Tue, 18 Sep 2001 12:16:40 -0500 (CDT) Subject: [Edu-sig] Pair programming Message-ID: Hi everyone, I'd like to add my $0.02 to Jeff's advice a week or so ago about having the students work in pairs. Many of the teachers on this list probably have students paired up in their classes out of necessity. Fortunately, in my situation I have 30 machines for 30 students. However, I've only been using 15 machines lately. It's still early in the year, and I haven't assigned a large project yet since the students still haven't learned all the syntax. But I have been using pairs for the daily work of writing little functions and programs. >From my observations so far, I would suggest that paired programming does a great job of drawing quiet students into discussions. I noticed that a number of my students in the first week or so of class were perfectly happy to sit quietly in class not understanding what was going on. They simply weren't assertive enough to raise their hands to get my attention. This was most often observed in my female students. These students are much more likely to ask their peers questions than they are to ask me. Incidentally, I also try to pair particularly shy students with a person of their own gender. There is no doubt that these quiet students are learning more and it almost certainly helps the students who are answering their questions too. (You learn more by teaching after all.) The quality of work produced is also higher. The direct interaction with another student really helps catch little syntax and logic errors even before the program is run. >From a teacher's standpoint, another great advantage is that I have only 15 groups of students to deal with instead of 30 individuals. Having few groups/students to visit means more individual attention from me. So I'd encourage everyone to give it a try. I'm not necessarily going to work in pairs 100% of the time, but I don't think I'll be using all 30 computers simultaneously very often. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From nhv@cape.com Tue Sep 18 19:17:57 2001 From: nhv@cape.com (Norman Vine) Date: Tue, 18 Sep 2001 14:17:57 -0400 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body. In-Reply-To: <20010918102612.B2566@fiddlersnest.org> Message-ID: <001101c1406e$3e9de540$a300a8c0@nhv> Jonathan Pennington writes: > >Given > 3 points on a plane, how would one use Python to calculate the >surface area of that plane. I'm assuming numpy would be used because >it's going to run quite frequently. Given only three points all you can calculate is the area of the triangle defined by those points. If this triangle is is on the surface of a sphere then the additional area in the amount of the 'spherical excess' must be applied to determine the area of the spherical triangle. This is closely related to the angular 'spherical excess' of triangles on a sphere IMHO a wonderful teaching device is to draw eight equal spherical triangles on a sphere. Each corner of the triangles is 90* hence the spherical excess is 90* Sum of angles - 180* FYI It can be proven that the sum of the interior angles of a spherical triangle is always > 180* and < 540* Spherical Area = pi times r squared times E divided by 180 SA = pi * r**2 * E / 180 where r = area of sphere E = Angular Spherical Excess This is easiest to derive from a unit sphere and is a 'good' teaching device > >To give more of an explaination, I'm trying to develop an educational >program that is adding mathematics to my existing attempt to merge >science(geology) and programming. Students will take coordinate data >(either in lat/lon or UTM format) and enter the data into their >programs to manipulate it, so the points will probably be in lat/lon >format. Note that the above is on a sphere and not a spheroid ! A reasonable first approximation of the area on a spheroidal triangle can be made by simply using the distance from the center of the spheroid to the center of the triangle as the radius There were Python bindings for the Proj library try searching the vaults of parnassus Note rather then just handing the students a working program I would try to have them try to figure this one out on their own using the unit sphere and 8 equal triangles as a starting point. Cheers Norman Vine From Jonathan Pennington Tue Sep 18 23:55:47 2001 From: Jonathan Pennington (Jonathan Pennington) Date: Tue, 18 Sep 2001 18:55:47 -0400 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body. In-Reply-To: <001101c1406e$3e9de540$a300a8c0@nhv>; from nhv@cape.com on Tue, Sep 18, 2001 at 02:17:57PM -0400 References: <20010918102612.B2566@fiddlersnest.org> <001101c1406e$3e9de540$a300a8c0@nhv> Message-ID: <20010918185547.A2548@fiddlersnest.org> * Norman Vine [010918 17:52]: > Given only three points all you can calculate is the area of > the triangle defined by those points. ... > Note rather then just handing the students a working program > I would try to have them try to figure this one out on their own > using the unit sphere and 8 equal triangles as a starting point. Actually that's what I want to do, but I want to be sure that I have the solution completely tackled before hand. For clarification, I'm not using just 3 points but >3 (greater than 3 points). I'm trying to figure out a general method that will calculate the area given a number of points greater than 3, it will probably be 4 or 5 most of the time. That's where I'm having the difficulty. -J -- Jonathan Pennington | john@coastalgeology.org "It's hard to take life too seriously when you realize yours is a joke." -me From wilson@visi.com Wed Sep 19 04:05:55 2001 From: wilson@visi.com (Timothy Wilson) Date: Tue, 18 Sep 2001 22:05:55 -0500 (CDT) Subject: [Edu-sig] One more thought on paired programming Message-ID: Hi everyone, I remembered one other point that I wanted to make about using a paired programming approach in my class. I was a bit rushed in my first class on the day that I began trying this approach. As a result, my instructions to the class weren't much more than, "Work with a partner on this." The results were not impressive. Most of the pairs worked by having one person do all the typing while the other student watched passively over his or her shoulder providing almost zero input in the process. Not being a *complete* moron, I was much more clear about my expectations in my other section that day. I explicitly told the students that I expected to see both students typing (though not simultaneously :-) and that I should hear discussions as I walked around the room observing. I told them that one person was not to do all the programming, but that they should use ideas from both students. (Since then, I've adopted the phrase "Four hands, one keyboard" as an unofficial slogan to remind them of these expectations.) The difference between the two classes was dramatic. The afternoon section that had received the more detailed instructions had no trouble with it and certainly learned a lot more than my morning class. The student-student interaction was much richer and I think we approached near 100% participation. It was cool. What is that, $0.04 by now? :-) -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson@visi.com | | http://linux.com From agauld@crosswinds.net Wed Sep 19 08:40:02 2001 From: agauld@crosswinds.net (agauld@crosswinds.net) Date: Wed, 19 Sep 2001 08:40:02 +0100 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body. In-Reply-To: <20010918102612.B2566@fiddlersnest.org> Message-ID: <07465775023745@mailth4.freenet.co.uk> On 18 Sep 01, at 10:26, Jonathan Pennington wrote: > Given > 3 points on a plane, how would one use Python to calculate the > surface area of that plane. My maths are rusty but how can you calculate the surface area of a plane? There are no boundaries to a plane the surface is always infinite? Or am I missing some vital bit of definition somewhere? > science(geology) and programming. Students will take coordinate data > (either in lat/lon or UTM format) and enter the data into their > programs to manipulate it, so the points will probably be in lat/lon > format. Now this implies a different kind of plane at work? Something to do with geography and therefore bounded? curious, Alan G From agauld@crosswinds.net Wed Sep 19 08:40:02 2001 From: agauld@crosswinds.net (agauld@crosswinds.net) Date: Wed, 19 Sep 2001 08:40:02 +0100 Subject: [Edu-sig] Function Question -- I'm confused... In-Reply-To: <878zfc6660.fsf@elbereth.ccraig.org> References: <21021521808939@mailth4.freenet.co.uk> Message-ID: <07470001523754@mailth4.freenet.co.uk> On 18 Sep 01, at 8:21, Christopher A. Craig wrote: > > def foo(): > > def bar(): > > print "Hello from bar" > > bar() > > In earlier versions of Python I think you could still type > > the code but bar would still be seen at the module level. > > This example does not use nested scoping, and will work correctly > Python 1.5 Yes, that's what I said. What I got totally wrong was the bit about bar being seen at module level. What I was thinking about was the fact that bar couldn't see the internals of foo because it was working effectively outside the scope of foo - at module level. But it is not in fact visible at module level - oops! Sorry folks. > Nested scopes allow an embedded function to see the variables of its > parent. Correct, that's what I got wrong. No excuses, I just hit the reply button too fast and didn't think it through properly. Aplogies all. Alan g From dscherer@vysics.com Wed Sep 19 15:38:38 2001 From: dscherer@vysics.com (David Scherer) Date: Wed, 19 Sep 2001 10:38:38 -0400 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body. In-Reply-To: <20010918185547.A2548@fiddlersnest.org> Message-ID: <000401c14118$c582d1b0$9d01a8c0@RABBIT> > Actually that's what I want to do, but I want to be sure that > I have the solution completely tackled before hand. For > clarification, I'm not using just 3 points but >3 (greater > than 3 points). I'm trying to figure out a general method > that will calculate the area given a number of points greater > than 3, it will probably be 4 or 5 most of the time. That's > where I'm having the difficulty. http://forum.swarthmore.edu/dr.math/problems/chen.8.9.99.html From sandysj@asme.org Wed Sep 19 20:12:02 2001 From: sandysj@asme.org (Jeff Sandys) Date: Wed, 19 Sep 2001 12:12:02 -0700 Subject: [Edu-sig] Pairs Programming in Education articles Message-ID: <3BA8EE02.EC44B82C@asme.org> Laurie Williams has written several articles on the use of pairs programming in education. Look at the 'Publications' at her site: http://collaboration.csc.ncsu.edu/laurie/ I plan to use pairs programming in the middle school programming club that I do as a volunteer. But we will be using Logo this year, because I have experience and a good class syllabus. Which brings me to my questions. Is anyone using Python for middle school students? (Pymid, Python Middle School list on yahoo, is inactive) If so, do you have a good syllabus for this age group? Has anyone done any work to use Python with the Lego RCX brick (or the Handy Board)? Thanks, Jeff Sandys From sdurkin@psd.k12.co.us Wed Sep 19 21:42:13 2001 From: sdurkin@psd.k12.co.us (Scott Durkin) Date: Wed, 19 Sep 2001 14:42:13 -0600 (MDT) Subject: [Edu-sig] Pairs Programming in Education articles In-Reply-To: <3BA8EE02.EC44B82C@asme.org> Message-ID: Jeff, > Laurie Williams has written several articles on the use of > pairs programming in education. Look at the 'Publications' > at her site: > http://collaboration.csc.ncsu.edu/laurie/ > > I plan to use pairs programming in the middle school > programming club that I do as a volunteer. But we will > be using Logo this year, because I have experience and > a good class syllabus. Which brings me to my questions. > > Is anyone using Python for middle school students? > (Pymid, Python Middle School list on yahoo, is inactive) > > If so, do you have a good syllabus for this age group? I teach Python and other languages to 7th-9th graders (13-15 yrs old) in the United States. I do not have a syllabus posted, but it is close to the combination of the two resources mentioned below. (I wasn't aware of Pymid. I would be very interested in seeing a list of those in the junior high level that are teaching Python.) I use How to Think and Python for Non-programmers. I have customized the Non-prog source a bit at my site. I have also created companion pages for How to Think that include comprehension questions. I don't think I have those posted, though. If you'd like, I could send them to you. How to Think is great! So is Non-Prog. I have this stuff linked on my site (see signature) under Computing. Pairs - With 30 students and 30 computers they have to work together or I would look like that guy on the old Ed Sullivan Show with the pie plates twirling on poles (you'd have to be over 40 yrs old and lived in the U.S. to grok the reference). When a student has a question I typically ask the person next to her/him what that question is. This goes back to my elementary teaching days - three before me - my students sat in groups of 4 and must ask everyone in the group before asking me - that way, where I was in the room was really where I needed to be - rather than answering something that I shouldn't have even been asked. Though students do work together, they must turn in their own work and be individually assessed. Teaching programming to these young students is a blast. As we all know, along with learning how to program students enhance their ability to read, think and solve problems across the curriculum. I have had many teaching jobs over the decades, but nothing comes close to the sense of accomplishment and satisfaction I receive when I teach this subject. It was nice to find a school that allows me to do this with this age group. Though there are six or seven junior highs in town, ours is the only one teaching programming to its students. I don't think any programming languages are even being taught at the high school level here (though, I believe one high school does CISCO certification - but they keep losing the teachers of the class to the private sector.) As always, thanks Guido! Real programming for real kids! Scott Durkin http://www.psd.k12.co.us/staff/sdurkin From jeff@elkner.net Wed Sep 19 21:58:09 2001 From: jeff@elkner.net (Jeffrey Elkner) Date: 19 Sep 2001 16:58:09 -0400 Subject: [Edu-sig] Pairs Programming in Education articles In-Reply-To: <3BA8EE02.EC44B82C@asme.org> References: <3BA8EE02.EC44B82C@asme.org> Message-ID: <1000933090.1417.4.camel@mdeicaza> Hi Jeff! Be sure to check out: http://www.livewires.org.uk/python/ for wonderful materials using Python to teach middle school kids. I use them with my high school students as well and they find them fun and educational. jeff elkner yorktown high school arlington, va On Wed, 2001-09-19 at 15:12, Jeff Sandys wrote: > Is anyone using Python for middle school students? > (Pymid, Python Middle School list on yahoo, is inactive) > > If so, do you have a good syllabus for this age group? > > Has anyone done any work to use Python with the > Lego RCX brick (or the Handy Board)? > > Thanks, > Jeff Sandys From Jonathan Pennington Wed Sep 19 23:41:34 2001 From: Jonathan Pennington (Jonathan Pennington) Date: Wed, 19 Sep 2001 18:41:34 -0400 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body. In-Reply-To: <07465775023745@mailth4.freenet.co.uk>; from agauld@crosswinds.net on Wed, Sep 19, 2001 at 08:40:02AM +0100 References: <20010918102612.B2566@fiddlersnest.org> <07465775023745@mailth4.freenet.co.uk> Message-ID: <20010919184134.B2087@fiddlersnest.org> * agauld@crosswinds.net [010919 18:26]: > My maths are rusty but how can you calculate the surface area > of a plane? There are no boundaries to a plane the surface is > always infinite? Or am I missing some vital bit of definition > somewhere? I'm defining the plane with coordinate data from maps and/or GPS recievers. The spherical body is the geode (idealized earth). However, calculating a boundless plane on a spherical body will not be infinite, but will be the surface area of the sphere itself. In that respect, it's not actually a plane in the traditional sense though. -J -- Jonathan Pennington | john@coastalgeology.org "It's hard to take life too seriously when you realize yours is a joke." -me From goodmansond@hotmail.com Thu Sep 20 15:18:55 2001 From: goodmansond@hotmail.com (Dean Goodmanson) Date: Thu, 20 Sep 2001 14:18:55 +0000 Subject: [Edu-sig] Python in Statistics class Message-ID: Another potentially naive post, but traffic is slow and it's almost Friday. I am curious to how Python is being used in a statistics classroom. In using python and In a brief search for Python and statistics I came across enough information to feel that Python would be a good statistical analysis tool. However, most of the information was either very math centric (matrice analysis, etc.) or at a seemingly graduate level statistics. Are there any Basic Statistics teachers out there, and are you using Python for number crunching along with GNUPlot or other tools for graphic representation? Could you point to some basic resources for an armchair statistician, or Practical Statistics (surveys, basic measurement analysis, etc.) -Dean _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp From kimtitu@yahoo.com Sat Sep 22 17:01:12 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Sat, 22 Sep 2001 09:01:12 -0700 (PDT) Subject: [Edu-sig] Delete a cookie Message-ID: <20010922160112.24664.qmail@web14707.mail.yahoo.com> Hi all, I am learning python in cgi programming. I want to keep the http state of a user to my website in CGI script. I decide to use Cookie module to realize it. However, i find that i can load, set and change cookies, i cannot invalide or delete the same cookie that i have created. Thus the cookies are always there as long as client does not close the browser. How can i delete those cookies? Or is there any other module that acchieve the same purpose that i can use? Thanks a lot. Kim Titu __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com From delza@alliances.org Sat Sep 22 18:32:31 2001 From: delza@alliances.org (Dethe Elza) Date: Sat, 22 Sep 2001 10:32:31 -0700 Subject: [Edu-sig] Delete a cookie References: <20010922160112.24664.qmail@web14707.mail.yahoo.com> Message-ID: <3BACCB2F.1020101@alliances.org> Deleting a cookie is non-intuitive. You have to set the cookie with an expire time of zero. HTH --Dethe Titu Kim wrote: > Hi all, > I am learning python in cgi programming. I want to > keep the http state of a user to my website in CGI > script. I decide to use Cookie module to realize it. > However, i find that i can load, set and change > cookies, i cannot invalide or delete the same cookie > that i have created. Thus the cookies are always there > as long as client does not close the browser. How can > i delete those cookies? Or is there any other module > that acchieve the same purpose that i can use? Thanks > a lot. > > Kim Titu > > __________________________________________________ > Do You Yahoo!? > Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig > > > -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From urnerk@qwest.net Sat Sep 22 23:47:43 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 22 Sep 2001 15:47:43 -0700 Subject: [Edu-sig] Subclassing type int In-Reply-To: <00c701c1355c$1285b360$c3090740@jasonic> Message-ID: <4.2.0.58.20010922153810.00c41360@pop3.norton.antivirus> OK, so now that builtin classes are subclassable, I'm thinking to subclass the int type to create a type of integer that adds, multiplies, and raises to powers modulo N (N = some natural number). Someting starting like: class I(int): If anyone finds this an interesting challenge, I'd be happy to see this be a thread. Gotta download the most recent 2.2 to play. Kirby From kimtitu@yahoo.com Tue Sep 25 01:42:00 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Mon, 24 Sep 2001 17:42:00 -0700 (PDT) Subject: [Edu-sig] Send email using qmail. Message-ID: <20010925004200.37375.qmail@web14706.mail.yahoo.com> Hi, I have some problem when sending out a mail using qmail. How can i implement a simple email mechanism Command? that will send an email througt qmail in python? Most of the examples i saw on the internet are using sendmail instead of qmail. Somebody please enlight me. Thanks alot. Kim Titu __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com From Ivan Juanes Tue Sep 25 16:48:40 2001 From: Ivan Juanes (Ivan Juanes ) Date: Tue, 25 Sep 2001 16:48:40 +0100 Subject: [Edu-sig] Send email using qmail. In-Reply-To: <20010925004200.37375.qmail@web14706.mail.yahoo.com> References: <20010925004200.37375.qmail@web14706.mail.yahoo.com> Message-ID: <20010925164840.A12309@kerberos.dhis.org> El dia Mon, Sep 24, 2001 at 05:42:00PM -0700, Titu Kim tuvo a bien escribir: > Hi, > I have some problem when sending out a mail using > qmail. How can i implement a simple email mechanism > Command? that will send an email througt qmail in > python? Most of the examples i saw on the internet are > using sendmail instead of qmail. Somebody please > enlight me. > Thanks alot. Using the sendmail module you will call the "sendmail" binary that comes with qmail, exim, postfix, etc. Any MTA on Unix has a Sendmail interface. Just use the standard procedure, it should work with qmail. Best regards, -- I've discovered that using VMS is a lot like driving a nail with your head: sure, you eventually get something practical done, but it usually results in a headache and some blood loss. (submitted by Sean A. Simpson) -- Escrito en MIT/Qt/GNU/BSD/Linux, o mejor "Linux" La FSF no es la dueña de mi trabajo J. Ivan Juanes Prieto -- Greek and Latin Teacher Canary Islands (Spain) -- Linux Debian 2.2 From jaapspies@home.nl Tue Sep 25 21:45:22 2001 From: jaapspies@home.nl (Jaap Spies) Date: Tue, 25 Sep 2001 21:45:22 +0100 Subject: [Edu-sig] Calculating area of a surface plane on a spherical body Message-ID: <3BB0ECE2.EE79700@home.nl> > Given > 3 points on a plane, how would one use Python to calculate the > surface area of that plane. I'm assuming numpy would be used because > it's going to run quite frequently. > > To give more of an explaination, I'm trying to develop an educational > program that is adding mathematics to my existing attempt to merge > science(geology) and programming. Students will take coordinate data > (either in lat/lon or UTM format) and enter the data into their > programs to manipulate it, so the points will probably be in lat/lon > format. > > If a program already exisits with such a solution, I wouldn't mind > reading the code. Otherwise, I'd like a math guru's opinion on > well-formed solutions. > Sorry, my reaction is a little bit late. When the area is small compared with R*R (R = 6000 km, radius or the earth), you may consider a polygon in a plane (maps are based on this concept). The area of a polygon P0, P1, P2, ..., Pn with P0 = Pn, can be calculated with a simple algorithm: A = ( sum from i=0 to n-1 (y[i+1] - y[i])*(x[i+1] + x[i]) ) / 2 where (x[i], y[i]) represents the coordinates of point P with index i. All you have to do is translate lat/lon in rectangular coordinates. Girard's theorem: A = sum from i=1 to n (theta[i]) - (n-2) * pi, (R=1) is for relative small area's rather sensitive for errors in the theta's. Jaap Spies, Institute of Technology Hogeschool Drenthe From Jason Cunliffe" Message-ID: <004801c14611$a0d6bae0$c3090740@jasonic> I posted before about this one.. and I hope it is not too off-topic. As you know I like to share tools which I find relevent and intersting tio Pyth and Edu-Sig. Recently I have been experimenting with Rebol, a veryclever collaborative language/toolkit designed for distributed internet applications. Idiosyncratic, minimal and stylish, it does some things very nicely indeed, especially message passing between many internet protocols. It also has a very ingenious graphical uer interface extension called Rebol/View .. fun to play with, food for thought... It makes as a viable hands-on model to consider for Edu-sig sahred workspaces, and relative to the excellent Pythoncard developments. PYTHON EMAIL ??? Rebol might offer a nice model/alternative for Pythoneers needing easy email handling and more.. Example: to send an email including the contents of web page >>> send fred@example.com read http://www.rebol.com www.rebol.com Rebol/Core Free for non-comercial use Rebol/View Free for non-commercial use [basic GUI] Rebol/View/Pro US$49.00 for non-commercial use [more] For some Rebol/View syntax check out the docs: http://www.rebol.com/docs.html http://www.rebol.com/docs/rebolintro.html http://www.rebol.com/docs/view-guide.html http://www.rebol.com/docs/easy-vid.html#section-1 - Jason From kimtitu@yahoo.com Tue Sep 25 22:16:31 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Tue, 25 Sep 2001 14:16:31 -0700 (PDT) Subject: [Edu-sig] Get arbitrary time in seconds Message-ID: <20010925211631.31822.qmail@web14706.mail.yahoo.com> How can i get the gmt time in second given the parameters year, month, day, hour, minute and seconds of the day only. I found that mktime can do this but it need three more tuples. How can i get around with this? Thanks a lot. Kim Titu __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com From dustin@cs.uchicago.edu Tue Sep 25 22:28:17 2001 From: dustin@cs.uchicago.edu (Dustin Mitchell) Date: Tue, 25 Sep 2001 16:28:17 -0500 (CDT) Subject: [Edu-sig] Get arbitrary time in seconds In-Reply-To: <20010925211631.31822.qmail@web14706.mail.yahoo.com> Message-ID: On Tue, 25 Sep 2001, Titu Kim wrote: > How can i get the gmt time in second given the > parameters year, month, day, hour, minute and seconds > of the day only. I found that mktime can do this but > it need three more tuples. How can i get around with > this? Thanks a lot. Leave them at zero: >>> time.mktime((2001,9,24,7,15,5,0,0,0)) 1001333705.0 Dustin -- )O( From kimtitu@yahoo.com Wed Sep 26 20:30:54 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Wed, 26 Sep 2001 12:30:54 -0700 (PDT) Subject: [Edu-sig] How to pass parameters to eval? Message-ID: <20010926193054.58453.qmail@web14706.mail.yahoo.com> Hi, I appreciate all replies to my previous quesions. This time, I am trying to pass two parameter to eval function so it can evaluate and return the result base on the parameter i gave. For examples: ********func.py*************** def fun (): print v1+v2 **************pro.py*********** from func import * funname = "fun()" v1 = "Hello " v2 = "World" eval(funname) **************************** I know these code will not run. If i put fun in the same file as pro.py, it works. What i want is to let fun in func.py to have access to variable v1 and v2 which are declared in pro.py. How can i do this? Any guidance or suggestion is highly appreciated. Kim Titu __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com From mats@laplaza.org Thu Sep 27 00:22:40 2001 From: mats@laplaza.org (Mats Wichmann) Date: Wed, 26 Sep 2001 17:22:40 -0600 Subject: [Edu-sig] How to pass parameters to eval? In-Reply-To: <20010926193054.58453.qmail@web14706.mail.yahoo.com> Message-ID: <5.1.0.14.1.20010926170841.01fba968@204.151.72.2> At 12:30 PM 9/26/2001 -0700, you wrote: >Hi, > I appreciate all replies to my previous quesions. >This time, I am trying to pass two parameter to eval >function so it can evaluate and return the result base >on the parameter i gave. For examples: > >********func.py*************** >def fun (): > print v1+v2 > >**************pro.py*********** >from func import * >funname = "fun()" >v1 = "Hello " >v2 = "World" >eval(funname) >**************************** >I know these code will not run. If i put fun in the >same file as pro.py, it works. What i want is to let >fun in func.py to have access to variable v1 and v2 >which are declared in pro.py. How can i do this? Any >guidance or suggestion is highly appreciated. I guess the question that comes up is why? This seems a pretty convoluted construct. From the point of view of module func, v1 and v2 are undefined; they're only visible in the namespace of the main program. You can make this work by having func.py import v1 and v2 from pro (and moving the eval to protected code: if __name__ == '__main__'). Normally you can pass eval() the namespaces it's going to operate in, but since what eval here does is run a function in a different module, you change context when the function runs. If you truly want program-global symbols, it seems better to put them in a separate file and have everybody import that. But most folks seem to think if you find a need to do that the design of the program could use some rethinking.... From urnerk@qwest.net Thu Sep 27 00:57:53 2001 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 26 Sep 2001 16:57:53 -0700 Subject: [Edu-sig] How to pass parameters to eval? In-Reply-To: <20010926193054.58453.qmail@web14706.mail.yahoo.com> Message-ID: <4.2.0.58.20010926165457.013df760@pop3.norton.antivirus> > >********func.py*************** >def fun (): > print v1+v2 > >**************pro.py*********** You can save: def fun (v1, v2): print v1 + v2 as func.py, then go: >>> from func import * >>> funname = fun >>> v1 = "Hello" >>> v2 = "World" >>> eval("funname(v1,v2)") HelloWorld Of course the easier thing would be to just go: >>> from func import * >>> fun("Hello","World") HelloWorld But I assume you have your reasons... Kirby From kimtitu@yahoo.com Thu Sep 27 04:53:18 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Wed, 26 Sep 2001 20:53:18 -0700 (PDT) Subject: [Edu-sig] Passing parameters to eval. Message-ID: <20010927035318.22480.qmail@web14707.mail.yahoo.com> >Hi, > I appreciate all replies to my previous quesions. >This time, I am trying to pass two parameter to eval >function so it can evaluate and return the result base >on the parameter i gave. For examples: > >********func.py*************** >def fun (): > print v1+v2 > >**************pro.py*********** >from func import * >funname = "fun()" >v1 = "Hello " >v2 = "World" >eval(funname) >**************************** >I know these code will not run. If i put fun in the >same file as pro.py, it works. What i want is to let >fun in func.py to have access to variable v1 and v2 >which are declared in pro.py. How can i do this? Any >guidance or suggestion is highly appreciated. I know this construct is weird. The reason i do this is the following: I have a cgi page that maintain the step to perform based on the form fields it receives. There are many fields this main cgi will receive. But each page pointing to this main page may send different set of fields. So base on the fields main cgi page get, it can determine which page to run next. My plan is to get the name of the function and pass it to eval. But that particular function passed to eval will use some parameters received by main page. That is why i wish to make all the variables in main page to be visible by other functions so i don't have to worry what parameters to be passed. Any good alternative to this problem? Thanks a lot. Kim Titu __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com From Jason Cunliffe" Message-ID: <000e01c14728$1e12d860$c3090740@jasonic> A nice quote by Chris Langreiter [Vanilla author] ... Programming is about languages much much more than about 'mathematics' - quite in sharp contrast to what they try to tell you in school. Languages provide you with a 'certain' level of abstraction, mathematics with a theoretically infinite one. Infinite abstractions are, however, pretty useless. Programming is as much fun as writing a poem or a short story or composing a song. It's putting sentences, statements, words together to form a meaningful whole. A well-written program (like much of a Smalltalk image) is like a symphony. - Jason quote source = http://static.userland.com/userLandDiscussArchive/msg016342.html Vanilla http://www.langreiter.com/cgi-bin/vanilla.r From urnerk@qwest.net Thu Sep 27 06:02:25 2001 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 26 Sep 2001 22:02:25 -0700 Subject: [Edu-sig] Passing parameters to eval. In-Reply-To: <20010927035318.22480.qmail@web14707.mail.yahoo.com> Message-ID: <4.2.0.58.20010926215806.00c7ad50@pop3.norton.antivirus> > >by other functions so i don't have to worry what >parameters to be passed. Any good alternative to this >problem? Thanks a lot. > >Kim Titu cgi.FieldStorage() will contain all the passed parameters in one place when the main script is called, so why not have all your functions take a single parameter e.g. form = cgi.FieldStorage() funname = "fun" eval(funname+"(form)") Then each function can figure out what to do with the information in your single parameter object (treatable as a dictionary, i.e. with keys and values). Kirby From urnerk@qwest.net Thu Sep 27 06:04:21 2001 From: urnerk@qwest.net (Kirby Urner) Date: Wed, 26 Sep 2001 22:04:21 -0700 Subject: [Edu-sig] Programming for Fun Quote In-Reply-To: <000e01c14728$1e12d860$c3090740@jasonic> References: <20010927035318.22480.qmail@web14707.mail.yahoo.com> Message-ID: <4.2.0.58.20010926220242.00c7d7e0@pop3.norton.antivirus> At 12:43 AM 9/27/2001 -0700, you wrote: >A nice quote by Chris Langreiter [Vanilla author] > >... >Programming is about languages much much more than about 'mathematics' - I would agree with the quote except I don't think mathematics *has* to be infinitely abstract. One of the joys of applying programming to math is you tend to make it (math) more concrete. And that can provide a more secure basis for subsequent abstraction. Kirby From Jason Cunliffe" <4.2.0.58.20010926220242.00c7d7e0@pop3.norton.antivirus> Message-ID: <001901c14734$c0e6b0a0$c3090740@jasonic> > >Programming is about languages much much more than about 'mathematics' - > > > I would agree with the quote except I don't think > mathematics *has* to be infinitely abstract. One > of the joys of applying programming to math is you > tend to make it (math) more concrete. And that can > provide a more secure basis for subsequent abstraction. > > Kirby Kirby LOL..I hoped that would catch your attention ;-) 'Infinitely Abstract' is almost an oxymoron. Everything has its own scale, context and direction... I have been re-reading a truly brilliant book you might all enjoy. I would describe as a rare example of a new ZenScience in action: Dynamic Patterns : The Self-Organization of Brain and Behavior (Complex Adaptive Systems) by J. A. Scott Kelso Paperback - 360 pages Reprint edition (March 1997) ISBN: 0262611317 For the past twenty years Scott Kelso's research has focused on extending the physical concepts of self- organization and the mathematical tools of nonlinear dynamics to understand how human beings (and human brains) perceive, intend, learn, control, and coordinate complex behaviors. In this book Kelso proposes a new, general framework within which to connect brain, mind, and behavior. Kelso's prescription for mental life breaks dramatically with the classical computational approach that is still the operative framework for many newer psychological and neurophysiological studies. His core thesis is that the creation and evolution of patterned behavior at all levels -- from neurons to mind -- is governed by the generic processes of self-organization. Both human brain and behavior are shown to exhibit features of pattern-forming dynamical systems, including multistability, abrupt phase transitions, crises, and intermittency. Dynamic Patterns brings together different aspects of this approach to the study of human behavior, using simple experimental examples and illustrations to convey essential concepts, strategies, and methods, with a minimum of mathematics. The book functions on _many_ levels, representing 20 years of brilliant work. It is extremely well written in my opinion. For example: ... This book is a small step towards fillnig the gap between the known laws of how matter behaves and how human beings behave. Just as classical physics derived its macrsoscopic laws from observations about the motion of planets and terrestial bodies, I will describe how it is possible to construct some of the laws that appear to govern (or at least describe and occasionally predict) the dynamic behavioral patterns produced by animals and people. These are used as the foundation on which to build a deeper understanding of phenomena such as perceiving, intending, ancicipating, learning, adapting to the environment -- and as a window into the brain itelf. The centerpiece of the book is a theory of coordination, how things are put together to produce recognizable functions. The things themselves might be made of matter, such as neurons, muscles or parts of the body, or they might be mental "things" such as perceptions and ideas. Coordination, I argue, is a fundamental feature of life. Imagine a living system composed of components that ignored each other and did not interact with themselves or the environment. Such a system would possess neither structure nor function. In this book I address the basic nature of this interaction, how it occurs and why it is the way it is. The core thesis is that human behavior - from neurons to mind - is governed by the generic process of self organization. Self organization refers to the spontaneous formation of patterns and pattern change in open, nonequilibrium systems. I argue that regardless of the levels of description one chooses to study (and this I would add is always a personal choice), the same basic pattern forming principles are in evidence. ... He is director of the Center for Complex Systems and Brain Sciences at Florida Atlantic University http://www.ccs.fau.edu/ A conference is planned http://www.ccs.fau.edu/conferencenews.htm best wishes - Jason From lha2@columbia.edu Fri Sep 28 10:46:24 2001 From: lha2@columbia.edu (Lloyd Hugh Allen) Date: Fri, 28 Sep 2001 05:46:24 -0400 Subject: [Edu-sig] Programming for Fun Quote Message-ID: <3BB446F0.F2A10059@mail.verizon.net> Mathematics hasn't provided a theoretically infinite level of abstraction since 1934, when Godel gave his lectures on uncertainty. It seems strange to me to separate mathematics and language (math seems to have syntax and grammar), but maybe I've been doing too much geometry and logic, and reading too much Hofstadter. From Jason Cunliffe" Message-ID: <001601c14840$69e7f2c0$c3090740@jasonic> "Lloyd Hugh Allen" wrote Re: [Edu-sig] Programming for Fun Quote > Mathematics hasn't provided a theoretically infinite level of > abstraction since 1934, when Godel gave his lectures on uncertainty. > > It seems strange to me to separate mathematics and language (math seems > to have syntax and grammar), but maybe I've been doing too much geometry > and logic, and reading too much Hofstadter. Yes Indeed. And reading too much Hofstadter will do that to you ;-) The orginal writer's view was that for teaching purposes in shools, programming is perhaps better approached from linguistic perspective first, than to be treated as Mathematics. I agree it is not Mathematics _or_ Language. Mathematics is a [human] language, and a subset if you will of Language. It more than that too.. but not less. An lovely example of this in action is the beuatiful and original calculus treatise: Who Is Fourier? : A Mathematical Adventure by Alan Gleason (Translator), Yo Sakakibara (Introduction), Transnational College of LEX Paperback (May 1995) Blackwell Science Inc; ISBN: 0964350408 $24.95 http://www.amazon.com/exec/obidos/ISBN%3D0964350408/themathematiassoA/107-20 37412-5694951 cheers - Jason From Jason Cunliffe" Stefan Richter and his bright team have been busy applying their heady DBObjects stuff, putting it to work for netlearning. Uses PIL, PostgreSQL adn more. I have not tried it out yet. http://demo.iuveno-net.de/iuveno/Products/ZQuest and new Graph Method http://demo.iuveno-net.de/iuveno/Products/GraphMethod - Jason From jeff@elkner.net Sat Sep 29 19:47:46 2001 From: jeff@elkner.net (Jeffrey Elkner) Date: 29 Sep 2001 14:47:46 -0400 Subject: [Edu-sig] measuring python... Message-ID: <1001789273.2414.6.camel@robeson> Hi All! I'm trying to get together a master's thesis and was hoping to do something related to Python's suitability as a language for teaching programming. I was thinking of comparing Python, C++, and Java solutions to common first year computer science problems in terms of length and readability. Comparing length is not a problem. "Readability" on the other hand is not easy to define in any quantifiable way. I was thinking of trying something like "tokens per line". Any thoughts? Thanks! jeff elkner yorktown high school arlington, va From urnerk@qwest.net Sat Sep 29 22:29:09 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 29 Sep 2001 14:29:09 -0700 Subject: [Edu-sig] measuring python... In-Reply-To: <1001789273.2414.6.camel@robeson> Message-ID: <4.2.0.58.20010929134244.00c84f00@pop3.norton.antivirus> Fun quote: We often refer to Perl because it contains the extremes of both good and bad, thus making for poignant examples. We respect its power but also abhor some of its abusability. It can be called the "Bill Clinton" of programming languages because it has some good ideas and is quite good at some things, but it also has some serious integrity problems http://www.geocities.com/tablizer/langopts.htm Relevant: Simplicity This is an attempt to keep the code simple. A common (but imperfect) measurement is the number of "tokens" needed. Tokens will be defined variables, objects, methods, keywords, operators, specifiers, etc. http://www.geocities.com/tablizer/goals.htm Note: this page part of a vast anti-OOP site, which is fun to explore if only because the guy is passionate about his anti-OOPiness. http://www.geocities.com/tablizer/oopbad.htm (hahah: http://www.geocities.com/tablizer/xbasefan.htm I'm an Xbase fan too, although I use an OOPized version of it) Also relevant: http://www.cise.ufl.edu/~jnw/COP5555/Lectures/02.html I like the approach of this latter page, which doesn't make "readability" an atomic measure, but something higher level, with lots of component parts (code size might fit into it). Readability seems related to the question "What makes a language a VHLL?" Part of the answer: built in data structures that already do a lot (e.g. Python's dictionary). Final point: one reason I'd give for why Python is a good first language and/or teaching language is that it has so much in common with many other languages. In other words, I'd emphasize the similarities over the differences. Python is very cosmopolitan and in this sense provides a broad spectrum of analogies, templates, experiences, which the student programmer can draw against, when learning whatever next language(s) (i.e. we should never assume that "first language" means "last language"). Kirby From jeff@elkner.net Sat Sep 29 23:57:19 2001 From: jeff@elkner.net (Jeffrey Elkner) Date: 29 Sep 2001 18:57:19 -0400 Subject: [Edu-sig] measuring python... In-Reply-To: <4.2.0.58.20010929134244.00c84f00@pop3.norton.antivirus> References: <4.2.0.58.20010929134244.00c84f00@pop3.norton.antivirus> Message-ID: <1001804261.2824.39.camel@robeson> Thanks a 10**6, Kirby! I already planned to include Python's commonality with other languages somewhere in the paper. And I can talk about it from personal experience. I'm taking an AI course this semester and we are learning Lisp. I was struck by how many Lisp concepts I was already familiar with thanks to my exposure to Python. My classmates whose experiences were generally limited to C, C++, and Java did not have this advantage. I've printed out a few of the references and will begin looking at them tomorrow. The http://www.cise.ufl.edu/~jnw/COP5555/Lectures/02.html site looks particularly helpful. Thanks again! jeff On Sat, 2001-09-29 at 17:29, Kirby Urner wrote: > > Fun quote: > > We often refer to Perl because it contains the extremes of > both good and bad, thus making for poignant examples. We > respect its power but also abhor some of its abusability. > It can be called the "Bill Clinton" of programming languages > because it has some good ideas and is quite good at some > things, but it also has some serious integrity problems > > http://www.geocities.com/tablizer/langopts.htm > > Relevant: > > Simplicity > > This is an attempt to keep the code simple. A common (but > imperfect) measurement is the number of "tokens" needed. > Tokens will be defined variables, objects, methods, keywords, > operators, specifiers, etc. > > http://www.geocities.com/tablizer/goals.htm > > Note: this page part of a vast anti-OOP site, which is fun to > explore if only because the guy is passionate about his > anti-OOPiness. > > http://www.geocities.com/tablizer/oopbad.htm > > (hahah: > http://www.geocities.com/tablizer/xbasefan.htm > I'm an Xbase fan too, although I use an OOPized version > of it) > > Also relevant: > http://www.cise.ufl.edu/~jnw/COP5555/Lectures/02.html > > I like the approach of this latter page, which doesn't make > "readability" an atomic measure, but something higher level, > with lots of component parts (code size might fit into it). > > Readability seems related to the question "What makes a > language a VHLL?" Part of the answer: built in data structures > that already do a lot (e.g. Python's dictionary). > > Final point: one reason I'd give for why Python is a good > first language and/or teaching language is that it has so > much in common with many other languages. In other words, > I'd emphasize the similarities over the differences. > > Python is very cosmopolitan and in this sense provides a > broad spectrum of analogies, templates, experiences, which > the student programmer can draw against, when learning > whatever next language(s) (i.e. we should never assume > that "first language" means "last language"). > > Kirby From ajs@ix.netcom.com Sat Sep 29 19:35:20 2001 From: ajs@ix.netcom.com (Arthur Siegel) Date: Sat, 29 Sep 2001 14:35:20 -0400 Subject: [Edu-sig] Programming for Fun Quote Message-ID: <000001c14945$721f27a0$a9e1fea9@carol> Jason writes - >The orginal writer's view was that for teaching purposes in shools, >programming is perhaps better approached from linguistic perspective first, >than to be treated as Mathematics. At least part of my perspective is related not so directly on how to teach programming, per se, but how most effectively to fit programming fundamentals into a curriculum. A select few take programming courses, while we are all (correctly, IMO) exposed to math courses. An understanding of programming fundamentals allows for an enhanced math curriculum - ala Kirby, for example. And I believe that enhancing and enlivening a mathematics curriculum justifies the commitment of resources to teaching/learning programming as core curriculum, to an extent beyond what is true for programming - standalone. Art From urnerk@qwest.net Sun Sep 30 01:51:22 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 29 Sep 2001 17:51:22 -0700 Subject: [Edu-sig] Programming for Fun Quote In-Reply-To: <000001c14945$721f27a0$a9e1fea9@carol> Message-ID: <4.2.0.58.20010929175003.00948f00@pop3.norton.antivirus> Yes, Art is here stating a view I share rather pithily. Kirby >And I believe that enhancing and enlivening a mathematics >curriculum justifies the commitment of resources to >teaching/learning programming as core curriculum, to an >extent beyond what is true for programming - standalone. > >Art From urnerk@qwest.net Sun Sep 30 02:10:20 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sat, 29 Sep 2001 18:10:20 -0700 Subject: [Edu-sig] Smoother long ints in 2.2a4 In-Reply-To: <4.2.0.58.20010929175003.00948f00@pop3.norton.antivirus> References: <000001c14945$721f27a0$a9e1fea9@carol> Message-ID: <4.2.0.58.20010929180752.00c02ba0@pop3.norton.antivirus> New in 2.2a4 -- conversion to long integer happens automatically when needed: >>> 2**34 17179869184L >>> a =1983409182340981239481 >>> a 1983409182340981239481L I like it! Kirby From tim.one@home.com Sun Sep 30 03:02:31 2001 From: tim.one@home.com (Tim Peters) Date: Sat, 29 Sep 2001 22:02:31 -0400 Subject: [Edu-sig] Smoother long ints in 2.2a4 In-Reply-To: <4.2.0.58.20010929180752.00c02ba0@pop3.norton.antivirus> Message-ID: [Kirby Urner] > New in 2.2a4 -- conversion to long integer happens automatically > when needed: > > >>> 2**34 > 17179869184L > >>> a =1983409182340981239481 > >>> a > 1983409182340981239481L > > I like it! Me too . Note that this is a partial implementation of PEP 237 (Unifying Long Integers and Integers), and indeed is as much as we dared implement without tickling serious compatibility issues: http://python.sourceforge.net/peps/pep-0237.html There are some other new niceties hiding in 2.2a4, like >>> import math >>> math.log10(10 ** 10000) 10000.0 >>> In earlier versions, you got an infinity, NaN, or simply nonsense, from trying to find the log of a long too big to convert to a C double. That bothered me for about 10 years -- so one guess as to who fixed it . About that "compatibility" issue: There's one context where ints don't auto-convert to longs as needed, and that's left shifts: >>> 1L << 100 1267650600228229401496703205376L >>> 1 << 100 0 >>> I don't know what we can do about that, because we *know* there's code out there that depends on (short) int left shifts acting as if in a fixed-width window, losing the bits shifted "off the end". The other cases of auto-conversion raised OverflowError before, and it's hard to conceive of working code that will miss that (all examples we found caught the OverflowError and then redid the computation from scratch after explicitly converting to long); but left-shift behavior both was and would remain silent, but with different results. From Jason Cunliffe" Message-ID: <004b01c14954$66c8ca00$c3090740@jasonic> PYTHON Python: I love for its readability on two levels: 1. - consistent syntax and mostly very clear logical flow top to bottom. 2. - friendly visual syntax mainly derived from the obligatory but liberating white-space indentation Scrolling down and scanning large chunks of python code, I detect a well tempered rhythm. The blocks, indentations, naming and repetition reveal a similar construct pattern across myriad examples. This is a very 'un-scientific' comment I realize, but one perhaps worthwhile investigating.. I love Python's writability for two main reasons also: a. - executable pseudo-code .. to me Python is very sculptural. You start by naming and imagining things and relationships and then proceed to sketch them in. With time and skill you just keep going, implementing details and functionality. Play and exploration are encouraged, as is throwing things away when one has a better insight. I think this stems from the fact that because everything in Python is an object, one must name it, and doing so makes it exist. you might argue that is true for all languages, and I would agree, but Python seems very direct in the workflow from imagine, to model to further implementation adn naming and objects [tokens??]are present in the same manner every step of the way. b. - dictionaries and named arguments ..yes thank you Guido! I argue named arguments are a major reason why Python is readable and makes a great learning language. You take your semantic token map with you and share it liberally with all who come after. Dictionaries are the engine behind this. What you call something or assign a value/meaning too is more important than where it comes in the sequence, and we people should not be persecuted by having to interpret lists of unidentified symbols. Once you know how to 'read' a little Python, you know how to read most Python. Ditto writing. There is evident a clear design pattern here, which apart from a few characterful idiosyncrasies, works very well. This I think makes it especially suitable for teaching programming. And I agree with Kirby, it is a very cosmopolitan language. I would stress also that any language for people to learn is only as good as its community. Even if a small tribe, is it a living growing language? I believe the mood and quality of its culture is especially crucial for learning computer programming. [From age 9, I studied Latin for 5 years, but never was any teacher able to articulate successfully why we should study Latin, despite the daily question from some prankster in class. I am glad I studied Latin, but wish to god that at the time there had been a more cosmopolitan context provided for our study.. connections to the past, present and future, common concepts, omni present structure, etc.. At 12 years old I doubt if I would have responded this vocabulary, but certainly to the meaning of them. As you may have noted, I have been having list of fun exploring Rebol. It has provided some valuable fresh perspectives. REBOL notes Rebol is interesting in parallel to Python because readability is also a prime design goal. http://www.rebol.org Rebol puts great emphasis on minimal simplicity of syntax and a readability from left to write which hopes to attain a pragmatic but simplified feeling, inspired by natural language such as English: >>> send somebody something >>> send edu-sig@python.org %notes_on_python.txt >>> send edu-sig@python.org read http://somesite.com/notes_on_python.html English and almost all human spoken languages are full of oddness, some more than others. But it is undeniable that a verb like 'send' is pretty universal idea, regardless of protocol, syntax, etc. Rebol's author Carl Sassenrath was formerly a bigtime Smalltalk fan and credits a mathematical theory of 'Denotational Semantics' with playing a role in the design philosophy underpinning Rebol. I know almost nothing about this yet myself, but following that thread, you might find some research, theory and metrics helpful to your Ph.D.. Denotational Semantics Understand the basic idea of calculating the meaning of a program as some element of a semantic domain. The links to papers I find: http://ase.isu.edu/ase01_07/ase01_07/bookcase/ref_sh/foldoc/9/29.htm http://www.acm.org/pubs/citations/journals/toplas/1992-14-1/p107-gudeman/ http://www.cogs.susx.ac.uk/lab/nlp/datr/datrnode17.html http://www.cis.upenn.edu/~bcpierce/types/archives/1991/msg00064.html http://ptolemy.eecs.berkeley.edu/papers/97/dataflow/ http://www.cs.unc.edu/~stotts/COMP204/assn/densem.html http://www.cogs.susx.ac.uk/local/teach/spl/list/node3.html [most are painfully academic to me, ymmv ;-)] Denotational semantics On the other hand, from the point of view of the programmer, who, in the case of real number computation, is typically a mathematician, a physicist or an engineer, representation details are mostly irrelevant. Whereas the operational semantics assigns computational mechanisms to program constructs, the denotational semantics assigns mathematical entities to them. These entities are real numbers, functions, sequences etc. I have read Python mythology interviews with Guido which refer to ABC and lessons learned from that. Hopefully there is more in the core Python design history which could help you too. hth Good Luck - Jason ----- Original Message ----- From: "Jeffrey Elkner" To: Sent: Saturday, September 29, 2001 11:47 AM Subject: [Edu-sig] measuring python... > Hi All! > > I'm trying to get together a master's thesis and was hoping to do > something related to Python's suitability as a language for teaching > programming. I was thinking of comparing Python, C++, and Java > solutions to common first year computer science problems in terms of > length and readability. > > Comparing length is not a problem. "Readability" on the other hand is > not easy to define in any quantifiable way. I was thinking of trying > something like "tokens per line". > > Any thoughts? From jasonic@nomadics.org Sun Sep 30 14:16:02 2001 From: jasonic@nomadics.org (Jason Cunliffe) Date: Sun, 30 Sep 2001 09:16:02 -0400 Subject: [Edu-sig] GracePlot References: <1001789273.2414.6.camel@robeson> <004b01c14954$66c8ca00$c3090740@jasonic> Message-ID: <08ae01c149b2$0e344f00$cc090740@megapathdsl.net> http://www.idyll.org/~n8gray/code/index.html Announcement This module provides interactive 2-D plotting capabilities via the Grace package. Why do we need yet another plotting package for Python? Simple. None of the packages out there (that I've tried) currently offer all of the following desirable properties: Designed for use at the interactive prompt Provide UI access to plot properties and allow changes on-the-fly Tight integration with Numeric Python A typical gracePlot session goes something like this: >>> from gracePlot import gracePlot >>> p = gracePlot() # A grace session opens >>> p.plot( [1,2,3,4,5], [10, 4, 2, 4, 10], [1, 0.7, 0.5, 1, 2], ... symbols=1 ) # A plot with errorbars & symbols >>> p.title('Funding: Ministry of Silly Walks') >>> p.ylabel('Funding (Pounds\S10\N)') >>> p.multi(2,1) # Multiple plots: 2 rows, 1 column >>> p.xlimit(0, 6) # Set limits of x-axis >>> p.focus(1,0) # Set current graph to row 1, column 0 >>> p.histoPlot( [7, 15, 18, 20, 21], x_min=1, ... dy=[2, 3.5, 4.6, 7.2, 8.8]) # A histogram w/errorbars >>> p.xlabel('Silliness Index') >>> p.ylabel('Applications/yr') >>> p.xlimit(0, 6) # Set limits of x-axis From urnerk@qwest.net Sun Sep 30 18:19:43 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 30 Sep 2001 10:19:43 -0700 Subject: [Edu-sig] more math with Python In-Reply-To: <08ae01c149b2$0e344f00$cc090740@megapathdsl.net> References: <1001789273.2414.6.camel@robeson> <004b01c14954$66c8ca00$c3090740@jasonic> Message-ID: <4.2.0.58.20010930092216.00c31450@pop3.norton.antivirus> A few moments of math thru programming just for the fun of it... Definition: A 'derangement' is a rearrangement of n things such that none is in its original position. Starting with 3 letters abc, the two derangements would be bca and cab. acb would be a permutation certainly, but not a derangement, since the first letter (a) didn't move. n = 3 in this case (3 things). As you would expect, as n goes higher, the number of possible derangements increases dramatically. Euler found an way to get the total number of possible derangements of n as a function of n (a breakthrough!). The formula is [1]: drs(n) = n! * [1/0! - 1/1! + 1/2! - 1/3! + ... + ((-1)^n)/n!] In other words, we have a series of fractions of the form 1/t! with alternating sign, where t=0,n. Multiply by factorial of n and you're done. Recall 0! = 1. Since 2.2a4 doesn't require worrying about overflow, we can write a simpler factorial program: >>> import operator >>> def fact(n): """ Return n! """ if n==0 or n==1: return 1 return reduce(operator.mul, range(1,n+1)) As for the fractions, many have written rational numbers modules, including me. I include a Fraction class in my mathobjects package (along with matrix and polynomial objects)[2]: >>> from mathobjects import Fraction >>> F = Fraction Fraction objects know how to perform basic operations, like addition, taking care of the common denominator issue, reducing to lowest terms, other stuff like that, behind the scenes: >>> F(1,2) + F(2,3) + F(3,7) # 1/2 + 2/3 + 3/7 (67/42) In my Math Curriculum of Tomorrow, one of the first things students get to do is write a fraction class, as it implements basic math ideas, plus is a great intro to operator overriding. And since the int vs. long dichotomy will be ever less pronounced as we move towards Python 3.0, the coding of such will just get easier. With these preliminaries out of the way, it's time for the main event: >>> def drs(n): """ Return the number of derangements of n things """ f = 0 # f: running total of fractions flip = 0 # sign changer for t in range(n+1): # t = 0 thru n if flip: f -= F(1,fact(t)) flip = 0 else: f += F(1,fact(t)) flip = 1 return fact(n) * f >>> drs(1) 0 >>> drs(2) 1 >>> drs(3) 2 >>> drs(4) 9 >>> drs(5) 44 >>> drs(6) 265 >>> drs(12) 176214841 If you don't like the 'flip' mechanism for changing sign, you might test for whether t is even or odd. t/2 has no remainder if t is even, i.e. t%2==0. So a variation of the above would be: >>> def drs(n): """ Return the number of derangements of n things """ f = 0 # f: running total of fractions for t in range(n+1): # t = 0 thru n if t%2==0: f += F(1,fact(t)) else: f -= F(1,fact(t)) return fact(n) * f Or, if you want to get even more compressed... >>> from operator import add, sub >>> def drs(n): """ Return the number of derangements of n things """ f = 0 for t in range(n+1): f = apply([add,sub][t%2],(f, F(1,fact(t))) ) return fact(n) * f (You could also improve readability by changing the name f to something else. Having f, F and fact all in play is a bit heavy on the fs -- but I'll just leave it be at this point). [1] William Dunham, 'Euler, The Master of Us All' (MAA, 1999), p. 167 [2] mathobjects package at Oregon Tips: http://www.oregon-tips.com/ under Curricula | Python Programming | Source code From humbert@hagen.de Sun Sep 30 18:59:13 2001 From: humbert@hagen.de (L. Humbert) Date: Sun, 30 Sep 2001 19:59:13 +0200 Subject: [Edu-sig] Re: Edu-sig digest, Vol 1 #407 - 9 msgs ... Msg.No 1:measuring python... References: Message-ID: <3BB75D71.10904@hagen.de> > Message: 1 > From: Jeffrey Elkner > To: edu-sig@python.org > Date: 29 Sep 2001 14:47:46 -0400 > Subject: [Edu-sig] measuring python... >=20 > Hi All! >=20 > I'm trying to get together a master's thesis and was hoping to do > something related to Python's suitability as a language for teaching > programming. I was thinking of comparing Python, C++, and Java > solutions to common first year computer science problems in terms of > length and readability. >=20 > Comparing length is not a problem. "Readability" on the other hand is > not easy to define in any quantifiable way. I was thinking of trying > something like "tokens per line". >=20 > Any thoughts? You may take a look at the contest which is documented in short form in e= nglish:=20 [Prechelt 2000a] PRECHELT, Lutz:=20 An empirical comparison of C, C++, Java, Perl, Python, Rexx and Tcl.=20 In: IEEE Computer 33 (2000), October, Nr. 10, S. 23-29. -=20 http://wwwipd.ira.uka.de/~prechelt/Biblio/jccpprt_computer2000.pdf=20 [Prechelt 2000b] PRECHELT, Lutz:=20 An empirical comparison of C, C++, Java, Perl, Python, Rexx and Tcl=20 for a search/string-processing program=20 / Fakult=E4t f=FCr Informatik, Universit=E4t Karlsruhe. Karlsruhe, March = 2000b ( 2000-5).=20 - Forschungsbericht.=20 http://wwwipd.ira.uka.de/~prechelt/Biblio/jccpprtTR.pdf=20 34 Seiten ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ Another interesting article regarding teaching informatics and look a=20 apropriate language: [B=F6sz=F6rm=E9nyi 1998] B=F6SZ=F6RM=E9NYI, L=E1szl=F3: Why Java is not m= y favorite=20 first-course language. In: Software - Concepts & Tools 19 (1998), S.=20 141-145. -=20 http://www.ifi.uni-klu.ac.at/ITEC/Publications/showabs?1998-0033-Boes [B=F6sz=F6rm=E9nyi 2001] B=F6SZ=F6RM=E9NYI, L=E1szl=F3: JAVA f=FCr Anf=E4= nger? Warum JAVA=20 nicht meine Lieblingssprache f=FCr einen Anf=E4ngerkurs ist. In: LOG IN 2= 1=20 (2001), Nr. 1, S. 14-19 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ The series from David Merz regarding functional programming [Mertz 2001a] MERTZ, David: Charming Python: Even More Functional=20 Programming in Python. In: IBM developerWorks (2001), June. - Series:=20 Charming Python 19 http://gnosis.cx/publish/tech_index.html=20 http://www-106.ibm.com/developerworks/library/l-prog3.html [Mertz 2001b] MERTZ, David: Charming Python: Functional programming in=20 Python. In: IBM developerWorks (2001), April. - Series: Charming Python=20 13 http://gnosis.cx/publish/tech_index.html=20 http://www-106.ibm.com/developerworks/library/l-prog.html [Mertz 2001c] MERTZ, David: Charming Python: More Functional Programming = in Python. In: IBM developerWorks (2001), March. - Series: Charming=20 Python 16 http://gnosis.cx/publish/tech_index.html=20 http://www-106.ibm.com/developerworks/library/l-prog2.html ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ I'm working on an article for http://seciii.cs.uni-dortmund.de/ July, 23 2002 which will be presented at the german afternoon -- so it will be in germa= n: Welche Programmiersprache unterst=FCtzt meine Konzepte f=FCr den=20 Informatikunterricht? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ The above mentioned articles where useful for me, when I was first=20 assembling material for the talk. Ludger Humbert From tim.one@home.com Sun Sep 30 21:16:06 2001 From: tim.one@home.com (Tim Peters) Date: Sun, 30 Sep 2001 16:16:06 -0400 Subject: [Edu-sig] more math with Python In-Reply-To: <4.2.0.58.20010930092216.00c31450@pop3.norton.antivirus> Message-ID: ]Kirby Urner] > ... > Euler found an way to get the total number of possible > derangements of n as a function of n (a breakthrough!). > The formula is [1]: > > drs(n) = n! * [1/0! - 1/1! + 1/2! - 1/3! + ... + ((-1)^n)/n!] Note that the sum in brackets consists of the first n+1 terms of the Taylor expansion of e**-1 around 0, so is a good approximation to 1/e (e being 2.71828..., of course). In fact, it's such a good approximation that drs(n) == round(n!/e) where round(x) rounds x to the nearest integer, for all n >= 1. An old probability teaser asks: "N gentlemen check in their hats at the country club. If the hats are given back to them at random, what's the probability that no gentleman gets back his own hat?". Because of the equality above, the probability approaches 1/e ~= 37% as N increases, and is already within spitting distance of 37% for N==4. If the students are advanced enough, it's an interesting exercise to find the smallest n for which the limitations of floating-point arithmetic cause round(n!/e) to return a different result than your exact computation using rationals. > ... > >>> def drs(n): > """ > Return the number of derangements of n things > """ > f = 0 # f: running total of fractions > flip = 0 # sign changer > for t in range(n+1): # t = 0 thru n > if flip: > f -= F(1,fact(t)) > flip = 0 > else: > f += F(1,fact(t)) > flip = 1 > return fact(n) * f And later you flipped in a different way, by testing the parity of t. A common idiom in numeric programs is to multiply by 1 or -1 instead, like so: f = 0 sign = 1 for t in range(n+1): f += sign * F(1, fact(t)) sign = -sign return fact(n) * f As a *programming* issue, it's thus interesting to consider whether F.__mul__ should or shouldn't try to recognize the special cases of multiplication by 1 and -1. There's isn't a "one size fits all" answer, so it's not for students with low tolerance for uncertainty .