From Scott.Daniels at Acm.Org Thu Feb 5 18:33:32 2009 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Thu, 05 Feb 2009 09:33:32 -0800 Subject: [Edu-sig] Topics for CS2 In-Reply-To: References: <40ea4eb00901150635i741ebc8fqba49fa2a894ea8a7@mail.gmail.com> <5.2.1.1.0.20090115125322.0343da00@mail.ece.arizona.edu> <5.2.1.1.0.20090117111156.0343da00@plus.pop.mail.yahoo.com> Message-ID: Scott David Daniels wrote: > Scott David Daniels wrote: > I wrote: > >> In PythonOOP.doc (page 4) you say: >> > There are two pieces of "magic" that make line 3 work. First, the >> > interpreter has to find the method set_vars. It's not in cat2. Then, >> > the instance cat2 has to be inserted as the first argument to set_vars. >> > The method is found by a search starting at cat2 ( the instance on >> > which the method is called ). The search then proceeds to the parent >> > class, then to the grandparent, and so on up to object, the ancestor >> > of all Animal classes. In this case, we find set_vars in Cat. >> >> For instances of subclasses of object (such as Cat), method lookups >> start in Cat, not cat2. If you try to set cat2.set_vars, you cannot >> (because a method is a property stored in he class), and you will try >> the set method of that property which will fail. Simple class variables >> are over-ridden by assignments to the instance values, but properties >> are not. This should be read/write properties are not. > And then immediately went to make a test case, which failed. Which > I should, of course, done before hitting send. I retract my comment > and will get back to you when I get my understanding straightened out. And I just noticed a great thread on comp.lang.python addressing the exact lookup order for obtaining attributes most recent post this morning. The Thread Title is "Understanding Descriptors", Brian Allen Vanderburg II asked the initial question, and Aahz and Bruno Desthuillers came up with a thorough answer. I'll put a link here, but it may wrap nastily. Nickel summary, lookup order is not dirt simple, and reading and writing work differently. http://groups.google.com/group/comp.lang.python/browse_thread/thread/a136f7626b2a8b7d/70a672cf7448c68e --Scott David Daniels Scott.Daniels at Acm.Org From mpaul213 at gmail.com Thu Feb 5 22:34:49 2009 From: mpaul213 at gmail.com (michel paul) Date: Thu, 5 Feb 2009 13:34:49 -0800 Subject: [Edu-sig] probability & simulation Message-ID: <40ea4eb00902051334j53fca162w4bd691c0d45b3440@mail.gmail.com> We began a unit in math called 'Probability and Simulation'. The students of course have to solve many typical problems involving dice and coins. This provided a perfect opportunity for incorporating Python in a way that didn't freak the kids out. Remember, I have been trying to weave Python into a math environment where programming is seen as something alien and scary. Bizarre. The 'choice' function in the random library provides an excellent way to create all kinds of simulations very easily. I used this as an example in class: >>> coin = ['Heads - I win', 'Tails - you lose'] >>> tosses = [choice(coin) for toss in range(1000)] It was great. Very easy to understand. This combined with the 'count' method in a list, and I could go ahead and assign them a little HW project to create a frequency table for throwing 2 dice 10,000 times. I told them to just experiment, copy and paste their Shell session and email it to me. It worked very well. Even a lot of the kids who have been resistant to this Python stuff could handle it. Didn't require having to write functions - purely interactive. Then the next day we explored tetrahedral and other kinds of dice. Very simple, and it seemed to work well. There's a section at the end of the chapter that describes creating simulations using BASIC. Ha! We did this on the very first day! - Michel -------------- next part -------------- An HTML attachment was scrubbed... URL: From macquigg at ece.arizona.edu Fri Feb 6 20:32:35 2009 From: macquigg at ece.arizona.edu (David MacQuigg) Date: Fri, 06 Feb 2009 12:32:35 -0700 Subject: [Edu-sig] Attribute Lookup Order In-Reply-To: References: <40ea4eb00901150635i741ebc8fqba49fa2a894ea8a7@mail.gmail.com> <5.2.1.1.0.20090115125322.0343da00@mail.ece.arizona.edu> <5.2.1.1.0.20090117111156.0343da00@plus.pop.mail.yahoo.com> Message-ID: <5.2.1.1.0.20090206111917.03f42c38@mail.ece.arizona.edu> >And I just noticed a great thread on comp.lang.python addressing the >exact lookup order for obtaining attributes most recent post this >morning. The Thread Title is "Understanding Descriptors", >Brian Allen Vanderburg II asked the initial question, and Aahz and >Bruno Desthuillers came up with a thorough answer. >I'll put a link here, but it may wrap nastily. Nickel summary, lookup >order is not dirt simple, and reading and writing work differently. > >http://groups.google.com/group/comp.lang.python/browse_thread/thread/a136f7626b2a8b7d/70a672cf7448c68e Maybe I'm missing some subtleties, but it still seems simple to me. An attribute is looked up in the order object -> class -> superclasses, *UNLESS* that attribute happens to be a property of the class. The purpose of properties is to over-ride direct access to attributes, and substitute your own getters and setters with whatever robustness is appropriate. Say you have a class Rectangle(object): def __init__(self, width, height): self.width = width self.height = height self.area = width * height and you find your students are changing the width and height parameters, but forgetting to change area. The Java guys will say we should never have written such fragile code, but that is the beauty of Python. We can write something simple, and add the robustness later. class Rectangle(object): def __init__(self, width, height): self.width = width self.height = height # self.area = width * height def getArea(self): return self.width * self.height area = property(getArea) Nothing in the interface changes. Programs dependent on Rectangle will not break, unless they were setting area directly, which they should never have done. Then when they do break, the user will see "AttributeError: can't set attribute", not some subtle error in the data that will screw up later usage. The example is from Martelli's Nutshell, 2nd ed. p.100-101. Quick summary (quoting Martelli): "The crucial importance of properties is that their existence makes it perfectly safe and indeed advisable for you to expose public data attributes as part of your class's public interface." -- Dave From Scott.Daniels at Acm.Org Fri Feb 6 20:54:19 2009 From: Scott.Daniels at Acm.Org (Scott David Daniels) Date: Fri, 06 Feb 2009 11:54:19 -0800 Subject: [Edu-sig] Attribute Lookup Order In-Reply-To: <5.2.1.1.0.20090206111917.03f42c38@mail.ece.arizona.edu> References: <40ea4eb00901150635i741ebc8fqba49fa2a894ea8a7@mail.gmail.com> <5.2.1.1.0.20090115125322.0343da00@mail.ece.arizona.edu> <5.2.1.1.0.20090117111156.0343da00@plus.pop.mail.yahoo.com> <5.2.1.1.0.20090206111917.03f42c38@mail.ece.arizona.edu> Message-ID: About my message: >> ... Nickel summary, lookup order is not dirt simple, and reading >> and writing work differently. David MacQuigg wrote: > Maybe I'm missing some subtleties, but it still seems simple to me. > An attribute is looked up in the order object -> class -> superclasses, > *UNLESS* that attribute happens to be a property of the class.... The subtleties involve the difference in the lookup order between read-only properties and properties with a write method. > ... > class Rectangle(object): > def __init__(self, width, height): > self.width = width > self.height = height > # self.area = width * height > > def getArea(self): > return self.width * self.height > ... Written in later versions of Python (2.5 and up) as: class Rectangle(object): def __init__(self, width, height): self.width = width self.height = height # self.area = width * height @property def area(self): return self.width * self.height --Scott David Daniels Scott.Daniels at Acm.Org From mpaul213 at gmail.com Fri Feb 6 22:48:10 2009 From: mpaul213 at gmail.com (michel paul) Date: Fri, 6 Feb 2009 13:48:10 -0800 Subject: [Edu-sig] probability & simulation In-Reply-To: <49480.52563.qm@web88108.mail.re2.yahoo.com> References: <40ea4eb00902051334j53fca162w4bd691c0d45b3440@mail.gmail.com> <49480.52563.qm@web88108.mail.re2.yahoo.com> Message-ID: <40ea4eb00902061348v54836d72l2f742f3fd85cdb8a@mail.gmail.com> Warren, Your book looks great! I'd be interested in seeing the rest of it. Yeah, we ended up discussing how to represent a deck of cards in class as well. One of the kids got inspired while creating the dice simulation and emailed me asking how to do something like that. So I was really glad to see this start growing organically. We haven't discussed classes previously, as that would REALLY have scared them off, so I just had him continue at the level of simple lists, thinking of cards as simple ordered pairs: >>> suits = ['S', 'H', 'D', 'C'] >>> ranks = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K'] >>> deck = [(rank, suit) for suit in suits for rank in ranks] >>> shuffle(deck) >>> hand = [deck.pop() for card in range(5)] He played around with this and really got into it. Good news! It's amazing how much you can do in a simple interactive way with Python. I mean, this LOOKS like what you do with a deck! But I did try to sow some seeds by mentioning how you could accomplish even more by thinking in terms of functions and classes. - Michel On Fri, Feb 6, 2009 at 9:21 AM, Warren Sande wrote: > Michel, > > Sounds like you caught their interest, which is great. I have a chapter on > probability and simulation in my book, "Hello World! Computer Programming > for Kids and Other Beginners". It talks about simulating dice, coins, and a > deck of cards. In the second half of the chapter we make a Crazy Eights > card game (text-based). I've attached a preview of the chapter if you want > to have a look. Keep in mind that this is one of the later chapters, and we > have already covered the basics like loops, lists, objects, etc. > > By the way, the book has had some delays in production, but it should be > out in the next few weeks. > > Regards, > Warren Sande > > > ------------------------------ > *From:* michel paul > *To:* "edu-sig at python.org" > *Sent:* Thursday, February 5, 2009 1:34:49 PM > *Subject:* [Edu-sig] probability & simulation > > We began a unit in math called 'Probability and Simulation'. The students > of course have to solve many typical problems involving dice and coins. > This provided a perfect opportunity for incorporating Python in a way that > didn't freak the kids out. Remember, I have been trying to weave Python > into a math environment where programming is seen as something alien and > scary. Bizarre. The 'choice' function in the random library provides an > excellent way to create all kinds of simulations very easily. I used this > as an example in class: > > >>> coin = ['Heads - I win', 'Tails - you lose'] > > >>> tosses = [choice(coin) for toss in range(1000)] > > It was great. Very easy to understand. This combined with the 'count' > method in a list, and I could go ahead and assign them a little HW project > to create a frequency table for throwing 2 dice 10,000 times. I told them > to just experiment, copy and paste their Shell session and email it to me. > It worked very well. Even a lot of the kids who have been resistant to this > Python stuff could handle it. Didn't require having to write functions - > purely interactive. > > Then the next day we explored tetrahedral and other kinds of dice. > > Very simple, and it seemed to work well. There's a section at the end of > the chapter that describes creating simulations using BASIC. Ha! We did > this on the very first day! > > - Michel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Sat Feb 7 06:47:07 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 6 Feb 2009 21:47:07 -0800 Subject: [Edu-sig] probability & simulation In-Reply-To: <40ea4eb00902061348v54836d72l2f742f3fd85cdb8a@mail.gmail.com> References: <40ea4eb00902051334j53fca162w4bd691c0d45b3440@mail.gmail.com> <49480.52563.qm@web88108.mail.re2.yahoo.com> <40ea4eb00902061348v54836d72l2f742f3fd85cdb8a@mail.gmail.com> Message-ID: 2009/2/6 michel paul : > Warren, > > Your book looks great! I'd be interested in seeing the rest of it. Yeah, > we ended up discussing how to represent a deck of cards in class as well. > One of the kids got inspired while creating the dice simulation and emailed > me asking how to do something like that. So I was really glad to see this > start growing organically. We haven't discussed classes previously, as that > would REALLY have scared them off, so I just had him continue at the level > of simple lists, thinking of cards as simple ordered pairs: > >>>> suits = ['S', 'H', 'D', 'C'] >>>> ranks = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K'] >>>> deck = [(rank, suit) for suit in suits for rank in ranks] >>>> shuffle(deck) >>>> hand = [deck.pop() for card in range(5)] > Good stuff. I'm always tempted to have 'S','H','D','C' replaced by the actual symbols (DejaVu font?), keeping the quote marks as these symbols don't qualify as identifiers, only strings. Here's the relevant page from the Unicode charts. http://unicode.org/charts/PDF/U2600.pdf Let's see what I can do with Python here... >>> import unicodedata >>> heart = chr(0x2665) >>> unicodedata.name(heart) 'BLACK HEART SUIT' I thought hearts were red... I've uploaded a screen shot using these characters in IDLE/Py3K: http://www.flickr.com/photos/17157315 at N00/3259871142/ Also, I've finally gotten around to getting my I Ching stuff ported to a Google appengine: http://osgarden.appspot.com Lots of Chinese characters, though not top-level (this is Python 2.5 anyway -- see About page for source). Yes, I use Justin's PyFontify with py2html, colorize code on the fly (had to modify py2html a little). > He played around with this and really got into it. Good news! It's amazing > how much you can do in a simple interactive way with Python. I mean, this > LOOKS like what you do with a deck! But I did try to sow some seeds by > mentioning how you could accomplish even more by thinking in terms of > functions and classes. > > - Michel Yes, REPL is what kids like, though they don't call it REPL (read, evaluate, print loop -- what the interpreter does). I might try EDSL for "eat, digest, say loop" -- you could think of others. In the 1980s the paradigm with BASIC etc. was "write a little program and prompt yourself for inputs" (ala raw_input), but it's easier at first to just work in a session, more like in Logo and APL, cluttering up the workspace (i.e. __main__) with all kinds of remembered stuff. Play around, then cut and paste we you want to keep for next time, some exceptions and debugging already happening interactively. We don't start by writing then running programs, we start by talking to the interpreter, importing existing libraries, poking around. When we we start saving stuff, we think of our first files more like the math library, or string, i.e. a box of tools that we use directly. The math module has no raw_input prompts -- that'd be silly. So our first saved .py files aren't "programs", they're "modules". They may have unit tests or doc tests, should at least have documentation of some kind, but there's no need for a main() or any unifying structure. It's not a "script", it's a "bag of useful things" (a namespace). Some functions, some classes, even some constants maybe... KIrby From mpaul213 at gmail.com Sat Feb 7 16:36:21 2009 From: mpaul213 at gmail.com (michel paul) Date: Sat, 7 Feb 2009 07:36:21 -0800 Subject: [Edu-sig] probability & simulation In-Reply-To: References: <40ea4eb00902051334j53fca162w4bd691c0d45b3440@mail.gmail.com> <49480.52563.qm@web88108.mail.re2.yahoo.com> <40ea4eb00902061348v54836d72l2f742f3fd85cdb8a@mail.gmail.com> Message-ID: <40ea4eb00902070736lb09599dl909fc7582065454f@mail.gmail.com> On Fri, Feb 6, 2009 at 9:47 PM, kirby urner wrote: Here's the relevant page from the Unicode charts. > http://unicode.org/charts/PDF/U2600.pdf > > Let's see what I can do with Python here... > > >>> import unicodedata > >>> heart = chr(0x2665) Ha! This will be a lot of fun when we get back to class. Yeah, I remember your Ching stuff, but at the time I hadn't yet explored 3.0. I figured I'd eventually get around to things like Unicode, but, wow, this is incredibly easy. Why wait? Little details like this can be gems. Thanks. - Michel -------------- next part -------------- An HTML attachment was scrubbed... URL: From macquigg at ece.arizona.edu Sat Feb 7 21:49:11 2009 From: macquigg at ece.arizona.edu (David MacQuigg) Date: Sat, 07 Feb 2009 13:49:11 -0700 Subject: [Edu-sig] Attribute Lookup Order In-Reply-To: References: <5.2.1.1.0.20090206111917.03f42c38@mail.ece.arizona.edu> <40ea4eb00901150635i741ebc8fqba49fa2a894ea8a7@mail.gmail.com> <5.2.1.1.0.20090115125322.0343da00@mail.ece.arizona.edu> <5.2.1.1.0.20090117111156.0343da00@plus.pop.mail.yahoo.com> <5.2.1.1.0.20090206111917.03f42c38@mail.ece.arizona.edu> Message-ID: <5.2.1.1.0.20090206141340.04005e50@mail.ece.arizona.edu> At 11:54 AM 2/6/2009 -0800, Scott David Daniels wrote: >About my message: >>> ... Nickel summary, lookup order is not dirt simple, and reading >>> and writing work differently. > >David MacQuigg wrote: >>Maybe I'm missing some subtleties, but it still seems simple to me. >>An attribute is looked up in the order object -> class -> superclasses, >>*UNLESS* that attribute happens to be a property of the class.... > >The subtleties involve the difference in the lookup order between >read-only properties and properties with a write method. > >>... >>class Rectangle(object): >> >> def __init__(self, width, height): >> self.width = width >> self.height = height >># self.area = width * height >> >> def getArea(self): >> return self.width * self.height >> >> area = property(getArea) >>... > >Written in later versions of Python (2.5 and up) as: > > class Rectangle(object): > def __init__(self, width, height): > self.width = width > self.height = height > # self.area = width * height > > @property > def area(self): > return self.width * self.height Nice! Syntax sugar for the more explicit form. I'll update my examples. As for the subtle changes in lookup order, I could include some discussion under Advanced Topics (Metaclasses, Cooperative Super Calls, etc.), but I will need to see a clear example that is relevant to the non-programmer scientists and engineers I am targeting. Else, the value is too low and the complexity too high. The @property example above *is* appropriate for my OOP chapter (under the topic Robust Programming). It is simple, and understanding the concept of protected attributes is good even if you don't use them. -- Dave From kirby.urner at gmail.com Sun Feb 8 08:41:13 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 7 Feb 2009 23:41:13 -0800 Subject: [Edu-sig] A PyToon Message-ID: This is admittedly somewhat weird: http://www.xtranormal.com/watch?s=87117 (a short cartoon, best to let it download to 100% of playback will be choppy). Michel, not sure what fonts best for Unicode, still learning. Deju Vu? (a font). At least with younger kids, I think it works to speak of callables having "a mouth". In python( elephant ) it looks like a python object is "eating" an elephant object. ( ) looks like a pairing lips, thinking of emoticons i.e. "a mouth turned sideways." I'm thinking of skits around functions "eating" objects... (having little skits is a part of our Monty Python heritage). Another metaphor is "the castle gates" i.e. arguments show up to be accepted by a function or other callable. Exceptions get raised. Lots of skit possibilities around "duck typing" (quack quack). Watching now: http://www.youtube.com/watch?v=E_kZDvwofHY Kirby From mpaul213 at gmail.com Mon Feb 9 06:11:25 2009 From: mpaul213 at gmail.com (michel paul) Date: Sun, 8 Feb 2009 21:11:25 -0800 Subject: [Edu-sig] another PyToon! Message-ID: <40ea4eb00902082111y3a82e56frd0c47299770f8b9e@mail.gmail.com> http://www.xtranormal.com/xtranormal/episode.php?aid=87487&mid=2009020814392471 Yeah, definitely clunky, but fun to play with. This toon is an accurate summary of many frustrating dialogs. - Michel -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Mon Feb 9 07:52:25 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 8 Feb 2009 22:52:25 -0800 Subject: [Edu-sig] another PyToon! In-Reply-To: <40ea4eb00902082111y3a82e56frd0c47299770f8b9e@mail.gmail.com> References: <40ea4eb00902082111y3a82e56frd0c47299770f8b9e@mail.gmail.com> Message-ID: 2009/2/8 michel paul : > http://www.xtranormal.com/xtranormal/episode.php?aid=87487&mid=2009020814392471 > > Yeah, definitely clunky, but fun to play with. > Yeah, my friend David Koski, a geometer, thinks this icons-to-movie scripting might be the start of something big, like these are first glimmers of something far more sophisticated. On the other hand, The Sims have been icon scriptable for some time and with clever editing are turned into music video puppets: http://mybizmo.blogspot.com/2009/01/playing-with-dolls.html (Koski reads my blogs, so he and his young daughter, younger than mine, enjoyed watching these). My 14 year old pointed me to this pair: a live action music video, followed by the Sims version. Here's her email: """ Ok here is one that is from a song called "My Immortal" by Evanescence. Its a very pretty song, but very sad. I think that this is a pretty good video for it. http://www.youtube.com/watch?v=GzOozzPg16E This one is not as good, but its also by Evanescence. She is one of the only artists with fans who make really good sim videos. Kelly Clarkson is OK but her songs are sometimes much less interesesting. ANYWAY, here is the sim version and the real one for "Everybody's Fool": http://www.youtube.com/watch?v=u55fpsbzAfk http://www.youtube.com/watch?v=bK6_Q1UmUGI&feature=related So those are two I really like, at least from that particular artist. Let me know if you want me to look up any more for you. """ > This toon is an accurate summary of many frustrating dialogs. > > - Michel Something of a breakthrough when one of my XX-friends, a teacher of health education, had an initially negative reaction i.e. this "everything is an object" mindset is precisely what's wrong with engineers, makes them cold and uncaring, because the "objectify everything." I think she now better understands my position, which I blogged about, quoting from, and citing, an earlier post to edu-sig: http://worldgame.blogspot.com/2009/02/regarding-objectifying.html Kirby From kirby.urner at gmail.com Tue Feb 10 23:09:28 2009 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 10 Feb 2009 14:09:28 -0800 Subject: [Edu-sig] More yakking from Portland (usa.or.pdx) Message-ID: So I've started a whole new blog, cram packed w/ dah math stuff: http://coffeeshopsnet.blogspot.com/ ( it's actually subtitled "philosophy talk" but there's lots of math-related content ) Please feel free to click on the Google ads at the bottom to make me rich. I'm still blue with the news from Reed College that my PHP is too weak, or why else wouldn't I get that Open Source Developer position (scan of the ad buried in my Photostream someplace). Hint: they wanted a maintenance technician not a visionary professor who mentions R. Buckminster Fuller on his resume (I was the Fuller Institute's first web wrangler, long ago -- bfi.org -- other responsibilities). It woulda been a big leap after 15 years in the private sector as a client-based business, but you have to understand, Reed is a great school (applied there as a high schooler, got accepted, but went to Princeton instead, so poetic justice I guess). David Koski was right: you *can* export those "xtranormal movies" to YouTube (icon based scripting language -- not talking about Icon the computer language, but little symbols, sequenced) so my Objectifying in Python prototype is now much more accessible. I'll be projecting it tonight at CubeSpace at our Portland Python User Group meeting, lugging speakers (gotta have good sound), as a part of my Pycon Preview. I'm gonna race through my slides just like I did with the engineering group and Mario Livio, visiting MVP (see CSN blog: http://coffeeshopsnet.blogspot.com/2009/02/glass-bead-game.html ) Here's the xtranormal movie (again) http://worldgame.blogspot.com/2009/02/regarding-objectifying.html (blog embedded) http://www.youtube.com/watch?v=p698mXuHmTs Anyway, the UK needs ed reform just as surely as the USA and I'm sensing a kind of division of labor emerging, with the UK handling the early algebra piece, very friendly to programming, and our open source capital (Portland) leading the nation in some of the more GIS/GPS type pieces, like with those dodecacams, Google Streets, Python appengine and like that. You all saw my clever advertising for OS Bridge right? http://osgarden.appspot.com/ . I have source code and credits in the About section. Managed to modify py2html, need to add a link, to PyFontify as well (they'll both autocolorize on the fly, thanks to themselves, very cool). So yeah, the entry I just posted to my CSN blog is about Constructivism. I don't mention the XO per se, but I do go over some of the history. http://coffeeshopsnet.blogspot.com/2009/02/about-constructivism.html My next plan is to see if Saturday Academy wants to serve as a training hub for adult teachers with day jobs in public schools, most of which already have some budget for in-service but don't use it on anything FOSS-related, even though that's a big part of our economy and what we're training up for around here, people moving here to do development and design work. Every kid should feel empowered to write server-side scripts in the cloud, is sort of my attitude. That's a way to get your identity out there, without the constraints of Facebook, Myspace... like it's not either/or. Being able to script from scratch, in PHP even if that's your bag (Reed's ad put PHP at the forefront), is a reward for having learned programming in math class, which in turn is a way of learning math skills (and geography) that'd be useful later in life, interpreting "math skills" to include file management in general, including bill paying and home economics. Of course the XOs fit right in to this vision, as portals to said cloud. I'll be posting more frequently in the countdown to Pycon. Tizard @ Stanford is doing a fine job of promoting our little Python for Teachers, although unless you're into education arcana and esoterica that's not going to mean much, this is not Britney Spears. Here's the other YouTube I'm going to project (with audio) and PPUG tonight, which is supposed to focus on VPython (and it will, just want to give context, show how I use it in Saturday Academy classes. Yeah, kinda random, just archiving some of my activities and thoughts. The blogs are more formal, upgraded the templates, installed Google Analytics on all of them, not just Grain of Sand. Averaging like 800 unique visitors each 30 day period, something like that. They like my movie reviews sometimes. Off to see Gordon next, good friend, interesting geek. Ah, the cleaning team has just arrived, gotta make this home office ship shape for tomorrow as MVP Anna Roys is swinging through from TECC/Alaska. tecc-alaska.org There's still interest in ramping up on the Python but I'm just a local yokel in Portland, don't get to fly around (or drive (bizmo scenario)) showing how that's done -- except that's the idea in Chicago, provided there's some interest. Kirby From mpaul213 at gmail.com Thu Feb 12 02:37:23 2009 From: mpaul213 at gmail.com (michel paul) Date: Wed, 11 Feb 2009 17:37:23 -0800 Subject: [Edu-sig] project Euler Message-ID: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> This is a pretty cool site: Project Euler . It's a list of problems that can't be solved using mathematical cleverness alone - they require programming. After you solve a problem, you then get access to the list of previous solutions. The first one - "Add all the natural numbers below one thousand that are multiples of 3 or 5." - is just a Python one-liner. The second - "Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million." It's fun looking at the previous solutions in all kinds of other languages. Really shows the elegance of Python. It reminds me somewhat of JavaBat . There was some discussion earlier about doing something similar in Python? - Michel -------------- next part -------------- An HTML attachment was scrubbed... URL: From macquigg at ece.arizona.edu Thu Feb 12 12:58:50 2009 From: macquigg at ece.arizona.edu (David MacQuigg) Date: Thu, 12 Feb 2009 04:58:50 -0700 Subject: [Edu-sig] project Euler Message-ID: <5.2.1.1.0.20090212045752.03b05bf0@plus.pop.mail.yahoo.com> At 05:37 PM 2/11/2009 -0800, michel paul wrote: >This is a pretty cool site: Project Euler. > >... > >It reminds me somewhat of JavaBat. There was some discussion earlier about doing something similar in Python? I'm still working on "PyBat", in my spare time :>). Interest at the University seems to have died out. I'll have something to post in the next few days, I hope. This will be a package of little programs to run on your own computer, rather than through a website - not as pretty, but it actually has some advantages in getting students to work with real programs and tools, with unit tests as part of the program, not tucked away in the internals of the website. Project Euler is very cool!! JavaBat has a different focus. I think of it as "batting practice" rather than intellectual challenge. I like the collaborative effort on Project Euler. We could do something similar with PyBat, increasing the number of topics and the number of problems on each topic, until we have covered all of Python. -- 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 * ************************************************************ * From echerlin at gmail.com Thu Feb 12 18:46:22 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Thu, 12 Feb 2009 09:46:22 -0800 Subject: [Edu-sig] project Euler In-Reply-To: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: 2009/2/11 michel paul : > This is a pretty cool site: Project Euler. > > It's a list of problems that can't be solved using mathematical cleverness > alone - they require programming. Not so, according to the examples below. > After you solve a problem, you then get > access to the list of previous solutions. > > The first one - "Add all the natural numbers below one thousand that are > multiples of 3 or 5." - is just a Python one-liner. It's a shorter APL one-liner, but so what? Sum of multiples of three (3-999), plus multiples of five (5-995), minus multiples of 15 (15-990). No programming required. > The second - "Find the sum of all the even-valued terms in the Fibonacci > sequence which do not exceed four million." Sum of every third term in the sequence. Set x=phi^3 and sum 2?(1 + x + x^2...) up to floor log 4e6 base x, and round the result. Also no programming. > It's fun looking at the previous solutions in all kinds of other languages. > Really shows the elegance of Python. > > It reminds me somewhat of JavaBat. There was some discussion earlier about > doing something similar in Python? > > - Michel > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > > -- 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/User:Mokurai (Ed Cherlin) From kirby.urner at gmail.com Thu Feb 12 22:14:37 2009 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 12 Feb 2009 13:14:37 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: > Sum of multiples of three (3-999), plus multiples of five (5-995), > minus multiples of 15 (15-990). No programming required. > Getting this as one line in Python would be a fun challenge though. >> The second - "Find the sum of all the even-valued terms in the Fibonacci >> sequence which do not exceed four million." > > Sum of every third term in the sequence. Set x=phi^3 and sum 2?(1 + x > + x^2...) up to floor log 4e6 base x, and round the result. Also no > programming. So you're doing that in your head? I think the word "programming" is misleading in some contexts. Using Python as a calculator is what Guido mentions in his tutorial. Python or TI? XO or TI? Kirby > >> It's fun looking at the previous solutions in all kinds of other languages. >> Really shows the elegance of Python. >> >> It reminds me somewhat of JavaBat. There was some discussion earlier about >> doing something similar in Python? >> >> - Michel >> >> _______________________________________________ >> Edu-sig mailing list >> Edu-sig at python.org >> http://mail.python.org/mailman/listinfo/edu-sig >> >> > > > > -- > 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/User:Mokurai (Ed Cherlin) > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From mpaul213 at gmail.com Thu Feb 12 23:05:05 2009 From: mpaul213 at gmail.com (michel paul) Date: Thu, 12 Feb 2009 14:05:05 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: <40ea4eb00902121405t4abe9733u72b485641274f550@mail.gmail.com> On Thu, Feb 12, 2009 at 9:46 AM, Edward Cherlin wrote: > It's a list of problems that can't be solved using mathematical cleverness > > alone - they require programming. > > Not so, according to the examples below. OK, then just look further down the list. : ) > > The first one - "Add all the natural numbers below one thousand that are > > multiples of 3 or 5." - is just a Python one-liner. > > It's a shorter APL one-liner, but so what? Well, I guess the 'so what' would be that APL is clearly another great language for mathematics students to study. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gregor.lingl at aon.at Thu Feb 12 23:29:55 2009 From: gregor.lingl at aon.at (Gregor Lingl) Date: Thu, 12 Feb 2009 23:29:55 +0100 Subject: [Edu-sig] project Euler In-Reply-To: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: <4994A2E3.2030200@aon.at> Another interesting site of this type, as you will see strongly Python biased, is http://appgallery.appspot.com/about_app?app_id=agphcHBnYWxsZXJ5chMLEgxBcHBsaWNhdGlvbnMYrhQM http://www.challenge-you.com/ which is a google app from the google app gallery and - as such - it must itself have been written in Python. Regards, Gregor michel paul schrieb: > This is a pretty cool site: Project Euler . > > It's a list of problems that can't be solved using mathematical > cleverness alone - they require programming. After you solve a > problem, you then get access to the list of previous solutions. > > The first one - "Add all the natural numbers below one thousand that > are multiples of 3 or 5." - is just a Python one-liner. > > The second - "Find the sum of all the even-valued terms in the > Fibonacci sequence which do not exceed four million." > > It's fun looking at the previous solutions in all kinds of other > languages. Really shows the elegance of Python. > > It reminds me somewhat of JavaBat . There was > some discussion earlier about doing something similar in Python? > > - Michel > ------------------------------------------------------------------------ > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From sb at csse.unimelb.edu.au Fri Feb 13 03:39:34 2009 From: sb at csse.unimelb.edu.au (Steven Bird) Date: Fri, 13 Feb 2009 13:39:34 +1100 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: <97e4e62e0902121839n7bf5ebeeq4ac4df6dc98a1d23@mail.gmail.com> 2009/2/13 kirby urner : >> Sum of multiples of three (3-999), plus multiples of five (5-995), >> minus multiples of 15 (15-990). No programming required. >> > > Getting this as one line in Python would be a fun challenge though. Maybe. However, considering their educational value, I think the problems are unmotivated and the result of doing any problem is almost useless. I think newcomers to programming find externally-motivated problems more compelling, especially when the solution is elegant and not bogged down in housekeeping or corner cases. -Steven Bird From kirby.urner at gmail.com Fri Feb 13 17:25:38 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 13 Feb 2009 08:25:38 -0800 Subject: [Edu-sig] project Euler In-Reply-To: <97e4e62e0902121839n7bf5ebeeq4ac4df6dc98a1d23@mail.gmail.com> References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> <97e4e62e0902121839n7bf5ebeeq4ac4df6dc98a1d23@mail.gmail.com> Message-ID: On Thu, Feb 12, 2009 at 6:39 PM, Steven Bird wrote: > 2009/2/13 kirby urner : >>> Sum of multiples of three (3-999), plus multiples of five (5-995), >>> minus multiples of 15 (15-990). No programming required. >>> >> >> Getting this as one line in Python would be a fun challenge though. > > Maybe. However, considering their educational value, I think the > problems are unmotivated and the result of doing any problem is almost > useless. I think newcomers to programming find externally-motivated > problems more compelling, especially when the solution is elegant and > not bogged down in housekeeping or corner cases. > > -Steven Bird > The Software Association of Oregon, in collaboration with Willamette University, organizes an annual contest wherein high school teams compete with each other, and against the clock, on challenges of this type. In my experience with this contest, none were using Python because Python was not yet part of the high school curriculum in Oregon, except in corner cases. That was some years ago. Kirby From kirby.urner at gmail.com Fri Feb 13 17:30:11 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 13 Feb 2009 08:30:11 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: On Thu, Feb 12, 2009 at 11:53 PM, Edward Cherlin wrote: << SNIP >> >> So you're doing that in your head? > > Not at all. I can do this example with paper and pencil, and I would > want a calculator or a log table for larger examples. Let's see... And I would want my Python shell. I don't own a calculator, have no need for one. > > 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 > 2 8 34 144 610 2584 > 2 10 44 188 798 3382, ok, 4 more terms...Third grade paper and pencil > arithmetic for the rest. > >> I think the word "programming" is misleading in some contexts. > > I don't use the word for anything that can easily be done on a > non-programmable calculator, an abacus, or a half sheet of paper by > one with the skills commonly taught (though not very often learned in > full) for each. I'm not that impressed by "commonly taught skills" i.e. if a kid knows how to use a TI, but not Python, I'm inclined to move on to the next candidate. > >> Using Python as a calculator is what Guido mentions in his tutorial. >> >> Python or TI? >> >> XO or TI? > > Similarly for APL and J. > Yes, as I've mentioned, APL was my first language and I've worked with Iverson himself on a paper about J. I heard from Roger Hui just the other day. Part of why I fell in love with Python is because of its orthogonal primitives, feels like APL in some ways. Plus the whole OO thing is way cool, highly accessible. My oft stated preference is to NOT ever (ever) get stuck in teaching just one language, even if one emphasizes just one in this or that classroom or on-line session. Per some brain science I've been studying, we really do *not* multitask, even though we appear to, any more than an Intel chip really does (OK, some do, but at one time it was all round robin). Kirby From echerlin at gmail.com Fri Feb 13 20:43:26 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Fri, 13 Feb 2009 11:43:26 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: On Fri, Feb 13, 2009 at 8:30 AM, kirby urner wrote: > On Thu, Feb 12, 2009 at 11:53 PM, Edward Cherlin wrote: > > << SNIP >> > >>> So you're doing that in your head? >> >> Not at all. I can do this example with paper and pencil, and I would >> want a calculator or a log table for larger examples. Let's see... > > And I would want my Python shell. I don't own a calculator, have no > need for one. I mean the Calculator activity in Sugar, or gcalctool. >> 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 >> 2 8 34 144 610 2584 >> 2 10 44 188 798 3382, ok, 4 more terms...Third grade paper and pencil >> arithmetic for the rest. >> >>> I think the word "programming" is misleading in some contexts. >> >> I don't use the word for anything that can easily be done on a >> non-programmable calculator, an abacus, or a half sheet of paper by >> one with the skills commonly taught (though not very often learned in >> full) for each. > > I'm not that impressed by "commonly taught skills" i.e. if a kid knows > how to use a TI, but not Python, I'm inclined to move on to the next > candidate. EEEE! No! Pencil and paper arithmetic skills, not gadgetry. Multiple column addition, subtraction, multiplication. >>> Using Python as a calculator is what Guido mentions in his tutorial. >>> >>> Python or TI? >>> >>> XO or TI? >> >> Similarly for APL and J. >> > > Yes, as I've mentioned, APL was my first language and I've worked with > Iverson himself on a paper about J. I heard from Roger Hui just the > other day. Part of why I fell in love with Python is because of its > orthogonal primitives, feels like APL in some ways. Plus the whole OO > thing is way cool, highly accessible. > > My oft stated preference is to NOT ever (ever) get stuck in teaching > just one language, even if one emphasizes just one in this or that > classroom or on-line session. We have to get away from the notion that "teaching programming" = "teaching language syntax". That's why I am working on a set of demonstrations of programming and Computer Science ideas in Turtle Art, where children can create programs directly as trees, not linear texts that a parser turns into a tree for execution. > Per some brain science I've been > studying, we really do *not* multitask, even though we appear to, any > more than an Intel chip really does (OK, some do, but at one time it > was all round robin). > > Kirby -- 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/User:Mokurai (Ed Cherlin) From kirby.urner at gmail.com Fri Feb 13 21:02:11 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 13 Feb 2009 12:02:11 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: On Fri, Feb 13, 2009 at 11:43 AM, Edward Cherlin wrote: << SNIP >> > > I mean the Calculator activity in Sugar, or gcalctool. > Our use Pippy maybe? >>> 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 >>> 2 8 34 144 610 2584 >>> 2 10 44 188 798 3382, ok, 4 more terms...Third grade paper and pencil >>> arithmetic for the rest. Recent meeting with Anna Roys, TECC/Alaska (tecc-alaska.org): Lesson plan: On-line Dictionary of Integer Sequences, enter 1, 12, 42, 92... Follow some links, to my page included, even if just for the pictures (good Virus from Life -- made out of metal nuts it looks like). Treasure hunt? We're focused on linking algebraic sequences, generator type stuff, to visual imagery, imaginary content, like we do later with coordinate systems (XYZ, spherical...), but "figurate numbers" ("polyhedral numbers") are a first bridge between algebra and geometry, coordinates be damned (until later). Glue four ping pong balls together: voila, a tetrahedron (your unit of volume in some curriculum segments, unless your school is some kind of joke -- Alaska leading the pack here in some ways). >>> >>>> I think the word "programming" is misleading in some contexts. >>> >>> I don't use the word for anything that can easily be done on a >>> non-programmable calculator, an abacus, or a half sheet of paper by >>> one with the skills commonly taught (though not very often learned in >>> full) for each. >> >> I'm not that impressed by "commonly taught skills" i.e. if a kid knows >> how to use a TI, but not Python, I'm inclined to move on to the next >> candidate. > > EEEE! No! Pencil and paper arithmetic skills, not gadgetry. Multiple > column addition, subtraction, multiplication. It's not either/or, but if it's between a TI and Python, then I say Python. Either way, you'll need paper and pencil skills too. A quick challenge: Spheres packing around a nuclear sphere go 1, 12, 42, 92... 10*L*L + 2, where L is the layer number, except where L = 1 we have just the one ball (the shape is a cuboctahedron). So how many balls total? Add up all the layers. Yes, very easy to do in APL. In Python: def cubocta( layer ): if layer == 1: return 1 return 10 * layer ** 2 + 2 def total_balls( layer ): total = 0 for i in range(1, layer + 1): total = total + cubocta( i ) return total But isn't there a closed form algebraic expression for total_balls that doesn't require cumulative adding? Damn straight. We'll get to it. Don't forget to watch the cartoons! This isn't Bourbaki. Visualizations encouraged! This is MVC. > >>>> Using Python as a calculator is what Guido mentions in his tutorial. >>>> >>>> Python or TI? >>>> >>>> XO or TI? >>> >>> Similarly for APL and J. >>> >> >> Yes, as I've mentioned, APL was my first language and I've worked with >> Iverson himself on a paper about J. I heard from Roger Hui just the >> other day. Part of why I fell in love with Python is because of its >> orthogonal primitives, feels like APL in some ways. Plus the whole OO >> thing is way cool, highly accessible. >> >> My oft stated preference is to NOT ever (ever) get stuck in teaching >> just one language, even if one emphasizes just one in this or that >> classroom or on-line session. > > We have to get away from the notion that "teaching programming" = > "teaching language syntax". That's why I am working on a set of > demonstrations of programming and Computer Science ideas in Turtle > Art, where children can create programs directly as trees, not linear > texts that a parser turns into a tree for execution. I'm just interested in teaching math. I don't give a rip about Computer Science (just kidding, I care plenty). But in Oregon, CS is just an elective, the first to go in hard times, whereas math has a monopoly lock, is in bed with TI, and is controlled by various text book publishers (not O'Reilly). Good thing we're breaking free of that stultifying quagmire in Alaska and places. XOs are likewise part of the stimulus package. Anyway, I just call it math, or gnu math. I don't call it computer science, because I don't want to be shoved off to the sidelines, like my peers have been. I'm a gnu math teacher, not a computer science teacher. Just trying to avoid the kiss of death you understand? > >> Per some brain science I've been >> studying, we really do *not* multitask, even though we appear to, any >> more than an Intel chip really does (OK, some do, but at one time it >> was all round robin). >> >> Kirby > Kirby From echerlin at gmail.com Fri Feb 13 21:33:27 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Fri, 13 Feb 2009 12:33:27 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: On Fri, Feb 13, 2009 at 12:02 PM, kirby urner wrote: > On Fri, Feb 13, 2009 at 11:43 AM, Edward Cherlin wrote: > > << SNIP >> > >> >> I mean the Calculator activity in Sugar, or gcalctool. >> > > Our use Pippy maybe? We have lost the context of the discussion. The question was not which tools to use in the classroom, but whether "programming" is the appropriate term to use for processes that can be done on a calculator (physical or virtual), or on pencil and paper. Of course we should use Pippy. And Turtle Art, and Calc, and Etoys and... >>>> 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 >>>> 2 8 34 144 610 2584 >>>> 2 10 44 188 798 3382, ok, 4 more terms...Third grade paper and pencil >>>> arithmetic for the rest. > > Recent meeting with Anna Roys, TECC/Alaska (tecc-alaska.org): > > Lesson plan: On-line Dictionary of Integer Sequences, enter 1, 12, 42, 92... Wonderful site. Major professional tool that children can learn from. > Follow some links, to my page included, even if just for the pictures > (good Virus from Life -- made out of metal nuts it looks like). > Treasure hunt? > > We're focused on linking algebraic sequences, generator type stuff, to > visual imagery, So if we tell the turtle to set v=5, and at every successive step to put down a dot, move by v, and set v =. v+a =. 10, we get dots at 0 5 15 25 35 45 55 Dividing by five, or alternatively using the first interval as a unit, we get 0 1 3 5 7 9 11 with partial sums 0 1 4 9 16 25 36 Very good. The next day, take the students outside with XOs and have them take videos of someone dropping a ball from the roof. Pick frames at some suitable interval and overlay them. Tell students to turn their XOs sideways, and ask if they recognize the dot pattern. Thus, in two lessons, uniform gravity means constant acceleration. This is Alan Kay's favorite demo. > imaginary content, like we do later with coordinate > systems (XYZ, spherical...), but "figurate numbers" ("polyhedral > numbers") are a first bridge between algebra and geometry, coordinates > be damned (until later). > > Glue four ping pong balls together: voila, a tetrahedron (your unit > of volume in some curriculum segments, unless your school is some kind > of joke -- Alaska leading the pack here in some ways). With 20, you can do a dissection of a tetrahedron into four pieces. Two consist of four balls in a row. Two consist of six balls in a two by three arrangement. Most people have a lot of trouble reassembling them. >>>>> I think the word "programming" is misleading in some contexts. >>>> >>>> I don't use the word for anything that can easily be done on a >>>> non-programmable calculator, an abacus, or a half sheet of paper by >>>> one with the skills commonly taught (though not very often learned in >>>> full) for each. >>> >>> I'm not that impressed by "commonly taught skills" i.e. if a kid knows >>> how to use a TI, but not Python, I'm inclined to move on to the next >>> candidate. >> >> EEEE! No! Pencil and paper arithmetic skills, not gadgetry. Multiple >> column addition, subtraction, multiplication. > > It's not either/or, but if it's between a TI and Python, then I say Python. > > Either way, you'll need paper and pencil skills too. > > A quick challenge: > > Spheres packing around a nuclear sphere go 1, 12, 42, 92... 10*L*L + > 2, where L is the layer number, except where L = 1 we have just the > one ball (the shape is a cuboctahedron). So how many balls total? > Add up all the layers. Yes, very easy to do in APL. > > In Python: > > def cubocta( layer ): > if layer == 1: return 1 > return 10 * layer ** 2 + 2 > > def total_balls( layer ): > total = 0 > for i in range(1, layer + 1): > total = total + cubocta( i ) > return total > > But isn't there a closed form algebraic expression for total_balls > that doesn't require cumulative adding? Damn straight. We'll get to > it. > > Don't forget to watch the cartoons! This isn't Bourbaki. > Visualizations encouraged! This is MVC. > >> >>>>> Using Python as a calculator is what Guido mentions in his tutorial. >>>>> >>>>> Python or TI? >>>>> >>>>> XO or TI? >>>> >>>> Similarly for APL and J. >>>> >>> >>> Yes, as I've mentioned, APL was my first language and I've worked with >>> Iverson himself on a paper about J. I heard from Roger Hui just the >>> other day. Part of why I fell in love with Python is because of its >>> orthogonal primitives, feels like APL in some ways. Plus the whole OO >>> thing is way cool, highly accessible. >>> >>> My oft stated preference is to NOT ever (ever) get stuck in teaching >>> just one language, even if one emphasizes just one in this or that >>> classroom or on-line session. >> >> We have to get away from the notion that "teaching programming" = >> "teaching language syntax". That's why I am working on a set of >> demonstrations of programming and Computer Science ideas in Turtle >> Art, where children can create programs directly as trees, not linear >> texts that a parser turns into a tree for execution. > > I'm just interested in teaching math. I don't give a rip about > Computer Science (just kidding, I care plenty). > > But in Oregon, CS is just an elective, the first to go in hard times, > whereas math has a monopoly lock, is in bed with TI, and is controlled > by various text book publishers (not O'Reilly). That's why I am pushing for Free digital textbooks, and incidentally for virtual calculators. Anything that can't switch between parentheses and RPN is rubbish. That gets us out from under the hardware vendors and the publishers. > Good thing we're > breaking free of that stultifying quagmire in Alaska and places. XOs > are likewise part of the stimulus package. > > Anyway, I just call it math, or gnu math. I don't call it computer > science, because I don't want to be shoved off to the sidelines, like > my peers have been. I'm a gnu math teacher, not a computer science > teacher. Just trying to avoid the kiss of death you understand? Certainly. When I was in college, Foundations of Mathematics, which formed much of the basis of CS, was still in the Philosophy Department. I don't care about the labels. >>> Per some brain science I've been >>> studying, we really do *not* multitask, even though we appear to, any >>> more than an Intel chip really does (OK, some do, but at one time it >>> was all round robin). >>> >>> Kirby >> > > Kirby > -- 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/User:Mokurai (Ed Cherlin) From kirby.urner at gmail.com Fri Feb 13 22:14:47 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 13 Feb 2009 13:14:47 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: On Fri, Feb 13, 2009 at 12:33 PM, Edward Cherlin wrote: > On Fri, Feb 13, 2009 at 12:02 PM, kirby urner wrote: >> On Fri, Feb 13, 2009 at 11:43 AM, Edward Cherlin wrote: >> >> << SNIP >> >> >>> >>> I mean the Calculator activity in Sugar, or gcalctool. >>> >> >> Our use Pippy maybe? > > We have lost the context of the discussion. The question was not which > tools to use in the classroom, but whether "programming" is the > appropriate term to use for processes that can be done on a calculator > (physical or virtual), or on pencil and paper. > Oh, I thought we were talking about whether the Euler Project was really cool or not. > Of course we should use Pippy. And Turtle Art, and Calc, and Etoys and... > Although in Oregon, XOs are extremely hard to come by, me being one of the few who has one (two actually). So when it comes to on the ground activities, I promote the hell out of the XO, market it extensively, but then have to fall back on what's actually available to Oregonians today, i.e. not XOs. Given XOs are designed for small hands and look like Fisher-Price toys, I don't push them for teenagers much, and that's the age group I tend to start with, and above (older). I am not like Alan Kay or Seymour Papert or those people who focus on really early math learning, where I think you're right on with controlling an avatar (like a turtle). Kids who have just mastered piloting their own bodies around, have fun playing with dolls, using puppets. I basically look at the early math sequence as working with puppets and polyhedra (shapes), or call them objects. >>>>> 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 >>>>> 2 8 34 144 610 2584 >>>>> 2 10 44 188 798 3382, ok, 4 more terms...Third grade paper and pencil >>>>> arithmetic for the rest. >> >> Recent meeting with Anna Roys, TECC/Alaska (tecc-alaska.org): >> >> Lesson plan: On-line Dictionary of Integer Sequences, enter 1, 12, 42, 92... > > Wonderful site. Major professional tool that children can learn from. > Yes. >> Follow some links, to my page included, even if just for the pictures >> (good Virus from Life -- made out of metal nuts it looks like). >> Treasure hunt? >> >> We're focused on linking algebraic sequences, generator type stuff, to >> visual imagery, > > So if we tell the turtle to set v=5, and at every successive step to > put down a dot, move by v, and set v =. v+a =. 10, we get dots at > > 0 5 15 25 35 45 55 > > Dividing by five, or alternatively using the first interval as a unit, we get > > 0 1 3 5 7 9 11 > > with partial sums > > 0 1 4 9 16 25 36 > > Very good. The next day, take the students outside with XOs and have > them take videos of someone dropping a ball from the roof. Pick frames > at some suitable interval and overlay them. Tell students to turn > their XOs sideways, and ask if they recognize the dot pattern. Thus, > in two lessons, uniform gravity means constant acceleration. This is > Alan Kay's favorite demo. Yes, I've seen those same demos over and over and over and over. So when I market the XO, which I do, I steer clear of all of that stuff. I don't want to be that redundant with what others are doing. I don't spend any time with Squeak. That's not my department and never will be. When I met with Alan Kay in London, c/o Shuttleworth Foundation, he kept talking about how Smalltalk was a dead language. There's lots of stuff in the archive here where I call him a "slayer" i.e. some Buffy-like character fighting the ghost of Smalltalk. He was encouraging JavaScript quite a bit, had written a whole turtle thing in that language, very impressive. I would push Python and Javascript over Smalltalk any day. I think Squeak is butt ugly, but don't tell Alan. I also think it's a work of brilliance, a gem (not mutually inconsistent views). > >> imaginary content, like we do later with coordinate >> systems (XYZ, spherical...), but "figurate numbers" ("polyhedral >> numbers") are a first bridge between algebra and geometry, coordinates >> be damned (until later). >> >> Glue four ping pong balls together: voila, a tetrahedron (your unit >> of volume in some curriculum segments, unless your school is some kind >> of joke -- Alaska leading the pack here in some ways). > > With 20, you can do a dissection of a tetrahedron into four pieces. Yes, and each of those break up into six "A modules" if you know anything about anything <-- > Two consist of four balls in a row. Two consist of six balls in a two > by three arrangement. Most people have a lot of trouble reassembling > them. Oh wait, I think we're talking about different dissections maybe. Sorry. >>> EEEE! No! Pencil and paper arithmetic skills, not gadgetry. Multiple >>> column addition, subtraction, multiplication. >> >> It's not either/or, but if it's between a TI and Python, then I say Python. >> >> Either way, you'll need paper and pencil skills too. >> >> A quick challenge: >> >> Spheres packing around a nuclear sphere go 1, 12, 42, 92... 10*L*L + >> 2, where L is the layer number, except where L = 1 we have just the >> one ball (the shape is a cuboctahedron). So how many balls total? >> Add up all the layers. Yes, very easy to do in APL. >> >> In Python: >> >> def cubocta( layer ): >> if layer == 1: return 1 >> return 10 * layer ** 2 + 2 >> >> def total_balls( layer ): >> total = 0 >> for i in range(1, layer + 1): >> total = total + cubocta( i ) >> return total >> >> But isn't there a closed form algebraic expression for total_balls >> that doesn't require cumulative adding? Damn straight. We'll get to >> it. >> >> Don't forget to watch the cartoons! This isn't Bourbaki. >> << SNIP >> >> I'm just interested in teaching math. I don't give a rip about >> Computer Science (just kidding, I care plenty). >> >> But in Oregon, CS is just an elective, the first to go in hard times, >> whereas math has a monopoly lock, is in bed with TI, and is controlled >> by various text book publishers (not O'Reilly). > > That's why I am pushing for Free digital textbooks, and incidentally > for virtual calculators. Anything that can't switch between > parentheses and RPN is rubbish. That gets us out from under the > hardware vendors and the publishers. I have no problem with anything you've said you're doing. You seem to be very loyal to your "little people" out there and are doing everything you know how to reach them. I sense a lot of people in your (our) camp, doing their level best. This gives me hope. In the meantime, change is threatening and it's no wonder that Kellogg's Corn Flakes boxes have never featured anything about OLPC, or that most USA kids don't have a clue about Python. I look for companies that invest in the future (like O'Reilly, like Google). I look for companies with courage. Hey, I even look to the military on occasion, since bravery is supposedly part of the job description. In my blogs, you'll find a lot of material on what I call Pentagon Math, ostensibly about Phi and Fibonacci Numbers, but it's rather thinly veiled, as I have Google views of the Pentagon itself, keep asking why kids on military bases, their parents asked to make the ultimate sacrifice, don't get access to decent educations at least. Talk about tyranny! See Chicago slides for more data. > >> Good thing we're >> breaking free of that stultifying quagmire in Alaska and places. XOs >> are likewise part of the stimulus package. >> >> Anyway, I just call it math, or gnu math. I don't call it computer >> science, because I don't want to be shoved off to the sidelines, like >> my peers have been. I'm a gnu math teacher, not a computer science >> teacher. Just trying to avoid the kiss of death you understand? > > Certainly. When I was in college, Foundations of Mathematics, which > formed much of the basis of CS, was still in the Philosophy > Department. I don't care about the labels. Yeah, me either. But bureaucrats care very deeply. Just because we don't care doesn't mean we have the luxury of pretending others don't care. Kirby From kirby.urner at gmail.com Sat Feb 14 19:02:34 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 14 Feb 2009 10:02:34 -0800 Subject: [Edu-sig] Moving ahead in Alaska (long) Message-ID: Did anyone else notice the Google valentines day graphic could be construed as XO promotion? I'm going to do something fun in my blog about that. Here's something long, but maybe useful if you're a math teacher using Python for some reason (still an elite and rare breed -- looks good on your resume): On Fri, Feb 13, 2009 at 12:02 PM, kirby urner wrote: << SNIP >> > Recent meeting with Anna Roys, TECC/Alaska (tecc-alaska.org): > > Lesson plan: On-line Dictionary of Integer Sequences, enter 1, 12, 42, 92... > > Follow some links, to my page included, even if just for the pictures > (good Virus from Life -- made out of metal nuts it looks like). > Treasure hunt? ==== < INTERJECTION > ===== Here's something I just uploaded to Math Forum on this lovely Valentine's Day, giving more context and background re my curriculum work with Alaska, the Matsu District in particular. It doesn't mention Python per se, but does talk about computer programming. Scroll to the very bottom for the rest of the edu-sig context, as Python generators of the "must have" variety are part of the mix... > Kirby > > [ in a meeting with Anna Roys of TECC/Alaska, Kennedy > School (McMenamins network), usa.pdx.or ] > > ------- End of Forwarded Message Happy V-day ya'll! Regarding the above meeting, I'm still putting puzzle pieces together, will be for awhile, but I wanted to go over a "signature lesson plan" that we use when suggesting a charter distinguish itself from the pack. Of course "distinguishing oneself from the pack" is not always what a school wants to do, at least not on the basis of curriculum. In sports it's OK (e.g. "best football team") but in academics you're looking for uniformity at the district level a lot of the time, so that parents don't get all bent out of shape about one school being oh so much better than another. A traditional district may well aim for homogeneity, as may a traditional state or even nation. Actually, the more accurate description is that the standards-based teaching methods now widely adopted aim to put a "floor" under a given school, such that content above and beyond what's in the standards is not actively discouraged so much as put on a back burner next to what's widely agreed as important. To use the football analogy: get as good as you like, but at least make sure your team plays by the rules, knows what these are. So, back to the lesson plan, which we're able to hook to standards here and there... Consider the figurate numbers, such as the triangular and square numbers. Review some example (previous lessons). Use ping pong balls or other balls (clay OK), to model the figures. Dots on paper also work for one layer, i.e. for arrays in a plane. Today we're ready to tackle some "polyhedral numbers" meaning we come off the plane, start stacking layers. Two easy examples, based on our work with the square and triangular numbers: the half-octahedral and tetrahedral numbers. Just stack consecutive layers from the previous review starting with 1. This is where having actual balls, not just dots on paper, might be advantageous. Square: 1, 4, 9, 16... Triangular: 1, 3, 6, 10... Half-octahedral: 1, 1+4 = 5, 1+4+9 = 14, 1+4+9+16 = 30 Tetrahedral: 1, 1+3=4, 1+3+6 = 10, 1+3+6+10 = 20 A next step requires the Internet, although pre-printed handouts would be another possibility. Visit the On-Line Encyclopedia of Interger Sequences and enter the above sequences, just to confirm they're in there and to take a gander at some of the literature. A purpose here is to connect with the larger culture and get a sense of the knowledge base, its "humongousness" if you will. The "half-octahedral" sequence is actually called the "square pyramidal" sequence (same thing): http://www.research.att.com/~njas/sequences/A000330 And here are the tetrahedral numbers: http://www.research.att.com/~njas/sequences/A000292 Lots of literature, plenty of branch points to other topics. What we're looking for here is a bridge to the sciences. We'll find many of course, as both the square pyramidal and tetrahedral ball packings define the all important FCC lattice (also known as the CCP -- or even IVM in more esoteric writings). Alexander Graham Bell's engineering around towers and kits forms an architectural connection. Other examples of this space frame or truss are not difficult to find (here in Portland we have some great examples).[1] However, there's another way of getting to the FCC that starts with a single nuclear ball with 12 packed around it, all intertangent to one another. 12 equi-diameter balls will squeeze around a nuclear one in more than one way, but if you insist on maximizing points of intertangency, then you're basically looking at two ways, defined as the CCP and HCP respectively. So how much of the above crystallographic background goes into the lesson, and how much is for teacher notes? In this overview of the plan, I don't make those decisions. A lot depends on grade level and which standards we're meeting. In taking the CCP route, starting with 12-around-1, we're able to expand outward with successive layers. The shape is cuboctahedral, meaning we'll have probably needed some background in the various polyhedra, at least the most commonly encountered simple ones, such as the Platonic Five and a smattering of others. Since we're doing sphere packing, the rhombic dodecahedron (a zonohedron) is going to be quite important (links to Kepler). So yes, other lesson plans are implied here. To make a long story short, the number of balls in the successive layers of our growing cuboctahedron (1, 12, 42, 92...) is also the number of balls in successive icosahedral arrangements. A great way to get this across is to show how a cuboctahedron may transform into an icosahedron and vice versa. Animations enter the picture at this point, or many math classrooms will be equipped with a sticks-and-rubber-joins affair such as we see in this YouTube: http://www.youtube.com/watch?v=HefLC3PW8XQ Back to the Encyclopedia: http://www.research.att.com/~njas/sequences/A005901 You'll see in the header that "cuboctahedral" and "icosahedral" are both mentioned. The interesting fact about the icosahedral numbers is they lay the groundwork for talking about (a) geodesic spheres, wherein the vertices (balls) are perhaps equidistant from some center and (b) the structure of the virus, consisting of proteins called capsomeres that follow the above sequence.[2] So this is a bridge from mathematics to both architecture and naturally occurring micro-architecture. The virus is our bridge to talking about RNA-DNA in other lessons, when we've turned to other subjects in biology etc. For those charters working a computer language into their curriculum (a growing number in some districts), these are typically some of the shortest "programs" one might wish for. However, jumping ahead to the closed form algebraic expressions which generate the above will often be done in conjunction with specific proofs. Mathematical induction is one option, though in the case of the cuboctahedral numbers in particular, I favor a different approach, likewise algebraic.[3] I'm expecting you'll discover these interconnected topics making a lot of headway in some of the charters, as we have corporate sponsors lining up to develop their market potential and lots of green lights from university departments. Alaska Pacific University and the State University of Alaska work with the State of Alaska on the development of standards (the former in particular) and so are aware of where the connect points might be. TECC itself is looking at the computer language piece, an anticipation of standing out as a flagship in the Matsu District. Advertising oneself as "early college" (in the sense of encouraging cross-enrollment) and STEM (into science and math) somewhat requires backing that up with at least some computer programming activities. The days when just calculators were sufficient appear to be behind us where "technology in the classroom" is concerned. Both the UK and US are moving to embrace low cost open source tools (hence the coin "gnu math"). What I'm suggesting to subscribers to math-teach is they mine this same network of interconnected topics if wanting to differentiate above the "floor level" (bare minimum). The STEM aspects are obvious, connections to contemporary engineering and science manifest, opportunities for computer use clear. Yes, Alaska may be ahead of the pack at this point, but the lower 48 have opportunities to borrow, especially if not in lockstep based on some text book series that excludes all of the above. Those would be the "non-competitive" schools, many of them mired in outmoded curricula. If you're a parent, you now know what to put on your radar, if looking for signs of innovation and a commitment to STEM. Kirby [1] http://www.portlandbridges.com/00,D300CRW05758,24,0,1,0-portland-oregon.html [2] http://books.google.com/books?id=7rfpzW7eMW4C&pg=PA181&lpg=PA181&dq=capsomeres+1,+12,+42&source=web&ots=3E4rWZjam3&sig=zRtjB9Lui5ncH-UxmFB3b9oSQ0A&hl=en&ei=iACXSdqkKZKasAOI9YyFAQ&sa=X&oi=book_result&resnum=2&ct=result [3] http://mybizmo.blogspot.com/2007/01/gnu-math-memo.html ==== < /INTERJECTION > ===== So the functions below need to be rewritten as generators, mixed in with our Fibonacci generator, Pascal's triangle generator, plus the prime and chaotic sequence generators we've been discussing (acknowledging that the "generator" may not always be the most computationally efficient method -- sometimes efficiency takes a back seat for pedagogical purposes). > > We're focused on linking algebraic sequences, generator type stuff, to > visual imagery, imaginary content, like we do later with coordinate > systems (XYZ, spherical...), but "figurate numbers" ("polyhedral > numbers") are a first bridge between algebra and geometry, coordinates > be damned (until later). > > Glue four ping pong balls together: voila, a tetrahedron (your unit > of volume in some curriculum segments, unless your school is some kind > of joke -- Alaska leading the pack here in some ways). > << SNIP >> > A quick challenge: > > Spheres packing around a nuclear sphere go 1, 12, 42, 92... 10*L*L + > 2, where L is the layer number, except where L = 1 we have just the > one ball (the shape is a cuboctahedron). So how many balls total? > Add up all the layers. Yes, very easy to do in APL. > > In Python: > > def cubocta( layer ): > if layer == 1: return 1 > return 10 * layer ** 2 + 2 > > def total_balls( layer ): > total = 0 > for i in range(1, layer + 1): > total = total + cubocta( i ) > return total > > But isn't there a closed form algebraic expression for total_balls > that doesn't require cumulative adding? Damn straight. We'll get to > it. > > Don't forget to watch the cartoons! This isn't Bourbaki. > Visualizations encouraged! This is MVC. From macquigg at ece.arizona.edu Sat Feb 14 19:07:45 2009 From: macquigg at ece.arizona.edu (David MacQuigg) Date: Sat, 14 Feb 2009 11:07:45 -0700 Subject: [Edu-sig] project PyBat In-Reply-To: <5.2.1.1.0.20090212045752.03b05bf0@plus.pop.mail.yahoo.com> Message-ID: <5.2.1.1.0.20090214104801.03ba52f0@mail.ece.arizona.edu> I've uploaded a very early release to http://ece.arizona.edu/~edatools/PyBat Contributions are welcome, anything that has good tutorial value - solutions to problems on JavaBat, Project Euler, Challenge-You, Michel's nifty list comprehensions, your own ideas. Just be sure to credit original authors, even if their work was only an inspiration for yours. A link to the original source is best. See the example in module PyBat.SOLUTIONS.List1.make2 in the file PyBat.zip at the above link. Athar Hameed has volunteered to build an interactive website, most likely on Google's App Engine. Many thanks. -- 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 * ************************************************************ * At 04:58 AM 2/12/2009 -0700, David MacQuigg wrote: >At 05:37 PM 2/11/2009 -0800, michel paul wrote: > >>This is a pretty cool site: Project Euler. >> >>... >> >>It reminds me somewhat of JavaBat. There was some discussion earlier about doing something similar in Python? > >I'm still working on "PyBat", in my spare time :>). Interest at the University seems to have died out. > >I'll have something to post in the next few days, I hope. This will be a package of little programs to run on your own computer, rather than through a website - not as pretty, but it actually has some advantages in getting students to work with real programs and tools, with unit tests as part of the program, not tucked away in the internals of the website. > >Project Euler is very cool!! JavaBat has a different focus. I think of it as "batting practice" rather than intellectual challenge. > >I like the collaborative effort on Project Euler. We could do something similar with PyBat, increasing the number of topics and the number of problems on each topic, until we have covered all of Python. > >-- Dave From kirby.urner at gmail.com Mon Feb 16 21:58:18 2009 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 16 Feb 2009 12:58:18 -0800 Subject: [Edu-sig] project Euler In-Reply-To: References: <40ea4eb00902111737g14782735i7d2d94d12a21e86d@mail.gmail.com> Message-ID: For those wishing to go yet deeper into the lesson plan below ("quick challenge" is one form, but you could easily make this a much more enriching experience), I've filed stuff on math-thinking-l, very low traffic these days. http://mail.geneseo.edu/pipermail/math-thinking-l/2009-February/date.html I do get a lot of thumbs up feedback from "the professoriate" I'm glad to report, e.g. John P. Dougherty, Computer Science, Haverford College called it "an interesting approach" whereas Richard Hake, Emeritus Professor of Physics, Indiana University thought my little essay on constructivism was quite good, will be no doubt alerting physics teachers to its blogged version: http://coffeeshopsnet.blogspot.com/2009/02/about-constructivism.html That paragraph about Gattegno is my connection to Tizard.Stanford.Edu, a co-sponsor of my Pycon talk, which is up to 4 registrations. Last year, the videography made all the difference. If we're a small group it'll be more like we're TV experts, having a pow wow. I've invited my CTO to do camera work, and she's game (per our meeting before her Europe assignment), but it's like pulling teeth to line up additional engineering companies as sponsors (just ask the CFO if you don't believe me (smile)). The stimulus package looks good for the charters though, so maybe by the time OS Bridge rolls around in June... Kirby >>> A quick challenge: >>> >>> Spheres packing around a nuclear sphere go 1, 12, 42, 92... 10*L*L + >>> 2, where L is the layer number, except where L = 1 we have just the >>> one ball (the shape is a cuboctahedron). So how many balls total? >>> Add up all the layers. Yes, very easy to do in APL. >>> >>> In Python: >>> >>> def cubocta( layer ): >>> if layer == 1: return 1 >>> return 10 * layer ** 2 + 2 >>> >>> def total_balls( layer ): >>> total = 0 >>> for i in range(1, layer + 1): >>> total = total + cubocta( i ) >>> return total >>> >>> But isn't there a closed form algebraic expression for total_balls >>> that doesn't require cumulative adding? Damn straight. We'll get to >>> it. >>> >>> Don't forget to watch the cartoons! This isn't Bourbaki. From jurgis.pralgauskis at gmail.com Tue Feb 17 15:22:05 2009 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Tue, 17 Feb 2009 16:22:05 +0200 Subject: [Edu-sig] happy new python interactive tutorial :) In-Reply-To: <34f4097d0901041437g481cb5a4hfc494f6850e6a238@mail.gmail.com> References: <34f4097d0901041437g481cb5a4hfc494f6850e6a238@mail.gmail.com> Message-ID: <34f4097d0902170622oabe081ek788cb9c102a248d1@mail.gmail.com> Hello, You can try the online interactive python tutorial system (beta) http://84.55.3.131:801/ (waiting for feedback :) still no freedom for experimentation, but local pythoniast proposed different alternatives: - http://try-python.mired.org/ (sun OS restricted zone) - PyPy sandboxed python http://codespeak.net/pypy/dist/pypy/doc/sandbox.html (somebody said, pylons have such in 500 Server Error pages) - Zope "safe Python" (but won't prevent DOS) - or just check for some words (import, eval, exec, read, write, file) before exec'ing - dedicated virtual server with external process checking and restarting if some DOS has happened On Sun, Jan 4, 2009 at 10:37 PM, Jurgis Pralgauskis wrote: > my weekend project in the mood of tryruby > https://launchpad.net/intro-to-code > > what I liked most, that it nicely plays with IDLE > but I still don't know, how to handle multiline inputs?? > and how to start IDLE on windows... > > -- > Jurgis Pralgauskis > tel: 8-616 77613; > jabber: jurgis at akl.lt; skype: dz0rdzas; > Don't worry, be happy and make things better ;) > -- Jurgis Pralgauskis tel: 8-616 77613; jabber: jurgis at akl.lt; skype: dz0rdzas; Don't worry, be happy and make things better ;) From stef.mientki at gmail.com Tue Feb 17 15:51:00 2009 From: stef.mientki at gmail.com (Stef Mientki) Date: Tue, 17 Feb 2009 15:51:00 +0100 Subject: [Edu-sig] happy new python interactive tutorial :) In-Reply-To: <34f4097d0902170622oabe081ek788cb9c102a248d1@mail.gmail.com> References: <34f4097d0901041437g481cb5a4hfc494f6850e6a238@mail.gmail.com> <34f4097d0902170622oabe081ek788cb9c102a248d1@mail.gmail.com> Message-ID: <499ACED4.6030508@gmail.com> Jurgis Pralgauskis wrote: > Hello, > You can try the online interactive python tutorial system (beta) > http://84.55.3.131:801/ > (waiting for feedback :) > Very nice, and here's the first feedback ;-) You probably made mistake: print 'hi' ^ Please correct your mistake: cheers, Stef From kirby.urner at gmail.com Fri Feb 20 03:49:43 2009 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 19 Feb 2009 18:49:43 -0800 Subject: [Edu-sig] more promo Message-ID: I've done a good job of explaining my program (P4E) on math-thinking-l recently, underused bandwidth, a convenient nexus, lots of good feedback. I'm reminding college minded professors that we don't have "computer science" in most schools, yet there's a hunger to learn skills. What I gathered from our meeting in London that time is students just boycott if it's not about learning computer skills i.e. you can't do "math for math's sake" (whatever that means). So that's why I'm calling it math. That's my only toe hold, in today's stripped down scene. Naturally, there's tremendous inertia, so it's falling to charters and various elite academies (like Saturday Academy), to serve as early adopters. Home schooling, or "self schooling" often plays a role. Kids learn after hours. My intent is to meet the early bird deadline for Pycon, like 48 hours or less, no secret this'll be a stretch given I'm splitting reimbursement, won't cover me, but that's my problem. Mom in hospital down in LA, with my sis (better by the day) etc. If there's any real opposition to the futurism I peddle, I haven't met it yet. There's inertia, doing the same things today we did yesterday, but that's different from "opposition". So from a marketing point of view, I'm feeling upbeat. Thinking people tip their hats. I'm a highly respected geek in this town. But does anyone get it about FOSS? This OS Bridge thing needs to be big, but a lot of Portlanders don't remember being called "an open source capital" by Christian Science Monitor in 1985. Understanding about FOSS takes a fairly high level of literacy (ongoing). Is that torch getting passed? In my view, coming from OSCON, the FOSS revolution has succeeded, but now there's this "so now what?" and it seems like there's a lot of waiting for answers. Students are anxious for stories, understandably. But our media (a primary source) is rather short on technical content, unless it's about money (economics). Everything else is fiction (cops, lawyers, doctors... all invented for TV). Even when I had ChoicePlus (no longer), there was precious little "geek TV" e.g. nothing about Python. Of course I know what you're thinking: YouTube, Vimeo, ShowMeDo. Yeah, very true. But that still leaves us locked out of the schools, in some "underground university" (like the sound of that -- reminds of Morlocks, very H.G. Wells). I've been explaining to my engineer friends how SQL isn't just about theory, Venn diagrams etc., it's about telling technical stories about how the world works, what's behind Fandango (ticket sales), the ATM machine on the corner. School has traditionally had this storytelling function where you give some insights into infrastructure. Then there's the amazing history: Hollerith, "keeping tabs", punch cards, IBM... it goes on. One of our number is Allen Taylor, author of 'SQL for Dummies', so safe to say I have a sympathetic audience. He was in my Python for Wanderers also. What's missing, when you drop out the technical stuff, is a coherent story about how stuff works, including some of the most awesome stories of humans working together, collaborating, working in teams (GNU, Linux...). As geeks, we have the same needs and rights as any subculture to tell our stories, share our lore. Ada, Hopper... and let's not forget The Turk. :) More recently: GNU, Linux, Mozilla, XO... (or meme pool, needs protecting through retelling). Anyway, these are the kinds of thoughts, beyond trying to sell my biggest client on moving beyond MUMPS (or at least doing something on the side). DemocracyLab is out with a new app engine, haven't had time to work with it yet. Speaking of app engines, I guess I already mentioned doing technical review for Dr. Chuck, working for O'Reilly. I get a name credit, plus I mentioned his title in my source code: osgarden.appspot.com More soon, Kirby From kirby.urner at gmail.com Sat Feb 21 02:11:21 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 20 Feb 2009 17:11:21 -0800 Subject: [Edu-sig] more promo In-Reply-To: References: Message-ID: On Thu, Feb 19, 2009 at 6:49 PM, kirby urner wrote: > I've done a good job of explaining my program (P4E) on math-thinking-l > recently, underused bandwidth, a convenient nexus, lots of good > feedback. I'm reminding college minded professors that we don't have > "computer science" in most schools, yet there's a hunger to learn > skills. The marketing decision to spin P4E off of CP4E traces to a post Vilnius thread here on edu-sig. You'll see the O'Reilly program confuses the two (middle picture, click for larger view): http://controlroom.blogspot.com/2007/07/programming-for-everybody.html ...but I'm not too worried about it. We could say CP4E ended with DARPA's figuring IDLE would dominate the world (which it kind of still does, unless you switch to Wingware 101 or just stick with Vim -- not saying I'm hard core)... ...or we could say CP4E was itself a continuation of the APL dream, in turn dreamed by Leibniz and Ada i.e. "someday we'll have these machines running logic, i.e. we'll have "logic engines", or "math engines", and we'll teach about them in school." These days have of course arrived, and we're doing it. Dr. Vannevar Bush another hero, anticipated Google in 1945. Good lore for the kiddies (actually, a lot of them know it, it's the adults who don't -- I think because screenwriters have tight deadlines and know time to really learn about geekdom, that film called 'Hackers' with Angelina really stupid, no disrespect to the great actress). http://www.imdb.com/title/tt0113243/ > > What I gathered from our meeting in London that time is students just > boycott if it's not about learning computer skills i.e. you can't do > "math for math's sake" (whatever that means). So that's why I'm > calling it math. That's my only toe hold, in today's stripped down > scene. Here's another take, same subject, not necessarily the same kids: "These students are truly hell bent on getting skills with technology. If you're not offering access to computers, it's just not going to fly. No one will show up." or: "if you're not teaching SQL or LAMP, they just won't come to class. Anything that's just "chalk 'n talk" is considered "an elective". Of course I exaggerate, am talking mostly about "the barrios". In elite zip codes with old money, you still have the old slave ships, kids forced to "learn math" that has nothing whatever to do with TCP/IP or URL parsing, no regular expressions, no RSA, no nuthin. That might be OK for gringos..." ... more laughing about gringos. > > Naturally, there's tremendous inertia, so it's falling to charters and > various elite academies (like Saturday Academy), to serve as early > adopters. Home schooling, or "self schooling" often plays a role. > Kids learn after hours. > YouTube etc. Not news. > My intent is to meet the early bird deadline for Pycon, like 48 hours > or less, no secret this'll be a stretch given I'm splitting > reimbursement, won't cover me, but that's my problem. Mom in hospital > down in LA, with my sis (better by the day) etc. > Yeah, so I'm registered, even signed up for my own group, messing up the paperwork. I need to get that reimbursement for working with Dr. Chuck as well (O'Reilly). Tickler file, note to self. Autobio: As some of you know, I had a very rough Pycon in 2004, meaning I didn't get to go, the late Arthur Siegal one of the first I got in touch with. Sudden illness in the family, had to bail, even though scheduled to give a talk and already at GWU for a Bucky Fuller Symposium (me on a panel with Applewhite et al -- had to bail on dinner with him too, a major disappointment for both of us, though we'd met many times before, stayed in touch by phone until he died the following February). Pycon 2005 was great though, got to bring Dawn, stay with friends: http://mybizmo.blogspot.com/2005/03/pycon-2005.html Missed the ones in Texas, had a blast last year in 2008 (also Chicago). > If there's any real opposition to the futurism I peddle, I haven't met > it yet. There's inertia, doing the same things today we did > yesterday, but that's different from "opposition". So from a > marketing point of view, I'm feeling upbeat. Thinking people tip > their hats. I'm a highly respected geek in this town. Like a just dug out an article about me in The Oregonian, our major daily, from the late 1980s, talking about all the same stuff minus the FOSS piece. Fuller anticipated a "design science revolution" back then, lasting about 10 years. That was the FOSS piece, i.e. "networks and networking" in the Grunchie book (very esoteric I realize, not expecting many readers). I listed grunch.net as my "personal site" (a manuscript), whereas 4dsolutions.net is my little Silicon Forest thing, where I'm a king in my castle (lots of peer review though... an open source castle (pioneer in open source is my tagline, member of POSSE in good standing I think). I worry about that though, focus group time, is this good marketing? http://www.possepdx.org/ I should walk my talk, was just blogging about how we're not afraid of our Wild West heritage, like to play up the cowgirl thing. So why am I complaining. http://controlroom.blogspot.com/2009/02/more-marketing.html Maybe we just need a new cowboy? I'm not a cowboy by the way, more from Old Town (Northwest Regional China Council a former client). Still Wild West though (we've had Chinese for longer than we've had gringos, unless Kenewick was a gringo -- some want to claim that). > > But does anyone get it about FOSS? This OS Bridge thing needs to be > big, but a lot of Portlanders don't remember being called "an open > source capital" by Christian Science Monitor in 1985. Understanding > about FOSS takes a fairly high level of literacy (ongoing). Is that > torch getting passed? Passing the torch means sharing the lore. Is it appropriate to talk about recent history in high schools anymore? I think there's not much consensus on what to say, so people escape into fighting the Scopes Trial, pretend it's Darwin-Marx versus Jesus or something. Just makes USAers appear more and more ridiculous with each passing day. Canadians still respected. > > In my view, coming from OSCON, the FOSS revolution has succeeded, but > now there's this "so now what?" and it seems like there's a lot of > waiting for answers. Students are anxious for stories, > understandably. Screenwriters could be doing more. 'Hackers' is not a good movie, as I've said. They're not getting "geekdom" right. Making movies geeks like (e.g. 'Serenity') is not the same thing as making a movie about geeks. 'Revolution OS' was cool, but it's dated. Those who get to see OSCON get what the center ring is like. Damian, Larry, Allison, Nat, Holden, Mark... R0ml but that doesn't percolate outward that far, unless you're hovering over YouTube, watching a lot of O'Reilly TV. Not everyone is. Kids aren't getting the real culture. NUMB3RS isn't even in the ballpark. > > But our media (a primary source) is rather short on technical content, > unless it's about money (economics). Everything else is fiction > (cops, lawyers, doctors... all invented for TV). Even when I had > ChoicePlus (no longer), there was precious little "geek TV" e.g. > nothing about Python. > Right. I agree with myself. Same rant as above. > Of course I know what you're thinking: YouTube, Vimeo, ShowMeDo. > Yeah, very true. But that still leaves us locked out of the schools, > in some "underground university" (like the sound of that -- reminds of > Morlocks, very H.G. Wells). > It's really an ancient pattern. Kid hunkers down over boring school work. Circus comes to town. Wow, to be a clown... wants to join. Mom says no. Back to school. But someday... But when the Circus comes to town, how many kids get to go? We're neither that kid friendly nor family friendly at most of these venues. This is *not* a criticism as I think we're just talking about new opportunities, other niches to fill. Pycon and EuroPython are just fine the way they are. But what else might we do. BarCamp is probably part of the answer. I like to think our little Wanderers group is also a good template, other towns could adopt it. And of course there's Saturday Academy, all about bringing high school aged students into the 21st century, into 2009, most high schools stuck in the 1980s if not earlier (still think dinking with calculators is what math is about). > I've been explaining to my engineer friends how SQL isn't just about > theory, Venn diagrams etc., it's about telling technical stories about > how the world works, what's behind Fandango (ticket sales), the ATM > machine on the corner. School has traditionally had this storytelling > function where you give some insights into infrastructure. Then > there's the amazing history: Hollerith, "keeping tabs", punch cards, > IBM... it goes on. People still afraid to tell this story at an adult level.... > > One of our number is Allen Taylor, author of 'SQL for Dummies', so > safe to say I have a sympathetic audience. He was in my Python for > Wanderers also. > > What's missing, when you drop out the technical stuff, is a coherent > story about how stuff works, including some of the most awesome > stories of humans working together, collaborating, working in teams > (GNU, Linux...). > Unicode... > As geeks, we have the same needs and rights as any subculture to tell > our stories, share our lore. Ada, Hopper... and let's not forget The > Turk. :) More recently: GNU, Linux, Mozilla, XO... (or meme pool, > needs protecting through retelling). > The Turk beat Napolean at chess. The bravest drawf who ever lived maybe. Think of the stress. > Anyway, these are the kinds of thoughts, beyond trying to sell my > biggest client on moving beyond MUMPS (or at least doing something on > the side). > > DemocracyLab is out with a new app engine, haven't had time to work with it yet. > Still haven't.... It uses that Java emulator thing, where you write it in Java, get it back in Javascript. Is that how it works? Lemme go Google: http://code.google.com/webtoolkit/ Yeah, so there's Python on the back (app engine) with Java helping out with the GUI (templates, views). So there's a foothold for ya. If your school doesn't have the IT, but has Internet, consider codeveloping for GAE using Subversion (or one of those, Launchpad?). Have the web site be about math, have it link to YouTubes you make about math. 'Who Is Fourier?' Notice they answer in terms of Fourier transformations, not just bio. I've enjoyed coding sine and cosine for VPython. It takes very little code to write a generic plotter that lets you actually rotate the graph. Once might consider that quirky, to have a "two dimensional object" (like a sine wave) actually take on spatial attributes, but in my curriculum that makes perfect sense. We're highly suspicious of graphs you can't rotate, if you wanna know the truth, no disrespect to Tufte. It's just, why do positive numbers always go to "the right"? If your camera gets around the other side, the *very same graph* is pointing left for the positives. That's not so radical, but you'd be amazed how no one thinks that way, which means their right brain is atrophied (figuratively speaking, nothing on X-Ray... MRI maybe). Understanding handedness is too important to be left to college chemistry or wherever they teach it today. > Speaking of app engines, I guess I already mentioned doing technical > review for Dr. Chuck, working for O'Reilly. I get a name credit, plus > I mentioned his title in my source code: osgarden.appspot.com > > More soon, > > Kirby > Yeah, that was fun. Dr. Chuck doesn't mention GWT. He works to get across Python, complains he's an old FORTRAN programmer if you push OO too hard. I'm getting the impression a lot of CS profs are still PTSD from the "paradigm shift" to OO, which I think we've agreed was overhyped by marketing whizzes who didn't really have a clue. I guess I have to blame the Visual Basic subculture in some ways, as VB was just objects, no classes, more like JavaScript in that way. Yet the VB camp has always been very loud in terms of marketing. Just a theory. Kirby From kirby.urner at gmail.com Mon Feb 23 19:49:13 2009 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 23 Feb 2009 10:49:13 -0800 Subject: [Edu-sig] more "Kirby's Classroom"... Message-ID: "More from Kirby's Classroom... (as seen on TV)" by K. Urner, Feb 23, 2009 Greetings math teachers, teachers of machine logic, or whatever this is (Python etc.). I'm continuing to apply spit and polish to various aspects of P4E here in Portland, more meetings with geometry buffs especially. Just got a new client today, HarrisonStreet Studios (JimmyLott.com) -- he does my soundtrack for a CSN pilot. Don't remember if I linked it, tangentially related in that I use Python to brew some of those graphics.&& == New E-toys like "game": first person car view, like typical race game, except freeway "dotted" line represents equator, left and right margins the respective tropics of Capricorn and Cancer. Lots of lighting applies, in getting the sun disk to oscillate per seasons, shadows to move, i.e. as we speed around the planet, steering between margins, we have access to astronomical data, with toggle inset frame showing inertial solar view, car a blip. 23 degree tilt, slight precession (~25K cycle, pole star not always pole star). Here's the ballpark we're talking: http://www.astro.lsa.umich.edu/undergrad/Labs/precession/index.html == Glenn (CSO) reminds me of lore associated with "beyond flatland" (the freeway) i.e. middle earth, i.e. what's beyond the margins? Of course we might talk in terms of constellations, but also geography e.g. Alaska, Greenland, Siberia (north) Antarctica (south). He studies the many sagas. In buckaneer lore (the Bucky stuff) we see the south as "where to go to get around" i.e. the fast moving current connects the Atlantic, Pacific and Indian oceans with a "hop on, hop off" turntable, used by world class pirates of old (before jets). Roz Savage connects here as "action figure" (inspiring to XX engineers, a target demographic), more in my blogs. These kinds of high powered arcade games don't run on tiny laptops so easily, more for "education mall" setting (coffee shops, supervisory staff, some classrooms -- a lot like a university but with more private sector supervision, when it comes to curriculum). However this isn't to discourage any open source versions on whatever platforms (e.g. Pygame, Pyglet). In general, I'm encouraging a Wild West "skin" for some of these, i.e. flat board store fronts with shacks in back, always fun to have an imposing "bank with columns" with like a mom 'n pop parked out pack, very "ToonTown" and historically an inspiration for the USA "mall" idea (similar to "bazaar"): http://www.flickr.com/photos/17157315 at N00/3304392700/ http://www.disneyorama.com/2008/11/14-original-disneyland-attractions-that-are-still-around-today/ http://picasaweb.google.com/DanDiLuzio/200806WildWestCity#5220420818691462098 http://www.flickr.com/photos/17157315 at N00/3303583889/ Random beefs (aka "dead beefs" -- esoteric allusion **): Sometimes gmail CSS seems weird, like right now I'm stuffed in a small Mozilla widget in FireFox, lots of screen real estate to my right, but no way to grow the widget. Anyone else notice that? If there's a ragged right indent, it might be because I'm messing up word wrap. And on the topic of glitches, I'll search engine my own blogspot, not get results (timeout with no error? then search again and bingo! the 2/3 posts I was expecting to get). I'm thinking "low batteries" sometimes. Pycon: might stay with Deb's cousin a night or two, still sorting it out, couldn't see blocking in Hyatt, given my "born in Chicago should see more of it" agenda. Or just Crowne Plaza like last year? Got used to the place, fond memories. I was thinking Dr. Chuck this morning (Umich), for letting me play in his sandbox with O'Reilly. I'm not saying we saw eye to eye on everything, each author entitled to a style, plus this was more an anthology in some ways (contributed chapters -- hence the 'et al' in my home.py citation). So, to edu-sig business, here's more of my usual.... ======================= from recent outbox, excerpts from some average correspondence: << SNIP >> I've got this sort of trademarked way of teaching Python, insofar was we trademark pedagogy (we don't, not if we want it to spread, though we appreciate citations), where we say "everything is a python in Python" (kind of like everything is a car in 'Cars'), and I can back that up with these little diagrams or "cave paintings". Turns out Pierce, the American Pragmatist, was getting to diagrams, per Dr. Susan Haack, dunno if you saw my fourth blog already, Coffee Shops Network. Haack and I were both Rorty students, she playing opposition, me a huge fan (he was my thesis advisor at Princeton). << SNIP >> A python in Python looks like this: class Python: def __init__(self): # I am born <-- comment self.stomach = [] def eat(self, food): self.stomach.append(food) def __repr___(self): return 'Hello, I'm a python at ", id(self) Would this make sense to an 8th grader? It did, but on the computer you get to "run the blueprint" i.e. this is just a template for a Python. You trigger a birth event, assign the resulting object a name, like this: >>> cute_kathy = Python() >>> cute_kathy.eat("something that kathy's like") and so on. Kids like it. Then they make multiple pythons, have them eat each other. Then they make dogs and monkeys, have them inherit from Mammal -- and they're hooked. From then on, eating out of my hand, per Saturday Academy. The twisted part, but fun, is that __repr__ and __init__, very much a part of the language, look like __ribs__, and snakes have a lot of ribs. I shared this in Vilnius and places. There's even a new rib, part of , called __missing__. http://discorporate.us/jek/talks/defaultdict/ === Kirby ** http://en.wikipedia.org/wiki/0xDEADBEEF#Magic_debug_values && http://mathforum.org/kb/thread.jspa?threadID=1905517&tstart=0 (a bit of a treasure hunt, but worth it if you want to see a cool video) From jurgis.pralgauskis at gmail.com Fri Feb 27 23:06:59 2009 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Sat, 28 Feb 2009 00:06:59 +0200 Subject: [Edu-sig] xturtle online via processing.js !? Message-ID: <34f4097d0902271406g5f84a84kf37307b3180337e4@mail.gmail.com> Hi, I am struggling around with interactive online py tutorials with https://launchpad.net/projects/intro-to-code (ith might become securely sandboxed soon, as pypy made it possible http://blog.sandbox.lt/en/WSGI%20and%20PyPy%20sandbox :) but one more thing is I'd like to let access xturtle functionality online - one possible way could be triggering tkinter to save its canvas to ps, and then convert them with imagemagic and show via web (animated gif or static) - but if pyjamas can render GUI for js (http://www.google.lt/search?&q=pyjamas+python ), mayby there is a way to **translate turtle commands to processing.js analogues** http://ejohn.org/blog/processingjs/ would it be difficult -- how do you think? -- Jurgis Pralgauskis tel: 8-616 77613; jabber: jurgis at akl.lt; skype: dz0rdzas; Don't worry, be happy and make things better ;) http://sagemath.visiems.lt From andre.roberge at gmail.com Sat Feb 28 01:18:38 2009 From: andre.roberge at gmail.com (Andre Roberge) Date: Fri, 27 Feb 2009 20:18:38 -0400 Subject: [Edu-sig] xturtle online via processing.js !? In-Reply-To: <34f4097d0902271406g5f84a84kf37307b3180337e4@mail.gmail.com> References: <34f4097d0902271406g5f84a84kf37307b3180337e4@mail.gmail.com> Message-ID: <7528bcdd0902271618s72a07710l32bbd19206b7e47e@mail.gmail.com> On Fri, Feb 27, 2009 at 6:06 PM, Jurgis Pralgauskis wrote: > Hi, > > I am ?struggling around with interactive online py tutorials > ?with https://launchpad.net/projects/intro-to-code > (ith might become securely sandboxed soon, as pypy made it possible > http://blog.sandbox.lt/en/WSGI%20and%20PyPy%20sandbox ?:) > > but one more thing is I'd like to let access xturtle functionality online > - one possible way could be triggering tkinter to save its canvas to ps, > and then convert them with imagemagic and show via web (animated gif or static) There's probably a better way: use the html canvas. I tried to implement a turtle module to be embedded with Crunchy (http://code.google.com/p/crunchy) - it is available as a demo experimental feature. You could use this as a starting point if you want. Andr? > > - but if pyjamas can render GUI for js > (http://www.google.lt/search?&q=pyjamas+python ), > mayby there is a way to **translate turtle commands to processing.js analogues** > http://ejohn.org/blog/processingjs/ > > would it be difficult -- how do you think? > > -- > Jurgis Pralgauskis > tel: 8-616 77613; > jabber: jurgis at akl.lt; skype: dz0rdzas; > Don't worry, be happy and make things better ;) > http://sagemath.visiems.lt > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From jurgis.pralgauskis at gmail.com Sat Feb 28 16:07:41 2009 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Sat, 28 Feb 2009 17:07:41 +0200 Subject: [Edu-sig] xturtle online via processing.js !? In-Reply-To: <7528bcdd0902271618s72a07710l32bbd19206b7e47e@mail.gmail.com> References: <34f4097d0902271406g5f84a84kf37307b3180337e4@mail.gmail.com> <7528bcdd0902271618s72a07710l32bbd19206b7e47e@mail.gmail.com> Message-ID: <34f4097d0902280707w6d168f44xf526d86a167f3dc9@mail.gmail.com> Hey, thats cute :) 1) I played around, and added Turtle.circle() to actions :) in code its called called circle_forward(self, radius, extent=None) and also aliased as circle you can find it http://files.akl.lt/users/jurgis/python/crunchy/ 1a) seems it would be best to use canvas interface methods, which are already in graphics module (according to DRY phylosophy) or at least decine upon method naming -- which just generate code vs those that pass it to exec_js plugin 1b) seems, like polygons and filling also would not be a big problem https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes#section_9 for fill you'd just jave to collect the points and then repeat them with fill() at end 2) and also I'd like to make it convert all actions to javacript code at once then it would be easier to implement turtel_js and graphics in other projects -- easily escaping crunchy :D As now for asinchronous update, the server and session must be up all the time 2a) then probably time.sleep would be also good to interface directly to js something like http://groups.google.co.in/group/phpguru/browse_thread/thread/8215dcdc2ac7321c 3) how is it related to server_root/reborg js experiments? so I'll try sth more tomorrow or in a week-time On Sat, Feb 28, 2009 at 2:18 AM, Andre Roberge wrote: > On Fri, Feb 27, 2009 at 6:06 PM, Jurgis Pralgauskis >> but one more thing is I'd like to let access xturtle functionality online >> - one possible way could be triggering tkinter to save its canvas to ps, >> and then convert them with imagemagic and show via web (animated gif or static) > > There's probably a better way: use the html canvas. ?I tried to > implement a turtle module to be embedded with Crunchy > (http://code.google.com/p/crunchy) - it is available as a demo > experimental feature. ?You could use this as a starting point if you > want. -- Jurgis Pralgauskis Don't worry, be happy and make things better ;) http://sagemath.visiems.lt From kirby.urner at gmail.com Sat Feb 28 16:28:51 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 28 Feb 2009 07:28:51 -0800 Subject: [Edu-sig] Python for Teachers (last call) Message-ID: Last chance to sign up for 'Python for Teachers', one of a few still below 10 and therefore eligible for cancellation in the next couple of days. If you were thinking to join us, just haven't gotten around to registering, today would be a good time. About 'Python for Teachers': Developed from my earlier 'Python Briefing', 'Python for Teachers' has been presented in abbreviated form to our local PPUG (Portland Python Users Group) [0], and to a gathering at Linus Pauling House, Dr. Mario Livio joining us, author of the recently published 'Is God a Mathematician?' [1] After PPUG, Chris F. wrote: "Thanks for the VPython talk at PDX Python. I realize you had to skim, but the content was really interesting. I wish I'd had teachers like you. Good luck at PyCon." Dr. Livio liked my use of Akbar font and had no problems re 4D vs. 4D vs. 4D (one of the slides, very technical). I'm doing another presentation of 'Python for Teachers' on March 17, and will be submitting it to OS Bridge before deadline (what Portland is doing instead of OSCON this year). Then of course I'm on tap to actually teach the stuff (pythonic math) in April, through Saturday Academy. "Pythonic math" as I teach it comes equipped with a new kind of spatial geometry -- with some connections to Wolfram's stuff (i.e. cellular automata studies), even more to Bucky Fuller's (where my '4D' comes from in 4Dsolutions.net -- the meme I was talking about with Dr. Livio, and also the 'rbf' in rbf.py).[2] A lot of the content is quite familiar however, just recast for 21st century tools (beyond calculators, per last year's Chicago talk).[3] A lot of the same content will be useful to adults, so one of the questions we explore is how to adapt technical content for different age groups and walks of life -- using audience-appropriate stories of high mnemonic value is key. Our problem though (and marketing challenge), is Pycon attracts programmers, not math teachers. I'm saying there's not a huge difference, once you consider "computer language = machine logic" (per Iverson), and factor in XP (pair programming etc.) i.e. everyone is a math teacher, especially in open source communities that encourage sharing among peers. The content is semi-numerical and algorithmic (per Knuth) and legitimate fodder for K-12 mathematics curricula. Why I target K-12, and *don't* call it "computer science", is spelled out in detail on math-thinking-l this month.[4] It's where most analysts consider the pipeline to be broken, i.e. students turn away from STEM subjects even before getting to college. CS is an obscure elective if offered at all, whereas math (what's broken) is considered mandatory. High school is the big turn off. What shall we do about it? In Portland, we're coming up with some answers: http://mathforum.org/kb/message.jspa?messageID=6626933&tstart=0 (SQL with VPython etc.) Most "schoolish math" teachers have either never heard of FOSS or simply don't use it, and the stuff that they teach is controlled by those with little to no computer skills, even in math and science. "Bridging the Digital Divide" has become a battle cry to address this situation, but just dumping affordable commodity hardware into the schools doesn't address questions about curriculum. What shall we do with this embarrassment of riches? Anyway I knew from the top this wouldn't be an easy niche to fill (no budget for a Flying Circus blimp), what with the Spanish Inquisition and all that rot, what? <--- Monty Python voice. Kirby 4D [0] http://coffeeshopsnet.blogspot.com/2009/02/glass-bead-game.html (write up of meetup with Livio) [1] http://mail.python.org/pipermail/portland/2009-February/000625.html (Michelle's write up of PPUG) [2] http://coffeeshopsnet.blogspot.com/2009/02/more-inside-story.html (more re our battle for hearts and minds) [3] http://showmedo.com/videos/?author=1851 [4] http://mail.geneseo.edu/pipermail/math-thinking-l/2009-February/001293.html ============ Me urging Dr. Chuck to sign up, a CS prof at U Mich I've been working with for his O'Reilly book on the Google App Engine, which I'm also promoting (consider this free advertising): ---------- Forwarded message ---------- From: kirby urner Date: Sat, Feb 28, 2009 at 6:28 AM Subject: Re: Updated Version of the Documents To: Dr. Chuck Greetings sir, Welcome back from South Africa, where I too have had many adventures. You should register for the workshop if you haven't yet, March 26 afternoon. ?We only have 7 signed up (not the only small group) and there's talk of cutting those that don't reach 10 in the next couple days. Kirby Cc: edu-sig (last chance to boost enrollment folks -- might have to admit Pycon isn't the right venue for 'Python for Teachers'). ?I'll put something else out on Chipy as well. ?If you have a blog, and want to promote, this is your chance. On Sat, Feb 28, 2009 at 5:02 AM, csev wrote: > Kirby, > > I am finally back from South Africa with a decent network connection. > ?Thanks for all of your help and comments. > > I will make sure that you get your book and compensation. ?I don't know the > mechanics or when it happens - but I will follow through to make sure it all > happens. > > I will be seeing you at PyCon - what day is your workshop? > > /Chuck > > On Feb 23, 2009, at 5:30 PM, kirby urner wrote: > >> Thank you Dr. Chuck, it has been a pleasure working with you and I >> enjoyed our correspondence. >> >> Please note the name credit in the source (home.py) in this Google App >> Engine: ?osgarden.appspot.com >> >> I was pleased to use PyFontify, un-Tk'd by Just van Rossum with a >> repurposed py2html to get the colorized source on the fly, for >> historic reasons if not because there aren't other more elegant >> solutions (we've seen some at PPUG -- Portland's very active and >> talented Python user group). >> >> As the token high school teacher looking for something to use in K-12, >> I have to say you opened my eyes to a lot of esoteric history and >> background I might not otherwise know, plus your making everything be >> in terms of an httpRequest and httpResponse, with Python "between the >> ears" was very compact, helped me in subsequent curriculum writing for >> clients, including Providence (corporate training) and Matsu District >> (Alaska footprints). >> >> Note that I also work with adult aged learners and I didn't see >> anything that'd be a turn off for them, though in person I use more >> colorful language than O'Reilly books do (per slides), and for the >> same "Head First series" motives (i.e. mnemonics matter). ?Probably >> it's the same in your classes. >> >> For purposes of reimbursement my mailing address for O'Reilly Media is: >> >> 4D Solutions >> 3745 SE Harrison St. >> Portland, OR ?97214 >> >> I perhaps will run into you at Pycon? ?My 'Python for Teachers' >> (workshop) promises to be rather intimate. ?We'll have the >> internationally recognized Tizard professor from Kingston (I think it >> is -- my colleague from last year), Steve Holden, chair of PSF (we >> hung out last OSCON), and a few others. ?We'd love to have the benefit >> of your wisdom and insights. >> >> Thanks again for including me (with a name credit). ?I take great >> professional pleasure in getting to work with O'Reilly, one of the >> most reputable publishers in the business. >> >> Sincerely, >> >> Kirby Urner >> 4D >> >> "everyone is a car in 'Cars', even the bug on the windshield" -- KU to >> Kathy Hyzy >> >> "everything is a python in Python" -- 4D mnemonic >> >> "__missing__ rib" -- Jason Kirtland ( >> http://discorporate.us/jek/talks/defaultdict/ ) From andre.roberge at gmail.com Sat Feb 28 17:50:29 2009 From: andre.roberge at gmail.com (Andre Roberge) Date: Sat, 28 Feb 2009 12:50:29 -0400 Subject: [Edu-sig] xturtle online via processing.js !? In-Reply-To: <34f4097d0902280707w6d168f44xf526d86a167f3dc9@mail.gmail.com> References: <34f4097d0902271406g5f84a84kf37307b3180337e4@mail.gmail.com> <7528bcdd0902271618s72a07710l32bbd19206b7e47e@mail.gmail.com> <34f4097d0902280707w6d168f44xf526d86a167f3dc9@mail.gmail.com> Message-ID: <7528bcdd0902280850p3266e69esc60f63bee2a71e5a@mail.gmail.com> On Sat, Feb 28, 2009 at 11:07 AM, Jurgis Pralgauskis wrote: > Hey, thats cute :) > Thanks. :-) > 1) I played around, and added Turtle.circle() to actions :) > in code its called called circle_forward(self, radius, extent=None) > and also aliased as circle > you can find it http://files.akl.lt/users/jurgis/python/crunchy/ > Looks nice. > 1a) seems it would be best to use canvas interface methods, > which are already in graphics module (according to DRY phylosophy) > or at least decine upon method naming -- > ?which just generate code vs those that pass it to exec_js plugin > I agree... this was (and still is) just an experiment. > 1b) seems, like ?polygons and filling also would not be a big problem > https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes#section_9 > for fill you'd just jave to collect the points and then repeat them > with fill() at end > Agreed. > 2) and also I'd like to make it convert all actions to javacript code at once > then it would be easier to implement turtel_js and graphics in other > projects -- > easily escaping crunchy :D That's a good point. However, the idea was to be able to control a turtle from an interpreter, typing one instruction at a time and seeing the result. > As now for asinchronous update, the server and session must be up all the time > > 2a) then probably time.sleep would be also good to interface directly to js > something like > http://groups.google.co.in/group/phpguru/browse_thread/thread/8215dcdc2ac7321c > > 3) how is it related to server_root/reborg js experiments? > It's not - at least not for now. The reeborg experiment is an very early prototype of an implementation of rur-ple (http://rur-ple.sourceforge.net) inside Crunchy. You can see a different version live at http://reeborg.world.googlepages.com/reeborg.html Andr? > so I'll try sth more tomorrow or in a week-time > > On Sat, Feb 28, 2009 at 2:18 AM, Andre Roberge wrote: >> On Fri, Feb 27, 2009 at 6:06 PM, Jurgis Pralgauskis >>> but one more thing is I'd like to let access xturtle functionality online >>> - one possible way could be triggering tkinter to save its canvas to ps, >>> and then convert them with imagemagic and show via web (animated gif or static) >> >> There's probably a better way: use the html canvas. ?I tried to >> implement a turtle module to be embedded with Crunchy >> (http://code.google.com/p/crunchy) - it is available as a demo >> experimental feature. ?You could use this as a starting point if you >> want. > > -- > Jurgis Pralgauskis > Don't worry, be happy and make things better ;) > http://sagemath.visiems.lt >