From kurner at oreillyschool.com Mon Jun 1 18:50:38 2015 From: kurner at oreillyschool.com (Kirby Urner) Date: Mon, 1 Jun 2015 09:50:38 -0700 Subject: [Edu-sig] Coming from FoxPro... Message-ID: Python is a lot more elegant than xBase in many ways, but then those of us coming from xBase appreciate the continuity. For example having a ">>> " (chevron) instead of a dot prompt (". ") is superficial whereas what's deep is having REPL in both cases. Ever since APL, I've been biased towards interpreters I could "chat with". xBase came out of Jet Propulsion Labs (CA) as a satellite controller language and was adapted for commercial use as dBase II (initially) surviving through dBase V under Borland, with FoxPro a sister implementation of the same language. Microsoft purchased FoxPro to compete with Borland as in those days many believed xBase in all its flavors, was to be one of three or four pillar languages going forward. FoxPro Advisor was a commercial magazine in stores. I even published an article in it (March 1994). In xBase we had keywords 'scatter' and 'gather' and I find myself using those verbs in explaining * and ** in my work as a Python mentor for O'Reilly School. On the arguments side, *seq makes syntactic sense, as it does on the parameters side (of calling a callable). Likewise **hash_of_stuff: we need to explain these as complementary uses. When you call a function with *seq as your argument, you're "scattering" a sequence ("exploding it") into positionals, whereas with def F(*seq): as a parameter, you're "gathering" ("imploding") positionals coming in. Ditto with dicts: scatter a dict into keyword arguments on the calling side (**d is an argument), gather incoming keyword arguments into a dict when called (**d is a parameter). Ed Leafe is another VFP (Visual FoxPro) refugee I meet at Pycons and OSCONs. Ed worked on Dabo to help VFP developers continue on in Python. I met another brilliant guy here in Portland, Jim Heuer, (I worked for him briefly some years back), who juggles Python, VFP and C all in one major SaaS application that routes trucks all over. He's a transportation engineer and a spry software developer. VFP attracted a lot of talented coders in my experience. Microsoft is discontinuing its support of VFP this year. No migration to 64-bit architecture planned. No next edition in the pipeline. That's partly why we're getting a lot of refugees in Python World. Microsoft maybe hoped to shepherd these refugees to Visual Basic perhaps, but no VFP progammer I know likes VB all that much (xBase was so superior to BASIC all along). That leaves other .NET platforms but C# is so low level. We can speculate as to how the diaspora will pan out. Some may just keep using VFP anyway as just because Microsoft no longer loves it does not mean one must abandon ship just yet. Maybe time to get the life rafts ready? Kirby Links: http://www.vbforums.com/showthread.php?116057-substitue-for-scatter-memavr-and-gather-memvar-of-foxpro-in-vb http://dabodev.com/ https://mail.python.org/pipermail/portland/2015-January/001663.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From mamckenna at sch.ci.lexington.ma.us Tue Jun 2 12:00:28 2015 From: mamckenna at sch.ci.lexington.ma.us (Marianne McKenna) Date: Tue, 02 Jun 2015 06:00:28 -0400 Subject: [Edu-sig] Edu-sig Digest, Vol 143, Issue 1 Message-ID: I am away from the office today June 2nd. I will try to respond by email. If you need immediate help, please contact tech support. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mamckenna at sch.ci.lexington.ma.us Wed Jun 3 12:00:35 2015 From: mamckenna at sch.ci.lexington.ma.us (Marianne McKenna) Date: Wed, 03 Jun 2015 06:00:35 -0400 Subject: [Edu-sig] Edu-sig Digest, Vol 143, Issue 2 Message-ID: I am away from the office today June 3rd. I will try to respond by email. If you need immediate help, please contact tech support. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mamckenna at sch.ci.lexington.ma.us Thu Jun 4 12:00:27 2015 From: mamckenna at sch.ci.lexington.ma.us (Marianne McKenna) Date: Thu, 04 Jun 2015 06:00:27 -0400 Subject: [Edu-sig] Edu-sig Digest, Vol 143, Issue 3 Message-ID: I am away from the office today June 3rd. I will try to respond by email. If you need immediate help, please contact tech support. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mamckenna at sch.ci.lexington.ma.us Fri Jun 5 12:00:25 2015 From: mamckenna at sch.ci.lexington.ma.us (Marianne McKenna) Date: Fri, 05 Jun 2015 06:00:25 -0400 Subject: [Edu-sig] Edu-sig Digest, Vol 143, Issue 4 Message-ID: I am away from the office today June 3rd. I will try to respond by email. If you need immediate help, please contact tech support. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Sat Jun 6 19:39:52 2015 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 6 Jun 2015 10:39:52 -0700 Subject: [Edu-sig] Distance Learning: where and how In-Reply-To: References: Message-ID: Another link pursuing distance learning as a topic: https://groups.google.com/forum/#!msg/mathfuture/qoOpRTX0iKk/ISaB8mYkTPoJ mathfuture, a Google Group. Kirby On Thu, May 21, 2015 at 7:21 PM, kirby urner wrote: > > I take a debate-encouraging position against the standard > cohort-based, curve- and letter-graded style of teaching in > this blog post from when I was the USDLA (distance learning) > conference: > > http://worldgame.blogspot.com/2015/04/against-grain.html > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kurner at oreillyschool.com Mon Jun 8 18:43:05 2015 From: kurner at oreillyschool.com (Kirby Urner) Date: Mon, 8 Jun 2015 09:43:05 -0700 Subject: [Edu-sig] Python5 @ OST / HK (science fiction) Message-ID: I've actually written some code for Python5 and it's a work in progress. Tractors instead of Turtles but as a way of introducing Turtles i.e. I'm not "anti-Turtle" in using a Tractor instead. A subclass of Tractor, CropCircleTractor, outputs the Mandelbrot Set. ASCII art output in version one, swapping in better graphics (deeper bit-wells) as the course progresses. OST = O'Reilly School of Technology, a real place, a real school. I work there, have for some years. HK = Hong Kong We don't have an OST in Hong Kong but the idea is "how would we design the parent classes of the current OST such that instances would work in other places." You could say i18n is the theme, and that's a pretty steady note for me (was our theme at the OSCON booth last year -- if you came by, our main guy was speaking in like Japanese, Portuguese etc., gifted in that way (me not so much)). No booth this year, but one of my co-workers is giving a talk. Looking forward! Dunno if 'A Pattern Language' is used much in CS. Sounds like an elementary patterns text but it's for architects mostly and deals with architectural "places" that crop up over and over: the nook, the hallway, the stairwell... like in movies; we can conjure myriad scenes (the tower, the basement...). I'm sketching OST / HK in terms of such Places at first: Oasis; Cruise; Stable... We have a stable of mentors in HK and through our "travel agency" (aka student services, like Expedia) you book a "cruise" (just a metaphor usually -- though in HK we might do some ships...). You being a student. Mentors from the stable come to the Oasis (aka watering hole) to fill up on courses (what caseload they'd like for the summer). Some mentors are lifers, others jump off and on more. We have celebrity guests. So that's pretty much what we have today, but a bare bones version. My in-house memos flesh it out more and explain how, in a parent class implementation, we can get more generalized about our Places and not get locked in to accidental features (attributes) of the current instance. That's a brainstorming technique other companies might already use I don't know. Yes, those "real world exigencies" matter, but in science fiction they don't so much. Kirby Python Mentor / OST -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Jun 10 01:18:19 2015 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 9 Jun 2015 16:18:19 -0700 Subject: [Edu-sig] fun with voting (by secret ballot) Message-ID: """ The code below derives from a thread on elections-wg at python.org where we were talking about tie-breaking techniques. There's a well known way that's actually used, but I was inspired to think about a game wherein the ballots are like playing cards in some ways, each encoded with a unique prime. I've got some notes in the moderator queue at math-teach (lots of traffic), for which I'll share the URL. More in this month's elections-wg archive, public-facing. It's just another way to introduce the Fundamental Theorem of Arithmetic while reminding students of the composite vs. prime distinction. Standard fare. (CL) copyleft, K. Urner / 4Dsolutions.net, 2015 """ import random class Ballot: """secret: unique prime belongs to ballot itself """ def __init__(self): self.dna = random.choice(pool_of_primes) # this is done at the store pool_of_primes.remove(self.dna) def vote(self, name, vote=1): self.candidate = name self.approve = vote def __repr__(self): return "Ballot with prime {}".format(self.dna) pool_of_primes = [int(it) for it in """\ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239""".split()] # 52 in a deck in this example deck = [Ballot() for _ in range(52)] # two extra ballots were not used random.shuffle(deck) # dealt to voters (how many they get depends on how many candidates) # ballots coming in from voters all over the world!.... # each candidate on the slate gates same number of ballots cast stackA = [] for _ in range(26): secret_ballot = deck.pop() secret_ballot.vote("Shrek") stackA.append(secret_ballot) stackB = [] for _ in range(26): secret_ballot = deck.pop() secret_ballot.vote("Alice") stackB.append(secret_ballot) # the Vote! a TIE, 25 for each candidate! def break_tie(sA, sB): productA, productB = 1, 1 for idx in range(len(sA)): productA = productA * sA[idx].dna productB = productB * sB[idx].dna if productA == productB: print("The impossible happened") raise Exception if productA > productB: print("Shrek wins!") else: print("Alice wins!") break_tie(stackA, stackB) print("The crowd roars") -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Jun 10 02:22:53 2015 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 9 Jun 2015 17:22:53 -0700 Subject: [Edu-sig] Congratulations to Mark Hammond Message-ID: 10 June 2015 at 03:39, Brian Curtin: > It is my pleasure to announce that Mark Hammond has been chosen to > receive our Distinguished Service Award for his hugely impactful > contributions to Python on Windows. Through his contributions to > CPython and via pywin32, Windows would not be the platform it is > without a lot of his efforts. That was a common enough thought that > several releases in the 2.x series of Windows installers included a > special thanks to him. Congratulations! I've benefited a lot from Mark's work myself. Just having Python go so deeply in Windows helped make it the household name it is today. Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Jun 10 03:37:11 2015 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 9 Jun 2015 18:37:11 -0700 Subject: [Edu-sig] fun with voting (by secret ballot) In-Reply-To: References: Message-ID: On Tue, Jun 9, 2015 at 4:18 PM, kirby urner wrote: > """ > The code below derives from a thread on elections-wg at python.org > where we were talking about tie-breaking techniques. There's a > well known way that's actually used, but I was inspired to think > about a game wherein the ballots are like playing cards in some > ways, each encoded with a unique prime. > > I've got some notes in the moderator queue at math-teach (lots > of traffic), for which I'll share the URL. More in this month's > elections-wg archive, public-facing. > > Yes, here's that thread on math-teach I mentioned, one of my haunts: http://mathforum.org/kb/thread.jspa?threadID=2713500 Also, apologies for the comments sometimes make it sound like I was not using the full 52 cards. I talk about 25-25 instead of 26-26. Those comments were from a previous version, which also multiplies modulus something. Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Wed Jun 10 15:23:57 2015 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Wed, 10 Jun 2015 14:23:57 +0100 Subject: [Edu-sig] ATTENTION! Education track now open! Message-ID: <55783A6D.5050109@ntoll.org> Hi Folks, A quick heads up: today we're announcing the fourth annual PyCon UK education track today. Details can be found here: http://www.pyconuk.org/education/ Register here: http://www.pyconuk.org/register/ Are you a teacher? Do you know any teachers..? Teacher's continuing professional development day is on Friday 18th September. Thanks to the generous sponsorship of Bank of America (again) it only costs ?50 for a teacher's conference ticket (not including conference meal). Can't get time off school? Not a problem - we (literally) have you covered: we have ?200 bursaries for schools who send teachers so they can recover the cost of a supply teacher. We'll provide details for how to obtain the bursary when you attend the conference. Who's taking part? The Raspberry Pi Foundation education team, Jam Packed, teaching colleagues and professional Python programmers will all be contributing workshops. You'll also get a chance to mix and collaborate with the wider conference attended by the UK's most talented Python developers. The kids' day will be on Saturday 19th September. We aim to run various workshops aimed at young beginner Pythonistas throughout the day. These will include web design, robotics, Minecraft and physical computing. Our aim is to turn excited kids into exhausted but inspired proto-programmers. The cost is only ?5 per child and parents/guardians get in for free. Lunch will be provided. You only need to bring an open mind and a sense of adventure! Spread the word, tell your friends and book tickets here: http://www.pyconuk.org/register/ I'm always happy to answer any questions you may have! Best wishes, Nicholas. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From kirby.urner at gmail.com Sat Jun 13 18:55:00 2015 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 13 Jun 2015 09:55:00 -0700 Subject: [Edu-sig] Python5 @ OST / HK (science fiction) In-Reply-To: References: Message-ID: On Mon, Jun 8, 2015 at 9:43 AM, Kirby Urner wrote: > > I've actually written some code for Python5 and > it's a work in progress. Tractors instead of Turtles > but as a way of introducing Turtles i.e. I'm not > "anti-Turtle" in using a Tractor instead. A subclass > of Tractor, CropCircleTractor, outputs the Mandelbrot > Set. ASCII art output in version one, swapping in > better graphics (deeper bit-wells) as the course > progresses. > > Here's some public-facing storyboarding showing these concepts taking shape. Of course there's conversation to go with (memos 'n stuff). Steve Holden wrote Python1-4 and Python5 continues in his footsteps, picking up on already-introduced topics (e.g. arrays, complex numbers): https://www.flickr.com/photos/kirbyurner/sets/72157654417641521 Storyboarding is an approach I take to curriculum writing, inspired by the film industry and comic books. For example, one of my four Digital Math topic hoppers is Martian Math [1], which I've test piloted around Portland, Oregon over the years. Here's some storyboarding around Martian Math which, in my treatment, overlaps Python, as you will see in the linked Table of Contents (Reed College experiment).... https://www.flickr.com/photos/kirbyurner/sets/72157624750749042 http://www.4dsolutions.net/satacad/martianmath/toc.html Another test pilot project, me as mentor, University of Portland: https://www.flickr.com/photos/kirbyurner/sets/72157630917499226 I expect to get to 3D graphics in Python5 thanks to import visual. Kirby [1] http://wikieducator.org/Digital_Math -------------- next part -------------- An HTML attachment was scrubbed... URL: From kurner at oreillyschool.com Fri Jun 19 19:12:27 2015 From: kurner at oreillyschool.com (Kirby Urner) Date: Fri, 19 Jun 2015 10:12:27 -0700 Subject: [Edu-sig] a Mandelbrot Set in a few lines of Python Message-ID: I'm pleased how little code is required to make a decent Mandelbrot Set image using Numpy + PIL, neither of which am I expert at using. This is how one learns. :-D Here's how it looks on my screen: https://flic.kr/p/uR81qU For more about using fractals in teaching: Fractals, Graphics, and Mathematics Education, edited by Michael Frame and Benoit B. Mandelbrot (c) 2002, Mathematical Association of America ISBN: 0-88385-169-5 ==== ''' Produces a decently high rez b/w graphic of Mandelbrot Set in under a minute using default parameters. Not super fast, but conceptually useful both for the mathematics and for the demo of numpy + PIL in an I-Python Notebook. (cl) Kirby Urner, MIT License, 2015 Pilot study for O'Reilly School of Technology Using I-Python Notebook + pillow (PIL fork) + in Anaconda distro ''' from PIL import Image import numpy as np def setup(pixels=(3200,2400), offset=(-2.5, 1.2), inc=1/1000): ''' Create patch of complex plane c for z = z**2 + c itereactions pixels(columns, rows), offset(left, top), inc = step ''' x, y = pixels offx, offy = offset field = np.zeros((x, y)).astype(np.complex) for j in range(y): for i in range(x): field[i][j] = complex( offx + inc * i, offy - inc * j) return field def mandelbrot_set(c): ''' Apply Mandelbrot transform (orbit of 0) to c ''' z = np.zeros(c.shape).astype(np.complex) # starts 0s for idx in range(100): z = z * z + c idx = abs(z) >= 2 # continue weeding out z[idx] = 3+0j # stamp out-of-bounds with 3 newf = (abs(z) < 2).astype(np.ubyte) # keep those in set newf = newf * 255 # turn them white im = Image.fromarray(newf) im = im.rotate(90) return im m = setup() image = mandelbrot_set(m) # may take 30 seconds or more! image.save('mandelbrot.png', "png") image.show() -------------- next part -------------- An HTML attachment was scrubbed... URL: From macquigg at ece.arizona.edu Sat Jun 20 03:15:44 2015 From: macquigg at ece.arizona.edu (David MacQuigg) Date: Fri, 19 Jun 2015 18:15:44 -0700 Subject: [Edu-sig] a Mandelbrot Set in a few lines of Python In-Reply-To: References: Message-ID: Hi Kirby, Nice work. I've used Mandelbrots to introduce Python to engineering students at U of A. engr.arizona.edu/~edatools/ece175/Lecture/ The images are breathtaking in their beauty. engr.arizona.edu/~edatools/ece175/Lecture/Mandel00.html engr.arizona.edu/~edatools/ece175/Lecture/Mandel_zoom_14.jpg If I do this lecture again, I'll try a variation like yours with PIL to generate the images. I never could get pygame working right. In principle, gaming routines should provide fast rendering of complex images, flashing to the screen as fast as I can generate them in C, but the overhead of my function calls seems to be ruining the potential for creating a Mandelbrot movie. David MacQuigg, Business Manager Benson Animal Hospital purl.net/macquigg -------------- next part -------------- An HTML attachment was scrubbed... URL: From kurner at oreillyschool.com Wed Jun 24 00:53:05 2015 From: kurner at oreillyschool.com (Kirby Urner) Date: Tue, 23 Jun 2015 15:53:05 -0700 Subject: [Edu-sig] a Mandelbrot Set in a few lines of Python In-Reply-To: References: Message-ID: On Fri, Jun 19, 2015 at 6:15 PM, David MacQuigg wrote: > Hi Kirby, > > Nice work. I've used Mandelbrots to introduce Python to engineering > students at U of A. > engr.arizona.edu/~edatools/ece175/Lecture/ > The images are breathtaking in their beauty. > engr.arizona.edu/~edatools/ece175/Lecture/Mandel00.html > engr.arizona.edu/~edatools/ece175/Lecture/Mandel_zoom_14.jpg > > If I do this lecture again, I'll try a variation like yours with PIL to > generate the images. I never could get pygame working right. In > principle, gaming routines should provide fast rendering of complex images, > flashing to the screen as fast as I can generate them in C, but the > overhead of my function calls seems to be ruining the potential for > creating a Mandelbrot movie. > > David MacQuigg, Business Manager > Benson Animal Hospital > purl.net/macquigg > > Nice and colorful, which mine was not. As one runs z = z * z + c over and over, more and more of the points "peel away" i.e. spiral into divergence and thereby leave the set. It's like sandblasting: the more you cycle, the more flecks blast away -- but then how long did they linger? That's where the coloring comes in, and I didn't use any (this time). Before it scrolls out of scope I should link to a thread on math-teach where I do some followup and contextualizing: http://mathforum.org/kb/thread.jspa?threadID=2716437 (re Mandelbrot as a core curriculum topic) Where I went with that thread was in favor of "Gnu Math" at the high school level, by which I mean breaking out of the TI mold in which many still find themselves. Do like they do in South Africa with the TuxLabs: let math collide with bash. Mix it up more with free software. Coding is still mostly on the other side of a firewall in math class, STEM notwithstanding, in many a public or private high school. However, that sorry state of affairs has been changing, slowly but surely. We started out in Oregon by re-purposing an old Discrete Math, making that more computational while still eligible for maths credit (three needed for a HS diploma in Oregon, similar in other states). I've more recently been consolidating some of these advances, in my own postings, using a different heuristic: Delta versus Lambda Calculus (fine to use the Greek letters). Delta Calc: our familiar pre-calc / calc (differential / integral calc), the staple of high school Lambda Calc: meant as a doorway to a more semi-numerical skill set (e.g. SQL and regular expressions), i.e. the Gnu Math, something different and relatively new in the high school classroom. The stuff I'm lumping under lambda calc is what we might expect to find under CS (CompSci) but again, a goal is to stay on track for the three math credits and a diploma. CS has been treated as recreational / extra-curricular in that sense. By making this stuff a "calculus" and assigning a Greek letter, we make it harder to push off stage. However, I do get more specific, in the above math-teach thread, in how I think the gateway to a lambda calculus could be framed. I'm not always so hand-wavy. We start off along this trajectory, around Algebra, by introducing a lesson about: Re-purposing numeric operators, multiplication and exponentiation (e.g. * and ** in Python), to mean: "composition" of functions i.e. (f * g)(x) == f(g(x)) and (f ** 3)(x) == f(f(f(x))). I've posted about this topic on math-teach a lot already. And what does any of this have to do with the Mandelbrot Set? Given a patch of complex plane (a square of "cloth" or "skin" C), we compute M(M(M(M...M(C)...))) i.e. (M**n)(C) where M is our repeated "sand blasting" operation. That's just one edge of connection. Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: