From faassen@vet.uu.nl Thu Nov 1 23:34:41 2001 From: faassen@vet.uu.nl (Martijn Faassen) Date: Fri, 2 Nov 2001 00:34:41 +0100 Subject: [Edu-sig] How to Improve code performance In-Reply-To: <3BDF2778.D27942E1@fa.disney.com> References: <3BDF2778.D27942E1@fa.disney.com> Message-ID: <20011102003441.A5952@vet.uu.nl> Brent Burley wrote: [snip] > The big problem is that tab=tab+"..." in a loop is expensive since > Python must allocate a new string and copy the old one each time. The > running time will increase with the square of the number of records, > i.e. O(n*n). > > It may not be intuitive, but putting all the partial strings in a list > and then joining them at the end is more efficient as the running time > will increase only linearly with the number of records, i.e. O(n). An alternative is to use StringIO (or cStringIO if you're not dealing with unicode strings): > tab = [] > tab.append("\n") > for x in result: > tab.append("") > for y in x: > tab.extend(("\n")) > tab.append("") > tab.append("
",y,"
") > print string.join(tab, "") from StringIO import StringIO # from cStringIO import StringIO result = StringIO() result.write('\n') for x in result: result.write("") for y in x: result.write("\n") result.write("") result.write("
") result.write(y) result.write("
") print result.getvalue() For an extra speedboost you could do this on top: write = result.write and then you can just use: write(") and so on. I believe cStringIO can be even faster than the .join() operation, but I haven't timed it. Regards, Martijn From Brent.Burley@disney.com Thu Nov 1 23:59:10 2001 From: Brent.Burley@disney.com (Brent Burley) Date: Thu, 01 Nov 2001 15:59:10 -0800 Subject: [Edu-sig] How to Improve code performance References: <3BDF2778.D27942E1@fa.disney.com> <20011102003441.A5952@vet.uu.nl> Message-ID: <3BE1E1CE.7928DF0@fa.disney.com> Thanks for the input - I hadn't really thought about StringIO. Now that I've taken a look ... StringIO is no different than what I've shown - it appends each string to a list and then uses string.join to build the final result. There's also additional overhead since it must support random access file operations. cStringIO should be faster, but it might not be. It allocates a single string buffer and reallocates it to be larger whenever it runs out of room (doubling the previous size). You end up reallocating and copying the string log2(n) times. If you were building a very large string, the difference could be significant. Brent Martijn Faassen wrote: > > Brent Burley wrote: > [snip] > > The big problem is that tab=tab+"..." in a loop is expensive since > > Python must allocate a new string and copy the old one each time. The > > running time will increase with the square of the number of records, > > i.e. O(n*n). > > > > It may not be intuitive, but putting all the partial strings in a list > > and then joining them at the end is more efficient as the running time > > will increase only linearly with the number of records, i.e. O(n). > > An alternative is to use StringIO (or cStringIO if you're not dealing > with unicode strings): > > I believe cStringIO can be even faster than the .join() operation, > but I haven't timed it. From deliberatus@my995internet.com Thu Nov 8 18:52:22 2001 From: deliberatus@my995internet.com (Kirk Bailey) Date: Thu, 08 Nov 2001 13:52:22 -0500 Subject: [Edu-sig] Just signed up Message-ID: <3BEAD466.708B5497@my995internet.com> for the list, I want to learn python and write a few things. Even willing later to help people learn it. Tried banging my poor head against perl for a spell, all I got was camel cooties... -- Respectfully, -Kirk D Bailey (C)2001 Addme! icq #27840081 end My Sites: http://www.howlermonkey.net/ - free REAL email! list service soon! http://www.sacredelectron.org/ - Rants! Spleenvents! http://www.minorfish.org/ - The list server for some of us! From dyoo@hkn.eecs.berkeley.edu Thu Nov 8 20:48:31 2001 From: dyoo@hkn.eecs.berkeley.edu (Danny Yoo) Date: Thu, 8 Nov 2001 12:48:31 -0800 (PST) Subject: [Edu-sig] Just signed up In-Reply-To: <3BEAD466.708B5497@my995internet.com> Message-ID: On Thu, 8 Nov 2001, Kirk Bailey wrote: > for the list, I want to learn python and write a few things. Even > willing later to help people learn it. Tried banging my poor head > against perl for a spell, all I got was camel cooties... Hi Kirk, Welcome! There's a section on Python.org for newcomers to the Python language: http://python.org/doc/Newbies.html and it has quite a few tutorials there that you can look at. The Edu-sig mailing list is for educational issues, such as school curricula and the Computer Programming For Everyone (CP4E) project; it might not be the best place to ask "newbie" questions on Python. Instead, you may find the Tutor mailing list a good place to ask questions: http://mail.python.org/mailman/listinfo/tutor Best of wishes to you. From wilson@visi.com Thu Nov 15 02:49:17 2001 From: wilson@visi.com (Timothy Wilson) Date: Wed, 14 Nov 2001 20:49:17 -0600 (CST) Subject: [Edu-sig] Teaching students to use CVS Message-ID: Hi everyone, I'm a little more than 1/4 of the way through my Intro. to Comp. Prog. class and we're starting to get into slightly more complicated assignments. (Well maybe we're not quite there yet.) Anyway, I'd like to have a way for my programming teams to collaborate on their code. Has anyone tried teaching beginning comp. prog. students to use CVS? It would be easy enough to drag out an old server and set it up for this purpose. Any hints or experiences that anyone would share? -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 jstraw@resample.com Thu Nov 15 03:17:58 2001 From: jstraw@resample.com (Jason Straw) Date: 14 Nov 2001 22:17:58 -0500 Subject: [Edu-sig] Teaching students to use CVS In-Reply-To: <1005794151.22209.8.camel@jlaptop.towhee.com> References: <1005794151.22209.8.camel@jlaptop.towhee.com> Message-ID: <1005794278.19763.11.camel@jlaptop.towhee.com> They don't seem to have a problem with it... BUT i could never get it to work remotely... so it was never useful to them.. but i had them grabbing programs anon. cvs from sourceforge (pyios.sf.net) Jason On Wed, 2001-11-14 at 21:49, Timothy Wilson wrote: > Hi everyone, > > I'm a little more than 1/4 of the way through my Intro. to Comp. Prog. class > and we're starting to get into slightly more complicated assignments. (Well > maybe we're not quite there yet.) > > Anyway, I'd like to have a way for my programming teams to collaborate on > their code. Has anyone tried teaching beginning comp. prog. students to use > CVS? It would be easy enough to drag out an old server and set it up for this purpose. > > Any hints or experiences that anyone would share? > > -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 > > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig -- Jason Straw jstraw@resample.com jstraw@ibiblio.org Yorktown High School Linux Users' Group Meetings Coordinator / yhslug.tux.org Upcoming Meetings! October 5th: LTSP From dustin@cs.uchicago.edu Thu Nov 15 03:21:02 2001 From: dustin@cs.uchicago.edu (Dustin Mitchell) Date: Wed, 14 Nov 2001 21:21:02 -0600 (CST) Subject: [Edu-sig] Teaching students to use CVS In-Reply-To: Message-ID: On Wed, 14 Nov 2001, Timothy Wilson wrote: > Hi everyone, > > I'm a little more than 1/4 of the way through my Intro. to Comp. Prog. class > and we're starting to get into slightly more complicated assignments. (Well > maybe we're not quite there yet.) > > Anyway, I'd like to have a way for my programming teams to collaborate on > their code. Has anyone tried teaching beginning comp. prog. students to use > CVS? It would be easy enough to drag out an old server and set it up for > this purpose. > > Any hints or experiences that anyone would share? Dave Beazley, author of Python Essential Reference and University of Chicago Assistant Professor, uses CVS for most of his advanced-level undergraduate courses. It's worked out pretty well. His course material is available from his website, http://systems.cs.uchicago.edu/~beazley/, including a quick overview of CVS. Basically he gives students the common syntaxes, and sends them to the manpages for more. But nearly all of the courses in that department are "read the manpage or fail" classes. If you're using Windoze, WinCVS may be an option -- it's not too complicated to learn, and saves a lot on all that syntax you need for the UNIX 'cvs' command. Dustin -- Dustin Mitchell dustin@cs.uchicago.edu dustin@ywlcs.org From dethe@burningtiger.com Thu Nov 15 03:54:47 2001 From: dethe@burningtiger.com (Dethe Elza) Date: Wed, 14 Nov 2001 19:54:47 -0800 Subject: [Edu-sig] Teaching students to use CVS References: Message-ID: <3BF33C87.4020504@burningtiger.com> Hi Tim, I haven't tried teaching CVS to students, just co-workers, but when I discovered it my first thoughts were, "I wish someone had showed me this in school, it would have saved me a LOT of time and trouble." Too many times of overwriting my working version in the heat of coding, or accidently deleting the work I'd struggled so long with because I was too tired to know what I was doing. I would often save everything into a dated directory, but there was no context to it, so if I did have to go back to an older version (assuming I'd saved the one I ended up needing, which was rare), I had few clues to which one. CVS has its faults, but it's orders of magnitude better than not using any revision system at all. And after struggling with the idiosyncracies of SourceSafe I liked CVS even more %-) So, no real tips, but I think it's a great idea. --Dethe -- Dethe Elza (delza@burningtiger.com) Chief Mad Scientist Burning Tiger Technologies (http://burningtiger.com) Living Code Weblog (http://livingcode.ca) From wilson@visi.com Thu Nov 15 04:19:40 2001 From: wilson@visi.com (Timothy Wilson) Date: Wed, 14 Nov 2001 22:19:40 -0600 (CST) Subject: [Edu-sig] Teaching students to use CVS In-Reply-To: <3BF33C87.4020504@burningtiger.com> Message-ID: On Wed, 14 Nov 2001, Dethe Elza wrote: > I haven't tried teaching CVS to students, just co-workers, but when I > discovered it my first thoughts were, "I wish someone had showed me this > in school, it would have saved me a LOT of time and trouble." Well I think CVS is probably overkill at this stage, but I thought I could teach it to them now so when we get to more complicated projects (/me crosses fingers ) they would be comfortable with the idea. I was reminding them today how I hoped that they would learn good development practices and not just Python syntax. I think getting a handle on CVS would qualify. :-) -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 Jason Cunliffe" This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C16DFF.F2D4B980 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit http://www.levitated.net/ ..lovely openSource Flash5 generative art site, well designed interface ./Jason ------=_NextPart_000_0005_01C16DFF.F2D4B980 Content-Type: application/octet-stream; name="Levitated Tile.url" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Levitated Tile.url" [DEFAULT] BASEURL=http://www.levitated.net/ [InternetShortcut] URL=http://www.levitated.net/ Modified=6080A047296EC10120 ------=_NextPart_000_0005_01C16DFF.F2D4B980-- From kimtitu@yahoo.com Fri Nov 16 00:51:16 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Thu, 15 Nov 2001 16:51:16 -0800 (PST) Subject: [Edu-sig] print to apache log from cgi script Message-ID: <20011116005116.41958.qmail@web14702.mail.yahoo.com> Hi, How can i output some message apache log files so i can see the progress in cgi script? If i use regular print, cgi prints the content to client browser. Thanks for any suggestion. Regards, Kim Titu __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com From schoen@loyalty.org Fri Nov 16 01:05:48 2001 From: schoen@loyalty.org (Seth David Schoen) Date: Thu, 15 Nov 2001 17:05:48 -0800 Subject: [Edu-sig] print to apache log from cgi script In-Reply-To: <20011116005116.41958.qmail@web14702.mail.yahoo.com> References: <20011116005116.41958.qmail@web14702.mail.yahoo.com> Message-ID: <20011115170548.W15060@zork.net> Titu Kim writes: > Hi, > How can i output some message apache log files so i > can see the progress in cgi script? If i use regular > print, cgi prints the content to client browser. > > Thanks for any suggestion. With many Unix web servers like Apache, writing data to standard error instead of standard output results in its being logged instead of transmitted to the client. You can write things to standard error by doing something like import sys # # ... # sys.stderr.write("hello there from my CGI script.\n") These errors are written _directly_ into the Apache error log for the appropriate virtual host, which means they will be intermingled with things like HTTP errors. That might not be what you want; it could be better to open your own log file from within your CGI script, using the "open" file, and write the data directly into your private log file instead. Questions about things like this might be more appropriate on some other list, although I'm not sure which one. -- Seth David Schoen | Its really terrible when FBI arrested Temp. http://www.loyalty.org/~schoen/ | hacker, who visited USA with peacefull down: http://www.loyalty.org/ (CAF) | mission -- to share his knowledge with http://www.freesklyarov.org/ | american nation. (Ilya V. Vasilyev) From kimtitu@yahoo.com Fri Nov 16 01:22:45 2001 From: kimtitu@yahoo.com (Titu Kim) Date: Thu, 15 Nov 2001 17:22:45 -0800 (PST) Subject: [Edu-sig] print to apache log from cgi script In-Reply-To: <20011115170548.W15060@zork.net> Message-ID: <20011116012245.43683.qmail@web14703.mail.yahoo.com> Thanks Schoen, I am trying to find a mailing list such as web programming related. If anybody knows one, please do not hesitate to tell me. Kim TItu --- Seth David Schoen wrote: > Titu Kim writes: > > > Hi, > > How can i output some message apache log files > so i > > can see the progress in cgi script? If i use > regular > > print, cgi prints the content to client browser. > > > > Thanks for any suggestion. > > With many Unix web servers like Apache, writing data > to standard error > instead of standard output results in its being > logged instead of > transmitted to the client. > > You can write things to standard error by doing > something like > > import sys > # > # ... > # > sys.stderr.write("hello there from my CGI > script.\n") > > These errors are written _directly_ into the Apache > error log for the > appropriate virtual host, which means they will be > intermingled with > things like HTTP errors. That might not be what you > want; it could be > better to open your own log file from within your > CGI script, using > the "open" file, and write the data directly into > your private log > file instead. > > Questions about things like this might be more > appropriate on some > other list, although I'm not sure which one. > > -- > Seth David Schoen | Its really > terrible when FBI arrested > Temp. http://www.loyalty.org/~schoen/ | hacker, who > visited USA with peacefull > down: http://www.loyalty.org/ (CAF) | mission -- > to share his knowledge with > http://www.freesklyarov.org/ | american > nation. (Ilya V. Vasilyev) > > _______________________________________________ > Edu-sig mailing list > Edu-sig@python.org > http://mail.python.org/mailman/listinfo/edu-sig __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com From urnerk@qwest.net Fri Nov 16 01:34:16 2001 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 15 Nov 2001 17:34:16 -0800 Subject: [Edu-sig] Re: Levitated Tile In-Reply-To: <000801c16e29$dc5a3b60$0301060a@vaio> Message-ID: <4.2.0.58.20011115172935.00c965e0@pop3.norton.antivirus> At 06:04 PM 11/15/2001 -0500, Jason Cunliffe wrote: >http://www.levitated.net/ > >..lovely openSource Flash5 generative art site, well designed interface > > >./Jason Yes, this is excellent. People with slower connections don't like "swoopy" sites, but this shows how "swoopy" is NOT synonymous with frivolous graphics, as here we're animating interesting math-related ideas dynamically, with the powerful Flash 5 package. Inspired by the Lorentz Attractor demo, I adapted the code (with source cited/credited) to work with my pre-existing coords.py and povray.py modules (freely downloadable and used extensively at my math-through-programming teaching site). Here's the URL, with the resulting graphic up top (nothing stunning): http://www.inetarena.com/~pdx4d/ocn/lorentz.html Gratifying to get something visual with so little code, as with the fractal obtained earlier (linked in the 'For Further Reading' section at bottom). Thanks again, Jason -- you're good at mining the web, a fine art in itself. Kirby Curriculum writer Oregon Curriculum Network & Oregon-Tips Python Curriculum From djrassoc01@mindspring.com Fri Nov 16 06:02:30 2001 From: djrassoc01@mindspring.com (Dr. David J. Ritchie, Sr.) Date: Fri, 16 Nov 2001 00:02:30 -0600 Subject: [Edu-sig] Teaching Python to Middle School students... References: <4.2.0.58.20011115172935.00c965e0@pop3.norton.antivirus> Message-ID: <3BF4ABF5.A76783E6@mindspring.com> [I have posted this information to comp.lang.python and also to the analogous Perl newsgroup. Sorry for the repetition if you follow both groups but I was told that the information should also go to this list.] By the way, I have just started teaching Python to students in a middle school computer club. It's going very well. Having done a similar thing for Perl over the past several years, I decided to try to do it for Python. I have put my perl handouts for the middle school kids up on my web site: http://home.mindspring.com/~djrassoc01/ After I have had a chance to classroom test and refine my Python handouts, it is likely that they will show up there as well. -- Dr. David J. Ritchie, Sr. djrassoc01@mindspring.com http://home.mindspring.com/~djrassoc01/ From recip@a1-online-marketing-advertising.com Mon Nov 26 00:23:17 2001 From: recip@a1-online-marketing-advertising.com (Gloria) Date: Sun, 25 Nov 2001 19:23:17 -0500 Subject: [Edu-sig] Reciprocal Links Message-ID: <200111251920.23w9r9A@192.168.0.2>
I have reviewed your site and feel that it is of an excellent quality compared to many on the net.

We are looking for sites with which we can trade reciprocal links. Our site is called
A1 Online Marketing Advertising and deals with marketing, advertising and web design.

It is a perfect complement to your site as it will assist your visitors in marketing their companies. By linking to us, you would provide your visitors a way to find a site they would likely find interesting, thus enhancing their experience at "your" site.

Our search engine, which will contain your link, operates on a 6:5 ratio. For every 5 unique click-throughs we receive from you, we pass 6 back. This ensures that you always have a constant, fresh source of traffic.

Further, many search engines such as Google, Inktomi and Altavista include reciprocal linking as part of their algorithm. By exchanging links, you will be able to get listed higher in their search results.

Please go to our search engine to add your site and find details on how to link to us.

Thank you,

Gloria Hammond

From urnerk@qwest.net Mon Nov 26 07:10:47 2001 From: urnerk@qwest.net (Kirby Urner) Date: Sun, 25 Nov 2001 23:10:47 -0800 Subject: [Edu-sig] more math with Python In-Reply-To: <4.2.0.58.20010930092216.00c31450@pop3.norton.antivirus> References: <08ae01c149b2$0e344f00$cc090740@megapathdsl.net> <1001789273.2414.6.camel@robeson> <004b01c14954$66c8ca00$c3090740@jasonic> Message-ID: <4.2.0.58.20011125225854.00c1a220@pop3.norton.antivirus> Here's somethin' I wrote to compute e. Uses 2.2's ability to go with long integers on the fly, no explicit conversion needed: def gete(d): "Return the value of e with d digits" i = n = 1 # approx number of terms needed terms = int(math.ceil(d * 4/math.log10(d))) e = val = 10**terms while i < terms: n *= i e += val/n i += 1 val = str(e) return val[0]+"."+val[1:d] Usage: >>> numb.gete(600) '2.718281828459045235360287471352662497757247093699959574966967627724 076630353547594571382178525166427427466391932003059921817413596629043 572900334295260595630738132328627943490763233829880753195251019011573 834187930702154089149934884167509244761460668082264800168477411853742 345442437107539077744992069551702761838606261331384583000752044933826 560297606737113200709328709127443747047230696977209310141692836819025 515108657463772111252389784425056953696770785449969967946864454905987 931636889230098793127736178215424999229576351482208269895193668033182 52886939849646510582093923982948879332036250944311' I checked it against a web page going for thousands more digits. So far so good. :-D The approximation re terms needed, given request for d digits, could probably use some fine tuning no doubt. The approach uses the fact that e = 1/0! + 1/1! + 1/2! + 1/3!... but with every term multiplied by 100000000000000000000000000000000... or whatever so that computations all happen in positive long integer world. The final step is simply to take the digits in string form, and stick in a decimal point after the 2. Kirby From bembry@bembry.org Thu Nov 29 17:30:13 2001 From: bembry@bembry.org (Bryce Embry) Date: Thu, 29 Nov 2001 11:30:13 -0600 Subject: [Edu-sig] Student Assignment Styles Message-ID: <5.1.0.14.0.20011129111614.00aba460@bembry.org> Howdy, I'm in my first year of teaching computer programming in Python and am developing my material based on the How To Think Like A Computer Scientists book at www.ibiblio.org/obp. I have to confess that I fell into teaching computer programming without any formal training, and I'm learning a lot of the material as we go along (I'm a few steps ahead of the students, but not far). Looking through some of the edu_sig posts, and Timothy Wilson's page at http://www.isd197.org/sibley/cs/icp/, I'm seeing that assigning students a large project seems to be more popular than assigning a number of smaller, more pedantic problems. What is the rationale behind the larger projects as opposed to smaller projects? What are the benefits and drawbacks of asking students to spend a week on one large project instead of that same week on three or four smaller tasks, then giving a large task once a month or so? I've been using what I consider to be smaller projects (my stuff is at http://www.bembry.org/tech/python/index.shtml ) and am wondering if fewer, larger projects would be better for my kids. ----------------------------------------------------------------------------------------- Bryce Embry --- Geek of All Trades, Master of None --- Margolin Hebrew Academy --- 390 South White Station --- Memphis, TN 38117 --- (901) 682-2409 From wilson@visi.com Thu Nov 29 18:06:58 2001 From: wilson@visi.com (Timothy Wilson) Date: Thu, 29 Nov 2001 12:06:58 -0600 (CST) Subject: [Edu-sig] Student Assignment Styles In-Reply-To: <5.1.0.14.0.20011129111614.00aba460@bembry.org> Message-ID: On Thu, 29 Nov 2001, Bryce Embry wrote: > Looking through some of the edu_sig posts, and Timothy Wilson's page at > http://www.isd197.org/sibley/cs/icp/, I'm seeing that assigning students a > large project seems to be more popular than assigning a number of smaller, > more pedantic problems. I did many more small assignments at the beginning of the year--little functions for programs that could be completed in twenty minutes or so. Now that my students have been exposed to most of the Python syntax, I have them working on larger assignments that are really just a bunch of little ones glued together. Plus, the larger projects tend to be more interesting for the students. > I've been using what I consider to be smaller projects (my stuff is at > http://www.bembry.org/tech/python/index.shtml ) and am wondering if fewer, > larger projects would be better for my kids. Thanks for the link. I'm always interested to see what other teachers are doing. -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 Nora Wirtschafter Thu Nov 29 18:22:24 2001 From: Nora Wirtschafter (Nora Wirtschafter) Date: Thu, 29 Nov 2001 13:22:24 -0500 (EST) Subject: [Edu-sig] Who is teaching Python?? Message-ID: <4420476.1007058144616.JavaMail.sainad@sage.edu> ------=_Part_9598_3991677.1007058144615 Content-Type: text/plain Content-Transfer-Encoding: 7bit Dear Colleagues, I am teaching Python at Widener University, Chester, PA, in CSCI 131, an elective science course for non-computer science majors. I am interested in knowing what other colleges, two- or four-year, are using Python as a teaching language. Is Python offered at different levels in the curriculum? Computer Science majors at Widener use C as their beginning language; what language do your CS majors use as a start? I am also interested in what texts you find appropriate (I have developed my own materials.) Thank you for any responses. Nora W. Wirtschafter, Instructor Widener University nww0002@mail.widener.edu ------=_Part_9598_3991677.1007058144615-- From jhrsn@pitt.edu Thu Nov 29 18:46:13 2001 From: jhrsn@pitt.edu (Jim Harrison) Date: Thu, 29 Nov 2001 13:46:13 -0500 Subject: [Edu-sig] Who is teaching Python?? In-Reply-To: <4420476.1007058144616.JavaMail.sainad@sage.edu> Message-ID: on 11/29/01 1:22 PM, Nora Wirtschafter at nww0002@mail.widener.edu wrote: > I am interested in knowing what other colleges, two- or four-year, are using > Python as a teaching language. Our graduate course in introductory programming for Medical Informatics uses Python. Information is available at: http://jhh.cbmi.upmc.edu/pop/ Jim Harrison ________________________________________________________________________ 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 jeff@elkner.net Thu Nov 29 18:59:56 2001 From: jeff@elkner.net (Jeffrey Elkner) Date: 29 Nov 2001 13:59:56 -0500 Subject: [Edu-sig] Student Assignment Styles In-Reply-To: <5.1.0.14.0.20011129111614.00aba460@bembry.org> References: <5.1.0.14.0.20011129111614.00aba460@bembry.org> Message-ID: <1007060396.12501.4.camel@mdeicaza> Hi Bryce! What I do first is assign small exercises from each chapter, and then assign a big project. I am using Tim's projects this year, and that has been a *BIG* help. (this collaboration thing is really working! ;-) Not all of the chapters in the text book have enough exercises, which is something I hope will be able to remedy in the next few weeks. There are two very good reasons for doing bigger projects: 1. The ability to write meaningful programs should be a primary teaching goal. Academic programs have often come under criticism by industry for not preparing students for "real world" programming. There is a natural tendancy in academia to focus on small examples that make the concept transparent without confusing learners with extraneous details. The problem is students come away with no understanding of the software development process itself. Their learning doesn't scale up to bigger problems. This is also the motivation for the case study now used in the Advanced Placeement program. 2. Big projects are Cool! My experience is that students like them because they solve more interesting problems. Tim is doing a great job of picking projects that my students enjoy doing (thanks again, Tim!) jeff elkner yorktown high school arlington, va On Thu, 2001-11-29 at 12:30, Bryce Embry wrote: > Howdy, > I'm in my first year of teaching computer programming in Python and am > developing my material based on the How To Think Like A Computer Scientists > book at www.ibiblio.org/obp. I have to confess that I fell into teaching > computer programming without any formal training, and I'm learning a lot of > the material as we go along (I'm a few steps ahead of the students, but not > far). > > Looking through some of the edu_sig posts, and Timothy Wilson's page at > http://www.isd197.org/sibley/cs/icp/, I'm seeing that assigning students a > large project seems to be more popular than assigning a number of smaller, > more pedantic problems. What is the rationale behind the larger projects as > opposed to smaller projects? What are the benefits and drawbacks of asking > students to spend a week on one large project instead of that same week on > three or four smaller tasks, then giving a large task once a month or > so? I've been using what I consider to be smaller projects (my stuff is at > http://www.bembry.org/tech/python/index.shtml ) and am wondering if fewer, > larger projects would be better for my kids. > > > ----------------------------------------------------------------------------------------- > Bryce Embry > --- Geek of All Trades, Master of None > --- Margolin Hebrew Academy > --- 390 South White Station > --- Memphis, TN 38117 > --- (901) 682-2409 From jeff@elkner.net Thu Nov 29 19:12:24 2001 From: jeff@elkner.net (Jeffrey Elkner) Date: 29 Nov 2001 14:12:24 -0500 Subject: [Edu-sig] Student Assignment Styles In-Reply-To: <5.1.0.14.0.20011129111614.00aba460@bembry.org> References: <5.1.0.14.0.20011129111614.00aba460@bembry.org> Message-ID: <1007061144.12501.6.camel@mdeicaza> Hello again, Bryce! I just took a look at your site and it looks nice! I would like to ask two favors: 1. Can we list you on the list of schools page? http://www.ibiblio.org/obp/pyBiblio/schools.php If that is okay, please send a paragram describing your school/program to Lex Berezhny: lex@berezhny.net 2. Can I put your exercises/nots on the pyBiblio site as well? My hope is that by leveraging the sharing and collaboration made possible by free content and the web we can both enhance student learning and reduce our work load at the same time. I put more hours than I can remember into working on the text book (it was fun), but I'm glad now that Tim is writing up interesting projects, so I don't have to do that. The more materials we can get on the site the easier it will be for other teachers to use Python. Thanks! jeff elkner yorktown high school arlington, va On Thu, 2001-11-29 at 12:30, Bryce Embry wrote: > (my stuff is at > http://www.bembry.org/tech/python/index.shtml ) > > Bryce Embry > --- Geek of All Trades, Master of None > --- Margolin Hebrew Academy > --- 390 South White Station > --- Memphis, TN 38117 > --- (901) 682-2409 From urnerk@qwest.net Thu Nov 29 19:13:45 2001 From: urnerk@qwest.net (Kirby Urner) Date: Thu, 29 Nov 2001 11:13:45 -0800 Subject: [Edu-sig] Student Assignment Styles In-Reply-To: <1007060396.12501.4.camel@mdeicaza> References: <5.1.0.14.0.20011129111614.00aba460@bembry.org> <5.1.0.14.0.20011129111614.00aba460@bembry.org> Message-ID: <4.2.0.58.20011129111256.019f7df0@pop3.norton.antivirus> > >2. Big projects are Cool! My experience is that students like them >because they solve more interesting problems. Tim is doing a great job >of picking projects that my students enjoy doing (thanks again, Tim!) Yeah, I liked doing the weather one. Kirby From dyoo@hkn.eecs.berkeley.edu Fri Nov 30 01:23:26 2001 From: dyoo@hkn.eecs.berkeley.edu (Danny Yoo) Date: Thu, 29 Nov 2001 17:23:26 -0800 (PST) Subject: [Edu-sig] Who is teaching Python?? In-Reply-To: <4420476.1007058144616.JavaMail.sainad@sage.edu> Message-ID: On Thu, 29 Nov 2001, Nora Wirtschafter wrote: > I am interested in knowing what other colleges, two- or four-year, are > using Python as a teaching language. Is Python offered at different > levels in the curriculum? Computer Science majors at Widener use C as > their beginning language; what language do your CS majors use as a > start? I am also interested in what texts you find appropriate (I > have developed my own materials.) Hi Nora, UC Berkeley uses the Scheme language in its introductory course "CS61A": http://inst.eecs.berkeley.edu/~cs61a/ The course uses "The Structure and Interpretation of Computer Programs" as the main textbook: http://mitpress.mit.edu/sicp/ Hope this helps! From urnerk@qwest.net Fri Nov 30 08:42:17 2001 From: urnerk@qwest.net (Kirby Urner) Date: Fri, 30 Nov 2001 00:42:17 -0800 Subject: [Edu-sig] More fun with Euler's Number In-Reply-To: <4.2.0.58.20011125225854.00c1a220@pop3.norton.antivirus> References: <4.2.0.58.20010930092216.00c31450@pop3.norton.antivirus> <08ae01c149b2$0e344f00$cc090740@megapathdsl.net> <1001789273.2414.6.camel@robeson> <004b01c14954$66c8ca00$c3090740@jasonic> Message-ID: <4.2.0.58.20011129235051.00948ef0@pop3.norton.antivirus> > >The approximation re terms needed, given request for d digits, could >probably use some fine tuning no doubt. Here's another stab at generating e to more-than-we-usually-get decimals. There's this algebraic transformation, which I haven't quite figured out yet, that lets you rewrite 1 + 1/1! + 1/2! + 1/3! + 1/4! + 1/5! as 1+(1+(1+(1+(1+1/5)/4)/3)/2)/1. This translates into a very simple algorithm for e (see below), used by Jean-Michel Ferrard in a program for the TI (calculator). He manages to get 600 significant digits out of the thing (a TI-92 or 89). But this algorithm requires knowing in advance how many terms you need in order to produce n significant digits. Jean-Michel knows 294 is the magic number for 600 digits, but the best approximation I was able to find, for the number of terms, was here: http://numbers.computation.free.fr/Constants/E/e.html where is written: "To have d decimal digits of e, the first K ~ d log(10)/log(d) terms of the series are sufficient" (Section 7). But that's approximate, and it doesn't work for a lot of the values of d that I try. My earlier approach was to boost it higher -- but how much higher would I need to go? I went too far. If we're really not sure in advance how many terms to compute, how do we stop from running through too many? I thought a good way to apply the brakes would be to check the least significant bits of the long integer being completed, and to say "if these bits don't change through 10 iterations, then we're done". I also go to a few digits beyond what the user requests, for good measure, but only display the number of decimals (= terms) actually asked for. Here's a program implementing this strategy, along with a different form of the algorithm derived in Section 4 of the above web resource. def gete(terms): e = 10 ** (terms + 5) sig = u = n = 1 cnt = 0 while cnt < 10: e = (e * (u+1))//u u = (n+1)*(u+1) n += 1 leastsig = e & 1111 if leastsig == sig: cnt += 1 else: sig = leastsig cnt = 0 se = str(e) return se[0]+"."+se[1:terms+1] I asked for the first 6000 digits of e, and was able to compare them with an online resource to ascertain my result indeed ended with the right digits: ...6110250517100 It goes through about 2090 iterations to reach the terminal condition, whereas the log formula would suggest 1588. Takes about 50 seconds to complete on my 1.2 Ghz AMD w/ 640 MB RAM (ymmv). However, now that I know I should use about 2090 iterations, if I use the algorithm in Jean-Michel Ferrard's paper (it was emailed to me -- not on the web AFAIK), then I get 6000 digits in a blindingly short time, under 1 second! Sheesh, that's a *huge* difference. Here's that algorithm: def gete2(): "Return the value of e with 6000 digits" u = x = 10**6000 for k in range(2090,0,-1): u = x + u//k return str(u) Clearly, knowing the number of terms in advance, and using the above (which implements the algebraic transformation I mention up top), is the superior method, by a long shot. I need to get a better grip on this "knowing how many terms in advance" issue. Of course none of these methods are what the professionals are using to compute e to millions or billions of digits. That's a whole other ballgame, using 'binary splitting' and the like (involves Fourier Transforms -- 'Who is Fourier?'). Still, this game is fun enough, if not ground-breaking (and it's educational). Kirby From rkr_ii@yahoo.com Fri Nov 30 20:21:46 2001 From: rkr_ii@yahoo.com (Robert Rickenbrode II) Date: Fri, 30 Nov 2001 15:21:46 -0500 Subject: [Edu-sig] RealTimeBattle and Python Message-ID: <5.0.2.1.0.20011130151951.00a875a0@pop.mail.yahoo.com> Anyone have any experience using RealTimeBattle (http://realtimebattle.sourceforge.net/) with Python? Just a consideration... Robert K. Rickenbrode II rkr_ii@yahoo.com