From kirby.urner at gmail.com Mon Nov 2 04:55:42 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 1 Nov 2009 19:55:42 -0800 Subject: [Edu-sig] more card play Message-ID: I'm becoming more enamored of the idea of using playing cards as a standard feature in my Python pedagogy and andragogy (means teaching adults). Not only do we have the standard deck, but also Tarot which could get us more into text files, string substitution (string.Template) and so forth. Cards have all the elements Mathematically, a Deck suggests the difference between Cardinality (yes, a silly pun) and Ordinality. You might imagine a deck in which you can't decipher the cards, don't know their "face value", and so have no clear idea of their ranking (ordinality). On the other hand, you know which cards are the same and which are different across multiple decks (le'ts just say), which is the meaning of "cardinality" (difference without any implied ordering). Midhat Gazele dwells on this difference some in his book 'Number'. You might have a set of objects, say stones or wasp specimens, and a way of cataloging them that doesn't implement > or < or even ==. There is only the Python "is" and "is not" for determining of two objects have the same identity or not. License plates on cars, proper names, have this purpose of distinguishing. However, very quickly just about any set beyond a certain size needs an ordering, perhaps simply alphabetical, so that one might flip through a lookup table in a hurry and get to the desired object. People used to use ledgers, thick books, for such cataloging. This is the beginning of data structuring or data structures. The idea of "ordering" (ordinality) is very closely associated with that of cardinality. Anyway, over on Pyfora I was noticing a member suggesting reversing a string might be best accomplished by thestring[::-1], i.e. extended slicing with from the end to the beginning step with a step of -1. However PEP 322 suggests this will be inefficient compared a a built in function introduced in 2.4: reversed. According to the PEP, all reversed needs is for the consumed object to support __getitem__ and __len__. If those two are present, the function will do the rest, and return an iterator object in which the contents of a sequence are iterated over in reverse order. >>> a = 'the rain in spain stays mainly in the plain' >>> ''.join(reversed(a)) 'nialp eht ni ylniam syats niaps ni niar eht' So for our Deck to be reversible by means of this built in function, the only methods we need to implement are these two, __getitem__ and __len__. I do this below, plus make shuffling the deck upon instantiation an option, not de rigueur (not mandatory). This makes it easier to see what reverse order is like. Note that the returned iterable is not itself a Deck, nor is it subscriptable, as the whole point of an iterable is it returns its contents "just in time" as you iterate over it. The cards are not "already present" in reversed order, are simply returned in reverse order. Of course you can force the iterable to dump all its contents by coercing it into a list. I do this as a part of the clone_deck method. Playing Game of War with clone decks, one the reverse of the other, results in a draw if always dealing from the top (now the default, yet still optional). The code below is just my Game of War again, with a few wrinkles. I've upgraded all string printing to use the print(thestring.format(args)) approach, versus the old percent sign string substitution codes. Other small improvements. >>> from sillygame import Deck >>> d = Deck(10) >>> newd = d.clone_deck() >>> newd[0] is d[0] True >>> id(newd[0]) 22884944 >>> id(d[0]) 22884944 >>> d.shuffle() >>> str(d) "['7 of Diamonds', 'Jack of Spades', 'Queen of Clubs', 'King of Spades', '5 of Clubs', '3 of Spades', '6 of Hearts', 'Ace of Clubs', '2 of Hearts', '9 of Spades']" >>> str(newd) "['2 of Hearts', 'Queen of Clubs', '6 of Hearts', '9 of Spades', '5 of Clubs', '7 of Diamonds', 'Ace of Clubs', '3 of Spades', 'Jack of Spades', 'King of Spades']" >>> d[0] Card(Diamonds, ('7', 7)) >>> newd[5] Card(Diamonds, ('7', 7)) >>> d[0] == newd[5] True >>> d[0] is newd[5] True Kirby For further reading: http://www.python.org/dev/peps/pep-0322/ from random import shuffle, randint thesuits = ['Hearts','Diamonds','Clubs','Spades'] theranks = ['Ace'] + [str(v) for v in range(2,11)] + ['Jack','Queen','King'] rank_values = list(zip(theranks, range(1,14))) class Card: def __init__(self, suit, rank_value ): self.suit = suit self.rank = rank_value[0] self.value = rank_value[1] def __lt__(self, other): if self.value < other.value: return True else: return False def __gt__(self, other): if self.value > other.value: return True else: return False def __eq__(self, other): if self.value == other.value: return True else: return False def __repr__(self): return "Card({0}, {1})".format(self.suit, (self.rank, self.value)) def __str__(self): return "{0} of {1}".format(self.rank, self.suit) class Deck: def __init__(self, numcards = 52, shuffle = True): # build a complete deck then slice try: assert 0 < numcards <= 52 except AssertionError: print("Defaulting to 52 cards") numcards = 52 self.numcards = numcards self.cards = [Card(suit, rank_value) for suit in thesuits for rank_value in rank_values ] if shuffle: self.shuffle() self.cards = self.cards[ : self.numcards] def __getitem__(self, index): return self.cards[index] def shuffle(self): shuffle(self.cards) def spit_card(self, top=True): try: assert self.numcards > 0 except AssertionError: raise Exception("Out of cards!") if top: some_card = self.cards.pop(0) else: some_card = self.cards.pop( randint( 0, self.numcards - 1 )) self.numcards = len(self.cards) return some_card def clone_deck(self, reverse=False): newdeck = Deck(numcards=1) newdeck.numcards = self.numcards if reverse: newdeck.cards = list(reversed(self.cards)) else: newdeck.cards = self.cards[:] return newdeck def __repr__(self): return "Deck({0})".format(self.numcards) def __str__(self): return str([str(card) for card in self.cards]) def __len__(self): return len(self.cards) def test(): thedeck = Deck() print (str(thedeck)) def game_of_war(): deckA = Deck(10) # deckB = Deck(10) deckB = deckA.clone_deck(reverse=True) # play a reversed clone PlayerA_score = 0 PlayerB_score = 0 try: assert deckA.numcards == deckB.numcards except AssertionError: raise Exception("Decks don't have same number of cards") for i in range(deckA.numcards): playerA_card = deckA.spit_card(top=False) # deal from anywhere playerB_card = deckB.spit_card(top=False) if playerA_card > playerB_card: PlayerA_score += 1 print("A's {0} beats B's {1}".format(playerA_card, playerB_card)) if playerA_card < playerB_card: PlayerB_score += 1 print("B's {0} beats A's {1}".format(playerB_card, playerA_card)) if playerA_card == playerB_card: print("B's {0} matches A's {1}".format(playerB_card, playerA_card)) if PlayerA_score > PlayerB_score: print("Game Over: A wins") if PlayerA_score < PlayerB_score: print("Game Over: B wins") if PlayerA_score == PlayerB_score: print("Game Over: it's a draw!") if __name__ == '__main__': # test() game_of_war() From echerlin at gmail.com Tue Nov 3 05:27:35 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Mon, 2 Nov 2009 20:27:35 -0800 Subject: [Edu-sig] more card play In-Reply-To: References: Message-ID: Cards: You are right on the merits for combinatory math, but you will run into strong cultural aversions. Reverse string in place with new iterator: There is a great deal more of this. In the 1980s Hewlett-Packard built an APL system around such transformations in place and lazy evaluation rules, including matrix/table transpose, take, drop, catenate, laminate, and a number of other transformations and combinations. I can probably dig out Harry Saal's paper on the subject. Indeed, that and several others. http://portal.acm.org/citation.cfm?id=801218&dl=GUIDE&coll=GUIDE&CFID=59626041&CFTOKEN=28525913 An APL compiler for the UNIX timesharing system http://portal.acm.org/citation.cfm?id=586034&dl=GUIDE&coll=GUIDE&CFID=59626133&CFTOKEN=77609109 Considerations in the design of a compiler for APL http://portal.acm.org/citation.cfm?id=804441 A software high performance APL interpreter On Sun, Nov 1, 2009 at 19:55, kirby urner wrote: > I'm becoming more enamored of the idea of using playing cards as a > standard feature in my Python pedagogy and andragogy (means teaching > adults). ?Not only do we have the standard deck, but also Tarot which > could get us more into text files, string substitution > (string.Template) and so forth. > > Cards have all the elements > > Mathematically, a Deck suggests the difference between Cardinality > (yes, a silly pun) and Ordinality. ?You might imagine a deck in which > you can't decipher the cards, don't know their "face value", and so > have no clear idea of their ranking (ordinality). > > On the other hand, you know which cards are the same and which are > different across multiple decks (le'ts just say), which is the meaning > of "cardinality" (difference without any implied ordering). > > Midhat Gazele dwells on this difference some in his book 'Number'. > You might have a set of objects, say stones or wasp specimens, and a > way of cataloging them that doesn't implement > or < or even ==. > There is only the Python "is" and "is not" for determining of two > objects have the same identity or not. ?License plates on cars, proper > names, have this purpose of distinguishing. > > However, very quickly just about any set beyond a certain size needs > an ordering, perhaps simply alphabetical, so that one might flip > through a lookup table in a hurry and get to the desired object. > People used to use ledgers, thick books, for such cataloging. > > This is the beginning of data structuring or data structures. ?The > idea of "ordering" (ordinality) is very closely associated with that > of cardinality. > > Anyway, over on Pyfora I was noticing a member suggesting reversing a > string might be best accomplished by thestring[::-1], i.e. extended > slicing with from the end to the beginning step with a step of -1. > However PEP 322 suggests this will be inefficient compared a a built > in function introduced in 2.4: ?reversed. > > According to the PEP, all reversed needs is for the consumed object to > support __getitem__ and __len__. ?If those two are present, the > function will do the rest, and return an iterator object in which the > contents of a sequence are iterated over in reverse order. > >>>> a = 'the rain in spain stays mainly in the plain' >>>> ''.join(reversed(a)) > 'nialp eht ni ylniam syats niaps ni niar eht' > > So for our Deck to be reversible by means of this built in function, > the only methods we need to implement are these two, __getitem__ and > __len__. ?I do this below, plus make shuffling the deck upon > instantiation an option, not de rigueur (not mandatory). ?This makes > it easier to see what reverse order is like. > > Note that the returned iterable is not itself a Deck, nor is it > subscriptable, as the whole point of an iterable is it returns its > contents "just in time" as you iterate over it. ?The cards are not > "already present" in reversed order, are simply returned in reverse > order. > > Of course you can force the iterable to dump all its contents by > coercing it into a list. ?I do this as a part of the clone_deck > method. ?Playing Game of War with clone decks, one the reverse of the > other, results in a draw if always dealing from the top (now the > default, yet still optional). > > The code below is just my Game of War again, with a few wrinkles. > I've upgraded all string printing to use the > print(thestring.format(args)) approach, versus the old percent sign > string substitution codes. ?Other small improvements. > >>>> from sillygame import Deck >>>> d = Deck(10) >>>> newd = d.clone_deck() >>>> newd[0] is d[0] > True >>>> id(newd[0]) > 22884944 >>>> id(d[0]) > 22884944 >>>> d.shuffle() >>>> str(d) > "['7 of Diamonds', 'Jack of Spades', 'Queen of Clubs', 'King of > Spades', '5 of Clubs', '3 of Spades', '6 of Hearts', 'Ace of Clubs', > '2 of Hearts', '9 of Spades']" >>>> str(newd) > "['2 of Hearts', 'Queen of Clubs', '6 of Hearts', '9 of Spades', '5 of > Clubs', '7 of Diamonds', 'Ace of Clubs', '3 of Spades', 'Jack of > Spades', 'King of Spades']" >>>> d[0] > Card(Diamonds, ('7', 7)) >>>> newd[5] > Card(Diamonds, ('7', 7)) >>>> d[0] == newd[5] > True >>>> d[0] is newd[5] > True > > Kirby > > For further reading: > http://www.python.org/dev/peps/pep-0322/ > > > from random import shuffle, randint > > thesuits = ['Hearts','Diamonds','Clubs','Spades'] > theranks = ['Ace'] + [str(v) for v in range(2,11)] + ['Jack','Queen','King'] > rank_values = list(zip(theranks, range(1,14))) > > class Card: > > ? ?def __init__(self, suit, rank_value ): > ? ? ? ?self.suit = suit > ? ? ? ?self.rank = rank_value[0] > ? ? ? ?self.value = rank_value[1] > > ? ?def __lt__(self, other): > ? ? ? ?if self.value < other.value: > ? ? ? ? ? ?return True > ? ? ? ?else: > ? ? ? ? ? ?return False > > ? ?def __gt__(self, other): > ? ? ? ?if self.value > other.value: > ? ? ? ? ? ?return True > ? ? ? ?else: > ? ? ? ? ? ?return False > > ? ?def __eq__(self, other): > ? ? ? ?if self.value == other.value: > ? ? ? ? ? ?return True > ? ? ? ?else: > ? ? ? ? ? ?return False > > ? ?def __repr__(self): > ? ? ? ?return "Card({0}, {1})".format(self.suit, (self.rank, self.value)) > > ? ?def __str__(self): > ? ? ? ?return "{0} of {1}".format(self.rank, self.suit) > > class Deck: > > ? ?def __init__(self, numcards = 52, shuffle = True): > ? ? ? ?# build a complete deck then slice > ? ? ? ?try: > ? ? ? ? ? ?assert 0 < numcards <= 52 > ? ? ? ?except AssertionError: > ? ? ? ? ? ?print("Defaulting to 52 cards") > ? ? ? ? ? ?numcards = 52 > > ? ? ? ?self.numcards = numcards > ? ? ? ?self.cards = [Card(suit, rank_value) > ? ? ? ? ? ? ? ? ? ? ?for suit in thesuits > ? ? ? ? ? ? ? ? ? ? ?for rank_value in rank_values > ? ? ? ? ? ? ? ? ? ? ? ] > ? ? ? ?if shuffle: self.shuffle() > ? ? ? ?self.cards = self.cards[ : self.numcards] > > ? ?def __getitem__(self, index): > ? ? ? ?return self.cards[index] > > ? ?def shuffle(self): > ? ? ? ?shuffle(self.cards) > > ? ?def spit_card(self, top=True): > ? ? ? ?try: > ? ? ? ? ? ?assert self.numcards > 0 > ? ? ? ?except AssertionError: > ? ? ? ? ? ?raise Exception("Out of cards!") > > ? ? ? ?if top: > ? ? ? ? ? ?some_card = self.cards.pop(0) > ? ? ? ?else: > ? ? ? ? ? ?some_card = self.cards.pop( randint( 0, self.numcards - 1 )) > > ? ? ? ?self.numcards = len(self.cards) > ? ? ? ?return some_card > > ? ?def clone_deck(self, reverse=False): > ? ? ? ?newdeck = Deck(numcards=1) > ? ? ? ?newdeck.numcards = self.numcards > ? ? ? ?if reverse: > ? ? ? ? ? ?newdeck.cards = list(reversed(self.cards)) > ? ? ? ?else: > ? ? ? ? ? ?newdeck.cards = self.cards[:] > ? ? ? ?return newdeck > > ? ?def __repr__(self): > ? ? ? ?return "Deck({0})".format(self.numcards) > > ? ?def __str__(self): > ? ? ? ?return str([str(card) for card in self.cards]) > > ? ?def __len__(self): > ? ? ? ?return len(self.cards) > > def test(): > ? ?thedeck = Deck() > ? ?print (str(thedeck)) > > def game_of_war(): > ? ?deckA = Deck(10) > ? ?# deckB = Deck(10) > ? ?deckB = deckA.clone_deck(reverse=True) # play a reversed clone > ? ?PlayerA_score = 0 > ? ?PlayerB_score = 0 > > ? ?try: > ? ? ? ?assert deckA.numcards == deckB.numcards > ? ?except AssertionError: > ? ? ? ?raise Exception("Decks don't have same number of cards") > > ? ?for i in range(deckA.numcards): > ? ? ? ?playerA_card = deckA.spit_card(top=False) # deal from anywhere > ? ? ? ?playerB_card = deckB.spit_card(top=False) > > ? ? ? ?if playerA_card > playerB_card: > ? ? ? ? ? ?PlayerA_score += 1 > ? ? ? ? ? ?print("A's {0} beats B's {1}".format(playerA_card, playerB_card)) > ? ? ? ?if playerA_card < playerB_card: > ? ? ? ? ? ?PlayerB_score += 1 > ? ? ? ? ? ?print("B's {0} beats A's {1}".format(playerB_card, playerA_card)) > ? ? ? ?if playerA_card == playerB_card: > ? ? ? ? ? ?print("B's {0} matches A's {1}".format(playerB_card, playerA_card)) > > ? ?if PlayerA_score > PlayerB_score: > ? ? ? ?print("Game Over: ?A wins") > ? ?if PlayerA_score < PlayerB_score: > ? ? ? ?print("Game Over: ?B wins") > ? ?if PlayerA_score == PlayerB_score: > ? ? ? ?print("Game Over: ?it's a draw!") > > if __name__ == '__main__': > ? ?# test() > ? ?game_of_war() > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- Edward Mokurai (??/???????????????/????????????? ?) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/ From lac at openend.se Tue Nov 3 07:20:08 2009 From: lac at openend.se (Laura Creighton) Date: Tue, 03 Nov 2009 07:20:08 +0100 Subject: [Edu-sig] more card play In-Reply-To: Message from Edward Cherlin of "Mon, 02 Nov 2009 20:27:35 PST." References: Message-ID: <200911030620.nA36K8KV011694@theraft.openend.se> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >Cards: You are right on the merits for combinatory math, but you will >run into strong cultural aversions. Why? Especially when _dice_ seem to be the preferred way to teach this stuff? (Or is this only here?) Laura From kirby.urner at gmail.com Tue Nov 3 17:04:06 2009 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 3 Nov 2009 08:04:06 -0800 Subject: [Edu-sig] more card play In-Reply-To: References: Message-ID: On Mon, Nov 2, 2009 at 8:27 PM, Edward Cherlin wrote: > Cards: You are right on the merits for combinatory math, but you will > run into strong cultural aversions. > > Yes, anticipated. However, the Python subculture has done the necessary work to publish a Diversity Statement, which has an antibiotic effect against puritanical bigots (assuming you mean some people have moral hangups about gambling?). The State of Oregon funds its education system with inputs from video poker machines whereas the various tribal sovereignties in this area earn a living from their resort casinos. So it's integral to our way of life to teach "casino math" (we don't necessarily call it "combinatorics" at first, as that just scares people away, makes 'em think we're only into academic applications whereas of course nothing could be further from the truth). > Reverse string in place with new iterator: There is a great deal more > of this. In the 1980s Hewlett-Packard built an APL system around such > Yes, the idea of an iterable goes hand-in-hand with the Pythonic notion of a generator. Both support the "next" API, a keyword you might assign another name to if you like. I've recommended "kick" as in "kick the can down the road", with each use generating a next term in some famous (or not famous) sequence: >>> def cubocta(): n = 0 while True: # infinite loop OK! if n == 0: yield 1 else: yield 10 * n * n + 2 n += 1 >>> kick = next >>> can = cubocta() >>> kick(can) 1 >>> kick(can) 12 >>> kick(can) 42 >>> kick(can) 92 >>> kick(can) 162 >>> See: http://www.research.att.com/~njas/sequences/A005901 (note link to virus morphology) In the example below, I'm showing how "nexting" through an iterable is a lazy evaluation affair in that I'm changing the first member of the list *after* assigning a name to the iterator. By the time the iterator reaches the first member of the list, the value has changed from when it started. >>> some_list = [1,2,3,4,5] >>> iterable = reversed(some_list) >>> next(iterable) 5 >>> some_list[0] = "Joker!" >>> next(iterable) 4 >>> next(iterable) 3 >>> next(iterable) 2 >>> next(iterable) 'Joker!' Notice that two iterators have their separate journeys through the target object i.e. advancing one of them doesn't have any affect on the other: >>> some_list = [1,2,3,4,5] >>> iterableA = reversed(some_list) >>> iterableB = reversed(some_list) >>> next(iterableA) 5 >>> next(iterableA) 4 >>> next(iterableA) 3 >>> next(iterableA) 2 >>> next(iterableA) 1 >>> some_list[0] = "Joker!" >>> next(iterableB) 5 >>> next(iterableB) 4 >>> next(iterableB) 3 >>> next(iterableB) 2 >>> next(iterableB) 'Joker!' >>> Of course strings are immutable so you can't play quite the same trick, of messing with the target string before the reversed iterator reaches the beginning. In the case of my Deck and Card classes, the cloned deck had its own complete list in reversed order (an option), however the underlying Card objects were identical across lists, as I was showing by using the "is" operator. > transformations in place and lazy evaluation rules, including > matrix/table transpose, take, drop, catenate, laminate, and a number > of other transformations and combinations. I can probably dig out > Harry Saal's paper on the subject. Indeed, that and several others. > > > http://portal.acm.org/citation.cfm?id=801218&dl=GUIDE&coll=GUIDE&CFID=59626041&CFTOKEN=28525913 > An APL compiler for the UNIX timesharing system > > > http://portal.acm.org/citation.cfm?id=586034&dl=GUIDE&coll=GUIDE&CFID=59626133&CFTOKEN=77609109 > Considerations in the design of a compiler for APL > > http://portal.acm.org/citation.cfm?id=804441 > A software high performance APL interpreter > > I've always thought Python had a lot in common with APL, especially in terms of how it organizes a lot of highly orthogonal built-in primitives to inter-operate in logically consistent ways. I was privileged to collaborate a little with Kenneth Iverson on my 'Jiving in J' paper. To this day, I recommend J as a second language, as I think a competent CS0/CS1 would never feature just a single programming language (too narrowing), even if it makes one primary and the other secondary. A more traditional option is to feature one agile and one system language, e.g. Python and C, or Jython and Java. Kirby 4D > On Sun, Nov 1, 2009 at 19:55, kirby urner wrote: > > I'm becoming more enamored of the idea of using playing cards as a > > standard feature in my Python pedagogy and andragogy (means teaching > > adults). Not only do we have the standard deck, but also Tarot which > > could get us more into text files, string substitution > > (string.Template) and so forth. > > > > Cards have all the elements > ... > -- > Edward Mokurai (??/???????????????/????????????? ?) Cherlin > Silent Thunder is my name, and Children are my nation. > The Cosmos is my dwelling place, the Truth my destination. > http://www.earthtreasury.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From travis at vaught.net Tue Nov 3 17:48:58 2009 From: travis at vaught.net (Travis Vaught) Date: Tue, 3 Nov 2009 10:48:58 -0600 Subject: [Edu-sig] more card play In-Reply-To: References: Message-ID: <69039402-3B3A-4033-B9D5-ED80FFBFA251@vaught.net> On Nov 3, 2009, at 10:04 AM, kirby urner wrote: > On Mon, Nov 2, 2009 at 8:27 PM, Edward Cherlin > wrote: > Cards: You are right on the merits for combinatory math, but you will > run into strong cultural aversions. > > > Yes, anticipated. However, the Python subculture has done the > necessary work to publish a Diversity Statement, which has an > antibiotic effect against puritanical bigots (assuming you mean some > people have moral hangups about gambling?). I was rather assuming that the hangups would be about the more cringe- worthy aspects of tarot cards. The fact that people of faith may not get a good feeling about using a tool whose logo is a snake, introductory examples are using tarot cards, and whose theme music might be construed to be the rather irreverent creations of the Monty Python players, says less about the presence of puritanical bigotry and more about a complete lack of sophistication in marketing. I love a good example (and a good joke) as much as the next guy, but let's not lean on a diversity statement as an excuse to not attend to some basic tenets of marketing. If we had examples that incorporated the various "Stations of the Cross" it would likewise go over like a lead balloon. Introducing Python as a unifying tool in early education (by some definition of early) calls for a particular discretion in the choice of examples. Best, Travis -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Tue Nov 3 18:37:53 2009 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 3 Nov 2009 09:37:53 -0800 Subject: [Edu-sig] more card play In-Reply-To: <200911030620.nA36K8KV011694@theraft.openend.se> References: <200911030620.nA36K8KV011694@theraft.openend.se> Message-ID: On Mon, Nov 2, 2009 at 10:20 PM, Laura Creighton wrote: > In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>Cards: You are right on the merits for combinatory math, but you will >>run into strong cultural aversions. > > Why? ?Especially when _dice_ seem to be the preferred way to teach > this stuff? ?(Or is this only here?) > > Laura > Yeah, dice are the perfect math object in that they unify polyhedra and randomness (chaotic sequences) in a single artifact. That we have all the Platonic solids as dice these days is a cool development, suitable for translating into software.[0] from random import choice class Die: def __init__(self, number_of_sides = 6): self.facets = number_of_sides def roll(self): return choice(range(1, self.facets+ 1)) # eliminate 0 def __str__(self): return "{0} sided die".format(self.facets) def __repr__(self): return "Die({0})".format(self.facets) >>> thedie = Die(20) >>> thedie.roll() 14 >>> thedie.roll() 10 >>> thedie.roll() 7 >>> thedie Die(20) >>> str(thedie) '20 sided die' Here's a more complicated version (not by me) that rolls a sum as triggered by the __rmul__ rib. http://code.activestate.com/recipes/573437/ Of course it might make a lot more sense to write this as a two line generator, could then go roll = next to assign the next keyword another name. >>> from random import randint >>> def die(sides): while True: yield randint(1, sides) >>> icosa_die = die(20) >>> roll = next >>> roll(icosa_die) 10 >>> roll(icosa_die) 18 >>> roll(icosa_die) 8 >>> roll(icosa_die) 4 Speaking of Open Education standards, the Boston Globe is finally getting into print what many have seen as the writing on the wall: mass published wood pulp textbooks are taking a back seat to digital distribution mechanisms.[1] USG stimulus money is helping to fuel the transition, ironically by funding proprietary initiatives versus creating more FOSS of by and for the people. Also ironic is the fact that use US military is a leading proponent of FOSS [2] given its already socialized mindset (i.e. its assets are communally owned and operated).[3] The White House recently switched to Drupal in a symbolic gesture. Kirby [0] http://www.dice.co.uk/poly_re.htm [1] http://mybizmo.blogspot.com/2009/11/not-following-detroit.html [2] http://controlroom.blogspot.com/2009/10/open-source-dot-gov.html [3] http://controlroom.blogspot.com/2009/11/socialist-victory-satire.html From kirby.urner at gmail.com Tue Nov 3 19:29:56 2009 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 3 Nov 2009 10:29:56 -0800 Subject: [Edu-sig] more card play In-Reply-To: <69039402-3B3A-4033-B9D5-ED80FFBFA251@vaught.net> References: <69039402-3B3A-4033-B9D5-ED80FFBFA251@vaught.net> Message-ID: On Tue, Nov 3, 2009 at 8:48 AM, Travis Vaught wrote: > > On Nov 3, 2009, at 10:04 AM, kirby urner wrote: > > On Mon, Nov 2, 2009 at 8:27 PM, Edward Cherlin wrote: >> >> Cards: You are right on the merits for combinatory math, but you will >> run into strong cultural aversions. >> > > Yes, anticipated.? However, the Python subculture has done the necessary > work to publish a Diversity Statement, which has an antibiotic effect > against puritanical bigots (assuming you mean some people have moral hangups > about gambling?). > > I was rather assuming that the hangups would be about the more cringe-worthy > aspects of tarot cards. ?The fact that people of faith may not get a good > feeling about using a tool whose logo is a snake, introductory examples are > using tarot cards, and whose theme music might be construed to be the rather > irreverent creations of the Monty Python players, says less about the > presence of puritanical bigotry and more about a complete lack of > sophistication in marketing. Thanks for clarifying Travis! I'd completely forgotten that I'd mentioned the Tarot Deck as an excuse to introduce more long-winded string templating, ala Madlibs and Grossology (a recurring theme in my curriculum writing). By way of background, a lot of younger kids especially enjoy scatological material as it's something they can relate to, makes the topic more user-friendly. There's a genre of Madlib that focuses on this theme (you know what a Madlib is right?). http://seattletimes.nwsource.com/html/localnews/2009256554_grossology24m.html http://tampabay.momslikeme.com/members/JournalActions.aspx?g=247205&m=388979 Probably the earliest introduction of scatology is in the first Snake method, where you have both 'eat' and 'poop' methods, a way of introducing the list data structure (as the stomach) and using it as a queue (first in first out, ala FIFO). I've had good experiences in my classroom of first introducing string.Template using Madlibs of an entertaining nature, then switching to more auster string.Templates having to do with generating scene description language and/or VRML, for getting polyhedra either ray-traced or brought into a browser plug-in such as Cortona's. >From my slides: http://www.4dsolutions.net/presentations/connectingthedots.pdf (see slides 11, 23-27 especially) > I love a good example (and a good joke) as much as the next guy, but let's > not lean on a diversity statement as an excuse to not attend to some basic > tenets of marketing. ?If we had examples that incorporated the various > "Stations of the Cross" it would likewise go over like a lead balloon. > Introducing Python as a unifying tool in early education (by some definition > of early) calls for a particular discretion in the choice of examples. > Best, > Travis > Yes, I understand better what you're driving at. However, the death of the mass-published text book as a primary curriculum distribution mechanism means we're able to niche market, not mass market. I used to work at McGraw-HIll and remember how editors would bend over backwards to develop some "acceptable to all" pabulum, focusing mainly on California and Texas as the standard bearers. I think those days are finally coming to an end.** The concept here is teachers will roll their own (develop their own content), quite possibly using a "place based" approach, meaning they up the relevance quotient by incorporating information from the local environment (in story problems, in geography lessons, in history lessons -- not just talking about math). I've worked with the Catholic subculture in Portland some, helping a protege us Pyblosxom to develop a blogging system for one of the local priests (Father Bob), complete with "skinning" depending on the liturgical calendar, with a few secular holidays thrown in for good measure. Coming up with a Python algorithm that'd correctly compute Easter was especially challenging, with the US Navy proving our most reliable source (I think it was -- some dot mil resource). Here we go: http://www.usno.navy.mil/USNO/astronomical-applications/astronomical-information-center/date-easter Regarding Tarot, that'd of course depend on the school and local community standards. In Portland, we tend to celebrate pirates, hackers, wizards and witches all in the same breath (it's the Winterhaven Wizards where my daughter went to junior high). If a student wanted to write a Tarot Reader is a school project, I doubt that'd be a problem around here in any way. YMMV of course. http://www.flickr.com/photos/17157315 at N00/4037589946/ (typical Portland pro witch propaganda) What some of us advertise about Python is that it fits well into niches (a variation of "fits your brain" meme) i.e. you're not even obligated to use Latin-1 except for the keywords. Having religious themes for your content is in no way a problem for the language itself, even if your language is Klingon (actually that might be a problem as Klingon is only ancillary in the Unicode standard and might be difficult to come by -- Damian does Klingon in Perl though, so I'm thinking there must be a way). http://www.archlug.org/kwiki/KlingonPerlProgramming http://globalmoxie.com/blog/klingon-not-spoken-here.shtml I regard the Diversity Statement as a way of protecting the niches against any largely fictitious "majority culture" that wants to steamroll some kind of "majority aesthetic" on the rest of us. There's really no need to pay much attention to tyrannical majorities anymore. It's all about locale and localization (another way of saying "place based" education is the way of the future, IMO). Of course that's just one more debating position, not saying you're compelled to agree, obviously. Just my point of view and all that, seems to be working well in practice. Kirby ** I remember the story about John Saxon, a retired military guy who decided to get into curriculum writing, found his textbooks had a large niche market among schoolers. However, his story problems about fairies and pixies were getting him into trouble with that group, which regarded these Narnia-like creatures as too Satanic for comfort. He needed to change his text for the next edition. Such is the relatively joyless life of mass publishers. http://www.home-school.com/Articles/SaxonEditorial.html Related blog post (Oct 17, 2009) http://controlroom.blogspot.com/2009/10/equipment-drop.html From ttoenjes at gmail.com Tue Nov 3 19:21:10 2009 From: ttoenjes at gmail.com (Trevor Toenjes) Date: Tue, 03 Nov 2009 13:21:10 -0500 Subject: [Edu-sig] [Fwd: FLL - FIRST/TWC Partnership in the US!] Message-ID: <4AF07496.30508@gmail.com> An HTML attachment was scrubbed... URL: From aharrin at luc.edu Tue Nov 3 20:37:15 2009 From: aharrin at luc.edu (Andrew Harrington) Date: Tue, 3 Nov 2009 13:37:15 -0600 Subject: [Edu-sig] no education in Pycon 2010 talks Message-ID: Looks like an interesting collection of talks for Pycon 2010, but I do not see a single talk that I recognize as coming from the educational community. (Am I wrong?) The only place I know where this is listed is http://us.pycon.org/2010/conference/proposals/status/#accepted which is likely only viewable by those on the program committee. Is the educational community coming? What we do informally outside the talks is usually the biggest thing. I am interested in a session/sprint generating stuff for PyWhip, but I can't stay after the regular conference time. I have gone every year for many years, but I need a bit of motivation to go this year. -- Andrew N. Harrington Director of Academic Programs Computer Science Department Loyola University Chicago 512B Lewis Towers (office) Snail mail to Lewis Towers 416 820 North Michigan Avenue Chicago, Illinois 60611 http://www.cs.luc.edu/~anh Phone: 312-915-7982 Fax: 312-915-7998 gpd at cs.luc.edu for graduate administration upd at cs.luc.edu for undergrad administration aharrin at luc.edu as professor -------------- next part -------------- An HTML attachment was scrubbed... URL: From vceder at canterburyschool.org Tue Nov 3 21:08:59 2009 From: vceder at canterburyschool.org (Vern Ceder) Date: Tue, 03 Nov 2009 15:08:59 -0500 Subject: [Edu-sig] no education in Pycon 2010 talks In-Reply-To: References: Message-ID: <4AF08DDB.5000006@canterburyschool.org> Andy, As I recall, there weren't many education directed talk proposals this year (in fact, I don't recall seeing any). I hope that the advent of poster sessions (see http://us.pycon.org/2010/conference/posters/) will add some opportunity for educational content. I would strongly encourage (beg, wheedle, plead, etc) the readers of this list to present a poster on an education topic, or a virtual poster, if you can't make it to Atlanta. We also are hoping for virtual posters from students, so encourage any bright (and/or video minded) students to come up with something. The idea of a PyWhip mini-sprint is kinda attractive, if we can find a time to do it, since I can't stay for the sprints this year either. Cheers, Vern Andrew Harrington wrote: > Looks like an interesting collection of talks for Pycon 2010, but I do > not see a single talk that I recognize as coming from the educational > community. (Am I wrong?) The only place I know where this is listed is > http://us.pycon.org/2010/conference/proposals/status/#accepted > which is likely only viewable by those on the program committee. > Is the educational community coming? What we do informally outside the > talks is usually the biggest thing. I am interested in a session/sprint > generating stuff for PyWhip, but I can't stay after the regular > conference time. > > I have gone every year for many years, but I need a bit of motivation to > go this year. > > -- > Andrew N. Harrington > Director of Academic Programs > Computer Science Department > Loyola University Chicago > 512B Lewis Towers (office) > Snail mail to Lewis Towers 416 > 820 North Michigan Avenue > Chicago, Illinois 60611 > > http://www.cs.luc.edu/~anh > Phone: 312-915-7982 > Fax: 312-915-7998 > gpd at cs.luc.edu for graduate administration > upd at cs.luc.edu for undergrad administration > aharrin at luc.edu as professor > > > ------------------------------------------------------------------------ > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig -- This time for sure! -Bullwinkle J. Moose ----------------------------- Vern Ceder, Director of Technology Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 From ttoenjes at gmail.com Tue Nov 3 21:22:29 2009 From: ttoenjes at gmail.com (Trevor Toenjes) Date: Tue, 03 Nov 2009 15:22:29 -0500 Subject: [Edu-sig] no education in Pycon 2010 talks In-Reply-To: References: Message-ID: <4AF09105.90102@gmail.com> I am interested in seeing more SIG Summits during PyCon. But this requires people to step up and organize them and email their lists and verify people are coming. PyCon is the perfect place for an organized annual edu-sig meeting. I dont know what the python educational community has done at PyCon in the past, but I will be glad to create some publicity just about Educators meeting at PyCon. And if you give me some more info, I might even be able to find sponsors interested in paying for parts of PyCon to help educators attend and present materials. I had another goal to reach out to regional Atlanta academics to invite them to PyCon. but I am spending my time on finding Sponsors. Is anyone motivated to call the local universities and tech schools to invite teachers and students to PyCon? this would be a boon for PyCon if we created an educational undercurrent through outreach. There are tutorial sessions that could also be turned into sessions like "How to Teach Python at xxx level". -Trevor Andrew Harrington wrote: > Looks like an interesting collection of talks for Pycon 2010, but I do > not see a single talk that I recognize as coming from the educational > community. (Am I wrong?) The only place I know where this is listed is > http://us.pycon.org/2010/conference/proposals/status/#accepted > which is likely only viewable by those on the program committee. > Is the educational community coming? What we do informally outside > the talks is usually the biggest thing. I am interested in a > session/sprint generating stuff for PyWhip, but I can't stay after the > regular conference time. > > I have gone every year for many years, but I need a bit of motivation > to go this year. > > -- > Andrew N. Harrington > Director of Academic Programs > Computer Science Department > Loyola University Chicago > 512B Lewis Towers (office) > Snail mail to Lewis Towers 416 > 820 North Michigan Avenue > Chicago, Illinois 60611 > > http://www.cs.luc.edu/~anh > Phone: 312-915-7982 > Fax: 312-915-7998 > gpd at cs.luc.edu for graduate administration > upd at cs.luc.edu for undergrad administration > aharrin at luc.edu as professor > ------------------------------------------------------------------------ > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From andre.roberge at gmail.com Tue Nov 3 21:37:43 2009 From: andre.roberge at gmail.com (Andre Roberge) Date: Tue, 3 Nov 2009 17:37:43 -0300 Subject: [Edu-sig] no education in Pycon 2010 talks In-Reply-To: <4AF08DDB.5000006@canterburyschool.org> References: <4AF08DDB.5000006@canterburyschool.org> Message-ID: <7528bcdd0911031237ga3eeb01ha5ed03ceca262fb8@mail.gmail.com> On Tue, Nov 3, 2009 at 5:08 PM, Vern Ceder wrote: > Andy, > > As I recall, there weren't many education directed talk proposals this year > (in fact, I don't recall seeing any). > > I hope that the advent of poster sessions (see > http://us.pycon.org/2010/conference/posters/) will add some opportunity > for educational content. I would strongly encourage (beg, wheedle, plead, > etc) the readers of this list to present a poster on an education topic, or > a virtual poster, if you can't make it to Atlanta. Thanks to you and others (Kirby? Steve Holden?) who came up with the idea of posters. Unfortunately, it looks like I won't be able to make it to Pycon this year .... but I will give serious consideration to your call for virtual posters and hope others will do the same. Andr? [snip] > > Cheers, > Vern > > Andrew Harrington wrote: > >> Looks like an interesting collection of talks for Pycon 2010, but I do not >> see a single talk that I recognize as coming from the educational community. >> (Am I wrong?) >> > [snip] > -- >> Andrew N. Harrington >> >> > [snip] > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vceder at canterburyschool.org Tue Nov 3 21:38:47 2009 From: vceder at canterburyschool.org (Vern Ceder) Date: Tue, 03 Nov 2009 15:38:47 -0500 Subject: [Edu-sig] no education in Pycon 2010 talks In-Reply-To: <4AF09105.90102@gmail.com> References: <4AF09105.90102@gmail.com> Message-ID: <4AF094D7.5090002@canterburyschool.org> Hi Trevor, Trevor Toenjes wrote: > I am interested in seeing more SIG Summits during PyCon. But this > requires people to step up and organize them and email their lists and > verify people are coming. PyCon is the perfect place for an organized > annual edu-sig meeting. > I dont know what the python educational community has done at PyCon in > the past, but I will be glad to create some publicity just about > Educators meeting at PyCon. And if you give me some more info, I might > even be able to find sponsors interested in paying for parts of PyCon to > help educators attend and present materials. > Actually, we've probably been more active than most - every year members of edu-sig have gone out to dinner and spent an open space evening together. Naturally more publicity and support would always be welcome. > I had another goal to reach out to regional Atlanta academics to invite > them to PyCon. but I am spending my time on finding Sponsors. Is anyone > motivated to call the local universities and tech schools to invite > teachers and students to PyCon? this would be a boon for PyCon if we > created an educational undercurrent through outreach. There are > tutorial sessions that could also be turned into sessions like "How to > Teach Python at xxx level". I would also appreciate it if someone had the academic contacts and the time to pursue them. However, I doubt that we can tinker with the tutorials much at this point. OTOH, posters, lightning talks, and open space are all very well suited for both educators and students, so it would be good to get the word out. Anyone? Vern > -Trevor > > > Andrew Harrington wrote: >> Looks like an interesting collection of talks for Pycon 2010, but I do >> not see a single talk that I recognize as coming from the educational >> community. (Am I wrong?) The only place I know where this is listed is >> http://us.pycon.org/2010/conference/proposals/status/#accepted >> which is likely only viewable by those on the program committee. >> Is the educational community coming? What we do informally outside >> the talks is usually the biggest thing. I am interested in a >> session/sprint generating stuff for PyWhip, but I can't stay after the >> regular conference time. >> I have gone every year for many years, but I need a bit of motivation >> to go this year. >> >> -- >> Andrew N. Harrington >> Director of Academic Programs >> Computer Science Department >> Loyola University Chicago >> 512B Lewis Towers (office) >> Snail mail to Lewis Towers 416 >> 820 North Michigan Avenue >> Chicago, Illinois 60611 >> >> http://www.cs.luc.edu/~anh >> Phone: 312-915-7982 >> Fax: 312-915-7998 >> gpd at cs.luc.edu for graduate administration >> upd at cs.luc.edu for undergrad administration >> aharrin at luc.edu as professor >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Edu-sig mailing list >> Edu-sig at python.org >> http://mail.python.org/mailman/listinfo/edu-sig >> > > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig -- This time for sure! -Bullwinkle J. Moose ----------------------------- Vern Ceder, Director of Technology Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 From echerlin at gmail.com Wed Nov 4 03:37:54 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Tue, 3 Nov 2009 18:37:54 -0800 Subject: [Edu-sig] more card play In-Reply-To: <200911030620.nA36K8KV011694@theraft.openend.se> References: <200911030620.nA36K8KV011694@theraft.openend.se> Message-ID: On Mon, Nov 2, 2009 at 22:20, Laura Creighton wrote: > In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>Cards: You are right on the merits for combinatory math, but you will >>run into strong cultural aversions. > > Why? ?Especially when _dice_ seem to be the preferred way to teach > this stuff? ?(Or is this only here?) I'm including the rest of the world, not just the US. I expect issues to be raised by Evangelical Christians, Muslims and others in various countries. Dice might be easier, because casting lots is mentioned with approval in the Bible. Certainly we can come up with equipment that is not associated with common taboos. > Laura > -- Edward Mokurai (??/???????????????/????????????? ?) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/ From lac at openend.se Wed Nov 4 04:44:33 2009 From: lac at openend.se (Laura Creighton) Date: Wed, 04 Nov 2009 04:44:33 +0100 Subject: [Edu-sig] more card play In-Reply-To: Message from Edward Cherlin of "Tue, 03 Nov 2009 18:37:54 PST." References: <200911030620.nA36K8KV011694@theraft.openend.se> Message-ID: <200911040344.nA43iX9W009865@theraft.openend.se> In a message of Tue, 03 Nov 2009 18:37:54 PST, Edward Cherlin writes: >On Mon, Nov 2, 2009 at 22:20, Laura Creighton wrote: >> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>>Cards: You are right on the merits for combinatory math, but you will >>>run into strong cultural aversions. >> >> Why? ??Especially when _dice_ seem to be the preferred way to teach >> this stuff? ??(Or is this only here?) > >I'm including the rest of the world, not just the US. I expect issues >to be raised by Evangelical Christians, Muslims and others in various >countries. Dice might be easier, because casting lots is mentioned >with approval in the Bible. Certainly we can come up with equipment >that is not associated with common taboos. > >> Laura I wasn't clear, sorry. Around here (Sweden), when you want to teach probability, you get out the dice. That's how it is taught, and how all the exercises are set up, etc. I'm really surprised at the notion that cards would be unacceptable, while dice would be fine. I know some people who would be strongly against both, seeing both as gambling devices, and I know some people who every year are opposed to the dice and who would find cards unobjectionable. I hadn't thought that people who like dice but hate cards exist. Do you know some? Or are you guessing that they must exist? And if the latter, why? Do you use something else to teach probability? still puzzled, Laura From goodmansond at gmail.com Wed Nov 4 05:06:05 2009 From: goodmansond at gmail.com (DeanG) Date: Tue, 3 Nov 2009 22:06:05 -0600 Subject: [Edu-sig] more card play In-Reply-To: <200911040344.nA43iX9W009865@theraft.openend.se> References: <200911030620.nA36K8KV011694@theraft.openend.se> <200911040344.nA43iX9W009865@theraft.openend.se> Message-ID: > On Tue, Nov 3, 2009 at 9:44 PM, Laura Creighton wrote: > Do you use something else to teach probability? Drawing colored rocks from a bag was one thing I recall, which wikipedia noted as the primary type of drawing lots. I'm still trying to figure out why my chemistry teacher was using Dominos to teach unit conversion... - Dean p.s. Lost Cities is a great card game with a light explorer theme. From echerlin at gmail.com Wed Nov 4 06:26:37 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Tue, 3 Nov 2009 21:26:37 -0800 Subject: [Edu-sig] more card play In-Reply-To: <200911040344.nA43iX9W009865@theraft.openend.se> References: <200911030620.nA36K8KV011694@theraft.openend.se> <200911040344.nA43iX9W009865@theraft.openend.se> Message-ID: On Tue, Nov 3, 2009 at 19:44, Laura Creighton wrote: > In a message of Tue, 03 Nov 2009 18:37:54 PST, Edward Cherlin writes: >>On Mon, Nov 2, 2009 at 22:20, Laura Creighton wrote: >>> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>>>Cards: You are right on the merits for combinatory math, but you will >>>>run into strong cultural aversions. >>> >>> Why? ?Especially when _dice_ seem to be the preferred way to teach >>> this stuff? ?(Or is this only here?) >> >>I'm including the rest of the world, not just the US. I expect issues >>to be raised by Evangelical Christians, Muslims and others in various >>countries. Dice might be easier, because casting lots is mentioned >>with approval in the Bible. Certainly we can come up with equipment >>that is not associated with common taboos. >> >>> Laura > > I wasn't clear, sorry. ?Around here (Sweden), when you want to teach > probability, you get out the dice. ?That's how it is taught, and > how all the exercises are set up, etc. ?I'm really surprised at > the notion that cards would be unacceptable, while dice would be > fine. > > I know some people who would be strongly against both, seeing both > as gambling devices, and I know some people who every year are > opposed to the dice and who would find cards unobjectionable. > I hadn't thought that people who like dice but hate cards exist. > Do you know some? ?Or are you guessing that they must exist? Guessing that they might exist. Certainly there are people who like ordinary cards and dice, but not Tarot. I'm one of them. The cards themselves normally don't bother me, but I have had issues with people who got into the practice. > And > if the latter, why? > > Do you use something else to teach probability? All sorts of things. Coins, Othello pieces, dice (4-30 sides), cards from various decks, dreidls, wheels of fortune, spinners, socks in a bag, colored balls, pseudo-random number generators, random number generators, letter distribution in texts,... > still puzzled, > Laura > -- Edward Mokurai (??/???????????????/????????????? ?) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/ From kirby.urner at gmail.com Wed Nov 4 09:06:19 2009 From: kirby.urner at gmail.com (kirby urner) Date: Wed, 4 Nov 2009 00:06:19 -0800 Subject: [Edu-sig] more card play In-Reply-To: References: <200911030620.nA36K8KV011694@theraft.openend.se> Message-ID: On Tue, Nov 3, 2009 at 6:37 PM, Edward Cherlin wrote: > On Mon, Nov 2, 2009 at 22:20, Laura Creighton wrote: >> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>>Cards: You are right on the merits for combinatory math, but you will >>>run into strong cultural aversions. >> >> Why? ?Especially when _dice_ seem to be the preferred way to teach >> this stuff? ?(Or is this only here?) > > I'm including the rest of the world, not just the US. I expect issues > to be raised by Evangelical Christians, Muslims and others in various > countries. Dice might be easier, because casting lots is mentioned > with approval in the Bible. Certainly we can come up with equipment > that is not associated with common taboos. > The goal is not just to teach combinatorics but an object oriented way of modeling stuff. What's attractive about using a deck of playing cards, per my recent examples, is you might have a Card class, a Deck class, and a Hand class (i.e. what each player has in her or his possession). This is a fairly rich environment in that sense, whereas just grabbing stones from a bag or rolling dice is a little bit too simple. The main reasons I flashed on Tarot were two fold: (a) I was thinking about cards with no obvious ranking (cardinality vs. ordinality), i.e. the __lt__, __gt__, __eq__ interface would be missing and (b) I'm always looking for opportunities to be verbose with text, to get away from the misconception or prejudice that computer programming always means something like "number crunching" However, on further consideration, I see that (a) is incorrect and that most Tarot decks are very much the precursor of our ordinary decks of today, with suits and numbers i.e. ranking. I used to know that, but had forgotten (I'm not big into Tarot, nor astrology either). Regarding (b), I really hadn't thought it through. I was thinking of funny Madlib templates but more like horoscopes, divinations about the future that might be fun to write, not just read. Probably in the back of my mind was the fact that I'd already implemented throwing the I Ching as a Google App Engine. That was more about testing out Unicode than it was about divination, although I was careful to have the code mirror the actual process (I consulted an expert) i.e. I didn't just grab two hexagrams at random in one line of code. There's more to it. In any case, I'm enjoying the background information on Tarot I'm getting from Wikipedia and places, but have no immediate plans to head off in that direction in my examples. The standard deck of 52 plus two jokers is sufficient for my purposes (including jokers or wild cards is actually a challenge I haven't addressed yet). What I'm liking about playing card examples, aside from talking about combinatorics, is the fairly rich environment in terms of having these different types of object: a Deck, a Card, and a Hand (what each player has). This gets into refactoring, adding new methods, thinking through some of the modeling issues. Just grabbing stones from a bag doesn't have this level of richness (but could, if we built a context around it). For those wishing to eschew any focus on playing cards for religious reasons, I'm certain equally rich (yet familiar and relatively simple) examples might easily be devised. We could brainstorm some more of these OO-friendly environments here on this list, complete with coding examples. One thing I want to get away from is the ultra-dry traditional computer science text that lavishes so much attention on "widgets" or "parts in inventory" with not much imaginative texture. I'm trying to weave OO into a more Liberal Artsy approach, where we digress in the sense of criss-crossing other disciplines. I'm a big believer in more curriculum integration, less deliberate compartmentation. For example, in talking about methods and attributes, I think many kids would appreciate having Monsters, Mythical Beings, Superheros to focus on -- the stuff of comic books and movies, also computer games. More like a MUD (multi-user domain), including in being text-based (more lexical than graphical -- because we're learning to code and think logically, not to draw like a pro). Why not learn or at least reinforce Greek Mythology this way, mixing stories with a little dot notation? Instead of just going Foo and Bar, we could have Hercules = Mortal(), Hercules.clean_stables() or something along those lines. Simple environments might include not just games, but establishments, institutions: like an Art Gallery, Restaurant, Theater, Airport... Village. What types of objects do these have and how do they relate to one another? We've often seen textbook examples talking about a school, classrooms, grades. I'd like to get away from that (over-used, too stultifying). Probably what's driving my thinking here, at least in part, is some of my writing for DemocracyLab.org. This think tank is/was trying to come up with "democracy engines" that would allow groups of people to relate policy proposals to underlying values. There was also some talk of a "village in a box" design, i.e. you could set up a small community and install this open source software, and get all sorts of roles predefined, along with a bunch of processes for running town meetings, polling, voting, keeping track of food stores, managing imports / exports.... Fun science fiction if nothing else, plus it gives students a context, a way of bringing a community into focus and thinking in an OO style about it. Legitimate exercise, not for everyone, but not every exercise needs to be: "Specify likely attributes (properties) and methods (behaviors) for the following classes, provide comments: Casket, Plot, Headstone, Corpse... Cemetery" You may think I'm just being facetious or trying to be Gothic, however I'm thinking of two real world experiences: 1. teaching high school in Jersey City, at a Catholic academy for girls, and asking my students to devise business cards for themselves as they imagine they might have when they were full-fledged adults with careers. One of my students came back with Funeral Director, and she wasn't joking, lots of families in Jersey City were actually involved in that business 2. a student in middle school in Italy, my dad the urban planner coming in to talk about his job and unfurling large city maps showing zoning, some big green areas around town. "Not parks, not golf courses... what do you think these are?" he asked, and none of us got the right answer (which I'm sure you're able to get, given the present context). Thinking in an OO style, about *everything*, is a useful way to go. A kind of "language immersion" approach, like some schools do with Japanese or Spanish.... Kirby > > > > -- > Edward Mokurai (??/???????????????/????????????? ?) Cherlin > Silent Thunder is my name, and Children are my nation. > The Cosmos is my dwelling place, the Truth my destination. > http://www.earthtreasury.org/ > From kirby.urner at gmail.com Thu Nov 5 15:23:13 2009 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 5 Nov 2009 06:23:13 -0800 Subject: [Edu-sig] noteworthy -- Message-ID: Hey Vern -- It's not exactly a poster, but it does have exhibits. The linked website giving Haikus distilled from Ulysses is amazing to behold: http://projects.metafilter.com/2256/Haiku-Finder I'm a fan of these alpha (vs. numeric) computing projects, though I'm also a fan of number crunching too (it's not either/or). KirbyUrner WikiEducator From ttoenjes at gmail.com Thu Nov 5 15:47:25 2009 From: ttoenjes at gmail.com (Trevor Toenjes) Date: Thu, 05 Nov 2009 09:47:25 -0500 Subject: [Edu-sig] Edu Summit at PyCon ? In-Reply-To: <4AF094D7.5090002@canterburyschool.org> References: <4AF09105.90102@gmail.com> <4AF094D7.5090002@canterburyschool.org> Message-ID: <4AF2E57D.5000203@gmail.com> Who is also part of pycon-organizers and can jump start some activity? Vern Ceder wrote: > Actually, we've probably been more active than most - every year > members of edu-sig have gone out to dinner and spent an open space > evening together. Naturally more publicity and support would always be > welcome. If this is satisfactory to everyone, then that is that. (the thread seemed to die quickly) But if there is a desire to accomplish more ... then it requires some organization and effort. My offer is open ended to do publicity if the group decides to organize the beginning of something more formal like an Education Summit. I am glad to help find additional space if need and do press releases, etc. Who can work on this? > I would also appreciate it if someone had the academic contacts and > the time to pursue them. However, I doubt that we can tinker with the > tutorials much at this point. OTOH, posters, lightning talks, and open > space are all very well suited for both educators and students, so it > would be good to get the word out. Anyone? Who will volunteer to start the grass-roots advocacy and call academics around Atlanta and invite them and their students to PyCon and to meet with the edu group? From vceder at canterburyschool.org Thu Nov 5 16:40:14 2009 From: vceder at canterburyschool.org (Vern Ceder) Date: Thu, 05 Nov 2009 10:40:14 -0500 Subject: [Edu-sig] noteworthy -- In-Reply-To: References: Message-ID: <4AF2F1DE.4090105@canterburyschool.org> Hey Kirby, Strange you should mention that - one of the unexplored ideas in my folder of possible programming exercises is to generate haiku from a list of words... possibly with the help of the NLTK. Lots of text processing issues to address in a fairly compact problem statement. I've also always liked text-y projects myself. And I definitely agree about the Ulysses results... Thanks much for the link. Cheers, Vern kirby urner wrote: > Hey Vern -- > > It's not exactly a poster, but it does have exhibits. The linked > website giving Haikus distilled from Ulysses is amazing to behold: > > http://projects.metafilter.com/2256/Haiku-Finder > > I'm a fan of these alpha (vs. numeric) computing projects, though I'm > also a fan of number crunching too (it's not either/or). > > KirbyUrner > WikiEducator > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig -- This time for sure! -Bullwinkle J. Moose ----------------------------- Vern Ceder, Director of Technology Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 From vceder at canterburyschool.org Thu Nov 5 17:19:12 2009 From: vceder at canterburyschool.org (Vern Ceder) Date: Thu, 05 Nov 2009 11:19:12 -0500 Subject: [Edu-sig] Edu Summit at PyCon ? In-Reply-To: <4AF2E57D.5000203@gmail.com> References: <4AF09105.90102@gmail.com> <4AF094D7.5090002@canterburyschool.org> <4AF2E57D.5000203@gmail.com> Message-ID: <4AF2FB00.4020709@canterburyschool.org> Trevor Toenjes wrote: > Who is also part of pycon-organizers and can jump start some activity? > Of course, Trevor and I are on pycon-organizers, but we both are in the coordinating business already, Trevor with sponsorship and me with the poster session. I can help some, but I'm reluctant to take the lead. > Vern Ceder wrote: >> Actually, we've probably been more active than most - every year >> members of edu-sig have gone out to dinner and spent an open space >> evening together. Naturally more publicity and support would always be >> welcome. > If this is satisfactory to everyone, then that is that. (the thread > seemed to die quickly) > > But if there is a desire to accomplish more ... then it requires some > organization and effort. > My offer is open ended to do publicity if the group decides to organize > the beginning of something more formal like an Education Summit. I am > glad to help find additional space if need and do press releases, etc. > Who can work on this? Yeah, the real question is whether we want to move to something more formal. We've usually had something like 20-25 show up for part or all of the open space, so we could probably expect to have enough mass for a more formal summit. The other summits have met during a tutorial day, which might be a problem for some of us in getting more time away from classes, an extra night of hotel, etc. OTOH, if we have a summit during PyCon we either have to take an evening or miss a chunk of talks. The past couple of years Andy Harrington and I have done the following: * setup a page on the PyCon wiki to collect attendees, topics and dinner plans (Vern) * publicized our meeting on this list (Vern) * researched a restaurant and made reservations (this is something that someone local is best equipped to do) (Andy) * reserved an open space room for our evening conversations (Andy) Other than the barest get-things-started nudge, we haven't had much need for a moderator or the like - we've just let the conversation flow. I can certainly set up the wiki page again, and will back Trevor up (if needed) in asking pycon-organizers for the space. With Trevor's offer to do publicity, a coordinator's role would mainly (I think) be: * manage outreach to potential attendees/invitees and the ed community (esp. those in the Atlanta area) * work out a format and agenda, etc * pitch the idea to the pycon-organizers, with Trevor and me (at least) as backup * coordinate with Trevor on overall location and publicity needs. >> I would also appreciate it if someone had the academic contacts and >> the time to pursue them. However, I doubt that we can tinker with the >> tutorials much at this point. OTOH, posters, lightning talks, and open >> space are all very well suited for both educators and students, so it >> would be good to get the word out. Anyone? > Who will volunteer to start the grass-roots advocacy and call academics > around Atlanta and invite them and their students to PyCon and to meet > with the edu group? > > Cheers, Vern -- This time for sure! -Bullwinkle J. Moose ----------------------------- Vern Ceder, Director of Technology Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 From kirby.urner at gmail.com Fri Nov 6 00:17:05 2009 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 5 Nov 2009 15:17:05 -0800 Subject: [Edu-sig] Edu Summit at PyCon ? In-Reply-To: <4AF2FB00.4020709@canterburyschool.org> References: <4AF09105.90102@gmail.com> <4AF094D7.5090002@canterburyschool.org> <4AF2E57D.5000203@gmail.com> <4AF2FB00.4020709@canterburyschool.org> Message-ID: Regarding promoting an edu-track @ Pycon, what I did last year, maybe effectively, was sign in to the Chicago Users Group (Python) and start yakking about my issues, bragging about how Portland was light years ahead of the midwest and yada yada. Upshot: uncertain. We had a self-reported math teacher show up in bike clothes at the exhibitionary break i.e. he wasn't pretending to have paid a registration. Plus I had a guy jump into my workshop claiming to have completely lost patience with the one down the hall, a refugee, but was he even registered then? WTF knows. In any case, Pycon 2009 / Chicago was pretty strong on education. Ian Benson was expressing urgency, hoping to make himself understood through flyers on every chair, which got us in hot water with the legal team a bit, no lasting damage. The BOF also included Dr. Chuck, just finished with his Google App Engine book, me one of the tech reviewers, so we were looking forward to meeting. Andre Roberge was there to deliver a great talk on Crunchy and receive steering privileges vis-a-vis edu-sig home page, so yeah, a lot was accomplished (lots more than I just said, sharing perspective -- education big the year before that too, some dinners). I'm still on the Chicago list, made some new friends. So maybe there's one for Atlanta? I'm still uncertain about my February agenda. A theme over hear has been "escape from Georgia", our company having been joined by a refugee from Savannah. Were we to represent ourselves at Pycon, she'd be a logical delegate. She'd blend right in. Thanks in part to diversity list, I'm especially interested in not sending guys (as in XYs) from my small business, or at least not exclusively. If there's only to be one, it won't be me. OSCON is another matter however, given no hotel bill or airfare. Kirby From kirby.urner at gmail.com Fri Nov 6 20:11:49 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 6 Nov 2009 11:11:49 -0800 Subject: [Edu-sig] Python on WikiEducator Message-ID: Over on WikiEducator, a subculture, I've expanded on work started by WikiBuddy Promila Kumar earlier this year. Here's the page: http://www.wikieducator.org/PYTHON_TUTORIALS The web resources could stand to be enhance, though since we're linking to the edu-sig home page, as well as scipy, there's already a huge space of Python links by two degrees of separation. There's something to be said for keeping the front page sparse, doing in-fill on separate pages. Y'all don't be shy about joinin' me now. <-- practicing for Georgia. Becoming a contributor in WikiEducator involves creating your home base (user page) and notifying the authorities, who will certify you with the equivalent of a white, yellow, brown or black belt. You work your way up. I got a yellow belt (same rank as Promila) in short order, given all my previous experience editing Wikis (Ward Cunningham is a Portland native after all, keep running into the guy at meetings). Glancing mention of the Litvins text in my blog post of this morning FYI (last paragraph): http://controlroom.blogspot.com/2009/11/more-on-textbooks.html Kirby From vceder at canterburyschool.org Thu Nov 12 19:14:48 2009 From: vceder at canterburyschool.org (Vern Ceder) Date: Thu, 12 Nov 2009 13:14:48 -0500 Subject: [Edu-sig] Call to Action (PyCon) Message-ID: <4AFC5098.9050006@canterburyschool.org> Hi everyone, This is a call for help on a couple of fronts. First of all, I could really use your help in promoting the poster session at PyCon. The nature of posters make them a good fit for both Python educators and their students. Undergrads and graduate students (and teachers) can use them as a way to get conference presentation experience and recognition, and virtual posters let students and teachers at any level get in on the fun, even if they can't come to Atlanta. So please, promote, blog, etc the poster session to your friends and colleagues as much as you can. Again, all information is at http://us.pycon.org/2010/conference/posters/ and don't hesitate to email me if you have any questions. If you have contacts that you think would be more responsive to a semi-official announcement/invitation/groveling plea from me, please send me their contact info and I'll get something to them. Secondly, we have the chance to put our stamp on PyCon. It wouldn't take that much to move our unofficial BoF to being a regular education "summit" and standard feature of PyCon. What it *would* take is someone to own the job of basic planning and outreach to the Python in Ed community, particularly those within easy attendance range of Atlanta. If anyone is willing to do that, but either can't attend PyCon or feels uncomfortable moderating the actual event, I'd be willing to be an on-site figurehead of last resort. ;) Given that the southeast includes so many excellent schools at all levels, it could be a great time to turn up our outreach, and it would demonstrate that Edu-Sig is one of the leading communities (which I happen to believe) within the greater Python community. So please consider taking this on. And please help plug the poster session - it would be great to have a strong education presence as we add posters to PyCon. Thanks, Vern -- This time for sure! -Bullwinkle J. Moose ----------------------------- Vern Ceder, Director of Technology Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 From kirby.urner at gmail.com Thu Nov 12 22:55:37 2009 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 12 Nov 2009 13:55:37 -0800 Subject: [Edu-sig] Call to Action (PyCon) In-Reply-To: <4AFC5098.9050006@canterburyschool.org> References: <4AFC5098.9050006@canterburyschool.org> Message-ID: On Thu, Nov 12, 2009 at 10:14 AM, Vern Ceder wrote: << trim >> > So please consider taking this on. And please help plug the poster session - > it would be great to have a strong education presence as we add posters to > PyCon. > > Thanks, > Vern > Hi Vern -- I forwarded your edu-sig post verbatim with a bit of an intro, encouraging our Portland User Group to spread the word regarding this new opportunity: http://mail.python.org/pipermail/portland/2009-November/000856.html It may take a few Pycons for this practice to really gain traction. I haven't been following the apac.pycon organizer list so don't know if that Pycon will feature a similar poster session or has plans to institute same down the road. My sense is the various Pycons copy from each other, so whatever works will in Atlanta has good chance of spreading. We're ramping up around Python in our multi-media events, experimenting with a kind of recruiting front end that's participatory, spoken word and music, using Lightning Talks as a guide (karaoke also apropos). The goal is to attract students to a whole set of free skool type classes where relevant skill sets might be cultivated. In other news: PEP 3003 will freeze the Python language long enough to help VMs catch up, focus energy on expanding libraries. Google has a new open source Go language.... Kirby > -- > This time for sure! > ? -Bullwinkle J. Moose > ----------------------------- > Vern Ceder, Director of Technology > Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 > vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From vceder at canterburyschool.org Thu Nov 12 23:19:29 2009 From: vceder at canterburyschool.org (Vern Ceder) Date: Thu, 12 Nov 2009 17:19:29 -0500 Subject: [Edu-sig] Call to Action (PyCon) In-Reply-To: References: <4AFC5098.9050006@canterburyschool.org> Message-ID: <4AFC89F1.2070702@canterburyschool.org> Thanks a lot, Kirby. That's the sort of boost we need. I hope some of the Portland folks will participate, virtually if they can't make the journey across the country. Cheers, Vern kirby urner wrote: > On Thu, Nov 12, 2009 at 10:14 AM, Vern Ceder > wrote: > > << trim >> > >> So please consider taking this on. And please help plug the poster session - >> it would be great to have a strong education presence as we add posters to >> PyCon. >> >> Thanks, >> Vern >> > > Hi Vern -- > > I forwarded your edu-sig post verbatim with a bit of an intro, > encouraging our Portland User Group to spread the word regarding this > new opportunity: > > http://mail.python.org/pipermail/portland/2009-November/000856.html > > It may take a few Pycons for this practice to really gain traction. I > haven't been following the apac.pycon organizer list so don't know if > that Pycon will feature a similar poster session or has plans to > institute same down the road. My sense is the various Pycons copy > from each other, so whatever works will in Atlanta has good chance of > spreading. > > We're ramping up around Python in our multi-media events, > experimenting with a kind of recruiting front end that's > participatory, spoken word and music, using Lightning Talks as a guide > (karaoke also apropos). The goal is to attract students to a whole > set of free skool type classes where relevant skill sets might be > cultivated. > > In other news: PEP 3003 will freeze the Python language long enough > to help VMs catch up, focus energy on expanding libraries. Google has > a new open source Go language.... > > Kirby > >> -- >> This time for sure! >> -Bullwinkle J. Moose >> ----------------------------- >> Vern Ceder, Director of Technology >> Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 >> vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 >> _______________________________________________ >> Edu-sig mailing list >> Edu-sig at python.org >> http://mail.python.org/mailman/listinfo/edu-sig >> -- This time for sure! -Bullwinkle J. Moose ----------------------------- Vern Ceder, Director of Technology Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137 From kirby.urner at gmail.com Sat Nov 14 05:25:32 2009 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 13 Nov 2009 20:25:32 -0800 Subject: [Edu-sig] Call to Action (PyCon) In-Reply-To: <4AFC89F1.2070702@canterburyschool.org> References: <4AFC5098.9050006@canterburyschool.org> <4AFC89F1.2070702@canterburyschool.org> Message-ID: On Thu, Nov 12, 2009 at 2:19 PM, Vern Ceder wrote: > Thanks a lot, Kirby. That's the sort of boost we need. I hope some of the > Portland folks will participate, virtually if they can't make the journey > across the country. > > Cheers, > Vern > Thanks to you as well Vern, for keeping this ball rolling. I dropped something into the Chipy list as well, expect a few subscribers will reminisce about last year's action (promotion). Speaking of which, I've found occasion to promote Python as a community to groups who might benefit from lessons learned. Two examples: (i) the Lightning Talk meme is worth sharing. A group, say a bunch of anarchists, hears how Pythonistas sometimes get kinda fascist about that time limit, which gives them respect for the discipline but maybe without thinking they have really think like a computer scientist (tends to mean "strict and precise" in the popular mindset). Here's a way to do Show & Tell without surrendering the floor to some guy who knows how to avoid being interrupted, plays King of the Hill with that microphone. Of course Karaoke has already helped reinforce this "sharing the limelight" ethic, other brands of open mic, but it's good to know the Python people have their own ethic and aesthetic, proves engineers are likewise human. (ii) the structure of the Python community contains many worthwhile ideas. Like the WikiEducator group is trying to juggle the puzzle pieces of having the Wiki itself, a governing structure, a Google group. What about a communal blog, do we need one? -- a recent question. Well, why not check out how the Python community does it with that PSF blog etc. There's something to be said for having those blogospheric links, as the Wiki concept is still not that familiar to those not getting open source through their schooling, let alone hearing anything about specific implementations, e.g. MoinMoin (believe it or not). Wikipedia is understood more as a read-only encyclopedia than a co-authoring system i.e. many who consult it for homework assignments don't understand what a Wiki is or what that has to do with how Wikipedia pages come to be. This means they might come to Wikieducator with similar preconceptions, more as consumers than as producers of content (which is fine, so far as it goes, but represents a loss of freedom, promotes passivity where more activity is probably what's needed). We have a long way to go, when it comes to passing on free and open source concepts. I continue to mine the Python infrastructure for good ideas (PEPs, clear notion of namespaces, a willingess to adapt but not gratuitously (Django's "no astronauts" meme...). It's a two way street of course, e.g. this idea of a "poster session" as a part of Pycon is already very much a part of many successful conferences (including GIS in Action (where I spoke right after Pycon this year, mentioned our wanting to copy this **). I still remember Chalmers, the NanoTech conference going on in tandem with EuroPython. For some of our keynotes, we had to wander through a poster session on buckyballs and nanotubes. It's around then that I launched something called HP4E, echoes of CP4E, trying to promote more geometric awareness (HP = hexapents &&). Kirby ** http://worldgame.blogspot.com/2009/04/gis-2009.html (with pictures) && http://controlroom.blogspot.com/2007/07/connecting-dots.html (see links) From frederic38300 at aol.com Mon Nov 16 17:01:48 2009 From: frederic38300 at aol.com (Frederic Baldit) Date: Mon, 16 Nov 2009 17:01:48 +0100 Subject: [Edu-sig] importing modules at IDLE startup Message-ID: <1258387308.3830.10.camel@Siula-Grande.lan> Hello, I'm using python (version 2.5.2, under debian lenny for personnal use on my notebook, and version 2.6 under Windows XP with my students) for teaching an introduction to algorithmic at High School (in France). I'm also using IDLE as IDE. Here is my problem (I try to solve it under linux fisrt): 1) I wrote a .pythonrc.py file with the two lines from __future__ import division from math import * 2) in my .bashrc file I wrote PYTHONSTARTUP = "/home/fred/.pythonrc.py" export PYTHONSTARTUP 3) when invoking python interactively in a terminal, it works fine: >>> 1/3 0.33333333333333331 >>> sqrt(5) 2.2360679774997898 4) I wrote a small script file test.py which contains print sqrt(2) print 1/3 Editing/testing this file with IDLE with the following command line: idle-python2.5 -n -s test.py and executing it with F5 gives the lines IDLE 1.2.2 ==== No Subprocess ==== >>> >>> 1.41421356237 0 So I have here a first problem with 1/3 division that should give a float result (according to the startup file import from __future__). 5) More annoying yet, when launching IDLE through the menu (under gnome), even the sqrt(2) command is not accepted (NameError: name 'sqrt' is not defined). I have checked that IDLE is launched with the command /usr/bin/idle-python2.5 -n -s Does anyone know how to solve this ? (of course I know that I could write 1.0/3, or also I could migrate to python 3). I simply want to "simplify" the python syntax for my students, so that "/" operator is always for them the usual (float) division, and usual math functions are available, this WITHOUT having to write any import at the top of their script. Thank's in advance for any valuable help. Frederic. From kirby.urner at gmail.com Mon Nov 16 18:47:53 2009 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 16 Nov 2009 09:47:53 -0800 Subject: [Edu-sig] importing modules at IDLE startup In-Reply-To: <1258387308.3830.10.camel@Siula-Grande.lan> References: <1258387308.3830.10.camel@Siula-Grande.lan> Message-ID: 1-2-3 testing... I created fred.py in site-packages of a 2.x for running in IDLE: from __future__ import division from math import sqrt def test(): return (1/3, sqrt(2)) print test() if __name__=="__main__": test() Students would have to use Recently Opened, fred.py, F5, which is not what you want. I encourage teachers to abandon 2.x at the earliest opportunity, realizing we're looking at VPython so really can't afford the luxury of cutting ties. Math without any VPython at all is hardly worth pursuing. Kirby On Mon, Nov 16, 2009 at 8:01 AM, Frederic Baldit wrote: > Hello, > I'm using python (version 2.5.2, under debian lenny for personnal use on > my notebook, and ?version 2.6 under Windows XP with my students) for > teaching an introduction to algorithmic at High School (in France). I'm > also using IDLE as IDE. > Here is my problem (I try to solve it under linux fisrt): > > 1) I wrote a .pythonrc.py file with the two lines > > from __future__ import division > from math import * > > 2) in my .bashrc file I wrote > > PYTHONSTARTUP = "/home/fred/.pythonrc.py" > export PYTHONSTARTUP > > 3) when invoking python interactively in a terminal, it works fine: > >>>> 1/3 > 0.33333333333333331 >>>> sqrt(5) > 2.2360679774997898 > > 4) I wrote a small script file test.py which contains > > print sqrt(2) > print 1/3 > > Editing/testing this file with IDLE with the following command line: > > idle-python2.5 -n -s test.py > > and executing it with F5 gives the lines > > IDLE 1.2.2 ? ? ?==== No Subprocess ==== >>>> >>>> > 1.41421356237 > 0 > > So I have here a first problem with 1/3 division that should give a > float result (according to the startup file import from __future__). > > 5) More annoying yet, when launching IDLE through the menu (under > gnome), even the sqrt(2) command is not accepted (NameError: name 'sqrt' > is not defined). I have checked that IDLE is launched with the > command /usr/bin/idle-python2.5 -n -s > > Does anyone know how to solve this ? (of course I know that I could > write 1.0/3, or also I could migrate to python 3). ?I simply want to > "simplify" the python syntax for my students, so that "/" operator is > always for them the usual (float) division, and usual math functions are > available, this WITHOUT having to write any import at the top of their > script. > > Thank's in advance for any valuable help. > ? ?Frederic. > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From g.akmayeva at ciceducation.org Mon Nov 16 19:25:36 2009 From: g.akmayeva at ciceducation.org (Galyna Akmayeva) Date: Mon, 16 Nov 2009 19:25:36 +0100 (CET) Subject: [Edu-sig] CICE-2010: Call for Papers Message-ID: <376108409.29377.1258395936612.JavaMail.open-xchange@oxltgw16.schlund.de> Kindly email this call for papers to your colleagues, faculty members and postgraduate students. Apologies for cross-postings. CALL FOR PAPERS Canada International Conference on Education (CICE-2010), April 26-28, 2010, Toronto, Canada (www.ciceducation.org) The CICE is an international refereed conference dedicated to the advancement of the theory and practices in education. The CICE promotes collaborative excellence between academicians and professionals from Education. The aim of CICE is to provide an opportunity for academicians and professionals from various educational fields with cross-disciplinary interests to bridge the knowledge gap, promote research esteem and the evolution of pedagogy. The CICE 2010 invites research papers that encompass conceptual analysis, design implementation and performance evaluation. All the accepted papers will appear in the proceedings and modified version of selected papers willbe published in special issues peer reviewed journals. The topics in CICE-2009 include but are not confined to the following areas: *Academic Advising and Counselling *Art Education *Adult Education *APD/Listening and Acoustics in Education Environment *Business Education *Counsellor Education *Curriculum, Research and Development *Competitive Skills *Continuing Education *Distance Education *Early Childhood Education *Educational Administration *Educational Foundations *Educational Psychology *Educational Technology *Education Policy and Leadership *Elementary Education *E-Learning *E-Manufacturing *ESL/TESL *E-Society *Geographical Education *Geographic information systems *Health Education *Higher Education *History *Home Education *Human Computer Interaction *Human Resource Development *Indigenous Education *ICT Education *Internet technologies *Imaginative Education *Kinesiology & Leisure Science *K12 *Language Education *Mathematics Education *Mobile Applications *Multi-Virtual Environment *Music Education *Pedagogy *Physical Education (PE) *Reading Education *Writing Education *Religion and Education Studies *Research Assessment Exercise (RAE) *Rural Education *Science Education *Secondary Education *Second life Educators *Social Studies Education *Special Education *Student Affairs *Teacher Education *Cross-disciplinary areas of Education *Ubiquitous Computing *Virtual Reality *Wireless applications *Other Areas of Education? For further information please visit CICE-2010 at www.ciceducation.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Tue Nov 17 19:46:45 2009 From: kirby.urner at gmail.com (kirby urner) Date: Tue, 17 Nov 2009 10:46:45 -0800 Subject: [Edu-sig] nexting vs. kicking (generators) Message-ID: My thanks to Carl Trachte for reminding me to make this link to a famous photograph of Ernest Hemingway: http://marbury.typepad.com/marbury/2009/09/kicking-the-can-down-the-road.html I've taken to binding "kick" to "next" (a built-in) and "kicking the can down the road" as my metaphor for iterating over and iterable, invoking the next API (i.e. kick). It's a pedagogical technique, not a company coding style. Renaming a built-in is not "normal" practice. You'll see this further spelled out in my introduction to the examples here provided: http://www.wikieducator.org/PYTHON_TUTORIALS#Generators (I've been hanging out with the Wikieducator crowd, comparing notes on South Africa and New Zealand most recently -- open source conversations). I'm submitting a talk entitled "Idiosyncratic Python" [sm] to OSCON this year, hoping to explain how somewhat pathological code might nevertheless reinforce clear conceptualization, and therefore stronger code down the line. Another example was replacing 'self' with other signature bindings, driving home some OO concepts and Python's particular implementation thereof. Any language tracing to Monty Python and having snake __ribs__ all over the place shouldn't complain about "idiosyncratic" right? IP will likely become a permanent feature of Pythonic pedagogy (PP) whereas where full blown andragogy is concerned (more inclusive) I might favor "truly demented" over the "merely idiosyncratic" (admittedly recruiting more youth that way too -- though some might run screaming... http://xkcd.com/107/ ). Our recent User Group meetings have been intensively into Mercurial. We should offer a full college level course on DVCS and VCS tools, perhaps through Saturday Academy? I should write to Joyce Cresswell again. We would want a minimum of two teachers, in keeping with our digital math teaching philosophy. Jason and Bret? Kirby PS: kudos from Chairman Steve for our recent diversity training / workshop / event featuring contributed Pythonic technology and lore: http://www.flickr.com/photos/17157315 at N00/4112904842/sizes/o/ Thx Steve! From kirby.urner at gmail.com Thu Nov 19 23:32:19 2009 From: kirby.urner at gmail.com (kirby urner) Date: Thu, 19 Nov 2009 14:32:19 -0800 Subject: [Edu-sig] Fwd: PyCon Posters deadline looms: Nov. 30 In-Reply-To: <6523e39a0911191313m5c1f1896k210e2932dee48f89@mail.gmail.com> References: <6523e39a0911191313m5c1f1896k210e2932dee48f89@mail.gmail.com> Message-ID: Some of you will have seen this, apropos edu-sig. Note that virtual posters have a later deadline. Kirby ---------- Forwarded message ---------- From: Catherine Devlin Date: Thu, Nov 19, 2009 at 1:13 PM Subject: PyCon Posters deadline looms: Nov. 30 To: python-announce-list at python.org The deadline for PyCon poster proposals is coming up soon - November 30! This year PyCon is introducing Poster Sessions. Poster sessions provide an alternative presentation mechanism that facilitates more one-on-one communication between the presenter and the audience. Poster sessions are particularly suited for topics of interest to a subset of the community, and we anticipate these sessions will provide an "incubator" for further discussions. PyCon 2010 is now seeking proposals for poster presentations and virtual poster presentations. Proposals for posters will be accepted through November 30th, and acceptance notifications will be provided by December 14th. More information about the what, how, when, and why of poster sessions is here: http://us.pycon.org/2010/conference/posters/cfp/ See you at PyCon, -- - Catherine http://catherinedevlin.blogspot.com/ *** PyCon * Feb 17-25, 2010 * Atlanta, GA * us.pycon.org *** -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/ -- >>> from mars import math http://www.wikieducator.org/Martian_Math -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.akmayeva at ciceducation.org Fri Nov 20 22:07:29 2009 From: g.akmayeva at ciceducation.org (Galyna Akmayeva) Date: Fri, 20 Nov 2009 22:07:29 +0100 (CET) Subject: [Edu-sig] CICE-2010: Call for Workshops Message-ID: <951144972.522921.1258751249354.JavaMail.open-xchange@oxltgw04.schlund.de> Kindly email this Call for Workshops to your colleagues, faculty members and postgraduate students. Apologies for cross-postings. Please send it to interested colleagues and students. Thanks! CALL FOR WORKSHOPS The CICE has been a prime international forum for both researchers and industry practitioners to exchange the latest fundamental advances in the state of the art and practice, Pedagogy, Arts, History, Open Learning, Distance Education, Math and Science Educution, ICT, Language Learning, Education (Early Year, Secondary, Post-Secondary and Higher), E-Learning, and identify emerging research topics. The CICE-2010 encourages you to submit workshop proposals. Workshop duration can be 2 hours. All the accepted papers will be included in the conference proceedings. You can consider organising a workshop that is related to CICE-2009 topics. The purpose of these workshops is to provide a platform for presenting novel ideas in a less formal and possibly more focused way than the conferences themselves. It offers a good opportunity for young researchers to present their work and to obtain feedback from an interested community. The format of each workshop is to be determined by the organisers, but it is expected that they contain ample time for general discussion. The preference is for one day workshops, but other schedules will also be considered. ? Important Dates Workshop Proposal Submission: December 15, 2009 Notification of Workshop Acceptance: December 31, 2009 ? The proposal must include: 1. The name of the workshop. 2. A statement of goals for the workshop. 3. The names and addresses of the organisers. 4. The names of potential participants, such as program committee members. 5. A description of the plans for call for participation (e.g., call for papers). 6. The expected number of attendees and the planned length of the workshop. 7. The topic of the workshop should be relevant to the main conference and details of any previous workshops. 8. The URL of the workshop web site. The workshop paper submission and author notification due dates are at the discretion of the workshop organisers but not later than 28 of February, 2010 in order to be included in the main conference proceedings. After acceptance of the workshop proposal, it is the responsibility of the Workshop Organiser(s)/Workshop Chair(s) to review all submitted papers to his/her workshop. If you are interested in organising workshops for the CICE-2010, please email your proposal to the workshop at ciceducation.org. Your workshop proposals will be reviewed by the Steering Committees. For further details, please visit www.ciceducation.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Mon Nov 23 01:38:05 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 22 Nov 2009 16:38:05 -0800 Subject: [Edu-sig] more card play In-Reply-To: References: <200911030620.nA36K8KV011694@theraft.openend.se> Message-ID: On Wed, Nov 4, 2009 at 12:06 AM, kirby urner wrote: > On Tue, Nov 3, 2009 at 6:37 PM, Edward Cherlin wrote: >> On Mon, Nov 2, 2009 at 22:20, Laura Creighton wrote: >>> In a message of Mon, 02 Nov 2009 20:27:35 PST, Edward Cherlin writes: >>>>Cards: You are right on the merits for combinatory math, but you will >>>>run into strong cultural aversions. >>> >>> Why? ?Especially when _dice_ seem to be the preferred way to teach >>> this stuff? ?(Or is this only here?) >> >> I'm including the rest of the world, not just the US. I expect issues >> to be raised by Evangelical Christians, Muslims and others in various >> countries. Dice might be easier, because casting lots is mentioned >> with approval in the Bible. Certainly we can come up with equipment >> that is not associated with common taboos. >> > > The goal is not just to teach combinatorics but an object oriented way > of modeling stuff. > > What's attractive about using a deck of playing cards, per my recent > examples, is you might have a Card class, a Deck class, and a Hand > class (i.e. what each player has in her or his possession). > Just to follow up on this theme, today I was shown one of those books from the LIFE series in the 1960s that were so influential at the time, in just about every school library, or at least in mine. I'd spent hours with this book in my boyhood: http://www.flickr.com/photos/17157315 at N00/4126467006/ So here's some of the playing card imagery prominent in the combinatorics and probably section. I have to think this material was influential, given how much time I spent with this book: http://www.flickr.com/photos/17157315 at N00/4126468504/in/photostream/ http://www.flickr.com/photos/17157315 at N00/4125698421/in/photostream/ http://www.flickr.com/photos/17157315 at N00/4125698093/in/photostream/ I had a suggestion from Carl T. to help promulgate Pycons and pointed him to my post here passing on Catherine's news of poster sessions, including virtual. Also, I'm back on math-thinking-l: http://mail.geneseo.edu/pipermail/math-thinking-l/2009-November/001327.html Kirby From missive at hotmail.com Sun Nov 29 18:34:14 2009 From: missive at hotmail.com (Lee Harr) Date: Sun, 29 Nov 2009 22:04:14 +0430 Subject: [Edu-sig] [ANNC] pybotwar-0.7 Message-ID: pybotwar is a fun and educational game where players write computer programs to control simulated robots. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation. It can be run in text-only mode -- useful for longer tournaments -- or use pyqt or pygame for a graphical interface and visualization of the action. pybotwar is released under GPLv3. Changes in pybotwar-0.7: ??? - pybox2d-2.0.2b1 compatibility (latest pybox2d release) ??? - decouple view modules so unused graphic modules are not required ??? - added new "pinged" sensor to detect when robot is seen by others ??? - randomize order robots are handled each tick ??? - PyQt4 interface improvements ??????? - new battle dialog to select combatants ??????? - internal text editor improvements ??????? - allow multiple open editor windows ??????? - do a few simple checks on robot programs when saving _________________________________________________________________ Windows Live: Keep your friends up to date with what you do online. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010 From kirby.urner at gmail.com Sun Nov 29 19:58:20 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 29 Nov 2009 10:58:20 -0800 Subject: [Edu-sig] Using the Decimal type in Martian Math Message-ID: I'm including the script below, using Python as a calculator, showing off the relatively new Decimal type, mainly to solicit feedback as to whether I'm doing anything really dorky (or that could easily be improved dramatically if I just knew what I was doing more). I don't use this type every day. In lobbying to displace calculators in at least some high school math courses, I need to make it evident to teachers that the bigger more colorful displays are well worth it, even though an advanced TI will do extended precision they tell me. It's still not so easy to take screen prints or to compare (as strings perhaps) with published digit sets (e.g. for pi, e, phi, sqrt(2) -- numbers we care about).[1] However, many math teachers are already converts to the bigger screens, i.e. once they have them, would never go back. Even just having the one up front, thanks to the computer projector, is enough in some classrooms (the 1:1 ratio may be what homework is all about, even in OLPC-ville). So if we're this far along the decision tree (in a computerized math lab, say a TuxLab, running free/libre stuff on commodity hardware) then the next challenge is to tout Python, a scripting language, over say Excel or OpenOffice or that IronPython spreadsheet with Python for cell coding. In Windows world, where Python also runs (on Tk in IDLE if you want the GUI, or on ActiveState's or Wing's for scholars...), Excel is a gravity well for many math teachers, or should I say black hole (they never re-emerge)? Does Excel harness IEEE extended precision? I know Mathematica does. For context: The appended script is a fragment of Martian Math where we take a tetrahedral pizza slice out of a spherical pizza (messy analogy) and weigh it (compute its volume). The 120 slices have identical angles, so all have the same volume for a given h (height), the scale factor built in to all the six linear dimensions (the six edges of each pizza slice). I'm changing the value of h from phi/root2 -- where the pizza weighs in at 7.5 -- to a different value (or vice versa), where the pizza weighs in at volume 5. Given this is Martian Math, there's the little matter of needing a conversion factor (syn3) to escape the Earthlings' worshipful fixation on unit-volume cubes (what keeps 'em retarded -- Martian Math is somewhat counter-culture (= counter-intelligence)). Our canonical Martian Math rhombic dodecahedron has a volume of six and has radius 1 i.e. inscribes each ball in a CCP ball packing (same as FCC, the ~0.74 maximum density possible in ordinary space). The volume 5 rhombic triacontahedron (investigated below) is a different animal (different zonohedron) but there's a bridge in that our T, A and B modules all have the same easy volume of 1/24. The latter two (A&B) build the primitive space-filler (i.e. the Mite, pg. 71 Regular Polytopes by Coxeter)) as well as said rhombic dodecahedron (also canonical cube (vol 3), octahedron (vol 4), tetrahedron (vol 1), cuboctahedron (vol 20) etc.). Probably more than you wanted to know, the kind of stuff I've encoded in my rbf.py for those wishing to explore our digital math track in more depth.[2] Kirby Urner Oregon Curriculum Network 4dsolutions.net isepp.org (board) python.org (voting member) wikieducator (wikibuddy) [1] http://mail.geneseo.edu/pipermail/math-thinking-l/2009-November/001329.html (suggesting high precision explorations, ala fractals, as integral to digital math track (DM)) [2] http://www.4dsolutions.net/ocn/cp4e.html -- >>> from mars import math http://www.wikieducator.org/Martian_Math === Python v. 2.6 === from decimal import Decimal, getcontext getcontext().prec = 31 # whole numbers d1,d2,d3,d4,d5,d6 = [Decimal(i) for i in range(1,7)] # fractions dthird = d1/d3 dhalf = d1/d2 # surds droot2 = d2.sqrt() droot5 = d5.sqrt() # constants # http://www.rwgrayprojects.com/synergetics/s09/figs/f86210.html syn3 = d3/pow(droot2, d3) # tetravolume:cubevolume phi = (d1 + droot5)/d2 # golden ratio def tvolume(h): # http://www.rwgrayprojects.com/synergetics/s09/figs/f86411a.html # http://www.rwgrayprojects.com/synergetics/s09/figs/f86411b.html AC, BC, OC = ((h/d2) * (droot5 - d1), (h/d2) * (d3 - droot5), h) base = dhalf * (AC * OC) return dthird * base * BC # T module (1/120th of volume 5 rhombic triacontahedron) h = (phi/droot2) * pow(d2/d3, d1/d3) tvol = tvolume(h) print "T Module" print "T in tetravolumes: ", tvol * syn3 print "Rh Triacontrahedron: ", 120 * tvol * syn3 # E module (1/120th of rhombic triacontahedron with radius 1) h = d1 evol = tvolume(h) print "E Module" print "E in tetravolumes: ", evol * syn3 print "Rh Triacontrahedron: ", 120 * evol * syn3 # K module (1/120th of volume 7.5 rhombic triacontahedron) h = phi/droot2 kvol = tvolume(h) print "K Module" print "K in tetravolumes: ", kvol * syn3 print "Rh Triacontrahedron: ", 120 * kvol * syn3 From bblais at bryant.edu Sun Nov 29 20:34:49 2009 From: bblais at bryant.edu (Brian Blais) Date: Sun, 29 Nov 2009 14:34:49 -0500 Subject: [Edu-sig] teaching python using turtle module Message-ID: Hello, I was just playing with the turtle module, and thought it was an interesting way to augment the introduction to python (I teach college students, who haven't had any programming). It's a great way to introduce functions, for-loops, and general program structures. After a bit of playing, I realized that I couldn't think of many examples which use turtle with conditional structures (if- and while- statements), or functions that return values, as opposed to "procedures" like: def square(length): forward(length) right(90) forward(length) right(90) forward(length) right(90) forward(length) right(90) If-statements could possibly be used with some sort of random behavior (if rand()<0.5 ...). Are there any other situations, using turtle, that these structures would be natural? thanks, Brian Blais -- Brian Blais bblais at bryant.edu http://web.bryant.edu/~bblais -------------- next part -------------- An HTML attachment was scrubbed... URL: From echerlin at gmail.com Sun Nov 29 23:51:14 2009 From: echerlin at gmail.com (Edward Cherlin) Date: Sun, 29 Nov 2009 14:51:14 -0800 Subject: [Edu-sig] teaching python using turtle module In-Reply-To: References: Message-ID: On Sun, Nov 29, 2009 at 11:34, Brian Blais wrote: > Hello, > I was just playing with the turtle module, and thought it was an interesting > way to augment the introduction to python (I teach college students, who > haven't had any programming). ?It's a great way to introduce functions, > for-loops, and general program structures. If you use the Python-programmable tile in Turtle Art in Sugar, or Smalltalk in the Turtle Graphics in Etoys, it's even better. I have been doing presentations on teaching Python in elementary schools, and working on how to teach basic Computer Science ideas. You can use an if-then-else to initialize a stream in Python for the first pass, and get a value at each pass thereafter. The logic can be either in the TA or the Python. > After a bit of playing, I realized that I couldn't think of many exaples > which use turtle with conditional structures (if- and while- statements), Repeat is used much more often. but of course we can provide examples of any behavior you like. I like to use the turtle to generate sequences, where I can use a conditional to stop when the turtle would go off the screen. Fibonacci numbers, for example, or exponentials. Similarly for spirals of various types. Simple cases like those are easy to do in TA, while more complex sequences could use Python. There are several fractal examples using loops provided with Sugar on a Stick, including variations on Siepinksi constructions, and the Koch Snowflake. When I can get the code for reading the color of a dot on the screen into the programmable tile, I can program a toy Turing machine, with an array of dots as the transition table, and a line of dots as the tape. > or > functions that return values, as opposed to "procedures" like: > def square(length): > ?? ?forward(length) > ?? ?right(90) > ?? ?forward(length) > ?? ?right(90) > ?? ?forward(length) > ?? ?right(90) > ?? ?forward(length) > ?? ?right(90) Surely you mean repeat(4) forward(length) right(90) > If-statements could possibly be used with some sort of random behavior (if > rand()<0.5 ...). Drunkard's Walk. > Are there any other situations, using turtle, that these > structures would be natural? Recent versions of TA contain stack instructions: push, pop, read, clear. Your students might find it interesting to program Forth instructions in TA or Python. This has practical applications in implementing and porting virtual machines such as Parrot and the VMs in Smalltalk and I-APL. There is plenty more where this came from. You would also be welcome to adapt the Python source code for TA tiles to your environment. > thanks, > Brian Blais > -- > Brian Blais > bblais at bryant.edu > http://web.bryant.edu/~bblais > > > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > > -- Edward Mokurai (??/???????????????/????????????? ?) Cherlin Silent Thunder is my name, and Children are my nation. The Cosmos is my dwelling place, the Truth my destination. http://www.earthtreasury.org/ From kirby.urner at gmail.com Sun Nov 29 23:52:38 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 29 Nov 2009 14:52:38 -0800 Subject: [Edu-sig] Using the Decimal type in Martian Math In-Reply-To: References: Message-ID: On Sun, Nov 29, 2009 at 10:58 AM, kirby urner wrote: << SNIP >> > print "K Module" > print "K in tetravolumes: ", kvol * syn3 > print "Rh Triacontrahedron: ", 120 * kvol * syn3 > I'm now comparing output from this script on Ubuntu netbook Python 2.6 and WinXP HP desktop Python 3.1. Here's Python 3.1rc1 (r31rc1:73069, May 31 2009, 08:57:10): getcontext().prec = 31 T Module T in tetravolumes: 0.04166666666666666666666666666670 Rh Triacontrahedron: 5.000000000000000000000000000005 E Module E in tetravolumes: 0.04173131692777365429943951200165 Rh Triacontrahedron: 5.007758031332838515932741440198 K Module K in tetravolumes: 0.06250000000000000000000000000008 Rh Triacontrahedron: 7.500000000000000000000000000009 getcontext().prec = 50 T Module T in tetravolumes: 0.041666666666666666666666666666666666666666666666678 Rh Triacontrahedron: 5.0000000000000000000000000000000000000000000000013 E Module E in tetravolumes: 0.041731316927773654299439512001665297072526423571419 Rh Triacontrahedron: 5.0077580313328385159327414401998356487031708285702 K Module K in tetravolumes: 0.062500000000000000000000000000000000000000000000014 Rh Triacontrahedron: 7.5000000000000000000000000000000000000000000000018 Here's from Python 2.6 on Ubuntu Starling-1: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 getcontext().prec = 31 T Module T in tetravolumes: 0.04166666666666666666666666666670 Rh Triacontrahedron: 5.000000000000000000000000000005 E Module E in tetravolumes: 0.04173131692777365429943951200165 Rh Triacontrahedron: 5.007758031332838515932741440198 K Module K in tetravolumes: 0.06250000000000000000000000000008 Rh Triacontrahedron: 7.500000000000000000000000000009 getcontext().prec = 50 T Module T in tetravolumes: 0.041666666666666666666666666666666666666666666666678 Rh Triacontrahedron: 5.0000000000000000000000000000000000000000000000013 E Module E in tetravolumes: 0.041731316927773654299439512001665297072526423571419 Rh Triacontrahedron: 5.0077580313328385159327414401998356487031708285702 K Module K in tetravolumes: 0.062500000000000000000000000000000000000000000000014 Rh Triacontrahedron: 7.5000000000000000000000000000000000000000000000018 Note that 0.041666666... is our 1/24, the volume of T,A and B slices (tetrahedra) in Martian Math. Kirby -- >>> from mars import math http://www.wikieducator.org/Martian_Math From bblais at bryant.edu Mon Nov 30 00:14:42 2009 From: bblais at bryant.edu (Brian Blais) Date: Sun, 29 Nov 2009 18:14:42 -0500 Subject: [Edu-sig] teaching python using turtle module In-Reply-To: References: Message-ID: <34E79EB9-242E-4F6E-B646-626A6A618932@bryant.edu> On Nov 29, 2009, at 17:51 , Edward Cherlin wrote: > If you use the Python-programmable tile in Turtle Art in Sugar, or > Smalltalk in the Turtle Graphics in Etoys, it's even better. I'll have to check this out. > sequences, where I can use a conditional to stop when the turtle would > go off the screen. ah, good idea. >> or >> functions that return values, as opposed to "procedures" like: >> def square(length): >> forward(length) >> right(90) >> forward(length) >> right(90) >> forward(length) >> right(90) >> forward(length) >> right(90) > > Surely you mean > > repeat(4) > forward(length) > right(90) > surely I don't mean. :) that's not python. I'd do: def square(length): for i in range(4): forward(length) right(90) but there isn't much difference with such a simple shape. obviously, as one continued, the for-loop method would be clearer. >> If-statements could possibly be used with some sort of random >> behavior (if >> rand()<0.5 ...). > > Drunkard's Walk. > yes, that was the kind of thing I was thinking about. thanks! bb -- Brian Blais bblais at bryant.edu http://web.bryant.edu/~bblais -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirby.urner at gmail.com Mon Nov 30 02:22:29 2009 From: kirby.urner at gmail.com (kirby urner) Date: Sun, 29 Nov 2009 17:22:29 -0800 Subject: [Edu-sig] teaching python using turtle module In-Reply-To: References: Message-ID: On Sun, Nov 29, 2009 at 2:51 PM, Edward Cherlin wrote: << snip >> > Drunkard's Walk. > If our think tank (isepp.org) could have gotten permission, we'd have used that Monopoly guy (looks kinda like Planters peanut guy) randomly walking on like some chess board with a lamp post (reminds of Narnia). We don't have that kind of dough though, so just do this conceptually (conceptual art). >> Are there any other situations, using turtle, that these >> structures would be natural? > > Recent versions of TA contain stack instructions: push, pop, read, > clear. Your students might find it interesting to program Forth > instructions in TA or Python. This has practical applications in > implementing and porting virtual machines such as Parrot and the VMs > in Smalltalk and I-APL. > > There is plenty more where this came from. You would also be welcome > to adapt the Python source code for TA tiles to your environment. > I recall Alan Kay communicating Seymour Papert's sense that having "an explicit receiver" was an OK development. What he meant by that, in Smalltalk terms, is that the original Logo had what I'd call a "context turtle" in that FORWARD or RIGHT were w/r to a given Turtle one didn't need to mention explicitly, like what else could one mean? With Python and other object oriented implementations, one first gives birth to a turtle, creates an instance, as in: >>> someturtle = Turtle() That's binding a name to a turtle object (giving some turtle object a name) and then controlling said turtle through the API using dot notation against the name, e.g. someturtle.forward(10) or someturtle.right(90). What you get from this is, of course, the possibility of multiple turtles, each with its own pen color, visibility, other properties of self-hood. This gets showcased in the default demo (in Windows, just double click on turtle.py in the Lib subdirectory): http://www.flickr.com/photos/17157315 at N00/4145780784/ (using Gregor's 3.1 code just minutes ago) IronPython also has access to the .NET turtle library: http://www.flickr.com/photos/mfoord/3104991233/ (not my computer) I suppose I'm only bringing this up to (a) name drop about being in a meeting with Alan Kay (with Guido and Mark Shuttleworth among others) and (b) to remind readers that Logo and turtle art, or the art of programming with turtles, are orthogonal axes. Logo as a language has also been extended considerably, as has the richness of the environment. Some of these are commercial, proprietary offerings. Some of these feature "spatial turtles" in a "turtle tank" i.e. each turtle is more like a biplane in a WWI dogfight (Snoopy vs. Red Baron), with all those extra degrees of freedom (roll, pitch, yaw). Python's turtle module is not, repeat not, an implementation of Logo in the Python language. It's an implementation of turtle graphics on a Tk canvas in the Python language. You'll also find a turtle module in wxPython such as in PythonCard by Kevin Altis. http://pythoncard.sourceforge.net/samples/turtle.html I think Gregor is right to see turtle.py as an easy way to implement an Objects First approach, consistent with a more generic approach to math concepts (vectors, polynomials, polyhedra) as objects (types), extending the OO rubric. We teach maths as extensible type systems that advance through the invention of new types, not just as systems evolving through a progression of proved theorems from fixed axioms. Kirby >> thanks, >> Brian Blais >> -- >> Brian Blais >> bblais at bryant.edu >> http://web.bryant.edu/~bblais >> >> >> >> _______________________________________________ >> Edu-sig mailing list >> Edu-sig at python.org >> http://mail.python.org/mailman/listinfo/edu-sig >> >> > > > > -- > Edward Mokurai (??/???????????????/????????????? ?) Cherlin > Silent Thunder is my name, and Children are my nation. > The Cosmos is my dwelling place, the Truth my destination. > http://www.earthtreasury.org/ > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > -- >>> from mars import math http://www.wikieducator.org/Martian_Math From gregor.lingl at aon.at Mon Nov 30 17:36:14 2009 From: gregor.lingl at aon.at (Gregor Lingl) Date: Mon, 30 Nov 2009 17:36:14 +0100 Subject: [Edu-sig] teaching python using turtle module In-Reply-To: References: Message-ID: <4B13F47E.3080706@aon.at> Hello Brian, I think the most natural use of the if statement (using turtle graphics) occurs in recursive functions drawing trees, fractals and the like. This is well known from Logo, where recursion is the canonical way of doing repetitions. (But note, that Logo has tail recursion optimizaton!) If you are not yet ready to use recursion with your students, probably many of the problems coming to your mind that need the examination of conditions can be solved better by using a conditional loop (i. e. a while -loop in Python) than by using mere if statements. That is not the case however, if you have to perform actions in the body of a loop, that depend on the current situation. I did a quick search in my repository of examples and found a fairly short and simple script that demonstrates, what I mean: a drunken turtle collecting coins (or whatever) on its random walk. ##### Python script using turtle graphics from turtle import Screen, Turtle from random import randint s = Screen() s.setup(560,560) s.title("A drunken turtle collecting ...") s.tracer(False) writer = Turtle(visible=False) writer.penup() writer.goto(0, -275) coins = [] for i in range(-4,5): for j in range(-4, 5): if i == j == 0: continue c = Turtle(shape="circle") c.color("", "orange") c.shapesize(0.5) c.goto(40*i, 40*j) coins.append(c) s.tracer(True) DRUNKENNESS = 45 t = Turtle(shape="turtle") t.color("black","") points = 0 while abs(t.xcor()) < 200 and abs(t.ycor()) < 200: t.forward(5) t.right(randint(-DRUNKENNESS, DRUNKENNESS)) found = None for c in coins: if t.distance(c) < 10: found = c break if found: found.hideturtle() coins.remove(found) t.shapesize(1+points/5., outline=1+points) points += 1 writer.write("{0} points".format(points), align="center", font=('Arial', 24, 'bold')) ############## End of script You can see a screenshot of a run of this script here: http://www.dropbox.com/gallery/2016850/1/TurtleCollector?h=6b370a The script could be expanded in several ways, e. g. for doing statistical investigations or examinig how the result depends on different parameters like drunkenness etc. Or you distribute the coins randomly ... Does that alter the average "harvest"? Just a suggestion ... Regards, Gregor Brian Blais schrieb: > Hello, > > I was just playing with the turtle module, and thought it was an > interesting way to augment the introduction to python (I teach college > students, who haven't had any programming). It's a great way to > introduce functions, for-loops, and general program structures. > > After a bit of playing, I realized that I couldn't think of many > examples which use turtle with conditional structures (if- and while- > statements), or functions that return values, as opposed to > "procedures" like: > > def square(length): > forward(length) > right(90) > forward(length) > right(90) > forward(length) > right(90) > forward(length) > right(90) > > > If-statements could possibly be used with some sort of random behavior > (if rand()<0.5 ...). Are there any other situations, using turtle, > that these structures would be natural? > > > > thanks, > > Brian Blais > > -- > Brian Blais > bblais at bryant.edu > http://web.bryant.edu/~bblais > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Edu-sig mailing list > Edu-sig at python.org > http://mail.python.org/mailman/listinfo/edu-sig > From kirby.urner at gmail.com Mon Nov 30 21:51:25 2009 From: kirby.urner at gmail.com (kirby urner) Date: Mon, 30 Nov 2009 12:51:25 -0800 Subject: [Edu-sig] teaching python using turtle module In-Reply-To: <4B13F47E.3080706@aon.at> References: <4B13F47E.3080706@aon.at> Message-ID: I'm glad turtle graphics intersected my thinking re extended precision decimals (Decimal type) on edu-sig just now. I've updated my tmods.py to contain a turtle rendering the plane-net of a T-mod: http://www.4dsolutions.net/ocn/python/tmod.py (runnable source) http://www.flickr.com/photos/17157315 at N00/4147429781/ (GUI view) Here's the graphical output: http://www.flickr.com/photos/17157315 at N00/4148139184/in/photostream/ (Python 3.1) If you actually wanna fold the T, you need to snip off the cap and reverse it, per this diagram: http://www.rwgrayprojects.com/synergetics/s09/figs/f86515.html 120 of them, 60 folded left, 60 folded right, all of volume 1/24, make the volume 5 rhombic triacontahedron. http://www.rwgrayprojects.com/synergetics/s09/figs/f86419.html If you blow up the volume by 3/2, to 7.5, the radius becomes phi / sqrt(2) -- what we're showing with Decimals. The reason this seems unfamiliar is the unit of volume is the tetrahedron formed by any four equi-radiused balls in inter-tangency. I'm spinning this as Martian Math these days, yakking on math-thinking-l about it, learned it from Bucky Fuller, Dave Koski et al. Kirby