From jurgis.pralgauskis at gmail.com Wed Aug 1 04:08:40 2018 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Wed, 1 Aug 2018 11:08:40 +0300 Subject: [Edu-sig] Python in Highschool (exams) In-Reply-To: References: Message-ID: Hi, May be you have examples of tasks and their solutions in PY? On Tue, Jul 10, 2018 at 4:05 PM Nicholas H.Tollervey wrote: > Here in the UK, most examination boards suggest the use of Python for > text based programming exercises at GCSE (16yo) and A-level (18yo) exams. > > N. > > On 10/07/18 10:24, Aidis Stukas wrote: > > Are there any countries that teach Python in high school. > > > > Also, is it allowed to use Python in programming/informatics exam, if > > your country has one? > > -- > > Aidis Stukas > > > > > > > > _______________________________________________ > > Edu-sig mailing list > > Edu-sig at python.org > > https://mail.python.org/mailman/listinfo/edu-sig > > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > https://mail.python.org/mailman/listinfo/edu-sig > -- Jurgis Pralgauskis tel: 8-616 77613; Don't worry, be happy and make things better ;) http://galvosukykla.lt -------------- next part -------------- An HTML attachment was scrubbed... URL: From jurgis.pralgauskis at gmail.com Wed Aug 1 05:24:32 2018 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Wed, 1 Aug 2018 12:24:32 +0300 Subject: [Edu-sig] Fil-in the gaps exercises? Message-ID: Hi, I think I saw a link to Python course with "fill in the blanks" exercises on some thread in early summer (or maybe spring), but now can't find it.. :/ Maybe someone remembers or knows similar? Thanks -- Jurgis Pralgauskis tel: 8-616 77613; Don't worry, be happy and make things better ;) http://galvosukykla.lt -------------- next part -------------- An HTML attachment was scrubbed... URL: From jurgis.pralgauskis at gmail.com Tue Aug 14 15:46:58 2018 From: jurgis.pralgauskis at gmail.com (Jurgis Pralgauskis) Date: Tue, 14 Aug 2018 22:46:58 +0300 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? Message-ID: Hi, The dillema I have when teaching: our k12 curricullum of programming is more based on algorithms (math ideas), but when working as programmer, I see the bigger need of SW architecture knowledge.. OOP is one big topic, which could replace sorting alg stuff (that I never applied (directly) in this century...). The topics could be integrated in making mini game engine :) I'd still leave classics of sum, min search, and search in sorted vs non array to get the idea of algorithms. What are your approaches, if you have programming classes in K12? -- Jurgis Pralgauskis tel: 8-616 77613 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Tue Aug 14 17:55:12 2018 From: wes.turner at gmail.com (Wes Turner) Date: Tue, 14 Aug 2018 17:55:12 -0400 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: Message-ID: You can probably do sorting, inheritance, and interfaces at the same time? An ISortable object must have a .sort() method. e.g. DoublyLinkedList(LinkedList). "15 Sorting Algorithms in 6 Minutes" https://youtu.be/kPRA0W1kECg - # of comparisons - # of array accesses ... Big-O Cheat Sheet http://bigocheatsheet.com - "Array Sorting Algorithms" - Time Complexity: Best, Average, Worst - Space Complexity: Worst I don't have K12 students. It's important to learn OOP. There really is a push back from OOP-over-abstraction to functional with interfaces by convention with e.g. Go,. As a multi-paradigm language built on C (not C++ (OOP which predates Java)), programs can be written in many styles with Python. There is - some might argue negligible - overhead to each function call. Is there a good way to do compile-time interface checking with Python? Why not? zope.interface is probably the most popular way to do 'actual' interfaces in Python. https://zopeinterface.readthedocs.io/en/latest/ Pyramid framework has zope.interface interfaces. https://github.com/Pylons/pyramid/blob/master/pyramid/interfaces.py - IResponse - IRequest (a 'marker' interface) An OOP exercise: # Namespacing def area_of_a_rectangle() def perimeter_of_a_rectangle() def shape__rectangle__area() def shape__square__area() # Inheritance, Interfaces, Parameters class Shape() def __init__(*args, **kwargs): # * def area() def perimeter() def height/width/[depth]() # physical units # class Number(float): # def __init__(value, unit=) class Square() class Rectangle() class Triangle() Sorting, [multiple] database indexes (import sqlite), and tree-balancing may be appropriate to teach or mention together or in an optimal sequence. - https://github.com/jwasham/coding-interview-university/blob/master/README.md#sorting - https://github.com/jwasham/coding-interview-university/blob/master/README.md#object-oriented-programming - https://github.com/jwasham/coding-interview-university/blob/master/README.md#design-patterns - https://en.wikipedia.org/wiki/Software_design_pattern - OOP sorted() is implemented with/as a Timsort (and expects an interface (is it __cmp__, __gt__, __lt__, AND __eq__?)). https://wiki.python.org/moin/TimeComplexity On Tuesday, August 14, 2018, Jurgis Pralgauskis < jurgis.pralgauskis at gmail.com> wrote: > Hi, > > The dillema I have when teaching: > our k12 curricullum of programming is more based on algorithms (math > ideas), > but when working as programmer, I see the bigger need of SW architecture > knowledge.. > > OOP is one big topic, which could replace sorting alg stuff (that I never > applied (directly) in this century...). The topics could be integrated in > making mini game engine :) > > I'd still leave classics of sum, min search, and search in sorted vs non > array to get the idea of algorithms. > > What are your approaches, if you have programming classes in K12? > -- > Jurgis Pralgauskis > tel: 8-616 77613 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Tue Aug 14 18:02:41 2018 From: wes.turner at gmail.com (Wes Turner) Date: Tue, 14 Aug 2018 18:02:41 -0400 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: Message-ID: Someone can probably better explain how setattr(object) and setattr(object()) work in regards to `self` as a bound positional parameter? Also, @classmethod and @staticmethod. On Tuesday, August 14, 2018, Wes Turner wrote: > You can probably do sorting, inheritance, and interfaces at the same time? > > An ISortable object must have a .sort() method. e.g. > DoublyLinkedList(LinkedList). > > "15 Sorting Algorithms in 6 Minutes" > https://youtu.be/kPRA0W1kECg > - # of comparisons > - # of array accesses > > ... Big-O Cheat Sheet > http://bigocheatsheet.com > - "Array Sorting Algorithms" > - Time Complexity: Best, Average, Worst > - Space Complexity: Worst > > > I don't have K12 students. > > It's important to learn OOP. There really is a push back from > OOP-over-abstraction to functional with interfaces by convention with e.g. > Go,. As a multi-paradigm language built on C (not C++ (OOP which predates > Java)), programs can be written in many styles with Python. > > There is - some might argue negligible - overhead to each function call. > Is there a good way to do compile-time interface checking with Python? Why > not? > > zope.interface is probably the most popular way to do 'actual' interfaces > in Python. > https://zopeinterface.readthedocs.io/en/latest/ > > Pyramid framework has zope.interface interfaces. > https://github.com/Pylons/pyramid/blob/master/pyramid/interfaces.py > - IResponse > - IRequest (a 'marker' interface) > > An OOP exercise: > > # Namespacing > def area_of_a_rectangle() > def perimeter_of_a_rectangle() > def shape__rectangle__area() > def shape__square__area() > > # Inheritance, Interfaces, Parameters > class Shape() > def __init__(*args, **kwargs): # * > def area() > def perimeter() > def height/width/[depth]() > # physical units > # class Number(float): > # def __init__(value, unit=) > class Square() > class Rectangle() > class Triangle() > > > Sorting, [multiple] database indexes (import sqlite), and tree-balancing > may be appropriate to teach or mention together or in an optimal sequence. > > - https://github.com/jwasham/coding-interview-university/ > blob/master/README.md#sorting > - https://github.com/jwasham/coding-interview-university/ > blob/master/README.md#object-oriented-programming > - https://github.com/jwasham/coding-interview-university/ > blob/master/README.md#design-patterns > - https://en.wikipedia.org/wiki/Software_design_pattern > - OOP > > sorted() is implemented with/as a Timsort (and expects an interface (is it > __cmp__, __gt__, __lt__, AND __eq__?)). > > https://wiki.python.org/moin/TimeComplexity > > On Tuesday, August 14, 2018, Jurgis Pralgauskis < > jurgis.pralgauskis at gmail.com> wrote: > >> Hi, >> >> The dillema I have when teaching: >> our k12 curricullum of programming is more based on algorithms (math >> ideas), >> but when working as programmer, I see the bigger need of SW architecture >> knowledge.. >> >> OOP is one big topic, which could replace sorting alg stuff (that I >> never applied (directly) in this century...). The topics could be >> integrated in making mini game engine :) >> >> I'd still leave classics of sum, min search, and search in sorted vs non >> array to get the idea of algorithms. >> >> What are your approaches, if you have programming classes in K12? >> -- >> Jurgis Pralgauskis >> tel: 8-616 77613 >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Aug 15 12:01:07 2018 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 15 Aug 2018 09:01:07 -0700 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: Message-ID: Hi Jurgis -- I've tried various approaches with K-12, noting that's in itself a wide spectrum i.e. K is nothing like 12. I'll focus on high school (9-12). I'd say the ubiquity (omnipresence) of the "dot operator" as "accessor" suggests working it into ordinary mathematical thinking, at first as a way to reach "attributes" (properties) and second as a way to trigger behaviors. noun.attribute versus noun.behavior(). Why isn't "dot notation" part of everyday math? Given the influx of CS in lower grades, I'd say it's becoming so, defacto. One mathematical object that calls out for such treatment is the Polyhedron, since that's obviously mathematical anyway, and is clearly an Object in the most literal sense. Polyhedrons are colorful and accessible and help make that bridge to game engines providing visuals. >>> tet = Tetrahedron() # could come with many defaults >>> tet.edges 6 >>> tet.vertexes 4 >>> tet.faces 4 What behaviors do we expect from a polyhedron? For starters: tet.rotate(degrees, axis) tet.scale() tet.translate(vector). We see how surface area increases as a 2nd power of change in linear scale, volume as a 3rd power e.g.: >>> tet.volume 1 >>> bigtet = tet.scale(2) # double all edge lengths >>> bigtet.volume 8 >>> biggest = tet.scale(3) # triple all edge lengths >>> biggest.volume 27 Your earlier focus on sorting might still be used, as a typical behavior of mathematical objects, such as lists. Your focus is perhaps less on the algorithms used and more on the syntax e.g. .items() as a behavior of the dict type. That segment in Python where we show how to sort on any element of a tuple might be worth covering: >>> polyvols = {"tetrahedron":1, "octahedron":4, "cube":3, "cuboctahedron":20} >>> vols_tuples = tuple(polyvols.items()) >>> vols_tuples (('tetrahedron', 1), ('octahedron', 4), ('cube', 3), ('cuboctahedron', 20)) >>> sorted(vols_tuples) # alphabetical [('cube', 3), ('cuboctahedron', 20), ('octahedron', 4), ('tetrahedron', 1)] >>> sorted(vols_tuples, key=lambda t: t[1]) # by volume, get to use lambda [('tetrahedron', 1), ('cube', 3), ('octahedron', 4), ('cuboctahedron', 20)] another way, not using lambda, shown in the docs on sorting: >>> from operator import itemgetter >>> getvol = itemgetter(1) # get item 1 of a tuple or other object using __getitem__ >>> getvol(('tetrahedron', 1)) 1 >>> sorted(vols_tuples, key=getvol) [('tetrahedron', 1), ('cube', 3), ('octahedron', 4), ('cuboctahedron', 20)] https://docs.python.org/3.7/howto/sorting.html Like Wes said, you could bridge to inheritance here (if in Python, interfaces are less required as we have multiple inheritance). class Polyhedron # base class could implement the generic guts of a polyhedron with subclasses like: class Tetrahedron(Polyhedron) class Cube(Polyhedron) class Octahedron(Polyhedron) class Cuboctahedron(Polyhedron) ... The special names __lt__ __eq__ __gt__ for <, ==, > will even let you implement sorting, in say volume order. #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 15 08:31:57 2018 @author: Kirby Urner """ class Polyhedron: def __lt__(self, other): return self.volume < other.volume def __gt__(self, other): return self.volume > other.volume def __eq__(self, other): return self.volume == other.volume def scale(self, factor): return type(self)(v=self.volume * factor**3) def __repr__(self): return "{}(v={})".format(type(self).__name__, self.volume) class Tetrahedron(Polyhedron): "Self dual, space-filler with octahedron" def __init__(self, v=1): self.volume = v self.edges, self.vertexes, self.faces = (6, 4, 4) class Cube(Polyhedron): "Dual of Octahedron, space-filler" def __init__(self, v=3): self.volume = v self.edges, self.vertexes, self.faces = (12, 8, 6) class Octahedron(Polyhedron): "Dual of Cube, space-filler with tetrahedron" def __init__(self, v=4): self.volume = v self.edges, self.vertexes, self.faces = (12, 6, 8) class RhDodecahedron(Polyhedron): "Dual of Cuboctahedron, space-filler" def __init__(self, v=6): self.volume = v self.edges, self.vertexes, self.faces = (24, 14, 12) class Cuboctahedron(Polyhedron): "Dual of Rh Dodecahedron" def __init__(self, v=20): self.volume = v self.edges, self.vertexes, self.faces = (24, 12, 14) mypolys = (Tetrahedron(), Cuboctahedron(), Octahedron(), Cube()) volume_order = sorted(mypolys) print(volume_order) from operator import attrgetter name = attrgetter("__class__.__name__") # >>> name(Tetrahedron()) # 'Tetrahedron' name_order = sorted(mypolys, key= name) print(name_order) OUTPUT: By volume: [Tetrahedron(v=1), Cube(v=3), Octahedron(v=4), Cuboctahedron(v=20)] By name: [Cube(v=3), Cuboctahedron(v=20), Octahedron(v=4), Tetrahedron(v=1)] https://twitter.com/itsmikebivins/status/1029552016849129472 Note: these are not necessarily familiar volumes outside a curriculum informed by American literature. https://medium.com/@kirbyurner/bridging-the-chasm-new-england-transcendentalism-in-the-1900s-1dfa4c2950d0 https://en.wikipedia.org/wiki/Synergetics_(Fuller)#Tetrahedral_accounting My art-science courses tend to phase in the above conventions under the rubric of "Martian Math". https://flic.kr/s/aHsmi8go79 Kirby On Tue, Aug 14, 2018 at 12:46 PM, Jurgis Pralgauskis < jurgis.pralgauskis at gmail.com> wrote: > Hi, > > The dillema I have when teaching: > our k12 curricullum of programming is more based on algorithms (math > ideas), > but when working as programmer, I see the bigger need of SW architecture > knowledge.. > > OOP is one big topic, which could replace sorting alg stuff (that I never > applied (directly) in this century...). The topics could be integrated in > making mini game engine :) > > I'd still leave classics of sum, min search, and search in sorted vs non > array to get the idea of algorithms. > > What are your approaches, if you have programming classes in K12? > -- > Jurgis Pralgauskis > tel: 8-616 77613 > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > https://mail.python.org/mailman/listinfo/edu-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Aug 15 12:14:53 2018 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 15 Aug 2018 09:14:53 -0700 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: Message-ID: OUTPUT: By volume: [Tetrahedron(v=1), Cube(v=3), Octahedron(v=4), Cuboctahedron(v=20)] By name: [Cube(v=3), Cuboctahedron(v=20), Octahedron(v=4), Tetrahedron(v=1)] [ weird tweet link appears here in the archive ] Interesting that a URL to a tweet (not one of mine) snuck into the archived copy of this message, even though I don't see it in the outgoing or incoming emailed versions. It shows the Portland skyline these days, when regional forest fires have made the atmosphere really hazy. https://mail.python.org/pipermail/edu-sig/2018-August/011990.html (archived post) Kirby (wearing listowner hat) On Wed, Aug 15, 2018 at 9:01 AM, kirby urner wrote: > > Hi Jurgis -- > > I've tried various approaches with K-12, noting that's in itself a wide > spectrum i.e. K is nothing like 12. > > I'll focus on high school (9-12). > > I'd say the ubiquity (omnipresence) of the "dot operator" as "accessor" > suggests working it into ordinary mathematical thinking, at first as a way > to reach "attributes" (properties) and second as a way to trigger > behaviors. noun.attribute versus noun.behavior(). Why isn't "dot > notation" part of everyday math? Given the influx of CS in lower grades, > I'd say it's becoming so, defacto. > > One mathematical object that calls out for such treatment is the > Polyhedron, since that's obviously mathematical anyway, and is clearly an > Object in the most literal sense. Polyhedrons are colorful and accessible > and help make that bridge to game engines providing visuals. > > >>> tet = Tetrahedron() # could come with many defaults > >>> tet.edges > 6 > >>> tet.vertexes > 4 > >>> tet.faces > 4 > > What behaviors do we expect from a polyhedron? > > For starters: > > tet.rotate(degrees, axis) > tet.scale() > tet.translate(vector). > > We see how surface area increases as a 2nd power of change in linear > scale, volume as a 3rd power e.g.: > > >>> tet.volume > 1 > >>> bigtet = tet.scale(2) # double all edge lengths > >>> bigtet.volume > 8 > >>> biggest = tet.scale(3) # triple all edge lengths > >>> biggest.volume > 27 > > Your earlier focus on sorting might still be used, as a typical behavior > of mathematical objects, such as lists. > > Your focus is perhaps less on the algorithms used and more on the syntax > e.g. .items() as a behavior of the dict type. > > That segment in Python where we show how to sort on any element of a tuple > might be worth covering: > > >>> polyvols = {"tetrahedron":1, "octahedron":4, "cube":3, > "cuboctahedron":20} > >>> vols_tuples = tuple(polyvols.items()) > >>> vols_tuples > (('tetrahedron', 1), ('octahedron', 4), ('cube', 3), ('cuboctahedron', 20)) > > >>> sorted(vols_tuples) # alphabetical > [('cube', 3), ('cuboctahedron', 20), ('octahedron', 4), ('tetrahedron', 1)] > > >>> sorted(vols_tuples, key=lambda t: t[1]) # by volume, get to use lambda > [('tetrahedron', 1), ('cube', 3), ('octahedron', 4), ('cuboctahedron', 20)] > > another way, not using lambda, shown in the docs on sorting: > > >>> from operator import itemgetter > >>> getvol = itemgetter(1) # get item 1 of a tuple or other object using > __getitem__ > >>> getvol(('tetrahedron', 1)) > 1 > > >>> sorted(vols_tuples, key=getvol) > [('tetrahedron', 1), ('cube', 3), ('octahedron', 4), ('cuboctahedron', 20)] > > https://docs.python.org/3.7/howto/sorting.html > > Like Wes said, you could bridge to inheritance here (if in Python, > interfaces are less required as we have multiple inheritance). > > class Polyhedron # base class > > could implement the generic guts of a polyhedron with subclasses like: > > class Tetrahedron(Polyhedron) > class Cube(Polyhedron) > class Octahedron(Polyhedron) > class Cuboctahedron(Polyhedron) > ... > > The special names __lt__ __eq__ __gt__ for <, ==, > will even let you > implement sorting, in say volume order. > > #!/usr/bin/env python3 > # -*- coding: utf-8 -*- > """ > Created on Wed Aug 15 08:31:57 2018 > > @author: Kirby Urner > """ > > class Polyhedron: > > def __lt__(self, other): > return self.volume < other.volume > > def __gt__(self, other): > return self.volume > other.volume > > def __eq__(self, other): > return self.volume == other.volume > > def scale(self, factor): > return type(self)(v=self.volume * factor**3) > > def __repr__(self): > return "{}(v={})".format(type(self).__name__, self.volume) > > class Tetrahedron(Polyhedron): > "Self dual, space-filler with octahedron" > > def __init__(self, v=1): > self.volume = v > self.edges, self.vertexes, self.faces = (6, 4, 4) > > class Cube(Polyhedron): > "Dual of Octahedron, space-filler" > > def __init__(self, v=3): > self.volume = v > self.edges, self.vertexes, self.faces = (12, 8, 6) > > class Octahedron(Polyhedron): > "Dual of Cube, space-filler with tetrahedron" > > def __init__(self, v=4): > self.volume = v > self.edges, self.vertexes, self.faces = (12, 6, 8) > > class RhDodecahedron(Polyhedron): > "Dual of Cuboctahedron, space-filler" > > def __init__(self, v=6): > self.volume = v > self.edges, self.vertexes, self.faces = (24, 14, 12) > > class Cuboctahedron(Polyhedron): > "Dual of Rh Dodecahedron" > > def __init__(self, v=20): > self.volume = v > self.edges, self.vertexes, self.faces = (24, 12, 14) > > mypolys = (Tetrahedron(), Cuboctahedron(), Octahedron(), Cube()) > volume_order = sorted(mypolys) > print(volume_order) > > from operator import attrgetter > name = attrgetter("__class__.__name__") > > # >>> name(Tetrahedron()) > # 'Tetrahedron' > > name_order = sorted(mypolys, key= name) > print(name_order) > > > OUTPUT: > > By volume: [Tetrahedron(v=1), Cube(v=3), Octahedron(v=4), > Cuboctahedron(v=20)] > By name: [Cube(v=3), Cuboctahedron(v=20), Octahedron(v=4), > Tetrahedron(v=1)] > https://twitter.com/itsmikebivins/status/1029552016849129472 > Note: > > these are not necessarily familiar volumes outside a curriculum informed > by American literature. > https://medium.com/@kirbyurner/bridging-the-chasm- > new-england-transcendentalism-in-the-1900s-1dfa4c2950d0 > https://en.wikipedia.org/wiki/Synergetics_(Fuller)#Tetrahedral_accounting > > My art-science courses tend to phase in the above conventions under the > rubric of "Martian Math". > https://flic.kr/s/aHsmi8go79 > > Kirby > > > > On Tue, Aug 14, 2018 at 12:46 PM, Jurgis Pralgauskis < > jurgis.pralgauskis at gmail.com> wrote: > >> Hi, >> >> The dillema I have when teaching: >> our k12 curricullum of programming is more based on algorithms (math >> ideas), >> but when working as programmer, I see the bigger need of SW architecture >> knowledge.. >> >> OOP is one big topic, which could replace sorting alg stuff (that I >> never applied (directly) in this century...). The topics could be >> integrated in making mini game engine :) >> >> I'd still leave classics of sum, min search, and search in sorted vs non >> array to get the idea of algorithms. >> >> What are your approaches, if you have programming classes in K12? >> -- >> Jurgis Pralgauskis >> tel: 8-616 77613 >> >> _______________________________________________ >> Edu-sig mailing list >> Edu-sig at python.org >> https://mail.python.org/mailman/listinfo/edu-sig >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Aug 15 16:52:36 2018 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 15 Aug 2018 13:52:36 -0700 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: Message-ID: OUTPUT: By volume: [Tetrahedron(v=1), Cube(v=3), Octahedron(v=4), Cuboctahedron(v=20)] By name: [Cube(v=3), Cuboctahedron(v=20), Octahedron(v=4), Tetrahedron(v=1)] === Here's a Jupyter Notebook version of my posting from this morning: https://github.com/4dsolutions/SAISOFT/blob/master/OrderingPolys.ipynb I'll test it out with my adult Python students this evening. We've been looking at sorting and lambda expressions. Diving into Polyhedrons as a topic, without actually rendering them, would be frustrating. Fortunately, I've already got rendering backends implemented, going back some decades. http://www.4dsolutions.net/ocn/cp4e.html When it comes to merging math with OOP, I think Polyhedrons look very promising. Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From kohnt at tobiaskohn.ch Wed Aug 15 13:04:32 2018 From: kohnt at tobiaskohn.ch (Tobias Kohn) Date: Wed, 15 Aug 2018 19:04:32 +0200 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: Message-ID: <20180815190432.Horde.GQ5m5hoKi7w8BycmdPjFwLK@webmail.tobiaskohn.ch> Hi Jurgis, As I had very similar problems in my high school teaching often enough, let me add my two cents' worth here.? In contrast to Wes' and Kirby's reply, I am focusing much more on the idea of algorithms than on the software/programming side, and would advocate to give sorting algorithms a fair try ^_^. I think the first question is really what your curriculum's objective is.? If we are talking about computer science, then doing the sorting algorithms is probably the right choice.? If it really is about programming, then OOP might be an acceptable alternative to consider.? The tricky part is that programming often comes as part of general computer science education, so the disctinction between the two is not always that easy.? And if we are talking about computer science as a (more or less) mandatory subject for everyone, then please keep in mind that you are not training future software engineers, and not everyone is becoming a programmer. Anyway, before teaching sorting algorithms, it might be a good idea to think about the reasons for teaching it.? As you have pointed out, sorting is available as a builtin function in nearly every programming system, and CPython has a very sophisticated implementation, indeed, which will almost always be better than what you can do with students.? Hence, teaching sorting algorithms can obviously not be just about the sorting. However, one thing you will have used over and over again as a programmer is, of course, optimisation.? As programmers, whenever possible, we want to come up with an elegant, fast, and efficient solution.? I strongly believe, it is this process of optimisation, of finding more efficient, and clever solutions, that we should be teaching to K-12 students.? And one of the best examples to demonstrate this process is through sorting.? Why?? Because the students can relate to the task in the first place (the understand the problem easily enough), and because we can easily achieve impressive speedups with approachable algorithms. What I want to say is, that directly teaching something like Quicksort to K-12 students has no positive effect, whatsoever.? It is just a dead piece of code, probably something to be learned for the next test, and forgotten just as quickly.? But, if we manage to rather focus on the process of starting with a really dumb sorting algorithm, and then discuss various approaches, and their limitations, of how we can improve it, and make it more efficient, then we get to truly engaging lessons.? Hence, teaching sorting is not about sorting, really, but about how you can improve the efficiency of a program. For this reason, I usually start with sorting early on.? Perhaps something as simple as taking two values, and returning them in ascending order (i. e., `min, max`).? Once you enhance this basic idea to three values, the function quickly gets much more complicated, and my students tend to write long series of `if`-`elif`-chains, something like: def sort_three(a, b, c): ??? if a <= b <= c: ??????? return a, b, c ??? elif a <= c <= b: ??????? return a, c, b ??? elif b <= a <= c: ??????? return b, a, c ??? ... ?? ? Once you arrive at four values, things turn quickly nasty.? Even with the three values above, it becomes hard to reason about the reliability of the function.? Have we covered all the cases?? Does it return the correct order for every conceivable corner-case?? Which is the right branch to be taken if all three values are equal, and where (in the code) do we actually test for that? At this point, the idea of Minsort to the rescue!? Instead of trying to cover every case, we try to think of a different approach, where we first identify the smallest element.? This might, for instance, look as follows. def sort_three(a, b, c): ??? if a <= b and a <= c: ??????? x = a ??????? y, z = sort_two(b, c) ??? elif b <= a and b <= c: ??????? x = b ??????? y, z = sort_two(a, c) ??? elif c <= a and c <= b: ??????? x = c ??????? y, z = sort_two(a, b) ??? return x, y, z Note that at this point, we have already started to bring in the idea of recursion, without actually doing proper recursion.? But demonstrating this basic idea in different settings will help us later on. As a next step, we can then go to do the same thing with lists (the actual implementation here will vary, depending on what you have discussed so far with your students). def sort(input_list): ??? output_list = [] ??? while len(input_list) > 0: ??????? x = min(input_list) ??????? input_list.remove(x) ??????? output_list.append(x) ??? return output_list One problem that occurs with this implementation is that the original list is being destroyed.? So, again, this gives rise to discuss several implementation issues. Finally, depending on what situation you are actually in, you can really do both, and cover sorting algorithms, as well as OOP (as Wes and Kirby have already pointed out). From my experience: in an elective class for 12th graders (who already knew the basics of Python programming), I implemented a very simple 3D-engine.? To that end, the graphical objects need to be build from triangles, and what is more natural than representing these triangles as objects?? But, once we start to rotate the camera, so as to give a real 3D-impression, we need to make sure that the triangles are painted in the correct order: we need to sort them according to their depth.? So, sorting does not only come in as quite natural a requirement, it is also evident that the sorting needs to be fast, because we want to repaint the scene several times every second. Unfortunately, it took me about half a year to cover this entire programme with about two hours each week.? This included, of course, a treatment of various projections, matrices, and all the other fun stuff.? But it might still give you yet another idea of how to approach the subject. I hope you will find a nice solution to your dilemma. Cheers, Tobias Quoting Jurgis Pralgauskis : > Hi, ? > The dillema I have when teaching: > ?our k12 curricullum of programming is more based on algorithms > (math ideas),? > but when working as programmer, I see the bigger need of SW > architecture knowledge..? > ? > ?OOP is one big topic, which could replace sorting alg stuff > (that I never applied (directly) in this century...). The topics > could be integrated in making mini game engine :)? > ? > I'd still leave classics of sum, min search, and search in sorted > vs non array to get the idea of algorithms. > > What are your approaches, if you have programming classes in K12? > -- > Jurgis Pralgauskis > tel: 8-616 77613 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu Aug 16 14:24:22 2018 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 16 Aug 2018 11:24:22 -0700 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: <20180815190432.Horde.GQ5m5hoKi7w8BycmdPjFwLK@webmail.tobiaskohn.ch> References: <20180815190432.Horde.GQ5m5hoKi7w8BycmdPjFwLK@webmail.tobiaskohn.ch> Message-ID: I'm glad Tobias took the bull by the horns and didn't eschew a deeper look into the sorting algorithms. As a big fan of animations, my reflex is to scour Youtube for graphical renderings of the different strategies, but then another thought crops up: lets get out of our seats and do choreography, Math is an Outdoor Sport! (PR poster). I should explain. The relationships between programming and scripting theater "programmes" (old spelling) are deep. Give each student a postit with a number and have them *enact* the sorting algorithm. E.g. starting in a row, turn to person on your left (if there is one) and swap places if your postit number is higher... have directors and make a video. Now choreograph (enact, dance) in a different way. Symphonies, plays, musicals, are so multi-track, so parallel, and yet we fail to exploit those intuitions sometimes. Let the Theater Department handle it, in consultation with CS. Could go under the heading of "Unplugged". Likely the Hobbits are already doing this in New Zealand (NZ has pioneered unplugged more than most, plus has Hobbits). Seriously, having lived in the Philippines where people routinely learn group dancing, I'm worried about only acting as teams in three capacities (a) cheerleader (b) athlete on the field (c) band. Theater is being eliminated in favor of competitive sports. Perhaps CS could come to the rescue and say "wait, we need Theater for our simulations". More cerebral team-based activities might go a long way towards fighting the stereotype that computer programmers only live in artificially lit basements eating pizza. That's a physically damaging lifestyle, nothing to do with writing code or even doing math. === Regarding last night's tele-class (real time, zoom.us), I worked through "cloning a github repo" as the core exercise, a repeat from last week, then went through the process of updating a notebook live, and pushing the changes back to the repo. The repo was of course the one with yesterday's Jupyter Notebook about Ordering Polyhedrons by volume. https://github.com/4dsolutions/SAISOFT I tell them "cloning a github repo" is going to be important for when they want like a Jake Vanderplas tutorial, i.e. when they want to study a topic in more depth and the workshop is (A) on Youtube or similar service and (B) the workshop materials are free via github (a common enough pattern). I also reminded them how Google shares TensorFlow in the form of Colab exercises (Jupyter Notebooks). One students asked "R or Python, which is winning in Data Science"? My answer: pandas is a relatively recent development and there's already lots of excellent curriculum based around R, which is likewise free / open source. The business world is rushing into Python because of DL / ML and so gains an R-like tool in the process, which enables better town-gown relations i.e. Harvard can talk to Facebook about Pytorch thanks to already teaching R in the stats department. In other words, it's not either/or, more like two communities forming a bridge via the common language of data science, which R and Python both reflect (as do some other languages / ecosystems, not aiming for comprehensivity here). Kirby On Wed, Aug 15, 2018 at 10:04 AM, Tobias Kohn wrote: > Hi Jurgis, > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carl at nextdayvideo.com Thu Aug 16 16:28:29 2018 From: carl at nextdayvideo.com (Carl Karsten) Date: Thu, 16 Aug 2018 15:28:29 -0500 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: Message-ID: One of my most memorable classes was Introduction to Algorithms. Not because I have ever needed to implement a linked list, but because it opened my eyes to a much larger field of knowledge than just knowing language syntax. I went into the class wondering what could I possibly learn? I left knowing the possibilities are endless. On Tue, Aug 14, 2018 at 2:47 PM Jurgis Pralgauskis wrote: > > Hi, > > The dillema I have when teaching: > our k12 curricullum of programming is more based on algorithms (math ideas), > but when working as programmer, I see the bigger need of SW architecture knowledge.. > > OOP is one big topic, which could replace sorting alg stuff (that I never applied (directly) in this century...). The topics could be integrated in making mini game engine :) > > I'd still leave classics of sum, min search, and search in sorted vs non array to get the idea of algorithms. > > What are your approaches, if you have programming classes in K12? > -- > Jurgis Pralgauskis > tel: 8-616 77613 > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > https://mail.python.org/mailman/listinfo/edu-sig From kohnt at tobiaskohn.ch Thu Aug 16 17:00:18 2018 From: kohnt at tobiaskohn.ch (Tobias Kohn) Date: Thu, 16 Aug 2018 23:00:18 +0200 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: <20180815190432.Horde.GQ5m5hoKi7w8BycmdPjFwLK@webmail.tobiaskohn.ch> Message-ID: <20180816230018.Horde.C-4t6mVd2Hy7oW2x57BjyWC@webmail.tobiaskohn.ch> I couldn't agree more!? Such interactive programmes are often so much more valuable than hours of talking (even though doing interactive programmes all the time will wear the students out -- as always, there is golden middle here ^_^). Another idea in that direction is to make two or three groups, and then have a little competition of who can sort a pile of post-its (or whatever) fastest.? And I would recommend to surprise the students.? Once they have learned how to sort numbers, say, give them post-its with picture of animals, say, or melodies, or whatever you fancy.? That forces them to think outside of the box, and suddenly computer science class becomes so much more meaningful and memorable! Yet another idea: how about sorting Morse code?? Usually, we get it sorted from 'A' to 'Z'.? But there are other ways, and before you know it, you are discussing trees... Cheers, Tobias Quoting kirby urner : > ? > I'm glad Tobias took the bull by the horns and didn't eschew? a > deeper look into the sorting algorithms. > ? > As a big fan of animations, my reflex is to scour Youtube for > graphical renderings of the different strategies, but then another > thought crops up: lets get out of our seats and do choreography, > Math is an Outdoor Sport! (PR poster). I should explain. > ? > The relationships between programming and scripting theater > "programmes" (old spelling) are deep. Give each student a postit > with a number and have them *enact* the sorting algorithm.? E.g. > starting in a row, turn to person on your left (if there is one) and > swap places if your postit number is higher...? have directors? and > make a video.? Now choreograph (enact, dance) in a different way. > ? > Symphonies, plays, musicals, are so multi-track, so parallel, and > yet we fail to exploit those intuitions sometimes. > ? > Let the Theater Department handle it, in consultation with CS.? > Could go under the heading of "Unplugged".? Likely the Hobbits are > already doing this in New Zealand (NZ has pioneered unplugged more > than most, plus has Hobbits). > ? > Seriously, having lived in the Philippines where people routinely > learn group dancing, I'm worried about only acting as teams in three > capacities (a) cheerleader (b) athlete on the field (c) band.? > Theater is being eliminated in favor of competitive sports.? Perhaps > CS could come to the rescue and say "wait, we need Theater for our > simulations". > ? > More cerebral team-based activities might go a long way towards > fighting the stereotype that computer programmers? only live in > artificially lit basements eating pizza.? That's a physically > damaging lifestyle, nothing to do with writing code or even doing > math. > ? > === > ? > Regarding last night's tele-class (real time, zoom.us[1]), I > worked through "cloning a github repo" as the core exercise, a > repeat from last week, then went through the process of updating a > notebook live, and pushing the changes back to the repo. > ? > The repo was of course the one with yesterday's Jupyter Notebook > about Ordering Polyhedrons by volume. > ? > https://github.com/4dsolutions/SAISOFT > ? > I tell them "cloning a github repo" is going to be important for > when they want like a Jake Vanderplas tutorial, i.e. when they want > to study a topic in more depth and the workshop is (A) on Youtube or > similar service and (B) the workshop materials are free via github > (a common enough pattern).? > ? > I also reminded them how Google shares TensorFlow in the form of > Colab exercises (Jupyter Notebooks). > ? > One students asked "R or Python, which is winning in Data Science"?? > ? > My answer:? pandas is a relatively recent development and there's > already lots of excellent curriculum based around R, which is > likewise free / open source. The business world is rushing into > Python because of DL / ML and so gains an R-like tool in the > process, which enables better town-gown relations i.e. Harvard can > talk to Facebook about Pytorch thanks to already teaching R in the > stats department.? > ? > In other words, it's not either/or, more like two communities > forming a bridge via the common language of data science, which R > and Python both reflect (as do some other languages / ecosystems, > not aiming for comprehensivity here). > ? > Kirby > ? > ? > > On Wed, Aug 15, 2018 at 10:04 AM, Tobias Kohn > wrote: > >> _Hi Jurgis,_ Links: ------ [1] http://zoom.us -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Fri Aug 17 00:09:46 2018 From: wes.turner at gmail.com (Wes Turner) Date: Fri, 17 Aug 2018 00:09:46 -0400 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: <20180816230018.Horde.C-4t6mVd2Hy7oW2x57BjyWC@webmail.tobiaskohn.ch> References: <20180815190432.Horde.GQ5m5hoKi7w8BycmdPjFwLK@webmail.tobiaskohn.ch> <20180816230018.Horde.C-4t6mVd2Hy7oW2x57BjyWC@webmail.tobiaskohn.ch> Message-ID: Optimization for real-world data. Morse code is a good one; which leads to the entropy of real-world English letters: how probable are the letters A, E, and Z? How probable is the 3-gram of letters 'AEZ'? A well-balanced tree could take this knowledge into account and sparsely add 'nodes' without needing to rebalance as often. Pairtree with hashes is an interesting real-world problem. Filesystems have a max number of file entries per directory. A good cryptographic hash has equal probabilities of e.g. hexadecimal character occurrence for each digit: each digit character has an equal probability of following any other digit. Shannon used these probabilities for something; I can't remember what it was? One (TED-Ed) YouTube video I found mentioned sorting library books; what's the fastest way? Sorting is not strictly necessary for top-k N-dimensional optimization: tracking high and low points doesn't require sorting the whole (then ordered or partially ordered) set. Here's an example from https://wrdrd.github.io/docs/consulting/data-science# optimization : Optimization? https://en.wikipedia.org/wiki/Mathematical_optimization Find local and global optima (maxima and minima) within an n-dimensional field which may be limited by resource constraints. # Global optima of a 1-dimensional list points = [10, 20, 100, 20, 10] global_max, global_min = max(points), min(points) assert global_max == 100 assert global_min == 10 # Local optima of a 1-dimensional list sample = points[:1] local_max, local_min = max(sample), min(sample) assert local_max == 20 assert local_min == 10 # A 2-dimensional list ... points = [(-0.5, 0), (0, 0.5), (0.5, 0), (0, -0.5)] https://en.wikipedia.org/wiki/Optimization_(disambiguation) https://en.wikipedia.org/wiki/Metaheuristic https://en.wikipedia.org/wiki/Receiver_operating_characteristic http://rayli.net/blog/data/top-10-data-mining-algorithms-in-plain-english/ http://scikit-learn.org/stable/tutorial/machine_learning_map/ https://en.wikipedia.org/wiki/Firefly_algorithm On Thursday, August 16, 2018, Tobias Kohn wrote: > I couldn't agree more! Such interactive programmes are often so much more > valuable than hours of talking (even though doing interactive programmes > all the time will wear the students out -- as always, there is golden > middle here ^_^). > > Another idea in that direction is to make two or three groups, and then > have a little competition of who can sort a pile of post-its (or whatever) > fastest. And I would recommend to surprise the students. Once they have > learned how to sort numbers, say, give them post-its with picture of > animals, say, or melodies, or whatever you fancy. That forces them to > think outside of the box, and suddenly computer science class becomes so > much more meaningful and memorable! > > Yet another idea: how about sorting Morse code? Usually, we get it sorted > from 'A' to 'Z'. But there are other ways, and before you know it, you are > discussing trees... > > Cheers, > Tobias > > > Quoting kirby urner : > > > I'm glad Tobias took the bull by the horns and didn't eschew a deeper > look into the sorting algorithms. > > As a big fan of animations, my reflex is to scour Youtube for graphical > renderings of the different strategies, but then another thought crops up: > lets get out of our seats and do choreography, Math is an Outdoor Sport! > (PR poster). I should explain. > > The relationships between programming and scripting theater "programmes" > (old spelling) are deep. Give each student a postit with a number and have > them *enact* the sorting algorithm. E.g. starting in a row, turn to person > on your left (if there is one) and swap places if your postit number is > higher... have directors and make a video. Now choreograph (enact, > dance) in a different way. > > Symphonies, plays, musicals, are so multi-track, so parallel, and yet we > fail to exploit those intuitions sometimes. > > Let the Theater Department handle it, in consultation with CS. Could go > under the heading of "Unplugged". Likely the Hobbits are already doing > this in New Zealand (NZ has pioneered unplugged more than most, plus has > Hobbits). > > Seriously, having lived in the Philippines where people routinely learn > group dancing, I'm worried about only acting as teams in three capacities > (a) cheerleader (b) athlete on the field (c) band. Theater is being > eliminated in favor of competitive sports. Perhaps CS could come to the > rescue and say "wait, we need Theater for our simulations". > > More cerebral team-based activities might go a long way towards fighting > the stereotype that computer programmers only live in artificially lit > basements eating pizza. That's a physically damaging lifestyle, nothing to > do with writing code or even doing math. > > === > > Regarding last night's tele-class (real time, zoom.us), I worked through > "cloning a github repo" as the core exercise, a repeat from last week, then > went through the process of updating a notebook live, and pushing the > changes back to the repo. > > The repo was of course the one with yesterday's Jupyter Notebook about > Ordering Polyhedrons by volume. > > https://github.com/4dsolutions/SAISOFT > > I tell them "cloning a github repo" is going to be important for when they > want like a Jake Vanderplas tutorial, i.e. when they want to study a topic > in more depth and the workshop is (A) on Youtube or similar service and (B) > the workshop materials are free via github (a common enough pattern). > > I also reminded them how Google shares TensorFlow in the form of Colab > exercises (Jupyter Notebooks). > > One students asked "R or Python, which is winning in Data Science"? > > My answer: pandas is a relatively recent development and there's already > lots of excellent curriculum based around R, which is likewise free / open > source. The business world is rushing into Python because of DL / ML and so > gains an R-like tool in the process, which enables better town-gown > relations i.e. Harvard can talk to Facebook about Pytorch thanks to already > teaching R in the stats department. > > In other words, it's not either/or, more like two communities forming a > bridge via the common language of data science, which R and Python both > reflect (as do some other languages / ecosystems, not aiming for > comprehensivity here). > > Kirby > > > > On Wed, Aug 15, 2018 at 10:04 AM, Tobias Kohn wrote: > >> *Hi Jurgis,* >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Fri Aug 17 17:28:14 2018 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 17 Aug 2018 14:28:14 -0700 Subject: [Edu-sig] What to teach: sorting algorithms vs OOP? In-Reply-To: References: <20180815190432.Horde.GQ5m5hoKi7w8BycmdPjFwLK@webmail.tobiaskohn.ch> Message-ID: On Thu, Aug 16, 2018 at 11:24 AM, kirby urner wrote: > > I'm glad Tobias took the bull by the horns and didn't eschew a deeper > look into the sorting algorithms. > > As a big fan of animations, my reflex is to scour Youtube for graphical > renderings of the different strategies > e.g.: https://youtu.be/ZZuD6iUe3Pc Check out the BBC spin (heavy into sorting): https://youtu.be/gOKVwRIyWdg (I'd gladly show this in my school) Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From jackiekazil at gmail.com Fri Aug 24 18:01:41 2018 From: jackiekazil at gmail.com (Jacqueline Kazil) Date: Fri, 24 Aug 2018 18:01:41 -0400 Subject: [Edu-sig] Diversity and Inclusion in Data Science to the Environmental Sciences Message-ID: There might be some people on this list interested in this event. I hope to see some of you apply for a spot! Please email Alycia, cc-ed on this post if you have questions! Cheers, -Jackie -------------------------------------------------------------------------------------------------- NSF INCLUDES CONFERENCE: Bringing Conversations on Diversity and Inclusion in Data Science to the Environmental Sciences April 2-4, 2019 Boulder, Colorado Growth in large ecological datasets and large environmental synthesis projects has resulted in the need for a diverse workforce with technical data science skills. A variety of organizations support underrepresented groups entering the data science field through training, mentoring, and networking opportunities. However, many of these initiatives have been developed in isolation, limiting opportunities for an exchange of ideas and lessons learned. This conference will facilitate development of the Environmental Data Science Inclusion Network (EDSIN) to strengthen initiatives across existing alliances and organizations to recruit and retain individuals from underrepresented groups in data science careers. Who Should Attend - Researchers focusing on recruitment and retention of underrepresented groups in STEM fields, quantitative biology education, or related areas - Project leaders for STEM programs serving underrepresented groups - Employers committed to hiring and retaining a diverse data science workforce - Mentors with experience working with students and early career professionals underrepresented in STEM - Evaluators doing work with STEM education programs - Educators who teach data science skills to learners of all ages How to Apply Funding is available through the National Science Foundation to support travel and participant costs for most attendees although there will be space available for those able to provide their own funding. To attend and/or be considered for funding, please fill out the application found on our website (edsin.qubeshub.org) by October 1. Applicants will be notified in early November of their acceptance. Unable to attend in person? We will be live-streaming the event! Details will be provided on our conference website as they become available. QuestionsContact Alycia Crall: acrall at battelleecology.org -- Jacqueline Kazil | @jackiekazil -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Mon Aug 27 20:12:13 2018 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 27 Aug 2018 17:12:13 -0700 Subject: [Edu-sig] Python teacher notes, preparing for class... Message-ID: My flight plan for sharing Python this evening, adult audience, real time in cyberspace, includes going backstage to survey the Python for Developers view. That will mean optionally cloning the Github site that's mainly a Sphinx HTML document about how to participate in Python's evolution. https://github.com/python/devguide (show how Sphinx works) I don't plan on actually compiling Python tonight, but we'll be right where one needs to be to learn how. Just looking at the issues tracker (first time) and PEPs (again) will inspire students with how well-oiled a machine is the Python "sausage making" factory. In my estimation, a well-rounded knowledge of Python includes understanding how to make one's own decorators and context managers. The following categories of type should also be made clear: * Mutable vs Immutable * Callable vs not * Collections: Sequences vs Mappings * Iterator vs Iterable * Generator as Iterator * Context Manager * Descriptor We recognize these types based on the assortment of "__ribs__" (special names) they contain e.g. callables have __call__, mutables support __setitem__, iterators have __next__, context managers __enter__ and __exit__, Descriptors __fget__, __fset__ and so on. We're like bird watcher with binoculars, identifying species based on these tell-tale characteristics (APIs). A grand synthesis involves using the @contextmanager decorator from contextlib to turn a generator into a context manager. That's a high point (summit) in my curriculum. The Descriptor concept works in tandem with decorator syntax to bring us the @property type. I use a "magic circle" type for properties, meaning you can set radius or circumference or area of a Circle, and the other two attributes reset automatically. I believe Raymond Hettinger uses the same approach. One of my most computer sciency types is the Permutation class, with many soft links to Group Theory. My P class randomly generates a dict with [a-z] plus space (' ') mapped to the same set, keys to values in a different order. I have voluminous writings on how one might use this class to explore elementary group theory on math-teach @ Math Forum, public archives, no longer open to new comments. https://repl.it/@kurner/Permutations http://mathforum.org/kb/message.jspa?messageID=10227508 https://github.com/4dsolutions/Python5/blob/master/Permutations.ipynb Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Mon Aug 27 21:36:06 2018 From: wes.turner at gmail.com (Wes Turner) Date: Mon, 27 Aug 2018 21:36:06 -0400 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: On Monday, August 27, 2018, kirby urner wrote: > > My flight plan for sharing Python this evening, adult audience, real time > in cyberspace, includes going backstage to survey the Python for Developers > view. > > That will mean optionally cloning the Github site that's mainly a Sphinx > HTML document about how to participate in Python's evolution. > > https://github.com/python/devguide (show how Sphinx works) > ReadTheDocs might be a helpful segue from Sphinx and the devguide. https://github.com/rtfd/readthedocs-docker-images/blob/master/README.rst#usage $ docker pull readthedocs/build:latest (Building a PDF with Sphinx requires installing a lot of LaTeX packages) https://github.com/yoloseem/awesome-sphinxdoc cookiecutter-pypackage has a good Sphinx template that extends the one generated by sphinx-quickstart with e.g. how to include README.rst in the Sphinx docs and the package long_description in setup.py (with cool badges) https://cookiecutter.readthedocs.io/en/latest/readme.html#available-cookiecutters https://packaging.python.org > > I don't plan on actually compiling Python tonight, but we'll be right > where one needs to be to learn how. Just looking at the issues tracker > (first time) and PEPs (again) will inspire students with how well-oiled a > machine is the Python "sausage making" factory. > > In my estimation, a well-rounded knowledge of Python includes > understanding how to make one's own decorators and context managers. > > The following categories of type should also be made clear: > > * Mutable vs Immutable > * Callable vs not > * Collections: Sequences vs Mappings > * Iterator vs Iterable > * Generator as Iterator > * Context Manager > * Descriptor > > We recognize these types based on the assortment of "__ribs__" (special > names) they contain e.g. callables have __call__, mutables support > __setitem__, iterators have __next__, context managers __enter__ and > __exit__, Descriptors __fget__, __fset__ and so on. We're like bird > watcher with binoculars, identifying species based on these tell-tale > characteristics (APIs. > This is the most unified reference on __dunder_methods__ ('magic methods') I've ever seen: "A Guide to Python's Magic Methods" https://rszalski.github.io/magicmethods/ > > A grand synthesis involves using the @contextmanager decorator from > contextlib to turn a generator into a context manager. That's a high point > (summit) in my curriculum. > > The Descriptor concept works in tandem with decorator syntax to bring us > the @property type. I use a "magic circle" type for properties, meaning > you can set radius or circumference or area of a Circle, and the other two > attributes reset automatically. I believe Raymond Hettinger uses the same > approach. > ipywidgets (and IPython) are built atop traitlets (which are like properties with event handlers that are observable) https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Events.html#Traitlet-events > Widget properties are IPython traitlets and traitlets are eventful. To handle changes, the observe method of the widget can be used to register a callback. > > One of my most computer sciency types is the Permutation class, with many > soft links to Group Theory. My P class randomly generates a dict with > [a-z] plus space (' ') mapped to the same set, keys to values in a > different order. I have voluminous writings on how one might use this > class to explore elementary group theory on math-teach @ Math Forum, public > archives, no longer open to new comments. > > https://repl.it/@kurner/Permutations > http://mathforum.org/kb/message.jspa?messageID=10227508 > https://github.com/4dsolutions/Python5/blob/master/Permutations.ipynb > > Kirby > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Aug 29 19:05:29 2018 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 29 Aug 2018 16:05:29 -0700 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: > This is the most unified reference on __dunder_methods__ ('magic methods') > I've ever seen: > "A Guide to Python's Magic Methods" > https://rszalski.github.io/magicmethods/ > > I'd not seen that Guide to magic methods before. Thanks! >From perusing it, I was reminded of a topic Trey Hunner discussed in one of his recorded live chats: When defining how your class implements ordering, e.g. using __lt__, __gt__, __eg__ and so on, it's sufficient to define just two of these, then decorate with @total_ordering to have Python fill in the blanks. I tested that out in my OrderingPolys.ipynb (Jupyter Notebook). Great! I'm keeping the demo. http://localhost:8889/notebooks/Documents/SAISOFT/SAISOFT/OrderingPolys.ipynb This Notebook now includes a link back to Rafe's docs. I'll be sure my California students know about this update. We meet again tonight. I use geometry, polyhedrons in particular, as an excuse to introduce OOP from yet another angle (I take a multi-faceted approach). Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Wed Aug 29 19:07:17 2018 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 29 Aug 2018 16:07:17 -0700 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: > I tested that out in my OrderingPolys.ipynb (Jupyter Notebook). Great! > I'm keeping the demo. > > > http://localhost:8889/notebooks/Documents/SAISOFT/SAISOFT/OrderingPolys.ipynb > https://github.com/4dsolutions/SAISOFT/blob/master/OrderingPolys.ipynb Sorry, my bad. I gave the local URL on my laptop vs the global one @ Github. Kirby > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 06:02:13 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 06:02:13 -0400 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: > By default, the sorted function looks at the leftmost element of a tuple or other iterable, when sorting... AFAIU, sorted() compares the whole object. https://docs.python.org/3/howto/sorting.html >>> l = [(3, 2), (3, 1), (1, 1, 2), (1, 1)] >>> sorted(l) [(1, 1), (1, 1, 2), (3, 1), (3, 2)] The way it reads, it seems like you're implying that sorted() does this: >>> l = [(3, 2), (3, 1), (1, 1, 2), (1, 1)] >>> sorted(l, key=lambda x: x[0]) [(1, 1, 2), (1, 1), (3, 2), (3, 1)] > You'll find some excellent overview of the magic methods in this essay by Rafe Kettler: A Guide to Python's Magic Methods. He's mostly looking at Python 2.7, so does not pick up on the __next__ method, however you'll be able to fill in the blanks thanks to this course This is unclear to me. What does the next() function do? How do I find the docs and source for it? These are misspelled: > comparitor > compartor These are great: - http://www.scipy-lectures.org/intro/language/python_language.html - http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-1-Introduction-to-Python-Programming.ipynb - Something about sorted with a link to the docs would be a good addition. IDK, I tend to find it much easier to just read the docs (and the source, if it's not clear). https://docs.python.org/3/library/functions.html#sorted https://docs.python.org/3/howto/sorting.html sorted() is a built-in function (as indicated by the TypeError thrown by inspect.getfile(sorted)); which are in bltinmodule.c: https://github.com/python/cpython/blob/master/Python/bltinmodule.c On Wednesday, August 29, 2018, kirby urner wrote: > > >> I tested that out in my OrderingPolys.ipynb (Jupyter Notebook). Great! >> I'm keeping the demo. >> >> http://localhost:8889/notebooks/Documents/SAISOFT/ >> SAISOFT/OrderingPolys.ipynb >> > > > https://github.com/4dsolutions/SAISOFT/blob/master/OrderingPolys.ipynb > > Sorry, my bad. I gave the local URL on my laptop vs the global one @ > Github. > > Kirby > >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu Aug 30 11:48:39 2018 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 30 Aug 2018 08:48:39 -0700 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: On Thu, Aug 30, 2018 at 3:02 AM Wes Turner wrote: > > By default, the sorted function looks at the leftmost element of a tuple > or other iterable, when sorting... > > You're right, my presentation is unclear. I'll fix it. The way it reads, it seems like you're implying that sorted() does this: > > Yes, and that's wrong. > >>> l = [(3, 2), (3, 1), (1, 1, 2), (1, 1)] > >>> sorted(l, key=lambda x: x[0]) > [(1, 1, 2), (1, 1), (3, 2), (3, 1)] > > > > You'll find some excellent overview of the magic methods in this essay > by Rafe Kettler: A Guide to Python's Magic Methods. He's mostly looking at > Python 2.7, so does not pick up on the __next__ method, however you'll be > able to fill in the blanks thanks to this course > > This is unclear to me. What does the next() function do? How do I find the > docs and source for it? > > next(obj) triggers obj.__next__() which in 2.7 is named next internally i.e. isn't magic. __next__ is the main driver of iterators e.g. for loops hit __next__ over and over as they loop over whatever. True, a list (iterable) doesn't have a __next__, but a for loop implicitly applies __iter__ (called by the iter function) which turns iterables into iterators. > These are misspelled: > > > comparitor > > compartor > > Will fix next. > These are great: > - http://www.scipy-lectures.org/intro/language/python_language.html > - > http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-1-Introduction-to-Python-Programming.ipynb > - Something about sorted with a link to the docs would be a good > addition. > > Thanks. Yes, I'll add some links to the docs as you suggest. Great feedback! Actually as part of my class I'm showing them edu-sig and other python.org lists, so we were actually viewing this conversation. I'll extend that to showing your corrections, as I want to demonstrate how the Python community all teaches each other, is friendly and so on. Kirby -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 12:12:22 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 12:12:22 -0400 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: On Thursday, August 30, 2018, kirby urner wrote: > > > Thanks. Yes, I'll add some links to the docs as you suggest. Great > feedback! > Glad to be helpful. I've trimmed out the text I'm not replying to and tried to use plaintext only in order to: make sure the thread stays below the 40K limit, and make it easy to reply inline without breaking HTML tags. > > Actually as part of my class I'm showing them edu-sig and other python.org > lists, so we were actually viewing this conversation. I'll extend that to > showing your corrections, as I want to demonstrate how the Python community > all teaches each other, is friendly and so on. > Code review with pull requests / merge requests and GitHub, Gerrit, GitLab etc is an essential skill. Src: https://github.com/jupyter/nbdime Docs: https://nbdime.readthedocs.io/ > nbdime provides tools for diffing and merging of Jupyter Notebooks. There are a number of real-time collaborative platforms for working with notebooks (CoCalc, Colab, ) https://hypothes.is highlights and annotations work on anything with a URL, are threaded, and support Markdown. > > Kirby > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 13:24:26 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 13:24:26 -0400 Subject: [Edu-sig] Python teacher notes, preparing for class... In-Reply-To: References: Message-ID: Mailing list tips and tricks, PEPs, Write the Docs Since you asked, although this isn't in scope of the original subject line, and since I'd like to just continue this thread instead of breaking the thread by changing the subject line, and since this isn't technically OT (off-topic) in the interest of conversing toward an objective, here I've added a first-line summary of this message. I should probably change the subject and start a new thread. You can search mailing lists in a number of ways: - Google search with "site:mail.python.org" and/or "inurl:" queries https://www.google.com/search?q=site%3Amail.python.org (inurl doesn't match mm3-migrated lists too) - Google Groups, if the list is set up there too - Gmail "list:python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - "from:list at mail.python.org" queries - This doesn't find messages that you didn't receive because you weren't subscribed yet. - Markmail "list:org.python.edu-sig" queries https://markmail.org/search/?q=list%3Aorg.python https://markmail.org/search/?q=list%3Aorg.python.edu-sig The Python mailing lists aren't yet all upgraded to mailman 3 (/mm3/ URLs); so some lists have the classic mailman archive interface (where "by thread" breaks at the month boundary, for example) and upgraded lists have the new Django-based HyperKitty interface with e.g. search and a full thread view. With mm3, it's also possible to reply to threads you didn't receive because you weren't subscribed at the time. e.g. -- for example i.e. -- that is (List of acronyms OTOH/OTOMH) Reply-all is unnecessary, but often helpful. If you just click reply, it may be addressed off-list to only the sender (and not the list email address, which is what you want if you want the mailing list app to archive for and relay the message to every subscriber). If that happens, you (or the recipient) can forward the message to the list, but it'll be unnecessarily quote-indented unless you just copy and paste (which can be lossy with HTML quote indents inferred from plaintext-quoted lines that start with '>'), so it pays to verify the to: field before you start composing a message. Some old hands argue for like 72 character fixed width messages so that when they're n-levels quote-indented, they still fit on an 80 character terminal without rewrapping. Old-school email clients like mutt, for example, can handle this; though, on a phone, fixed width hard-broken lines wrap like this sometimes; which is not as easy to read. TL;DR (too long; didn't read) is an acronym of Reddit; though the standard form of intro summary, body, conclusion summary is equally helpful for long-form mailing list posts. Many email clients show the first part of the first line of the message after the overly-long narrowly descriptive subject line that doesn't actually describe the scope of the discussion anymore. For Python features, the ultimate objective is to write or develop a PEP. There is a PEP template here: https://www.python.org/dev/peps/pep-0012/ https://github.com/python/peps/blob/master/pep-0012.rst PEP 1 explains PEPs: "PEP 1 -- PEP Purpose and Guidelines" https://www.python.org/dev/peps/pep-0001/ https://github.com/python/peps/blob/master/pep-0001.txt PEPs must be justified (as indicated by the Rationale heading in the PEP template); so starting with a justification is a good approach to arguing that you need the whole list's time before you spend your precious time writing an actual PEP like actual contributors do sometimes (when they're getting actual work done). Bug and issue discussions are for the issue tracker (Roundup), though sometimes it's a really good idea to ask a list for help and feedback. Mailing lists don't support ReStructuredText, but docs, docstrings, and PEPs do; so it's perfectly reasonable -- even advisable, though not at all strictly necessary -- to format mailing list messages that would be helpful for those purposes in reStructuredText from the start. By the time you've added RST setext headings, you might as well be collaboratively drafting a PEP. Though it doesn't happen nearly frequently enough, it's often really helpful to update the docs with wisdom culled from the mailing lists (and Q&A sites which have labels). "6. Helping with Documentation?" https://devguide.python.org/docquality/ "7. Documenting Python?" https://devguide.python.org/documenting/ The ultimate source of Python documentation (an often-cited strength of Python as a language choice): https://github.com/python/cpython/tree/master/Doc "16. Accepting Pull Requests?" https://devguide.python.org/committing/ On Thursday, August 30, 2018, Wes Turner wrote: > > > On Thursday, August 30, 2018, kirby urner wrote: >> >> >> Thanks. Yes, I'll add some links to the docs as you suggest. Great >> feedback! >> > > Glad to be helpful. > > I've trimmed out the text I'm not replying to and tried to use plaintext > only in order to: make sure the thread stays below the 40K limit, and make > it easy to reply inline without breaking HTML tags. > > >> >> Actually as part of my class I'm showing them edu-sig and other >> python.org lists, so we were actually viewing this conversation. I'll >> extend that to showing your corrections, as I want to demonstrate how the >> Python community all teaches each other, is friendly and so on. >> > > Code review with pull requests / merge requests and GitHub, Gerrit, GitLab > etc is an essential skill. > > Src: https://github.com/jupyter/nbdime > Docs: https://nbdime.readthedocs.io/ > > > nbdime provides tools for diffing and merging of Jupyter Notebooks. > > There are a number of real-time collaborative platforms for working with > notebooks (CoCalc, Colab, ) > > https://hypothes.is highlights and annotations work on anything with a > URL, are threaded, and support Markdown. > > >> >> Kirby >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 13:26:50 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 13:26:50 -0400 Subject: [Edu-sig] REQ: HOWTO mailing lists resources Message-ID: What are some good resources for learning how to mailing list? Was: "Re: [Edu-sig] Python teacher notes, preparing for class..." On Thursday, August 30, 2018, Wes Turner wrote: > Mailing list tips and tricks, PEPs, Write the Docs > > Since you asked, although this isn't in scope of the original subject > line, and since I'd like to just continue this thread instead of breaking > the thread by changing the subject line, and since this isn't technically > OT (off-topic) in the interest of conversing toward an objective, here I've > added a first-line summary of this message. I should probably change the > subject and start a new thread. > > You can search mailing lists in a number of ways: > > - Google search with "site:mail.python.org" and/or "inurl:" queries > https://www.google.com/search?q=site%3Amail.python.org > (inurl doesn't match mm3-migrated lists too) > > - Google Groups, if the list is set up there too > > - Gmail "list:python.org" queries > - This doesn't find messages that you didn't receive because you weren't > subscribed yet. > > - "from:list at mail.python.org" queries > - This doesn't find messages that you didn't receive because you weren't > subscribed yet. > > - Markmail "list:org.python.edu-sig" queries > https://markmail.org/search/?q=list%3Aorg.python > https://markmail.org/search/?q=list%3Aorg.python.edu-sig > > The Python mailing lists aren't yet all upgraded to mailman 3 (/mm3/ > URLs); so some lists have the classic mailman archive interface (where "by > thread" breaks at the month boundary, for example) and upgraded lists have > the new Django-based HyperKitty interface with e.g. search and a full > thread view. > > With mm3, it's also possible to reply to threads you didn't receive > because you weren't subscribed at the time. > > e.g. -- for example > i.e. -- that is > (List of acronyms OTOH/OTOMH) > > Reply-all is unnecessary, but often helpful. If you just click reply, it > may be addressed off-list to only the sender (and not the list email > address, which is what you want if you want the mailing list app to archive > for and relay the message to every subscriber). If that happens, you (or > the recipient) can forward the message to the list, but it'll be > unnecessarily quote-indented unless you just copy and paste (which can be > lossy with HTML quote indents inferred from plaintext-quoted lines that > start with '>'), so it pays to verify the to: field before you start > composing a message. > > Some old hands argue for like 72 character fixed width messages so that > when they're n-levels quote-indented, they still fit on an 80 character > terminal without rewrapping. Old-school email clients like mutt, for > example, can handle this; > though, on a phone, fixed width hard-broken lines > wrap like > this sometimes; which is not as easy to read. > > TL;DR (too long; didn't read) is an acronym of Reddit; though the standard > form of intro summary, body, conclusion summary is equally helpful for > long-form mailing list posts. Many email clients show the first part of the > first line of the message after the overly-long narrowly descriptive > subject line that doesn't actually describe the scope of the discussion > anymore. > > For Python features, the ultimate objective is to write or develop a PEP. > There is a PEP template here: > https://www.python.org/dev/peps/pep-0012/ > https://github.com/python/peps/blob/master/pep-0012.rst > > PEP 1 explains PEPs: > "PEP 1 -- PEP Purpose and Guidelines" > https://www.python.org/dev/peps/pep-0001/ > https://github.com/python/peps/blob/master/pep-0001.txt > > PEPs must be justified (as indicated by the Rationale heading in the PEP > template); so starting with a justification is a good approach to arguing > that you need the whole list's time before you spend your precious time > writing an actual PEP like actual contributors do sometimes (when they're > getting actual work done). > > Bug and issue discussions are for the issue tracker (Roundup), though > sometimes it's a really good idea to ask a list for help and feedback. > > Mailing lists don't support ReStructuredText, but docs, docstrings, and > PEPs do; so it's perfectly reasonable -- even advisable, though not at all > strictly necessary -- to format mailing list messages that would be helpful > for those purposes in reStructuredText from the start. By the time you've > added RST setext headings, you might as well be collaboratively drafting a > PEP. > > Though it doesn't happen nearly frequently enough, it's often really > helpful to update the docs with wisdom culled from the mailing lists (and > Q&A sites which have labels). > > "6. Helping with Documentation?" > https://devguide.python.org/docquality/ > > "7. Documenting Python?" > https://devguide.python.org/documenting/ > > The ultimate source of Python documentation (an often-cited strength of > Python as a language choice): > https://github.com/python/cpython/tree/master/Doc > > "16. Accepting Pull Requests?" > https://devguide.python.org/committing/ > > > > On Thursday, August 30, 2018, Wes Turner wrote: > >> >> >> On Thursday, August 30, 2018, kirby urner wrote: >>> >>> >>> Thanks. Yes, I'll add some links to the docs as you suggest. Great >>> feedback! >>> >> >> Glad to be helpful. >> >> I've trimmed out the text I'm not replying to and tried to use plaintext >> only in order to: make sure the thread stays below the 40K limit, and make >> it easy to reply inline without breaking HTML tags. >> >> >>> >>> Actually as part of my class I'm showing them edu-sig and other >>> python.org lists, so we were actually viewing this conversation. I'll >>> extend that to showing your corrections, as I want to demonstrate how the >>> Python community all teaches each other, is friendly and so on. >>> >> >> Code review with pull requests / merge requests and GitHub, Gerrit, >> GitLab etc is an essential skill. >> >> Src: https://github.com/jupyter/nbdime >> Docs: https://nbdime.readthedocs.io/ >> >> > nbdime provides tools for diffing and merging of Jupyter Notebooks. >> >> There are a number of real-time collaborative platforms for working with >> notebooks (CoCalc, Colab, ) >> >> https://hypothes.is highlights and annotations work on anything with a >> URL, are threaded, and support Markdown. >> >> >>> >>> Kirby >>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 13:30:55 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 13:30:55 -0400 Subject: [Edu-sig] REQ: HOWTO mailing lists resources In-Reply-To: References: Message-ID: On Thursday, August 30, 2018, Wes Turner wrote: > > Was: "Re: [Edu-sig] Python teacher notes, preparing for class..." > Here's a link to the thread this is forked from: https://mail.python.org/pipermail/edu-sig/2018-August/012007.html https://markmail.org/search/?q=list%3Aorg.python.edu-sig#query:list%3Aorg.python.edu-sig+page:1+mid:wbvjeinflkndz4ey+state:results > On Thursday, August 30, 2018, Wes Turner wrote: > >> Mailing list tips and tricks, PEPs, Write the Docs >> >> Since you asked, although this isn't in scope of the original subject >> line, and since I'd like to just continue this thread instead of breaking >> the thread by changing the subject line, and since this isn't technically >> OT (off-topic) in the interest of conversing toward an objective, here I've >> added a first-line summary of this message. I should probably change the >> subject and start a new thread. >> >> You can search mailing lists in a number of ways: >> >> - Google search with "site:mail.python.org" and/or "inurl:" queries >> https://www.google.com/search?q=site%3Amail.python.org >> (inurl doesn't match mm3-migrated lists too) >> >> - Google Groups, if the list is set up there too >> >> - Gmail "list:python.org" queries >> - This doesn't find messages that you didn't receive because you >> weren't subscribed yet. >> >> - "from:list at mail.python.org" queries >> - This doesn't find messages that you didn't receive because you >> weren't subscribed yet. >> >> - Markmail "list:org.python.edu-sig" queries >> https://markmail.org/search/?q=list%3Aorg.python >> https://markmail.org/search/?q=list%3Aorg.python.edu-sig >> >> The Python mailing lists aren't yet all upgraded to mailman 3 (/mm3/ >> URLs); so some lists have the classic mailman archive interface (where "by >> thread" breaks at the month boundary, for example) and upgraded lists have >> the new Django-based HyperKitty interface with e.g. search and a full >> thread view. >> >> With mm3, it's also possible to reply to threads you didn't receive >> because you weren't subscribed at the time. >> >> e.g. -- for example >> i.e. -- that is >> (List of acronyms OTOH/OTOMH) >> >> Reply-all is unnecessary, but often helpful. If you just click reply, it >> may be addressed off-list to only the sender (and not the list email >> address, which is what you want if you want the mailing list app to archive >> for and relay the message to every subscriber). If that happens, you (or >> the recipient) can forward the message to the list, but it'll be >> unnecessarily quote-indented unless you just copy and paste (which can be >> lossy with HTML quote indents inferred from plaintext-quoted lines that >> start with '>'), so it pays to verify the to: field before you start >> composing a message. >> >> Some old hands argue for like 72 character fixed width messages so that >> when they're n-levels quote-indented, they still fit on an 80 character >> terminal without rewrapping. Old-school email clients like mutt, for >> example, can handle this; >> though, on a phone, fixed width hard-broken lines >> wrap like >> this sometimes; which is not as easy to read. >> >> TL;DR (too long; didn't read) is an acronym of Reddit; though the >> standard form of intro summary, body, conclusion summary is equally helpful >> for long-form mailing list posts. Many email clients show the first part of >> the first line of the message after the overly-long narrowly descriptive >> subject line that doesn't actually describe the scope of the discussion >> anymore. >> >> For Python features, the ultimate objective is to write or develop a PEP. >> There is a PEP template here: >> https://www.python.org/dev/peps/pep-0012/ >> https://github.com/python/peps/blob/master/pep-0012.rst >> >> PEP 1 explains PEPs: >> "PEP 1 -- PEP Purpose and Guidelines" >> https://www.python.org/dev/peps/pep-0001/ >> https://github.com/python/peps/blob/master/pep-0001.txt >> >> PEPs must be justified (as indicated by the Rationale heading in the PEP >> template); so starting with a justification is a good approach to arguing >> that you need the whole list's time before you spend your precious time >> writing an actual PEP like actual contributors do sometimes (when they're >> getting actual work done). >> >> Bug and issue discussions are for the issue tracker (Roundup), though >> sometimes it's a really good idea to ask a list for help and feedback. >> >> Mailing lists don't support ReStructuredText, but docs, docstrings, and >> PEPs do; so it's perfectly reasonable -- even advisable, though not at all >> strictly necessary -- to format mailing list messages that would be helpful >> for those purposes in reStructuredText from the start. By the time you've >> added RST setext headings, you might as well be collaboratively drafting a >> PEP. >> >> Though it doesn't happen nearly frequently enough, it's often really >> helpful to update the docs with wisdom culled from the mailing lists (and >> Q&A sites which have labels). >> >> "6. Helping with Documentation?" >> https://devguide.python.org/docquality/ >> >> "7. Documenting Python?" >> https://devguide.python.org/documenting/ >> >> The ultimate source of Python documentation (an often-cited strength of >> Python as a language choice): >> https://github.com/python/cpython/tree/master/Doc >> >> "16. Accepting Pull Requests?" >> https://devguide.python.org/committing/ >> >> >> >> On Thursday, August 30, 2018, Wes Turner wrote: >> >>> >>> >>> On Thursday, August 30, 2018, kirby urner wrote: >>>> >>>> >>>> Thanks. Yes, I'll add some links to the docs as you suggest. Great >>>> feedback! >>>> >>> >>> Glad to be helpful. >>> >>> I've trimmed out the text I'm not replying to and tried to use plaintext >>> only in order to: make sure the thread stays below the 40K limit, and make >>> it easy to reply inline without breaking HTML tags. >>> >>> >>>> >>>> Actually as part of my class I'm showing them edu-sig and other >>>> python.org lists, so we were actually viewing this conversation. I'll >>>> extend that to showing your corrections, as I want to demonstrate how the >>>> Python community all teaches each other, is friendly and so on. >>>> >>> >>> Code review with pull requests / merge requests and GitHub, Gerrit, >>> GitLab etc is an essential skill. >>> >>> Src: https://github.com/jupyter/nbdime >>> Docs: https://nbdime.readthedocs.io/ >>> >>> > nbdime provides tools for diffing and merging of Jupyter Notebooks. >>> >>> There are a number of real-time collaborative platforms for working with >>> notebooks (CoCalc, Colab, ) >>> >>> https://hypothes.is highlights and annotations work on anything with a >>> URL, are threaded, and support Markdown. >>> >>> >>>> >>>> Kirby >>>> >>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 13:39:47 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 13:39:47 -0400 Subject: [Edu-sig] REQ: HOWTO mailing lists resources In-Reply-To: References: Message-ID: Devguide /search "mailing" "12. Following Python?s Development?" > mailing lists https://devguide.python.org/communication/#mailing-lists - List of development-relevant lists "2. Where to Get Help?" > Mailing Lists https://devguide.python.org/help/#mailing-lists - [x] python-ideas - [x] python-dev - [ ] tutor "Python Community Code of Conduct" https://www.python.org/psf/codeofconduct/ But where does it teach me TO mailing list? I think that's the real question here. On Thursday, August 30, 2018, Wes Turner wrote: > > > On Thursday, August 30, 2018, Wes Turner wrote: > >> >> Was: "Re: [Edu-sig] Python teacher notes, preparing for class..." >> > > Here's a link to the thread this is forked from: > https://mail.python.org/pipermail/edu-sig/2018-August/012007.html > > https://markmail.org/search/?q=list%3Aorg.python.edu-sig# > query:list%3Aorg.python.edu-sig+page:1+mid:wbvjeinflkndz4ey+state:results > > > >> On Thursday, August 30, 2018, Wes Turner wrote: >> >>> Mailing list tips and tricks, PEPs, Write the Docs >>> >>> Since you asked, although this isn't in scope of the original subject >>> line, and since I'd like to just continue this thread instead of breaking >>> the thread by changing the subject line, and since this isn't technically >>> OT (off-topic) in the interest of conversing toward an objective, here I've >>> added a first-line summary of this message. I should probably change the >>> subject and start a new thread. >>> >>> You can search mailing lists in a number of ways: >>> >>> - Google search with "site:mail.python.org" and/or "inurl:" queries >>> https://www.google.com/search?q=site%3Amail.python.org >>> (inurl doesn't match mm3-migrated lists too) >>> >>> - Google Groups, if the list is set up there too >>> >>> - Gmail "list:python.org" queries >>> - This doesn't find messages that you didn't receive because you >>> weren't subscribed yet. >>> >>> - "from:list at mail.python.org" queries >>> - This doesn't find messages that you didn't receive because you >>> weren't subscribed yet. >>> >>> - Markmail "list:org.python.edu-sig" queries >>> https://markmail.org/search/?q=list%3Aorg.python >>> https://markmail.org/search/?q=list%3Aorg.python.edu-sig >>> >>> The Python mailing lists aren't yet all upgraded to mailman 3 (/mm3/ >>> URLs); so some lists have the classic mailman archive interface (where "by >>> thread" breaks at the month boundary, for example) and upgraded lists have >>> the new Django-based HyperKitty interface with e.g. search and a full >>> thread view. >>> >>> With mm3, it's also possible to reply to threads you didn't receive >>> because you weren't subscribed at the time. >>> >>> e.g. -- for example >>> i.e. -- that is >>> (List of acronyms OTOH/OTOMH) >>> >>> Reply-all is unnecessary, but often helpful. If you just click reply, it >>> may be addressed off-list to only the sender (and not the list email >>> address, which is what you want if you want the mailing list app to archive >>> for and relay the message to every subscriber). If that happens, you (or >>> the recipient) can forward the message to the list, but it'll be >>> unnecessarily quote-indented unless you just copy and paste (which can be >>> lossy with HTML quote indents inferred from plaintext-quoted lines that >>> start with '>'), so it pays to verify the to: field before you start >>> composing a message. >>> >>> Some old hands argue for like 72 character fixed width messages so that >>> when they're n-levels quote-indented, they still fit on an 80 character >>> terminal without rewrapping. Old-school email clients like mutt, for >>> example, can handle this; >>> though, on a phone, fixed width hard-broken lines >>> wrap like >>> this sometimes; which is not as easy to read. >>> >>> TL;DR (too long; didn't read) is an acronym of Reddit; though the >>> standard form of intro summary, body, conclusion summary is equally helpful >>> for long-form mailing list posts. Many email clients show the first part of >>> the first line of the message after the overly-long narrowly descriptive >>> subject line that doesn't actually describe the scope of the discussion >>> anymore. >>> >>> For Python features, the ultimate objective is to write or develop a >>> PEP. There is a PEP template here: >>> https://www.python.org/dev/peps/pep-0012/ >>> https://github.com/python/peps/blob/master/pep-0012.rst >>> >>> PEP 1 explains PEPs: >>> "PEP 1 -- PEP Purpose and Guidelines" >>> https://www.python.org/dev/peps/pep-0001/ >>> https://github.com/python/peps/blob/master/pep-0001.txt >>> >>> PEPs must be justified (as indicated by the Rationale heading in the PEP >>> template); so starting with a justification is a good approach to arguing >>> that you need the whole list's time before you spend your precious time >>> writing an actual PEP like actual contributors do sometimes (when they're >>> getting actual work done). >>> >>> Bug and issue discussions are for the issue tracker (Roundup), though >>> sometimes it's a really good idea to ask a list for help and feedback. >>> >>> Mailing lists don't support ReStructuredText, but docs, docstrings, and >>> PEPs do; so it's perfectly reasonable -- even advisable, though not at all >>> strictly necessary -- to format mailing list messages that would be helpful >>> for those purposes in reStructuredText from the start. By the time you've >>> added RST setext headings, you might as well be collaboratively drafting a >>> PEP. >>> >>> Though it doesn't happen nearly frequently enough, it's often really >>> helpful to update the docs with wisdom culled from the mailing lists (and >>> Q&A sites which have labels). >>> >>> "6. Helping with Documentation?" >>> https://devguide.python.org/docquality/ >>> >>> "7. Documenting Python?" >>> https://devguide.python.org/documenting/ >>> >>> The ultimate source of Python documentation (an often-cited strength of >>> Python as a language choice): >>> https://github.com/python/cpython/tree/master/Doc >>> >>> "16. Accepting Pull Requests?" >>> https://devguide.python.org/committing/ >>> >>> >>> >>> On Thursday, August 30, 2018, Wes Turner wrote: >>> >>>> >>>> >>>> On Thursday, August 30, 2018, kirby urner >>>> wrote: >>>>> >>>>> >>>>> Thanks. Yes, I'll add some links to the docs as you suggest. Great >>>>> feedback! >>>>> >>>> >>>> Glad to be helpful. >>>> >>>> I've trimmed out the text I'm not replying to and tried to use >>>> plaintext only in order to: make sure the thread stays below the 40K limit, >>>> and make it easy to reply inline without breaking HTML tags. >>>> >>>> >>>>> >>>>> Actually as part of my class I'm showing them edu-sig and other >>>>> python.org lists, so we were actually viewing this conversation. >>>>> I'll extend that to showing your corrections, as I want to demonstrate how >>>>> the Python community all teaches each other, is friendly and so on. >>>>> >>>> >>>> Code review with pull requests / merge requests and GitHub, Gerrit, >>>> GitLab etc is an essential skill. >>>> >>>> Src: https://github.com/jupyter/nbdime >>>> Docs: https://nbdime.readthedocs.io/ >>>> >>>> > nbdime provides tools for diffing and merging of Jupyter Notebooks. >>>> >>>> There are a number of real-time collaborative platforms for working >>>> with notebooks (CoCalc, Colab, ) >>>> >>>> https://hypothes.is highlights and annotations work on anything with a >>>> URL, are threaded, and support Markdown. >>>> >>>> >>>>> >>>>> Kirby >>>>> >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Thu Aug 30 17:00:33 2018 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 30 Aug 2018 14:00:33 -0700 Subject: [Edu-sig] REQ: HOWTO mailing lists resources In-Reply-To: References: Message-ID: > But where does it teach me TO mailing list? > I think that's the real question here. > > Just to clarify what you're asking, here's a use case: I was a volunteer Clerk of IT for a religious group that conducts business on-line but mostly by stowing information at a website, with all the headaches of managing logins to control who gets to post where. Drupal. My recommendation was we imitate Python.org a lot more by setting up mailman listservs with varying degrees of visibility to the public (some are members only and so on). I set up a Google Group by was of demonstration and ran it for a couple years. It's still out there. The advantage of mail-lists are not only are they searchable but they maintain the context and threads of conversation, great for organizational memory. However, for historical reason, our clerks prefer to use conference calls in real time, with someone taking minutes for the archives. A lose a lot that way. There's lots more listserv use since my tenure ended, by various interest groups, but no centralized place at the regional level for these listservs to go, which is probably just fine (we're pretty informal), however I never did find how I could get mailman servers installed at our ISP, back when I was filing reports and proposals. Our ISP only offered ancient majordomo as a listserv option, with precious little information on how to set one up. How does one set up a bunch of domain-name specific mail servers ala Python's mm3, is that in the ballpark of what you're asking? Kirby > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Thu Aug 30 18:16:20 2018 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 30 Aug 2018 18:16:20 -0400 Subject: [Edu-sig] REQ: HOWTO mailing lists resources In-Reply-To: References: Message-ID: Mailman list admin resources, scope clarification Here are the mailman 3 docs: http://docs.mailman3.org/en/latest/ IDK how much of the mailman 2 docs still apply? https://www.gnu.org/software/mailman/docs.html Here's the first result for search("docker mailman") https://github.com/maxking/docker-mailman And here are the "Mailman Suite Installation" > "Mailman 3 in Docker" docs: http://docs.mailman3.org/en/latest/prodsetup.html#mailman-3-in-docker TBH, securing and upgrading mailing lists is beyond the competencies of most volunteer-run organizations; which is one reason that I'd recommend Google Groups or similar for most organisations. In my experience, ISPs offer GUI installers for various app on shared hosting platforms, but upgrades aren't managed in the same GUI; which requires a volunteer to keep the apps upgraded with at least security updates. A VPS and/or container hosting doesn't make upgrading a one-click process; but sets the bar to where the list admin needs to be competent with SSH and ideally a configuration management system so that when they hand off admin responsibilities that organizational knowledge is preserved. Docker containers are often not secure by default; but can be extended FROM with commands in the Dockerfile, a shell script, or a configuration management tool which can apply a secure policy baseline. I haven't reviewed any of the containers linked here. Moreso interested to learn of new resources which teach how to contribute to an existing mailing list. Google Groups seems much easier for onboarding non-technical people without needing to forward everything. As an assumed public context, it may be fair to say that mailing lists elicit more helpful communications than non-archived email. On Thursday, August 30, 2018, kirby urner wrote: > > >> But where does it teach me TO mailing list? >> I think that's the real question here. >> >> > Just to clarify what you're asking, here's a use case: > > I was a volunteer Clerk of IT for a religious group that conducts business > on-line but mostly by stowing information at a website, with all the > headaches of managing logins to control who gets to post where. Drupal. > > My recommendation was we imitate Python.org a lot more by setting up > mailman listservs with varying degrees of visibility to the public (some > are members only and so on). I set up a Google Group by was of > demonstration and ran it for a couple years. It's still out there. > > The advantage of mail-lists are not only are they searchable but they > maintain the context and threads of conversation, great for organizational > memory. However, for historical reason, our clerks prefer to use conference > calls in real time, with someone taking minutes for the archives. A lose a > lot that way. > > There's lots more listserv use since my tenure ended, by various interest > groups, but no centralized place at the regional level for these listservs > to go, which is probably just fine (we're pretty informal), however I never > did find how I could get mailman servers installed at our ISP, back when I > was filing reports and proposals. > > Our ISP only offered ancient majordomo as a listserv option, with precious > little information on how to set one up. > > How does one set up a bunch of domain-name specific mail servers ala > Python's mm3, is that in the ballpark of what you're asking? > > Kirby > >> -------------- next part -------------- An HTML attachment was scrubbed... URL: