Re: [Edu-sig] Code to Joy in The Economist (June/July 2018)

2018-06-03 Thread David Handy
If you have two buckets, bucket A and bucket B, and you put a fish into bucket 
A, a fish does not magically appear in bucket B also.

>>> bucket_a = []
>>> bucket_b = []
>>> bucket_a.append('fish')
>>> bucket_b
[]

But, if you have only one bucket with two labels on it, bucket A and bucket B, 
then when you use label A to put a fish into the bucket, and then use label B 
to look at the bucket, you will see that same fish.

>>> bucket_a = []
>>> bucket_b = bucket_a
>>> bucket_a.append('fish')
>>> bucket_b
['fish']

This is a crucial conceptual understanding our students must gain or they will 
experience endless frustration trying to debug their programs, not 
understanding the behavior. Whether they use DreamWeaver or some other editor, 
this is relevant.

David H

 
On Sunday, June 3, 2018 11:39am, "Carl Karsten"  said:



> That doesn't tell me how postit notes are different from buckets.
> 
> I get the python side, I don't get how the analogies are different.
> 
> I am also not sure the target audience comes to the conclusions about
> implementation you all seem worried about. Hmm, implementation may
> not be the right word, I think that's not abstract enough.
> 
> If you are talking to a seasoned C programmer that understands what
> "int a" does, then sure, tell him how Python is different.
> 
> If you are talking to someone who wants to use Dreamweaver to edit
> code, I am sceptical that spending time on this is a good idea.
> 
> One of the biggest problems I have at Office Hours is spending so much
> time talking about tangents that we run out of time to finish the
> original topic. I somewhat expect that the tangents are equally
> helpful, so I am not too worried about it. But if you are working
> up a curriculum or lesson plan or whatever, I question what things
> should be included.
> 
> 
> 
> On Sun, Jun 3, 2018 at 8:50 AM, Naomi Ceder  wrote:
> > As Kirby says, of course the data does go somewhere, and that "somewhere"
> > could be thought of as a container. But "creating" a variable name in Python
> > doesn't in itself create a container. A lot of beginners will assume that:
> > a = 1
> > a = b = c
> > will actually create three objects, (or containers, or buckets). This leads
> > to a flawed mental model of what Python actually does, with unexpected
> > results for mutable types.
> >
> > Cheers,
> > Naomi
> >
> > On Sun, 3 Jun 2018 at 13:56, Carl Karsten 
> wrote:
> >>
> >> > But you are totally right, Kirby - we've got to get him off of this
> >> > notion of variables as containers. "Post-its, not buckets" is the
> way I put
> >> > it, but I rather like the luggage tag metaphor as well.
> >>
> >> You lost me here. What's wrong with bucket?
> >>
> >>
> >> On Sat, Jun 2, 2018 at 3:25 PM, Naomi Ceder 
> wrote:
> >> > It is a lovely article. Andrew Smith was at PyCon and I had dinner
> with
> >> > him
> >> > and Nicholas one evening and also sat down and chatted with Andrew
> on a
> >> > couple of other occasions.
> >> >
> >> > He's a smart guy and a likable one, and he is very taken with coding
> in
> >> > general, Python in particular, and especially the Python community,
> and
> >> > he
> >> > plans to keep going beyond just that article. I fully expect we'll
> see
> >> > and
> >> > hear more of Andrew Smith's adventures with Python over the coming
> year
> >> > or
> >> > two.
> >> >
> >> > But you are totally right, Kirby - we've got to get him off of this
> >> > notion
> >> > of variables as containers. "Post-its, not buckets" is the way I put
> it,
> >> > but
> >> > I rather like the luggage tag metaphor as well.
> >> >
> >> > And for those of us who are geeks "of a certain age" I can also
> >> > recommend
> >> > his book Moondust, which is the story of him tracking down and
> talking
> >> > to
> >> > all of the surviving Apollo astronauts in the early 2000's.
> >> >
> >> > Cheers,
> >> > Naomi
> >> >
> >> > On Sat, 2 Jun 2018 at 15:13, kirby urner
>  wrote:
> >> >>
> >> >>
> >> >>
> >> >> One of my screen scraper friends (always reading) just forwarded
> this
> >> >> link:
> >> >>
> >> >> https://www.1843magazine.com/features/code-to-joy
> >> >>
> >> >> A highly literate middle aged writer tackles programming from
> zero and
> >> >> winds up in Python after a pilgrimmage through Javascript, and
> uses the
> >> >> Twitter API. He meditates on what learning to code might mean
> to a
> >> >> fully
> >> >> developed adult such as himself (connects to Andragogy **).
> >> >>
> >> >> Nicholas Tollervey, sometime edu-sig poster and Micro:bit
> avatar, is
> >> >> very
> >> >> much a hero in this story, living up to the ideal of a
> Pythonista as
> >> >>
> >> >> (A) not religiously dogmatic (re "language wars") yet
> >> >> (B) having enthusiasm for sharing Python (without too much
> >> >> proselytizing).
> >> >>
> >> >> Bravo on a stellar performance!
> >> >>
> >> >> Quincy Larson of freeCodeCamp fame is another champion of
> openness and
> >> >> accessibility (and good advice). I get his emails in

Re: [Edu-sig] Browser-based instruction

2017-10-03 Thread David Handy

Does it really have to run in a browser?
 
When I read your requirements, that students be able to run on a public 
computer that they do not own, yet keep their files from one session to 
another, I thought maybe running Python off of a USB stick, and saving their 
programs back onto that USB stick, would meet your requirements. It would have 
the advantage of not locking your students into a particular online service nor 
requiring Internet service to function. Yet you could write programs that 
access web services, install packages from PyPI, etc.
 
At first I was going to point you to Portable Python: [ 
http://portablepython.com/ ]( http://portablepython.com/ )
 
But it has been years since I used it. Going to their website just now, I found 
it it now says:


"Portable Python is not being developed anymore. At the moment there are 
several better and more up-to-date alternatives"
 
There are links to other alternatives of complete Python distributions that can 
run off of a USB stick, none of which I have tried personally.
 
Just something to consider.
 
David H
 
On Monday, October 2, 2017 1:58pm, "Catherine Devlin" 
 said:



Hi, educators,
I'm thinking of teaching classes at our public library for folks who may or may 
not own their own computers.  To that end, I'm trying to figure out the best 
way to provide them a hosted Python environment.

The platform of my dreams would
- Let them write and keep their scripts long-term
- Allow installation of packages from PyPI
- Not restrict outgoing web traffic - for instance, consuming web APIs is great 
for student projects, but many online environments restrict that use

I don't know what's the closest to my dreams, but if anybody has relevant 
experience, I'd love to hear about it.
Thanks!-- 

- Catherine
[ http://catherinedevlin.blogspot.com ]( http://catherinedevlin.blogspot.com )___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] dual use __main__: work or test

2017-02-11 Thread David Handy

I often do something similar, but usually with a command-line option or 
sub-command to indicate whether to run tests instead of doing the normal thing, 
and my default is usually to do the normal thing, not run tests.
 
However, many times I'll write a module not intended for use as a stand-alone 
script, but put some tests in it, and put an "if __name__ ==  '__main__'" thing 
in there that will unconditionally run tests. Then I can run that module's 
using the "-m" option, which I love:
 
python -m module_name
 
The test could use doctests, or even just call a function that has code with 
assert statements in it. I often use this technique when "bench-testing" a 
module under development.
 
David H
 
 
On Saturday, February 11, 2017 7:22pm, "kirby urner"  
said:








Does anyone use this pattern?:  
(a) accept command line parameters if __name__ == "__main__" or(b) run 
unittests if no parameters passed

Something like:

if __name__ == "__main__":
if len(sys.argv)==7:
command_line()  
else:
unittest.main()

I'm using this pattern with my classes, as a way of touching on both passing 
arguments from the command line (with nod to argparse for POSIX compliance), 
and self-contained testing. 

Maybe this would be better with doctest instead. I could do another version

Example:
[ https://github.com/4dsolutions/Python5/blob/master/tetravolume.py ]( 
https://github.com/4dsolutions/Python5/blob/master/tetravolume.py )

Kirby

___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] mixed messages about math...

2016-08-05 Thread David Handy

You haven't heard me on this list for a while, but I've been lurking!
 
About Math and CS - I remember the time (when I was in high school, early 
1980s) that there were several Math textbooks that included short computer 
programs right in the text. Students were  encouraged to type these programs 
into some nearby microcomputer and try them out. The language: BASIC. Students 
were encouraged to read the code and figure out what it did, and write more of 
their own. On, say, an Apple ][ or TRS-80 type machine. Again, these were Math 
textbooks, not programming nor electronics nor science textbooks. The first 
time I saw a computer in school (1979, it was a Commodore PET) was in my 
pre-Algrebra Math class. 7th grade. In Hillsboro, Oregon. We were encouraged to 
take a few minutes at the end of Math class time, on  a regular basis, to write 
whatever code our hearts desired. We would write code on paper at home (and 
look up examples in magazines) and bring it to Math class to type in.
 
Amazingly, Kirby, what you are saying is that things have gone backwards since 
the early 1980s in terms of integrating Math and Computer Science.
 
David H
 
On Friday, August 5, 2016 5:10pm, "kirby urner"  said:



































I was just drafting another blog post for CERM Academy,which manages streams of 
thought pieces going out to 
subscribers, then warehoused in a WordPress site. [1]As a former high school 
math teacher, my question is about the likely fate of that profession, in the 
light of two 
messages coming loud and strong from the adult world:1) the US President, Bill 
Gates, Mark Zuckerberg and many others, including hip hop stars, say "learning 
to code" is a great door opener, a ticket to the 21st Century


and

2) in order to respond to this demand, we're going to 
need a new army of CS teachers, very much in short 
supply at the moment.  Scientific American has another 
article on that theme in this August's issue. [2]What's being said, then, is:

3) whatever this "learning to code" thing is, it cannot bemath, as we presently 
do have a lot of math teachers, 
eager to innovate, but only a few "coding teachers" ergo 
"CS is not Math".That's quite a devastating message to be broadcasting.  
Math already has a relevance problem, with books like 'The Math Myth' chipping 
away at its lifeblood, its 
required status.  

"So what if we swapped out math for CS?" is the question 
that inevitably arises, once we tell the world they're 
really different. What if the school can't produce? 
"Stay home and learn"?  Who gets to do that?  That's
an interesting question.Before we go too far down this road however, it may
pay to look ahead.  Won't those hypothetical new 
coding classes include stuff about vectors and spatial 
geometry?  Luciano's OSCON talk was a lot about 
writing a vector class in fluent Python.  Isn't that what 
CAD is all about?  Look at Pi3D.  

Algorithms for finding primes Understanding RSA 
entails learning about Euler's Theorem, a generalization 
of Fermat's Little, and so on.  

Is 'The Art of Computer Programming' not-mathematical 
simply by virtue of being only semi-numerical?

In saying all these actually relevant topics belong to this 
new discipline, and that math teachers are not qualified 
to teach it, is stripping away their last shred of credibility.
The real weak link in this chain is not the math teachers,
but the fact that they're ball and chained to computer 
illiterate textbooks.  In the US, they're commanded to 
toe the line and teach to the tests.  But the tests have 
no use for hexadecimals (Common Core is base 10 only).

Finally, right when functions become "top level citizens",
(hooray) it turns out math teachers no longer get to 
teach exactly what that means, as the examples are all
in JavaScript or other "not math" languages.The real message we're sending to  
is that mathematicsinvolves calculation, because in math class we use 
calculators and don't code, whereas computer science 
involves computation.
Math is for calculator people.  Computer science is for computer people.  It's 
TI versus Pi.  

We seem prepared to move ahead on such thin ice, akin to
saying data science is not really math, not statistics, because 
there's coding involved.  

Somehow the mere act of coding marks a mythical boundary, 
around which we're happy to design our civilization?








Anyway, subscribers here are already veterans of such
discussions.  I ruminate more in this recent blog post:

[ http://worldgame.blogspot.com/2016/08/accelerated-learning.html ]( 
http://worldgame.blogspot.com/2016/08/accelerated-learning.html )


Kirby

[1]  [ http://cermacademy.com/ ]( http://cermacademy.com/ )

[2]  [ https://flic.kr/p/KCTvvU ]( https://flic.kr/p/KCTvvU )



___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Research on best language to use for teaching beginners

2015-10-02 Thread David Handy

On Thursday, October 1, 2015 4:50pm, "Andre Roberge"  
said:

...
 



The best keywords (combining result from the two groups) are thought to 
include: repeat, again, loop, cycle
The worst keywords are thought to include: foreach, while, echo, duplicate, for 
 with "for" getting the worst result of all.Now that you mention it, I have 
hazy memories from > 30 years ago, when I was learning BASIC, of puzzling over 
the meaning of the FOR keyword and wondering why they chose that word. So I'm 
not surprised to see that on the list of difficult keywords.
However, the WHILE keyword in BASIC was intuitive for me. So it surprises me to 
see that on their list of bad keywords.
David H___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] ACM article on Python

2015-03-23 Thread David Handy

Thank you all for the links pointing to Minecraft on the Raspberry Pi and 
articles on how to control it with Python. That's not something I've tried 
myself, but I have passed the links along to my friend.
 
David H
 
On Monday, March 23, 2015 7:41pm, "Francois Dion"  
said:



[ http://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/ ]( 
http://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/ )

[ 
http://www.raspberrypi-spy.co.uk/2014/06/building-a-castle-in-minecraft-with-python/
 ]( 
http://www.raspberrypi-spy.co.uk/2014/06/building-a-castle-in-minecraft-with-python/
 )
Francois

El Mar 22, 2015, a las 10:23 PM, "David Handy" <[ da...@handysoftware.com ]( 
mailto:da...@handysoftware.com )> escribió:



This evening I had an interesting conversation with a very determined 10-year 
old boy who wants to learn programming in Java and nothing but Java. I told him 
that I recommend Python as a first programing language, because learning Python 
is easier. But he was adamant. It's Java or nothing. Why? Minecraft is 
implemented in Java. That made Java the ultimate in coolness to him. No 
"risk-averse bureaucratic" thinking there, just a willingness to do hard things 
to get what he wanted.
 
So I told him, go for it, more power to you, and offered my assistance. What 
else could I do? :) In the face of determination like that, it's lead, follow, 
or get out of the way...
 
David H
 
On Saturday, March 14, 2015 5:27pm, "Mark Engelberg" <[ 
mark.engelb...@gmail.com ]( mailto:mark.engelb...@gmail.com )> said:



On Fri, Mar 13, 2015 at 7:33 AM, David MacQuigg <[ macqu...@ece.arizona.edu ]( 
mailto:macqu...@ece.arizona.edu )> wrote:



The first thing that got my attention was the banner text "Choosing Python is 
the modern equivalent of the old adage 'nobody ever got fired for choosing 
IBM'".  If I were an unimaginative, risk-averse bureaucrat, just wanting to run 
with the herd, the choice would be Java, not Python.  The only clarification I 
can find is in the conclusion of the article where we learn that Python is 
"blandly conventional", just the latest crest in the "waves of fashion" 
(Pascal, C++, Java, Python, Scratch).  Odd that Ruby is not mentioned anywhere.
Remember, this article is specifically about language choices for programming 
education.  I agree that Java is still the default choice for a risk-averse 
bureaucrat in industry, but in education, Python has become the most popular, 
default choice (that's sort of the whole point of the article).  In industry, 
many managers don't feel the need to look beyond Java to find more compelling 
options (even those that might boost productivity); similarly, at this point, 
many educators don't feel the need to look beyond Python to see if there are 
more compelling options (even those that might provide a better educational 
experience).
That's what I think the author's point is about Python being "blandly 
conventional".  There's no reason to think that Python is the pinnacle of 
educational languages.  It wasn't designed to be an educational language, so it 
should be possible to do better.  But it happens to be a pretty good choice for 
education, good enough that many people have stopped looking for better.
Ruby isn't mentioned because it never made significant waves in the educational 
community.  Remember, the article is just about educational language choices, 
not fashionable languages in general.




The bulk of the article is discussion of Python's "weaknesses": 
1) Creating non-trivial data structures is onerous.
2) Limited support for testing.
3) Lack of static types.
4) Difficult transition to other languages because the syntax is quite 
different.

Show me some real-world examples of a data structure or test setup I can't do 
better in Python.  Python's doctest is an excellent methodology for teaching 
Test-Driven Design, or even just teaching basic Python (see [ pykata.org ]( 
http://pykata.org/ )).
I think the best way to understand these criticisms is to take a look at the 
language Pyret ([ pyret.org ]( http://pyret.org )), a language that is being 
developed by Shriram Krishnamurthi (one of the educators quoted in the article) 
as an answer to the problems he sees with Python as an educational language.  


In Python you have a couple options to build structured data.  You can use the 
object system, but that's a little heavyweight and clunky for beginners.  You 
can just use dictionaries with the relevant entries, but beginners often don't 
have the discipline to mentally keep track of many different types of objects 
that are all dictionaries with different combinations of entries.  This gets 
especially problematic when you get to recursive data structures like binary 
trees.  It's pretty

Re: [Edu-sig] ACM article on Python

2015-03-22 Thread David Handy

This evening I had an interesting conversation with a very determined 10-year 
old boy who wants to learn programming in Java and nothing but Java. I told him 
that I recommend Python as a first programing language, because learning Python 
is easier. But he was adamant. It's Java or nothing. Why? Minecraft is 
implemented in Java. That made Java the ultimate in coolness to him. No 
"risk-averse bureaucratic" thinking there, just a willingness to do hard things 
to get what he wanted.
 
So I told him, go for it, more power to you, and offered my assistance. What 
else could I do? :) In the face of determination like that, it's lead, follow, 
or get out of the way...
 
David H
 
On Saturday, March 14, 2015 5:27pm, "Mark Engelberg"  
said:



On Fri, Mar 13, 2015 at 7:33 AM, David MacQuigg <[ macqu...@ece.arizona.edu ]( 
mailto:macqu...@ece.arizona.edu )> wrote:



The first thing that got my attention was the banner text "Choosing Python is 
the modern equivalent of the old adage 'nobody ever got fired for choosing 
IBM'".  If I were an unimaginative, risk-averse bureaucrat, just wanting to run 
with the herd, the choice would be Java, not Python.  The only clarification I 
can find is in the conclusion of the article where we learn that Python is 
"blandly conventional", just the latest crest in the "waves of fashion" 
(Pascal, C++, Java, Python, Scratch).  Odd that Ruby is not mentioned anywhere.
Remember, this article is specifically about language choices for programming 
education.  I agree that Java is still the default choice for a risk-averse 
bureaucrat in industry, but in education, Python has become the most popular, 
default choice (that's sort of the whole point of the article).  In industry, 
many managers don't feel the need to look beyond Java to find more compelling 
options (even those that might boost productivity); similarly, at this point, 
many educators don't feel the need to look beyond Python to see if there are 
more compelling options (even those that might provide a better educational 
experience). 
That's what I think the author's point is about Python being "blandly 
conventional".  There's no reason to think that Python is the pinnacle of 
educational languages.  It wasn't designed to be an educational language, so it 
should be possible to do better.  But it happens to be a pretty good choice for 
education, good enough that many people have stopped looking for better. 
Ruby isn't mentioned because it never made significant waves in the educational 
community.  Remember, the article is just about educational language choices, 
not fashionable languages in general.




The bulk of the article is discussion of Python's "weaknesses": 
1) Creating non-trivial data structures is onerous.
2) Limited support for testing.
3) Lack of static types.
4) Difficult transition to other languages because the syntax is quite 
different.

Show me some real-world examples of a data structure or test setup I can't do 
better in Python.  Python's doctest is an excellent methodology for teaching 
Test-Driven Design, or even just teaching basic Python (see [ pykata.org ]( 
http://pykata.org/ )).
I think the best way to understand these criticisms is to take a look at the 
language Pyret ([ pyret.org ]( http://pyret.org )), a language that is being 
developed by Shriram Krishnamurthi (one of the educators quoted in the article) 
as an answer to the problems he sees with Python as an educational language.  


In Python you have a couple options to build structured data.  You can use the 
object system, but that's a little heavyweight and clunky for beginners.  You 
can just use dictionaries with the relevant entries, but beginners often don't 
have the discipline to mentally keep track of many different types of objects 
that are all dictionaries with different combinations of entries.  This gets 
especially problematic when you get to recursive data structures like binary 
trees.  It's pretty tough to teach this well in Python with dictionaries, so 
teaching this usually gets delayed until the object system has been taught, and 
then all your functionality that operates on the trees are generally written as 
methods split between the branch and leaf classes.  This is tough for students 
because the code for a given function isn't all in one place, it is spread out 
among the two different types of classes.  Contrast this with Pyret's approach 
to structured data and recursive data structures.
As far as testing goes, Python's biggest limitation is that structured data 
created with dictionaries or objects are mutable data structures.  It is 
fundamentally more difficult to test mutable data structures because you can't 
use a built-in notion of structural equality.  So all tests must be in the form 
of setting up an object, calling functions/methods which mutate it, and then 
testing various properties of the mutated object.  This is onerous for 
beginners, and very hard to get them to do this with 

Re: [Edu-sig] real advice to a real student (comments welcome)

2015-01-17 Thread David Handy
On Friday, January 16, 2015 10:47pm, "kirby urner"  said:
> On Thu, Jan 15, 2015 at 2:00 AM, Laura Creighton  wrote:
> 
>> Can you suggest your student watch this video?
>> http://www.thersa.org/events/rsaanimate/animate/rsa-animate-drive
>>
>> It is Dan Pink's _The Surprising Truth About what Motivates Us_
>>
>> After he or she has done so, I have this added bit.
>>
>>
> A very worthwhile read.  I have continued corresponding with this student
> and will share a link to this post.
> 
> What's interesting in the cartoon / animation is where we start seeing
> shafts of light and here people just wanna be good (at something).
> 
> That looks a lot like the religion model i.e. religion better answers these
> needs than businesses.

I'm glad I wasn't the only one who noticed that. As soon as the video started 
talking about trained professionals working 20-30 hours a week outside of their 
jobs, without pay, for a purpose, it reminded me of all my friends who are lay 
leaders in my church. These people are engineers, doctors, lawyers, 
pharmaceutical researchers, etc. and they put in 20+ hours per week in free 
service to others. Something powerful is motivating them.

> 
> But then immediately we have to ask:  what's the difference (between
> religion and business -- both involve branding for example).
> 
> In a way it's just our mental categories that get in the way.  "We"
> (amorphous we) approach the world with messy namespaces.

We are all human beings with a lot in common.

> 
> As I posted to a physics list recently:
> 
> "The best religions are yet to come."
>>
>>
>> This saying pisses everyone off because:
>>
>> (a) half the people sing "Imagine there's no religion" and imagine they
>> know what they mean by that

Thank you Kirby for having the courage to bring up the "R" word in this space, 
not as a curse word nor as an insult. I'm getting a bit tired of "that's a 
religious argument" being used as the ultimate put-down, meaning "that's an 
irrational argument". It gets old.

>>
>> and
>>
>> (b) the other half can't imagine "new religions" in the pipeline, still
>> set to make their debut...

As a committed Christian I am not offended by people who express religious 
beliefs different from mine, even if they are "new religions". Rather, I tend 
to empathize with, and understand, people who are sincere.

>>
>> ... but I assure you're they're there.
>>
>> A lot of religions come with excellent science.  Belief in God?  Not
>> always a feature.

A lot of great scientists (Newton, Mendel, Kelvin, etc.) were religious.
Several of my friends in church are working scientists.
Religion is not synonymous with irrationality.

>>
> 
> 
> Kirby
> @npym_it
> @thekirbster
> @psf_snake
> 
> 
> Python:   Just Use It.
> 


David H


___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] PYTHON for audio processing

2013-09-16 Thread David Handy

Hi Sundeep -
 
I don't know anything about the MFCC, DTW, or ANN algorithms you mentioned.
I would have to guess that they do some kind of transformation to frequency 
domain as a first stage, and probably use something like the FFT. The numpy 
(Numeric Python) package provides FFT and other accelerated numeric 
capabilities. You should take a look at it.
 
As far as HTK goes, if it is a library written in C/C++ with a C interface, 
supplied as a DLL or shared object library, and you have C programming 
experience, you could use the Python ctypes module and create your own Python 
interface to it that way, without having to write any C code. Just a thought.
 
David H
 
-Original Message-
From: "Sundeep Sivan" 
Sent: Tuesday, September 3, 2013 12:21pm
To: edu-sig@python.org
Subject: [Edu-sig] PYTHON for audio processing



Hi,
I am an M.TECH student. I would like to do my main project in python. and my 
main project is "Speaker recognition"(ie. recognizing persons from their 
voice). For feature extraction i would like to use MFCC(Mel frequency cepstral 
coefficients) and For feature matching i may use Hidden markov model or 
DTW(Dynamic time warping) or ANN. When i googled about it their are many 
toolkits like HTK etc avilable for MATLAB. But i didnt get any tools for 
python. So my question is that can i do my project in python? Also is their any 
toolkits or modules avilable for my project. Kindly help.
Regards
Sundeep___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Using try / except: any stipulations against routine use?

2011-12-14 Thread David Handy
On Wed, Dec 14, 2011 at 08:59:58PM -0400, Andre Roberge wrote:
> Personally, I find both the if/else and the try/except much easier to
> remember, and slightly easier to read than the one-liner.
> 
> Furthermore, if one is interested in performance, it appears that the
> if/else approach is *always* faster than the one-liner.  When exceptions
> are rarely raised, then the try/except approach is the fastest.   Below are
> the results from a quick test to compare the efficiency of the three cases,
> followed by the code.  This is using Python 2.7 on a fairly old computer.
> 
> André

(Snipped André's code and results.)

Thanks for the benchmark!

For readability, my very favorite is to use defaultdict, in Python since
version 2.5:

from collections import defaultdict

d = defaultdict(int)
d[k] += 1

I added a defaultdict case to André's benchmark. It definitely beats
setdefault and is competitive with both try/except and if/else.  This was
also run using Python 2.7 on my very slow notebook PC.

David H

===

100% new keys

setdefault: 0.821501894794
defaultdict:0.96327996994
try/except: 3.30088125725
if/else:0.400257295271
--
10% new keys
setdefault: 1.07847561631
defaultdict:0.656087296011
try/except: 0.980378791159
if/else:0.600138006367
--
1% new keys

setdefault: 1.08054654991
defaultdict:0.604530464067
try/except: 0.711149322051
if/else:0.605315759405
--
0.1% new keys

setdefault: 0.848571815692
defaultdict:0.395037078735
try/except: 0.482041712005
if/else:0.570016859685

===

from timeit import Timer

print "100% new keys\n"
print 'setdefault:\t',
t = Timer("""
d = {}
for i in range(1000):
d[i] = d.get(i, 0) + 1
""")
print t.timeit(number=1000)

print 'defaultdict:\t',
t = Timer("""
d = defaultdict(int)
for i in range(1000):
d[i] += 1
""", setup='from collections import defaultdict')
print t.timeit(number=1000)

print 'try/except:\t',
t = Timer("""
d = {}
for i in range(1000):
try:
d[i] += 1
except KeyError:
d[i] = 1
""")
print t.timeit(number=1000)

print 'if/else:\t',
t = Timer("""
d = {}
for i in range(1000):
if i in d:
d[i] += 1
else:
d[i] = 1
""")
print t.timeit(number=1000)

print "-"*50
print "10% new keys"
print 'setdefault:\t',
t = Timer("""
d = {}
for i in range(1000):
k = i % 100
d[k] = d.get(k, 0) + 1
""")
print t.timeit(number=1000)

print 'defaultdict:\t',
t = Timer("""
d = defaultdict(int)
for i in range(1000):
k = i % 100
d[k] += 1
""", setup='from collections import defaultdict')
print t.timeit(number=1000)

print 'try/except:\t',
t = Timer("""
d = {}
for i in range(1000):
k = i % 100
try:
d[k] += 1
except KeyError:
d[k] = 1
""")
print t.timeit(number=1000)

print 'if/else:\t',
t = Timer("""
d = {}
for i in range(1000):
k = i % 100
if i in d:
d[k] += 1
else:
d[k] = 1
""")
print t.timeit(number=1000)

print "-"*50
print "1% new keys\n"
print 'setdefault:\t',
t = Timer("""
d = {}
for i in range(1000):
k = i % 10
d[k] = d.get(k, 0) + 1
""")
print t.timeit(number=1000)

print 'defaultdict:\t',
t = Timer("""
d = defaultdict(int)
for i in range(1000):
k = i % 10
d[k] += 1
""", setup='from collections import defaultdict')
print t.timeit(number=1000)

print 'try/except:\t',
t = Timer("""
d = {}
for i in range(1000):
k = i % 10
try:
d[k] += 1
except KeyError:
d[k] = 1
""")
print t.timeit(number=1000)

print 'if/else:\t',
t = Timer("""
d = {}
for i in range(1000):
k = i % 10
if i in d:
d[k] += 1
else:
d[k] = 1
""")
print t.timeit(number=1000)


print "-"*50
print "0.1% new keys\n"
print 'setdefault:\t',
t = Timer("""
d = {}
for i in range(1000):
d[1] = d.get(1, 0) + 1
""")
print t.timeit(number=1000)

print 'defaultdict:\t',
t = Timer("""
d = defaultdict(int)
for i in range(1000):
d[1] += 1
""", setup='from collections import defaultdict')
print t.timeit(number=1000)

print 'try/except:\t',
t = Timer("""
d = {}
for i in range(1000):
try:
d[1] += 1
except KeyError:
d[1] = 1
""")
print t.timeit(number=1000)

print 'if/else:\t',
t = Timer("""
d = {}
for i in range(1000):
if 1 in d:
d[1] += 1
else:
d[1] = 1
""")
print t.timeit(number=1000)

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Using try / except: any stipulations against routine use?

2011-12-14 Thread David Handy
On Thu, Dec 15, 2011 at 12:08:48AM +0100, Laura Creighton wrote:
> In a message of Wed, 14 Dec 2011 14:36:43 PST, kirby urner writes:
> >> Isn't this at least as readable, and conceptually simpler?
> >>
> >> if ext in res_dict:
> >>res_dict[ext] += 1
> >> else:
> >>res_dict[ext] = 1
> >
> >I get that a lot too and often propose my one-liner.  This is not a
> >matter of flagging a mistake, just showing another way.
> >
> >It's a chance to learn dict methods better and hey, they're paying to
> >have a pro coach.
> >
> >Kirby
> 
> This looks suspiciously like 'I am a superior being because I know more
> obscure methods that you do, and obscure knowledge defines the professional'.
> Bleah.

Kirby thinks the one-liner is more readable than the 4-liner. So do I.
Apparently this is something upon which reasonable people can disagree. :)

David H
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Python and pre-algebra

2011-07-02 Thread David Handy
On Fri, Jul 01, 2011 at 10:33:35PM -0400, moku...@earthtreasury.org wrote:
> 
> On Fri, July 1, 2011 9:28 am, David Handy wrote:
> > I've written a beginning Python
> > programming book (an updated attempt at the "BASIC from the Ground Up"
> > that got me started), I've taught short, free seminars here in North
> > Carolina and Virginia, and am doing what I can in my "spare time" to
> > tutor youth, including my own children.
> >
> > Best wishes to all you fellow travelers!
> >
> > David H
> 
> Where can we find your book?

I sell my book in e-book format, or in batches of 20+, at:

http://www.handysoftware.com/cpif/

Thanks,
David H

> -- 
> Edward Mokurai
> (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر
> ج) Cherlin
> Silent Thunder is my name, and Children are my nation.
> The Cosmos is my dwelling place, the Truth my destination.
> http://wiki.sugarlabs.org/go/Replacing_Textbooks
> 
> 
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Python and pre-algebra

2011-07-01 Thread David Handy
On Thu, Jun 30, 2011 at 10:41:45PM -0700, kirby urner wrote:
> On Thu, Jun 30, 2011 at 8:03 PM,  wrote:
> >
> > On Wed, June 29, 2011 7:15 pm, mary.do...@comcast.net wrote:
> > >
> > > I teach 6th grade math and Python was suggested as a way to apply
> > > pre-algebra concepts in a programming context. My programming background
> > > consists of one C++ programming class. How do I begin?
> >
> > Python is one of several excellent options. Others are Logo, Smalltalk,
> > and APL, all of which are available at no cost. I worked on a free APL for
> > 8-bit computers before the Free Software movement got started, and I have
> > friends working on APLs for current computers to put under the GPL.
> >
> 
> APL was my first love at Princeton, back when most people (including
> me) had to use punch cards.  It was the interactivity I loved, among
> other aspects.  Logo the same way.  Grew into dBase later, always
> interactive, a dialog.  Languages divide into those which respond,
> conversationally, and those which must be looked at as non-conversational.
> Python joined the ranks of the conversationals.
> 
> >
> > Assuming that your students know no Python, you could use the Sugar Labs
> > Turtle Art approach to math and programming to get started. Turtle Art was
> > designed for children to use for math, programming, and art, and has
> > natural ways to move to Logo, Python, or Etoys/Smalltalk. FORTH, too, but
> > most people don't want to know that. ^_^ (FORTH love if honk then)
> 
> I was a math teacher in a day school for humans of the female
> persuasion, as one of the trusted male faculty (most were not male),
> but this was long before the Free Software movement (GNU / GPL),
> was still at the start of the first computer revolution.  No Internet
> yet, at least not for ordinary civilians like me.
> 
> I dreamed of hypertext (read Computer Lib / Dream Machines
> by Ted Nelson) and joined IGC with a guest account at New
> Jersey Institute of Technology.  Proto-internet, pre-listserv.  In
> the meantime, snailmailers were proto-typing listservs via
> Action Linkage.  Anyone remember?  You'd mail your post to
> the anchor, who'd photocopy the lot and mail back out to
> subscribers.  The whole listserv phenomenon, happening
> through snailmail.  Lots of ethnography as yet unwritten.
> 
> Mid 1980s.
> 
> 'A Network Nation' by Turoff and Starr Roxanne Hiltz.
> http://web.njit.edu/~turoff/Vita/vita2005.html#a30
> 
> I lived behind Loew's Theater on Journal Square, the main
> PATH station in Jersey City.  By 1985, I was back in Portland,
> having been raised there through 2nd grade.
> 
> >
> > The question is, which pre-algebra concepts? Do you have a curriculum
> > standard or a particular textbook in mind? Are there other topics of
> > interest?
> >
> > I can write TA or mixed TA/Python examples, and show students how to do
> > the same, and we could work together on lesson plans to share in the Sugar
> > Labs Replacing Textbooks program. There are others with an interest in
> > doing this.
> >
> 
> Then I worked at McGraw-Hill (after some stuff in between), 28th floor,
> Rockefeller Center, Manhattan, editing textbooks, testing educational
> computer games, contributing curriculum writing (Logo, BASIC).
> 
> Back then, we thought computers were soon to take the math teaching
> world by storm.  Little did we suspect that the North Americans would be
> conquered by Texas Instruments, leaving the innovation vista to
> other cultures and/or subversive counter-cultures still operational
> in some areas.
> 
> OLPC (One Laptop per Child) was one attempt to break the TI lock
> on teacher imaginations.  For the most part, it failed in North America.
> The resistance was too great.  No breakfast cereal boxes featured
> the XO.  Nothing on the backs of Kellogs or General Mills.  No
> donated G1G1 commercials during Saturday Morning cartoons.
> http://www.youtube.com/watch?v=yFmQP3JimAE&feature=related
> http://youtu.be/XSH_5YP0tU8
> 
> Few ever got a clue.  Teachers fell further and further behind.
> 
> The situation was so bad in Hillsboro (personal anecdote), home
> of Intel in Oregon (Aloha plant) that the police got into the home
> schooling business, tried to do outreach to tomorrow's gangland
> by setting up a Linux Lab in West Precinct (where I came in, as
> a contract instructor).

I hope you don't mind me chiming in here. I grew up in Hillsboro, Oregon. I
graduated from Glencoe High School in 1985. I am an early Saturday Academy
alumni (I believe Kirby knows about Saturday Academy).

Since you all are talking about use of computers in teaching children
mathematics, I thought I would mention my own personal experience as a
learner in the early days of microcomputers.

When I was in 7th grade (1979) in Brown Junior High in Hillsboro, I
was in a "talented and gifted" track and was given a semester to do
any science-related project I wanted to do, and then display my work
in science-fair format at the end of the semest

Re: [Edu-sig] Migrating to Projects - Was: Low Enrollments - programming as anti-intellectualism

2005-11-04 Thread David Handy
On Fri, Nov 04, 2005 at 12:31:03PM -0700, Trent Oliphant wrote:
> Toby Donaldson wrote:
> > 
> > One thing CS departments could do is offer service-oriented software
> > engineering courses. It's clear that many people nowadays learn to
> > program on their own, and run into well-known difficulties once their
> > programs get too big. Those people would probably appreciate and
> > benefit from a software engineering course, especially if was
> > platform/lanuage neutral.
> 
> This brings up an interesting discussion point, one in which I would be 
> extremely interested personally:  How do you help students (or yourself) move 
> from writing scripts, functions, classes, modules etc. to writing a larger 
> project.  I am actually at that stage right now in my personal learning 
> curve. 
> That curve seems extremely steep.

[snip]

> Is that part of the reason for the perception that Python is not
> approriate for large scale projects - because there are no tools that make
> the job realistic? 

No, that's not the usual reason people give. The main reason that people
who've never tried Python give for assuming that it's not appropriate for
"large scale projects" is its dynamic typing. Sometimes they also assume
that Python execution speed is "too slow".

[snip]

> I know it may seem that I am talking about an IDE - but even those (at
> least the ones available for Python that I have seen) assume that you
> already know how to do a project.  So I get overwhelmed.  I want them to
> work for me - but they just haven't yet.

[snip]

> ... but I don't even know where to start and there appears to be nothing
> out there to help me learn that.
> 
> Trent Oliphant

You do not need another tool nor another IDE in order to "move up" from
writing scripts to creating a larger project. What you need are knowledge,
experience, and good methodology.

The reason there is no book or manual on how to make this transition is that
it strongly depends on what type of project you want to do. Plus it is like
riding a bicycle. There is only so much a manual can do for you. But here's
the good news: there are plenty of resources, plenty of help out there for
you.

I offer these sincere suggestions:

1. Figure out what you are trying to do. What lights your fire? Come up with
concrete goals and write them down in your project notebook.

2. Find an existing Python open-source project that in some way resembles
what you want to do.

3. Figure out how that project works. Read its source code and trace
through it. Hack it, change it, put print statements all over just to show
you were there. Diagram its packages and modules. Figure out how it is
installed and configured, and how it accesses data.

4. Now work on your own project, following the model of the one you
reverse-engineered.

5. As you find out that things aren't working for you, change your approach,
or find a different model to follow. Write down your lessons learned, then
move on. Don't be afraid to throw away code and start over. If you can't
stand to delete something you have worked so hard on, move it to some other
directory where you can keep it and cherish it forever (but move on!)

6. As you find that you have bitten off more than you can chew, narrow the
scope of your project. Do something less ambitious, but do something.

7. Gather your fan club -- any victim or captive audience to whom you can
show off your work. In the case of the StarSim game I am writing, my sons
are willing enough to "test" it for me. And the local Zope/Python users
group has been kind enough to let me show my work in progress a couple of
times.

8. Have fun or get paid for it, or both. If it doesn't do at least one of
those two things (generate enjoyment or cash) do something different.

Good luck! If you've got time to work on a project but don't know how to
begin, then you're a lot better off than I am, regardless of how much I
think I know... :)

--
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Python as Application

2005-10-25 Thread David Handy
On Tue, Oct 25, 2005 at 04:26:26PM -0400, Arthur wrote:
> ... I realize that my approach to learning Python has been closer to
> learning a software application than the traditional approach to learning
> to program and learning a programming language.
>
> ...
> 
> I focus on having a dialog with Python's behavior.  And that is 
> conducted mostly by throwing code at it, and then registering the result 
> - until I zone in more and more finely on controlling the result by 
> controlling the code I throw at it.
> 
> ...
> 
> And it seems to me that if the approach to teaching Python was more 
> toward Python as an application, than as a "programming language", 
> better results might be achievable for a wider range of people.
> 
> FWIW.
 
Thank you for your comments, that is worth something to me.

Question for you: How much did Python's interactive mode (the >>> prompt
thingy) help you in your explorations? As you threw code at Python, how
often did you create scratch .py files and run them, vs. trying something at
the interactive prompt?

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Low Enrollments

2005-10-13 Thread David Handy
On Wed, Oct 12, 2005 at 11:35:36PM -0700, Toby Donaldson wrote:
> > It appeared as if these kids thought there was a hard road to success
> > and an easy road to the same success, so planned to take the easy road.
> 
> Hmm, is this just the "kids today are lazy and didn't work as hard as
> I did in my day" argument? I don't buy that one. Kids today are no
> less lazy than at any other time in history. Perhaps they have more
> opportunity for leisure, but many still say they want to become
> doctors or nurses or lawyers --- careers that require lots of
> education and hard work.

I wasn't speaking about all kids everywhere in the world. But unfortunately
I have several more data points to show there really was a problem among
American kids in Oregon in the 1990's. I read reported statistics that said
Oregon was one of the bottom states of the US in terms of kids wanting to go
into *any* technical profession. I saw reports in the media of scholarship
programs and training programs with seats going empty for lack of interest.
The programming and electronics classes at Glencoe High were both canceled
for lack of interest.

Kirby is in better touch with the pulse of things back in Oregon now than I
am. Hopefully he has witnessed a rebound, hopefully things have gotten
better. But I believe there really was a dip in the 1990's.

> I think when a kid says "engineering is too hard", they are also
> saying that they don't see the rewards of engineering as very
> significant. I really don't see kids as being afraid to work hard;
> quite the opposite, I am often amazed at how hard students will work
> on something that is interesting and valuable to them.

Yes it is true that people find ways to work hard at things that interest
them; somehow many have a hard time finding something that is interesting
and valuable to them!

Unfortunately, the majority of this group told me that they were "undecided"
on what they wanted to major in. In particular I don't remember any saying
they wanted to become doctors, etc.

It seemed like we had a group of kids who were college-bound because their
parents had money, but they were unmotivated. Hopefully they became
"late-bloomers" and "found themselves" later on.

I didn't want to come across as saying "kids today are lazy" so much as to
emphasize that I've seen the correlation between a willingness to work --
including physical labor -- and entering and succeeding in technical fields
of study.  Good parents take note and prepare your children accordingly.

On a related note, I have also noticed a lack of confidence, a fear of
failure, contributing to people being unwilling to try difficult technical
studies.  Somehow someone has to convince them they can do it.  In my case
it was my father who boosted my confidence.  The parents' attitude makes a
big difference.  I remember teaching a programming seminar to a group of
12-year-olds as part of a Boy Scouts activity.  One young man kept saying
over and over "I'm just no good at this stuff" even though (1) he had never
tried before, so how did he know he wasn't good at it? and (2) he understood
and followed all the directions perfectly.  But I know why he said he was
"no good at this stuff" -- I had overheard his father saying that exact same
thing.

David H

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Low Enrollments

2005-10-12 Thread David Handy
On Wed, Oct 12, 2005 at 08:25:56PM -0600, Chuck Allison wrote:
> Hello EDU-SIG,
> 
>   CS enrollments seem to be dropping drastically everywhere. Many
>   factors probably are at fault (dot-com bust, off-shoring hype), but
>   there seem to be others. One in particular is that so few HS
>   graduates seem ready analytically to join in.
> 
...
> 
>   Honestly, I can't imagine a field that better combines both sides of
>   the brain with a service ethic and a dimension of fun than CS. But
>   it looks like so much nerd-ness or drivel to the uninitiated.
>   
>   Any ideas would be appreciated.

I noticed a profound shift occur at Glencoe High School in Hillsboro, Oregon
between 1985 (when I graduated from there) and 1995-1998 when I visited
there to give talks for national engineering week. In one memorable
experience, I spoke to the Biochemistry students, in the same classroom
where I had taken that same class a decade earlier. These were the top 20
math and science students in the school. I asked how many of them wanted to
become engineers. I got zero responses. I was floored. Based on my
experience of the past, I had expected least a handful! I said "engineering
is a good career, it pays good money, why are you not interested?" One kid
raised his hand and said "It's too hard." Another volunteered, "Yeah, I have
a friend who is an engineering student and he has to work all the time." I
was dumbfounded. It appeared as if these kids thought there was a hard road
to success and an easy road to the same success, so planned to take the easy
road.

Chuck, we are up against a more difficult problem than just making CS look
cool. CS is fun, of course, but it is also hard work, there is no disguising
that.  If the rising generation doesn't have the work ethic, there is really
no substitute.

In my experience, I noticed that among the successful American-born
engineering students, a significant number of them had been raised on farms,
where they had to get up at 5am every morning to milk the cows. In other
words, they knew how to work.  So what did I do?  When I lived back in
Oregon, we moved out to the country and we had goats and chickens, and my
boys went out with me morning and evening to milk the goats.  Now that we
live in a different environment in North Carolina, I have taken a different
route and have the boys help me in our home publishing business.  They have
gotten pretty good at binding books. (Just a little plug: anyone who buys my
book is contributing to my children's education in multiple ways.)

David H

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Microsoft's KPL

2005-10-07 Thread David Handy
ed that the cost in transportng their
> good to new customers made their prices uncompetitive.  At this point
> in time, improvements in transportation technology drove the ability
> of large firms to increase their markets.  Current technology is so
> advanced that you can pick up raw materials from Canada, ship them to
> South East Asia, make cars out of them, and ship the cars back.  It is
> one big global market now.  The attempts to sell in China is the
> pushing back of the last -- admittedly huge -- frontier.
> 
> But the upshot of all of this is that scarcity is over.  The market in
> goods and services are saturated with offerings.  It doesn't do you
> any good to make any more, since all you will do is waste money and
> add to the glut.  Indeed, you are better off spending your money in
> advertising, trying to promote averice, and 'stimulate demand'.
> 
> And where human beings really shine is at unskilled labour.  If you
> invest heavily in touch screens and bar code readers, you can lower
> the skills needed for a checkout clerk.  But they are cheaper than
> robots at picking up goods and passing them over the sensors.
> 
> And it makes sense to pay them, at rates which exceed the value of
> the service they provide.  You just pass on their costs onto the
> price of the goods.  Because what keeps this over-balanced system
> running at all is amount of circulation that the money does.  
> Impoverishing the check out clerks to the point where they can no
> longer function as consumers does not serve the interests of the
> market as a whole.
> 
> But this means that the whole 'what is the purpose of education'
> question is in serious need of revision.  It used to be that preparing
> people for productive lives was enough.  These days a productive life
> may not be what is wanted.  Perhaps a meaningful one would be a better
> goal to strive for.
> 
> Laura
> ___
> Edu-sig mailing list
> Edu-sig@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
> 

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Microsoft's KPL

2005-10-05 Thread David Handy
Microsoft's "Coding 4 Fun" website referenced below is ostensibly intended
to boost hobby coding on the MS platform. But my understanding is that
Microsoft has one of those "we own you, body and soul, and everything you
create is owned by us" employee contracts. So you can't code for fun and
release the code if you are a Microsoft employee, unless you can somehow get
through the MS legal department.

Therefore KPL was not developed by Microsoft employees. And it doesn't
appear to be open source, either. (No source code available, and I couldn't
find any explicit license, other than a statement that it was "freeware".)

David H

On Mon, Oct 03, 2005 at 02:13:58PM -0700, Guido van Rossum wrote:
> Has anyone looked at this yet?
> 
> http://msdn.microsoft.com/coding4fun/
> 
> http://www.computerworld.com/developmenttopics/development/story/0,10801,105100,00.html
> 
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> ___
> Edu-sig mailing list
> Edu-sig@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
> 

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Brute force solutions

2005-09-21 Thread David Handy
On Wed, Sep 21, 2005 at 09:31:41AM -0700, Kirby Urner wrote:
> Mine original draft makes sense to set the stage, cuz the reasoning is so
> dang primitive.  Yours adds a layer of sophistication more reflective of how
> real world programmers learn to squeeze the most out of their cycles.

Your original draft was a great baseline. That's one good reason not to
prematurely optimize: it makes you look like a hero when you optimize
later. :)

> 
> Of course all of this requires temporarily ignoring the fact that algebraic
> methods give us a way to compute phi as simply (1 + math.sqrt(5))/2.0.

The technique is generally useful to solve any equation of one variable,
given:

1. You have an interval in which the solution lies
2. You have an error function that is monotonically increasing over the
interval the further you get from the solution (and goes to zero at the
solution)

I think exposing students to numerical equation solving using Python can
give them an understanding that will help them later when they are trying
to, i.e. figure out how to solve a problem with their fancy caculator,
spreadsheet functions, etc.

> 
> Kirby
> 
> 

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Brute force solutions

2005-09-21 Thread David Handy
On Wed, Sep 21, 2005 at 06:44:01PM +0100, Peter Bowyer wrote:
> At 14:33 21/09/2005, you wrote:
> >At the cost of roughly doubling the complexity of the code (19 lines instead
> >of ten lines in the function body), I was able to improve the performance by
> >a factor of more than 6500, while basically still using the same
> >"brute-force" approach of guessing a number, adjusting the guess by a delta,
> >and noticing which number gets the lowest error.
> 
> Psyco also makes a very noticeable difference:
> 
> Without:
> Slow method -- result: 1.61803406588 time: 1.40232660855 seconds
> Faster method -- result: 1.6180333003 time: 0.000200135212716 seconds
> 2 digits more precision -- result: 1.61803398295 time: 
> 0.000242882824493 seconds
> 
> With psyco.full()
> Slow method -- result: 1.61803406588 time: 0.256314531595 seconds
> Faster method -- result: 1.6180333003 time: 3.65800681372e-005 seconds
> 2 digits more precision -- result: 1.61803398295 time: 
> 4.53755994128e-005 second

Thanks for bringing up Psyco. This is an example of something Psyco can
speed up, with about a 5.5x improvement for both my algorithm and Kirby's.

However, it doesn't change the fact that original agorithm doesn't scale
well.  Try 12 digits of precision instead of 6:

Slow method -- result: 1.61803406588 time: 0.753984212875 seconds
Faster method -- result: 1.6180333003 time: 0.000110749006271 seconds
2 digits more precision -- result: 1.61803398295 time: 0.000144357919693
seconds
6 digits more precision -- result: 1.61803398875 time: 0.000229076862335
seconds

6 more digits of precision takes the optimized algorithm only 2x more time.

With the original algorithm, 6 digits more precision takes 100x more
time. Even with Psyco, it would take about three days to calculate phi to
12 decimal places on your machine.

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Brute force solutions

2005-09-21 Thread David Handy
   
>   b = 1 - a
>   e = abs(b/a - 1/b)
>   if e < diff:
>   phi = b/a
>   diff = e
>   return phi
> 
>  >>> findphi(0.01)
>  1.6180340658818939
> 
> Some lessons that might be learned from this approach:
> 
> (1) when working with floats, you want to compare differences, not check for
> equalities, e.g. looking for when b/a == 1/b would be a bad idea.
> 
> (2) you get greater accuracy in exchange for more cycles
> 
> (3) visualization helps
> 
> The last point is especially important.  The code itself says nothing about
> lines.  The diagram is what explains the logic behind the algorithm -- which
> is why it's included right in the comments, as primitive ASCII art (bad
> form, or a good idea?).
> 
> Kirby
> 
> [1] 
> http://mathforum.org/kb/message.jspa?messageID=3867841&tstart=0
> 
> [2] 
> http://altreligion.about.com/library/glossary/symbols/bldefswiccasymbols.htm
> 
> PS:  happy birthday Dawn Wicca (9/20/2005)
> 
> 
> ___
> Edu-sig mailing list
> Edu-sig@python.org
> http://mail.python.org/mailman/listinfo/edu-sig
> 

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/

- End forwarded message -

-- 
David Handy
Computer Programming is Fun!
Beginning Computer Programming with Python
http://www.handysoftware.com/cpif/
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Gutless classes

2005-09-09 Thread David Handy
On Thu, Sep 08, 2005 at 03:57:47PM -0700, Kirby Urner wrote:
> > Extending Classes
> > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/412717
> > 
> > --Dethe
> > 
> 
> Thanks for showing me that.
> 
> I guess I'm just fascinated by the mutability of classes at runtime even
> without __metaclass__ magic, e.g.:
> 
> 
>  >>> class Alter(object):  
> "stub class"
> Pass
> 
>  >>> def meth1(self): return "Meth 1"   # mindless method 1
> 
>  >>> def meth2(self): return "Meth 2"   # I'm mindless too
> 
>  >>> class Alter(object):
>   pass
> 
>  >>> Alter.m1 = meth1
>  >>> oa = Alter()  # create objects, go wild
>  >>> oa.m1()
>  'Meth 1'
>  >>> ob = Alter()
> 
> Sometime later, rebind the method m1 in the class itself:
> 
>  >>> Alter.m1 = meth2
>  >>> oa.m1()
>  'Meth 2'
>  >>> ob.m1()
>  'Meth 2'

I haven't yet found any need to change the method on a class, but I have
often written code that changes a method on an instance. Here's a class that
"runs" something, but it is an error to run it more than once:

class RunOnce:

def run(self):
self.run = _noMoreRunning
# do other stuff that you only want to happen once

def _noMoreRunning(self):
raise Exception("Can only call run() once.")

I prefer the pattern above to the alternative:

class RunOnce:

def __init__(self):
self.__has_been_run_before = False

def run(self):
if self.__has_been_run_before:
raise Exception("Can only call run() once.")
self.__has_been_run_before = True
# do other stuff that you only want to happen once

David H
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Python Quiz

2005-09-07 Thread David Handy
On Tue, Sep 06, 2005 at 03:31:36PM -0700, Kirby Urner wrote:
> 
> class Shell:
> 
>   def __init__(ghost):
>   pass
> 
>   def __repr__(ghost):
>   return 'What famous Japanese cartoon?'
> 
> OK that was easy.  So how about:
> 
> class Shell (object):
> 
>   def __init__(ghost):
>   pass
> 
>   def __repr__(ghost):
>   return 'What famous Japanimation?'
> 
> Hint:  think "new-style class."
> 
> Kirby

I don't get it. You have two classes, both with a repr implementation, and
the second one happens to be a new-style class as indicated by its being
derived from "object". Was there more to it than that?

Just in case, I copied and pasted your new-style class definition into
kirby-ghost.py and tried it out with Python 2.3 on my machine, just to see
if there was some gotcha that I had overlooked. It works just fine for me:

[EMAIL PROTECTED] stuff]$ python -i kirby-ghost.py
>>> dir()
['Shell', '__builtins__', '__doc__', '__file__', '__name__']
>>> s = Shell()
>>> s
What famous Japanimation?

Loving-Python-Quizzes-but-being-puzzled-by-this-one'ly-yours,
David H
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


[Edu-sig] Computer Programming is Fun! Beginning Computer Programming with Python

2005-06-25 Thread David Handy
Hi fellow EDU-SIGer's -

A few times over the last year I have mentioned on this list my project to
write a beginning programming book using Python. At least one edu-sig
subscriber has used this book successfully in teaching an 8th-grade
programming class.

My book is now ready for sale to the public. Here is the "official"
announcement:

Written by a homeschooling Dad and professional software developer,
"Computer Programming is Fun!" fills a need for a book that teaches
computer programming to teenage youth.

The author set out to write a book like the one he used to teach himself
programming at age 12. In the 1980's programming students began learning
with BASIC, but for the new millenium the author chose the more modern
Python language. Python is used by NASA, Google, and George Lucas'
Industrial Lights and Magic, but is simple enough for beginners to learn. 

Testimonial:

Mr. Handy

I got my program to work! I thought today's lesson was really good, I
espically [sic] liked the section where you told about how sound and
other stuff actually works. I liked your theme song, and using these
notes I can make a soundtrack for future space battles.

(An 11-year-old in North Carolina)

This book has been successfully used by both homeschooling families and
public school teachers. A syllabus outline at the beginning of the book lets
you select the lessons you want from one of three learning tracks: a data
processing track, a video game track, or a simple turtle graphics track,
depending on the student's interests and level of learning. 

All necessary software, including the Python programming language and sample
programs, are included on a CD in the back of the book. This book is geared
for either self-study or classroom use. Neither the student nor the teacher
need have any prior programming experience.

208 pages, $29.95 plus taxes and shipping if applicable

Order from the author's web site:

http://www.handysoftware.com/cpif/

"Why teach computer programming to teenagers? For the same reason you would
teach them piano or any other musical instrument. Consider the computer an
instrument for the mind."

David Handy
[EMAIL PROTECTED]
(919)773-9881

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Python at grades 5-9 summer program

2005-06-17 Thread David Handy
On Thu, Jun 16, 2005 at 11:26:28PM -0700, Dave Briccetti wrote:
> Hi all. I'm pleased that I've finally discovered what a great resource 
> Edu-sig is.

Hi Dave, welcome aboard.

> I've been a professional programmer since 1978, and a self-employed
> consultant since 1983. These days I work mostly in Java on Linux, Windows,
> and MacOS X. In the summers I teach for six weeks at a community college
> program for grades 5-9 in Pleasant Hill, California (not far from San
> Francisco). Over the years I've taught QBASIC, Visual Basic, C++, and
> Java.

You sound like a man after my own heart. Professional software developer
with a desire to teach young people. Me too.

In fact this week I sat down with my 8 and 11 year old sons and taught them
binary arithmetic and logic design (AND, OR, and NOT gates) just like my
father taught me when I was 10...it's a generational thing.

> A few weeks ago I got an email from an adult who is a friend of a student
> who will be in my Python class this year. The man works in industry, and
> wanted to know why I would teach Python and not Visual C++... suggesting
> that I'm some tired old professor who was just teaching what he knows
> instead of something useful. 

I'm rolling on the floor laughing! Python boosts productivity more than 4x
over C++ for me and thousands of other developers and that's not useful?
Sounds like he's the one stubbornly sticking with the things he knows
instead of learning things that are new and different.

I'm not worried about folks like that, let them have their own opinions.
What bothers me though is that I'm meeting young people who have been
influenced by folks like that. They want to skip Python and go straight to
C++ because that's what they think "cool" game developers do.

They've got to understand that games they think are so "cool" are written by
teams that consist of 3 to 5 programmers and 50 or more graphic artists,
designers, etc. working full time for a long time with costs in the
millions. They want so much to impress their peers, their teacher, etc. They
need to understand that people will be a lot more impressed by something
that's funny and original that they did themselves in Python and it actually
runs vs. something they attempted in C++ and it would have been the next
Starcraft only they never got it finished or working. That's the beauty of
Python -- your success rate goes way up.

Anyway, welcome again to EDU-SIG.

David Handy
Computer Programming is Fun!
http://www.handysoftware.com/cpif/

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] K-16 CS/math hybrid

2005-05-09 Thread David Handy
On Mon, May 09, 2005 at 04:07:41PM -0700, Anna Martelli Ravenscroft wrote:
> Just a follow-up on the math and programming interaction: I was brushing 
> up on algebra for a placement test for the local community college (yes 
> - I'm finally going to go get my degree...) and while I was studying, my 
> brain kept coding python in the background... I kept seeing things in 
> terms of "how could I code this?" [btw - yes, I passed.]
> 
> Just thought it was amusing to see how python has influenced my thinking.
> 
> Anna

I had a very similar experience (though it occurred a while ago, and with
BASIC, since Python was still ten years away.)

I learned to program *before* I was taught algebra or trigonometry in school.
However, I quickly ran into problems where I "needed" them. I begged my Dad
to teach me how I could rotate space ship drawings in the computer game I
was writing, so he taught me sine and cosine and the Pythagorean theorem
(though he didn't call it that, but rather "how to calculate the distance
between two points".)

Anyway, I had the same experience of my brain "coding in the background"
while I learned mathematics in school. I feel like it helped me a lot. And
after I learned some new thing I would go home and write a program to
graph it or do a simulation with it, and that further cemented the
knowledge.

That's why I'm big on teaching computer programming to young teenagers, as
much as they are willing to learn. My personal experience is that "learning
to program" first led directly to "programming to learn" later. I feel that
the benefits have continued for years afterwards as I went through
engineering school, and on into my career. I don't think that I am so
unusual, but rather that I had unusual opportunities. I'd like to share
those opportunities if I can.

And yes I think Python is much better than BASIC for that purpose. :)

David H.
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: RE: [Edu-sig] RE: Integration correction

2005-03-30 Thread David Handy
On Wed, Mar 30, 2005 at 07:15:58AM -0500, Arthur wrote:
> What I can't and don't understand - as a 'radial" - was why those who
> purport to most appreciate Python as it is would sign in mass unto an
> endeavor which could foreseeable alter what it is and how it is used in
> dramatic ways, and do so irretrievably.

I'll try and answer that one.

When I learned Python version 1.5.2 back in March of 1999, six years ago, I
already had a lot of experience programming in C, C++, Pascal, Perl, etc.

Learning Python made me a better programmer. Object-oriented programming
concepts that were obscure in C++ became so much clearer in Python, with
it's "everything is an object" and "first-class functions and classes." I
took that philosophy and began writing better C++ code.

But it didn't stop there. After I thoroughly learned Python 1.5.2, it
evolved. It got generators and iterators, and I learned those too. By this
time I was programming C# and Java. The new things I learned from Python
2.2+ made me a better C# and Java programmer.

In 2004 I started using list comprehensions and generator expressions and
the more accessible features of new-style classes, including properties and
cooperative superclasses. All of these things made my life better.

In 2005 (so far) I've now understood descriptors and how they can help me.
Metaclasses are next on my list.  And with every mind-expanding step I've
become a better Java programmer. Even though Java doesn't have Python's
features, those "patterns", when learned first in Python, really help.

I feel like I'm water skiing, and Python is an intellectual power-boat
towing me along.

Perhaps you're saying "the boat's going too fast, I want to get off". Well,
you may have that luxury, but I don't. I make my *living* doing this stuff.
My wife and four hungry children depend on me keeping up with the
world-class state of the art. If I were to decide that I've had enough, my
brain is full, then I might as well find another line of work.

Certainly I have an interest in Python code remaining accessible to
entry-level programmers. I am not an elitist. But advanced Python features
have made advanced programming accessible to *me*, when otherwise I might
not have gotten into it, due to lack of time and perceived barriers to
entry.

I believe Python offers a lot to programmers at every level. The good old
Python 1.5.2 feature set is still great for beginners, and that's the
feature set I teach to beginners. But there is no limit to how far you can
go in Python. If I taught beginners using, say, Visual Basic, I'm putting a
ceiling over their heads. Python scales conceptually.

And that's my 2 cents.
David H.
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Re: Best approach to teaching OOP and graphics

2005-03-26 Thread David Handy
On Sat, Mar 26, 2005 at 04:51:26PM -0500, David Handy wrote:
> So I created a module called demotest that does the same thing as doctest,
> except that it prints each command and response, and it waits for me to
> press Enter before going on to the next line. I just put:
> 
> if __name__ == '__main__':
> import demotest
> demotest.test()
> 
> at the bottom of my example module and it steps me through my demonstration.

Correction:

if __name__ == '__main__':
import demotest
demotest.demo()

(The function name is demo(), not test(). You'd think I could get my own API
right...)

David H.

> 
> If this sounds interesting, here is the link to the notes from my
> presentation:
> 
> http://trizpug.org/Members/dhandy/newclass/
> 
> and here is a direct link to my demotest module:
> 
> http://trizpug.org/Members/dhandy/demotest.py
> 
> Maybe someone else will find it as useful as I did. It requires Python 2.4
> because it uses the "advanced" doctest API: it uses DocTestFinder and
> extends DocTestRunner.
> 
> David H.
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Re: Best approach to teaching OOP and graphics

2005-03-26 Thread David Handy
On Sat, Mar 26, 2005 at 11:18:47AM -0500, Jeffrey Elkner wrote:
> On Sat, 2005-03-26 at 12:08 +0200, Linda Grandell wrote:
> > I dived right into your lessons... Looks *very* good.

I have to echo that sentiment. Jeff, your approach is excellent.  Test
Driven Development really works, I've proved that myself.

But what I'm also impressed with is that you gave the students series of
tests to pass, each one adding more functionality. You are teaching your
students *incremental* development, which is extremely important IMO.

> I wanted to find a way to use this approach throughout the course, but the
> existing testing frameworks always got in the way.
> 
> DocTest has changed all that.

That has been my experience exactly.

Speaking of making good use of doctest, I did a presentation recently at the
Triangle Zope/Python user's group (TriZPUG) on Python's new-style classes. I
wanted to demonstrate the features using an interactive Python session, but
I didn't trust myself not to be too nervous to type the commands right.

So I created a module called demotest that does the same thing as doctest,
except that it prints each command and response, and it waits for me to
press Enter before going on to the next line. I just put:

if __name__ == '__main__':
import demotest
demotest.test()

at the bottom of my example module and it steps me through my demonstration.

If this sounds interesting, here is the link to the notes from my
presentation:

http://trizpug.org/Members/dhandy/newclass/

and here is a direct link to my demotest module:

http://trizpug.org/Members/dhandy/demotest.py

Maybe someone else will find it as useful as I did. It requires Python 2.4
because it uses the "advanced" doctest API: it uses DocTestFinder and
extends DocTestRunner.

David H.

- End forwarded message -
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Looking for a comprehensive Python and Tkinterdocumentation (like the Java documentation)

2005-03-03 Thread David Handy
On Thu, Mar 03, 2005 at 08:08:12AM -0800, Kirby Urner wrote:
> You can run pydoc as a server and hit it with your browser:
> 
> """
> Run "pydoc -p " to start an HTTP server on a given port on the
> local machine to generate documentation web pages.
> """
> 
> However, I'm having trouble getting this to work in Python 2.4 on WinXP, per
> the traceback below:
> 
> D:\Python24\Lib>python pydoc.py -p 7887
> Traceback (most recent call last):
>   File "pydoc.py", line 55, in ?
> import sys, imp, os, re, types, inspect, __builtin__
>   File "D:\Python24\Lib\re.py", line 5, in ?
> from sre import *
>   File "D:\Python24\Lib\sre.py", line 97, in ?
> import sre_compile
>   File "D:\Python24\Lib\sre_compile.py", line 17, in ?
> assert _sre.MAGIC == MAGIC, "SRE module mismatch"
> AssertionError: SRE module mismatch
> 
> 
> On the other hand, when I change to Python 2.3 and try the same thing, it
> works:
> 
> D:\Python24\Lib>cd..
> 
> D:\Python24>cd ..
> 
> D:\>cd python23
> 
> D:\Python23>cd lib
> 
> D:\Python23\Lib>python pydoc.py -p 7887
> pydoc server ready at http://localhost:7887/
> 
> Anyone able to get the 2.4 pydoc server working in Windows?
> 
> Kirby

It works great for me:

C:\Python24>python -m pydoc -p 3999
pydoc server ready at http://localhost:3999/

(Using the nice new -m flag to run a module from the command line.)

Just a thought - do you still have Python23 in your PATH? It looks like you
might be trying to run the 2.4 version of pydoc using the 2.3 version of
python.

David H.

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Looking for a comprehensive Python and Tkinter documentation (like the Java documentation)

2005-03-02 Thread David Handy
On Wed, Mar 02, 2005 at 05:03:54PM +0100, Florian Reichl wrote:
> before using Python I was using Java at school.
> I really like Python. It has a lot of advantages.
> But I am missing the good documentation provided with Java!
>
> ...
> 
> Is there anything like that made for Python???
> 
> ...
> 
> P.S.: Where do I find the official Tkinter documentation?

Have you ever run pydoc?

On windows: Programs->Python 2.4->Module Docs

Click the "browse" button and look through documentation automatically
extracted from all the module files in your PYTHONPATH -- the standard Python
library plus whatever else you have installed.

Then of course there are the official online docs for the Python standard
library, which I find quite useful and at least as good as the corresponding
online Java API documentation:

http://docs.python.org/

As for Tkinter, well, that happens to be the weakest point. Unlike the other
standard Python packages, it is not fully documented in the "official" docs
-- for example, you won't find a complete description of Tkinter.Canvas
there.  Instead, when you go to http://docs.python.org/lib/module-Tkinter.html
you'll find some general overview and examples, and then you're referred to
other resources. I found John Grayson's "Python and Tkinter Programming"
book most useful; I wouldn't be using Tkinter without it.

I wouldn't complain too much about them not filling up the online docs with
hundreds of pages of Tkinter material. Most graphical frameworks are complex
enough to merit a book of some kind; I wouldn't try to learn Swing from the
online Java API documents!

David H.

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] High School Programming for Newbies

2005-02-25 Thread David Handy
On Thu, Feb 24, 2005 at 08:39:56PM -0600, Joseph Ehlers wrote:
> Dear Python Community,

...

> My high school is not turning out programmers; we are just trying to
> expose students to computer science and programming and to help them think
> logically through problems.  We are trying to prepare them for college
> computer science.  From my research, Python's strengths seem to be:  easy
> to learn, simple syntax, fun, allows students to spend time thinking about
> the problem versus fixing syntax, transitions nicely into Java, and
> develops logical thinking.  All that sounds great, just what we are tying
> to accomplish and I can't wait for the course.  
>
> (I'm finally getting to my question.)  Now some people are telling me that
> we need to offer C++.  Help! I don't think I can fit more into the
> curriculum and do justice to any one language.  One of our goals is to
> offer AP Computer Science Java in the future and we want the students
> adequately prepared for that language.  What is the opinion of the Python
> Edu-Sig community?  Should we offer C++?  And if so, where would it fit
> into the curriculum? 

You summed up very well what you are trying to accomplish with your school's
computer programming curriculum (teach logical thinking and problem solving,
prepare for a transition into Java should the student go on to computer
science in college) and you say that Python is meeting that need.

So the question is, why are "some people" telling you that you need to offer
C++? What need do they think is not being met that C++ can fill? If "they"
are telling you that you need to offer C++, then the burden is on "them" to
explain why. The only possible reason you give for C++ is to be adequately
prepared for Java. So why not just offer Java instead of C++? Java is easier
for new programmers.

I am a professional software developer with years of experience programming
in C++. About four years ago, my company (and every other company I am aware
of) that was doing application development in C++ switched over to C# or
Java (I did both). I haven't done any C++ development since. Switching from
C++ to Java and C# at least doubled my productivity, and when I am allowed
to use Python, that at least doubles my productivity over C# or Java. C and
C++ are low-level lanaguages that are best left for low-level tasks such as
device drivers, directly interfacing with the operating system, or things
that require very high performance such as 3D graphics libraries (most
programmers just use such libraries, they don't write their own).

Sure, it may be educational to teach students C or C++ so they can
appreciate the trials that the previous generation had to go through before
we had decent high-level languages. Also teaching C or C++ can be helpful as
part of a big picture overview that includes understanding the hardware and
the operating system. Maybe those goals are what "they" had in mind when
they recommended adding C++ to curriculum, but those are not what you said
your goals were. Perhaps understanding the history, the hardware, and the OS
at that advanced level is more of a college-level goal anyway.

David H.
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Help Testing IDLD patch

2004-12-15 Thread David Handy
On Wed, Dec 15, 2004 at 12:33:49PM -0600, John Zelle wrote:

> I was more concerned about IDLE 1.04's instablility under Windows. I 
> have a very simple test that causes IDLE to hang, and it does not appear 
> to be fixed in IDLE 1.1.

I'd like to try out your fix on my Windows 98 machine, but I'm not sure if
I'm seeing the same problem as you.

Please post your simple test that causes IDLE to hang.

Thanks,

David H.
___
Edu-sig mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/edu-sig