From jurgis.pralgauskis at gmail.com Wed May 5 23:08:24 2010 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Thu, 6 May 2010 00:08:24 +0300 Subject: [Edu-sig] programming skills and IQ tests.. Message-ID: Hello, I think one of best ways to teach programming is with examples (of course with a bit of theory explanation). I'd like to test my students' general ability to undersnand examples. Because I am confused, is it my fault or their laziness, or sth else, that some of them (nearly 30%) understnand nearly nothig what they were taught. Main question of email: Does anyone know freely distributable DB of such IQ quiz questions -- preferrably mostly graphical, like http://iq-test.co.uk/iq-test/ or so I think it could come in handy for others (mathematics here as well)... I also hope, one can train the attention/concentration with IQ tests -- which is verty important skill in understanding examples. Thanks in advance -- Jurgis Pralgauskis Don't worry, be happy and make things better ;) From jrgray at gmail.com Thu May 6 06:34:13 2010 From: jrgray at gmail.com (Jeremy Gray) Date: Thu, 6 May 2010 00:34:13 -0400 Subject: [Edu-sig] programming skills and IQ tests.. In-Reply-To: References: Message-ID: Hi Jurgis, being edu-sig, I'll send this to the list and not just you personally, despite it having somewhat low actual python content. I teach at grad and undergrad level, and do research into individual differences in self-control, and sometimes use IQ tests (see http://www.yale.edu/scan/) python is pretty useful in the lab, especially PsychoPy. I'd like to test my students' general ability to undersnand examples. > Because I am confused, is it my fault or their laziness, or sth else, > that some of them (nearly 30%) understnand nearly nothig what they were > taught. > rather than to get into assessing and interpreting IQ-ish scores, I think you'd be much better off asking other teachers / instructors for advice on how to get through to those 30%. from what you are saying, the real problem you want to solve is how to get through to those students, right? maybe a mentor teacher can sit in and observe you and the class and offer suggestions? or ask someone who taught the course previously what examples they used, and how the course went? maybe you could ask students for anonymous feedback after each class one what was really clear and what was really unclear. (how useful this might depend on the age group.) you might ask about whether students can see well enough, hear well enough, and so on. it sounds like you are hoping to tease apart motivation from ability, which is not a trivial thing to do. for this, giving students problems to do in class is unlikely to be informative: its the same class (with the same social setting including distractions, history of expectations, etc), the same time of day (fatigue, etc). its not just as simple as giving a page of problems out, and getting a score. once it become "IQ" there's an implicit threat of revealing that a given student is either lazy or incompetent, so some will become nervous and do poorly as a result. and there's what's called stereotype threat, which is the fear of confirming a negative stereotype about one's racial or ethnic group. its basically a way of eliciting anxiety that interferes with performance, and everyone is susceptible to it (including white males in the context of being compared to Asian males on a math-y test). so IQ: its better not to go there if you don't have to. and the real problem is getting through to that 30%, not quantifying their ability. if you still want to go the IQ route, out of personal curiosity or whatever, you would be better off if you can obtain student scores on a standardized test that someone else has already administered, on which the student was personally invested in doing well, and took under optimal conditions (low distraction, etc). if you are in a school setting, maybe there's a way to work with the administration to get standardized test scores? if these are college level, SAT scores work surprisingly well as a measure of general cognitive ability (you can convert one into the other with pretty high accuracy, for individual people). or perhaps down the road we could collaborate on a research project :o) I'm only half-kidding. there would have to be a scientific question, not just an assessment of students in a class. > Main question of email: > Does anyone know freely distributable DB of such IQ quiz questions -- > preferrably mostly graphical, like > http://iq-test.co.uk/iq-test/ or so > sorry, I don't know of any but I've toyed with the idea of developing a battery of mini-tasks for this. there are a number of pretty creative, and non-threatening tasks out there that correlate to some degree with IQ. reaction time does, for example. if we got enough of such tasks, implemented as mini-games in python, ... could be interesting. > I think it could come in handy for others (mathematics here as well)... > I also hope, one can train the attention/concentration with IQ tests > -- which is verty important skill in understanding examples. > yes, its possible to train attention / concentration to some degree, hard, but possible. people in my field talk about "working memory training" (for which the wikipedia page is pretty bad and out of date). the most interesting study I've seen is by Jaeggi et al, available free, http://www.ncbi.nlm.nih.gov/pubmed/18443283 (or pdf: http://www.pnas.org/content/105/19/6791.full.pdf+html) best regards, --Jeremy -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu May 6 06:48:51 2010 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 5 May 2010 21:48:51 -0700 Subject: [Edu-sig] programming skills and IQ tests.. In-Reply-To: References: Message-ID: On Wed, May 5, 2010 at 2:08 PM, Jurgis Pralgauskis wrote: > Hello, > > I think one of best ways to teach programming is with examples (of > course with a bit of theory explanation). > I'd like to test my students' general ability to undersnand examples. > Because I am confused, is it my fault or their laziness, or sth else, > that some of them (nearly 30%) understnand nearly nothig what they were taught. > Reconcile yourself to a bell curve response (including to IQ tests) and don't berate students in the lower 30%, as you yourself are in the lower 30% on other axes of measure (so many types of IQ). We all fall short, in one dimension or another. Python and/or whatever is not for everyone, CP4E notwithstanding. The goal is to provide ample opportunity, not insist that everyone "get it" (whatever that means). There's a difference between being friendly and insisting on being a friend. Kirby From punch at cse.msu.edu Thu May 6 18:57:59 2010 From: punch at cse.msu.edu (Bill Punch) Date: Thu, 06 May 2010 12:57:59 -0400 Subject: [Edu-sig] programming skills and IQ tests.. In-Reply-To: References: Message-ID: <4BE2F517.8010100@cse.msu.edu> There are a number of papers on the topic of measuring programmer aptitude. In general, I would strongly recommend looking through the Psychology of Programming Interest Group (PPIG, http://www.ppig.org). One paper in particular attracted a lot of attention about 4 years ago: "Testing Programmer Aptitude" (http://www.ppig.org/papers/18th-dehnadi.pdf). It was controversial at the time but was followed up sometime later. Have a look at the author's web page: Saeed Dehnadi (http://www.eis.mdx.ac.uk/research/PhDArea/saeed/) for his followups Another article that tries to measure aptitude is Jeff Kramer's article on abstraction (in the Piaget sense) as a measure. (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.120.6776&rep=rep1&type=pdf) though see the following for a, kind of, rebuttal (http://portal.acm.org/citation.cfm?id=1138430). >>>bill<<< Jurgis Pralgauskis wrote: > Hello, > > I think one of best ways to teach programming is with examples (of > course with a bit of theory explanation). > I'd like to test my students' general ability to undersnand examples. > Because I am confused, is it my fault or their laziness, or sth else, > that some of them (nearly 30%) understnand nearly nothig what they were taught. > > Main question of email: > Does anyone know freely distributable DB of such IQ quiz questions -- > preferrably mostly graphical, like > http://iq-test.co.uk/iq-test/ or so > > I think it could come in handy for others (mathematics here as well)... > > I also hope, one can train the attention/concentration with IQ tests > -- which is verty important skill in understanding examples. > > > Thanks in advance > From ajudkis at verizon.net Fri May 7 02:59:00 2010 From: ajudkis at verizon.net (Andy Judkis) Date: Thu, 06 May 2010 20:59:00 -0400 Subject: [Edu-sig] programming skills and IQ tests.. In-Reply-To: References: Message-ID: <4BE365D4.4000809@verizon.net> I think this is a really interesting topic. I've been teaching a general "here's how computers work" class to all the 10th graders in my school for about 6 years now. Like Jurgis, I find that about 30% of the kids just don't get it. I'm just resigned to that, and my goal is to have them not HATE it, and to have at least an understanding of why other people like it. I went to the opera for the first time last week, it was Der Fliegende Hollander, at the Met. Over 2 hours without an intermission. Not my cup of tea. At the end of it the woman in front of us was sobbing, I thought it was tears of relief that it was finally over but my wife says that she was deeply moved by the story. Needless to say, I'm not in a hurry to go back, but even so I'm glad to have gone once. I think that programming is like that for some people -- they'll never love it, but it's still a good thing to have experienced. Cheers, Andy From jurgis.pralgauskis at gmail.com Fri May 7 15:27:33 2010 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Fri, 7 May 2010 16:27:33 +0300 Subject: [Edu-sig] programming skills and IQ tests.. In-Reply-To: <4BE365D4.4000809@verizon.net> References: <4BE365D4.4000809@verizon.net> Message-ID: Thanks to all, especially Jeremy. still now I don't have time to read everything, but problem is complex, I agree. as those students seem nearly unable to understand math (so I guess generally aren't used to problem solving). and they are ususally quite unpatient.. ===================== I'll explain in more detail: this might be the problem of my countries education system..., (I teach 1 year college students -- and in 3 years they should become "network admins"...) and I give them half made mini programs in Scratch (http://scratch.mit.edu) and they are unable to finish them :( for example, if we have object moving in an inside of rectangle area, and when it approaches one side of rectangle -- ith should "teleport/jump" to the opposite site rectangle is (-200, -150) to (200, 150) I give one side as example (in Scratch) and they have to finish if x > 200: x = -200 most of 30% "loosers" succseed, (not without help from others). then I ask, that sides could shrink (and need variables) right = 200 left = -200 if x > right: x = left right = right - 40 if x < left: x = right left = left + 40 and they should finish it for top/bottom and this is a "damn hard" task... :/ =============== my idea for the next year is to prepair mini tests for students to: - to practice programming-like problem solving - to test their level and to see, what they lack most - help them make up minds, if they want/dare to have programming On Fri, May 7, 2010 at 3:59 AM, Andy Judkis wrote: > I think this is a really interesting topic. ?I've been teaching a general > "here's how computers work" class to all the 10th graders in my school for > about 6 years now. ?Like Jurgis, I find that about 30% of the kids just > don't get it. ?I'm just resigned to that, and my goal is to have them not > HATE it, and to have at least an understanding of why other people like it. -- Jurgis Pralgauskis tel: 8-616 77613; Don't worry, be happy and make things better ;) http://kompiuterija.pasimokom.lt From jurgis.pralgauskis at gmail.com Sat May 8 13:04:41 2010 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Sat, 8 May 2010 14:04:41 +0300 Subject: [Edu-sig] The perfect IT environment in a school In-Reply-To: References: Message-ID: in such cases http://portableapps.com/ and http://www.portablepython.com/ could help or maybe even some LiveCD/LiveUSB On Fri, Apr 30, 2010 at 10:19 AM, Jan Ulrich Hasecke wrote: > Hi, > > since three years I am guiding a Python voluntary workgroup in a school > and we are suffering from a badly organized IT environment (a rigidly > restricted Windows setting). > > Most of all we miss a decent VCS as Mercurial or Bazaar. In the official > IT classes they never used a VCS so it was never installed. > > While thinking about this I discovered that some other things are > missing. For eg. we cannot install a web framework due to the strange > restrictions. They do not have Zotero installed. For students the > FF-plugin Zotero would be a great tool to make bibliographies. > > Does anyone yet compiled a list of things which may not be missing in a > perfect IT environment in a school? Perhaps I can lobby some teachers to > improve their environment. > > juh > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- Jurgis Pralgauskis tel: 8-616 77613; Don't worry, be happy and make things better ;) http://kompiuterija.pasimokom.lt From blakeelias at gmail.com Sat May 8 17:21:11 2010 From: blakeelias at gmail.com (Blake) Date: Sat, 8 May 2010 11:21:11 -0400 Subject: [Edu-sig] The perfect IT environment in a school In-Reply-To: References: Message-ID: On Sat, May 8, 2010 at 7:04 AM, Jurgis Pralgauskis wrote: > > in such cases http://portableapps.com/ and > http://www.portablepython.com/ could help > > or maybe even some LiveCD/LiveUSB Have you considered Sugar on a Stick? The UI is far different from Windows and might not be appropriate, but it's Linux under the hood with terminal, Python support, etc. http://wiki.sugarlabs.org/go/Sugar_on_a_Stick Blake Elias > > On Fri, Apr 30, 2010 at 10:19 AM, Jan Ulrich Hasecke > wrote: > > Hi, > > > > since three years I am guiding a Python voluntary workgroup in a school > > and we are suffering from a badly organized IT environment (a rigidly > > restricted Windows setting). > > > > Most of all we miss a decent VCS as Mercurial or Bazaar. In the official > > IT classes they never used a VCS so it was never installed. > > > > While thinking about this I discovered that some other things are > > missing. For eg. we cannot install a web framework due to the strange > > restrictions. They do not have Zotero installed. For students the > > FF-plugin Zotero would be a great tool to make bibliographies. > > > > Does anyone yet compiled a list of things which may not be missing in a > > perfect IT environment in a school? Perhaps I can lobby some teachers to > > improve their environment. > > > > juh > > > > _______________________________________________ > > Edu-sig mailing list > > Edu-sig at python.org > > http://mail.python.org/mailman/listinfo/edu-sig > > > > > > -- > Jurgis Pralgauskis > tel: 8-616 77613; > Don't worry, be happy and make things better ;) > http://kompiuterija.pasimokom.lt > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig From kirby.urner at gmail.com Sat May 8 21:36:58 2010 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 8 May 2010 12:36:58 -0700 Subject: [Edu-sig] The perfect IT environment in a school In-Reply-To: References: Message-ID: On Fri, Apr 30, 2010 at 12:19 AM, Jan Ulrich Hasecke wrote: > Hi, > > since three years I am guiding a Python voluntary workgroup in a school > and we are suffering from a badly organized IT environment (a rigidly > restricted Windows setting). > > Most of all we miss a decent VCS as Mercurial or Bazaar. In the official > IT classes they never used a VCS so it was never installed. > > While thinking about this I discovered that some other things are > missing. For eg. we cannot install a web framework due to the strange > restrictions. They do not have Zotero installed. For students the > FF-plugin Zotero would be a great tool to make bibliographies. > > Does anyone yet compiled a list of things which may not be missing in a > perfect IT environment in a school? Perhaps I can lobby some teachers to > improve their environment. > > juh > Some thoughts: A perfectly designed IT environment for a school is not modeled on the commercial private company with a closed shop IT department responsive to users in the rest of the company. Rather, given the school is supposed to be teaching IT skills, the students and faculty together co-manage and plan the school's IT functions. There is no sense of us-and-them, although some students and faculty choose to become more deeply involved than others, given temperament and predilections. Perhaps one gets assistance from consultants or district geeks, volunteers in the private sector, but faculty and students are still responsible for their own school's internal network at the end of the day. There is no separate IT department per se, only a set of positions that people rotate through, sysop A for awhile, sysop B for another spell, and so forth, with responsibilities partially overlapping. Classroom content includes explaining and training for these jobs. At the hardware level, a decision is whether to have standalone workstations with local hard drives, perhaps sharing a server, or dumb terminals, with servers doing a lot of the processing. ** At Free Geek, we would convert some of the former into the latter species by removing hard drives and installing booting ethernet cards that would take one directly to the LAN. Everything was server-based. In some ways, I think that's a better model for a school, as local drives tend to over-specialize the workstation in question. Best if you get access to all your files and projects no matter which terminal you choose, be that in your dorm (presuming dorms) or the library (presuming libraries). Of course it's not either/or. Students and faculty may have personal laptops or netbooks, with the school providing only terminals, but with USB ports. Laptops may have VPN access to server-based personal accounts via wifi or ethernet. Letting faculty and students govern the shared infrastructure does not mean falling away from best practices necessarily, though the standards should be different where academia is concerned, as here a premium is placed on openness in the liberal arts tradition (presuming a school of that character, not saying all of them are). Students experience a lot of freedom to download and install, to experiment with new material. The shared operating system needs to be tight enough to permit local experimentation, without endangering or corrupting the work in neighboring accounts. That's what the great multi-user operating systems of this world are designed to provide: relatively well insulated processes and channels, that allow individual users ways to mount devices, manage a branching file system, with user-controllable sharing with peers and limited powers to wreak havoc. The corporate IT curricula are training sysops to lock everything down pretty tightly in hopes of frustrating any cyber attacks. A problem with this approach is one starts to treat every employee as a potential threat and IT becomes both adversarial and prosecutorial regarding company infrastructure. In an academic setting, this fortress mentality puts a damper on scholarship more generally, resulting in a dumbed down internal culture -- a vicious circle that may lead to a school's suffering some loss of reputation. The ideal liberal arts academy or think tank is transparent enough to not care about proprietary scholarship leaking out, as the whole point of research is to share it with the public. Of course that's a completely idealized view, whereas in truth many secrets are jealously protected within academia, where people have the same human impulse to sometimes keep stuff under wraps. A 4-way collaboration between local faculty, students, alumni, and a cloud computing platform, customized specifically for a given school, is a likely long term pattern. Students don't necessarily want to drop their accounts just because they graduate from the school. Alumni include faculty as well. If the school provides public-facing web pages for students, faculty and alums, then we're looking at a pretty serious IT operation. Finding ways to keep it manageable would be a constant curriculum challenge. One could argue that no school should grow beyond it's ability to manage its own internal IT. Simply providing logos for alums to stick in their own Facebook accounts might be the better way to go. Why reinvent the wheel? Kirby ** cached local memory on Flash drives might be a part of this picture. From kirby.urner at gmail.com Sun May 16 03:28:19 2010 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 15 May 2010 18:28:19 -0700 Subject: [Edu-sig] Calling functions... Message-ID: Something I maybe hadn't been clear on before cramming for a workshop: Even functions with purely positional parameters may be passed a dict, in which case the positional parameters will be treated like named ones, i.e. the dict will map to them. I'll use the new formating protocol: >>> from __future__ import print_function >>> def f(a, b, c): print("a={0}, b={1}, c={2}".format(a,b,c)) >>> f(1,2,3) a=1, b=2, c=3 Here's what I'm illustrating: >>> thedict = dict(c=5,a=10,b='cat') >>> f(**thedict) a=10, b=cat, c=5 Now what if we try to sneak in an argument that doesn't map: >>> thedict = dict(c=5,a=10,b='cat', d='dog') >>> f(**thedict) Traceback (most recent call last): File "", line 1, in f(**thedict) TypeError: f() got an unexpected keyword argument 'd' The d is caught, an exception is raised. So here we might add the all purpose "pooper scooper" (yeah, scatological -- sometimes effective pedagogy): >>> def f(a, b, c, **kwargs): print("a={0}, b={1}, c={2}".format(a,b,c)) The d now gets through, though nothing echoes: >>> f(**thedict) a=10, b=cat, c=5 Lets make sure we see what's in "overflow": >>> def f(a, b, c, **kwargs): print("a={0}, b={1}, c={2}".format(a,b,c)) print(kwargs) >>> f(**thedict) a=10, b=cat, c=5 {'d': 'dog'} Is an all purpose pooper scooper allowed to have defaults? No, default arguments are what turn parameters into named parameters. *args and **kwargs (often so named by convention) are not named parameters so much as "collectors" of "overflow" arguments (made-up terminology). >>> def f(a, b, c, d='dog', *e): print("a={0}, b={1}, c={2} d={3} e={4}".format(a,b,c,d,e)) >>> f(**thedict) a=10, b=cat, c=5 d=dog e=() >>> Speaking of made-up terminology, when I pass **thedict as an argument, I tend to think of the ** as "explode". If you don't double-star it, it goes through as just the one argument and an exception gets raised: >>> f(thedict) Traceback (most recent call last): File "", line 1, in f(thedict) TypeError: f() takes at least 3 arguments (1 given) The same "explode" operator works for tuples in that it "unpacks" the one argument into len(tuple) arguments. The typical use is to make (x,y,z)-tuples map to some function that expects x, y and z as separate arguments. The error messages remind us when we fail to "explode" one argument into many: >>> def f(x, y, z): return x**2 + y**2 + z**2 >>> f(1,2,3) 14 >>> coords = (1,2,3) >>> f(coords) Traceback (most recent call last): File "", line 1, in f(coords) TypeError: f() takes exactly 3 arguments (1 given) >>> f(*coords) 14 >>> f(dict(y=2,x=1,z=3)) Traceback (most recent call last): File "", line 1, in f(dict(y=2,x=1,z=3)) TypeError: f() takes exactly 3 arguments (1 given) >>> f(**dict(y=2,x=1,z=3)) 14 Kirby From macquigg at ece.arizona.edu Sun May 16 22:14:19 2010 From: macquigg at ece.arizona.edu (David MacQuigg) Date: Sun, 16 May 2010 13:14:19 -0700 Subject: [Edu-sig] Calling functions... In-Reply-To: References: Message-ID: <4BF0521B.40508@ece.arizona.edu> Hey Kirby!! This is the best explanation I've seen of Python's argument passing subtleties. If you don't mind I would like to post it on our PyKata website in a section "Tips from the Masters", with you as author, of course. We could also put a link to a page on your website, if you prefer. -- Dave ************************************************************ * * David MacQuigg, PhD email: macquigg at ece.arizona.edu * * * Research Associate phone: USA 520-721-4583 * * * * ECE Department, University of Arizona * * * * 9320 East Mikelyn Lane * * * * http://purl.net/macquigg Tucson, Arizona 85710 * ************************************************************ * kirby urner wrote: > ... > > Even functions with purely positional > parameters may be passed a dict, in > which case the positional parameters > will be treated like named ones, i.e. > the dict will map to them. > > I'll use the new formating protocol: > > >>>> from __future__ import print_function >>>> > > >>>> def f(a, b, c): >>>> > print("a={0}, b={1}, c={2}".format(a,b,c)) > > > >>>> f(1,2,3) >>>> > a=1, b=2, c=3 > > Here's what I'm illustrating: > > >>>> thedict = dict(c=5,a=10,b='cat') >>>> > > >>>> f(**thedict) >>>> > a=10, b=cat, c=5 > > Now what if we try to sneak in an argument > that doesn't map: > > >>>> thedict = dict(c=5,a=10,b='cat', d='dog') >>>> f(**thedict) >>>> > > Traceback (most recent call last): > File "", line 1, in > f(**thedict) > TypeError: f() got an unexpected keyword argument 'd' > > The d is caught, an exception is raised. > > So here we might add the all purpose "pooper scooper" > (yeah, scatological -- sometimes effective pedagogy): > > >>>> def f(a, b, c, **kwargs): >>>> > print("a={0}, b={1}, c={2}".format(a,b,c)) > > The d now gets through, though nothing echoes: > > >>>> f(**thedict) >>>> > a=10, b=cat, c=5 > > Lets make sure we see what's in "overflow": > > >>>> def f(a, b, c, **kwargs): >>>> > print("a={0}, b={1}, c={2}".format(a,b,c)) > print(kwargs) > > > >>>> f(**thedict) >>>> > a=10, b=cat, c=5 > {'d': 'dog'} > > Is an all purpose pooper scooper allowed to have > defaults? No, default arguments are what turn > parameters into named parameters. *args and > **kwargs (often so named by convention) are > not named parameters so much as "collectors" > of "overflow" arguments (made-up terminology). > > >>>> def f(a, b, c, d='dog', *e): >>>> > print("a={0}, b={1}, c={2} d={3} e={4}".format(a,b,c,d,e)) > > > >>>> f(**thedict) >>>> > a=10, b=cat, c=5 d=dog e=() > > > Speaking of made-up terminology, when I pass > **thedict as an argument, I tend to think of the > ** as "explode". > > If you don't double-star it, it goes through as just > the one argument and an exception gets raised: > > >>>> f(thedict) >>>> > > Traceback (most recent call last): > File "", line 1, in > f(thedict) > TypeError: f() takes at least 3 arguments (1 given) > > The same "explode" operator works for tuples in > that it "unpacks" the one argument into len(tuple) > arguments. The typical use is to make (x,y,z)-tuples > map to some function that expects x, y and z as > separate arguments. > > The error messages remind us when we fail to > "explode" one argument into many: > > >>>> def f(x, y, z): >>>> > return x**2 + y**2 + z**2 > > >>>> f(1,2,3) >>>> > 14 > >>>> coords = (1,2,3) >>>> f(coords) >>>> > > Traceback (most recent call last): > File "", line 1, in > f(coords) > TypeError: f() takes exactly 3 arguments (1 given) > >>>> f(*coords) >>>> > 14 > >>>> f(dict(y=2,x=1,z=3)) >>>> > > Traceback (most recent call last): > File "", line 1, in > f(dict(y=2,x=1,z=3)) > TypeError: f() takes exactly 3 arguments (1 given) > >>>> f(**dict(y=2,x=1,z=3)) >>>> > 14 > > Kirby > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > > From kirby.urner at gmail.com Sun May 16 22:52:04 2010 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 16 May 2010 13:52:04 -0700 Subject: [Edu-sig] Calling functions... Message-ID: Hey Kirby!! This is the best explanation I've seen of Python's argument passing subtleties. If you don't mind I would like to post it on our PyKata website in a section "Tips from the Masters", with you as author, of course. We could also put a link to a page on your website, if you prefer. -- Dave Would be great on PyKata! Kirby From mikle3d2 at gmail.com Tue May 18 09:46:13 2010 From: mikle3d2 at gmail.com (mikle3d kys) Date: Tue, 18 May 2010 11:46:13 +0400 Subject: [Edu-sig] MasterCard Marketplace to revolutionize online shopping experience In-Reply-To: References: Message-ID: MasterCard Worldwide announced a three-year exclusive alliance in the payments space with Next Jump Inc a next-generation e-commerce company, to revolutionize the online shopping experience. The strategic agreement will allow the companies to work together to harness their combined assets in the payments technology, e-commerce and digital marketing space to drive innovation for the industry and improve the consumer experience. It will also give MasterCard access to Next Jump?s extensive aggregated e-commerce network, human capital through its digital technology engineers, and an agile development process to fuel innovation and drive speed to market for relevant and desirable e-commerce solutions that meet consumer demands. ?Our new alliance with Next Jump will allow MasterCard to make game-changing advances in the online channel, which is ripe for innovation in a way that allows consumers to have a simple, seamless, secure and valuable experience wherever they are in the world and through whatever device they access the Internet,? says Josh Peirez, Group Executive of Innovative Platforms, MasterCard Worldwide. ?The deal is a result of our approach to innovation that is based on deep analysis of the landscape looking at areas of opportunity and identifying leading technologies to help us best meet our customers? evolving needs.? ?MasterCard is an ideal match for Next Jump and we are looking forward to partnering our unique, data-driven approach and technology with their powerful network and insights,? says Charlie Kim, Founder and CEO of Next Jump. ?Next Jump has a unique model that benefits both merchants and consumers. For merchants, Next Jump enables sales as a trusted partner ? we never compete with them. Our technology allows merchants to re-direct ad spend towards better pricing in return for guaranteed sales. The merchant analytics from this model are incredibly impressive, allowing merchants to step up or down their participation in the program. For consumers, the best customers are rewarded with lower prices and/or VIP access to newest, hard-to-get, sold out products. Consumers that either spend more or have greater influence in getting others to shop ? are the best customers and are rewarded accordingly.? -------------- next part -------------- An HTML attachment was scrubbed... URL: From asweigart at gmail.com Wed May 19 23:20:20 2010 From: asweigart at gmail.com (Albert Sweigart) Date: Wed, 19 May 2010 14:20:20 -0700 Subject: [Edu-sig] Invent Your Own Computer Games with Python book now on Amazon Message-ID: Hello everyone. I've written a book called "Invent Your Own Computer Games with Python" which is freely available under a Creative Commons license at http://inventwithpython.com The print version is now also available on Amazon.com at http://www.amazon.com/Invent-Your-Computer-Games-Python/dp/0982106017/ Unlike many other programming books which cover programming concepts and principles without concrete examples, each chapter in "Invent with Python" features the complete source code for a small game (Guess the Number, Tic Tac Toe, Hangman, Encryption, Othello, etc.) and then explains the code line by line, covering programming concepts as they are used. This is similar to the old source code listings in Byte magazine and other books on BASIC. The online html and pdf versions are free and unabridged. The print version is $25 and qualifies for free shipping. (I wanted to make the book as affordable as possible, especially compared to other programming books.) If you know of an educational institute or nonprofit that would like to make a bulk purchase, I can lower the price to about $7 a copy (plus shipping). I'm always open to questions and criticisms, or if anyone knows of teachers or after-school computer clubs that could make use of this book. Thanks! -Al Sweigart From droujkova at gmail.com Wed May 19 23:39:06 2010 From: droujkova at gmail.com (Maria Droujkova) Date: Wed, 19 May 2010 17:39:06 -0400 Subject: [Edu-sig] Invent Your Own Computer Games with Python book now on Amazon In-Reply-To: References: Message-ID: This Spring, we used Al's book for six weeks of a homeschool "Physics and Modeling" class. I am extremely happy with the book. Students really, really liked the book! Here are a few of their applets: http://physicsmathmodeling.wikispaces.com/Our+Python+program+gallery They said the book was easy to use, fun, and supported independent exploration. I very much appreciated having this great resource available. Thank you very much, Al! Cheers, Maria Droujkova http://www.naturalmath.com Make math your own, to make your own math. On Wed, May 19, 2010 at 5:20 PM, Albert Sweigart wrote: > Hello everyone. I've written a book called "Invent Your Own Computer > Games with Python" which is freely available under a Creative Commons > license at http://inventwithpython.com The print version is now also > available on Amazon.com at > http://www.amazon.com/Invent-Your-Computer-Games-Python/dp/0982106017/ > > Unlike many other programming books which cover programming concepts > and principles without concrete examples, each chapter in "Invent with > Python" features the complete source code for a small game (Guess the > Number, Tic Tac Toe, Hangman, Encryption, Othello, etc.) and then > explains the code line by line, covering programming concepts as they > are used. This is similar to the old source code listings in Byte > magazine and other books on BASIC. > > The online html and pdf versions are free and unabridged. The print > version is $25 and qualifies for free shipping. (I wanted to make the > book as affordable as possible, especially compared to other > programming books.) If you know of an educational institute or > nonprofit that would like to make a bulk purchase, I can lower the > price to about $7 a copy (plus shipping). > > I'm always open to questions and criticisms, or if anyone knows of > teachers or after-school computer clubs that could make use of this > book. > > Thanks! > > -Al Sweigart > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.roberge at gmail.com Fri May 21 18:15:46 2010 From: andre.roberge at gmail.com (Andre Roberge) Date: Fri, 21 May 2010 13:15:46 -0300 Subject: [Edu-sig] Question for Guido van Robot, RUR-PLE and other Karel the robot clone users Message-ID: Karel the robot introduced by Pattis in 1981 included a turnoff instruction. Since then, every clone seems to include that instruction as well. I have never seen a pedagogical reason given for including the turnoff instruction. I have yet to see a good example where the use of that instruction is required... Karel the robot is used as a mini-language to introduce programming concepts. An alternative visual environment is provided by turtle graphics. When I look at turtle graphics, there is no turnoff instruction ... As I am working on a new rur-ple version, I was wondering if it would not be preferable to simply drop the turnoff [turn_off() in rur-ple] instruction. If you use GvR or rur-ple or any other Karel like environment to teach programming concepts, or if you have used such an environment when you started learning yourself, I would definitely be interested in hearing your opinion. Cheers, Andr? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajudkis at verizon.net Sat May 22 13:00:22 2010 From: ajudkis at verizon.net (Andy Judkis) Date: Sat, 22 May 2010 07:00:22 -0400 Subject: [Edu-sig] Question for Guido van Robot, RUR-PLE and other Karel the robot clone users (Andre Roberge) In-Reply-To: References: Message-ID: <4BF7B946.1040103@verizon.net> I just finished using RUR-PLE to introduce programming for probably the 10th time, and I still feel that it's just about ideal as a starting point for Python. If you haven't looked at it, I highly recommend giving it a try. Every time I teach it, I mean to send Andre an email saying "you know, we can just drop this turn_off() thing", but I never remember. I can't think of any programming concept that turn_off() teaches, and there are always a few kids who confuse it with return. Cheers, Andy > Karel the robot introduced by Pattis in 1981 included a turnoff > instruction. Since then, every clone seems to include that instruction as > well. > > I have never seen a pedagogical reason given for including the turnoff > instruction. I have yet to see a good example where the use of that > instruction is required... > > Karel the robot is used as a mini-language to introduce programming > concepts. An alternative visual environment is provided by turtle > graphics. When I look at turtle graphics, there is no turnoff instruction > ... > > As I am working on a new rur-ple version, I was wondering if it would not be > preferable to simply drop the turnoff [turn_off() in rur-ple] instruction. > > If you use GvR or rur-ple or any other Karel like environment to teach > programming concepts, or if you have used such an environment when you > started learning yourself, I would definitely be interested in hearing your > opinion. > > Cheers, > > Andr? > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > > > End of Edu-sig Digest, Vol 82, Issue 9 > ************************************** > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.819 / Virus Database: 271.1.1/2887 - Release Date: 05/21/10 02:26:00 > > From kirby.urner at gmail.com Wed May 26 21:58:20 2010 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 26 May 2010 12:58:20 -0700 Subject: [Edu-sig] Factory functions: synthesizing top-level names Message-ID: Creating Top-Level names root0, root1, root2... rootN Setting the stage: We've come across an ethnicity, in our voyages of the starship whatever, that doesn't share our fascination with squares and cubes. For example, when multiplying n * n, it never occurred to them to picture n * n squares in a checkerboard pattern. Rather, they have a more Chinese Checkers bias towards triangles and hexagons, and their picture of n * n is an equilateral triangle subdivided into n ** 2 similar sub-triangles. Likewise, their picture of n * n * n, or n**3 is a tetrahedron, though here the subdividing process results in a matrix known to Earthlings ("terra-ists") as the FCC and/or CCP and/or... whatever Earthling terminology. The Challenge: The anthropologist-astronauts we've left behind to work and study with these people (to be collected on a next pass a year from now, unless they plan on staying longer), are using Python, and find that saying 'sqrt' just gets in the way (keeps them habituated to patterns of thought they're trying to snap out of). What they'd like to do is this: for 2nd, 3rd, 4th, 5th etc. root of a number, have the functions root2, root3, root4... up to root10 routinely available, perhaps in a module called roots or radicals. >>> import radicals as r >>> r.root3 ( 2.0 / 3.0 ) 0.8735804647362989 So how might we generate root0... root10 in a factory function, such that these function names become top level within their generating and/or defining module? True, we could individually define these functions per the example below, but what is a clever way of generating rootN in principle, such as root2012, taking 2012 as an argument. Hints: For root2, you might take an obvious shortcut: from math import sqrt as root2 For root3, consider the following: def root3 (x): return pow( x, 1.0/3.0 ) In general: def rootN (x): return pow( x, 1.0/N) Rationale for this exercise: Students often want a way to factory-produce new names at the top level, from within a contained scope (such as from within a function). These top level names may be of data, functions or whatever arbitrary objects. The production process often involves synthesizing new names on the fly, as strings. Strings are "right side" objects, usually assigned names, but not themselves names of anything. By what magic might we turn a string object into a top-level name: that is the question this lesson addresses. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu May 27 03:24:23 2010 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 26 May 2010 18:24:23 -0700 Subject: [Edu-sig] Factory functions: synthesizing top-level names In-Reply-To: References: Message-ID: > By what magic?might we turn a string object into > a top-level name: ?that is the question this lesson > addresses. I do have an answer in the queue, my proposed solution. However I'd be happy to see others toss in some ideas, just to test whether my lesson plan is clear enough to get across what the challenge is. Maybe not. On another front, I'm wanting to tell the story of free and open source software to a next generation of teen, and wondered if FOSS veterans here would have any feedback regarding the following thumbnail: GNU = GNU is not Unix and was the original inspiration for the free software movement, centered on what become known as the GNU Public License (GPL). The GPL was a way for copyright holders to insist that their hard work not be used only selfishly by others, that the fruits of their labors achieve maximum positive benefit for omni-humanity, to put a Global U spin on it. Once the GPL was out there getting the work done (e.g. Linux), a safe-enough ecosystem was developed for a bevy of alternative licensing schemes, some of which allow shops to take something inhouse, transform it, and release it under a more restrictive license agreement, if they release it at all. [ Python could be an example of this, in that developers of the IronPython codebase have been enabled to start with CPython, the original version, with the resulting codebase being free and open source under a different set of rules from the GPL or even from whatever the original Python was using. Actually, the story is more complicated than that, in that Jim H. first worked on the Java implementation before moving to C# in an attempt to prove the CLR (common language runtime) engine was unsuitable for dynamic languages. He came to the conclusion that the CLR engine could work, hence the IronPython project. ] The original context is some Google group (a new one). The relevant thread is accessible from this blog post FYI: http://mybizmo.blogspot.com/2010/05/math-reform.html Where it says: Rhombic Triacontahedra etc. (Synergetics list) -- Urner (I'm still adding to this list of May 2010 math reform writings). Kirby From andre.roberge at gmail.com Thu May 27 04:21:54 2010 From: andre.roberge at gmail.com (Andre Roberge) Date: Wed, 26 May 2010 23:21:54 -0300 Subject: [Edu-sig] Factory functions: synthesizing top-level names In-Reply-To: References: Message-ID: On Wed, May 26, 2010 at 4:58 PM, kirby urner wrote: > Creating Top-Level names root0, root1, root2... rootN > > SNIP > > What they'd like to do is this: for 2nd, 3rd, 4th, > 5th etc. root of a number, have the functions > root2, root3, root4... up to root10 routinely available, > perhaps in a module called roots or radicals. > > >>> import radicals as r > >>> r.root3 ( 2.0 / 3.0 ) > 0.8735804647362989 > > So how might we generate root0... root10 in a > factory function, such that these function names > become top level within their generating and/or > defining module? > > True, we could individually define these functions > per the example below, but what is a clever way > of generating rootN in principle, such as root2012, > taking 2012 as an argument. > > Ok, here's my solution: >>> def make_root(i): ... def _root(x): ... return pow(x, 1.0/i) ... return _root ... >>> for i in range(1, 11): ... locals()['root' + str(i)] = make_root(i) ... >>> root2(4) 2.0 >>> root4(64) 2.8284271247461903 >>> root6(64) 2.0 Cheers, Andr? > Hints: > > For root2, you might take an obvious shortcut: > > from math import sqrt as root2 > > For root3, consider the following: > > def root3 (x): return pow( x, 1.0/3.0 ) > > In general: > > def rootN (x): return pow( x, 1.0/N) > > Rationale for this exercise: > > Students often want a way to factory-produce > new names at the top level, from within a contained > scope (such as from within a function). > > These top level names may be of data, functions or > whatever arbitrary objects. The production process > often involves synthesizing new names on the fly, > as strings. Strings are "right side" objects, usually > assigned names, but not themselves names of > anything. > > By what magic might we turn a string object into > a top-level name: that is the question this lesson > addresses. > > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu May 27 07:44:14 2010 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 26 May 2010 22:44:14 -0700 Subject: [Edu-sig] Factory functions: synthesizing top-level names In-Reply-To: References: Message-ID: On Wed, May 26, 2010 at 7:21 PM, Andre Roberge wrote: > > Ok, here's my solution: > >>>> def make_root(i): > ...??? def _root(x): > ...???????? return pow(x, 1.0/i) > ...??? return _root > ... >>>> for i in range(1, 11): > ...???? locals()['root' + str(i)] = make_root(i) > ... >>>> root2(4) > 2.0 >>>> root4(64) > 2.8284271247461903 >>>> root6(64) > 2.0 > > Cheers, > Andr? > Much appreciated Andr?! I think our solutions are similar: """ http://mail.python.org/pipermail/edu-sig/2010-May/009998.html http://mail.python.org/pipermail/edu-sig/2010-May/009999.html """ def makeroot(N): try: assert type(N)==type(1) and N>=0 except: raise ValueError("0 <= N <= integer") fname = "root" + str(N) if N==0: fdef = "globals()['%s'] = lambda x: pow(x, 0)" % fname else: fdef = "globals()['%s'] = lambda x: pow(x, float(1)/%s)" % (fname,N) exec(fdef) Kirby From kirby.urner at gmail.com Thu May 27 07:52:31 2010 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 26 May 2010 22:52:31 -0700 Subject: [Edu-sig] Factory functions: synthesizing top-level names In-Reply-To: References: Message-ID: > > Much appreciated Andr?! > > I think our solutions are similar: > ... yours is better though, in that you don't make use of exec. My use of it was superfluous. Changing my solution, in light of yours: #=== def makeroot(N): try: assert type(N)==type(1) and N>=0 except: raise ValueError("0 <= N <= integer") fname = "root" + str(N) if N==0: globals()[fname] = lambda x: pow(x, 0) else: globals()[fname] = lambda x: pow(x, float(1)/N) for i in range(11): makeroot(i) #=== Kirby From andre.roberge at gmail.com Thu May 27 12:15:38 2010 From: andre.roberge at gmail.com (Andre Roberge) Date: Thu, 27 May 2010 07:15:38 -0300 Subject: [Edu-sig] Factory functions: synthesizing top-level names In-Reply-To: References: Message-ID: On Thu, May 27, 2010 at 2:52 AM, kirby urner wrote: > > > > Much appreciated Andr?! > It was a fun challenge. :-) > > > > I think our solutions are similar: > > > > ... yours is better though, in that you don't make use of exec. > > My use of it was superfluous. > > Changing my solution, in light of yours: > > #=== > > def makeroot(N): > try: > assert type(N)==type(1) and N>=0 > except: > raise ValueError("0 <= N <= integer") > > fname = "root" + str(N) > > if N==0: > globals()[fname] = lambda x: pow(x, 0) > else: > globals()[fname] = lambda x: pow(x, float(1)/N) > > > for i in range(11): > makeroot(i) > > #=== > > Technically, your use of globals() instead of locals(), like I did, is better, in that it allows you to have it inside a function body, and still be available at the module level, as per your stated goal. However, I find the use of lambda to be too restrictive, in principle, as it obviously works only for expressions, and not complex functions. If this example is to be used as a prototype to show students how to do this kind of name assignment, then the way I have done it with an inner named function (which I first learned about *years* ago, from a post from you on edu-sig! I believe it was http://mail.python.org/pipermail/edu-sig/2005-March/004590.html) is a better way to go. > Kirby > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu May 27 20:03:03 2010 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 27 May 2010 11:03:03 -0700 Subject: [Edu-sig] Factory functions: synthesizing top-level names In-Reply-To: References: Message-ID: On Thu, May 27, 2010 at 3:15 AM, Andre Roberge wrote: > > > On Thu, May 27, 2010 at 2:52 AM, kirby urner wrote: >> >> > >> > Much appreciated Andr?! > > It was a fun challenge. > ?:-) >> >> > >> > I think our solutions are similar: >> > >> >> ... yours is better though, in that you don't make use of exec. >> >> My use of it was superfluous. >> >> Changing my solution, in light of yours: >> >> #=== >> >> def makeroot(N): >> ? try: >> ? ? ? assert type(N)==type(1) and N>=0 >> ? except: >> ? ? ? raise ValueError("0 <= N <= integer") >> >> ? fname = "root" + str(N) >> >> ? if N==0: >> ? ? ? globals()[fname] = lambda x: pow(x, 0) >> ? else: >> ? ? ? globals()[fname] = lambda x: pow(x, float(1)/N) >> >> >> for i in range(11): >> ? ?makeroot(i) >> >> #=== >> > > Technically, your use of globals() instead of locals(), like I did, is > better, in that it allows you to have it inside a function body, and still > be available at the module level, as per your stated goal. > > However, I find the use of lambda to be too restrictive, in principle, as it > obviously works only for expressions, and not complex functions.? If this > example is to be used as a prototype to show students how to do this kind of > name assignment, then the way I have done it with an inner named function > (which I first learned about *years* ago, from a post from you on edu-sig! > I believe it was > http://mail.python.org/pipermail/edu-sig/2005-March/004590.html) is a better > way to go. > >> >> Kirby > Yes sir, I agree. The Python lambda is weak (on purpose) in not providing for full scale anonymous functions. Binding to the function object returned by an inner function def is a more liberal strategy, allows for more complexity. This thread will document these suggestions and nuances. Kirby From droujkova at gmail.com Sun May 30 23:58:45 2010 From: droujkova at gmail.com (Maria Droujkova) Date: Sun, 30 May 2010 17:58:45 -0400 Subject: [Edu-sig] Math 2.0 online live series: June overview Message-ID: Join these free, open, weekly live online events at Math 2.0 interest group and meet other interested educators, parents, developers, and community leaders for an hour of an intense discussion. June 5th, 2010, 2pm ET. Host: Julie Harland, Mathematics Professor at MiraCosta College and creator of hundreds of math videos at YourMathGal.com You can ask Julie questions about her projects, as well as using screencasts in your work and online education in general. June 9th, 2010, 9:30pm ET. Host: Peter Gray, Professor of Psychology at Boston College, blogging at Psychology Today's Freedom to Learn. Peter will talk about his blog, and in particular two widely resonating posts about mathematics: the Benezet experiment, and a family learning philosophy called "unschooling." You can also ask Peter questions about his research of Sudbury schools. June 19th, 2010, 2pm ET. Host: Kalid Azad, creator of InstaCalc, and blogger at BetterExplained. We will talk about the meaning of math insights ("a-ha moments") and interactive ways of sharing them online. People interested in the development of lightweight, embeddable math widgets can also ask questions about InstaCalc. June 26th, 2010. Host: Ryan Goble, teacher mentor at South Bronx, graduate student at Columbia University, and creator of Making Curriculum Pop - a resource-sharing community for educators interested in better practices and teaching with pop culture. Ask Ryan about building educator communities, online learning, and using culture at large as the classroom. To join the weekly events, follow this link in your browser to a virtual room that opens half an hour before each event: https://sas.elluminate.com/m.jnlp?password=M.FCAF787B38E30D58F943EB7232EE27 More details about the upcoming events, and full recordings of past events, are at the Math 2.0 wiki: http://mathfuture.wikispaces.com/events Cheers, Maria Droujkova http://www.naturalmath.com Make math your own, to make your own math. -------------- next part -------------- An HTML attachment was scrubbed... URL: