From kirby.urner at gmail.com Sat Jul 1 18:54:39 2017 From: kirby.urner at gmail.com (kirby urner) Date: Sat, 1 Jul 2017 15:54:39 -0700 Subject: [Edu-sig] some buried history Message-ID: http://mathforum.org/kb/message.jspa?messageID=10181740 (link to math-teach) This posting to Math Forum mentions Naga the she-snake (stuffed Python) mascot representing our Python community at OSCONs for some years, also Pycons and Djangocons (though Django had its own pony). Perl may have started the mascot movement with its camel. https://flic.kr/p/a8ackQ Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From calcpage at aol.com Sun Jul 2 19:33:18 2017 From: calcpage at aol.com (A. Jorge Garcia) Date: Sun, 2 Jul 2017 19:33:18 -0400 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <15cac9c619c-7bb7-12e73@webprd-m98.mail.aol.com> Message-ID: <15d05a6b825-1c82-d62e@webprd-a16.mail.aol.com> Finally, here's my attempt at using the Python3 kernel in a Jupyter Notebook on cocatc.com! https://www.youtube.com/watch?v=fKthpFIV-TU https://cocalc.com/projects/77404da1-af58-43f6-aac9-60bc5b24bb1a/files/2017%20Pythonic%20Calculus%20Executive%20Summary!.ipynb Enjoy,? A. Jorge Garcia? Applied Math, Physics & CS? http://shadowfaxrant.blogspot.com? http://www.youtube.com/calcpage2009? 2013-2017 NYS Secondary Math http://PAEMST.org Nominee -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Sun Jul 2 22:19:16 2017 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 2 Jul 2017 19:19:16 -0700 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <15d05a6b825-1c82-d62e@webprd-a16.mail.aol.com> References: <15cac9c619c-7bb7-12e73@webprd-m98.mail.aol.com> <15d05a6b825-1c82-d62e@webprd-a16.mail.aol.com> Message-ID: > > https://www.youtube.com/watch?v=fKthpFIV-TU > > Way cool. I made some notes: I like how you muddle your way through, showing where you're getting confused. Students looking over your shoulder want to help. Not intimidating. Shows how we're meant to explore, even as teachers. You get confused that cells may be Markdown, as shown up top, vs. Code. Like a spreadsheet, you can write lots of text between code sections. The markdown punctuation is a lot like what's used in Wikis, restructured text. Cheat sheet: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet (you can embed links, pictures, even Youtubes). Example: http://nbviewer.jupyter.org/github/4dsolutions/Python5/blob/master/Pi%20Day%20Fun.ipynb Also, it's not that the cells are "isolated" but define objects top to bottom, just like a Python module, so yes, if you come in cold and start running to last cells first, NameError problems are likely. Running them all, in order, is a one click option, as you mention. Nothing wrong with doing that. Speadsheets work the same way don't they? MathCAD does: you need all the names mentioned already defined higher up. Regarding your diff function, one *could* pass a function as an argument, no problemo, no need for fancy parsing etc. i.e. functions are just callable objects e.g.: def diff( func, x, h=1e-8): return ( func(x+h)-func(x) )/h then: def g(x): return x**2 - 2 >>> diff(g, 2) # passing the function as an argument, accept h default When you imported * from numpy, you got sin from there. You sounded surprised you could do that without importing it from math. More evidence of how the * may lead to confusion. The math version of sin and cos is what you *don't* want, as you're trying to feed in an np.arange, whereas the math version just accepts scalar numbers (degrees or radians) from numpy import arange, linspace would be another way to lose the np prefix, short of using a star. Tack on sin, cos. The sin, cos in math are *not* able to handle arange or linspace objects, so getting these from numpy is what you needed all along. Might not have needed math at all. But then explain how numpy is so vary oriented towards array processing. from numpy import arange, sin # this will work t = arange(0, 2, 0.1) sin(t) array([ 0. , 0.09983342, 0.19866933, 0.29552021, 0.38941834, 0.47942554, 0.56464247, 0.64421769, 0.71735609, 0.78332691, 0.84147098, 0.89120736, 0.93203909, 0.96355819, 0.98544973, 0.99749499, 0.9995736 , 0.99166481, 0.97384763, 0.94630009]) from math import sin # uh oh, this import of sin gets in the way sin(t) Traceback (most recent call last): Python Shell, prompt 8, line 1 builtins.TypeError: only length-1 arrays can be converted to Python scalars Note that in Python3, range(a, b) creates a "range type object", not a list, which is why you don't see the output as a list until the list comprehension. list(range(a,b)) will always get you the list representation. Thanks again! Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From calcpage at aol.com Sun Jul 2 23:56:59 2017 From: calcpage at aol.com (A Jorge Garcia) Date: Sun, 02 Jul 2017 23:56:59 -0400 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: References: <15cac9c619c-7bb7-12e73@webprd-m98.mail.aol.com> <15d05a6b825-1c82-d62e@webprd-a16.mail.aol.com> Message-ID: <7f3b98db-0eee-4cbe-9a79-78a201291fe8@aol.com> Thanx, Kirby, for all your insightful comments! Well, I tried! I think I'm spoiled by using Sage all these years where everything is imported for you and it's all based on standard Python. I had no idea that numpy was so different. I thought it just built extra functionality on top of Python. BTW, I was initially attracted to Python because it reminded me so much of MATLAB. In MATLAB everything is declared as a matrix whether it be an actual rectangular 2x3 matrix or a square 2x2 matrix or a column vector 3x1 or a row vector 1x4 or even a scalar 1x1! So, my thinking was that everything in Python is based on lists and list comprehensions. Another point in Python's favor for a Pythonic math class is that said lists and list operators are great for dealing with sequences and series and hence recursive sequences like we use in Newton's method as well as series that arise in Reiman Sums. Also, I've been using SageCell for a few years now and forgot about the top down model you refer to when using multiple cells. When using Sage proper or Jupyter, I'll have to be careful about that unless I just use one huge cell! Thanx for all the constructive criticism. I have a lot of work to do! Regards, AJG ?Sent from BlueMail ? On Jul 2, 2017, 10:19 PM, at 10:19 PM, kirby urner wrote: >> >> https://www.youtube.com/watch?v=fKthpFIV-TU >> >> >Way cool. > >I made some notes: > >I like how you muddle your way through, showing where you're getting >confused. Students looking over your shoulder want to help. Not >intimidating. Shows how we're meant to explore, even as teachers. > >You get confused that cells may be Markdown, as shown up top, vs. Code. > >Like a spreadsheet, you can write lots of text between code sections. >The >markdown punctuation is a lot like what's used in Wikis, restructured >text. Cheat sheet: > >https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet > >(you can embed links, pictures, even Youtubes). > >Example: >http://nbviewer.jupyter.org/github/4dsolutions/Python5/blob/master/Pi%20Day%20Fun.ipynb > >Also, it's not that the cells are "isolated" but define objects top to >bottom, just like a Python module, so yes, if you come in cold and >start >running to last cells first, NameError problems are likely. Running >them >all, in order, is a one click option, as you mention. Nothing wrong >with >doing that. > >Speadsheets work the same way don't they? MathCAD does: you need all >the >names mentioned already defined higher up. > >Regarding your diff function, one *could* pass a function as an >argument, >no problemo, no need for fancy parsing etc. i.e. functions are just >callable objects e.g.: > >def diff( func, x, h=1e-8): > return ( func(x+h)-func(x) )/h > >then: > >def g(x): > return x**2 - 2 > >>>> diff(g, 2) # passing the function as an argument, accept h default > >When you imported * from numpy, you got sin from there. You sounded >surprised you could do that without importing it from math. > >More evidence of how the * may lead to confusion. > >The math version of sin and cos is what you *don't* want, as you're >trying >to feed in an np.arange, whereas the math version just accepts scalar >numbers (degrees or radians) > >from numpy import arange, linspace > >would be another way to lose the np prefix, short of using a star. >Tack on >sin, cos. > >The sin, cos in math are *not* able to handle arange or linspace >objects, >so getting these from numpy is what you needed all along. Might not >have >needed math at all. But then explain how numpy is so vary oriented >towards >array processing. > >from numpy import arange, sin # this will work >t = arange(0, 2, 0.1) >sin(t) >array([ 0. , 0.09983342, 0.19866933, 0.29552021, 0.38941834, > 0.47942554, 0.56464247, 0.64421769, 0.71735609, 0.78332691, > 0.84147098, 0.89120736, 0.93203909, 0.96355819, 0.98544973, > 0.99749499, 0.9995736 , 0.99166481, 0.97384763, 0.94630009]) > > >from math import sin # uh oh, this import of sin gets in the way >sin(t) > >Traceback (most recent call last): > Python Shell, prompt 8, line 1 >builtins.TypeError: only length-1 arrays can be converted to Python >scalars > >Note that in Python3, range(a, b) creates a "range type object", not a >list, which is why you don't see the output as a list until the list >comprehension. > >list(range(a,b)) will always get you the list representation. > >Thanks again! > >Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Mon Jul 3 01:20:58 2017 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 2 Jul 2017 22:20:58 -0700 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <7f3b98db-0eee-4cbe-9a79-78a201291fe8@aol.com> References: <15cac9c619c-7bb7-12e73@webprd-m98.mail.aol.com> <15d05a6b825-1c82-d62e@webprd-a16.mail.aol.com> <7f3b98db-0eee-4cbe-9a79-78a201291fe8@aol.com> Message-ID: Good evening again Jorge -- I wouldn't see these newer pure Python skills supplanting so much as supplementing your Sage skills. You're widening your base of operations. You'll be able to reach out to a different demographic: students already comfortable in Python3 but wanting to review Calculus (for example). If your code stays close to their day job tool set, so much the better. Python is compared with MATLAB a whole lot, as you know. The economics is similar to what brought us Linux and open source in general: students get hooked on expensive power tools while in university, and then suffer cold turkey when they graduate, leading to a vicious circle of getting out of shape, losing access to all those workouts. You're a musician deprived of your instrument! A fish out of water! You're Richard Stallman without the passwords to the systems you yourself wrote. Pycon 2017 featured science luminaries explaining why the rush into Jupyter Notebooks: the intelligent layperson / hobbyist / amateur / enthusiast has a way to play, to co-explore. Also: here's a way to really share the number crunching behind those published papers, for those who really care about the nitty gritty. Read the journal article, download the notebook that goes with. Yes, numpy is grounded in those APL, J and R-like languages that take any-dimensional arrays as their bread and butter, you're certainly right about that. The J language (APL's inventor Iverson one of its designers) is especially like that: a pipeline of transformations, as the arrays travel right to left. (jsoftware.com) You're right to love this way of thinking. So many for loops go away when numpy gets its freedoms. What I keep wondering about, in addition to the wonderful stuff you're doing, is integrating SymPy, with its ability to do indefinite integrals and the like, full fledged computer algebra. What Amit shows off to good effect. https://github.com/aktech Maybe Sage is better at that too. Pure Python starting from scratch is pretty low level, even with Numpy here to help. But you take it a long way just in your one hour of code. Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From taz.daughtrey at gmail.com Sun Jul 2 13:30:23 2017 From: taz.daughtrey at gmail.com (Taz Daughtrey) Date: Sun, 2 Jul 2017 13:30:23 -0400 Subject: [Edu-sig] Edu-sig Digest, Vol 168, Issue 1 In-Reply-To: References: Message-ID: I remain puzzled why Monty Python, the actual inspiration of the language's name, isn't more commonly recognized. - Taz > On Jul 2, 2017, at 12:00 PM, edu-sig-request at python.org wrote: > > Send Edu-sig mailing list submissions to > edu-sig at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/edu-sig > or, via email, send a message with subject or body 'help' to > edu-sig-request at python.org > > You can reach the person managing the list at > edu-sig-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Edu-sig digest..." > > > Today's Topics: > > 1. some buried history (kirby urner) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 1 Jul 2017 15:54:39 -0700 > From: kirby urner > To: "edu-sig at python.org" > Subject: [Edu-sig] some buried history > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > http://mathforum.org/kb/message.jspa?messageID=10181740 > (link to math-teach) > > This posting to Math Forum mentions > Naga the she-snake (stuffed Python) > mascot representing our Python community > at OSCONs for some years, also Pycons > and Djangocons (though Django had its > own pony). > > Perl may have started the mascot movement > with its camel. > > https://flic.kr/p/a8ackQ > > Kirby > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > https://mail.python.org/mailman/listinfo/edu-sig > > > ------------------------------ > > End of Edu-sig Digest, Vol 168, Issue 1 > *************************************** From calcpage at aol.com Sun Jul 9 18:52:30 2017 From: calcpage at aol.com (A. Jorge Garcia) Date: Sun, 9 Jul 2017 18:52:30 -0400 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <7f3b98db-0eee-4cbe-9a79-78a201291fe8@aol.com> Message-ID: <15d298de04e-61ab-1c333@webprd-a35.mail.aol.com> OK, here's another stab at it! https://cocalc.com/app#projects/77404da1-af58-43f6-aac9-60bc5b24bb1a/files/2017%20Pythonic%20Calculus%20Executive%20Summary%20(Take%202)!.ipynb https://www.youtube.com/watch?v=vCjyotXsXgY In this version I tried to reorganize the screencast a bit so it would be a little shorter. Thanx to Kirby for his suggestions which I included here a bit. Sincerely,? A. Jorge Garcia? Applied?Math, Physics & CS? http://shadowfaxrant.blogspot.com? http://www.youtube.com/calcpage2009? 2013-2017 NYS Secondary Math http://PAEMST.org Nominee -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Mon Jul 10 17:08:48 2017 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 10 Jul 2017 14:08:48 -0700 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <15d298de04e-61ab-1c333@webprd-a35.mail.aol.com> References: <7f3b98db-0eee-4cbe-9a79-78a201291fe8@aol.com> <15d298de04e-61ab-1c333@webprd-a35.mail.aol.com> Message-ID: Thanks for the shout-out to me in the middle Jorge! Also, thanks for keeping Take 1, as I think it helps other teachers to watch you work out, and share snapshots as you improve. I keep old relics around for the same reason sometimes, to show the deltas (changes) -- "the deltas" sounds like muscles in this "workout" context, like "abs". I've linked to Take 2 from Math Forum 206, as an exhibit of what a master teacher does to stay in shape. Said link might not show up quite yet (posted minutes ago, moderated forum), but it's supposed to reply to this one in the archives: http://mathforum.org/kb/message.jspa?messageID=10187668 Of course after boasting about working out (with the greatest) I then drop a juggling ball and forget the actual link. Par for the course. :-D Kirby On Sun, Jul 9, 2017 at 3:52 PM, A. Jorge Garcia wrote: > OK, here's another stab at it! > https://cocalc.com/app#projects/77404da1-af58-43f6-aac9- > 60bc5b24bb1a/files/2017%20Pythonic%20Calculus%20Executive% > 20Summary%20(Take%202)!.ipynb > > https://www.youtube.com/watch?v=vCjyotXsXgY > In this version I tried to reorganize the screencast a bit so it would be > a little shorter. > Thanx to Kirby for his suggestions which I included here a bit. > > Sincerely, > A. Jorge Garcia > Applied Math, Physics & CS > http://shadowfaxrant.blogspot.com > http://www.youtube.com/calcpage2009 > 2013-2017 NYS Secondary Math http://PAEMST.org Nominee > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From calcpage at aol.com Tue Jul 11 12:33:27 2017 From: calcpage at aol.com (A. Jorge Garcia) Date: Tue, 11 Jul 2017 12:33:27 -0400 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: Message-ID: <15d327f91df-39fd-1a7db@webprd-m64.mail.aol.com> Thanx, Kirby, for all your help! ? I always learn something new from your posts and suggestions! So, I had to mention you in the "Take 2" ScreenCast audio as well as in the description/caption below the Screencast on my YouTube.\ channel:?https://www.youtube.com/user/calcpage2009 It's very seldom that I rerecord a ScreenCast, or even edit one. But I had to make this one a bit shorter. I did leave the first take for comparison. However, I replaced the video in the following playlist where I compare and contrast Graphing Calculators vs Coding in Math class solving Graphing Calculator active FRQs from the AP Calculus Exam 2016 and 2017:?https://www.youtube.com/playlist?list=PLL956Pn2cKSje0HeHkR38C8BVWbTeOFUy You've commented in the past that you like my "Live" ScreenCasts, and I enjoy these the most too. However, in the interest of saving student's time viewing the ScreenCast, I've been recording more "Shorts" these days which are shorter summaries after the topic has been covered in class. Regards, Al Sincerely,? A. Jorge Garcia? Applied Math, Physics & CS? http://shadowfaxrant.blogspot.com? http://www.youtube.com/calcpage2009? 2013-2017 NYS Secondary Math http://PAEMST.org Nominee -------------- next part -------------- An HTML attachment was scrubbed... URL: From calcpage at aol.com Mon Jul 17 18:01:37 2017 From: calcpage at aol.com (A. Jorge Garcia) Date: Mon, 17 Jul 2017 18:01:37 -0400 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <15d327f91df-39fd-1a7db@webprd-m64.mail.aol.com> Message-ID: <15d52922c83-14be-d2e3@webprd-m66.mail.aol.com> FYI, here's a whole playlist comparing and contrasting Graphing Calculators to SAGE and Python! Sincerely,? A. Jorge Garcia? Applied Math, Physics & CS? http://shadowfaxrant.blogspot.com? http://www.youtube.com/calcpage2009? 2013-2017 NYS Secondary Math http://PAEMST.org Nominee -------------- next part -------------- An HTML attachment was scrubbed... URL: From calcpage at aol.com Mon Jul 17 18:03:48 2017 From: calcpage at aol.com (A. Jorge Garcia) Date: Mon, 17 Jul 2017 18:03:48 -0400 Subject: [Edu-sig] Help with Jupyter Notebook, please? In-Reply-To: <15d52922c83-14be-d2e3@webprd-m66.mail.aol.com> Message-ID: <15d52942cf9-14be-d302@webprd-m66.mail.aol.com> (SORRY, FORGOT THE LINK) FYI, here's a whole playlist comparing and contrasting Graphing Calculators to SAGE and Python! https://www.youtube.com/playlist?list=PLL956Pn2cKSje0HeHkR38C8BVWbTeOFUy Sincerely,? A. Jorge Garcia? Applied Math, Physics & CS? http://shadowfaxrant.blogspot.com?; http://www.youtube.com/calcpage2009?; 2013-2017 NYS Secondary Math http://PAEMST.org Nominee -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Tue Jul 25 00:45:02 2017 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 24 Jul 2017 21:45:02 -0700 Subject: [Edu-sig] teaching Python etc. Message-ID: I turned down a $600/day 3 day gig I might not have got anyway, because the textbook goes twelve chapters with no 'class' keyword, and that would define the full complement of our topics. My code of conduct forbids teaching Python that way. The whole point of OOP was here's a way we think in natural language: about Things with properties and behaviors. Maybe some people don't like to be "objectified" and it's true, that can mean something bad, but in the context of the Django ORM, it means an integrated object has the records. The patient, the athlete, the student object, comes with a medical history. Lots of SQL behind the scenes. Rollicking good debate over on math-teach as we exult over the huge numbers turning out to take AP CS.[1] The Learn to Code movement is succeeding, has gained traction. The Coding with Kids that I work for has likewise spread to several more cities, and any successful business model attracts imitators (CwK has a great website for faculty, lets us track everything, including our hours). Is code school the new high school? https://medium.com/@kirbyurner/the-plight-of-high-school-math-teachers-c0faf0a6efe6 (an essay coming up on its first anniversary) The $600/day gig was teaching adults (andragogy vs pedagogy), over the wire, which is how I've been making ends meet. Unfortunately for me, a truck pulled up across the street and started moving wires from pole A (the old one) to pole B (the new one) and wouldn't ya know, my Internet, which goes right through there, cut out. The crew said "not us" (what are the chances?) and took off. CenturyLink is coming tomorrow, but will they have a long enough ladder? I've gotta do my wind-up session 10 of 10 for the Californians. Patrick offered me his office (Comcast). I'm tethered to Internet through my cell phone as I write this (not enough bandwidth for live screen and audio though). We introduce Python classes early because that's the promise of OOP. To sucker for that "ontogeny recapitulates phylogeny" thesis, that we need to slog through a whole semester of procedural programming, before we make a single instance of something, is impossible in practice, at least in Python, as just about everything one touches is an instance of something. This textbook seems to hearken from that era (fortunately receding in the rear view mirror). You'd think in Java at least it'd be classes right out of the gate as one can't but extend a class to get anything done. Python's the same way of course; I think of functions as another type, canned (built-in), with their own syntax, but an instance of the FunctionType nonetheless. Out here in Code School world, the pressure is on to teach Python in two main ways: as a web development language, using projects like Flask and Django, and as a Data Science tool, using pandas, numpy, Jupyter Notebooks and mathplotlib -- but then when it comes to visualization tools, there's a plethora of 2D options. Great talk on this at Pycon2017. I've always been more a 3D guy myself, writing to POV-Ray and later Visual Python. I had a good experience getting vpython over anaconda and embedding same in a Notebook, but that was a while ago. No one pays me for 3D stuff. Maybe we should learn to do stats that way, using more 3D models than we do. Fly through. Not just physics should have all the fun. As it is it seems precious few physics teachers take the "coding a physics engine" approach. Maybe Carnegie Mellon? I'm far from omniscient. Hey, TinkerCAD is loads of fun for simulating an Arduino, a great sandbox if you don't have all the components. I've made some screencasts showing that. [2] The Learn to Code movement is having a big impact, to summarize. Kirby [1] http://mathforum.org/kb/thread.jspa?threadID=2870615 [2] https://youtu.be/AB7fzNK6vjs -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Tue Jul 25 12:03:03 2017 From: wes.turner at gmail.com (Wes Turner) Date: Tue, 25 Jul 2017 11:03:03 -0500 Subject: [Edu-sig] teaching Python etc. In-Reply-To: References: Message-ID: On Monday, July 24, 2017, kirby urner wrote: > > I turned down a $600/day 3 day gig I might not have got anyway, because > the textbook goes twelve chapters with no 'class' keyword, and that would > define the full complement of our topics. My code of conduct forbids > teaching Python that way. > +1. - "Namespaces are one honking great idea -- let's do more of those!" - Classes are dicts with MRO. https://en.wikipedia.org/wiki/C3_linearization#Example_demonstrated_in_Python > The whole point of OOP was here's a way we think in natural language: > about Things with properties and behaviors. > Maybe 'classes and instance of classes'. class Book(object): pass; book_instance = Book() > Maybe some people don't like to be "objectified" and it's true, that can > mean something bad, but in the context of the Django ORM, it means an > integrated object has the records. > ActiveRecord and DataMapper are both popular ORM patterns. From https://wrdrd.github.io/docs/consulting/knowledge-engineering#object-relational-mapping : Object Relational Mapping? Wikipedia: https://en.wikipedia.org/wiki/Object-relational_mapping - https://en.wikipedia.org/wiki/Data_mapper_pattern - https://en.wikipedia.org/wiki/Active_record_pattern https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch - https://en.wikipedia.org/wiki/List_of_object-relational_mapping_software > The patient, the athlete, the student object, comes with a medical > history. Lots of SQL behind the scenes. > Medical history as a schema / informatics example and Python: - GNUhealth - (an actual application (with an install procedure and/or just Docker) with example/test data) - https://en.wikibooks.org/wiki/GNU_Health/Different_ways_to_test_GNU_Health#Option_4:_Run_GNU_Health_from_Docker_.28Lightweight_Containers.29 - https://hub.docker.com/r/mbsolutions/postgres-gnuhealth/~/dockerfile/ - https://en.wikibooks.org/wiki/GNU_Health/The_Demo_database - https://hg.savannah.gnu.org/hgweb/health/file/tip/tryton/backend/fhir/server/fhir/patient.py - lots of XML (which can be digitally signed) - lots of boilerplate - (this is in the the server API) Normalization to records (rows) with fields (columns) and keys (identity) AND/OR Denormalization to composed, often nested, signable records (See: JSONLD, ld-signatures, blockcerts) > Rollicking good debate over on math-teach as we exult over the huge > numbers turning out to take AP CS.[1] The Learn to Code movement is > succeeding, has gained traction. The Coding with Kids that I work for has > likewise spread to several more cities, and any successful business model > attracts imitators (CwK has a great website for faculty, lets us track > everything, including our hours). Is code school the new high school? > > https://medium.com/@kirbyurner/the-plight-of-high-school- > math-teachers-c0faf0a6efe6 > (an essay coming up on its first anniversary) > > The $600/day gig was teaching adults (andragogy vs pedagogy), over the > wire, which is how I've been making ends meet. > > Unfortunately for me, a truck pulled up across the street and started > moving wires from pole A (the old one) to pole B (the new one) and wouldn't > ya know, my Internet, which goes right through there, cut out. > > The crew said "not us" (what are the chances?) and took off. CenturyLink > is coming tomorrow, but will they have a long enough ladder? I've gotta do > my wind-up session 10 of 10 for the Californians. Patrick offered me his > office (Comcast). I'm tethered to Internet through my cell phone as I write > this (not enough bandwidth for live screen and audio though). > > We introduce Python classes early because that's the promise of OOP. > We could start with import unittest class Shape(): class Square(): class Rectangle(): class Triangle(): # def area(*args, **kwargs): # def circumference(*args, **kwargs): ... https://westurner.github.io/2016/10/17/teaching-test-driven-development-first.html > To sucker for that "ontogeny recapitulates phylogeny" thesis, that we need > to slog through a whole semester of procedural programming, before we make > a single instance of something, is impossible in practice, at least in > Python, as just about everything one touches is an instance of something. > This textbook seems to hearken from that era (fortunately receding in the > rear view mirror). > > You'd think in Java at least it'd be classes right out of the gate as one > can't but extend a class to get anything done. > > Python's the same way of course; I think of functions as another type, > canned (built-in), with their own syntax, but an instance of the > FunctionType nonetheless. > FunctionType type annotation: https://github.com/python/typeshed/blob/1e04a8c1b8b2c7a1fc3d9fcfbc2d3d8ba2dc933a/stdlib/3/types.pyi#L25 > > Out here in Code School world, the pressure is on to teach Python in two > main ways: as a web development language, using projects like Flask and > Django, and as a Data Science tool, using pandas, numpy, Jupyter Notebooks > and mathplotlib -- but then when it comes to visualization tools, there's a > plethora of 2D options. Great talk on this at Pycon2017. > Mayavi (VTK), Blender > I've always been more a 3D guy myself, writing to POV-Ray and later Visual > Python. I had a good experience getting vpython over anaconda and > embedding same in a Notebook, but that was a while ago. No one pays me for > 3D stuff. > http://holoviews.org/ (Bokeh, Matplotlib, Plotly) > > Maybe we should learn to do stats that way, using more 3D models than we > do. Fly through. > We manage to understand so much about data through 2D (+time) visualizations that don't have 3D camera and viewport parameters to just reset to the best view. That said, these 3Blue1Brown professionally animated math videos are outstanding (and sponsored!): https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw > > Not just physics should have all the fun. As it is it seems precious few > physics teachers take the "coding a physics engine" approach. Maybe > Carnegie Mellon? I'm far from omniscient. > https://en.wikipedia.org/wiki/General_relativity#Relationship_with_quantum_theory - /search computational physics and python - /search physics simulation and python - http://vpython.org/ - https://docs.blender.org/manual/en/dev/physics/ - Are there other good tools in {Python,} for evaluating complex systems at a point in time? (I think we've had a similar discussion in the past.) > Hey, TinkerCAD is loads of fun for simulating an Arduino, a great sandbox > if you don't have all the components. I've made some screencasts showing > that. [2] > Recently, I learned about LeoCAD (because LEGOs and a bricklayer.org presentation): https://github.com/westurner/wiki/wiki/bricklayer#bricklayer-jupyter-extension > > The Learn to Code movement is having a big impact, to summarize. > "Nine Policy Ideas to Make Computer Science Fundamental to K-12 Education" https://code.org/files/Making_CS_Fundamental.pdf > > Kirby > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Tue Jul 25 12:11:25 2017 From: wes.turner at gmail.com (Wes Turner) Date: Tue, 25 Jul 2017 11:11:25 -0500 Subject: [Edu-sig] teaching Python etc. In-Reply-To: References: Message-ID: On Tue, Jul 25, 2017 at 11:03 AM, Wes Turner wrote: > > > On Monday, July 24, 2017, kirby urner wrote: > >> >> I turned down a $600/day 3 day gig I might not have got anyway, because >> the textbook goes twelve chapters with no 'class' keyword, and that would >> define the full complement of our topics. My code of conduct forbids >> teaching Python that way. >> > > +1. > - "Namespaces are one honking great idea -- let's do more of those!" > - Classes are dicts with MRO. https://en.wikipedia.org/ > wiki/C3_linearization#Example_demonstrated_in_Python > > >> The whole point of OOP was here's a way we think in natural language: >> about Things with properties and behaviors. >> > > Maybe 'classes and instance of classes'. class Book(object): pass; > book_instance = Book() > > >> Maybe some people don't like to be "objectified" and it's true, that >> can mean something bad, but in the context of the Django ORM, it means an >> integrated object has the records. >> > > ActiveRecord and DataMapper are both popular ORM patterns. > > From https://wrdrd.github.io/docs/consulting/knowledge- > engineering#object-relational-mapping : > > Object Relational Mapping? > Wikipedia: https://en.wikipedia.org/wiki/Object-relational_mapping > - https://en.wikipedia.org/wiki/Data_mapper_pattern > - https://en.wikipedia.org/wiki/Active_record_pattern > > https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch > - https://en.wikipedia.org/wiki/List_of_object-relational_mapping_software > > > >> The patient, the athlete, the student object, comes with a medical >> history. Lots of SQL behind the scenes. >> > > Medical history as a schema / informatics example and Python: > - GNUhealth > - (an actual application (with an install procedure and/or just Docker) > with example/test data) - https://en.wikibooks.org/ > wiki/GNU_Health/Different_ways_to_test_GNU_Health# > Option_4:_Run_GNU_Health_from_Docker_.28Lightweight_Containers.29 > - https://hub.docker.com/r/mbsolutions/postgres-gnuhealth/~/dockerfile/ > > - https://en.wikibooks.org/wiki/GNU_Health/The_Demo_database > - https://hg.savannah.gnu.org/hgweb/health/file/tip/tryton/ > backend/fhir/server/fhir/patient.py > - lots of XML (which can be digitally signed) > - lots of boilerplate > - (this is in the the server API) > > Normalization to records (rows) with fields (columns) and keys (identity) > AND/OR > Denormalization to composed, often nested, signable records (See: JSONLD, > ld-signatures, blockcerts) > > >> Rollicking good debate over on math-teach as we exult over the huge >> numbers turning out to take AP CS.[1] The Learn to Code movement is >> succeeding, has gained traction. The Coding with Kids that I work for has >> likewise spread to several more cities, and any successful business model >> attracts imitators (CwK has a great website for faculty, lets us track >> everything, including our hours). Is code school the new high school? >> >> https://medium.com/@kirbyurner/the-plight-of-high-school-mat >> h-teachers-c0faf0a6efe6 >> (an essay coming up on its first anniversary) >> >> The $600/day gig was teaching adults (andragogy vs pedagogy), over the >> wire, which is how I've been making ends meet. >> >> Unfortunately for me, a truck pulled up across the street and started >> moving wires from pole A (the old one) to pole B (the new one) and wouldn't >> ya know, my Internet, which goes right through there, cut out. >> >> The crew said "not us" (what are the chances?) and took off. CenturyLink >> is coming tomorrow, but will they have a long enough ladder? I've gotta do >> my wind-up session 10 of 10 for the Californians. Patrick offered me his >> office (Comcast). I'm tethered to Internet through my cell phone as I write >> this (not enough bandwidth for live screen and audio though). >> > >> We introduce Python classes early because that's the promise of OOP. >> > > We could start with > > import unittest > class Shape(): > class Square(): > class Rectangle(): > class Triangle(): > # def area(*args, **kwargs): > # def circumference(*args, **kwargs): > > ... https://westurner.github.io/2016/10/17/teaching-test- > driven-development-first.html > > >> To sucker for that "ontogeny recapitulates phylogeny" thesis, that we >> need to slog through a whole semester of procedural programming, before we >> make a single instance of something, is impossible in practice, at least in >> Python, as just about everything one touches is an instance of something. >> This textbook seems to hearken from that era (fortunately receding in the >> rear view mirror). >> >> You'd think in Java at least it'd be classes right out of the gate as one >> can't but extend a class to get anything done. >> >> Python's the same way of course; I think of functions as another type, >> canned (built-in), with their own syntax, but an instance of the >> FunctionType nonetheless. >> > > FunctionType type annotation: > https://github.com/python/typeshed/blob/1e04a8c1b8b2c7a1fc3d9fcfbc2d3d > 8ba2dc933a/stdlib/3/types.pyi#L25 > > >> >> Out here in Code School world, the pressure is on to teach Python in two >> main ways: as a web development language, using projects like Flask and >> Django, and as a Data Science tool, using pandas, numpy, Jupyter Notebooks >> and mathplotlib -- but then when it comes to visualization tools, there's a >> plethora of 2D options. Great talk on this at Pycon2017. >> > > Mayavi (VTK), Blender > > >> I've always been more a 3D guy myself, writing to POV-Ray and later >> Visual Python. I had a good experience getting vpython over anaconda and >> embedding same in a Notebook, but that was a while ago. No one pays me for >> 3D stuff. >> > > http://holoviews.org/ (Bokeh, Matplotlib, Plotly) > > >> >> Maybe we should learn to do stats that way, using more 3D models than we >> do. Fly through. >> > > We manage to understand so much about data through 2D (+time) > visualizations that don't have 3D camera and viewport parameters to just > reset to the best view. > > That said, these 3Blue1Brown professionally animated math videos are > outstanding (and sponsored!): > https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw > > >> >> Not just physics should have all the fun. As it is it seems precious few >> physics teachers take the "coding a physics engine" approach. Maybe >> Carnegie Mellon? I'm far from omniscient. >> > > https://en.wikipedia.org/wiki/General_relativity# > Relationship_with_quantum_theory > > - /search computational physics and python > - /search physics simulation and python > > - http://vpython.org/ > - https://docs.blender.org/manual/en/dev/physics/ > > - Are there other good tools in {Python,} for evaluating complex systems > at a point in time? (I think we've had a similar discussion in the past.) > A moving object with a headlight is traveling at velocity v. Is it v+c, or just c? #DefiningTheProblem #LIGO > > >> Hey, TinkerCAD is loads of fun for simulating an Arduino, a great sandbox >> if you don't have all the components. I've made some screencasts showing >> that. [2] >> > > Recently, I learned about LeoCAD (because LEGOs and a bricklayer.org > presentation): > https://github.com/westurner/wiki/wiki/bricklayer# > bricklayer-jupyter-extension > > >> >> The Learn to Code movement is having a big impact, to summarize. >> > > "Nine Policy Ideas to Make Computer Science Fundamental to K-12 Education" > https://code.org/files/Making_CS_Fundamental.pdf > > >> >> Kirby >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: