From carroll at tjc.com Thu Feb 1 02:24:42 2007 From: carroll at tjc.com (Terry Carroll) Date: Wed, 31 Jan 2007 17:24:42 -0800 (PST) Subject: [Baypiggies] [vote] name change Message-ID: On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: > To change the name of this mailing list, vote +1 and propose an alternate. > To keep the existing name, vote -1. +0 I would like the group's name changed, and voted to do so last time, which was not all that long ago. I think those of us who wanted the name changed should acknowledge that we're substantially in the minority and accept it, at least for a respectful amount of time. Let's check in maybe a couple years after the last vote on this. From carroll at tjc.com Thu Feb 1 02:30:10 2007 From: carroll at tjc.com (Terry Carroll) Date: Wed, 31 Jan 2007 17:30:10 -0800 (PST) Subject: [Baypiggies] [vote] name change In-Reply-To: <003901c74567$67b14f90$51a2480c@aluminum> Message-ID: On Wed, 31 Jan 2007, James Hartley wrote: > Given that you joined the group while its name is BayPIGgies indicates > that the name isn't important to you either. I disagree with that. It indicates that belonging to the local group of Python enthusiasts was more important than the name. It does not mean the name was unimportant. From DennisR at dair.com Thu Feb 1 02:39:39 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Wed, 31 Jan 2007 17:39:39 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: Message-ID: <5.1.0.14.0.20070131173616.00bf17f8@localhost> At 05:24 PM 1/31/2007, Terry Carroll wrote: >On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: > > > To change the name of this mailing list, vote +1 and propose an alternate. > > To keep the existing name, vote -1. -1 to change the name of *this* list +1 to create a new name for list(s) we are about to add. [BayPiggies Announce] is just too long for a new list name [BP Announce] or some short name is better for *new* list --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From carroll at tjc.com Thu Feb 1 02:17:59 2007 From: carroll at tjc.com (Terry Carroll) Date: Wed, 31 Jan 2007 17:17:59 -0800 (PST) Subject: [Baypiggies] [vote] admin list, jobs list In-Reply-To: Message-ID: On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: > * Should we have an admin list? (+1 yes, -1 no) -1 > * Should we have a separate jobs list? (+1 yes, -1 no) -1 From doug.durham at yahoo.com Thu Feb 1 02:55:11 2007 From: doug.durham at yahoo.com (doug.durham at yahoo.com) Date: Wed, 31 Jan 2007 17:55:11 -0800 (PST) Subject: [Baypiggies] [vote] name change Message-ID: <258150.90795.qm@web31809.mail.mud.yahoo.com> I vote -1. Change nothing. Please let's move on. I'd rather see some technical discussions. ----- Original Message ---- From: Dennis Reinhardt To: baypiggies at python.org Sent: Wednesday, January 31, 2007 5:39:39 PM Subject: Re: [Baypiggies] [vote] name change At 05:24 PM 1/31/2007, Terry Carroll wrote: >On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: > > > To change the name of this mailing list, vote +1 and propose an alternate. > > To keep the existing name, vote -1. -1 to change the name of *this* list +1 to create a new name for list(s) we are about to add. [BayPiggies Announce] is just too long for a new list name [BP Announce] or some short name is better for *new* list --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: http://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070131/ece12dd0/attachment.htm From whitaker at google.com Thu Feb 1 04:31:16 2007 From: whitaker at google.com (Russell Whitaker) Date: Wed, 31 Jan 2007 19:31:16 -0800 Subject: [Baypiggies] Fwd: Watch "Baypiggies 2006 Member Survey Results" on Google Video In-Reply-To: <30154666.821170300486022.JavaMail.video@cwdi2.prod.google.com> References: <30154666.821170300486022.JavaMail.video@cwdi2.prod.google.com> Message-ID: <997a56990701311931m6061d1efpe5ea9beb016092da@mail.gmail.com> Here's that Baypiggies meeting I filmed a few weeks ago. Please be kind: I'd just learned how to operate the video and audio gear an hour before. Russell ---------- Forwarded message ---------- From: russell.whitaker Date: Jan 31, 2007 7:28 PM Subject: Watch "Baypiggies 2006 Member Survey Results" on Google Video To: whitaker at google.com Cc: russell.whitaker at gmail.com Your friend, russell.whitaker at gmail.com, has sent you the following video from Google Video: *Baypiggies 2006 Member Survey Results* 1 hr 23 min 19 sec - Jan 17, 2007 *Average rating:* (1 rating) *Description:* Google Tech Talks January 11, 2007 ABSTRACT 2006 Member Survey Results. Want to see more cool videos? Go to video.google.com/?hl=en Think you have an even cooler video? Add it at video.google.com/videouploadform?hl=en If you're having trouble watching the video, try copying the following URL into your browser: http://video.google.com/videoplay?docid=-540262696706523167&q=baypiggies&pr=goog-sl&hl=en -- Russell Whitaker Sysops Tools Team Lead Google Inc., Mt View, CA "gets() remains as a monument to C's continuing support of buffer overruns." - Bill Frantz -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070131/a479c891/attachment.html From marilyn at deliberate.com Thu Feb 1 06:56:08 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Wed, 31 Jan 2007 21:56:08 -0800 Subject: [Baypiggies] [vote] name change Message-ID: <20070201055610.BB2591E4006@bag.python.org> ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: > At 05:24 PM 1/31/2007, Terry Carroll wrote: >>On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: >> >> > To change the name of this mailing list, vote +1 and propose an alternate. >> > To keep the existing name, vote -1. > > -1 to change the name of *this* list > +1 to create a new name for list(s) we are about to add. > > [BayPiggies Announce] is just too long for a new list name > [BP Announce] or some short name is better for *new* list We haven't been invited to vote on that, although that was the proposal I put forward. Thank you for remembering. Terry Carroll said: > +0 > > I would like the group's name changed, and voted to do so last time, which > was not all that long ago. > > I think those of us who wanted the name changed should acknowledge that > we're substantially in the minority and accept it, at least for a > respectful amount of time. Let's check in maybe a couple years after the > last vote on this. -- Yes. It was JJ, who is opposed to name-changing, who is polling the group about this, which wasn't anyone's proposal. Sort of a slight-of-hand, mob-rule kind of trick. But, I say this smiling, because it is amusing and not so important. I just thought the pending length of the new lists' names was a good excuse to bend the name a little and appease us who are not content with the name. But, clearly JJ didn't agree and put forward a losing proposal instead. It's all good, Marilyn > > > --------------------------------- > | Dennis | DennisR at dair.com | > | Reinhardt | http://www.dair.com | > --------------------------------- > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From spmcinerney at hotmail.com Thu Feb 1 07:33:12 2007 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Wed, 31 Jan 2007 22:33:12 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: <20070201055610.BB2591E4006@bag.python.org> Message-ID: Marilyn, I think JJ asked the question in a neutral way, the majority has weighed in on this, and I think it's time to close the discussion for 2007. The count of all people who want to change the name (to all the various new proposed names) is heavily outnumbered by something like ~1:3 or 1:4 by the people who don't. When this same question was asked in 2006 (by your poll) the results were similarly heavily against. I totally understand you strongly dislike the name but I can't see any better alternative that has been proposed. At some point we have to end this iteration of the discussion - can we at least follow Terry's suggestion and take this off the table until Feb 2008? I would much rather spend time finalizing February's unconfirmed meeting agenda, the March meeting (whether people will organized a presentation on what they attended at PyCon or not), profiling, possibly a recruiter's evening, Python in animation, Python in education, capabilities-secure Pyth-E, the Bay Area bid for PyCon 2008, and other proposals for this year's coming meetings. Tomorrow is already Feb 1, and yet again http://www.baypiggies.net/ is still showing the January meeting instead of the forthcoming (unconfirmed) Feb 8 meeting! This is really very poor, and to my mind infinitely more unprofessional than any choice of group name. For the record my votes are: -1 to namechange +1 to -admin list (for activity organizing, not this sort of meta-discussion) +1 to [JOBS] and [ADMIN] tags on existing list Regards, Stephen _________________________________________________________________ Turn searches into helpful donations. Make your search count. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donation&FORM=WLMTAG From aahz at pythoncraft.com Thu Feb 1 15:22:42 2007 From: aahz at pythoncraft.com (Aahz) Date: Thu, 1 Feb 2007 06:22:42 -0800 Subject: [Baypiggies] [ADMIN] List language In-Reply-To: <20070201055610.BB2591E4006@bag.python.org> References: <20070201055610.BB2591E4006@bag.python.org> Message-ID: <20070201142242.GB24639@panix.com> On Wed, Jan 31, 2007, Marilyn Davis wrote: > ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: >> >> I think those of us who wanted the name changed should acknowledge >> that we're substantially in the minority and accept it, at least for >> a respectful amount of time. Let's check in maybe a couple years >> after the last vote on this. > > Yes. It was JJ, who is opposed to name-changing, who is polling > the group about this, which wasn't anyone's proposal. Sort of a > slight-of-hand, mob-rule kind of trick. Really? Saying things like makes me wonder who exactly is playing the trick, so here are your own words: http://mail.python.org/pipermail/baypiggies/2006-April/000376.html Although I'm no longer the official list admin, I still would like this list conducted with professional language, and using terms such as "slight-of-hand", "mob-rule", and "trick" is insulting, offensive, and inappropriate. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From jim at well.com Thu Feb 1 15:28:56 2007 From: jim at well.com (jim stockford) Date: Thu, 1 Feb 2007 06:28:56 -0800 Subject: [Baypiggies] Seeking February (and March and April) speakers In-Reply-To: <45B628D1.2060301@bigasterisk.com> References: <45B628D1.2060301@bigasterisk.com> Message-ID: <8d1ac7aace7a0fe16c64089bae6089c9@well.com> thanks again for volunteering. could you get me the following info for me to include in the meeting announcement: your name as you'd like it listed any affiliation you'd like to mention some salient bio (couple of sentences or so) a title for your presentation a couple or three sentences summarizing the topic many thanks, jim stockford 415 823 4590 my cellphone, call anytime i figure Dennis will go first, then you, then ken. can change the order if you wish. jim On Jan 23, 2007, at 7:25 AM, Drew Perttula wrote: > Stephen McInerney wrote: >> * Ken Seehart had expressed interest in presenting a snippet from >> January? >> There seemed to be support for aiming to regularly *briefly* present >> 1/2 snippets at the start of each meeting, before the main activity. >> (I forget did Drew mention something as well?) > > http://drewp.quickwitretort.com/2006/12/25/0 > > I could demo that and explain how it works. > From aahz at pythoncraft.com Thu Feb 1 15:27:33 2007 From: aahz at pythoncraft.com (Aahz) Date: Thu, 1 Feb 2007 06:27:33 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: References: <20070201055610.BB2591E4006@bag.python.org> Message-ID: <20070201142733.GC24639@panix.com> On Wed, Jan 31, 2007, Stephen McInerney wrote: > > can we at least follow Terry's suggestion and take this off the table > until Feb 2008? Two years would be Feb 2009. Given that two successive polls have declined the namechange by a landslide, I would prefer to remove this issue from discussion for at least five years. I suspect that many people would agree with "never" for the next time, if only because the discussion itself causes more pain than the name. In any event, I think it would be appropriate for JJ to make a list ruling specifying the next time. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From jim at well.com Thu Feb 1 15:43:23 2007 From: jim at well.com (jim stockford) Date: Thu, 1 Feb 2007 06:43:23 -0800 Subject: [Baypiggies] Seeking February (and March and April) speakers In-Reply-To: <8d1ac7aace7a0fe16c64089bae6089c9@well.com> References: <45B628D1.2060301@bigasterisk.com> <8d1ac7aace7a0fe16c64089bae6089c9@well.com> Message-ID: <62903e6a15d3884932308e0cc9f20298@well.com> sorry all, that was meant for drew. too early and too busy, made (another) mistake. On Feb 1, 2007, at 6:28 AM, jim stockford wrote: > > thanks again for volunteering. > could you get me the following info for > me to include in the meeting announcement: > > your name as you'd like it listed > any affiliation you'd like to mention > some salient bio (couple of sentences or so) > a title for your presentation > a couple or three sentences summarizing the topic > > many thanks, > jim stockford > 415 823 4590 my cellphone, call anytime > > i figure Dennis will go first, then you, then ken. > can change the order if you wish. > jim > > > On Jan 23, 2007, at 7:25 AM, Drew Perttula wrote: > >> Stephen McInerney wrote: >>> * Ken Seehart had expressed interest in presenting a snippet from >>> January? >>> There seemed to be support for aiming to regularly *briefly* present >>> 1/2 snippets at the start of each meeting, before the main activity. >>> (I forget did Drew mention something as well?) >> >> http://drewp.quickwitretort.com/2006/12/25/0 >> >> I could demo that and explain how it works. >> > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From tungwaiyip at yahoo.com Thu Feb 1 03:02:06 2007 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Thu, 01 Feb 2007 10:02:06 +0800 Subject: [Baypiggies] [vote] admin list, jobs list, name change In-Reply-To: <45BFF89F.4020009@sidorof.com> References: <45BFF89F.4020009@sidorof.com> Message-ID: > admin: -1 > jobs: -1 > > name change: -1 -1 for all. I was without network for a few days and come back to find my mailbox overflow with votes and discussions. I only hope this will lead to some constructive end. I do suggest next time we use some sort of web polling instead of sending out tons of email to the list. After this we should summarize the result into stated policy. This may not be a scientific poll but enough people have voiced their opinion and this may have already costed us a few membership. I'm no fans of a lot of policies. Everytime Aahz warned people on policy violation I found his seriousness a bit comical. But if lack of policy causes endless debate, I would much prefer it settled by stated policies. I am mortified by the suggestion that we should have another name change vote in 2008 or 2009. We should consider the issue settled. Unless there are demonstrated change in membership profile or other catalytic event like Python has itself changed its name due to consideration of its offensiveness, we should not reopen the same issue again. Furthermore I suggest we make it a policy to prohibit prolonged discussion on group policies. The admin should invite people to take such discussion off the list. The purpose is not to suppress different opinions but to prioritize this list for Python related discussions. If having a wiki on our web site would facilitate them then we should create one. Sorry for adding to the already overloaded discussion. Wai Yip From jjinux at gmail.com Thu Feb 1 23:11:55 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 14:11:55 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: <20070201055610.BB2591E4006@bag.python.org> References: <20070201055610.BB2591E4006@bag.python.org> Message-ID: On 1/31/07, Marilyn Davis wrote: > ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: > > > At 05:24 PM 1/31/2007, Terry Carroll wrote: > >>On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: > >> > >> > To change the name of this mailing list, vote +1 and propose an alternate. > >> > To keep the existing name, vote -1. > > > > -1 to change the name of *this* list > > +1 to create a new name for list(s) we are about to add. > > > > [BayPiggies Announce] is just too long for a new list name > > [BP Announce] or some short name is better for *new* list > > We haven't been invited to vote on that, although that was the proposal I put forward. Thank you for remembering. > > Terry Carroll said: > > > +0 > > > > I would like the group's name changed, and voted to do so last time, which > > was not all that long ago. > > > > I think those of us who wanted the name changed should acknowledge that > > we're substantially in the minority and accept it, at least for a > > respectful amount of time. Let's check in maybe a couple years after the > > last vote on this. > > -- > > Yes. It was JJ, who is opposed to name-changing, who is polling the group about this, which wasn't anyone's proposal. Sort of a slight-of-hand, mob-rule kind of trick. But, I say this smiling, because it is amusing and not so important. I just thought the pending length of the new lists' names was a good excuse to bend the name a little and appease us who are not content with the name. But, clearly JJ didn't agree and put forward a losing proposal instead. > > It's all good, I object to this characterization of my behavior. My main objection to the name change is due to the burden it places on all the members. I never even seriously considered having two lists with different prefixes. Those who know me well know that I'm a stickler for consistency, so I would naturally object to two lists, one called baypiggies at python.org and the other bp-announce at python.org. Where you are looking to see maliciousness, there is only my obsessive compulsive need to make things consistent ;) No offense taken, though. Let's move on. -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Thu Feb 1 23:22:23 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 14:22:23 -0800 Subject: [Baypiggies] [vote] admin list, jobs list In-Reply-To: <154395.58407.qm@web36109.mail.mud.yahoo.com> References: <154395.58407.qm@web36109.mail.mud.yahoo.com> Message-ID: On 1/30/07, Praveen Kumar wrote: > > * Should we have an admin list? (+1 yes, -1 no) > > * Should we have a separate jobs list? (+1 yes, -1 no) > > Don't care. But how about a separate list just for final event announcements ( > no discussions ) ? That has already been agreed on. :) Best Regards, -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Thu Feb 1 23:37:45 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 14:37:45 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: References: Message-ID: On 1/30/07, Shannon -jj Behrens wrote: > Ok, let's address the mother of all arguments--the name change ;) > > Instructions: > To change the name of this mailing list, vote +1 and propose an alternate. > To keep the existing name, vote -1. > > Certain of our readers object to the term "baypiggies" due to the > negative connotation. Clearly, a better term might have been > "baysmarties", but I digress ;) > > As we come to conclusion about the direction of this mailing list, it > makes sense to bite the bullet and vote on whether to keep the name > baypiggies. As a historical note (Aahz can correct me), baypiggies > stands for "Bay Area Python Interest Group", which makes sense. > > If we change the name baypiggies, we may (arguably) gain a name with a > better connotation, but we risk irritating a lot of people who will > have to update their mail filters and learn a new email address to > send mail to. Worst of all, there may be instances of this email > address in the wild, and I'm not sure if I can set it up as an alias > if we decide to go with a new name. > > Because of the severe drawbacks of this change, I'd like to be > conservative and propose that we only change the name if we have 10 or > more +1s and no more than half as many -1s. I think requiring a two > to one vote is fair given the advantages vs. the disadvantages of > making this change. Ok, thank you all for responding. Thank you too for bearing with the volume of email. Here are the results: Yes: marilyn at deliberate.com carroll at tjc.com DennisR at dair.com (but only for the announce list) No: aahz at pythoncraft.com bdbaddog at gmail.com cvanarsdall at mvista.com dbs at abaca.com DennisR at dair.com doug.durham at yahoo.com ds-bp at sidorof.com eric at ericwalstad.com jjhartley at att.net kenobi at gmail.com krishna2 at krishna2.com mac at wireless.com mrbmahoney at gmail.com richardk at adax.com rstephe at sun.science.wayne.edu spmcinerney at hotmail.com tungwaiyip at yahoo.com webmaven at cox.net wescpy at gmail.com ylchobe at gmail.com I think that constitutes clear consensus. We will not be changing our name. As moderator of this mailing list, I'd like to close this discussion for at least two years, which I feel is reasonable and moderate. However, I suspect that in the period of just two years, it's unlikely that the consensus will have changed much. Ok, now that we're done with that, let's get back to talking about Python! Best Regards, -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Thu Feb 1 23:39:32 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 14:39:32 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: References: Message-ID: By the way, on the subject of "bp-announce at python.org", I'm going to pull that discussion into a new thread now that this poll has completed. Best Regards, -jj On 2/1/07, Shannon -jj Behrens wrote: > On 1/30/07, Shannon -jj Behrens wrote: > > Ok, let's address the mother of all arguments--the name change ;) > > > > Instructions: > > To change the name of this mailing list, vote +1 and propose an alternate. > > To keep the existing name, vote -1. > > > > Certain of our readers object to the term "baypiggies" due to the > > negative connotation. Clearly, a better term might have been > > "baysmarties", but I digress ;) > > > > As we come to conclusion about the direction of this mailing list, it > > makes sense to bite the bullet and vote on whether to keep the name > > baypiggies. As a historical note (Aahz can correct me), baypiggies > > stands for "Bay Area Python Interest Group", which makes sense. > > > > If we change the name baypiggies, we may (arguably) gain a name with a > > better connotation, but we risk irritating a lot of people who will > > have to update their mail filters and learn a new email address to > > send mail to. Worst of all, there may be instances of this email > > address in the wild, and I'm not sure if I can set it up as an alias > > if we decide to go with a new name. > > > > Because of the severe drawbacks of this change, I'd like to be > > conservative and propose that we only change the name if we have 10 or > > more +1s and no more than half as many -1s. I think requiring a two > > to one vote is fair given the advantages vs. the disadvantages of > > making this change. > > Ok, thank you all for responding. Thank you too for bearing with the > volume of email. Here are the results: > > Yes: > marilyn at deliberate.com > carroll at tjc.com > DennisR at dair.com (but only for the announce list) > No: > aahz at pythoncraft.com > bdbaddog at gmail.com > cvanarsdall at mvista.com > dbs at abaca.com > DennisR at dair.com > doug.durham at yahoo.com > ds-bp at sidorof.com > eric at ericwalstad.com > jjhartley at att.net > kenobi at gmail.com > krishna2 at krishna2.com > mac at wireless.com > mrbmahoney at gmail.com > richardk at adax.com > rstephe at sun.science.wayne.edu > spmcinerney at hotmail.com > tungwaiyip at yahoo.com > webmaven at cox.net > wescpy at gmail.com > ylchobe at gmail.com > > I think that constitutes clear consensus. We will not be changing our > name. As moderator of this mailing list, I'd like to close this > discussion for at least two years, which I feel is reasonable and > moderate. However, I suspect that in the period of just two years, > it's unlikely that the consensus will have changed much. > > Ok, now that we're done with that, let's get back to talking about Python! > > Best Regards, > -jj > > -- > http://jjinux.blogspot.com/ > -- http://jjinux.blogspot.com/ From eric at ericwalstad.com Fri Feb 2 00:20:09 2007 From: eric at ericwalstad.com (Eric Walstad) Date: Thu, 01 Feb 2007 15:20:09 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: References: Message-ID: <45C275A9.7050502@ericwalstad.com> And now for something completely different... > let's get back to talking about Python! ...and there was much rejoicing. Thanks JJ. -E From annaraven at gmail.com Fri Feb 2 00:28:09 2007 From: annaraven at gmail.com (Anna Ravenscroft) Date: Thu, 1 Feb 2007 15:28:09 -0800 Subject: [Baypiggies] PyGame anyone? Message-ID: Does anyone here use PyGame? Is there a good tutorial for it online somewhere? If not, what was your favorite way of learning more about it? -- cordially, Anna -- It is fate, but call it Italy if it pleases you, Vicar! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070201/44d233b8/attachment.html From jjinux at gmail.com Fri Feb 2 00:39:02 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 15:39:02 -0800 Subject: [Baypiggies] [vote] admin list, jobs list In-Reply-To: References: Message-ID: On 1/30/07, Shannon -jj Behrens wrote: > Ok, I'm getting mixed messages on two topics: > > * Should we have an admin list? (+1 yes, -1 no) > > * Should we have a separate jobs list? (+1 yes, -1 no) > > Well, this is a mailing list, so of course we'll disagree. > > If you want a separate admin list, speak now. I'm personally against > it. However, if I get four or more +1's and no more than half as many > -1's, I'll let myself be vetoed. > > As for the separate jobs list, some are arguing for it and some are > arguing against it. I'm really quite confused because the arguments > are pretty much sounding the same on both sides. Hence, my default > decision is to drop it. We can stick with a subject line prefix with > the existing list. If you really want the new list, speak now. > Again, four or more +1's and no more than half as many -1's. Ok, thank you all for voting, and thank you for your patience during the flood of emails. Here are the results: Admin List: Yes: spmcinerney at hotmail.com No: carroll at tjc.com ds-bp at sidorof.com harrington_chad at hotmail.com tungwaiyip at yahoo.com wescpy at gmail.com Jobs List: Yes: harrington_chad at hotmail.com spmcinerney at hotmail.com (to avoid clogging the main list) No: carroll at tjc.com ds-bp at sidorof.com tungwaiyip at yahoo.com wescpy at gmail.com I think this constitutes clear consensus: we will *not* have separate jobs and admin lists. Previously, we decided that we liked the idea of a moderated announce list, as long as baypiggies at python.org also gets all the announcements. It is likely that we will adopt the use of an email prefix such as "[jobs]" for job postings. I may state this more formally later. As list moderator, I'd like to close this discussion for a period of at least two years. Best Regards, -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Fri Feb 2 00:40:37 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 15:40:37 -0800 Subject: [Baypiggies] Fwd: PyGame anyone? In-Reply-To: References: Message-ID: On 2/1/07, Anna Ravenscroft wrote: > Does anyone here use PyGame? Is there a good tutorial for it online > somewhere? If not, what was your favorite way of learning more about it? There's going to be a talk about it at PyCon, and I think there was a tutorial at last year's PyCon. It may be possible to find the materials. Best Regards, -jj -- http://jjinux.blogspot.com/ From aahz at pythoncraft.com Fri Feb 2 00:46:29 2007 From: aahz at pythoncraft.com (Aahz) Date: Thu, 1 Feb 2007 15:46:29 -0800 Subject: [Baypiggies] PyGame anyone? In-Reply-To: References: Message-ID: <20070201234629.GA22575@panix.com> On Thu, Feb 01, 2007, Anna Ravenscroft wrote: > > Does anyone here use PyGame? Is there a good tutorial for it online > somewhere? If not, what was your favorite way of learning more about it? http://pygame.org/wiki/tutorials Don't bother with the new book "Game Programming: The L Line". -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From DOBrien at LeapFrog.com Fri Feb 2 01:12:26 2007 From: DOBrien at LeapFrog.com (Dennis O'Brien) Date: Thu, 1 Feb 2007 16:12:26 -0800 Subject: [Baypiggies] PyGame anyone? In-Reply-To: Message-ID: > Does anyone here use PyGame? Is there a good tutorial for it online > somewhere? If not, what was your favorite way of learning more about it? ShowMeDo has some intro screencasts/tutorials on PyGame. http://showmedo.com/videos/series?name=pythonMayerPyGameSeries http://showmedo.com/videos/series?name=pythonArellanoPyGameSeries If you are like me, you learn best by doing. There is another 1 week PyGame challenge coming up at PyWeek in April. http://www.pyweek.org/ You can also look through some of the previous entries including source code. http://www.pyweek.org/3/entries/ http://www.pyweek.org/2/entries/ --Dennis From marilyn at deliberate.com Fri Feb 2 02:47:16 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Thu, 01 Feb 2007 17:47:16 -0800 Subject: [Baypiggies] [vote] name change Message-ID: <20070202014719.EE0AF1E4006@bag.python.org> ----- On Thursday, February 1, 2007 jjinux at gmail.com wrote: > On 1/31/07, Marilyn Davis wrote: >> ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: >> >> > At 05:24 PM 1/31/2007, Terry Carroll wrote: >> >>On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: >> >> >> >> > To change the name of this mailing list, vote +1 and propose an alternate. >> >> > To keep the existing name, vote -1. >> > >> > -1 to change the name of *this* list >> > +1 to create a new name for list(s) we are about to add. >> > >> > [BayPiggies Announce] is just too long for a new list name >> > [BP Announce] or some short name is better for *new* list >> >> We haven't been invited to vote on that, although that was the proposal I > put forward. Thank you for remembering. >> >> Terry Carroll said: >> >> > +0 >> > >> > I would like the group's name changed, and voted to do so last time, which >> > was not all that long ago. >> > >> > I think those of us who wanted the name changed should acknowledge that >> > we're substantially in the minority and accept it, at least for a >> > respectful amount of time. Let's check in maybe a couple years after the >> > last vote on this. >> >> -- >> >> Yes. It was JJ, who is opposed to name-changing, who is polling the group > about this, which wasn't anyone's proposal. Sort of a slight-of-hand, > mob-rule kind of trick. But, I say this smiling, because it is amusing and > not so important. I just thought the pending length of the new lists' names > was a good excuse to bend the name a little and appease us who are not > content with the name. But, clearly JJ didn't agree and put forward a > losing proposal instead. >> >> It's all good, > > I object to this characterization of my behavior. My main objection > to the name change is due to the burden it places on all the members. > I never even seriously considered having two lists with different > prefixes. Those who know me well know that I'm a stickler for > consistency, so I would naturally object to two lists, one called > baypiggies at python.org and the other bp-announce at python.org. > > Where you are looking to see maliciousness, there is only my obsessive > compulsive need to make things consistent ;) No maliciousness was seen, but perhaps an error was made. I don't know you very well, JJ, but I do know that I like you a lot and I'd bet good money that you are never malicious. > > No offense taken, though. Let's move on. Thank you for knowing not to take offense. The manuever that I am judging as a "trick" is, in fact, a standard trick for swaying people. Using faulty democratic procedure is so common in our current culture that almost no one knows what real democratic procedure is, and what a trick is. I'll explain, but first, regrettably, I have to defend myself: ----- On Thursday, February 1, 2007 aahz at pythoncraft.com wrote: > On Wed, Jan 31, 2007, Marilyn Davis wrote: >> ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: >>> >>> I think those of us who wanted the name changed should acknowledge >>> that we're substantially in the minority and accept it, at least for >>> a respectful amount of time. Let's check in maybe a couple years >>> after the last vote on this. >> >> Yes. It was JJ, who is opposed to name-changing, who is polling >> the group about this, which wasn't anyone's proposal. Sort of a >> slight-of-hand, mob-rule kind of trick. > > Really? Saying things like makes me wonder who exactly is playing the > trick, so here are your own words: > > http://mail.python.org/pipermail/baypiggies/2006-April/000376.html No, that email is from the first poll and has nothing to do with this one. But it does support my argument that the poll was a "trick", and a trick that you fell for, because you believed that I put the proposal forward. I did not. Again, I'm willing to believe that you made an unintentional mistake in claiming that you caught me in a lie. It was a "trick" on me though, and on us. Many people will read your email and label me a "liar" and never fully correct that false impression, no matter how much and how well I defend myself. > > Although I'm no longer the official list admin, I still would like this > list conducted with professional language, and using terms such as > "slight-of-hand", "mob-rule", and "trick" is insulting, offensive, and > inappropriate. Truth is always appropriate. Here was the proposal I did put forward. I don't remember any real comments. Please correct me if I'm wrong. ----- On Friday, January 26, 2007 marilyn at deliberate.com wrote: > Hi, > > I want to suggest that instead of baypiggies-xxxx at python.org, that the new > lists' names be shortened to bp-xxxx at python.org for 2 reasons: > > 1. Long names take up too much space on the subject line. > > 2. Those of us who are uncomfortable with the "piggie" name, can think of > ourselves as the Bay Python group. > > Just to remind you, we ran a poll about the current name last year and 18 of > 51 voters thought the name bad enough to warrant renaming the group. That's > 35%! That's huge. > > Here are results of that poll: > > Number of Voters Subject Poll Type Result Summary > > 51 Change name? Public [-1,1] [18/29] 0.62:1 > > bp-xxxx at python.org would be a nice gesture to the 18 of us. > > What do you think? > > Marilyn And JJ's response a few days later. Please note that there was no mention of the real proposal. It was vetoed without a word of explanation --- until today. But, instead of speaking to my proposal, we got this one, a sure loser: ----- On Tuesday, January 30, 2007 jjinux at gmail.com wrote: > Ok, let's address the mother of all arguments--the name change ;) > > Instructions: > To change the name of this mailing list, vote +1 and propose an alternate. > To keep the existing name, vote -1. > > Certain of our readers object to the term "baypiggies" due to the > negative connotation. Clearly, a better term might have been > "baysmarties", but I digress ;) > > As we come to conclusion about the direction of this mailing list, it > makes sense to bite the bullet and vote on whether to keep the name > baypiggies. As a historical note (Aahz can correct me), baypiggies > stands for "Bay Area Python Interest Group", which makes sense. > > If we change the name baypiggies, we may (arguably) gain a name with a > better connotation, but we risk irritating a lot of people who will > have to update their mail filters and learn a new email address to > send mail to. Worst of all, there may be instances of this email > address in the wild, and I'm not sure if I can set it up as an alias > if we decide to go with a new name. > > Because of the severe drawbacks of this change, I'd like to be > conservative and propose that we only change the name if we have 10 or > more +1s and no more than half as many -1s. I think requiring a two > to one vote is fair given the advantages vs. the disadvantages of > making this change. And Stephen, this was *very* negatively proposed. Why did you claim otherwise? A mistake? More importantly, no one who is in favor of changing the name had anything to do with this proposal. This is not a democratic jesture. It is a nip-this-in-the-bud gesture: to propose a poll that you are opposed to, when there has been no proposal or discussion from anyone else, and, furthermore, to propose it so negatively. Yet, people on both sides of the issue have said things that indicate that they were sure that the poll was proposed by proponents, even by me. It is precisely that is natural to assume that a poll would be put forward by proponents that it was a trick. So, it was a trick, probably an unconscious trick, but a trick, on me, and on us, the group. Democracy is a state of mind, a way of being. When someone uses an ostensibly democratic procudure, it can be for one of two purposes, not both: 1. To ascertain the collective will of the group. 2. To sway the group. The 2nd purpose is not democracy, but a trick on the people, a slight-of-hand, mob-rule trick. That's what it is. And in this case, because it made people believe that proponents had the bad taste to put forward another name-change proposal so soon, it was a doubly-dirty trick, resulting in a ban on talking about name-change. Not good. I'm very willing to accept that the two tricks played on us, and Stephen's mistake, were unconscious. But I can't help but point out that accepting for oneself the label "piggy" would *exactly* have an influence toward making oneself unconscious and uncareful and unattentive. I wish my Python-loving friends weren't required to be subject to such an influence to be in the club. How about: Bay Area Python Flying Circus? OK. Now I'm ready to go on. JJ, again I thank you for taking the hard task of being under my critical eyeball. I hope you continue to be unoffended. Fondly, Marilyn From jjinux at gmail.com Fri Feb 2 03:31:22 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 18:31:22 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: <20070202014719.EE0AF1E4006@bag.python.org> References: <20070202014719.EE0AF1E4006@bag.python.org> Message-ID: On 2/1/07, Marilyn Davis wrote: > ----- On Thursday, February 1, 2007 jjinux at gmail.com wrote: > > > On 1/31/07, Marilyn Davis wrote: > >> ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: > >> > >> > At 05:24 PM 1/31/2007, Terry Carroll wrote: > >> >>On Tue, 30 Jan 2007, Shannon -jj Behrens wrote: > >> >> > >> >> > To change the name of this mailing list, vote +1 and propose an alternate. > >> >> > To keep the existing name, vote -1. > >> > > >> > -1 to change the name of *this* list > >> > +1 to create a new name for list(s) we are about to add. > >> > > >> > [BayPiggies Announce] is just too long for a new list name > >> > [BP Announce] or some short name is better for *new* list > >> > >> We haven't been invited to vote on that, although that was the proposal I > > put forward. Thank you for remembering. > >> > >> Terry Carroll said: > >> > >> > +0 > >> > > >> > I would like the group's name changed, and voted to do so last time, which > >> > was not all that long ago. > >> > > >> > I think those of us who wanted the name changed should acknowledge that > >> > we're substantially in the minority and accept it, at least for a > >> > respectful amount of time. Let's check in maybe a couple years after the > >> > last vote on this. > >> > >> -- > >> > >> Yes. It was JJ, who is opposed to name-changing, who is polling the group > > about this, which wasn't anyone's proposal. Sort of a slight-of-hand, > > mob-rule kind of trick. But, I say this smiling, because it is amusing and > > not so important. I just thought the pending length of the new lists' names > > was a good excuse to bend the name a little and appease us who are not > > content with the name. But, clearly JJ didn't agree and put forward a > > losing proposal instead. > >> > >> It's all good, > > > > I object to this characterization of my behavior. My main objection > > to the name change is due to the burden it places on all the members. > > I never even seriously considered having two lists with different > > prefixes. Those who know me well know that I'm a stickler for > > consistency, so I would naturally object to two lists, one called > > baypiggies at python.org and the other bp-announce at python.org. > > > > Where you are looking to see maliciousness, there is only my obsessive > > compulsive need to make things consistent ;) > > No maliciousness was seen, but perhaps an error was made. I don't know you very well, JJ, but I do know that I like you a lot and I'd bet good money that you are never malicious. > > > > > No offense taken, though. Let's move on. > > Thank you for knowing not to take offense. > > The manuever that I am judging as a "trick" is, in fact, a standard trick for swaying people. Using faulty democratic procedure is so common in our current culture that almost no one knows what real democratic procedure is, and what a trick is. > > I'll explain, but first, regrettably, I have to defend myself: > > ----- On Thursday, February 1, 2007 aahz at pythoncraft.com wrote: > > > On Wed, Jan 31, 2007, Marilyn Davis wrote: > >> ----- On Wednesday, January 31, 2007 DennisR at dair.com wrote: > >>> > >>> I think those of us who wanted the name changed should acknowledge > >>> that we're substantially in the minority and accept it, at least for > >>> a respectful amount of time. Let's check in maybe a couple years > >>> after the last vote on this. > >> > >> Yes. It was JJ, who is opposed to name-changing, who is polling > >> the group about this, which wasn't anyone's proposal. Sort of a > >> slight-of-hand, mob-rule kind of trick. > > > > Really? Saying things like makes me wonder who exactly is playing the > > trick, so here are your own words: > > > > http://mail.python.org/pipermail/baypiggies/2006-April/000376.html > > No, that email is from the first poll and has nothing to do with this one. > > But it does support my argument that the poll was a "trick", and a trick that you fell for, because you believed that I put the proposal forward. I did not. Again, don't mistake my ignorance for malice. I posed that poll because I knew some people were interested in a name change. I didn't have any specific, prior proposals in mind. I surely didn't have that email you quoted memorized. I think "should we change our name" is a reasonable question. I still think having "baypiggies at python.org" and "bp-announce at python.org" is both inconsistent and confusing. Furthermore, as long as you yourself continue to subscribe to this list, having a "bp-announce at python.org" doesn't help you in your resolve to not call yourself a piggy. > Again, I'm willing to believe that you made an unintentional mistake in claiming that you caught me in a lie. > > It was a "trick" on me though, and on us. Many people will read your email and label me a "liar" and never fully correct that false impression, no matter how much and how well I defend myself. > > > > > Although I'm no longer the official list admin, I still would like this > > list conducted with professional language, and using terms such as > > "slight-of-hand", "mob-rule", and "trick" is insulting, offensive, and > > inappropriate. > > Truth is always appropriate. > > Here was the proposal I did put forward. I don't remember any real comments. Please correct me if I'm wrong. > > ----- On Friday, January 26, 2007 marilyn at deliberate.com wrote: > > > Hi, > > > > I want to suggest that instead of baypiggies-xxxx at python.org, that the new > > lists' names be shortened to bp-xxxx at python.org for 2 reasons: > > > > 1. Long names take up too much space on the subject line. > > > > 2. Those of us who are uncomfortable with the "piggie" name, can think of > > ourselves as the Bay Python group. > > > > Just to remind you, we ran a poll about the current name last year and 18 of > > 51 voters thought the name bad enough to warrant renaming the group. That's > > 35%! That's huge. > > > > Here are results of that poll: > > > > Number of Voters Subject Poll Type Result Summary > > > > 51 Change name? Public [-1,1] [18/29] 0.62:1 > > > > bp-xxxx at python.org would be a nice gesture to the 18 of us. > > > > What do you think? > > > > Marilyn > > And JJ's response a few days later. Please note that there was no mention of the real proposal. It was vetoed without a word of explanation --- until today. It wasn't vetoed ;) It was simply forgotten. > But, instead of speaking to my proposal, we got this one, a sure loser: > > ----- On Tuesday, January 30, 2007 jjinux at gmail.com wrote: > > > Ok, let's address the mother of all arguments--the name change ;) > > > > Instructions: > > To change the name of this mailing list, vote +1 and propose an alternate. > > To keep the existing name, vote -1. > > > > Certain of our readers object to the term "baypiggies" due to the > > negative connotation. Clearly, a better term might have been > > "baysmarties", but I digress ;) > > > > As we come to conclusion about the direction of this mailing list, it > > makes sense to bite the bullet and vote on whether to keep the name > > baypiggies. As a historical note (Aahz can correct me), baypiggies > > stands for "Bay Area Python Interest Group", which makes sense. > > > > If we change the name baypiggies, we may (arguably) gain a name with a > > better connotation, but we risk irritating a lot of people who will > > have to update their mail filters and learn a new email address to > > send mail to. Worst of all, there may be instances of this email > > address in the wild, and I'm not sure if I can set it up as an alias > > if we decide to go with a new name. > > > > Because of the severe drawbacks of this change, I'd like to be > > conservative and propose that we only change the name if we have 10 or > > more +1s and no more than half as many -1s. I think requiring a two > > to one vote is fair given the advantages vs. the disadvantages of > > making this change. > > And Stephen, this was *very* negatively proposed. Why did you claim otherwise? A mistake? I did actually try to be objective in making that proposal. I wasn't trying to be negative. > More importantly, no one who is in favor of changing the name had anything to do with this proposal. This is not a democratic jesture. It is a nip-this-in-the-bud gesture: to propose a poll that you are opposed to, when there has been no proposal or discussion from anyone else, and, furthermore, to propose it so negatively. > > Yet, people on both sides of the issue have said things that indicate that they were sure that the poll was proposed by proponents, even by me. The poll was proposed by me in response to what I thought was on a lot of people's minds. > It is precisely that is natural to assume that a poll would be put forward by proponents that it was a trick. > > So, it was a trick, probably an unconscious trick, but a trick, on me, and on us, the group. > > Democracy is a state of mind, a way of being. When someone uses an ostensibly democratic procudure, it can be for one of two purposes, not both: > > 1. To ascertain the collective will of the group. > > 2. To sway the group. I should be clear about how I plan on moderating this list. I don't pretend to call it a democracy. The readers will kill me if I pose a poll on every little decision. Rather, I said before that I'm a fan of benevolent dictatorships. I'm going to do what I feel the readers want. When I'm unsure of what they want, I'll pose a poll to figure out what they want. When I see rough consensus, I will go with the consensus even if I don't agree. I posed a question "should we change the name BayPiggies" because I think that's a valid question, and I wanted to know the answer. I hadn't planned on putting forth a poll on "bp-announce at python.org" vs. "baypiggies-announce at python.org" because I think "bp-announce" is confusing and inconsistent. > The 2nd purpose is not democracy, but a trick on the people, a slight-of-hand, mob-rule trick. That's what it is. > > And in this case, because it made people believe that proponents had the bad taste to put forward another name-change proposal so soon, it was a doubly-dirty trick, resulting in a ban on talking about name-change. Let me be clear, *I'm* the one who put forth the poll based on my perceived notion of discontent in the crowd. > Not good. > > I'm very willing to accept that the two tricks played on us, and Stephen's mistake, were unconscious. But I can't help but point out that accepting for oneself the label "piggy" would *exactly* have an influence toward making oneself unconscious and uncareful and unattentive. Actually, I don't label myself a piggy at all. However, if I did label myself a piggy, it would have a positive connotation, because pigs are well known to be quite intelligent. > I wish my Python-loving friends weren't required to be subject to such an influence to be in the club. > > How about: Bay Area Python Flying Circus? > > OK. Now I'm ready to go on. > > JJ, again I thank you for taking the hard task of being under my critical eyeball. I hope you continue to be unoffended. It comes with the job ;) Name me one US president that wasn't criticized, and I'll start feeling self conscious ;) Now, can we move on? Best Regards, -jj -- http://jjinux.blogspot.com/ From carroll at tjc.com Fri Feb 2 03:37:19 2007 From: carroll at tjc.com (Terry Carroll) Date: Thu, 1 Feb 2007 18:37:19 -0800 (PST) Subject: [Baypiggies] [vote] name change In-Reply-To: Message-ID: On Thu, 1 Feb 2007, Shannon -jj Behrens wrote: > Ok, thank you all for responding. Thank you too for bearing with the > volume of email. Here are the results: > > Yes: > ... > carroll at tjc.com Just a point of clarity: I did not vote Yes; I was a +0; meant to be abstaining. Sorry if that wasn't clear. My comment accompanying my vote was that, although I would like a name change, we went through that vote last year, and those of us who wanted the name change should acknowledge we lost and move on. My abstention was my way of doing that; a Yes vote would have been inconsistent with my position. But, no harm, no foul. From leowils at yahoo.com Fri Feb 2 03:34:11 2007 From: leowils at yahoo.com (Leo Wils) Date: Thu, 1 Feb 2007 18:34:11 -0800 (PST) Subject: [Baypiggies] jj - Please consider grouping and labeling Baypiggies Digests by subject line categories In-Reply-To: Message-ID: <20070202023411.74506.qmail@web31106.mail.mud.yahoo.com> I have a suggestion for jj and others to consider. This would work for me, and might work for others. The implementation is easy. It has some of the advantages of separate mailing lists. Presort the Baypiggies email into a small number of predefined categories. This can be done by prepending a category to each subject line, such as JOBS, ADMINISTRATION, UPCOMING MEETINGS, OTHER. Include only one category in each digest mailing, with a subject line beginning with BP_JOBS or something like that. Sorting into categories by the first characters in the subject line is easy. Subject line categories would allow me to more quickly find info about meetings, skip jobs listings, etc. I don't care if I get email I'm not interested in, as long as it is easy to identify. Clever people might find other ways to use subject line categories. - Leo ____________________________________________________________________________________ Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. http://answers.yahoo.com/dir/?link=list&sid=396545367 From jjinux at gmail.com Fri Feb 2 03:42:53 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 1 Feb 2007 18:42:53 -0800 Subject: [Baypiggies] [vote] name change In-Reply-To: References: Message-ID: On 2/1/07, Terry Carroll wrote: > On Thu, 1 Feb 2007, Shannon -jj Behrens wrote: > > > Ok, thank you all for responding. Thank you too for bearing with the > > volume of email. Here are the results: > > > > Yes: > > ... > > carroll at tjc.com > > Just a point of clarity: I did not vote Yes; I was a +0; meant to > be abstaining. Sorry if that wasn't clear. > > My comment accompanying my vote was that, although I would like a name > change, we went through that vote last year, and those of us who wanted > the name change should acknowledge we lost and move on. My abstention was > my way of doing that; a Yes vote would have been inconsistent with my > position. > > But, no harm, no foul. My apologies. -jj -- http://jjinux.blogspot.com/ From wescpy at gmail.com Fri Feb 2 03:51:06 2007 From: wescpy at gmail.com (wesley chun) Date: Thu, 1 Feb 2007 18:51:06 -0800 Subject: [Baypiggies] ANN: (Intensive) Intro to Python training, Feb 7-9, San Francisco In-Reply-To: <78b3a9580701121458se25c929od439075a565728ba@mail.gmail.com> References: <78b3a9580701121458se25c929od439075a565728ba@mail.gmail.com> Message-ID: <78b3a9580702011851p2defeb96ofa6247f45d05e3b@mail.gmail.com> greetings to all, when i sent my reminder last month, we quickly filled to the maximum capacity of 20 and registration was closed -- apologies to those of you who tried to sign up afterwards. today, i got the venue to move our course to larger facilities, allowing up to 30 attendees, so i have reopened registration for those who need to send someone to Python training ASAP, e.g., next week. there are about 6 more spaces left. feel free to forward my original message to anyone you know may find this useful. the schedule is wed-fri, feb 7-9, 9a-5p daily. thanks, and hope to see you soon! -wesley On 1/12/07, wesley chun wrote: > FINAL REMINDER... as announced last night, we still have some seats left! > > What: (Intensive) Intro to Python > When: February 7-9, 2007 > Where: San Francisco (SFO/San Bruno), CA, USA > Web: http://cyberwebconsulting.com (click "Python Training" link) > > Need to get up-to-speed with Python as quickly as possible? Come join > us in beautiful Northern California for another one of our rigorous > Python training events! This is an intense introduction to Python > directed towards those who have some proficiency in another high-level > language. This course will take place in San Bruno right near the San > Francisco International Airport. > > LOCALS: easy freeway (101/280/380) with lots of parking plus public > transit (BART and CalTrain) access via the San Bruno stations, easily > accessible from all parts of the Bay Area > > VISITORS: free shuttle to/from the airport, free high-speed internet, > free breakfast and evening reception daily > > The cost is $1295 per attendee. Discounts are > available for multiple registrations as well as teachers/students. > Registration will be opening soon for the next Intro and Advanced > courses both taking place back-to-back in May 2007. See website for > more details. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Prentice Hall, (c)2007,2001 http://corepython.com wesley.j.chun :: wescpy-at-gmail.com python training and technical consulting cyberweb.consulting : silicon valley, ca http://cyberwebconsulting.com From aahz at pythoncraft.com Fri Feb 2 05:52:47 2007 From: aahz at pythoncraft.com (Aahz) Date: Thu, 1 Feb 2007 20:52:47 -0800 Subject: [Baypiggies] jj - Please consider grouping and labeling Baypiggies Digests by subject line categories In-Reply-To: <20070202023411.74506.qmail@web31106.mail.mud.yahoo.com> References: <20070202023411.74506.qmail@web31106.mail.mud.yahoo.com> Message-ID: <20070202045247.GA14725@panix.com> On Thu, Feb 01, 2007, Leo Wils wrote: > > Presort the Baypiggies email into a small number of predefined > categories. This can be done by prepending a category to each subject > line, such as JOBS, ADMINISTRATION, UPCOMING MEETINGS, OTHER. > Include only one category in each digest mailing, with a subject > line beginning with BP_JOBS or something like that. Sorting into > categories by the first characters in the subject line is easy. AFAIK, Mailman can't sort digests by subject. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From andywiggin at gmail.com Fri Feb 2 07:32:18 2007 From: andywiggin at gmail.com (Andy Wiggin) Date: Thu, 1 Feb 2007 22:32:18 -0800 Subject: [Baypiggies] PyGame anyone? In-Reply-To: References: Message-ID: <74e7428a0702012232h1427013ewea377d360853640a@mail.gmail.com> On 2/1/07, Anna Ravenscroft wrote: > Does anyone here use PyGame? Is there a good tutorial for it online > somewhere? If not, what was your favorite way of learning more about it? > Occasionally for fun. I liked http://kai.vm.bytemark.co.uk/~piman/writing/sprite-tutorial.shtml http://pygame.org/wiki/tut_design?parent=tutorials (Both links from the pygame tutorial page). My favorite way of learning was using an image of my then-one-year-old daughter as a sprite in my game. It made the testing much more fun. -andy From spmcinerney at hotmail.com Fri Feb 2 07:25:39 2007 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Thu, 01 Feb 2007 22:25:39 -0800 Subject: [Baypiggies] [ADMIN] Don't disclose phone numbers or emails - list archives globally visible Message-ID: Just a reminder to not ever send your personal phone number (as someone did earlier) or a large list of member emails (as JJ did) on this list, because these can be automatically harvested by spammers and robots. There are now very many sites publicly archiving this list, the following gives 976 hits: http://www.google.com/search?hl=en&q=baypiggies+archive , last year it was only 1. Once this stuff gets out there it's impossible to undo it. (Hope we can get back to the February talk organizing now.) Regards, Stephen _________________________________________________________________ FREE online classifieds from Windows Live Expo ? buy and sell with people you know http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06 From kenobi at gmail.com Fri Feb 2 19:02:07 2007 From: kenobi at gmail.com (Rick Kwan) Date: Fri, 2 Feb 2007 10:02:07 -0800 Subject: [Baypiggies] [ADMIN] Don't disclose phone numbers or emails - list archives globally visible In-Reply-To: References: Message-ID: On 2/1/07, Stephen McInerney wrote: > > Just a reminder to not ever send your personal phone number (as someone did earlier) > or a large list of member emails (as JJ did) on this list, because these can be > automatically harvested by spammers and robots. Oh. yeah. I suspect JJ was following my observation that Usenet votes usually published the e-mail addresses of how people voted so that they can be sure they were tallied correctly (as was useful in one case here). With a reliable on-line survey/vote pages, this may no longer be necessary. For web pages where I've had to publish contact info, I've gone to using "(at)" in place of "@", just to slow down the spammers without annoying the daylights out of more naive readers. --Rick Kwan kenobi(at)gmail.com, or perhaps kenobi(at)gmail(dot)com (ugh) > There are now very many sites publicly archiving this list, the following gives 976 hits: > http://www.google.com/search?hl=en&q=baypiggies+archive > , last year it was only 1. Once this stuff gets out there it's impossible to undo it. > > (Hope we can get back to the February talk organizing now.) > > Regards, > Stephen From jjinux at gmail.com Fri Feb 2 20:56:07 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 2 Feb 2007 11:56:07 -0800 Subject: [Baypiggies] [ADMIN] Don't disclose phone numbers or emails - list archives globally visible In-Reply-To: References: Message-ID: As much as I hate spam (having worked at an anti-spam company), let's be realistic. The email addresses I included were already visible because they were sent to the mailing list. Consider http://mail.python.org/pipermail/baypiggies/2007-January.txt. I really don't think spammers are fooled by the simple use of " at " instead of "@". Aahz, I'm open to your advice here. To anyone I recklessly put in spam's way, I apologize. -jj On 2/1/07, Stephen McInerney wrote: > > Just a reminder to not ever send your personal phone number (as someone did > earlier) > or a large list of member emails (as JJ did) on this list, because these can > be > automatically harvested by spammers and robots. > > There are now very many sites publicly archiving this list, > the following gives 976 hits: > http://www.google.com/search?hl=en&q=baypiggies+archive > , last year it was only 1. Once this stuff gets out there it's impossible to > undo it. > > (Hope we can get back to the February talk organizing now.) > > Regards, > Stephen > > _________________________________________________________________ > FREE online classifieds from Windows Live Expo ? buy and sell with people > you know > http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06 > > -- http://jjinux.blogspot.com/ From jim at well.com Sat Feb 3 18:32:37 2007 From: jim at well.com (jim stockford) Date: Sat, 3 Feb 2007 09:32:37 -0800 Subject: [Baypiggies] February Meeting Thursday, the Eighth 7:30 PM to 9:00 Message-ID: <8ba7115955cb7cadba201dec07269e7e@well.com> ------------------------------------------------- ------------------------------------------------- BayPIGgies February Meeting Thursday February 8, 2007 7:30 to 8:50 PM Technical Program ------------------------------------------------- 7:30 moving chairs, greetings, ------------------------------------------------- 7:35 speaker: Dennis Reinhardt organization: DAIR Computer Systems materials URL (after presentation): http://www.spamai.com/present/ project URL: http://www.dialogdevil.com Title: Three Generations of User Interface Abstract: I have implemented DialogDevil via three different user interfaces: (1) direct to Windows API via ctypes (2) wxPython, and (3) separate embedded html-based process. The pros and cons of each approach from a developer's perspective will be discussed using metrics such as memory footprint, download size, flexibility, robustness, and visual styling. ------------------------------------------------- 8:00 Speaker: Drew Perttula Bio: In past Baypiggies meetings, Drew has presented a video editor, an intro to pyrex, and a theater lighting control system. Currently, he spends most of his time working on films with ogres and princesses and on a web game startup. Title: Visualizing python profile results Abstract: I'll present a simple development tool that reads results from the python profiler and renders them into a web page. The page uses colored bars and tinted table cells to highlight additional information about the profile results. ------------------------------------------------- 8:25 Speaker: Ken Seehart Title: Introduction to wxPython ------------------------------------------------- 8:50 announcements, discussion, hubbub ------------------------------------------------- ------------------------------------------------- Next Meetings Undetermined From mrbmahoney at gmail.com Tue Feb 6 01:14:58 2007 From: mrbmahoney at gmail.com (Brian Mahoney) Date: Mon, 5 Feb 2007 16:14:58 -0800 Subject: [Baypiggies] Dinner Announcement - Thursday, Feb 8, 6 pm Message-ID: <5538c19b0702051614l4beb5719o6f3ec7487ee44e@mail.gmail.com> For Thursday, February 8, I can coordinate a pre-meeting dinner in Mountain View, before the BayPIGgies meeting at Google . Restaurant reservations may be sent to my email until Thursday afternoon (earlier is better). We eat family-style, there are vegetarian and non-vegetarian dishes. Cost around $10 per person, including tax and tip. Bring cash, please. Start dinner at 6pm and I will keep things moving so that we finish and get everyone headed towards Google to complete sign-in before the 7:30 meeting start. The restaurant is Cafe Yulong in downtown Mountain View (650) 960-1677 743 W Dana Street, 1/2 block from Castro where Books, Inc is on the corner. Parking lots all around, but downtown Mountain View parking is still difficult. It is a slightly out of the ordinary Chinese restaurant. This link has a downtown map and additional information. http://www.mountainviewca.net/restaurants/cafeyulong.html I've made reservations under "Python" for 6pm Thursday. If you wish to join us for dinner please e-mail me by 3 pm Thursday (earlier is better) so I may confirm the headcount. From walterv at gbbservices.com Tue Feb 6 17:29:04 2007 From: walterv at gbbservices.com (Walter Vannini) Date: Tue, 06 Feb 2007 08:29:04 -0800 Subject: [Baypiggies] ACCU meeting on Wednesday Message-ID: <45C8ACD0.7050807@gbbservices.com> IMPORTANT CHANGE: Due to new PayPal security requirements, we are strongly recommending that you preregister by RSVPing if you think you might be attending. If you forget to preregister, PayPal might not allow us to admit you. Also, all attendees will now need to present some form of Photo ID. To RSVP, please reply to this e-mail, address it to Ali ?ehreli , and add RSVP to the subject line. When: Wednesday, February 7, 2007 Topic: Technical Management of Software Development Speaker: Alex Martelli Time: 7:00pm Where: eBay Town Hall (next to PayPal/eBay) 2161 North First St San Jose, CA 95131 Map: Cost: Free More Info: Managing software development projects can benefit from some approaches that are rather different from most traditional management techniques. Software developers operate with their own particular mindset, culture and reward system. To motivate and inspire a top programming team, one type of ideal manager is a technical peer who can jump into the code and work hands-on, together with the developers, to solve thorny problems. Such technical involvement can keep a project moving forward and help the manager build credibility and trust within the team. In this talk, Alex Martelli discusses some common management myths, and shares some immediately useful advice for anyone involved in managing software development projects. For those who want to read ahead (or listen ahead) an early version of this talk can be found at . The ACCU talk will have plenty of new material: quoting Alex "I have changed the talk itself quite a bit since that podcast was recorded in July". Alex Martelli is Uber Technical Lead at Google, Inc. Alex holds a laurea in Ingegneria Elettronica from Bologna University. He wrote Python in a Nutshell, and also co-edited the Python Cookbook. He's a member of the Python Software Foundation, and won the 2002 Activators' Choice Award and the 2006 Frank Willison Memorial Award. Alex spent 8 years with IBM Research (earning three Outstanding Technical Achievement Awards), 12 years as senior consultant (Win32, Fortran, C, C++, Java, etc) at Think3 inc, and 3 years as a Python freelance consultant (mostly for AB Strakt). He has taught Programming, Numerical Computing, and Object Oriented Design at Ferrara University and other venues. --- Upcoming ACCU talks --- March 21, 2007 Kevlin Henney "Four (More) Patterns You Should Know" ----- The ACCU meets monthly. To suggest topics and speakers please email Walter Vannini via walterv at gbbservices.com Walter Vannini From tpc at cryptic.com Tue Feb 6 18:52:17 2007 From: tpc at cryptic.com (tpc at cryptic.com) Date: Tue, 6 Feb 2007 09:52:17 -0800 Subject: [Baypiggies] ACCU meeting on Wednesday In-Reply-To: <45C8ACD0.7050807@gbbservices.com> References: <45C8ACD0.7050807@gbbservices.com> Message-ID: On 2/6/07, Walter Vannini wrote: > > IMPORTANT CHANGE: > Due to new PayPal security requirements, we are strongly > recommending that you preregister by RSVPing if you think > you might be attending. If you forget to preregister, PayPal > might not allow us to admit you. Also, all attendees will > now need to present some form of Photo ID. > > To RSVP, please reply to this e-mail, address it to Ali ?ehreli > , and add RSVP to the subject line. > > When: Wednesday, February 7, 2007 > Topic: Technical Management of Software Development > Speaker: Alex Martelli > Time: 7:00pm > Where: eBay Town Hall (next to PayPal/eBay) > 2161 North First St San Jose, CA 95131 > Map: > Cost: Free > More Info: hey guys, I wanted to ask if anyone is interested in carpooling to the Alex Martelli talk tomorrow from the East Bay. I normally don't have time to make the one hour journey, but I took a look at the topic and description and decided this talk promises to be something special. I hope to leave from the Berkeley/Oakland area around 5:45pm. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070206/cc874920/attachment.html From lhawthorn at google.com Tue Feb 6 19:42:56 2007 From: lhawthorn at google.com (Leslie Hawthorn) Date: Tue, 6 Feb 2007 10:42:56 -0800 Subject: [Baypiggies] Please register on the wiki Message-ID: <4869cee70702061042q774d76c9j7db2f6ff1fca0378@mail.gmail.com> Hello everyone, If you will be attending the upcoming Baypiggies meeting on Thursday, February 8th, please sign up on the wiki no later than 3 PM tomorrow, Wednesday, May 7th. http://wiki.python.org/moin/BayPiggiesGoogleMeetings We will also need the help of a volunteer to tape the presentation. Please contact me off-list if you are interested in helping. Best, LH -- Leslie Hawthorn Open Source Program Office Google Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070206/96e20cc0/attachment.htm From jim at well.com Wed Feb 7 01:59:44 2007 From: jim at well.com (jim stockford) Date: Tue, 6 Feb 2007 16:59:44 -0800 Subject: [Baypiggies] End topic for this coming meeting Message-ID: <34f95723b0f325efd51441a908bed483@well.com> Let's spend the final ten or so minutes of this coming meeting figuring out who can report on their reaction to PyCon--what speakers will you see, will you be willing to summarize and opine. jim From spmcinerney at hotmail.com Wed Feb 7 02:14:12 2007 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Tue, 06 Feb 2007 17:14:12 -0800 Subject: [Baypiggies] End topic for this coming meeting/ March PyCon talk planning In-Reply-To: <34f95723b0f325efd51441a908bed483@well.com> Message-ID: I was going to suggest we look at the PyCon program ( http://us.pycon.org/TX2007/HomePage ) figure out what are the must-hear talks, and try to get a list of volunteer names of people who promise to give an overview of them at the March meeting. Regards, Stephen >From: jim stockford >To: baypiggies at python.org >Subject: [Baypiggies] End topic for this coming meeting >Date: Tue, 6 Feb 2007 16:59:44 -0800 > > > > Let's spend the final ten or so minutes of this >coming meeting figuring out who can report on >their reaction to PyCon--what speakers will you >see, will you be willing to summarize and opine. >jim _________________________________________________________________ Turn searches into helpful donations. Make your search count. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donation&FORM=WLMTAG From DennisR at dair.com Wed Feb 7 02:21:25 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Tue, 06 Feb 2007 17:21:25 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: <34f95723b0f325efd51441a908bed483@well.com> Message-ID: <5.1.0.14.0.20070206171154.00be5950@localhost> At 04:59 PM 2/6/2007, jim stockford wrote: > Let's spend the final ten or so minutes of this >coming meeting figuring out who can report on >their reaction to PyCon--what speakers will you >see, will you be willing to summarize and opine. >jim Do I understand that there is no time for announcements? Can we try doing announcements differently? I suggest for announcements which need to be made at the meeting, that they be written up and distributed via handouts laid on a table. If people need to contact you, put your picture on the handout. regards, Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From jjinux at gmail.com Wed Feb 7 04:45:26 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 6 Feb 2007 19:45:26 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: <5.1.0.14.0.20070206171154.00be5950@localhost> References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> Message-ID: On 2/6/07, Dennis Reinhardt wrote: > At 04:59 PM 2/6/2007, jim stockford wrote: > > Let's spend the final ten or so minutes of this > >coming meeting figuring out who can report on > >their reaction to PyCon--what speakers will you > >see, will you be willing to summarize and opine. > >jim > > Do I understand that there is no time for announcements? Can we try doing > announcements differently? > > I suggest for announcements which need to be made at the meeting, that they > be written up and distributed via handouts laid on a table. If people need > to contact you, put your picture on the handout. It seems wasteful to waste paper when we have this mailing list and we're actually in a room together, but that's just me :-/ -jj -- http://jjinux.blogspot.com/ From jim at well.com Wed Feb 7 04:57:27 2007 From: jim at well.com (jim stockford) Date: Tue, 6 Feb 2007 19:57:27 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> Message-ID: <0ad4e3c11e40a7245c9c04375a556901@well.com> let's have announcements at the end, including announcements of who's going to PyCon and is willing to report at the March meeting. On Feb 6, 2007, at 7:45 PM, Shannon -jj Behrens wrote: > On 2/6/07, Dennis Reinhardt wrote: >> At 04:59 PM 2/6/2007, jim stockford wrote: >>> Let's spend the final ten or so minutes of this >>> coming meeting figuring out who can report on >>> their reaction to PyCon--what speakers will you >>> see, will you be willing to summarize and opine. >>> jim >> >> Do I understand that there is no time for announcements? Can we try >> doing >> announcements differently? >> >> I suggest for announcements which need to be made at the meeting, >> that they >> be written up and distributed via handouts laid on a table. If >> people need >> to contact you, put your picture on the handout. > > It seems wasteful to waste paper when we have this mailing list and > we're actually in a room together, but that's just me :-/ > > -jj > > -- > http://jjinux.blogspot.com/ > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From donnamsnow at gmail.com Wed Feb 7 05:34:40 2007 From: donnamsnow at gmail.com (Donna Snow) Date: Tue, 6 Feb 2007 20:34:40 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: <0ad4e3c11e40a7245c9c04375a556901@well.com> References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> <0ad4e3c11e40a7245c9c04375a556901@well.com> Message-ID: I personally liked Mapping and Random Access.. I'm a social type person and like the opportunity to hear what other people are doing and then milling about after the meeting.. being rushed out of the room at the end is a bit disconcerting... We should allow for at least 15 minutes + each meeting (either before or after) for schmoozin'.. Best Regards, Donna M. Snow, Owner C Squared Enterprises illuminate your web http://www.csquaredtech.com On 2/6/07, jim stockford wrote: > > let's have announcements at the end, including > announcements of who's going to PyCon and is > willing to report at the March meeting. > > On Feb 6, 2007, at 7:45 PM, Shannon -jj Behrens wrote: > > > On 2/6/07, Dennis Reinhardt wrote: > >> At 04:59 PM 2/6/2007, jim stockford wrote: > >>> Let's spend the final ten or so minutes of this > >>> coming meeting figuring out who can report on > >>> their reaction to PyCon--what speakers will you > >>> see, will you be willing to summarize and opine. > >>> jim > >> > >> Do I understand that there is no time for announcements? Can we try > >> doing > >> announcements differently? > >> > >> I suggest for announcements which need to be made at the meeting, > >> that they > >> be written up and distributed via handouts laid on a table. If > >> people need > >> to contact you, put your picture on the handout. > > > > It seems wasteful to waste paper when we have this mailing list and > > we're actually in a room together, but that's just me :-/ > > > > -jj > > > > -- > > http://jjinux.blogspot.com/ > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From jim at well.com Wed Feb 7 15:41:58 2007 From: jim at well.com (jim stockford) Date: Wed, 7 Feb 2007 06:41:58 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> <0ad4e3c11e40a7245c9c04375a556901@well.com> Message-ID: <506f3f152895c8bed3f15b53d4ab4d76@well.com> point taken, and thanks for the note. let's see who really shows up to talk; if one speaker is missing, we'll have plenty of time for schmoozin'. On Feb 6, 2007, at 8:34 PM, Donna Snow wrote: > I personally liked Mapping and Random Access.. I'm a social type > person and like the opportunity to hear what other people are doing > and then milling about after the meeting.. being rushed out of the > room at the end is a bit disconcerting... > > We should allow for at least 15 minutes + each meeting (either before > or after) for schmoozin'.. > > Best Regards, > Donna M. Snow, Owner > C Squared Enterprises > illuminate your web > http://www.csquaredtech.com > > On 2/6/07, jim stockford wrote: >> >> let's have announcements at the end, including >> announcements of who's going to PyCon and is >> willing to report at the March meeting. >> >> On Feb 6, 2007, at 7:45 PM, Shannon -jj Behrens wrote: >> >> > On 2/6/07, Dennis Reinhardt wrote: >> >> At 04:59 PM 2/6/2007, jim stockford wrote: >> >>> Let's spend the final ten or so minutes of this >> >>> coming meeting figuring out who can report on >> >>> their reaction to PyCon--what speakers will you >> >>> see, will you be willing to summarize and opine. >> >>> jim >> >> >> >> Do I understand that there is no time for announcements? Can we >> try >> >> doing >> >> announcements differently? >> >> >> >> I suggest for announcements which need to be made at the meeting, >> >> that they >> >> be written up and distributed via handouts laid on a table. If >> >> people need >> >> to contact you, put your picture on the handout. >> > >> > It seems wasteful to waste paper when we have this mailing list and >> > we're actually in a room together, but that's just me :-/ >> > >> > -jj >> > >> > -- >> > http://jjinux.blogspot.com/ >> > _______________________________________________ >> > Baypiggies mailing list >> > Baypiggies at python.org >> > To change your subscription options or unsubscribe: >> > http://mail.python.org/mailman/listinfo/baypiggies >> > >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies >> > From walterv at gbbservices.com Wed Feb 7 19:27:19 2007 From: walterv at gbbservices.com (Walter Vannini) Date: Wed, 07 Feb 2007 10:27:19 -0800 Subject: [Baypiggies] ACCU meeting tonight Message-ID: <45CA1A07.60902@gbbservices.com> IMPORTANT CHANGE: Due to new PayPal security requirements, we are strongly recommending that you preregister by RSVPing if you think you might be attending. If you forget to preregister, PayPal might not allow us to admit you. Also, all attendees will now need to present some form of Photo ID. To RSVP, please reply to this e-mail, address it to Ali ?ehreli , and add RSVP to the subject line. When: Wednesday, February 7, 2007 Topic: Technical Management of Software Development Speaker: Alex Martelli Time: 7:00pm Where: eBay Town Hall (next to PayPal/eBay) 2161 North First St San Jose, CA 95131 Map: Cost: Free More Info: Managing software development projects can benefit from some approaches that are rather different from most traditional management techniques. Software developers operate with their own particular mindset, culture and reward system. To motivate and inspire a top programming team, one type of ideal manager is a technical peer who can jump into the code and work hands-on, together with the developers, to solve thorny problems. Such technical involvement can keep a project moving forward and help the manager build credibility and trust within the team. In this talk, Alex Martelli discusses some common management myths, and shares some immediately useful advice for anyone involved in managing software development projects. For those who want to read ahead (or listen ahead) an early version of this talk can be found at . The ACCU talk will have plenty of new material: quoting Alex "I have changed the talk itself quite a bit since that podcast was recorded in July". Alex Martelli is Uber Technical Lead at Google, Inc. Alex holds a laurea in Ingegneria Elettronica from Bologna University. He wrote Python in a Nutshell, and also co-edited the Python Cookbook. He's a member of the Python Software Foundation, and won the 2002 Activators' Choice Award and the 2006 Frank Willison Memorial Award. Alex spent 8 years with IBM Research (earning three Outstanding Technical Achievement Awards), 12 years as senior consultant (Win32, Fortran, C, C++, Java, etc) at Think3 inc, and 3 years as a Python freelance consultant (mostly for AB Strakt). He has taught Programming, Numerical Computing, and Object Oriented Design at Ferrara University and other venues. --- Upcoming ACCU talks --- March 21, 2007 Kevlin Henney "Four (More) Patterns You Should Know" ----- The ACCU meets monthly. To suggest topics and speakers please email Walter Vannini via walterv at gbbservices.com Walter Vannini From tpc at cryptic.com Wed Feb 7 19:22:29 2007 From: tpc at cryptic.com (tpc at cryptic.com) Date: Wed, 7 Feb 2007 10:22:29 -0800 Subject: [Baypiggies] Carpooling to the ACCU meeting tonight from the East Bay Message-ID: On 2/6/07, Walter Vannini wrote: > > IMPORTANT CHANGE: > Due to new PayPal security requirements, we are strongly > recommending that you preregister by RSVPing if you think > you might be attending. If you forget to preregister, PayPal > might not allow us to admit you. Also, all attendees will > now need to present some form of Photo ID. > > To RSVP, please reply to this e-mail, address it to Ali ?ehreli > , and add RSVP to the subject line. > > When: Wednesday, February 7, 2007 > Topic: Technical Management of Software Development > Speaker: Alex Martelli > Time: 7:00pm > Where: eBay Town Hall (next to PayPal/eBay) > 2161 North First St San Jose, CA 95131 > Map: > Cost: Free > More Info: hey guys, I wanted to ask if anyone is interested in carpooling to the Alex Martelli talk tonight from the East Bay. I normally don't have time to make the one hour journey, but I took a look at the topic and description and decided this talk promises to be something special. I hope to leave from the Berkeley/Oakland area around 5:45pm. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070207/5843324f/attachment.html From tpc at cryptic.com Thu Feb 8 00:05:01 2007 From: tpc at cryptic.com (tpc at cryptic.com) Date: Wed, 7 Feb 2007 15:05:01 -0800 Subject: [Baypiggies] ACCU meeting tonight In-Reply-To: <45CA1A07.60902@gbbservices.com> References: <45CA1A07.60902@gbbservices.com> Message-ID: On 2/7/07, Walter Vannini wrote: > > IMPORTANT CHANGE: > Due to new PayPal security requirements, we are strongly > recommending that you preregister by RSVPing if you think > you might be attending. If you forget to preregister, PayPal > might not allow us to admit you. Also, all attendees will > now need to present some form of Photo ID. > > To RSVP, please reply to this e-mail, address it to Ali ?ehreli > , and add RSVP to the subject line. > > When: Wednesday, February 7, 2007 > Topic: Technical Management of Software Development > Speaker: Alex Martelli > Time: 7:00pm > Where: eBay Town Hall (next to PayPal/eBay) > 2161 North First St San Jose, CA 95131 > Map: > Cost: Free > More Info: hey guys, I wanted to ask if anyone is interested in carpooling to the Alex Martelli talk this evening from the East Bay. I normally don't have time to make the one hour journey, but I took a look at the topic and description and decided this talk promises to be something special. I hope to leave from the Berkeley/Oakland area around 5:45pm. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070207/e4abee7a/attachment.html From marilyn at deliberate.com Thu Feb 8 21:12:46 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Thu, 08 Feb 2007 12:12:46 -0800 Subject: [Baypiggies] New PyOP List - wasRe: [vote] name change Message-ID: <20070208201249.344C91E4008@bag.python.org> JJ said: > > Again, don't mistake my ignorance for malice. I posed that poll I know. I know you are not malicious. But please nullify that mis-poll as a mistake. We already took that poll in a carefully legitimate way and the previous poll should be respected: 35% think the name is bad enough to warrant changing. A group of marketeers would take that number very seriously. But we are technical people. The up-side is that the incident gave me the opportunity to teach something about democracy, which is my #1 calling: http://www.deliberate.com Teaching Python, and whatever other little gigs I get, support the democracy work. Please understand and not take offense, that I can't, voluntarily, be subject to a dictator, no matter how benevolent, charming and good. So I started another email list/group: PyOP "Python on the Peninsula". As soon as you get the announce list happening, I'll be leaving Baypiggies, although I do expect my participation in the meetings to grow when I'm not weighed down by the name, "piggies". This happened: ----- On Tuesday, February 6, 2007 brad at python.org wrote: > At 12:25 PM -0800 2/6/07, Marilyn Davis wrote: > >> Hello Python.org Postmasters, >> >> Would you please make a pyop at python.org email list? > > Done. > >> It will be a democratically-administrated email list for ???*???Python on >> the Peninsula???*??? -- the SF Bay Peninsula. > > Noted in the short description of the list. > >> Baypiggies is the whole SF Bay area, and I hope/expect the list to >> be populated with people who attend the live meetings. Everyone is >> welcome, of course. But to earn voting rights, you must have >> attended one meeting in the last 3 months, or 2 meetings in the last year. >> >> I hope a few democratic rules of order are ok in a python.org list. > > So far as I know, so long as the rules don't discriminate with > regards to race, religion, creed, gender, sexual preferences, etc... > you should be able to run your list pretty much however you want. > >> I'll be the first admin, but I hope there is enough enthusiasm that >> someone else will want to be the admin in a year. > > Fair enough. > > I've pre-filled in a few things on the list, including an > introductory description which has a few standard list policies > regarding the archives, etc.... If you want to change these, that's [rest clipped] I have a big deadline on Monday so I don't have much time for fiddling with this right now but I'll try to get it all set next week with some starting rules. So that you understand my action I'll explain that, as a democracy activist, in league with Zapatistas and other democracy activists. I see that the threatening demise of the planet is the war between corporate-governmental-military monster and democracy/people: a war between the dominant/submissant model and the cooperative model. Being part of this struggle, I feel I am betraying the cause and the earth if I willingly participate where democratic forms are disrespected ... and then there's the name thing. When meeting organizers are looking for help or speakers, if they raise their requests to the new announce list, I'll respond if I can, but I will be participating as a member of PyOP. For starters I will not feed the announce list into the PyOP list so that, if anyone wants to belong to both lists, there will not be duplicates. And since this baypiggies list does not allow cross-posting, there will not be any perceived problems from a cross-post with this list. Cross-posts on the PyOP list are ok with me as long as the cross-poster takes responsibility to keep the thread making sense. But if there are other members who feel differently, a decision reached by democratic process will override any defaults I set up. I want to point out that when Guido says he's Python's benevolent dictator, it's a bit silly because Python is just a computer language. No matter how dynamic, intelligent and fun Python is, it is not a being with a mind of her own, dignity, or a sense of responsibilty. Guido invented Python and holds the original vision and the responsibility to protect it from turning into a committee-led mish-mash. In reality, he is "protector" of the language. Hard job. But, as a person, voluntarily in community with other people, it is important to me that I belong to a committee-led mish-mash. I hope a few people join me, because I do want to be in ecommunity with other Python-lovers. See you tonight, Marilyn From jjinux at gmail.com Thu Feb 8 23:46:07 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 8 Feb 2007 14:46:07 -0800 Subject: [Baypiggies] New PyOP List - wasRe: [vote] name change In-Reply-To: <20070208201249.344C91E4008@bag.python.org> References: <20070208201249.344C91E4008@bag.python.org> Message-ID: On 2/8/07, Marilyn Davis wrote: > JJ said: > > > > Again, don't mistake my ignorance for malice. I posed that poll > > I know. I know you are not malicious. But please nullify that mis-poll as a mistake. It's true that I mistook what you, a member of the list, were interested in. Still, the poll served to tell me what the readership thought. It answered my question. What's to nullify about that? > We already took that poll in a carefully legitimate way and the previous poll should be respected: 35% think the name is bad enough to warrant changing. A group of marketeers would take that number very seriously. But we are technical people. Fair enough. Unfortunately, I can't violate the will of the 65% majority. > The up-side is that the incident gave me the opportunity to teach something about democracy, which is my #1 calling: http://www.deliberate.com > > Teaching Python, and whatever other little gigs I get, support the democracy work. > > Please understand and not take offense, that I can't, voluntarily, be subject to a dictator, no matter how benevolent, charming and good. Do you also refuse to use Linux? I purposely took the term "benevolent dictator" from Linus's original usage. In fact, while it may be called a benevolent dictatorship, at its heart, this is really a meritocracy. Those who give the most make the most decisions. > So I started another email list/group: PyOP "Python on the Peninsula". Ok. I wish you the best of luck in your future endeavors. Before you leave, I'd like to say thank you for all your contributions. > As soon as you get the announce list happening, I'll be leaving Baypiggies, although I do expect my participation in the meetings to grow when I'm not weighed down by the name, "piggies". > > This happened: > > ----- On Tuesday, February 6, 2007 brad at python.org wrote: > > > At 12:25 PM -0800 2/6/07, Marilyn Davis wrote: > > > >> Hello Python.org Postmasters, > >> > >> Would you please make a pyop at python.org email list? > > > > Done. > > > >> It will be a democratically-administrated email list for ?*?Python on > >> the Peninsula?*? -- the SF Bay Peninsula. > > > > Noted in the short description of the list. > > > >> Baypiggies is the whole SF Bay area, and I hope/expect the list to > >> be populated with people who attend the live meetings. Everyone is > >> welcome, of course. But to earn voting rights, you must have > >> attended one meeting in the last 3 months, or 2 meetings in the last year. > >> > >> I hope a few democratic rules of order are ok in a python.org list. > > > > So far as I know, so long as the rules don't discriminate with > > regards to race, religion, creed, gender, sexual preferences, etc... > > you should be able to run your list pretty much however you want. > > > >> I'll be the first admin, but I hope there is enough enthusiasm that > >> someone else will want to be the admin in a year. > > > > Fair enough. > > > > I've pre-filled in a few things on the list, including an > > introductory description which has a few standard list policies > > regarding the archives, etc.... If you want to change these, that's > [rest clipped] > > I have a big deadline on Monday so I don't have much time for fiddling with this right now but I'll try to get it all set next week with some starting rules. > > So that you understand my action I'll explain that, as a democracy activist, in league with Zapatistas and other democracy activists. I see that the threatening demise of the planet is the war between corporate-governmental-military monster and democracy/people: a war between the dominant/submissant model and the cooperative model. Being part of this struggle, I feel I am betraying the cause and the earth if I willingly participate where democratic forms are disrespected ... and then there's the name thing. Wow. Ok. I guess we each have our causes. Personally, mine is open source, and it drives me crazy to ever have to use anything closed source. (Now is a chance for Alex Martelli to take a quick jab at my presentation software debacle at the last meeting ;) > When meeting organizers are looking for help or speakers, if they raise their requests to the new announce list, I'll respond if I can, but I will be participating as a member of PyOP. > > For starters I will not feed the announce list into the PyOP list so that, if anyone wants to belong to both lists, there will not be duplicates. And since this baypiggies list does not allow cross-posting, there will not be any perceived problems from a cross-post with this list. Cross-posts on the PyOP list are ok with me as long as the cross-poster takes responsibility to keep the thread making sense. But if there are other members who feel differently, a decision reached by democratic process will override any defaults I set up. > > I want to point out that when Guido says he's Python's benevolent dictator, it's a bit silly because Python is just a computer language. No matter how dynamic, intelligent and fun Python is, it is not a being with a mind of her own, dignity, or a sense of responsibilty. Guido invented Python and holds the original vision and the responsibility to protect it from turning into a committee-led mish-mash. In reality, he is "protector" of the language. Hard job. > > But, as a person, voluntarily in community with other people, it is important to me that I belong to a committee-led mish-mash. > > I hope a few people join me, because I do want to be in ecommunity with other Python-lovers. > > See you tonight, > > Marilyn Best Regards, -jj -- http://jjinux.blogspot.com/ From ken at seehart.com Fri Feb 9 02:36:00 2007 From: ken at seehart.com (Ken Seehart) Date: Thu, 08 Feb 2007 17:36:00 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> <0ad4e3c11e40a7245c9c04375a556901@well.com> Message-ID: <45CBD000.5060809@seehart.com> I'm am not going to be able to make it because I am ill. I apologize for the late notice. - Ken Donna Snow wrote: > I personally liked Mapping and Random Access.. I'm a social type > person and like the opportunity to hear what other people are doing > and then milling about after the meeting.. being rushed out of the > room at the end is a bit disconcerting... > > We should allow for at least 15 minutes + each meeting (either before > or after) for schmoozin'.. > > Best Regards, > Donna M. Snow, Owner > C Squared Enterprises > illuminate your web > http://www.csquaredtech.com > > On 2/6/07, jim stockford wrote: > >> let's have announcements at the end, including >> announcements of who's going to PyCon and is >> willing to report at the March meeting. >> >> On Feb 6, 2007, at 7:45 PM, Shannon -jj Behrens wrote: >> >> >>> On 2/6/07, Dennis Reinhardt wrote: >>> >>>> At 04:59 PM 2/6/2007, jim stockford wrote: >>>> >>>>> Let's spend the final ten or so minutes of this >>>>> coming meeting figuring out who can report on >>>>> their reaction to PyCon--what speakers will you >>>>> see, will you be willing to summarize and opine. >>>>> jim >>>>> >>>> Do I understand that there is no time for announcements? Can we try >>>> doing >>>> announcements differently? >>>> >>>> I suggest for announcements which need to be made at the meeting, >>>> that they >>>> be written up and distributed via handouts laid on a table. If >>>> people need >>>> to contact you, put your picture on the handout. >>>> >>> It seems wasteful to waste paper when we have this mailing list and >>> we're actually in a room together, but that's just me :-/ >>> >>> -jj >>> >>> -- >>> http://jjinux.blogspot.com/ >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> http://mail.python.org/mailman/listinfo/baypiggies >>> >>> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies >> >> > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070208/cf7add2a/attachment.html From DennisR at dair.com Fri Feb 9 02:42:43 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Thu, 08 Feb 2007 17:42:43 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: <45CBD000.5060809@seehart.com> References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> <0ad4e3c11e40a7245c9c04375a556901@well.com> Message-ID: <5.1.0.14.0.20070208173821.00bf46c8@localhost> I will be talking about wxPython as one of 3 GUIs. Up until today, I was a little light on coverage because I knew you would cover this. However, this afternoon, I added some code samples showing showing wxPython code. I can provide further depth on wxPython via code samples, if desired, or keep to original 25 minutes. Take care of yourself and get well. Dennis At 05:36 PM 2/8/2007, Ken Seehart wrote: >I'm am not going to be able to make it because I am ill. I apologize for >the late notice. > >- Ken > >Donna Snow wrote: >> >> >>I personally liked Mapping and Random Access.. I'm a social type >>person and like the opportunity to hear what other people are doing >>and then milling about after the meeting.. being rushed out of the >>room at the end is a bit disconcerting... >> >>We should allow for at least 15 minutes + each meeting (either before >>or after) for schmoozin'.. >> >>Best Regards, >>Donna M. Snow, Owner >>C Squared Enterprises >>illuminate your web >>http://www.csquaredtech.com >> >>On 2/6/07, jim stockford wrote: >> >>> >>> >>> let's have announcements at the end, including >>>announcements of who's going to PyCon and is >>>willing to report at the March meeting. >>> >>>On Feb 6, 2007, at 7:45 PM, Shannon -jj Behrens wrote: >>> >>> >>>> >>>> >>>>On 2/6/07, Dennis Reinhardt >>>>wrote: >>>> >>>>> >>>>> >>>>>At 04:59 PM 2/6/2007, jim stockford wrote: >>>>> >>>>>> >>>>>> >>>>>> Let's spend the final ten or so minutes of this >>>>>>coming meeting figuring out who can report on >>>>>>their reaction to PyCon--what speakers will you >>>>>>see, will you be willing to summarize and opine. >>>>>>jim >>>>>> >>>>> >>>>> >>>>>Do I understand that there is no time for announcements? Can we try >>>>>doing >>>>>announcements differently? >>>>> >>>>>I suggest for announcements which need to be made at the meeting, >>>>>that they >>>>>be written up and distributed via handouts laid on a table. If >>>>>people need >>>>>to contact you, put your picture on the handout. >>>>> >>>> >>>> >>>>It seems wasteful to waste paper when we have this mailing list and >>>>we're actually in a room together, but that's just me :-/ >>>> >>>>-jj >>>> >>>>-- >>>>http://jjinux.blogspot.com/ >>>>_______________________________________________ >>>>Baypiggies mailing list >>>>Baypiggies at python.org >>>>To change your subscription options or unsubscribe: >>>>http://mail.python.org/mailman/listinfo/baypiggies >>>> >>>> >>> >>> >>>_______________________________________________ >>>Baypiggies mailing list >>>Baypiggies at python.org >>>To change your subscription options or unsubscribe: >>>http://mail.python.org/mailman/listinfo/baypiggies >>> >>> >> >> >>_______________________________________________ >>Baypiggies mailing list >>Baypiggies at python.org >>To change your subscription options or unsubscribe: >>http://mail.python.org/mailman/listinfo/baypiggies >> >> >> --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From max at theslimmers.net Fri Feb 9 03:04:25 2007 From: max at theslimmers.net (Max Slimmer) Date: Thu, 8 Feb 2007 18:04:25 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: <5.1.0.14.0.20070208173821.00bf46c8@localhost> Message-ID: <200702090204.l1924Tbo020268@a.mail.sonic.net> I would like to hear Ken's talk at some point in time. He indicated he had a tool to facilitate quick build of a wxPython app. The more the better. max > -----Original Message----- > From: baypiggies-bounces at python.org > [mailto:baypiggies-bounces at python.org] On Behalf Of Dennis Reinhardt > Sent: Thursday, February 08, 2007 5:43 PM > To: ken at seehart.com; Donna Snow; baypiggies at python.org > Subject: Re: [Baypiggies] End topic for this coming meeting > > I will be talking about wxPython as one of 3 GUIs. Up until > today, I was a little light on coverage because I knew you > would cover this. However, this afternoon, I added some code > samples showing showing wxPython code. I can provide further > depth on wxPython via code samples, if desired, or keep to > original 25 minutes. > > Take care of yourself and get well. > > Dennis > > At 05:36 PM 2/8/2007, Ken Seehart wrote: > >I'm am not going to be able to make it because I am ill. I > apologize > >for the late notice. > > > >- Ken > > > >Donna Snow wrote: > >> > >> > >>I personally liked Mapping and Random Access.. I'm a social type > >>person and like the opportunity to hear what other people are doing > >>and then milling about after the meeting.. being rushed out of the > >>room at the end is a bit disconcerting... > >> > >>We should allow for at least 15 minutes + each meeting > (either before > >>or after) for schmoozin'.. > >> > >>Best Regards, > >>Donna M. Snow, Owner > >>C Squared Enterprises > >>illuminate your web > >>http://www.csquaredtech.com > >> > >>On 2/6/07, jim stockford wrote: > >> > >>> > >>> > >>> let's have announcements at the end, including > announcements of > >>>who's going to PyCon and is willing to report at the March meeting. > >>> > >>>On Feb 6, 2007, at 7:45 PM, Shannon -jj Behrens wrote: > >>> > >>> > >>>> > >>>> > >>>>On 2/6/07, Dennis Reinhardt > >>>> > >>>>wrote: > >>>> > >>>>> > >>>>> > >>>>>At 04:59 PM 2/6/2007, jim stockford wrote: > >>>>> > >>>>>> > >>>>>> > >>>>>> Let's spend the final ten or so minutes of this coming > >>>>>>meeting figuring out who can report on their reaction to > >>>>>>PyCon--what speakers will you see, will you be willing to > >>>>>>summarize and opine. > >>>>>>jim > >>>>>> > >>>>> > >>>>> > >>>>>Do I understand that there is no time for announcements? Can we > >>>>>try doing announcements differently? > >>>>> > >>>>>I suggest for announcements which need to be made at the > meeting, > >>>>>that they be written up and distributed via handouts laid on a > >>>>>table. If people need to contact you, put your picture on the > >>>>>handout. > >>>>> > >>>> > >>>> > >>>>It seems wasteful to waste paper when we have this > mailing list and > >>>>we're actually in a room together, but that's just me :-/ > >>>> > >>>>-jj > >>>> > >>>>-- > >>>>http://jjinux.blogspot.com/ > >>>>_______________________________________________ > >>>>Baypiggies mailing list > >>>>Baypiggies at python.org > >>>>To change your subscription options or unsubscribe: > >>>>http:/ > /mail.pyth > >>>>on.org/mailman/listinfo/baypiggies > >>>> > >>>> > >>> > >>> > >>>_______________________________________________ > >>>Baypiggies mailing list > >>>Baypiggies at python.org > >>>To change your subscription options or unsubscribe: > >>>http:// > mail.pytho > >>>n.org/mailman/listinfo/baypiggies > >>> > >>> > >> > >> > >>_______________________________________________ > >>Baypiggies mailing list > >>Baypiggies at python.org > >>To change your subscription options or unsubscribe: > >>http://m > ail.python > >>.org/mailman/listinfo/baypiggies > >> > >> > >> > > --------------------------------- > | Dennis | DennisR at dair.com | > | Reinhardt | http://www.dair.com | > --------------------------------- > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From chad.netzer at gmail.com Fri Feb 9 03:35:04 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Thu, 8 Feb 2007 18:35:04 -0800 Subject: [Baypiggies] End topic for this coming meeting In-Reply-To: <45CBD000.5060809@seehart.com> References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> <0ad4e3c11e40a7245c9c04375a556901@well.com> <45CBD000.5060809@seehart.com> Message-ID: On 2/8/07, Ken Seehart wrote: > > I'm am not going to be able to make it because I am ill. I apologize for > the late notice. > > - Ken I'm sorry you got the "bug" Ken; it is that time when lots of people are getting sick. I hope to see your talk someday. I hope you get well soon. I have an interest in Model-View architectures, and was hoping to talk a bit more about it with the group, especially in relation to wxWidgets. It turns out that the dispatcher.py module has been incorporated into wx (wx.py.dispatcher), and I was curious as to whether you or Dennis were going to mention it in your Feb. presentations. Chad From DennisR at dair.com Fri Feb 9 06:39:23 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Thu, 08 Feb 2007 21:39:23 -0800 Subject: [Baypiggies] Presentation URL In-Reply-To: <45CBD000.5060809@seehart.com> References: <34f95723b0f325efd51441a908bed483@well.com> <5.1.0.14.0.20070206171154.00be5950@localhost> <0ad4e3c11e40a7245c9c04375a556901@well.com> Message-ID: <5.1.0.14.0.20070208213704.00bf6e30@localhost> I have uploaded my presentation tonight of 3 Generations of User Interface to http://www.spamai.com/present/ as a 1.7 MB PowerPoint presentation or a 2.8 Zip compressed PDF. Hopefully, that spans the client readers everyone who is interested has. Regards, Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From drewp at bigasterisk.com Fri Feb 9 09:05:04 2007 From: drewp at bigasterisk.com (Drew Perttula) Date: Fri, 09 Feb 2007 00:05:04 -0800 Subject: [Baypiggies] profiling notes and links Message-ID: <45CC2B30.7080608@bigasterisk.com> Posted here: http://drewp.quickwitretort.com/2007/02/08/0 Thanks for the questions and comments during and after my talk. From chad.netzer at gmail.com Fri Feb 9 23:30:02 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Fri, 9 Feb 2007 14:30:02 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks Message-ID: First, I want to thank Dennis and Drew for speaking last night, and Jim Stockford for hosting the post talk discussion. I've created this thread to start discussion about the "newbie" night that was talked about at the end of last night's meeting. If people reply to this thread only (or mostly), those on the list who aren't interested can easily ignore it. If we are to host a beginners night, it will be best to start organizing it soon, in order to line up topics, speakers, make timely announcements, etc. One person at the meeting asked about Python "idioms", and in fact in a previous email I brought up the idea of an "anti-idioms" presentation. I'll get the ball rolling with a few idioms and tips that I can think of, without explanation. If people are interested in the why, or wish to add some, please reply and discuss. Perhaps it could evolve into a good QA topic for beginners. Also, if people have other ideas or suggestions for a beginners night, please feel free to discuss them here. Some Python beginner tips and idioms: 1) Do not use lists, dicts, or any mutable object as default arguments; use None instead. 2) If you need to do a lot of string appends, use lists and join(). 3) Understand and use iterators in loops. 4) Use dictionaries, sets, and other mappings for searches and queries. 5) Understand and use the decorate/sort/undecorate (DSU) idiom. 6) Catch exceptions that you can handle, don't suppress ones you can't. 7) Ask forgiveness, not permission. Ie. perform conversions and other operations using "try". Avoid queries to determine if an operation will succeed. 8) Use assert() to document your code. 9) Don't overuse tuples as "read only" lists. Use them to make dictionary keys, or pass around short lived groups of objects. 10) Use open() to open files, not file(). (trivial, perhaps) Chad From cturner at pattern.net Fri Feb 9 23:48:46 2007 From: cturner at pattern.net (Chip Turner) Date: Fri, 9 Feb 2007 14:48:46 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <3ab624bd0702091448p760fa4e6w7b2c84f668c9b087@mail.gmail.com> Another common newbie pattern are ex-Perl programmers who are trying out python. There's a whole host of gotchas and 'don't do it like you did in Perl, Python has a different way' (where different usually, but not always, is a synonym for better). If a significant portion of the newbies who would like to learn Python have a Perl background then this can be a good way to get them up to speed quicker. It is very common in my group at work, for instance, to have a new hire be fairly knowledgeable in Perl but not Python, and so it is a bit of a jumpstart to help leverage the already existing skillset. Chip On 2/9/07, Chad Netzer wrote: > First, I want to thank Dennis and Drew for speaking last night, and > Jim Stockford for hosting the post talk discussion. > > I've created this thread to start discussion about the "newbie" night > that was talked about at the end of last night's meeting. If people > reply to this thread only (or mostly), those on the list who aren't > interested can easily ignore it. If we are to host a beginners night, > it will be best to start organizing it soon, in order to line up > topics, speakers, make timely announcements, etc. > > One person at the meeting asked about Python "idioms", and in fact in > a previous email I brought up the idea of an "anti-idioms" > presentation. I'll get the ball rolling with a few idioms and tips > that I can think of, without explanation. If people are interested in > the why, or wish to add some, please reply and discuss. Perhaps it > could evolve into a good QA topic for beginners. > > Also, if people have other ideas or suggestions for a beginners night, > please feel free to discuss them here. > > > > Some Python beginner tips and idioms: > > 1) Do not use lists, dicts, or any mutable object as default > arguments; use None instead. > > 2) If you need to do a lot of string appends, use lists and join(). > > 3) Understand and use iterators in loops. > > 4) Use dictionaries, sets, and other mappings for searches and > queries. > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > 6) Catch exceptions that you can handle, don't suppress ones you > can't. > > 7) Ask forgiveness, not permission. Ie. perform conversions and > other operations using "try". Avoid queries to determine if an > operation will succeed. > > 8) Use assert() to document your code. > > 9) Don't overuse tuples as "read only" lists. Use them to make > dictionary keys, or pass around short lived groups of objects. > > 10) Use open() to open files, not file(). (trivial, perhaps) > > > Chad > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Chip Turner cturner at pattern.net From aleax at google.com Sat Feb 10 00:12:01 2007 From: aleax at google.com (Alex Martelli) Date: Fri, 9 Feb 2007 15:12:01 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <55dc209b0702091512u1885cbb0y67dede68d4be6258@mail.gmail.com> On 2/9/07, Chad Netzer wrote: ... > Some Python beginner tips and idioms: > > 1) Do not use lists, dicts, or any mutable object as default > arguments; use None instead. > > 2) If you need to do a lot of string appends, use lists and join(). > > 3) Understand and use iterators in loops. > > 4) Use dictionaries, sets, and other mappings for searches and > queries. > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. ...which is best expressed today with the key=... argument to sort &c. > 6) Catch exceptions that you can handle, don't suppress ones you > can't. > > 7) Ask forgiveness, not permission. Ie. perform conversions and > other operations using "try". Avoid queries to determine if an > operation will succeed. > > 8) Use assert() to document your code. > > 9) Don't overuse tuples as "read only" lists. Use them to make > dictionary keys, or pass around short lived groups of objects. > > 10) Use open() to open files, not file(). (trivial, perhaps) 11) never, ever alter the list (or other mutable container) on which you're looping with a 'for' statement -- when feasible, build a new container -- or, if you must, loop on a copy of the original container if you absolutely do need to alter the original 12) if you think you need to use 'eval', or, even worse, 'exec', think again -- most likely you do NOT need it (read up about getattr and setattr builtins); if you DO need it, it's almost unheard of that you'll need to do it with default locals and globals -- almost invariably, for the rare cases where eval (or exec... if ever...) is appropriate, you want one or two explicit dictionaries for locals and globals. 13) eschew eschew repetition repetition -- say what you mean and say it ONCE Alex From DennisR at dair.com Sat Feb 10 00:40:00 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Fri, 09 Feb 2007 15:40:00 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: Message-ID: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> >2) If you need to do a lot of string appends, use lists and join(). This is an optimization and as such may not be the first approach to consider. All of the code samples I showed used string appends such as str = "" str += "string 1" str + "string 2" ... Why? ... because it is more concise and renders the code easier to read. I think in 4 or so years, I have had to convert an append string such as this into appending list elements followed by a join once, maybe twice. Your experience may differ but there is a clarity vs. efficiency tradeoff here and my experience is that the efficiency is rarely needed. I realize Chad said "a lot". That is a key qualifier. When doing "a lot", efficiency matters. >3) Understand and use iterators in loops. I am using 2.3 and get by without iterators. I would re-purpose this entirely. Coming from other languages, the natural tendency is to iterate over a structure by index: for i in range(0,99): element = array[i] ... The range operator is considered evil in that it builds a list at runtime. So, taken literally, the advice could be construed to use an interator instead. My advice is to not do either of the above. Instead, iterate over the structure and let the array element be the loop iteration value. Instead of iterators, do: for element in array: ... and dispense with indicies to the extent that you can. There will be cases where you need an index (e.g. updating element) but the first approach ought to be iterating over the structure. >5) Understand and use the decorate/sort/undecorate (DSU) idiom. I don't even know what that is. When is the tutorial...? Regards, Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From jjinux at gmail.com Sat Feb 10 00:51:45 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 15:51:45 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: On 2/9/07, Chad Netzer wrote: > First, I want to thank Dennis and Drew for speaking last night, and > Jim Stockford for hosting the post talk discussion. > > I've created this thread to start discussion about the "newbie" night > that was talked about at the end of last night's meeting. If people > reply to this thread only (or mostly), those on the list who aren't > interested can easily ignore it. If we are to host a beginners night, > it will be best to start organizing it soon, in order to line up > topics, speakers, make timely announcements, etc. > > One person at the meeting asked about Python "idioms", and in fact in > a previous email I brought up the idea of an "anti-idioms" > presentation. I'll get the ball rolling with a few idioms and tips > that I can think of, without explanation. If people are interested in > the why, or wish to add some, please reply and discuss. Perhaps it > could evolve into a good QA topic for beginners. > > Also, if people have other ideas or suggestions for a beginners night, > please feel free to discuss them here. > > > > Some Python beginner tips and idioms: > > 1) Do not use lists, dicts, or any mutable object as default > arguments; use None instead. > > 2) If you need to do a lot of string appends, use lists and join(). Or use a buffer: from cStringIO import StringIO buf = StringIO buf.write(...) print buf.getvalue() > 3) Understand and use iterators in loops. > > 4) Use dictionaries, sets, and other mappings for searches and > queries. > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > 6) Catch exceptions that you can handle, don't suppress ones you > can't. > > 7) Ask forgiveness, not permission. Ie. perform conversions and > other operations using "try". Avoid queries to determine if an > operation will succeed. > > 8) Use assert() to document your code. > > 9) Don't overuse tuples as "read only" lists. Use them to make > dictionary keys, or pass around short lived groups of objects. > > 10) Use open() to open files, not file(). (trivial, perhaps) #) Not everything is a class. Some things are just functions. That's okay. Passing around functions and bound methods is more powerful in Python than in many non-functional languages. #) Don't implement the singleton design pattern using a class with a getInstance method. Modules are implicitly singletons ;) Best Regards, -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Sat Feb 10 00:55:16 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 15:55:16 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <55dc209b0702091512u1885cbb0y67dede68d4be6258@mail.gmail.com> References: <55dc209b0702091512u1885cbb0y67dede68d4be6258@mail.gmail.com> Message-ID: On 2/9/07, Alex Martelli wrote: > On 2/9/07, Chad Netzer wrote: > ... > > Some Python beginner tips and idioms: > > > > 1) Do not use lists, dicts, or any mutable object as default > > arguments; use None instead. > > > > 2) If you need to do a lot of string appends, use lists and join(). > > > > 3) Understand and use iterators in loops. > > > > 4) Use dictionaries, sets, and other mappings for searches and > > queries. > > > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > ...which is best expressed today with the key=... argument to sort &c. > > > > 6) Catch exceptions that you can handle, don't suppress ones you > > can't. > > > > 7) Ask forgiveness, not permission. Ie. perform conversions and > > other operations using "try". Avoid queries to determine if an > > operation will succeed. > > > > 8) Use assert() to document your code. > > > > 9) Don't overuse tuples as "read only" lists. Use them to make > > dictionary keys, or pass around short lived groups of objects. > > > > 10) Use open() to open files, not file(). (trivial, perhaps) > > 11) never, ever alter the list (or other mutable container) on which > you're looping with a 'for' statement -- when feasible, build a new > container -- or, if you must, loop on a copy of the original container > if you absolutely do need to alter the original > > 12) if you think you need to use 'eval', or, even worse, 'exec', think > again -- most likely you do NOT need it (read up about getattr and > setattr builtins); if you DO need it, it's almost unheard of that > you'll need to do it with default locals and globals -- almost > invariably, for the rare cases where eval (or exec... if ever...) is > appropriate, you want one or two explicit dictionaries for locals and > globals. > > 13) eschew eschew repetition repetition -- say what you mean and say it ONCE Agreed. The beauty of Python is looking at two chunks of code that look the same but couldn't easily be refactored into a single block of code in C (without macros). In Python, thanks to meta programming, if text "looks" similar, you can usually factor out the similarity. -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Sat Feb 10 00:57:58 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 15:57:58 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> References: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> Message-ID: On 2/9/07, Dennis Reinhardt wrote: > This is an optimization and as such may not be the first approach to > consider. All of the code samples I showed used string appends such as > > str = "" > str += "string 1" > str + "string 2" > ... #) Use triple quoted strings, and use buffers. -jj -- http://jjinux.blogspot.com/ From cappy2112 at gmail.com Sat Feb 10 01:04:34 2007 From: cappy2112 at gmail.com (Tony Cappellini) Date: Fri, 9 Feb 2007 16:04:34 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. I wouldn't agree that this is a beginner topic, especially since it's relatively new to the language. From jjinux at gmail.com Sat Feb 10 01:07:38 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 16:07:38 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: On 2/9/07, Chad Netzer wrote: > First, I want to thank Dennis and Drew for speaking last night, and > Jim Stockford for hosting the post talk discussion. > > I've created this thread to start discussion about the "newbie" night > that was talked about at the end of last night's meeting. If people > reply to this thread only (or mostly), those on the list who aren't > interested can easily ignore it. If we are to host a beginners night, > it will be best to start organizing it soon, in order to line up > topics, speakers, make timely announcements, etc. > > One person at the meeting asked about Python "idioms", and in fact in > a previous email I brought up the idea of an "anti-idioms" > presentation. I'll get the ball rolling with a few idioms and tips > that I can think of, without explanation. If people are interested in > the why, or wish to add some, please reply and discuss. Perhaps it > could evolve into a good QA topic for beginners. > > Also, if people have other ideas or suggestions for a beginners night, > please feel free to discuss them here. > > > > Some Python beginner tips and idioms: > > 1) Do not use lists, dicts, or any mutable object as default > arguments; use None instead. > > 2) If you need to do a lot of string appends, use lists and join(). > > 3) Understand and use iterators in loops. > > 4) Use dictionaries, sets, and other mappings for searches and > queries. > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > 6) Catch exceptions that you can handle, don't suppress ones you > can't. > > 7) Ask forgiveness, not permission. Ie. perform conversions and > other operations using "try". Avoid queries to determine if an > operation will succeed. > > 8) Use assert() to document your code. > > 9) Don't overuse tuples as "read only" lists. Use them to make > dictionary keys, or pass around short lived groups of objects. > > 10) Use open() to open files, not file(). (trivial, perhaps) Sorry, I have more: #) Keep a Python shell open. Import modules. Use help(obj) within the shell. Try things out. Copy from the shell into your code. The shell is a necessary part of the development environment. #) Use print instead of a debugger. In rare cases, throw the following into your code: import pdb pdb.set_trace() Now, from within the debugger, instead of painstakingly tracing over your code, pretend you're in the Python shell and look around. #) In network servers, use a thread that listens on a unix socket as a backdoor. It should act like a Python shell so you can look around your application as it's running. -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Sat Feb 10 01:18:21 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 16:18:21 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: On 2/9/07, Shannon -jj Behrens wrote: > On 2/9/07, Chad Netzer wrote: > > First, I want to thank Dennis and Drew for speaking last night, and > > Jim Stockford for hosting the post talk discussion. > > > > I've created this thread to start discussion about the "newbie" night > > that was talked about at the end of last night's meeting. If people > > reply to this thread only (or mostly), those on the list who aren't > > interested can easily ignore it. If we are to host a beginners night, > > it will be best to start organizing it soon, in order to line up > > topics, speakers, make timely announcements, etc. > > > > One person at the meeting asked about Python "idioms", and in fact in > > a previous email I brought up the idea of an "anti-idioms" > > presentation. I'll get the ball rolling with a few idioms and tips > > that I can think of, without explanation. If people are interested in > > the why, or wish to add some, please reply and discuss. Perhaps it > > could evolve into a good QA topic for beginners. > > > > Also, if people have other ideas or suggestions for a beginners night, > > please feel free to discuss them here. > > > > > > > > Some Python beginner tips and idioms: > > > > 1) Do not use lists, dicts, or any mutable object as default > > arguments; use None instead. > > > > 2) If you need to do a lot of string appends, use lists and join(). > > > > 3) Understand and use iterators in loops. > > > > 4) Use dictionaries, sets, and other mappings for searches and > > queries. > > > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > > > 6) Catch exceptions that you can handle, don't suppress ones you > > can't. > > > > 7) Ask forgiveness, not permission. Ie. perform conversions and > > other operations using "try". Avoid queries to determine if an > > operation will succeed. > > > > 8) Use assert() to document your code. > > > > 9) Don't overuse tuples as "read only" lists. Use them to make > > dictionary keys, or pass around short lived groups of objects. > > > > 10) Use open() to open files, not file(). (trivial, perhaps) > > Sorry, I have more: > > #) Keep a Python shell open. Import modules. Use help(obj) within > the shell. Try things out. Copy from the shell into your code. The > shell is a necessary part of the development environment. > > #) Use print instead of a debugger. In rare cases, throw the > following into your code: > > import pdb > pdb.set_trace() > > Now, from within the debugger, instead of painstakingly tracing over > your code, pretend you're in the Python shell and look around. > > #) In network servers, use a thread that listens on a unix socket as a > backdoor. It should act like a Python shell so you can look around > your application as it's running. #) Use the source. Don't just read it! Update it! If you're having a problem with a standard library module or a third-party module, remember that you're not dealing with a compiled DLL. You can log in as root and throw some print statements into the thing! Remember to undo your changes before you leave. -jj -- http://jjinux.blogspot.com/ From DennisR at dair.com Sat Feb 10 01:18:58 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Fri, 09 Feb 2007 16:18:58 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> Message-ID: <5.1.0.14.0.20070209160547.00beedc8@localhost> At 03:57 PM 2/9/2007, Shannon -jj Behrens wrote: >On 2/9/07, Dennis Reinhardt wrote: >>This is an optimization and as such may not be the first approach to >>consider. All of the code samples I showed used string appends such as >> >> str = "" >> str += "string 1" >> str + "string 2" >> ... > >#) Use triple quoted strings, and use buffers. Triple quoted strings are often a poorer solution. 1) to avoid breaking up the indentation structure, triple quoted strings must either have lots of extra white space or must be defined globally. If globally, subroutine level parameter substitution is awkward. 2) Parameter substitution is very awkward for long blocks of text. A common idiom I run up against is defining html in which the user may have already entered a value. So, one might find: html += "" % previous("xyz") and where it is understood that previous() reads the invoking URL for the xyz= parameter value. Doing this in a long triple string is ugly. Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From asheesh at asheesh.org Sat Feb 10 01:21:20 2007 From: asheesh at asheesh.org (Asheesh Laroia) Date: Fri, 9 Feb 2007 19:21:20 -0500 (EST) Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: On Fri, 9 Feb 2007, Shannon -jj Behrens wrote: > #) Use the source. Don't just read it! Update it! If you're having a > problem with a standard library module or a third-party module, remember > that you're not dealing with a compiled DLL. You can log in as root and > throw some print statements into the thing! Remember to undo your > changes before you leave. The fact that eggs (zip files of packaged Python code) make this harder is the main reason I don't like that packaging format. -- Asheesh. -- Your aims are high, and you are capable of much. From sesquile at gmail.com Sat Feb 10 01:24:34 2007 From: sesquile at gmail.com (m h) Date: Fri, 9 Feb 2007 17:24:34 -0700 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: Here's some other good hints:: http://www.pkgcore.org/trac/doc/dev-notes/hacking.rst -matt From aahz at pythoncraft.com Sat Feb 10 01:42:32 2007 From: aahz at pythoncraft.com (Aahz) Date: Fri, 9 Feb 2007 16:42:32 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <20070210004231.GA26064@panix.com> On Fri, Feb 09, 2007, Chad Netzer wrote: > > 8) Use assert() to document your code. First of all, assert is a statement, not a function. Second, doctests are much better for documenting code IMO. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From p at ulmcnett.com Sat Feb 10 02:05:17 2007 From: p at ulmcnett.com (Paul McNett) Date: Fri, 09 Feb 2007 17:05:17 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209160547.00beedc8@localhost> References: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> Message-ID: <45CD1A4D.90004@ulmcnett.com> Dennis Reinhardt wrote: > At 03:57 PM 2/9/2007, Shannon -jj Behrens wrote: >> On 2/9/07, Dennis Reinhardt wrote: >>> This is an optimization and as such may not be the first approach to >>> consider. All of the code samples I showed used string appends such as >>> >>> str = "" >>> str += "string 1" >>> str + "string 2" >>> ... >> #) Use triple quoted strings, and use buffers. > > Triple quoted strings are often a poorer solution. > > 1) to avoid breaking up the indentation structure, triple quoted > strings must either have lots of extra white space or must be > defined globally. If globally, subroutine level parameter > substitution is awkward. I respectfully disagree. Take this example: class MyBizobj(...): def getCustomerInfo(self, cust_id): sql = """ select customers.name as name, sum(invoices.amount) as amount_total, blah as blah from customers left join invoices on invoices.cust_id = customers.id where customers.id = ?""" self.cur.execute(sql, (cust_id,)) On one level, it is kind of ugly because I don't indent the lines to match the indentation of the code. On the other hand, it is easy to follow. > 2) Parameter substitution is very awkward for long blocks of > text. Again, I disagree. > A common idiom I run up against is defining html in which the user may have > already entered a value. So, one might find: > > html += "" % previous("xyz") > > and where it is understood that previous() reads the invoking URL for the > xyz= parameter value. > > Doing this in a long triple string is ugly. You should use named arguments in string formatting. Such as: html += """ """ % locals() Ok ok, this example is kind of ugly too, but it seems better when you actually have a block of html. -- pkm ~ http://paulmcnett.com From p at ulmcnett.com Sat Feb 10 02:07:46 2007 From: p at ulmcnett.com (Paul McNett) Date: Fri, 09 Feb 2007 17:07:46 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <45CD1AE2.8090503@ulmcnett.com> Asheesh Laroia wrote: > On Fri, 9 Feb 2007, Shannon -jj Behrens wrote: > >> #) Use the source. Don't just read it! Update it! If you're having a >> problem with a standard library module or a third-party module, remember >> that you're not dealing with a compiled DLL. You can log in as root and >> throw some print statements into the thing! Remember to undo your >> changes before you leave. > > The fact that eggs (zip files of packaged Python code) make this harder is > the main reason I don't like that packaging format. Agreed. I think eggs may be great for getting required stuff on user's machines, when for whatever reason you didn't want to be polite and package it up for them with py2exe or something. But for developing, nothing beats having things closer to the top level in site-packages. Although, I do plan on attending the eggs session at PyCon, because I do see the value of having something kind of cpan-like for Python. -- pkm ~ http://paulmcnett.com From DennisR at dair.com Sat Feb 10 02:21:45 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Fri, 09 Feb 2007 17:21:45 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <45CD1A4D.90004@ulmcnett.com> References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> Message-ID: <5.1.0.14.0.20070209171258.00bfbdc0@localhost> At 05:05 PM 2/9/2007, Paul McNett wrote: >I respectfully disagree. Take this example: > >class MyBizobj(...): > def getCustomerInfo(self, cust_id): > sql = """ >select customers.name as name, This starts with an empty line. I believe this can be changed by sql = \ """select customers.name as name, Which then breaks up the SQL, albeit only slightly. My point had to do with "breaking up the indentation structure" and I think you have illustrated my point. You illustration does not show how a long triple quoted string gets supplied with parameters. Stylistically, I often prefer substituting parameters on a line by line basis because there is better locality, making the code easier to understand and read. Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From DennisR at dair.com Sat Feb 10 02:31:39 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Fri, 09 Feb 2007 17:31:39 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <45CD1A4D.90004@ulmcnett.com> References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> Message-ID: <5.1.0.14.0.20070209172435.00beea68@localhost> At 05:05 PM 2/9/2007, Paul McNett wrote: >Dennis Reinhardt wrote: >Take this example: > >class MyBizobj(...): > def getCustomerInfo(self, cust_id): > sql = """ >select customers.name as name, > sum(invoices.amount) as amount_total, > blah as blah > from customers > left join invoices > on invoices.cust_id = customers.id > where customers.id = ?""" > self.cur.execute(sql, (cust_id,)) To preserve SQL *and* Python structuring, I would write this as: class MyBizobj(...): def getCustomerInfo(self, cust_id): sql = "" sql += "select customers.name as name,\r\n" sql += " sum(invoices.amount) as amount_total,\r\n" sql += " blah as blah\r\n" sql += " from customers\r\n" sql += " left join invoices\r\n" sql += " on invoices.cust_id = customers.id\r\n" sql += " where customers.id = ?\r\n" self.cur.execute(sql, (cust_id,)) Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From whitaker at google.com Sat Feb 10 02:40:33 2007 From: whitaker at google.com (Russell Whitaker) Date: Fri, 9 Feb 2007 17:40:33 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <997a56990702091740g4effd89s15066f92f754ed1e@mail.gmail.com> On 2/9/07, Chad Netzer wrote: > First, I want to thank Dennis and Drew for speaking last night, and > Jim Stockford for hosting the post talk discussion. > > I've created this thread to start discussion about the "newbie" night > that was talked about at the end of last night's meeting. If people > reply to this thread only (or mostly), those on the list who aren't > interested can easily ignore it. If we are to host a beginners night, > it will be best to start organizing it soon, in order to line up > topics, speakers, make timely announcements, etc. > > One person at the meeting asked about Python "idioms", and in fact in > a previous email I brought up the idea of an "anti-idioms" > presentation. I'll get the ball rolling with a few idioms and tips > that I can think of, without explanation. If people are interested in > the why, or wish to add some, please reply and discuss. Perhaps it > could evolve into a good QA topic for beginners. > > Also, if people have other ideas or suggestions for a beginners night, > please feel free to discuss them here. > > > > Some Python beginner tips and idioms: > > 1) Do not use lists, dicts, or any mutable object as default > arguments; use None instead. > > 2) If you need to do a lot of string appends, use lists and join(). > > 3) Understand and use iterators in loops. > > 4) Use dictionaries, sets, and other mappings for searches and > queries. > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > 6) Catch exceptions that you can handle, don't suppress ones you > can't. > > 7) Ask forgiveness, not permission. Ie. perform conversions and > other operations using "try". Avoid queries to determine if an > operation will succeed. > > 8) Use assert() to document your code. > > 9) Don't overuse tuples as "read only" lists. Use them to make > dictionary keys, or pass around short lived groups of objects. > > 10) Use open() to open files, not file(). (trivial, perhaps) > #) Learn to use the unittest module. Buy the O'Reilly book "Unit Test Frameworks"[1], read at least chapters 1-4 & 9. Challenge yourself to write all your code test-first. [1] - http://www.oreilly.com/catalog/unitest/ -- Russell Whitaker Sysops Tools Team Lead Google Inc., Mt View, CA "gets() remains as a monument to C's continuing support of buffer overruns." - Bill Frantz From carroll at tjc.com Sat Feb 10 02:42:14 2007 From: carroll at tjc.com (Terry Carroll) Date: Fri, 9 Feb 2007 17:42:14 -0800 (PST) Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: Message-ID: #) Don't use "from foo import *" From chad.netzer at gmail.com Sat Feb 10 02:43:00 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Fri, 9 Feb 2007 17:43:00 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209172435.00beea68@localhost> References: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <45CD1A4D.90004@ulmcnett.com> <5.1.0.14.0.20070209172435.00beea68@localhost> Message-ID: n 2/9/07, Dennis Reinhardt wrote: > > To preserve SQL *and* Python structuring, I would write this as: > > class MyBizobj(...): > def getCustomerInfo(self, cust_id): > sql = "" > sql += "select customers.name as name,\r\n" > sql += " sum(invoices.amount) as amount_total,\r\n" > sql += " blah as blah\r\n" > sql += " from customers\r\n" > sql += " left join invoices\r\n" > sql += " on invoices.cust_id = customers.id\r\n" > sql += " where customers.id = ?\r\n" > self.cur.execute(sql, (cust_id,)) Another alternative (which does the concatenation at compile time) is: class MyBizobj(...): def getCustomerInfo(self, cust_id): sql = ( "select customers.name as name,\r\n" " sum(invoices.amount) as amount_total,\r\n" " blah as blah\r\n" " from customers\r\n" " etc..." ) Chad From chad.netzer at gmail.com Sat Feb 10 02:49:59 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Fri, 9 Feb 2007 17:49:59 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <20070210004231.GA26064@panix.com> References: <20070210004231.GA26064@panix.com> Message-ID: On 2/9/07, Aahz wrote: > On Fri, Feb 09, 2007, Chad Netzer wrote: > > > > 8) Use assert() to document your code. > > First of all, assert is a statement, not a function. Second, doctests > are much better for documenting code IMO. Right you are! In the past I had the habit of using the parens, but they are unpythonic. Also, really I should have said "use assert to comment your code". Thus if variable 'a' must be greater than 0, use this: assert a > 0 rather than: # 'a' must be greater than zero Chad From nad at acm.org Sat Feb 10 02:49:57 2007 From: nad at acm.org (Ned Deily) Date: Fri, 09 Feb 2007 17:49:57 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks References: <45CD1AE2.8090503@ulmcnett.com> Message-ID: In article <45CD1AE2.8090503 at ulmcnett.com>, Paul McNett

wrote: > Asheesh Laroia wrote: > > On Fri, 9 Feb 2007, Shannon -jj Behrens wrote: > >> #) Use the source. Don't just read it! Update it! If you're having a > >> problem with a standard library module or a third-party module, remember > >> that you're not dealing with a compiled DLL. You can log in as root and > >> throw some print statements into the thing! Remember to undo your > >> changes before you leave. > > The fact that eggs (zip files of packaged Python code) make this harder is > > the main reason I don't like that packaging format. > Agreed. I think eggs may be great for getting required stuff on user's > machines, when for whatever reason you didn't want to be polite and > package it up for them with py2exe or something. But for developing, > nothing beats having things closer to the top level in site-packages. eggs do not have to be zipped; that's just the default. To install eggs unzipped, use the -Z (--always-unzip) option to easy_install. If you always want eggs to be installed unzipped, add a few lines to one of the config files read by setuptools or easy_install, for example: $ cat ~/.pydistutils.cfg [easy_install] upgrade = 1 zip-ok = 0 -- Ned Deily, nad at acm.org From chad.netzer at gmail.com Sat Feb 10 02:58:42 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Fri, 9 Feb 2007 17:58:42 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> Message-ID: On 2/9/07, Tony Cappellini wrote: > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > I wouldn't agree that this is a beginner topic, especially since it's > relatively new to the language. Well, the idiom isn't all that new, although as Alex M. pointed out, the 'key' argument to list.sort() is. For those not familiar with it: http://wiki.python.org/moin/HowTo/Sorting Also, see the sorted() builtin with recent Python versions. Chad From p at ulmcnett.com Sat Feb 10 05:26:27 2007 From: p at ulmcnett.com (Paul McNett) Date: Fri, 09 Feb 2007 20:26:27 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209172435.00beea68@localhost> References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209172435.00beea68@localhost> Message-ID: <45CD4973.60406@ulmcnett.com> Dennis Reinhardt wrote: > At 05:05 PM 2/9/2007, Paul McNett wrote: >> Dennis Reinhardt wrote: >> Take this example: >> >> class MyBizobj(...): >> def getCustomerInfo(self, cust_id): >> sql = """ >> select customers.name as name, >> sum(invoices.amount) as amount_total, >> blah as blah >> from customers >> left join invoices >> on invoices.cust_id = customers.id >> where customers.id = ?""" >> self.cur.execute(sql, (cust_id,)) > > To preserve SQL *and* Python structuring, I would write this as: > > class MyBizobj(...): > def getCustomerInfo(self, cust_id): > sql = "" > sql += "select customers.name as name,\r\n" > sql += " sum(invoices.amount) as amount_total,\r\n" > sql += " blah as blah\r\n" > sql += " from customers\r\n" > sql += " left join invoices\r\n" > sql += " on invoices.cust_id = customers.id\r\n" > sql += " where customers.id = ?\r\n" > self.cur.execute(sql, (cust_id,)) Yuck! :) I guess it's good that Python lets me write it how I want to, and you write it how you want to! -- pkm ~ http://paulmcnett.com From p at ulmcnett.com Sat Feb 10 05:27:59 2007 From: p at ulmcnett.com (Paul McNett) Date: Fri, 09 Feb 2007 20:27:59 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <45CD49CF.7070405@ulmcnett.com> Terry Carroll wrote: > #) Don't use "from foo import *" But don't fall into the mindset that if that is bad, "from foo import bar" is therefore bad, too. -- pkm ~ http://paulmcnett.com From lantal at tmail.com Sat Feb 10 05:28:58 2007 From: lantal at tmail.com (Laszlo Antal) Date: Fri, 9 Feb 2007 20:28:58 -0800 Subject: [Baypiggies] (no subject) Message-ID: <1171081738.2A2879EE@gf28.dngr.org> Hi, This is a great thread. I want to thank everyone for sharing their wisdom. Keep it coming. Thank you On 2/9/07, Tony Cappellini wrote: > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > I wouldn't agree that this is a beginner topic, especially since it's > relatively new to the language. > Well, the idiom isn't all that new, although as Alex M. pointed out, > the 'key' argument > to list.sort() is. > For those not familiar with it: > http://wiki.python.org/moin/HowTo/Sorting > Also, see the sorted() builtin with recent Python versions. > Chad _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies Laszlo Antal From lantal at tmail.com Sat Feb 10 05:32:39 2007 From: lantal at tmail.com (Laszlo Antal) Date: Fri, 9 Feb 2007 20:32:39 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks References: <1171081738.2A2879EE@gf28.dngr.org> Message-ID: <1171081959.118A0D91@ff1.dngr.org> Hi, This is a great thread. I want to thank everyone for sharing their wisdom. Keep it coming. Thank you On 2/9/07, Tony Cappellini wrote: > > 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > I wouldn't agree that this is a beginner topic, especially since it's > relatively new to the language. > Well, the idiom isn't all that new, although as Alex M. pointed out, > the 'key' argument > to list.sort() is. > For those not familiar with it: > http://wiki.python.org/moin/HowTo/Sorting > Also, see the sorted() builtin with recent Python versions. > Chad _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies Laszlo Antal Laszlo Antal From jjinux at gmail.com Sat Feb 10 05:39:40 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 20:39:40 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <45CD49CF.7070405@ulmcnett.com> References: <45CD49CF.7070405@ulmcnett.com> Message-ID: #) Don't write complicated classes that have similar APIs to dicts, lists, etc. If it looks like a dict and smells like a dict, use a dict. Don't write a bunch of boilerplate API. You can either subclass a real dict, subclass UserDict (in rare situations), mixin the UserDictMixin (spell? also in rare situations), etc., or just provide access to the underlying dict. #) Don't write getters and setters that don't actually do anything except set a private instance member. If that's the case, just use a public instance member. Later, you can switch to a real property using the idiom in the Python cookbook http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183: def foo(): doc = "property foo's doc string" def fget(self): return self._foo def fset(self, value): self._foo = value def fdel(self): del self._foo return locals() # credit: David Niergarth foo = property(**foo()) #) Need something? Use the online Python Cookbook ;) Got something cool? Submit it to the cookbook. The code there isn't always perfect, but it's usually a really good starting point! Happy Hacking! -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Sat Feb 10 05:42:04 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 9 Feb 2007 20:42:04 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <45CD49CF.7070405@ulmcnett.com> Message-ID: #) Don't Import the World When designing a module and considering what modules it will need to import, consider what the hierarchy of modules will look like when you're done. If your hierarchy has arrows going back towards the top, something is wrong; circular imports are nightmarish. It's better to have many small modules with a clean hierarchy of imports. #) Embrace Truth According to Python Consider the following: >>> def truth(x): ... if x is not None: # Truth test 1. ... print "Not none." ... if x: # Truth test 2. ... print "bool(x) is not False." ... >>> truth(None) # Fails both tests. >>> truth(True) # Passes both tests. Not none. bool(x) is not False. # Only passes test 1. >>> truth([]) Not none. Python has a very-rich understanding of "truth". if x is not None is very simple and fast. if x is very smart and flexible. Both are useful. Understand the difference and pick the right one for your situation. #) Embrace the Pythonic Approach to Interfaces Python doesn't have interfaces in the same way Java and C++ do. Instead, it has duck typing, "If it looks like a duck and quacks like a duck, it's a duck!" Consider: >>> def talk_to(obj): ... obj.talk() ... >>> class Dog: ... def talk(self): ... print "Woof!" ... >>> class Cat: ... def talk(self): ... print "Meow!" ... >>> talk_to(Dog()) Woof! >>> talk_to(Cat()) Meow! In Java, Dog and Cat would need to either subclass some parent class or implement an interface. This is unnecessary in Python. Nonetheless, it's still a good idea to at least document complicated interfaces. If you insist on creating what C++ calls a "pure virtual" method, here's how: >>> class Talks: ... def talk(self): ... """Print something interesting.""" ... raise NotImplementedError ... >>> class Dog(Talks): ... pass ... >>> Dog().talk() Traceback (most recent call last): File "", line 1, in ? File "", line 3, in talk NotImplementedError Tools like Epydoc and PyChecker understand this NotImplementedError idiom. Furthermore, it's a great opportunity to include some documentation about the method. #) Use the dict.get() Method >>> d = {"a": 1} >>> if d.has_key("a"): # This is the hard way. ... value = d["a"] ... else: ... value = "default" ... >>> print value 1 >>> print d.get("a", "default") # This is the easy way. 1 >>> b = d.get("b") >>> if b is None: ... print "Oh, no! No b!" ... Oh, no! No b! #) Similarly, have a peek at: help({}.setdefault). Happy Hacking! -jj From DennisR at dair.com Sat Feb 10 05:46:45 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Fri, 09 Feb 2007 20:46:45 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <1171081738.2A2879EE@gf28.dngr.org> Message-ID: <5.1.0.14.0.20070209204012.00be9ae8@localhost> At 08:28 PM 2/9/2007, Laszlo Antal wrote: >Hi, >This is a great thread. >I want to thank everyone for sharing their wisdom. >Keep it coming. I *was* going to duck out because I was outnumbered by those favoring triple quoting. Yes, triple quoting can work for simple situations. The triple quoting examples displayed in this thread have been just that: simple. They do not include conditionally executed code or do parameter substitution. What they do is obscure the block structure of the code. Here is a code fragment from my talk last night (foil 15, I believe). How would you re-write this to utilize triple quoting? The task here is to build a two level visual tree structure: # build entire initial tree structure def init_tree(ht_obj): html = "" index = 0 last_exe = "" for xml_entry in util_actwin.display_list("enm", "+"): exe_name = str_extract(xml_entry, ["enm"]) keye = safe_int(str_extract(xml_entry, ["key"])) act = str_extract(xml_entry, ["act"]) #logger("init_tree %s %s" % (keye, exe_name)) fname, exe = exe_name.split(".") if fname != last_exe: html += "" if fname == expanded_node: html += "" else: html += "\r\n\r\n" % hovered_img(ht_obj, index) html += "" % get_program_image(fname) html += "" % fname html += "" html += "" if fname == expanded_node: html += "" html += "" parm_index = safe_int_default(ht_obj.param("index"), -1) if parm_index == keye: html += "" html += "" % hovered_img(ht_obj, index) The equivalent snippet from Drew > cols = [T.td[T.a(href=("edt_main.py?slct=edit" > "&class=tree_open32" > "&index=", keye, > "&act=", act) > )[hovered_img(ht_obj, index)]], I guess the nesting take some getting used to. Stripping all the contained wording, Drew's version above becomes cols = [[(())[()]], where the opening "[" is not balanced because it is closed later> Compare the equivalent stripped version of Dennis's code html += "" I think moving the nesting of html into Python "[...]" and "(...)" creates its own difficulties in reading and understanding. >Nevow gets quoting right, so probably some of the other code could be >simplified. hovered_img() should return a stan structure instead of the >insides of an img tag, too. So some of the nesting in the stripped version above would simplify, right? Maybe the stripped code becomes cols = [[(())], ??? >My version of the code has 2/3 as many "words" as the original, as >counted by wc. Does that make it easier to maintain? I'm not sure, Dennis's stripped version has 5 words while Drew's has 0. Those extra words help to visually scan the html. I think those extra words may be reducing cognitive load, allowing easier manual matchup of nesting. Drew's version is moving some of the html nesting into Python. I am not sure which version would be easier to maintain either. >http://cheeseshop.python.org/pypi/Breve/1.0.35 >http://www.kieranholland.com/code/documentation/nevow-stan/ thanks for your version and the references. regards, Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From glenn.gee at batnet.com Wed Feb 14 18:20:25 2007 From: glenn.gee at batnet.com (Glenn R. Edwards) Date: Wed, 14 Feb 2007 09:20:25 -0800 Subject: [Baypiggies] Contract Python programming Message-ID: <000401c7505c$6b0ce910$6501a8c0@gee02> I have a modest Python programming task that I need to contract to a local (Bay Area) individual. The project will start immediately and I am the main contact, engineering manager and payor. In general, the program will play a supervisory role to a machine-control application (EMC2: see linuxcnc.org) running on a Linux:Ubuntu platform. The supervisor will load EMC2 work files, monitor all EMC2 processing and automatically retrieve/send files to a local (LAN) Linux server. More details available after initial contact. The contract will likely be arranged as a fixed-price contract as I feel the specification is sufficiently clear and complete to do so. Interested parties should please contact me directly and only by email. I will accept replies for the next two days. I am a newbie and if I have broken any code-of-conduct for this group by posting this job in this manner, I apologize. Please inform me of the proper way to do so. Best regards, -- -- Glenn glenn.gee at batnet.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070214/d70c00d7/attachment.htm From chad.netzer at gmail.com Wed Feb 14 20:39:36 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Wed, 14 Feb 2007 11:39:36 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - stan In-Reply-To: <5.1.0.14.0.20070214082207.00beb440@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <45D2B455.7030100@bigasterisk.com> <5.1.0.14.0.20070214082207.00beb440@localhost> Message-ID: On 2/14/07, Dennis Reinhardt wrote: > At 11:03 PM 2/13/2007, Drew Perttula wrote: > > >Some notes: > >The python lists and tuples in the xml-creating code will simply > >disappear in the output. T.p["foo", "bar"] renders to "

foobar

". > > Hmmm... I thought the x[y] syntax was doing an element access on dict or > list x to find element y. If x is an function, then I am guessing that > x[y] is shorthand for > > z = [y] > x(z) > > or something like that. Hmmm. I'm not sure what you mean here. If x is a function, then it is not subscriptable. I suppose it may be possible to fiddle with the function object's __dict__ to try to make it subscriptable, but it would be an unusual hack. However, if x is an object from a user created class X, then x[y] is syntactic sugar for: X.__getitem__(x, key) where key may be just about anything; a integer, a string, a list of strings, etc. Of course, your object should be prepared to handle the key, which in Drew's T.p["foo", "bar"] example, seems to mean consolidating a sequence. http://docs.python.org/ref/sequence-types.html > A snippet from Dennis: > >> html += "
" % hovered_img(ht_obj, index) > > The equivalent snippet from Drew > > cols = [T.td[T.a(href=("edt_main.py?slct=edit" > > "&class=tree_open32" > > "&index=", keye, > > "&act=", act) > > )[hovered_img(ht_obj, index)]], > > > I guess the nesting take some getting used to. Stripping all the contained > wording, Drew's version above becomes > > cols = [[(())[()]], > > where the opening "[" is not balanced because it is closed later> Compare > the equivalent stripped version of Dennis's code > > html += "" I think to be fair, I'd say Drew's stripped version is something like: cols = [T.td[T.a(href="")], blahblahblah] ie. the html structure is more than the parens or square brackets. And building the href in place adds to the visual complexity in both examples. It seems to me, just like when deciding whether to use an Expat or DOM parser, I'd choose a method based on how I want to manipulate the structure of the document before finally generating it. Chad From jjinux at gmail.com Wed Feb 14 22:06:26 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 14 Feb 2007 13:06:26 -0800 Subject: [Baypiggies] Contract Python programming In-Reply-To: <000401c7505c$6b0ce910$6501a8c0@gee02> References: <000401c7505c$6b0ce910$6501a8c0@gee02> Message-ID: On 2/14/07, Glenn R. Edwards wrote: > I have a modest Python programming task that I need to contract to a local > (Bay Area) individual. The project will start immediately and I am the main > contact, engineering manager and payor. > > In general, the program will play a supervisory role to a machine-control > application (EMC2: see linuxcnc.org) running on a Linux:Ubuntu platform. > The supervisor will load EMC2 work files, monitor all EMC2 processing and > automatically retrieve/send files to a local (LAN) Linux server. More > details available after initial contact. > > The contract will likely be arranged as a fixed-price contract as I feel the > specification is sufficiently clear and complete to do so. > > Interested parties should please contact me directly and only by email. I > will accept replies for the next two days. > > I am a newbie and if I have broken any code-of-conduct for this group by > posting this job in this manner, I apologize. Please inform me of the > proper way to do so. Thanks for your diligence. I think you're fine. If anyone feels that a posting has broken the rules, please send email to me privately, and I will handle it off list so that 400 other people don't have to spend time on it. Thanks! -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Wed Feb 14 22:19:36 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 14 Feb 2007 13:19:36 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <20070214040013.GB1076@panix.com> References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> <20070214040013.GB1076@panix.com> Message-ID: On 2/13/07, Aahz wrote: > On Tue, Feb 13, 2007, Shannon -jj Behrens wrote: > > > > #) Using try/except for flow control: > > > > """Try to actually log the user in. > > > > BASIC IDEA: A million things can go wrong, and there are several ways to > > succeed. You want to check for the ways that can succeed and continue on as > > soon as one of them does. You want the non-local flow of control that > > exceptions provide, but you need it for both success *and* failure. > > > > """ > > > > def doLoginAction(self): > > """Try to actually log the user in.""" > > class PasswordAccepted(Exception): pass > > try: > > if check_password(): # This may raise KeyError. > > raise PasswordAccepted > > do_more_expensive_work() > > and_even_more_expensive_work() > > if check_other_password(): # This may raise KeyError. > > raise PasswordAccepted > > raise KeyError > > except KeyError: > > self.setError("Invalid username or password.") > > return > > except PasswordAccepted: > > pass > > continue_successfully() > > This really should not call setError(), it should simply raise > ValueError (ValueError is for invalid data). Sorry for the confusion. setError() is fictitious. Presumably, you would do something like create an error response for the user with the given warning. Perhaps setError could be replaced with code that redirects the user to an error page. -jj -- http://jjinux.blogspot.com/ From whitaker at google.com Thu Feb 15 03:28:15 2007 From: whitaker at google.com (Russell Whitaker) Date: Wed, 14 Feb 2007 18:28:15 -0800 Subject: [Baypiggies] Looking for a hotel room at PyCon 2007 Message-ID: <997a56990702141828t7e37366oe3aa79e4ddd5ed64@mail.gmail.com> I waited too long to commit to attending next week's PyCon 2007 in Dallas: I called the hotel and found out they're fully booked. So, I'm looking for a room/suite share... anyone up for it? Thanks, -- Russell Whitaker Sysops Tools Team Lead Google Inc., Mt View, CA "gets() remains as a monument to C's continuing support of buffer overruns." - Bill Frantz From webmaven at cox.net Thu Feb 15 03:35:19 2007 From: webmaven at cox.net (Michael Bernstein) Date: Wed, 14 Feb 2007 18:35:19 -0800 Subject: [Baypiggies] Looking for a hotel room at PyCon 2007 In-Reply-To: <997a56990702141828t7e37366oe3aa79e4ddd5ed64@mail.gmail.com> References: <997a56990702141828t7e37366oe3aa79e4ddd5ed64@mail.gmail.com> Message-ID: <1171506919.5121.164.camel@workshop> On Wed, 2007-02-14 at 18:28 -0800, Russell Whitaker wrote: > I waited too long to commit to attending next week's PyCon 2007 in > Dallas: I called the hotel and found out they're fully booked. > > So, I'm looking for a room/suite share... anyone up for it? Try posting here: http://us.pycon.org/Addison/RoomSplitting - Michael Bernstein -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/baypiggies/attachments/20070214/c7a6849d/attachment.pgp From whitaker at google.com Thu Feb 15 03:48:29 2007 From: whitaker at google.com (Russell Whitaker) Date: Wed, 14 Feb 2007 18:48:29 -0800 Subject: [Baypiggies] Looking for a hotel room at PyCon 2007 In-Reply-To: <1171506919.5121.164.camel@workshop> References: <997a56990702141828t7e37366oe3aa79e4ddd5ed64@mail.gmail.com> <1171506919.5121.164.camel@workshop> Message-ID: <997a56990702141848t4e0be0aai323c6fc202937ff5@mail.gmail.com> On 2/14/07, Michael Bernstein wrote: > On Wed, 2007-02-14 at 18:28 -0800, Russell Whitaker wrote: > > I waited too long to commit to attending next week's PyCon 2007 in > > Dallas: I called the hotel and found out they're fully booked. > > > > So, I'm looking for a room/suite share... anyone up for it? > > Try posting here: > http://us.pycon.org/Addison/RoomSplitting > > - Michael Bernstein > Excellent! Thanks for the pointer! -- Russell Whitaker Sysops Tools Team Lead Google Inc., Mt View, CA "gets() remains as a monument to C's continuing support of buffer overruns." - Bill Frantz From drewp at bigasterisk.com Thu Feb 15 08:21:49 2007 From: drewp at bigasterisk.com (Drew Perttula) Date: Wed, 14 Feb 2007 23:21:49 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - stan In-Reply-To: <5.1.0.14.0.20070214082207.00beb440@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> Message-ID: <45D40A0D.8060005@bigasterisk.com> Dennis Reinhardt wrote: > At 11:03 PM 2/13/2007, Drew Perttula wrote: > > >Some notes: > >The python lists and tuples in the xml-creating code will simply > >disappear in the output. T.p["foo", "bar"] renders to "

foobar

". > > Hmmm... I thought the x[y] syntax was doing an element access on dict or > list x to find element y. If x is an function, then I am guessing that Nope, the square brackets are being used in a novel way that creates stan structures, which are later rendered as html. It's absolutely unguessable and essentially new syntax, except that it follows the python rules for subscripting (which do allow comma-separated objects). Fortunately, the xml angle brackets are completely gone in stan, so a python programmer actually has less overall syntax rules to memorize. I also never think about xml quoting or unicode issues in my stan templates, which is really nice. The implementation of that special stan syntax is surprisingly simple. You can check it out at http://divmod.org/trac/browser/trunk/Nevow/nevow/stan.py Line 313 lets T.p(align="center") save an attribute on a p tag; lines 336-338 remember the children in T.p[child1, child2, child3]. Other files of interest: http://divmod.org/trac/browser/trunk/Nevow/nevow/flat/flatstan.py -> the rendering of stan into xml (with all the quoting). http://divmod.org/trac/browser/trunk/Nevow/nevow/tags.py -> setup of the standard tags, such as T.p, T.h1, T.table From DennisR at dair.com Thu Feb 15 21:22:43 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Thu, 15 Feb 2007 12:22:43 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: <45D40A0D.8060005@bigasterisk.com> References: <5.1.0.14.0.20070214082207.00beb440@localhost> <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> Message-ID: <5.1.0.14.0.20070215112850.00bee9a0@localhost> At 11:21 PM 2/14/2007, Drew Perttula wrote: >Nope, the square brackets are being used in a novel way that creates stan >structures, Summary ------- Appending many string fragments is done most efficiently using a dict in both time and memory under extreme conditions. Text append gives better memory results than list append. Under realistic conditions, there was little reason to choose text over list over dict. Discussion ---------- This discussion and Stan got me thinking. Today, I want to tackle code which generates a graphical directory display of icons. It is possible for people to have directories of thousands (maybe even 10s of thousands) of icons. Efficiency may matter. The convention wisdom, IIRC, is to do list appends rather than string appends. I wrote a program to test this, measuring execution time and final memory footprint under windows. Here is the code: import time def holding(): #l = "" #l = [""] l = {} for x in range(0,100000): #l += "abcdef" #l += ["abcdef"] #l.append("abcdef") l[x] = "abcdef" time.sleep(1) print "enter holding" for a in range(0,10): start = time.time() for b in range(0,10): holding() print "%3.5f" % (time.time()-start) time.sleep(1) print "exit holding" time.sleep(2000) The code uses "range" because I want to run it under 2.3, although all the results reported here are for 2.5. Here are the results: TIME (10 calls ea) 100K_iter_1_str 500K_iter_1_str 100K_iter_5_str 1K_iter_5_str text 0.422 15.656 14.937 0.016 list+= 0.438 2.2 0.421 0.016 list_append 0.219 1.188 0.219 0.016 dict 0.203 1.031 0.204 0 MEM 100K_iter_1_str 500K_iter_1_str 100K_iter_5_str 1K_iter_5_str text 6.196 10.356 5.44 3.548 list+= 7.196 11.92 7.192 3.56 list_append 7.192 11.92 7.196 3.56 dict 5.66 9.548 5.656 3.588 The TIME results are in seconds for 10 calls to holding(), as should be clear from the code. The best and worst case timings among the 10 runs did not vary much (usually second decimal) and so for simplicity I simply reported worst case timing. The MEM results are in megabytes of memory at the end of run (at "exit holding"). At start of run before entering holding(), memory used was 3.5 MB. Clearly, there is a systematic growth in memory. The final time.sleep(2000) is to allow time for garbage collection to reduce memory usage. In one run, I waited 10 minutes and saw no change in memory used. The memory used fluctuated far more than time. My expectation for the memory results is that all memory internal to holding() would be released because all variables were local. This expectation does not appear to be met. Across the columns, "100K_iter" means the for x in range(0,100000): statement had an upper limit of 100000 (as shown) while 500K_iter says the upper limit is 5 times greater and so on. "1_str" means the string used is "abcdef" (as shown) while 5_str means "abcdefabcdefabcdefabcdefabcdef" was used instead. For the rows, text means that the #l = "" #l += "abcdef" statements were uncommented while dict is uncommented in the code show. Evaluation ------------ I am looking at HTML generation. A 100K HTML file is *huge*. Doing 100K or 500K appends of a 6 or 30 character string are "stress tests" which I simply do not expect to reach. I would like to know what the behavior is but these levels are not the design point. The final column showing 1000 appends of a 30 character string represent a typical design point. At 1K iterations, the time differences do not matter. I am using a Dual core 2 GHz machine for timing. Even a machine 20X slower is still acceptable for generating a local html page. If I were writing a multiuser server, the timing would matter. In my app, it simply does not matter at my design point. What matters more to me is memory footprint. The list append tests show larger memory footprint under all conditions tested. Under realistic test conditions, there is little difference in memory footprint and I would expect that running more iterations or changing the test conditions could affect the rankings. Under realistic conditions, there is not much difference in either time or memory footprint. --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From cvanarsdall at mvista.com Thu Feb 15 22:00:57 2007 From: cvanarsdall at mvista.com (Carl J. Van Arsdall) Date: Thu, 15 Feb 2007 13:00:57 -0800 Subject: [Baypiggies] PyCon meetup anyone? Message-ID: <45D4CA09.8010103@mvista.com> Hey guys, I'll be at PyCon and I can't wait. I was thinking it might be cool to get together for dinner/drinks with a few bay area ex patriots while we're in texas. Would anyone be interested in this type of thing? Hey, let me know on my private email, we don't need to include the whole list. I'll build up a list of people who are interested and try to coordinate as best I can. We can nerd out in a foreign country - yes, california is that special to me ;) - so let me know! Hope to see some of you next week! -carl -- Carl J. Van Arsdall cvanarsdall at mvista.com Build and Release MontaVista Software From dyoo at cs.wpi.edu Thu Feb 15 22:44:18 2007 From: dyoo at cs.wpi.edu (Daniel Yoo) Date: Thu, 15 Feb 2007 16:44:18 -0500 (EST) Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: <5.1.0.14.0.20070215112850.00bee9a0@localhost> References: <5.1.0.14.0.20070214082207.00beb440@localhost> <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> Message-ID: > Appending many string fragments is done most efficiently using a dict in > both time and memory under extreme conditions. Hi Dennis, I am not sure what you mean by this. Let's make it clear: we have some concept of a template that whose "holes" need to be filled in. There are a few ways to implement the concept of a templated string: * By appending string fragments together. def mad_libs(noun, verb): return noun + " was " + verb + "ing along when ..." Alternatively, def mad_libs(noun, verb): buffer = [] buffer.append(noun) buffer.append(" was ") ... ## you get the idea return ''.join(buffer) * By using string formatting to interpolate a value. In this case, we have two options to the string formatter, to pass along the values through a list, or through a dictionary: def mad_lib(noun, verb): return '%s was %sing along when' % (noun, verb) I know what you meant to say earlier with, > Appending many string fragments is done most efficiently using a dict in > both time and memory under extreme conditions. but we have to be careful here: you don't want to compare the act of doing string interpolation to do string concatenation. Rather, you mean to say "Filling in a template is done most efficiently using string formatting with a dictionary..." If you like, think of it in terms of conceptual "types": the left hand side has to be an intention, a concept, and the right hand side is the implementation to make that intention work. > This discussion and Stan got me thinking. Today, I want to tackle code > which generates a graphical directory display of icons. It is possible > for people to have directories of thousands (maybe even 10s of > thousands) of icons. Efficiency may matter. > > The convention wisdom, IIRC, is to do list appends rather than string > appends. In some cases, we do not necessarily need to do any appends at all, list or string. We can generate the output on-the-fly, writing our output to a file-like object. This part has been a bit ignored in the discussion. Concretely: ################################### def mad_libs(name, verb, out_file): out_file.write(noun) out_file.write(" was ") ... ## you get the idea ################################### We do not have to always work with constructing strings. In fact, in a lot of applications, we must not, or else we'll run out of memory. > I wrote a program to test this, measuring execution time and final > memory footprint under windows. Here is the code: I'm cutting out the commented lines. ############################# def holding(): l = {} for x in range(0,100000): l[x] = "abcdef" ############################# Can you explain what this is trying to test? As far as I can tell, this is testing how fast we can build dictionaries, but there's only one string literal value involved here. The problem is this: there's no string concatenation or string building going on here at all, so I'm not sure how this relates to previous discussion. I think this might be related to the confusion earlier that dictionaries could be directly used to concatenate strings together. That's not true: you need to go through a string-formatting operation too. I assume that you had several edited versions of "holding", each corresponding to a commented line. You have to compare apples to apples. The version working with dictionaries (as well as the one working with lists) must make the same end result, the same content as the version that I assume looks like: ############################ def holding(): l = "" for x in range(0,100000): l += "abcdef" ############################# To make this easier, we should change the defintions so that these are actual functions that can be compared functionally. For example: ############################################## def holding_with_lists(): l = [] for x in range(0,100000): l.append("abcdef") return ''.join(l) def holding_naive(): l = "" for x in range(0,100000): l += "abcdef" return l assert holding_with_lists() == holding_naive() ############################################## Otherwise, without making sure these different implemenations return the same result, we risk comparing apples to oranges. I suspect that's what's happened here. By the way, if we're going to publish benchmarks, we should make it easy to replicate those benchmarks. The things we're comparing should be independent functions that can be tested. Asking people to comment or uncomment lines of code to do the measurements is error prone. Good luck to you. From chad.netzer at gmail.com Thu Feb 15 23:21:39 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Thu, 15 Feb 2007 14:21:39 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> Message-ID: On 2/15/07, Daniel Yoo wrote: > To make this easier, we should change the defintions so that these are > actual functions that can be compared functionally. For example: > > ############################################## > def holding_with_lists(): > l = [] > for x in range(0,100000): > l.append("abcdef") > return ''.join(l) > > def holding_naive(): > l = "" > for x in range(0,100000): > l += "abcdef" > return l > > assert holding_with_lists() == holding_naive() > ############################################## > > Otherwise, without making sure these different implemenations return the > same result, we risk comparing apples to oranges. I suspect that's what's > happened here. Danny, in addition to your good advice, I'd also suggest not using range() in the loop, since Dennis was also intending to look at memory footprint. Use xrange(), or make a simple iterator instead. Dennis, you said in your example, "The final time.sleep(2000) is to allow time for garbage collection to reduce memory usage." However, that certainly will have no effect with CPython, nor do operating system memory allocators work that way. If I'm wrong about this, someone please enlighten me. You could try: gc.collect() but these simple examples probably don't have any unreachable memory cycles. In general, memory usage benchmarking can be a tricky undertaking, sometimes even for 'simple' examples. Chad From jjinux at gmail.com Fri Feb 16 00:09:11 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 15 Feb 2007 15:09:11 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> Message-ID: On 2/15/07, Chad Netzer wrote: > On 2/15/07, Daniel Yoo wrote: > > > To make this easier, we should change the defintions so that these are > > actual functions that can be compared functionally. For example: > > > > ############################################## > > def holding_with_lists(): > > l = [] > > for x in range(0,100000): > > l.append("abcdef") > > return ''.join(l) > > > > def holding_naive(): > > l = "" > > for x in range(0,100000): > > l += "abcdef" > > return l > > > > assert holding_with_lists() == holding_naive() > > ############################################## > > > > Otherwise, without making sure these different implemenations return the > > same result, we risk comparing apples to oranges. I suspect that's what's > > happened here. > > > Danny, in addition to your good advice, I'd also suggest not using > range() in the loop, since Dennis was also intending to look at memory > footprint. Use xrange(), or make a simple iterator instead. > > Dennis, you said in your example, "The final time.sleep(2000) is to > allow time for garbage collection to reduce memory usage." However, > that certainly will have no effect with CPython, nor do operating > system memory allocators work that way. If I'm wrong about this, > someone please enlighten me. You could try: > > gc.collect() > > but these simple examples probably don't have any unreachable memory > cycles. In general, memory usage benchmarking can be a tricky > undertaking, sometimes even for 'simple' examples. I saw a talk at PyCon two years ago that said that Python would never give memory back to the OS. That's probably changed, but I'd check first. I think this discussion is a bit of a red herring. I still think we should focus on readability. If Dennis insists on using += instead of a nice templating engine like Cheetah, and it turns out that list.append uses less memory than +=, then let's remember that that StringIO takes care of using a list internally. I suggest he do the following since he seems to dislike triple quoted strings (which I don't agree with): from cStringIO import StringIO buf = StringIO() w = buf.write w("String") w("String %s bar." % name) ... return w.getvalue() Better yet, wrap that boilerplate in a function and use a "with" statement to do it automatically ;) As another contribution to perhaps make him happier, I submit this, which I use to use before I switched to Cheetah: =============================================== def evalstr(s, dollar="$"): """Evaluate a string with embedded python expressions. This is a Python version of the function evalstr, which is used for variable interpolation. For instance, a = 5 evalStr("I have $a$ dogs.") will return "I have 5 dogs." The code between the $'s can be any valid Python expression. I'll just basically do str(eval(expression), yourGlobals, yourLocals) Since eval is being used, the expression must return some value. To escape $'s in s, just use $$ (even within expressions). To use a different character than $, pass the desired character in the second (optional) argument. If there are an odd number of $ symbols, a ValueError exception will be raised. Here are some additional examples (assuming a = 5): "My dog is $a$ years old." -> "My dog is 5 years old.", "I have $$5.00" -> "I have $5.00", "My $a$ year old dog has $$5.00" -> "My 5 year old dog has $5.00", "My dog has $'$$%s.' % a$" -> "My dog has $5.", "My dog has $'$$' + str(a) + '.'" -> ValueError exception, "My dog is $a$.$" -> ValueError exception, "$$ is a char." -> "$ is a char.", "$a$ is a number." -> "5 is a number.", "$a$" -> "5", "$a" -> ValueError exception, "I have a $$" -> "I have a $", "" -> "", "Spam" -> "Spam", "$" -> ValueError exception, "$ evalstr('I am #a#.', '#') $" -> "I am 5." """ # By the way, I'm sorry if this stuff is hard to read. If you # can come up with something more elegant, I'd love to see it, # but this is the best that I could come up with. import string import sys inEv = 0 # Are we in eval mode (i.e. inside a single $)? inDollar = 0 # We just got a dollar. We might be in an escape sequence. ret = "" # This is the string we're returning. tok = "" # The token we're currently working with. stack = [] # All good languages are stack based ;) i=j=0 # These are indexes into s. # Grab the calling function's namespace. I can't find a nice # way to do this other than manually generating an exception # and surfing the traceback. As for performance, you can do # this about 10000 times in a bit less than a second on my # PIII 600 mhz system. try: 1/0 except: traceback = sys.exc_info()[2] currFrame = traceback.tb_frame prevFrame = currFrame.f_back prevGlobals = prevFrame.f_globals prevLocals = prevFrame.f_locals # If they forget to close the $, raise a ValueError exception. if string.count(s, dollar) % 2: raise ValueError, "unmatched dollar symbol" sLen = len(s) while 1: # Get next token. j = i if j==sLen: tok = "" elif s[j] == dollar: tok = dollar i = j+1 else: while j 0: ret = ret + \ str(eval(string.join(stack, ""), prevGlobals, prevLocals)) ret = ret + tok stack = [] # Deal with end of string. if tok == "": break return ret # I also have a C version of this if you want it. =============================================== Happy Hacking! -jj -- http://jjinux.blogspot.com/ From DennisR at dair.com Fri Feb 16 00:08:06 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Thu, 15 Feb 2007 15:08:06 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> Message-ID: <5.1.0.14.0.20070215145929.00bf3c20@localhost> At 02:21 PM 2/15/2007, Chad Netzer wrote: >Dennis, you said in your example, "The final time.sleep(2000) is to >allow time for garbage collection to reduce memory usage." However, >that certainly will have no effect with CPython, nor do operating >system memory allocators work that way. I read at http://docs.python.org/lib/module-gc.html where it says "tune the collection frequency" and other statements on this page to mean that the garbage collector makes periodic sweeps of object references. I do not see what the timing is. I did provide for a window in this code so that if such a sweep resulted in lowering memory requirements, I had provided for time to go by. Informal testing on a large system (not this toy example) where I set the gc collection interval to every minute did not materially affect the results. In this toy example, I had experimented with explicit del() calls and took them out of the code as they made no improvement. Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From kelly at nttmcl.com Fri Feb 16 00:15:50 2007 From: kelly at nttmcl.com (Kelly Yancey) Date: Thu, 15 Feb 2007 15:15:50 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> Message-ID: <45D4E9A6.5090201@nttmcl.com> Shannon -jj Behrens wrote: > > I saw a talk at PyCon two years ago that said that Python would never > give memory back to the OS. That's probably changed, but I'd check > first. > Only Python 2.5 currently frees memory back to the system. From http://docs.python.org/whatsnew/ports.html: Evan Jones's patch to obmalloc, first described in a talk at PyCon DC 2005, was applied. Python 2.4 allocated small objects in 256K-sized arenas, but never freed arenas. With this patch, Python will free arenas when they're empty. The net effect is that on some platforms, when you allocate many objects, Python's memory usage may actually drop when you delete them and the memory may be returned to the operating system. (Implemented by Evan Jones, and reworked by Tim Peters.) Kelly From annaraven at gmail.com Fri Feb 16 00:30:59 2007 From: annaraven at gmail.com (Anna Ravenscroft) Date: Thu, 15 Feb 2007 15:30:59 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: <5.1.0.14.0.20070215145929.00bf3c20@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> <5.1.0.14.0.20070215145929.00bf3c20@localhost> Message-ID: On 2/15/07, Dennis Reinhardt wrote: > > At 02:21 PM 2/15/2007, Chad Netzer wrote: > > >Dennis, you said in your example, "The final time.sleep(2000) is to > >allow time for garbage collection to reduce memory usage." However, > >that certainly will have no effect with CPython, nor do operating > >system memory allocators work that way. > > > I read at http://docs.python.org/lib/module-gc.html where it says > > "tune the collection frequency" > > and other statements on this page to mean that the garbage collector makes > periodic sweeps of object references. I do not see what the timing is. I > did provide for a window in this code so that if such a sweep resulted in > lowering memory requirements, I had provided for time to go by. > > Informal testing on a large system (not this toy example) where I set the > gc collection interval to every minute did not materially affect the > results. In this toy example, I had experimented with explicit del() > calls > and took them out of the code as they made no improvement. > > Dennis > > > --------------------------------- > | Dennis | DennisR at dair.com | > | Reinhardt | http://www.dair.com | > --------------------------------- > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > May I suggest that, given the variety of "expert" responses, this might not be an appropriate topic for newbies/beginners night? It's a great topic for discussion in general... -- cordially, Anna -- It is fate, but call it Italy if it pleases you, Vicar! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070215/4b6e86e5/attachment.htm From chad.netzer at gmail.com Fri Feb 16 01:29:45 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Thu, 15 Feb 2007 16:29:45 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: <5.1.0.14.0.20070215145929.00bf3c20@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> <5.1.0.14.0.20070215145929.00bf3c20@localhost> Message-ID: On 2/15/07, Dennis Reinhardt wrote: > At 02:21 PM 2/15/2007, Chad Netzer wrote: > > >Dennis, you said in your example, "The final time.sleep(2000) is to > >allow time for garbage collection to reduce memory usage." However, > >that certainly will have no effect with CPython, nor do operating > >system memory allocators work that way. > > > I read at http://docs.python.org/lib/module-gc.html where it says > > "tune the collection frequency" > > and other statements on this page to mean that the garbage collector makes > periodic sweeps of object references. Note that the "garbage collector module" in CPython refers to the cyclic-reference garbage collector, not the normal reference count garbage collecting system. In general, objects are destroyed immediately after their reference count drops to zero, rather than when a separate garbage collector thread decides to mark them as garbage. Hence, if you want to collect any unreachable cycles, gc.collect() should definitely replace any sleep() calls. I'm happy to hear that, as of 2.5, CPython can now return blocks of memory used to allocate small objects to the system on occasion. Hmmm, let's see... Cool! I just tried it! First, fire up python 2.4 (or less) and input this: class Foo: pass l = [Foo() for i in xrange(1000000)] Now we have a list of small user created objects, and the Python process on my machine is using 217 MB of virtual mem (and 184 MB real mem). If I delete the list: del l My process is now using 213 virtual (181 real), so although the memory is available for reuse by Python's object allocator, it is not returned to the system (ie. it is not free()'d). This means I can make the same list again: l = [Foo() for i in xrange(1000000)] and the python process now uses the same max amount of memory as before (217 MB virtual/184MB real). Now, trying the same thing in Python 2.5: class Foo: pass l = [Foo() for i in xrange(1000000)] and I get 219 MB virtual memory used (185 MB real memory). However, now when I delete the list: del l My virtual memory usage drops back down to 37 MB (3 MB real), which is practically what it started with. So, although this is a contrived small object usage example, I think it is kinda neat. :) Chad PS. Yes, Anna, this isn't really beginner night material; just fun to discuss. From alvinwang at gmail.com Fri Feb 16 01:37:42 2007 From: alvinwang at gmail.com (Alvin Wang) Date: Thu, 15 Feb 2007 16:37:42 -0800 Subject: [Baypiggies] Pycon 2008 Bid Status Message-ID: <77d044440702151637m324524eevf2b41aaf883b5d27@mail.gmail.com> I am sure some of you may be wondering what is happening. Originally, there were 3 other cities other than SF interested. Boston, Cleveland and Chicago. Boston and Cleveland have pretty much dropped out. I missed the online chat where Chicago detailed their status. From some emails, it seems like they are having a few problems. They should still get a bid in. I contacted the Santa Clara and San Mateo Convention/Visitor Bureaus. Got some bids. Had 2 finalists - San Mateo Marriott and Santa Clara Marriott. I am going with San Mateo Marriott. Santa Clara Marriott is a little bigger. I am hoping that we can attract more people but it is not guaranteed. Santa Clara is planning on trying to rent out any space that we do not use. San Mateo is going to give us all the meeting space 24x7. For the time of the conference, we will own the hotel so they are planning on being very accommodating. The decision will be made at Pycon. It is a 2 year bid. If the bid is accepted, Pycon will be signing the contract. It also has a core of volunteers to work on the conference. Personally, I am planning on focusing on increasing local attendance by working with other local user groups and finding SV speakers. Hopefully, there will be a lot of interest from Baypiggies in helping out. I already have a list of several volunteers. -- Alvin Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070215/33f0b821/attachment.htm From DennisR at dair.com Fri Feb 16 01:58:53 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Thu, 15 Feb 2007 16:58:53 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - test results In-Reply-To: References: <5.1.0.14.0.20070215145929.00bf3c20@localhost> <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> <5.1.0.14.0.20070215145929.00bf3c20@localhost> Message-ID: <5.1.0.14.0.20070215164640.00bef830@localhost> At 04:29 PM 2/15/2007, Chad Netzer wrote: >Note that the "garbage collector module" in CPython refers to the >cyclic-reference garbage collector, not the normal reference count >garbage collecting system. In general, objects are destroyed >immediately after their reference count drops to zero, rather than >when a separate garbage collector thread decides to mark them as >garbage. Distinction noted. It was not entirely clear to me which case applied to my code: 1) N objects all having reference counts of 0 or 2) N objects with N-1 references counts of 1 in a chain with 1 object having 0 references. IOW, I was not clear which model applied to my situation. I was abetted in not having a clear picture of this because memory I expected to be returned to OS was not returned. I was holding open the possibility that the cyclic-reference collector might apply. >I'm happy to hear that, as of 2.5, CPython can now return blocks of >memory used to allocate small objects to the system on occasion. >Hmmm, let's see... > >Cool! Yes, Cool! Great stuff. --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From aahz at pythoncraft.com Fri Feb 16 22:14:40 2007 From: aahz at pythoncraft.com (Aahz) Date: Fri, 16 Feb 2007 13:14:40 -0800 Subject: [Baypiggies] Pycon 2008 Bid Status In-Reply-To: <77d044440702151637m324524eevf2b41aaf883b5d27@mail.gmail.com> References: <77d044440702151637m324524eevf2b41aaf883b5d27@mail.gmail.com> Message-ID: <20070216211440.GA1942@panix.com> On Thu, Feb 15, 2007, Alvin Wang wrote: > > The decision will be made at Pycon. It is a 2 year bid. > > If the bid is accepted, Pycon will be signing the contract. It also > has a core of volunteers to work on the conference. Personally, I am > planning on focusing on increasing local attendance by working with > other local user groups and finding SV speakers. Hopefully, there > will be a lot of interest from Baypiggies in helping out. I already > have a list of several volunteers. Just to clarify, it will be the PSF signing the bid. I'm not sure how much additional time I'll have available for a local PyCon, but I've been involved with every PyCon so far and have been to two of them. I'll also have some experience with the San Mateo Marriott this coming May/July (Baycon and Westercon will be there). Sure would be nice to win this! -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From aahz at pythoncraft.com Fri Feb 16 23:08:41 2007 From: aahz at pythoncraft.com (Aahz) Date: Fri, 16 Feb 2007 14:08:41 -0800 Subject: [Baypiggies] Memory usage In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> Message-ID: <20070216220841.GA13291@panix.com> On Thu, Feb 15, 2007, Shannon -jj Behrens wrote: > > I saw a talk at PyCon two years ago that said that Python would never > give memory back to the OS. That's probably changed, but I'd check > first. That's "partly changed", not "probably changed". ;-) PyMalloc does change the way Python interacts with malloc(), but many OSes never return memory to the system free pool until an application exits. OTOH, it mostly doesn't matter, either: even when it's not returned to the general OS pool, memory that is free()'d is usually marked such that it doesn't require physical RAM. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From aahz at pythoncraft.com Fri Feb 16 23:14:21 2007 From: aahz at pythoncraft.com (Aahz) Date: Fri, 16 Feb 2007 14:14:21 -0800 Subject: [Baypiggies] What garbage! In-Reply-To: <5.1.0.14.0.20070215145929.00bf3c20@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <5.1.0.14.0.20070214082207.00beb440@localhost> <5.1.0.14.0.20070215112850.00bee9a0@localhost> <5.1.0.14.0.20070215145929.00bf3c20@localhost> Message-ID: <20070216221421.GB13291@panix.com> On Thu, Feb 15, 2007, Dennis Reinhardt wrote: > At 02:21 PM 2/15/2007, Chad Netzer wrote: >> >>Dennis, you said in your example, "The final time.sleep(2000) is to >>allow time for garbage collection to reduce memory usage." However, >>that certainly will have no effect with CPython, nor do operating >>system memory allocators work that way. > > I read at http://docs.python.org/lib/module-gc.html where it says > > "tune the collection frequency" > > and other statements on this page to mean that the garbage collector makes > periodic sweeps of object references. I do not see what the timing is. I > did provide for a window in this code so that if such a sweep resulted in > lowering memory requirements, I had provided for time to go by. Generally speaking, GC runs depend on object allocation/de-allocation, not clock time. GC will run when X number of objects have been created without deallocating them. (There are some subtleties involved, but that's the essence.) As Chad pointed out, this is separate from Python's regular refcount mechanism. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From rdm at cfcl.com Tue Feb 20 22:10:56 2007 From: rdm at cfcl.com (Rich Morin) Date: Tue, 20 Feb 2007 13:10:56 -0800 Subject: [Baypiggies] BASS Meeting (SF), Wed, Feb, 28 Message-ID: So, we'll have Perlies; what about Pythonistas and Rubyists? > Subject: [sf-perl] Wednesday, February 28: Beer and Scripting SIG > Reply-To: San Francisco Perl Mongers User Group > > Once again we're merging with Rich's excellent Beer and Scripting SIG > (BASS). More people + more perspectives = better meeting. In fact, > last month's meeting was so successful that I'm making this the > default for dinner meetings. Thanks, Rich! > > All the details are here: http://www.cfcl.com/rdm/bass/ RSVPs > are appreciated. For your convenience, here are the critical details: Date: Wednesday, February 28, 2007 (4th. Wed.) Time: 8:00 pm Place: Wild Pepper 3601 26th St. (near San Jose Ave.) San Francisco, California, USA 415/695-767[89] -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From jaffe.mark at gmail.com Thu Feb 22 03:21:15 2007 From: jaffe.mark at gmail.com (Mark Jaffe) Date: Wed, 21 Feb 2007 18:21:15 -0800 Subject: [Baypiggies] [OT] Seeking meeting attendee... Message-ID: <5EFC0084-984A-4502-859A-C6981A87C4F0@gmail.com> Hi, At the September meeting, I met a test engineer who works at Tesla Motors in San Carlos. I bantered with her a bit, but we did not exchange contact info. At this time, I have a professional interest in resuming contact, but am not sure how to do so. I apologize that I do not recall her name, either (damned ADD!) I thought the Wiki pages would contain past attendees names, but did not find them. If the lady in question is on the list, please respond to my query. Thanks, Mark From ken at seehart.com Thu Feb 22 19:36:19 2007 From: ken at seehart.com (Ken Seehart) Date: Thu, 22 Feb 2007 10:36:19 -0800 Subject: [Baypiggies] PyCon 2007 In-Reply-To: <5EFC0084-984A-4502-859A-C6981A87C4F0@gmail.com> References: <5EFC0084-984A-4502-859A-C6981A87C4F0@gmail.com> Message-ID: <45DDE2A3.6040704@seehart.com> Hello from Texas! Just finished /*Faster Python Programs through Optimization and Extensions I* /tutorial. Started a little slowly with comparisons of list joins vs sequential string concatenation, etc, while showing how to use time.clock() to compare performance. Started getting interesting with some real tools, like Numpy . Most valuable insight for me: look at Psyco . This has got to be the quickest way to get a performance boost (about 4x in some examples) on Intel processors without any effort. Two lines of code will often do the trick. import psyco psyco.full() # converts and binds all of your functions to native code Also looked at pyrex, a custom language which makes it pretty easy way to rewrite existing python code and wrap existing C/C++ code to be compiled with a C compiler. Seems easier than boost or swig (except perhaps for large API libraries), and much easier than hand coding C extensions. # file: mc_pi_pyrex_fast.pyx cdef extern from "math.h": #1 double sqrt(double x) #2 cdef extern from "stdlib.h": #3 int rand() #4 int RAND_MAX #5 def piPyrex(int n): cdef int count_inside, count #6 cdef float x, y #7 count_inside = 0 for count from 0 <= count < n: #8 x = rand() #9 y = rand() d = sqrt(x*x + y*y) #10 if d < RAND_MAX: #11 count_inside = count_inside + 1 return 4.0 * count_inside / n Covered ctypes for yet another way to wrap a DLL or shared library. Compared a variety of tools for relative speed (see the pdf ). - Ken Seehart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070222/5bc43543/attachment.html From ken at seehart.com Thu Feb 22 19:39:12 2007 From: ken at seehart.com (Ken Seehart) Date: Thu, 22 Feb 2007 10:39:12 -0800 Subject: [Baypiggies] PyCon 2007 In-Reply-To: <45DDE2A3.6040704@seehart.com> References: <5EFC0084-984A-4502-859A-C6981A87C4F0@gmail.com> <45DDE2A3.6040704@seehart.com> Message-ID: <45DDE350.6010902@seehart.com> Oops, that last message should just be addressed to baypiggies at python.org. - Ken From akennedy93612 at yahoo.com Fri Feb 23 03:11:11 2007 From: akennedy93612 at yahoo.com (Douglas Kennedy) Date: Thu, 22 Feb 2007 18:11:11 -0800 (PST) Subject: [Baypiggies] How to embed Flash Player Controls within a Python app... Message-ID: <484901.94943.qm@web54504.mail.yahoo.com> Hi Python users, I am seeking some help or at least direction. I am developing a python application that is a learning center. Part of the requirement is that it not be browser based. Python seems to a practice choice so far. The videos and screencast videos are going to be produced using the Camtasia Studio also requirement in a FLV/SWF format. The learning center application needs to have embedded within its screen the video window. Found wxpython that allows the video to be called from a python. The problem is that have not found any way to control the video? Typical controls play,stop, pause,rewind, fast forward etc... Maybe I am missing it I have not found the controls within python or wxpython to control a flash video. Well, Python users any direction? Your help is and will continue to be appreciated. thanks, Doug P.S... I have been using this list for a couple of years now and it has been of benefit in many ways thanks. I hope to in the future enjoy your gatherings... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070222/95a6e20b/attachment.html From bsergean at gmail.com Sat Feb 24 18:16:38 2007 From: bsergean at gmail.com (Benjamin Sergeant) Date: Sat, 24 Feb 2007 09:16:38 -0800 Subject: [Baypiggies] PyCon 2007 In-Reply-To: <45DDE2A3.6040704@seehart.com> References: <5EFC0084-984A-4502-859A-C6981A87C4F0@gmail.com> <45DDE2A3.6040704@seehart.com> Message-ID: Quite interesting, and for those who'd like to go farther on the assumption: 'Assuming an infinte number of points the ratio of points may be used instead of the areas, so: ' ? = 4 numberof pointsinside / totalnumberof points Here is an explanation in french http://serge.mehl.free.fr/anx/pi_alea.html Benjamin. Le 22 f?vr. 07 ? 10:36, Ken Seehart a ?crit : > Hello from Texas! > > Just finished Faster Python Programs through Optimization and > Extensions I tutorial. > > Started a little slowly with comparisons of list joins vs > sequential string concatenation, etc, while showing how to use > time.clock() to compare performance. > > Started getting interesting with some real tools, like Numpy. > > Most valuable insight for me: look at Psyco. This has got to be > the quickest way to get a performance boost (about 4x in some > examples) on Intel processors without any effort. Two lines of > code will often do the trick. > import psyco > psyco.full() # converts and binds all of your functions to native code > > Also looked at pyrex, a custom language which makes it pretty easy > way to rewrite existing python code and wrap existing C/C++ code to > be compiled with a C compiler. Seems easier than boost or swig > (except perhaps for large API libraries), and much easier than hand > coding C extensions. > > # file: mc_pi_pyrex_fast.pyx > cdef extern from "math.h": #1 > double sqrt(double x) #2 > cdef extern from "stdlib.h": #3 > int rand() #4 > int RAND_MAX #5 > def piPyrex(int n): > cdef int count_inside, count #6 > cdef float x, y #7 > count_inside = 0 > for count from 0 <= count < n: #8 > x = rand() #9 > y = rand() > d = sqrt(x*x + y*y) #10 > if d < RAND_MAX: #11 > count_inside = count_inside + 1 > return 4.0 * count_inside / n > > Covered ctypes for yet another way to wrap a DLL or shared library. > > Compared a variety of tools for relative speed (see the pdf). > > - Ken Seehart > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070224/dad9aa89/attachment.html From keith at dartworks.biz Mon Feb 26 14:34:30 2007 From: keith at dartworks.biz (Keith Dart) Date: Mon, 26 Feb 2007 05:34:30 -0800 Subject: [Baypiggies] new web application framework. Message-ID: <20070226053430.3c0f823b@tinker.homenetwork> After some experience with the Django web application framework, and studying other frameworks such as Pylons and Paste, I decided to create yet another framework. ;-) This one is closer to my idea of "perfection" in a framework. ;-) It's salient features over other is: Runs on Linux Python based. No threads. Integrated lighttpd and fastCGI coprocesses. Virtual hosting. Process controller (with restart). Fast. Standards compliant. No templates required. Modern WSGI interface. Object oriented. As flexible as Python itself. But... it's new and not fully tested. -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From alvinwang at gmail.com Mon Feb 26 10:36:13 2007 From: alvinwang at gmail.com (Alvin Wang) Date: Mon, 26 Feb 2007 01:36:13 -0800 Subject: [Baypiggies] FYI Chicago is Pycon 2008 Message-ID: <77d044440702260136ld182503td9b6af7ada572097@mail.gmail.com> Hi, They announced the winner after I left on Sunday so I got the info late. Anyway Chicago won. http://chipy.org/ChiPyCon_2008_Bid There were several reasons. - cheaper, they felt that Chicago would be a reasonable incremental increase in room rate. - bigger - this year was 40% larger than last year. They expect at least that large a jump by coming to the Bay Area. - Chicago stacked the quiz responses from 2006. Chicago was the most asked for venue. In talking to people that were not from Chicago, SF was widely preferred. Chicago has a lot of people at the conference. I pitched Santa Clara too after some people expressed concern about San Mateo's size. I got the feeling that they wanted to split the win since 2 cities put in good bids. Chicago was cheaper and had a lot of people so they went first. There is a very good possibility that 2009 will be awarded prior to 2008. The problem is that 2009 will be even larger. They are going to contact me about it. I am planning on looking into a few more options. Thanks Alvin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/baypiggies/attachments/20070226/1b9af720/attachment.htm From eric at ericwalstad.com Mon Feb 26 17:43:00 2007 From: eric at ericwalstad.com (Eric Walstad) Date: Mon, 26 Feb 2007 08:43:00 -0800 Subject: [Baypiggies] new web application framework. In-Reply-To: <20070226053430.3c0f823b@tinker.homenetwork> References: <20070226053430.3c0f823b@tinker.homenetwork> Message-ID: <200702260843.00463.eric@ericwalstad.com> On Monday 26 February 2007 05:34, Keith Dart wrote: > After some experience with the Django web application framework, and > studying other frameworks such as Pylons and Paste, I decided to > create yet another framework. ;-) This one is closer to my idea of > "perfection" in a framework. ;-) It's salient features over other is: > > Runs on Linux > Python based. > No threads. > Integrated lighttpd and fastCGI coprocesses. > Virtual hosting. > Process controller (with restart). > Fast. > Standards compliant. > No templates required. > Modern WSGI interface. > Object oriented. > As flexible as Python itself. > > But... it's new and not fully tested. Hi Keith, I'd like to have a look at it. Do you have a URL? Best, Eric. From keith at dartworks.biz Mon Feb 26 21:51:21 2007 From: keith at dartworks.biz (Keith Dart) Date: Mon, 26 Feb 2007 12:51:21 -0800 Subject: [Baypiggies] new web application framework. In-Reply-To: <200702260843.00463.eric@ericwalstad.com> References: <20070226053430.3c0f823b@tinker.homenetwork> <200702260843.00463.eric@ericwalstad.com> Message-ID: <20070226125121.0058f81f@tinker.homenetwork> On Mon, 26 Feb 2007 08:43:00 -0800 Eric Walstad wrote: > I'd like to have a look at it. Do you have a URL? Thanks. Currently, the code is hosted on Google code hosting: http://code.google.com/p/pynms/ You can use subversion to get a working copy from there. As for "showing off" the framework, with documentation, I'm still working on the content so that's not available yet. It will likely be a while, but eventually you'll see something on http://www.pynms.net/ Please don't hesitate to ask questions about it, since I know the documentation is lacking. -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From marilyn at deliberate.com Tue Feb 27 20:33:02 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Tue, 27 Feb 2007 11:33:02 -0800 Subject: [Baypiggies] The new PyoP List Message-ID: <20070227193306.D24BB1E4002@bag.python.org> Hello Python Fans, I'm sorry I've been so sluggish about getting the new list going. I've been so swamped with Python classes and preparation for Python classes that I haven't been able to give this the thought it deserves until today. The Python training business has really picked up the last few months! I had to give up teaching C. Here's my draft of the material for the new list. If anyone can think of anything I forgot to address, or has any suggestions, please let me know. Once this is published, it'll take a 2/3 majority vote to change anything. I'm hoping to have all bases covered so that admin issues will be minimized. Thank you, Marilyn Davis ----- PURPOSE This list is intended to be technical and social support for Python enthusiasts who meet face-to-face at the monthly Python meetings at Google in Mountain View, CA. MEMBERSHIP Everyone anywhere is welcome to join and participate. But, in the event of a vote, only members who have actually attended a live meeting in the last 3 months, or 2 live meetings in the last year, may vote, or participate in controversial discussion about administrative issues. For the most part, the "vouch-for" system will be used to determine if a person has voting privileges. If the current meeting facilitator, or this list's administrator, or any well-known regular attender can vouch for your attendance, you get voting privileges; if the current meeting facilitator, or this list's administrator, or any well-known regular attender can vouch for someone who can vouch for you, you get voting privileges. If you wish to keep a low profile at meetings, but still would like voting privileges, please keep the badges given to you by Google and be prepared to snail mail them to the current list administrator, if a vote happens. ADMINISTRATION Administrative decisions will be made democratically by the members. The list administrator's role is to facilitate and implement the will of the group. The exception is a case in which an emergency decision is required to immediately revoke an email address's right to post to the list for violating the list's rules, given in "RULES" below. If such a decision and action is taken, it can be reversed by majority vote as described below in "VOTING". The list administrator has a 2 year term, if a new volunteer is willing to take on the job. If there are more than one willing volunteer, an election will be held to decide which candidate will be the new list administrator. An election will be held as follows: 1. Two months before the current term ends: The current list administrator will call for volunteers to be candidates for the next term. In order to qualify for candidacy, a volunteer must: 1. have voting privileges on the list. 2. be a list member for at least 1 year. 3. have his candidacy seconded by at least one voting member. 2. One month before the current term ends: The election will be held by public or private vote, as is deemed practical by the current administrator. Qualified voting members will vote range(-5, 6) for each candidate. The candidate with the most positive votes wins. In case of a tie, the candidate with the most positive votes, and fewest negative votes wins. If there is still a tie, the candidate with the most positive vote, least negative votes and highest average votes wins. If there is still a tie, the candidates with the most positive votes, least negative votes, highest average votes will have their names placed in a hat and the winner will be picked out of the hat at the next face-to-face meeting. Marilyn Davis is the first list administrator. Her term expires June 1, 2009. LIST RULES 1. The name of the list/group is "Python on the Peninsula". 2. Discussion about these rules are welcome but will be clearly marked with "ADMIN" in the subject line. 3. No flaming. Make your point without attacking the person. 4. If you wish to send private email to a list member, and you want that mail to remain private, you must first write the list member to ask permission to engage in a private conversation and receive a message back encouraging a private conversation. 5. Job ads must be clearly marked with "JOB" in the subject line. 6. Only first-party job ads are allowed; no "head-hunters". 7. Ads for jobs outside the SF Bay Area are not allowed, unless the prospective employer is offering to pay moving expenses. VOTING To change a list rule, given above: 1. A change is proposed by one member with voting privileges. See MEMBERSHIP, above, for the definition of a "member with voting privileges". 2. The change is seconded by a different member with voting privileges. 3. There is a 2 week period for discussion before a poll is taken. 4. Voting is +1 to vote for the proposal 0 to abstain -1 to reject the proposal 5. The poll is open for 1 month. 6. A 2/3 positive/negative vote is required to change a rule. To reverse an emergency decision made by the list administrator (see ADMINISTRATION above): 1. The reversal is proposed by one member with voting privileges. 2. The reversal is seconded by a different member with voting priviledges. 3. There is a 24 hour period for discussion before a poll is taken. 4. Voting is +1 to vote for the reversal 0 to abstain -1 to reject the reversal 5. The poll is open for 1 week except in the special case explained in # 7, below. 6. 51% positive/negative vote is required to reverse an emergency decision. 7. If there is a 2/3 positive/negative vote, and at least 20 voters, at any time before the 1 week of voting expires, the emergency decision will be reversed. ----- From marilyn at deliberate.com Tue Feb 27 20:47:39 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Tue, 27 Feb 2007 11:47:39 -0800 Subject: [Baypiggies] New PyOP List - wasRe: [vote] name change Message-ID: <20070227210246.6D4F91E400C@bag.python.org> ----- On Thursday, February 8, 2007 jjinux at gmail.com wrote: > On 2/8/07, Marilyn Davis wrote: >> JJ said: >> > >> > Again, don't mistake my ignorance for malice. I posed that poll >> >> I know. I know you are not malicious. But please nullify that mis-poll as > a mistake. > > It's true that I mistook what you, a member of the list, were > interested in. Still, the poll served to tell me what the readership > thought. It answered my question. What's to nullify about that? > >> We already took that poll in a carefully legitimate way and the previous > poll should be respected: 35% think the name is bad enough to warrant > changing. A group of marketeers would take that number very seriously. But > we are technical people. > > Fair enough. Unfortunately, I can't violate the will of the 65% majority. > Of course not. But the 65% might reconsider the wisdom of sticking to a name that 35% find unpleasant. We'll never know how many more find it too uncomfortable to join. >> The up-side is that the incident gave me the opportunity to teach something > about democracy, which is my #1 calling: http://www.deliberate.com >> >> Teaching Python, and whatever other little gigs I get, support the democracy > work. >> >> Please understand and not take offense, that I can't, voluntarily, be > subject to a dictator, no matter how benevolent, charming and good. > > Do you also refuse to use Linux? I purposely took the term > "benevolent dictator" from Linus's original usage. In fact, while it > may be called a benevolent dictatorship, at its heart, this is really > a meritocracy. Those who give the most make the most decisions. I use and advocate the "GNU System", which includes Linus' kernel. The motto is "GNU's Not Unix! - Free Software, Free Society". I really get the connection and know it will become more apparent to everyone as the future unfolds. > >> So I started another email list/group: PyOP "Python on the Peninsula". > > Ok. I wish you the best of luck in your future endeavors. Before you > leave, I'd like to say thank you for all your contributions. > >> As soon as you get the announce list happening, I'll be leaving Baypiggies, > although I do expect my participation in the meetings to grow when I'm not > weighed down by the name, "piggies". >> >> This happened: >> >> ----- On Tuesday, February 6, 2007 brad at python.org wrote: >> >> > At 12:25 PM -0800 2/6/07, Marilyn Davis wrote: >> > >> >> Hello Python.org Postmasters, >> >> >> >> Would you please make a pyop at python.org email list? >> > >> > Done. >> > >> >> It will be a democratically-administrated email list for ???*???Python on >> >> the Peninsula???*??? -- the SF Bay Peninsula. >> > >> > Noted in the short description of the list. >> > >> >> Baypiggies is the whole SF Bay area, and I hope/expect the list to >> >> be populated with people who attend the live meetings. Everyone is >> >> welcome, of course. But to earn voting rights, you must have >> >> attended one meeting in the last 3 months, or 2 meetings in the last year. >> >> >> >> I hope a few democratic rules of order are ok in a python.org list. >> > >> > So far as I know, so long as the rules don't discriminate with >> > regards to race, religion, creed, gender, sexual preferences, etc... >> > you should be able to run your list pretty much however you want. >> > >> >> I'll be the first admin, but I hope there is enough enthusiasm that >> >> someone else will want to be the admin in a year. >> > >> > Fair enough. >> > >> > I've pre-filled in a few things on the list, including an >> > introductory description which has a few standard list policies >> > regarding the archives, etc.... If you want to change these, that's >> [rest clipped] >> >> I have a big deadline on Monday so I don't have much time for fiddling with > this right now but I'll try to get it all set next week with some starting > rules. >> >> So that you understand my action I'll explain that, as a democracy activist, > in league with Zapatistas and other democracy activists. I see that the > threatening demise of the planet is the war between > corporate-governmental-military monster and democracy/people: a war between > the dominant/submissant model and the cooperative model. Being part of this > struggle, I feel I am betraying the cause and the earth if I willingly > participate where democratic forms are disrespected ... and then there's the > name thing. > > Wow. Ok. I guess we each have our causes. Personally, mine is open > source, and it drives me crazy to ever have to use anything closed > source. Open source and democracy are the same cause. Or, they are subclassed from the same cause: dominant/submissant vs cooperative. Indeed, racism, sexism, imperialism, ... all the ism's that tear us apart are that dominant/submissant model. [much deleted] JJ, it is a pleasure to discuss with you. Always your fan, Marilyn From grayarea at reddagger.org Wed Feb 28 00:21:29 2007 From: grayarea at reddagger.org (jwithers) Date: Tue, 27 Feb 2007 15:21:29 -0800 Subject: [Baypiggies] The new PyoP List In-Reply-To: <20070227193306.D24BB1E4002@bag.python.org> References: <20070227193306.D24BB1E4002@bag.python.org> Message-ID: <1172618489.9349.711.camel@localhost> > PURPOSE > > This list is intended to be technical and social support for Python > enthusiasts who meet face-to-face at the monthly Python meetings at > Google in Mountain View, CA. Sorry, just trying to make sure I actually understand this, because it seems slightly surreal. What is happening is that a new list is being split off of the baypiggies mailing list by someone who doesn't like the name, but the point of the list is providing technical and social support to people who attend the monthly meeting at Google, which is, unless I am missing something, the monthly Bay PIGgies meeting? And the physical meeting is actually called that and not planning on changing its name? Or am I misunderstanding what is happening here? jpw From wescpy at gmail.com Wed Feb 28 01:26:46 2007 From: wescpy at gmail.com (wesley chun) Date: Tue, 27 Feb 2007 16:26:46 -0800 Subject: [Baypiggies] The new PyoP List In-Reply-To: <1172618489.9349.711.camel@localhost> References: <20070227193306.D24BB1E4002@bag.python.org> <1172618489.9349.711.camel@localhost> Message-ID: <78b3a9580702271626i747d44few5f9cf9d218bbe2b7@mail.gmail.com> > > PURPOSE > > > > This list is intended to be technical and social support for Python > > enthusiasts who meet face-to-face at the monthly Python meetings at > > Google in Mountain View, CA. > > Sorry, just trying to make sure I actually understand this, because it > seems slightly surreal. What is happening is that a new list is being > split off of the baypiggies mailing list by someone who doesn't like the > name, but the point of the list is providing technical and social > support to people who attend the monthly meeting at Google, which is, > unless I am missing something, the monthly Bay PIGgies meeting? And the > physical meeting is actually called that and not planning on changing > its name? > > Or am I misunderstanding what is happening here? i believe that your description is accurate. this original mailing list, which JJ has now assumed the moderator role for, is for *both* those who attend meetings as well as those who don't, and consist of folks who both like the name *and* dislike it. the key differentiator is that once the group splits off into these 2 separate lists, members of this main list will no longer discuss issues that have been put to rest and that we can once again return to the almost-silent list that BayPIGgies has been known for since 1999 until 2005. cheers, -wesley From tungwaiyip at yahoo.com Wed Feb 28 02:34:12 2007 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Tue, 27 Feb 2007 17:34:12 -0800 Subject: [Baypiggies] Pycon 2007 In-Reply-To: <77d044440702260136ld182503td9b6af7ada572097@mail.gmail.com> References: <77d044440702260136ld182503td9b6af7ada572097@mail.gmail.com> Message-ID: For those who cannot attend PyCon 2007, this is a report by Jeremy Jones on oreillynet: http://www.oreillynet.com/onlamp/blog/2007/02/pycon_day_1_1.html http://www.oreillynet.com/onlamp/blog/2007/02/pycon_day_2.html http://www.oreillynet.com/onlamp/blog/2007/02/pycon_day_3.html The talk schedule is available at http://us.pycon.org/apps07/talks/ Unfortunately the audio and material links indicates "Release Form not on File" for all talks. Perhaps the organizers haven't got to update the site yet? Wai Yip From keith at dartworks.biz Wed Feb 28 02:49:35 2007 From: keith at dartworks.biz (Keith Dart) Date: Tue, 27 Feb 2007 17:49:35 -0800 Subject: [Baypiggies] web developers - Perfect python framework? Message-ID: <20070227174935.1f4e25ef@tinker.homenetwork> I curious to know what those of you who develop web based applications, in Python or not, would consider to be a "perfect" framework. Anyone care to enumerate their ideas? -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From keith at dartworks.biz Wed Feb 28 04:32:47 2007 From: keith at dartworks.biz (Keith Dart) Date: Tue, 27 Feb 2007 19:32:47 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: <20070227193247.004c3f0e@tinker.homenetwork> On Tue, 13 Feb 2007 15:33:53 -0800 "Shannon -jj Behrens" wrote: > #) Monkey patching! > > At runtime, anything is hackable. Sometimes you have to rely on a > third party library that does the wrong thing. Now, you should start How's this for "monkey patching": import new parser = xml.sax.sax2exts.XMLParserFactory.make_parser() ... # since the xml API provides some generic parser I can't just # subclass I have to "patch" the object in-place with this trick. # This is to a) make the API compatible with the HTMLParser, and b) # allow specifing the encoding in the request. parser.parse_orig = parser.parse def parse(self, url, data=None, encoding=POM.DEFAULT_ENCODING): import WWW.urllibplus fo = WWW.urllibplus.urlopen(url, data, encoding) return self.parse_orig(fo) parser.parse = new.instancemethod(parse, parser, parser.__class__) return parser (sorry about the late reply) -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From zia at cruzio.com Wed Feb 28 06:26:20 2007 From: zia at cruzio.com (Doug Landauer) Date: Tue, 27 Feb 2007 21:26:20 -0800 Subject: [Baypiggies] New PyOP List In-Reply-To: <20070227210246.6D4F91E400C@bag.python.org> References: <20070227210246.6D4F91E400C@bag.python.org> Message-ID: > Of course not. But the 65% might reconsider the wisdom of sticking to > a name that 35% find unpleasant. We'll never know how many more find > it too uncomfortable to join. We'll also never know just how much of an overestimate that 35% is. For what it's worth, there is a twenty-year-old "Psychology of Programming Interest Group" which has embraced the "pig" mascot ... see http://www.ppig.org/ (they have a very cool little piggie favicon). It seems to me that if experts in psychology are happy to embrace such a symbol, then we who are experts only in programming probably ought at least to let it slide. Just my opinion, -- Doug L. From keith at dartworks.biz Wed Feb 28 11:25:08 2007 From: keith at dartworks.biz (Keith Dart) Date: Wed, 28 Feb 2007 02:25:08 -0800 Subject: [Baypiggies] The new PyoP List In-Reply-To: <20070227193306.D24BB1E4002@bag.python.org> References: <20070227193306.D24BB1E4002@bag.python.org> Message-ID: <20070228022508.3dbeab7b@tinker.homenetwork> On Tue, 27 Feb 2007 11:33:02 -0800 Marilyn Davis wrote: > Once this is published, it'll take a 2/3 majority vote to > change anything. But if the 1/3 minority doesn't like the decision they can go start another list, right? ;-) -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From jim at well.com Wed Feb 28 15:22:40 2007 From: jim at well.com (jim stockford) Date: Wed, 28 Feb 2007 06:22:40 -0800 Subject: [Baypiggies] New PyOP List In-Reply-To: References: <20070227210246.6D4F91E400C@bag.python.org> Message-ID: please, please let it slide--jj, help! On Feb 27, 2007, at 9:26 PM, Doug Landauer wrote: >> Of course not. But the 65% might reconsider the wisdom of sticking to >> a name that 35% find unpleasant. We'll never know how many more find >> it too uncomfortable to join. > > We'll also never know just how much of an overestimate that 35% is. > > > For what it's worth, there is a twenty-year-old "Psychology of > Programming > Interest Group" which has embraced the "pig" mascot ... see > http://www.ppig.org/ > (they have a very cool little piggie favicon). It seems to me that if > experts in psychology are happy to embrace such a symbol, then we who > are > experts only in programming probably ought at least to let it slide. > > > Just my opinion, > -- Doug L. > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From marilyn at deliberate.com Wed Feb 28 18:15:23 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Wed, 28 Feb 2007 09:15:23 -0800 Subject: [Baypiggies] The new PyoP List Message-ID: <20070228171526.3D7EE1E4014@bag.python.org> It's true that I'll be happy to get out from under the name. But, the new list is not about the name, it's about democracy. It's about respect for democratic process, respect for the dignity of individuals. I was content to whine about the name, take a careful poll, and then keep quiet. With the talk of new lists, I proposed a shortened version of the name for the new list(s). My proposal was manipulated and trampled on and a benevolent dictatorship was declared. That's what I can't support, even though I like the benevolent dictator. Marilyn From bdbaddog at gmail.com Wed Feb 28 19:49:34 2007 From: bdbaddog at gmail.com (William Deegan) Date: Wed, 28 Feb 2007 10:49:34 -0800 Subject: [Baypiggies] The new PyoP List In-Reply-To: <20070228171526.3D7EE1E4014@bag.python.org> References: <20070228171526.3D7EE1E4014@bag.python.org> Message-ID: <8540148a0702281049l19b9936fx6ebc5f53326c23c0@mail.gmail.com> All, Can I suggest that we leave discussions of Pyop to the Pyop mailling list? Thanks, Bill From Chris.Clark at ingres.com Wed Feb 28 19:55:31 2007 From: Chris.Clark at ingres.com (Chris Clark) Date: Wed, 28 Feb 2007 10:55:31 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <1171435383.9349.13.camel@localhost> <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> Message-ID: <45E5D023.1080608@ingres.com> Sorry for the really late reply but I've been having posting problems :-( Bob Ippolito wrote: > On 2/13/07, jwithers wrote: > >>> I agree with JJ that template language is another good alternative, >>> especially for more complex generation. While this is subjective and >>> everyone have different criteria, I consider the approach of interleaving >>> Python code with the target output hard to maintain. It goes back to the >>> Java Servlet approach and the many addon projects later to provide better >>> alternatives. >>> >> I have found TAL to be good for taking care of that. Templates, but you >> are close to forced to move your code outside the templates. Most people >> don't seem to like it much, but it makes me happy. Most of Zope gets on >> my nerves in one way or another, but TAL makes for better separation >> than the majority of templating systems, and avoids the ugly of building >> your html inside your code. >> > > Genshi offers the same paradigm as TAL but uses Python syntax and is a > bit friendlier to those who want to put code in templates. It's a > pretty good middle ground in my experience. > Templates are definitely a personal (and project) preference and discussions can easily become the next "My dog-shaker is better than your dog-shaker...". The usual principle of using the right tool for the right job arises. The main points I looked at when I was looking for a templating system where: * I really wanted to have all code outside of the template, there are times when this is useful but I wanted seperate. E.g. something TAL like. * had to handle Unicode in some form (encoding type really wasn't an issue) * Create html (i.e. handle html escaping for me), xml/xhtml would have been nice but I really needed html o I wanted to use a html editor - I wanted/needed to hand craft some of the tags but for the most part I wanted to use http://www.nvu.com so I didn't have to hand craft everything. This meant the replacement indicators had to be preserved by my (dumb) html editor that know nothing about templating * I also needed to bolt in an off the shelf javascript library for real time updates of the dom. The library I was using was small but did add elements to the original html that wasn't 100% compliant so I actually needed to handle bad html * Small library! * Easy to use library! Other projects (and personal) requirements will be very different from mine. The "bad html" kept me from using Genshi, but I do like Genshi a lot. After lots of experimentation I ended up using http://freespace.virgin.net/hamish.sanderson/htmltemplate.html - one thing that annoys me slightly about HTMLTemplate is that you have to write code to populate the template. I was able to get around that in a few projects by writing a generic routine to take in a dictionary (like most templating systems). For the few times that I couldn't use my generic dict system I ended up with a routine (or routines) that have 1 line per item to be replaced in the template. For large numbers of elements this was easy to maintain, if you have very few elements this actual is frustrating and you wonder why you used a template :-) I'm hopefully that I will be using HTMLTemplate for a while, but I can envisage a project having different requirements which may mean another templating system! I'm really going to have to invest in some time in buffet - http://projects.dowski.com/projects/buffet Just my 2 cents. Chris From Chris.Clark at ingres.com Wed Feb 28 20:31:26 2007 From: Chris.Clark at ingres.com (Chris Clark) Date: Wed, 28 Feb 2007 11:31:26 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <1171435383.9349.13.camel@localhost> <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> <45E5D023.1080608@ingres.com> Message-ID: <45E5D88E.9080500@ingres.com> Tung Wai Yip wrote: > On Wed, 28 Feb 2007 10:55:31 -0800, Chris Clark > wrote: >> After lots of experimentation I ended up using >> http://freespace.virgin.net/hamish.sanderson/htmltemplate.html - one >> thing that annoys me slightly about HTMLTemplate is that you have to >> write code to populate the template. I was able to get around that in a >> few projects by writing a generic routine to take in a dictionary (like >> most templating systems). For the few times that I couldn't use my >> generic dict system I ended up with a routine (or routines) that have 1 >> line per item to be replaced in the template. For large numbers of >> elements this was easy to maintain, if you have very few elements this >> actual is frustrating and you wonder why you used a template :-) > > I'm a happy user of HTMLTemplate too. Is your enhancement generic > enough to contribute back to the project? I did send it back, as it required some a minor change to be made to HTMLTemplate. I got a response back that a new version (v2) will be coming out with a slightly different api. The new version will closely model the TextTemplate (same web site). I'm not clear if my code was accepted though :-) I'm happy to share my "uses dicts" change, if anyone is interested just drop me a mail (it is only a small tar ball). Chris From tungwaiyip at yahoo.com Wed Feb 28 20:24:25 2007 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Wed, 28 Feb 2007 11:24:25 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: <45E5D023.1080608@ingres.com> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <1171435383.9349.13.camel@localhost> <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> <45E5D023.1080608@ingres.com> Message-ID: On Wed, 28 Feb 2007 10:55:31 -0800, Chris Clark wrote: > After lots of experimentation I ended up using > http://freespace.virgin.net/hamish.sanderson/htmltemplate.html - one > thing that annoys me slightly about HTMLTemplate is that you have to > write code to populate the template. I was able to get around that in a > few projects by writing a generic routine to take in a dictionary (like > most templating systems). For the few times that I couldn't use my > generic dict system I ended up with a routine (or routines) that have 1 > line per item to be replaced in the template. For large numbers of > elements this was easy to maintain, if you have very few elements this > actual is frustrating and you wonder why you used a template :-) > Chris Hi Chris, I'm a happy user of HTMLTemplate too. Is your enhancement generic enough to contribute back to the project? Wai Yip From jjinux at gmail.com Wed Feb 28 23:22:01 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 28 Feb 2007 14:22:01 -0800 Subject: [Baypiggies] PyCon 2007 Message-ID: Hey guys, I just finished writing summaries for all the talks I attended at PyCon: http://jjinux.blogspot.com/search/label/pycon2007 I suggest you read them from bottom to top in order to get them in chronological order. Enjoy! -jj -- http://jjinux.blogspot.com/ From cbc at unc.edu Tue Feb 27 21:55:09 2007 From: cbc at unc.edu (Chris Calloway) Date: Tue, 27 Feb 2007 15:55:09 -0500 Subject: [Baypiggies] Three days left for Zope3 boot camp registration Message-ID: <45E49AAD.1010101@unc.edu> Registration ends Friday: http://trizpug.org/boot-camp/camp5 -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599
" % fname html += "<%s>%s 
  I don't think my reply got through the first time (forgot that I'm using a different email address at WPI now.) Let me refoward my message. ---------- Forwarded message ---------- Date: Fri, 9 Feb 2007 18:50:06 -0500 (EST) From: Daniel Yoo To: Dennis Reinhardt Cc: baypiggies at python.org Subject: Re: [Baypiggies] Discussion for newbies/beginner night talks > > 2) If you need to do a lot of string appends, use lists and join(). > > This is an optimization and as such may not be the first approach to > consider. All of the code samples I showed used string appends such as > > str = "" > str += "string 1" > str + "string 2" > ... Hi Dennis, I guess the other thing to point out is: if you're doing a lot of string appends, see if circumstances will let you can avoid it. For example, if you're building xml output, don't do it by string appending things together if you can avoid it: build the xml tree, and have the xml library do the xml->string thing. Related to this is making sure that if the problem involves data structures, use data structures: don't treat everything like a string. If we need to produce a dictionary whose keys are a combination of several values, don't string concatenate, but rather build a tuple, and use that as the key: ########################################################## ## not so good def add_phone(book, first_name, last_name, phone_number): book[first_name + "," + last_name] = phone_number def lookup(book, first_name, last_name): return book[first_name + "," + last_name] ## A little better def add_phone(book, first_name, last_name, phone_number): book[(first_name, last_name)] = phone_number def lookup(book, first_name, last_name): return book[(first_name, last_name)] ########################################################## That is, sometimes we avoid string concatenation not because of efficiency, but because it's more correct to do so. The first solution forces us to think about people putting in first_name and last_name combinations that concatenate to the same string, whereas the tuple solution has only one possible way of building that tuple. Best of wishes! From webmaven at cox.net Sat Feb 10 06:05:43 2007 From: webmaven at cox.net (Michael Bernstein) Date: Fri, 09 Feb 2007 21:05:43 -0800 Subject: [Baypiggies] [Fwd: Re: Discussion for newbies/beginner night talks] Message-ID: <1171083943.6728.262.camel@workshop> On Fri, 2007-02-09 at 17:21 -0800, Dennis Reinhardt wrote: > At 05:05 PM 2/9/2007, Paul McNett wrote: > > >I respectfully disagree. Take this example: > > > >class MyBizobj(...): > > def getCustomerInfo(self, cust_id): > > sql = """ > >select customers.name as name, > > This starts with an empty line. I believe this can be changed by > > sql = \ > """select customers.name as name, > > Which then breaks up the SQL, albeit only slightly. I recently came across some code that used this convention: a = StringIO("""\ blah blah blah ... """) which takes care of the leading extra line. Or, I found this useful function a couple of years ago that strips the leading and trailing blank lines and eliminates the *common* extra indentation at the beginning of lines in a multiline string, so you could add the extra whitespace needed to make it look OK within the code without sacrificing the indenting that was actually part of the string's formatting: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/145672 HTH, - Michael R. Bernstein michaelbernstein.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/baypiggies/attachments/20070209/274636b0/attachment.pgp From DennisR at dair.com Sat Feb 10 06:20:01 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Fri, 09 Feb 2007 21:20:01 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks (fwd) In-Reply-To: Message-ID: <5.1.0.14.0.20070209211142.00bec0c0@localhost> Danny, Thanks, I did get it before. I like your (first_name, last_name) key example. Very neat technique. It is good to hear from you. I hope you are doing well. At 09:00 PM 2/9/2007, Daniel Yoo wrote: >I don't think my reply got through the first time (forgot that I'm using a >different email address at WPI now.) Let me refoward my message. > >Hi Dennis, > >########################################################## >## A little better >def add_phone(book, first_name, last_name, phone_number): > book[(first_name, last_name)] = phone_number > >def lookup(book, first_name, last_name): > return book[(first_name, last_name)] >########################################################## --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From marilyn at deliberate.com Sat Feb 10 07:12:08 2007 From: marilyn at deliberate.com (Marilyn Davis) Date: Fri, 09 Feb 2007 22:12:08 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks Message-ID: <20070210061212.5F25D1E4012@bag.python.org> ----- On Friday, February 9, 2007 whitaker at google.com wrote: > On 2/9/07, Chad Netzer wrote: >> First, I want to thank Dennis and Drew for speaking last night, and >> Jim Stockford for hosting the post talk discussion. >> >> I've created this thread to start discussion about the "newbie" night >> that was talked about at the end of last night's meeting. If people >> reply to this thread only (or mostly), those on the list who aren't >> interested can easily ignore it. If we are to host a beginners night, >> it will be best to start organizing it soon, in order to line up >> topics, speakers, make timely announcements, etc. >> >> One person at the meeting asked about Python "idioms", and in fact in >> a previous email I brought up the idea of an "anti-idioms" >> presentation. I'll get the ball rolling with a few idioms and tips >> that I can think of, without explanation. If people are interested in >> the why, or wish to add some, please reply and discuss. Perhaps it >> could evolve into a good QA topic for beginners. >> >> Also, if people have other ideas or suggestions for a beginners night, >> please feel free to discuss them here. >> >> >> >> Some Python beginner tips and idioms: >> >> 1) Do not use lists, dicts, or any mutable object as default >> arguments; use None instead. >> >> 2) If you need to do a lot of string appends, use lists and join(). >> >> 3) Understand and use iterators in loops. >> >> 4) Use dictionaries, sets, and other mappings for searches and >> queries. >> >> 5) Understand and use the decorate/sort/undecorate (DSU) idiom. >> >> 6) Catch exceptions that you can handle, don't suppress ones you >> can't. >> >> 7) Ask forgiveness, not permission. Ie. perform conversions and >> other operations using "try". Avoid queries to determine if an >> operation will succeed. >> >> 8) Use assert() to document your code. >> >> 9) Don't overuse tuples as "read only" lists. Use them to make >> dictionary keys, or pass around short lived groups of objects. >> >> 10) Use open() to open files, not file(). (trivial, perhaps) >> > > #) Learn to use the unittest module. Buy the O'Reilly book "Unit Test > Frameworks"[1], read at least chapters 1-4 & 9. Challenge yourself to > write all your code test-first. > > [1] - http://www.oreilly.com/catalog/unitest/ < hour with newbees? New to Python, but know another language? I think I'd teach them: if __name__ == '__main__': Import it from another module and show how it doesn't run. Get them in a namespace state of mind. The rest of the example syntax can be almost-english-python. What would be a fun example? Enumerate is impressive to push in there. Sneak in a regular expression with named groups? They probably worked all day so there is a limit to how much you can push into their brains so maybe demo more, taking up the time, and stuff in less material so they go home feeling like they got it. But mostly, you want to get newbeez in a namespace state-of-mind. Marilyn p.s. Thanks for the tidbits of Pythonic wisdom. They're mostly pretty intermediate, I think. More please. Hurry! Before the announce list is announced and I gotta go. > > -- > Russell Whitaker > Sysops Tools Team Lead > Google Inc., Mt View, CA > "gets() remains as a monument to C's continuing support of buffer > overruns." - Bill Frantz > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From zia at cruzio.com Sat Feb 10 09:27:04 2007 From: zia at cruzio.com (Doug Landauer) Date: Sat, 10 Feb 2007 00:27:04 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <45CD1A4D.90004@ulmcnett.com> <5.1.0.14.0.20070209172435.00beea68@localhost> Message-ID: <912f4b0e8cd902a015d66ebf6148b204@cruzio.com> For what it's worth, here's my version. It was inspired by Hal Fulton's "margin" method from his Ruby book. It works at runtime, and isn't as strict as the cookbook example that Michael Bernstein mentioned ( http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/145672 ), but it's short and a bit easier to use (less cluttered-looking at usage site) than Chad's more efficient compile-time version. import re undent_pat = re.compile( r"(?m)^\s*\S(.*)$", re.M ) def undent (str): return undent_pat.sub( r'\1', str.rstrip() ) # Example: def getCustomerInfo(cust_id): sql = undent( '''\ |select customers.name as name, | sum(invoices.amount) as amount_total, | blah as blah | from customers | etc... ''') Maybe I ought to add it to that cookbook entry. -- Doug L. On Feb 9, 2007, at 5:43 PM, Chad Netzer wrote: > n 2/9/07, Dennis Reinhardt wrote: >> >> To preserve SQL *and* Python structuring, I would write this as: >> >> class MyBizobj(...): >> def getCustomerInfo(self, cust_id): >> sql = "" >> sql += "select customers.name as name,\r\n" >> sql += " sum(invoices.amount) as amount_total,\r\n" >> sql += " blah as blah\r\n" >> sql += " from customers\r\n" >> sql += " left join invoices\r\n" >> sql += " on invoices.cust_id = customers.id\r\n" >> sql += " where customers.id = ?\r\n" >> self.cur.execute(sql, (cust_id,)) > > Another alternative (which does the concatenation at compile time) is: > > class MyBizobj(...): > def getCustomerInfo(self, cust_id): > sql = ( > "select customers.name as name,\r\n" > " sum(invoices.amount) as amount_total,\r\n" > " blah as blah\r\n" > " from customers\r\n" > " etc..." > ) > > Chad > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From zia at cruzio.com Sat Feb 10 09:42:21 2007 From: zia at cruzio.com (Doug Landauer) Date: Sat, 10 Feb 2007 00:42:21 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <912f4b0e8cd902a015d66ebf6148b204@cruzio.com> References: <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <45CD1A4D.90004@ulmcnett.com> <5.1.0.14.0.20070209172435.00beea68@localhost> <912f4b0e8cd902a015d66ebf6148b204@cruzio.com> Message-ID: On Feb 10, 2007, at 12:27 AM, Doug Landauer wrote: > For what it's worth, here's my version. It was inspired by Hal > Fulton's "margin" method from his Ruby book. It works at runtime, and > isn't as strict as the cookbook example that Michael Bernstein > mentioned ( > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/145672 ), but > it's short and a bit easier to use (less cluttered-looking at usage > site) than Chad's more efficient compile-time version. > > import re > undent_pat = re.compile( r"(?m)^\s*\S(.*)$", re.M ) > def undent (str): > return undent_pat.sub( r'\1', str.rstrip() ) Always happens just *after* I post ... I merged a couple of versions of that pattern, and now the initial (?m) is redundant. Removing it makes the pattern easier to understand: undent_pat = re.compile( r"^\s*\S(.*)$", re.M ) With the M (multiline) mode, ^ matches beginning of any line in the string, and $ matches the ends of them. So you can use an even shorter version: import re def undent (str): return re.sub( r'(?m)^\s*\S(.*)$', r'\1', str.rstrip() ) if you don't care about the regex getting recompiled at each usage. -- Doug L. From chad.netzer at gmail.com Sat Feb 10 11:14:34 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Sat, 10 Feb 2007 02:14:34 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <3ab624bd0702091448p760fa4e6w7b2c84f668c9b087@mail.gmail.com> References: <3ab624bd0702091448p760fa4e6w7b2c84f668c9b087@mail.gmail.com> Message-ID: Keep it coming everyone! What a fun thread. I'm going to try to put together some TeX slides gathering these examples together this weekend, and host it on my website for some collaborative feedback. But with all these suggestions, ranked from beginner to more advanced, we have the beginnings of a "newbie" talk with a Q&A format, I think. Thanks to all who have weighed in so far. Are there any lurking beginners out there who have specific issues they want addressed? Chip, you brought up certain idioms that Perl programmers should unlearn when moving to Python. Do you have any specific examples? Are there any Java programmers that took up Python, who have specific suggestions about making the transition? Chad From andy_lists at bananabread.net Sat Feb 10 08:58:03 2007 From: andy_lists at bananabread.net (Andrew Brown) Date: Fri, 09 Feb 2007 23:58:03 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: Message-ID: <45CD7B0B.7060503@bananabread.net> Chad Netzer wrote: > I'll get the ball rolling with a few idioms and tips > that I can think of, without explanation. If people are interested in > the why, or wish to add some, please reply and discuss. Perhaps it > could evolve into a good QA topic for beginners. Wow, this is the best stuff I've ever gotten out of the Python group or meetings. I think you're onto something here. What I am finding so valuable: Dealing with fundamental and frequently used python idioms, But giving them a thorough workout and showing how to use them well and Pythonically while avoiding common pitfalls. Demonstrating the consequences thereof (good and bad). Revolving around highly utilized components gives the very new plenty of time to pick up on the basics. Further showing how to use and abuse the idioms draws out the experience in the crowd to help intermediate people faster catch on to what isn't readily obvious in basic documentation or from light usage. Maybe what I'm envisioning is a "Things you wish you'd understood sooner in Python - night" (Hopefully I posted this comment in the right place.) Andy From aahz at pythoncraft.com Sat Feb 10 15:24:34 2007 From: aahz at pythoncraft.com (Aahz) Date: Sat, 10 Feb 2007 06:24:34 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209171258.00bfbdc0@localhost> References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209171258.00bfbdc0@localhost> Message-ID: <20070210142434.GB24895@panix.com> On Fri, Feb 09, 2007, Dennis Reinhardt wrote: > At 05:05 PM 2/9/2007, Paul McNett wrote: >> >>I respectfully disagree. Take this example: >> >>class MyBizobj(...): >> def getCustomerInfo(self, cust_id): >> sql = """ >>select customers.name as name, > > This starts with an empty line. I believe this can be changed by > > sql = \ > """select customers.name as name, > > Which then breaks up the SQL, albeit only slightly. > > My point had to do with "breaking up the indentation structure" and I think > you have illustrated my point. > > You illustration does not show how a long triple quoted string gets > supplied with parameters. Stylistically, I often prefer substituting > parameters on a line by line basis because there is better locality, making > the code easier to understand and read. Strings like SQL and HTML that do not normally get presented to the user don't need to care about whitespace AT ALL. Here's what I normally do at work: sql = """ select c.name from customers c where c.activation_date > %s """ % db.sql_repr(activation_date) The SQL itself may be further indented as needed for clarity -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From p at ulmcnett.com Sat Feb 10 16:54:42 2007 From: p at ulmcnett.com (Paul McNett) Date: Sat, 10 Feb 2007 07:54:42 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <20070210061212.5F25D1E4012@bag.python.org> References: <20070210061212.5F25D1E4012@bag.python.org> Message-ID: <45CDEAC2.1020106@ulmcnett.com> Marilyn Davis wrote: > But mostly, you want to get newbeez in a namespace state-of-mind. This hits the nail on the head. Namespaces, names, and how an object isn't going to know its name in whatever namespace is binding to it. This is one of those things that is *so simple* to those that understand it, but can be a roadblock to those who don't. -- pkm ~ http://paulmcnett.com From p at ulmcnett.com Sat Feb 10 17:14:16 2007 From: p at ulmcnett.com (Paul McNett) Date: Sat, 10 Feb 2007 08:14:16 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <20070210142434.GB24895@panix.com> References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209171258.00bfbdc0@localhost> <20070210142434.GB24895@panix.com> Message-ID: <45CDEF58.7040109@ulmcnett.com> Aahz wrote: > On Fri, Feb 09, 2007, Dennis Reinhardt wrote: >> You illustration does not show how a long triple quoted string gets >> supplied with parameters. Stylistically, I often prefer substituting >> parameters on a line by line basis because there is better locality, making >> the code easier to understand and read. How about this contrived example: def getHeader(self, **kwargs): html = """ %(title)s %(navigation_bar)s """ return html % kwargs > Strings like SQL and HTML that do not normally get presented to the user > don't need to care about whitespace AT ALL. I think that with longish triple-quoted strings, ignoring the code indentation is the best. But that's me. -- pkm ~ http://paulmcnett.com From tungwaiyip at yahoo.com Sat Feb 10 18:41:25 2007 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Sat, 10 Feb 2007 09:41:25 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <45CDEF58.7040109@ulmcnett.com> References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209171258.00bfbdc0@localhost> <20070210142434.GB24895@panix.com> <45CDEF58.7040109@ulmcnett.com> Message-ID: On Sat, 10 Feb 2007 08:14:16 -0800, Paul McNett

wrote: > Aahz wrote: >> On Fri, Feb 09, 2007, Dennis Reinhardt wrote: >>> You illustration does not show how a long triple quoted string gets >>> supplied with parameters. Stylistically, I often prefer substituting >>> parameters on a line by line basis because there is better locality, >>> making >>> the code easier to understand and read. > > How about this contrived example: > > def getHeader(self, **kwargs): > html = """ > > > > %(title)s > > > > > > %(navigation_bar)s > > > """ > return html % kwargs > > >> Strings like SQL and HTML that do not normally get presented to the user >> don't need to care about whitespace AT ALL. > > I think that with longish triple-quoted strings, ignoring the code > indentation is the best. But that's me. I'm with you. I often embed long fragement of SQL or HTML into Python source code. I can easily read the embedded text fragement as a whole without a lot of quotes inserted if I would have to break them into individual lines. Even better, it avoids the obfuscation of escaping the " character with \". I think triple quote is one of the feature I like most in Python. One caveat - since you use % to format the arguments, the individual % characters in the text block would have to escaped. Something you'd likely to encounter when embedding CSS. Wai Yip From DennisR at dair.com Sat Feb 10 18:26:19 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Sat, 10 Feb 2007 09:26:19 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <20070210142434.GB24895@panix.com> References: <5.1.0.14.0.20070209171258.00bfbdc0@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209171258.00bfbdc0@localhost> Message-ID: <5.1.0.14.0.20070210091207.00bfbae0@localhost> At 06:24 AM 2/10/2007, Aahz wrote: >Strings like SQL and HTML that do not normally get presented to the user >don't need to care about whitespace AT ALL. Here's what I normally do at >work: > > sql = """ > select c.name > from customers c > where c.activation_date > %s > """ % db.sql_repr(activation_date) > >The SQL itself may be further indented as needed for clarity Sure, this works. I would not put "AT ALL" in caps because that extra white space carries extra runtime memory footprint and flows through CPU cache on string retrieval. But, hey, if I were a total efficiency advocate, I would not be string appending or maybe even using Python. For long strings with many substitutions, the line where the substitution is used (the %s) is many lines removed from where it is defined. I think using and defining them on same line has better locality. For the text body, this is very readable. --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From DennisR at dair.com Sat Feb 10 19:11:43 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Sat, 10 Feb 2007 10:11:43 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <20070209230414.1afb919e@psyche.corp.google.com> References: <5.1.0.14.0.20070209204012.00be9ae8@localhost> <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <5.1.0.14.0.20070210095042.00bfbae0@localhost> At 11:04 PM 2/9/2007, Keith Dart =?UTF-8?B?4pmC?= wrote: >Dennis Reinhardt wrote the following on 2007-02-09 at 20:46 PST: >=== > > # build entire initial tree structure > >Just FYI, here is (something like) how I would re-write it using my >XHTML generator module: ..... > >Although, if I did it from scratch I would do it differently. Probably >I would use a the table generator with row and column iterators. My original code wrapped wxPython functions. I re-wrote in place to substitute html. Your version is more readable. Right now, I have only a single need for this tree structure and my "inlined" version works for me. Even without your XHTML generator module, I can and will refactor this code along the lines you show if a second use arises. Regards, Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From DennisR at dair.com Sat Feb 10 18:48:53 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Sat, 10 Feb 2007 09:48:53 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <45CDEF58.7040109@ulmcnett.com> References: <20070210142434.GB24895@panix.com> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209171258.00bfbdc0@localhost> <20070210142434.GB24895@panix.com> Message-ID: <5.1.0.14.0.20070210090643.00bf5cb8@localhost> At 08:14 AM 2/10/2007, Paul McNett wrote: > > On Fri, Feb 09, 2007, Dennis Reinhardt wrote: > >> Stylistically, I often prefer substituting > >> parameters on a line by line basis because there is better locality, > making > >> the code easier to understand and read. > >How about this contrived example: > >def getHeader(self, **kwargs): > ...... > return html % kwargs Clever example and manageable. Not shown is the invocation of getHeader() where the actual parameter values are defined. This contrived example separates definition and use. I think something like html += "%s" % ht_obj.param("title") has better locality by bringing definition and use closer together on same line (or two lines). Synthesizing this discussion, title = ht_obj.param("title") #extract string from URL .... html = """\ ... %(title)s ... """ looks ok to me. It does not allow piecing together strings conditionally at run time but it does a fine job of expressing fixed strings with substitutions. --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From p at ulmcnett.com Sat Feb 10 19:29:07 2007 From: p at ulmcnett.com (Paul McNett) Date: Sat, 10 Feb 2007 10:29:07 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <5.1.0.14.0.20070209160547.00beedc8@localhost> <5.1.0.14.0.20070209151826.00bf4ab8@localhost> <5.1.0.14.0.20070209171258.00bfbdc0@localhost> <20070210142434.GB24895@panix.com> <45CDEF58.7040109@ulmcnett.com> Message-ID: <45CE0EF3.5030408@ulmcnett.com> Tung Wai Yip wrote: > One caveat - since you use % to format the arguments, the individual % > characters in the text block would have to escaped. Something you'd likely > to encounter when embedding CSS. Yep, which is why I move over to Template when things like that are likely to be a problem. Else, it isn't too big a deal to remember to %%. -- pkm ~ http://paulmcnett.com From jim at well.com Sat Feb 10 20:15:27 2007 From: jim at well.com (jim stockford) Date: Sat, 10 Feb 2007 11:15:27 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> Message-ID: <32ef362c7a25f2e88a66b9d27384ef2a@well.com> what's the assumption of a newbie? I'm guessing not new to programming but pretty well experienced in C, VB, Java, Perl 5 (and maybe interested in future features in Perl 6), maybe looking at Ruby as an alternative commitment to Python. I think our group has at least one ADA-experienced coder, certainly there are a few assembler experienced. All of the above might identify themselves as newbies wrt Python. If you buy the above, the decorators and other new and/or exotic features in Python might be very interesting for them. On Feb 9, 2007, at 4:04 PM, Tony Cappellini wrote: >> 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > I wouldn't agree that this is a beginner topic, especially since it's > relatively new to the language. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From spmcinerney at hotmail.com Sun Feb 11 02:34:33 2007 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Sat, 10 Feb 2007 17:34:33 -0800 Subject: [Baypiggies] Two distinct categories of newbies In-Reply-To: <32ef362c7a25f2e88a66b9d27384ef2a@well.com> Message-ID: There are two distinct categories of newbies, be aware that these are very different: 1) people who are new to programming (also includes the rapidly-growing sector of people using Python in education at all levels (elementary, high-school, science, visualization).) 2) people who are new to Python but experienced in programming (i.e. migrators from PERL,C++,Java,VB etc.) Most of their time is spent with a syntax guide, reference manual, package reference, and also in translating or learning new idioms ("how do I implement feature X from language Y?"), design patterns and unlearning bad or suboptimal practices from their old languages. (e.g. I mentioned before the book "PERL to Python Migration" by Martin C Brown - it only addresses the syntax and library reference, but it's the best I've found.) You might include in this 2a) people who became disillusioned with the lack of useful features of their previous language ("paradigm shoppers"). So to address these it is best to present "Top Ten Things that are Easier/Faster/Better in Python than PERL" (e.g. you can create arbitrarily-deep nested data structures, and they will throw a very helpful and descriptive exception if you use the wrong accessor function, instead of continuing silently as PERL does). Regards, Stephen _________________________________________________________________ FREE online classifieds from Windows Live Expo ? buy and sell with people you know http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06 From ddf at lka.com Mon Feb 12 03:01:31 2007 From: ddf at lka.com (Delbert Franz) Date: Sun, 11 Feb 2007 18:01:31 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <32ef362c7a25f2e88a66b9d27384ef2a@well.com> References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> Message-ID: <200702111801.31819.ddf@lka.com> On Saturday 10 February 2007 11:15, jim stockford wrote: > > what's the assumption of a newbie? I'm guessing > not new to programming but pretty well experienced > in C, VB, Java, Perl 5 (and maybe interested in future > features in Perl 6), maybe looking at Ruby as an > alternative commitment to Python. I think our group > has at least one ADA-experienced coder, certainly > there are a few assembler experienced. All of the > above might identify themselves as newbies wrt > Python. > If you buy the above, the decorators and other > new and/or exotic features in Python might be > very interesting for them. > > > On Feb 9, 2007, at 4:04 PM, Tony Cappellini wrote: > > >> 5) Understand and use the decorate/sort/undecorate (DSU) idiom. > > I wouldn't agree that this is a beginner topic, especially since it's > > relatively new to the language. > > _______________________________________________ I have been reading this thread with considerable interest. I'm what you would call a newbie. My first meeting of baypiggies was on 8 February. I got word of the meeting and the group via Wesley Chun, as I was one of 24 students in his latest "Intro to Python" class. By the way, it's a great class! Here are some of my thoughts on newbies/beginner night talks: 1. It is generally helpful to know something about one's audience before making a presentation:) However, the range of background and experiences of people coming to Python is varied. The background outlined above is quite distant from me. I programmed in C about 20 years ago for about 6 months on an eight-bit computer with 64KB RAM! Other than that, I have experience in none of the languages listed. 2. Based on the attendees at the class I took, the backgrounds are diverse: two of us had extensive education outside of IT, the rest had various software application, maintenance, sys admim, etc. experience. Some had C and C++, and others had a background in Perl. Some were there primarily because their boss sent them! Quite a number had not encountered any object-oriented language before. 3. I have come to Python after about 40 years of experience in Fortran, about five in PL/I, about two years of assembler for a Dec PDP 8/I, and some Basic. I have had one university course in what would now be called Computer Science (the term was not yet coined when I started). The reason my clients retain me is for my expertise in solving their problem. The software I develop and use comes along with me and for their staff, but it is my expertise in applying the software and training users that gets my foot in the door. Of course I have to maintain and extend the software as I go along and sometimes that is an explicit paid item but often it is just part of my "overhead". Thus software development is somewhat of an adjunct to my main body of expertise. 4. My interest in Python is for developing GUI-based data displays and analysis of the results from my software which models unsteady free-surface flow in rivers, canals, storm sewers, and related structures. I'm also interested in the scientific and numerical packages in Python: numpy, scipy, matplotlib, etc. 5. Here are some topics that I would find interesting and also useful: 5.1 Someone giving a talk on their experience in using scientific/numerical applications via Python. I don't have enough knowledge yet but perhaps in a year or two I may:) 5.2 A recent "newbie graduate", whose only exposure to object-oriented programming came from Python, sharing how they came to understand, view, and use classes, inheritance, methods, etc. What attracts them to that approach and how is it better than the non-object oriented approaches? Comparisons with other object-oriented languages are useless to me but might be useful for other newbies. 5.3 Some talks on experience with various graphical interfaces: TK, GTK, pyQT, etc. I currently have some experience with TK, having constructed an interactive package to create 2-D time-series plots of flows, and elevations during flood events. I have not had time to give another interface a try. GTK sounds interesting in combination with glade. I must say that doing this with Python is so much more fun than when I did a more limited package with a proprietary add-on to Fortran! I also like that fact I don't have to pay anyone for the privilege of using the software:) 5.4 Some introduction to using Python for web programming. I currently have a web site I created and being able add some more dynamic content might prove useful. 5.5 Extending Python by interfacing to Fortran code. This will be on my to-do list as I move into using Python as a front-end for more heavy-duty number-crunching software. Sorry for the long e-mail but it does give some feed back from a newbie who hopes to "graduate" in the not to distant future:) Delbert From chad.netzer at gmail.com Mon Feb 12 03:20:04 2007 From: chad.netzer at gmail.com (Chad Netzer) Date: Sun, 11 Feb 2007 18:20:04 -0800 Subject: [Baypiggies] [Offtopic] Vim author (Bram M.) talk at Google, this Tues 2/13/07 at 7 pm Message-ID: I apologize if this is offtopic, but since JJ mentioned Vim in his talk a couple months ago, it might be relevant to a few of you. Bram Moolenaar will be at Google this Tuesday night (2/13/07 @ 7 pm), giving a talk entitled: "Seven habits for effective text editing, 2.0" More information at the Vim homepage and Google Code blog: www.vim.org http://google-code-updates.blogspot.com/2007/02/open-source-developers-google-speaker.html Chad From spmcinerney at hotmail.com Mon Feb 12 05:49:00 2007 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Sun, 11 Feb 2007 20:49:00 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <200702111801.31819.ddf@lka.com> Message-ID: Delbert, Do you not use the Python wrapping of VTK (C++) for visualization? And there's an open-source fluid dynamics package called MayaVi that sits on top of VTK and can also be used to produce pretty good visualizations. These are included in Enthought Python for Windows distribution. >4. My interest in Python is for developing GUI-based data displays and >analysis >of the results from my software which models unsteady free-surface >flow in rivers, canals, storm sewers, and related structures. I'm also >interested >in the scientific and numerical packages in Python: numpy, scipy, >matplotlib, >etc. > > >5.3 Some talks on experience with various graphical interfaces: TK, GTK, >pyQT, etc. >I currently have some experience with TK, having constructed an >interactive package >to create 2-D time-series plots of flows, and elevations during flood >events. >I have not had time to give another interface a try. GTK sounds >interesting >in combination with glade. I must say that doing this with Python is so >much more >fun than when I did a more limited package with a proprietary add-on to >Fortran! >I also like that fact I don't have to pay anyone for the privilege of using >the >software:) >5.5 Extending Python by interfacing to Fortran code. This will be on my >to-do list as I move into using Python as a front-end for more heavy-duty >number-crunching software. (NOSC have done this for atmospheric forecasting. Also SciPy conference 07 will be in San Diego, should be a good event.) Regards, Stephen _________________________________________________________________ Check out all that glitters with the MSN Entertainment Guide to the Academy Awards? http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline2 From jim at well.com Mon Feb 12 22:17:29 2007 From: jim at well.com (jim stockford) Date: Mon, 12 Feb 2007 13:17:29 -0800 Subject: [Baypiggies] call for more March meeting presenters Message-ID: We've got promises from Jason, Drew, and JJ to report on what they think is interesting at PyCon for the bayPIGgies March 8 meeting. If you're going to PyCon, please volunteer to tell us what you think was interesting. If you know someone going to PyCon, volunteer them, please. thanks, jim at well.com From cbc at unc.edu Tue Feb 13 00:11:07 2007 From: cbc at unc.edu (Chris Calloway) Date: Mon, 12 Feb 2007 18:11:07 -0500 Subject: [Baypiggies] Zope 3 Boot Camp early bird registration deadline near Message-ID: <45D0F40B.9080706@unc.edu> The early bird registration deadline for Camp 5 and the BBQ Sprint is Wednesday, February 14: http://trizpug.org/boot-camp/camp5/ You can save $50 by registering early. Registration ends Friday March 2. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 From spmcinerney at hotmail.com Tue Feb 13 05:39:07 2007 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Mon, 12 Feb 2007 20:39:07 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks / VTK, Enthought In-Reply-To: <45D10E6E.1060304@ingres.com> Message-ID: Chris, - Enthought is an awesome Windows bundle with scientific-batteries-very-included, even if it does trail releases of Python itself by ~1yr. (currently at Python 2.4.3) It takes all the headache out of installing compatible versions of multiple numeric and visualization packages, which is seriously painful. - Best place to ask your Ubuntu / transplanted binary question is on 'enthon-dev' list. https://mail.enthought.com/mailman/listinfo (also has 'enthought-announce' and other lists) I suspect they do not support that. - I am not aware of other VTK users in BayPIGgies but I think it's good for scientific apps; I know quite a few scientific users use GTK. I never encountered any of the issues you did. Either try Enthought Python on XP (should be easy), or try reporting and troubleshooting the individual packages like VTK (more painful). Regards, Stephen _________________________________________________________________ FREE online classifieds from Windows Live Expo ? buy and sell with people you know http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06 From jim at well.com Tue Feb 13 18:27:51 2007 From: jim at well.com (jim stockford) Date: Tue, 13 Feb 2007 09:27:51 -0800 Subject: [Baypiggies] [Offtopic] Vim author (Bram M.) talk at Google, this Tues 2/13/07 at 7 pm In-Reply-To: References: Message-ID: <2c54497d0f1e7929df7ee820ff30d2e2@well.com> seems on topic to me--vim is my favorite, and editing techniques seem germane to the group. On Feb 11, 2007, at 6:20 PM, Chad Netzer wrote: > I apologize if this is offtopic, but since JJ mentioned Vim in his > talk a > couple months ago, it might be relevant to a few of you. > > Bram Moolenaar will be at Google this Tuesday night (2/13/07 @ 7 pm), > giving a talk entitled: > > "Seven habits for effective text editing, 2.0" > > More information at the Vim homepage and Google Code blog: > > www.vim.org > http://google-code-updates.blogspot.com/2007/02/open-source- > developers-google-speaker.html > > Chad > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From cbc at unc.edu Mon Feb 12 19:30:29 2007 From: cbc at unc.edu (Chris Calloway) Date: Mon, 12 Feb 2007 13:30:29 -0500 Subject: [Baypiggies] Zope 3 Boot Camp early bird registration deadline near Message-ID: <45D0B245.6040802@unc.edu> The early bird registration deadline for Camp 5 and the BBQ Sprint is Wednesday, February 14: http://trizpug.org/boot-camp/camp5/ You can save $50 by registering early. Registration ends Friday March 2. -- Sincerely, Chris Calloway http://www.seacoos.org office: 332 Chapman Hall phone: (919) 962-4323 mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599 From jjinux at gmail.com Tue Feb 13 23:33:04 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 13 Feb 2007 14:33:04 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209204012.00be9ae8@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: On 2/9/07, Dennis Reinhardt wrote: > At 08:28 PM 2/9/2007, Laszlo Antal wrote: > >Hi, > >This is a great thread. > >I want to thank everyone for sharing their wisdom. > >Keep it coming. > > I *was* going to duck out because I was outnumbered by those favoring > triple quoting. > > Yes, triple quoting can work for simple situations. The triple quoting > examples displayed in this thread have been just that: simple. They do not > include conditionally executed code or do parameter substitution. What > they do is obscure the block structure of the code. > > Here is a code fragment from my talk last night (foil 15, I believe). How > would you re-write this to utilize triple quoting? The task here is to > build a two level visual tree structure: > > # build entire initial tree structure > def init_tree(ht_obj): > html = "" > index = 0 > last_exe = "" > for xml_entry in util_actwin.display_list("enm", "+"): > exe_name = str_extract(xml_entry, ["enm"]) > keye = safe_int(str_extract(xml_entry, ["key"])) > act = str_extract(xml_entry, ["act"]) > #logger("init_tree %s %s" % (keye, exe_name)) > fname, exe = exe_name.split(".") > if fname != last_exe: > html += "" > if fname == expanded_node: > html += "" > else: > html += "\r\n\r\n" % hovered_img(ht_obj, index) > html += "" % > get_program_image(fname) > html += "" % fname > html += "" > html += "" > if fname == expanded_node: > html += "" > html += "" > parm_index = safe_int_default(ht_obj.param("index"), -1) > if parm_index == keye: > html += "" > html += "" > else: > html += "" % hovered_img(ht_obj, index) > html += "" > html += "" % get_caption(xml_entry) > html += "" > else: > pass > last_exe = fname > index += 1 > html += "
href=edt_main.py?slct=expand&fname=%s>" % fname > html += "<%s>%s 
  html += "width=32 height=32 border=0> html += "&class=tree_open32" > html += "&index=%s" % keye > html += "&act=%s" % act > html += "><%s> html += "width=16 height=16 border=0>%s
" > return html Seriously, that's what a templating language is used for! I recommend Cheetah, Myghty, Mako, or Genshi, depending on your tastes. Please excuse me if I say that the above is *ugly*. It's much better to break what you can into Python, and use a templating language for the rest. Best Regards, -jj -- http://jjinux.blogspot.com/ From tungwaiyip at yahoo.com Tue Feb 13 23:55:25 2007 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Tue, 13 Feb 2007 14:55:25 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: On Tue, 13 Feb 2007 14:33:04 -0800, Shannon -jj Behrens wrote: > On 2/9/07, Dennis Reinhardt wrote: >> At 08:28 PM 2/9/2007, Laszlo Antal wrote: >> >Hi, >> >This is a great thread. >> >I want to thank everyone for sharing their wisdom. >> >Keep it coming. >> >> I *was* going to duck out because I was outnumbered by those favoring >> triple quoting. >> >> Yes, triple quoting can work for simple situations. The triple quoting >> examples displayed in this thread have been just that: simple. They do >> not >> include conditionally executed code or do parameter substitution. What >> they do is obscure the block structure of the code. >> >> Here is a code fragment from my talk last night (foil 15, I believe). >> How >> would you re-write this to utilize triple quoting? The task here is to >> build a two level visual tree structure: >> >> # build entire initial tree structure >> def init_tree(ht_obj): >> html = "" >> index = 0 >> last_exe = "" >> for xml_entry in util_actwin.display_list("enm", "+"): >> exe_name = str_extract(xml_entry, ["enm"]) >> keye = safe_int(str_extract(xml_entry, ["key"])) >> act = str_extract(xml_entry, ["act"]) >> #logger("init_tree %s %s" % (keye, exe_name)) >> fname, exe = exe_name.split(".") >> if fname != last_exe: >> html += "" >> if fname == expanded_node: >> html += "" >> else: >> html += "\r\n\r\n" % hovered_img(ht_obj, >> index) >> html += "" % >> get_program_image(fname) >> html += "" % fname >> html += "" >> html += "" >> if fname == expanded_node: >> html += "" >> html += "" >> parm_index = safe_int_default(ht_obj.param("index"), -1) >> if parm_index == keye: >> html += "" >> html += "" >> else: >> html += "" % hovered_img(ht_obj, >> index) >> html += "" >> html += "" % get_caption(xml_entry) >> html += "" >> else: >> pass >> last_exe = fname >> index += 1 >> html += "
> href=edt_main.py?slct=expand&fname=%s>" % fname >> html += "<%s>%s 
 > get_action_image(xml_entry) >> html += "width=32 height=32 border=0>> html += "&class=tree_open32" >> html += "&index=%s" % keye >> html += "&act=%s" % act >> html += "><%s>> get_action_image(xml_entry) >> html += "width=16 height=16 border=0>%s
" >> return html > > Seriously, that's what a templating language is used for! I recommend > Cheetah, Myghty, Mako, or Genshi, depending on your tastes. Please > excuse me if I say that the above is *ugly*. It's much better to > break what you can into Python, and use a templating language for the > rest. > > Best Regards, > -jj > My HTMLTestRunner is a real world example of generating moderately complex text output using triple quoted text blocks. http://tungwaiyip.info/software/HTMLTestRunner.html I agree with JJ that template language is another good alternative, especially for more complex generation. While this is subjective and everyone have different criteria, I consider the approach of interleaving Python code with the target output hard to maintain. It goes back to the Java Servlet approach and the many addon projects later to provide better alternatives. Wai Yip From jjinux at gmail.com Wed Feb 14 00:02:34 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 13 Feb 2007 15:02:34 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <200702111801.31819.ddf@lka.com> References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: > 4. My interest in Python is for developing GUI-based data displays and analysis > of the results from my software which models unsteady free-surface > flow in rivers, canals, storm sewers, and related structures. Neat! > 5.2 A recent "newbie graduate", whose only exposure to object-oriented programming > came from Python, sharing how they came to understand, view, and use classes, > inheritance, methods, etc. > What attracts them to that approach and how is it > better than the non-object oriented approaches? Comparisons with other object-oriented > languages are useless to me but might be useful for other newbies. I think there are many of us, myself included, that could give this talk if there was enough interest. > 5.3 Some talks on experience with various graphical interfaces: TK, GTK, pyQT, etc. > I currently have some experience with TK, having constructed an interactive package > to create 2-D time-series plots of flows, and elevations during flood events. > I have not had time to give another interface a try. GTK sounds interesting > in combination with glade. Drew is quite good with Tk. I gave a talk on PyGTK and Glade over a year ago, but attendance was smaller than some of my other talks. If there were more interest, I could do it again. > 5.4 Some introduction to using Python for web programming. I currently have > a web site I created and being able add some more dynamic content might > prove useful. There's no end to the number of different Web technology talks we can have. We had a Twisted talk a while ago. Perhaps Ben Bangert or I can give a talk on Pylons + either Mako or Genshi. We've covered Plone. We had a Django talk. Ok, more Python tidbits: #) We could quickly cover list comprehensions, generators, and closures. #) Use generator expressions to transform iterators on the fly. For instance: >>> f = open("junk.txt") >>> f = (line.lower() for line in f) Now I can pass f to somewhere else, and it'll lower case the lines *on the fly*. >>> for line in f: ... print line, ... foo bar bat howdy! Happy Hacking! -jj -- http://jjinux.blogspot.com/ From jjinux at gmail.com Wed Feb 14 00:15:52 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 13 Feb 2007 15:15:52 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: #) Using try/except for flow control: """Try to actually log the user in. BASIC IDEA: A million things can go wrong, and there are several ways to succeed. You want to check for the ways that can succeed and continue on as soon as one of them does. You want the non-local flow of control that exceptions provide, but you need it for both success *and* failure. """ def doLoginAction(self): """Try to actually log the user in.""" class PasswordAccepted(Exception): pass try: if check_password(): # This may raise KeyError. raise PasswordAccepted do_more_expensive_work() and_even_more_expensive_work() if check_other_password(): # This may raise KeyError. raise PasswordAccepted raise KeyError except KeyError: self.setError("Invalid username or password.") return except PasswordAccepted: pass continue_successfully() From jjinux at gmail.com Wed Feb 14 00:16:08 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 13 Feb 2007 15:16:08 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: """Demonstrate function decorators. BASIC IDEA: Use a function decorator to tell when and how a function should be logged. All kinds of things can be logged automatically, including the function arguments, how long it took to run, and (theoretically) even the stack. The syntax looks like: @logged("post") def hello(name): print "Hello,", name """ import sys import time def logged(when): """Log every invocation of the function. when -- This should be "pre" or "post". If "post", then I'll also time the function, which may be useful for profiling. """ def log(f, *args, **kargs): print >> sys.stderr, """\ Called: function: %s args: %s kargs: %s""" % (`f`, `args`, `kargs`) def pre_logged(f): def wrapper(*args, **kargs): log(f, *args, **kargs) return f(*args, **kargs) return wrapper def post_logged(f): def wrapper(*args, **kargs): start = time.time() try: return f(*args, **kargs) finally: log(f, *args, **kargs) print >> sys.stderr, """\ time delta: %s""" % (time.time() - start) return wrapper try: return {"pre": pre_logged, "post": post_logged}[when] except KeyError, e: raise ValueError(e) @logged("post") def hello(name): print "Hello,", name hello("World!") From mac at Wireless.Com Wed Feb 14 00:27:03 2007 From: mac at Wireless.Com (Mike Cheponis) Date: Tue, 13 Feb 2007 15:27:03 -0800 (PST) Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: On Tue, 13 Feb 2007, Tung Wai Yip wrote: > My HTMLTestRunner is a real world example of generating moderately complex > text output using triple quoted text blocks. > > http://tungwaiyip.info/software/HTMLTestRunner.html > > I agree with JJ that template language is another good alternative, > especially for more complex generation. While this is subjective and > everyone have different criteria, I consider the approach of interleaving > Python code with the target output hard to maintain. It goes back to the > Java Servlet approach and the many addon projects later to provide better > alternatives. Are you sort-of saying that having a separate template is like having a ".h" file, and that keeping code+data local in the program makes things easier to understand, and, therefore, perhaps Python needs to include better templating features? (Yes, I know I'm putting lots of words in your mouth, but I'd appreciate more detail on what you mean.) Thanks, -Mike From jjinux at gmail.com Wed Feb 14 00:33:53 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 13 Feb 2007 15:33:53 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: Python experts know about this, but Python newbies might not: #) Monkey patching! At runtime, anything is hackable. Sometimes you have to rely on a third party library that does the wrong thing. Now, you should start by submitting a bug or a patch. In the meantime, you still need to fix it to solve your own needs. Modifying third party packages sucks. It's not fun to maintain custom versions of a bunch of third party packages. Both packaging and upgrading suddenly becomes yucky. Instead of actually editing the code, sometimes you can get by with monkey patching, that is, fixing it at runtime. That way, you don't have to modify the other code. This is best used sparingly, carefully, and lightly. You also have to remember to undo your monkey patches once the problem gets resolved ;) Ok, let's say I have a naughty third-party library that thinks it lives in DOS land. However, it only does bad things when I'm not looking. I haven't been able to find the culprit. I need to spot it red handed, preferably with a stack trace! I know it's using the os.path.join function. Hence, I use an undercover decoy version of os.path.join to nab him in the act! >>> import os >>> >>> # Here's an example of naughty code that thinks it lives in DOS: >>> os.path.join(r"\usr", "local") '\\usr/local' >>> >>> # Let's replace os.path.join with my own "special" version. Notice how >>> # I'm using *args so that any number of arguments will get carried through >>> # seamlessly. Correctly using *args and *kargs is an important part of >>> # wrapping other functions. >>> >>> def my_join(*args): ... """Figure out who thinks he's living in DOS land.""" ... for arg in args: ... if arg.find("\\") != -1: ... raise ValueError("This ain't DOS bub!") ... return os.path.old_join(*args) ... >>> # Swap in my new version. >>> os.path.old_join = os.path.join >>> os.path.join = my_join >>> >>> # Well behaved code is safe: >>> os.path.join("/usr", "local") '/usr/local' >>> # Naughty code isn't! >>> os.path.join(r"\usr", "local") Traceback (most recent call last): File "", line 1, in ? File "", line 5, in my_join ValueError: This ain't DOS bub! Happy Hacking! -jj From wescpy at gmail.com Wed Feb 14 00:50:35 2007 From: wescpy at gmail.com (wesley chun) Date: Tue, 13 Feb 2007 15:50:35 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <78b3a9580702131550o1344a107sebaf312155a8b396@mail.gmail.com> > > I consider the approach of interleaving > > Python code with the target output hard to maintain. It goes back to the > > Java Servlet approach and the many addon projects later to provide better > > alternatives. > > Are you sort-of saying that having a separate template is like having a ".h" file, and that keeping code+data local in the program makes things easier to understand, and, therefore, perhaps Python needs to include better templating features? what i'm reading from what wai-yip said is that when you have Python code and are actively trying to maintain its structure, attempting to interleave Python code along with, say XML, SQL, etc., is difficult to maintain, because you will end up wrecking/ruining/destroying the structure of at least one, if not all, just to maintain *structure*, say nothing of anything else. there is also a hint of "what happens when we try to allow insertion of (programming) logic inside a structured document processing format like HTML." that's just what *i* read... to each his/her own! i understand dennis' logic in trying to preserve structure in his code, and why he is doing it -- i've seen lots of code like this, and to some extent, it works in JS, however, for large and/or long-running Python applications, i cannot justify the CPU time and performance lost in doing malloc()+realloc()+realloc()+realloc()+realloc()+realloc()+realloc()+realloc()+realloc()..., not to mention any internal heap fragmentation that may result from it. here's a clip from the man page: The order and contiguity of storage allocated by successive calls to realloc() is unspecified. The pointer returned if the allocation suc- ceeds shall be suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallo- cated). my process mgmt background is now a little rusty, so remind me: does the OS help "defrag" heap chunks at all during the lifetime of a process? if so, how often? is it time- or capacity-based? just curious, -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Prentice Hall, (c)2007,2001 http://corepython.com wesley.j.chun :: wescpy-at-gmail.com python training and technical consulting cyberweb.consulting : silicon valley, ca http://cyberwebconsulting.com From tungwaiyip at yahoo.com Wed Feb 14 01:17:24 2007 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Tue, 13 Feb 2007 16:17:24 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: > On Tue, 13 Feb 2007, Tung Wai Yip wrote: > >> My HTMLTestRunner is a real world example of generating moderately >> complex >> text output using triple quoted text blocks. >> >> http://tungwaiyip.info/software/HTMLTestRunner.html >> >> I agree with JJ that template language is another good alternative, >> especially for more complex generation. While this is subjective and >> everyone have different criteria, I consider the approach of >> interleaving >> Python code with the target output hard to maintain. It goes back to the >> Java Servlet approach and the many addon projects later to provide >> better >> alternatives. > > Are you sort-of saying that having a separate template is like having a > ".h" file, and that keeping code+data local in the program makes things > easier to understand, and, therefore, perhaps Python needs to include > better templating features? > > (Yes, I know I'm putting lots of words in your mouth, but I'd appreciate > more detail on what you mean.) > > Thanks, > > -Mike Sorry for not explaining myself sufficiently. I was contrasting different approach of generating non-trivial text output using Python. 1. Use string operations (+, %, etc) This is the most straight forward approach with no dependency on external library. With Python code it can make use of arbitrary logic. The con is it leads to mixing of Python code and target text that made it hard to read. Too much Python logic sprinkled inside would make the flow especially hard to follow. 2. Use triple quoted text block This is the similar to 1. except you can group more target text into a larger unit, thus provide a higher degree of separation of Python code and the target output. Also the ' and " characters do not need to be escaped inside a text block, therefore it is a big boon in readability when you are generating text with a lot of quotes (like HTML or XML). 3. Use a template langauge By template language it means the likes of Cheetah, Myghty, Mako, or Genshi as JJ mentioned. The parallel in Java world is JSP and Velocity. They are routinely used in webpage generation because they are more powerful and makes complex project easier to maintain. It also mean to create an interfacing point between programmers and designers. The con is the dependency on third party library, more new language to learn and also a risk of lock-in to a third-party language. Also while the goal is provide a high degree of separation between code and the template, in practice it is never perfect and we often find code spill over to the template. Depends on the complexity of the problem, all approach has their appropiate use. In theory more separation is better. But if you have a simple problem, it maybe burdensome to invoke a template library and edit two separate files. I especially emphasize triple quote not because it the best solution to every problem but that it is an overlooked feature in Python that often significantly improve string operations as oppose to using a lot of string concatenations. It is also a big improvement in readability. Wai Yip From jjinux at gmail.com Wed Feb 14 01:42:05 2007 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 13 Feb 2007 16:42:05 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: #) Unlike a lot of languages, Python has a nice *mix* of the programming paradigms. It's not just OO. You should embrace this. Let me run down the list with some examples: Procedural: Code everything in functions. You can put functions inside of functions and lexical scoping works like in Pascal. Functional: >>> l = [1, 2, 3, None, 1.2] >>> filter(None, l) [1, 2, 3, 1.2] >>> l = [1, 2, 3] >>> filter(lambda x: x > 2, l) [3] >>> map(str, l) ['1', '2', '3'] >>> # A closure. >>> def greeter(name): ... def greet(): ... print "Hello, my name is %s" % name ... return greet ... >>> greet = greeter('JJ') >>> greet() Hello, my name is JJ >>> # Now I can pass my special greet somewhere else. Modern functional programming a la Haskell: >>> l = [1, 2, 3, None, 1.2] >>> [i for i in l if l is not None] [1, 2, 3, None, 1.2] >>> l = [1, 2, 3] >>> [i for i in l if i > 2] [3] >>> [str(i) for i in l] ['1', '2', '3'] Object oriented: >>> class Fruit: ... def good_for_you(self): ... return True ... >>> class Orange(Fruit): ... def taste(self): ... return "sweet" ... >>> class Lemon(Fruit): ... def taste(self): ... return "sour" ... >>> fruit = [Orange(), Lemon()] >>> for i in fruit: ... print i.__class__.__name__ ... print i.good_for_you() ... print i.taste() ... Orange True sweet Lemon True sour But unlike Java, we have bound methods: >>> taste = Orange().taste >>> # I can now pass taste around as a function pointer. ... >>> taste() 'sweet' Imperative: a = 0 a += 1 # That's a functional programming joke ;) Aspect oriented programming: >>> # Functions: ... >>> def sum(a, b): ... print a + b ... >>> # Aspects: ... >>> def wrap_function(f): ... def inner(*args, **kargs): ... print "Calling %s with %r %r" % ( ... f.func_name, args, kargs) ... return f(*args, **kargs) ... return inner ... >>> # Weave them together: ... >>> sum = wrap_function(sum) >>> >>> # Test: ... >>> sum(1, 2) Calling sum with (1, 2) {} 3 Logic-based: Here's a Python-take on Prolog: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303057 Ok, I'm out of paradigms ;) Happy Hacking! -jj From DennisR at dair.com Wed Feb 14 01:44:31 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Tue, 13 Feb 2007 16:44:31 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: <78b3a9580702131550o1344a107sebaf312155a8b396@mail.gmail.co m> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <5.1.0.14.0.20070213161517.00bed4b8@localhost> At 03:50 PM 2/13/2007, wesley chun wrote: >i cannot justify the CPU time and performance >lost in doing >malloc()+realloc()+realloc()+realloc()+realloc()+realloc()+realloc()+realloc()+realloc().. We can quantify this, albeit abstractly. The actual allocation and re-use of memory is not known to me. The simplest case to consider is once allocated, memory is never re-claimed, also a worst case. If we allocate a memory object N units in length, the memory impact is N. If we allocate this in units of 1 by copy/append (a.k.a tail recursion), the impact is as bad as 1+2+3+4 .... or more generally N*(N+1)/2 For moderate N (say =10), the impact is 5.5X worse than allocating a single block of N. For larger N, the N*(N+1)/2 gets bad fast. If N is less than 10, the impact is better than 5.5X. A copy/append such as A += ... [done 30 times] can be re-expressed as X += ... [done 10 times] Y += ... [done 10 times] Z += ... [done 10 times] A + X + Y + Z [done once] In DialogDevil, scanning and processing click actions against the running processes *is* a CPU drain and I have had to put a lot of optimization work into that. In SpamAI, I had to pay lots of attention to efficiency of regular expressions I wrote. HTML generation simply is not even a blip on the cpu radar screen for either program, both of which required optimization work. Regards, Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From bsergean at gmail.com Wed Feb 14 01:49:51 2007 From: bsergean at gmail.com (Benjamin Sergeant) Date: Tue, 13 Feb 2007 19:49:51 -0500 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <1621f9fa0702131649w4a5592a0gf35b36c87808486e@mail.gmail.com> If you want a very simple and easy to integrate templating engine you might check this one: http://pytof.googlecode.com/svn/trunk/pytof/ezt.py (1 file :) Check the edna code or my humble pet project (pytof) for usage. Benjamin. ps: I moved from triple quoting to templating and I think it was a good move ... On 2/13/07, Tung Wai Yip wrote: > > On Tue, 13 Feb 2007, Tung Wai Yip wrote: > > > >> My HTMLTestRunner is a real world example of generating moderately > >> complex > >> text output using triple quoted text blocks. > >> > >> http://tungwaiyip.info/software/HTMLTestRunner.html > >> > >> I agree with JJ that template language is another good alternative, > >> especially for more complex generation. While this is subjective and > >> everyone have different criteria, I consider the approach of > >> interleaving > >> Python code with the target output hard to maintain. It goes back to the > >> Java Servlet approach and the many addon projects later to provide > >> better > >> alternatives. > > > > Are you sort-of saying that having a separate template is like having a > > ".h" file, and that keeping code+data local in the program makes things > > easier to understand, and, therefore, perhaps Python needs to include > > better templating features? > > > > (Yes, I know I'm putting lots of words in your mouth, but I'd appreciate > > more detail on what you mean.) > > > > Thanks, > > > > -Mike > > > Sorry for not explaining myself sufficiently. I was contrasting different > approach of generating non-trivial text output using Python. > > > 1. Use string operations (+, %, etc) > > This is the most straight forward approach with no dependency on external > library. With Python code it can make use of arbitrary logic. The con is > it leads to mixing of Python code and target text that made it hard to > read. Too much Python logic sprinkled inside would make the flow > especially hard to follow. > > > 2. Use triple quoted text block > > This is the similar to 1. except you can group more target text into a > larger unit, thus provide a higher degree of separation of Python code and > the target output. Also the ' and " characters do not need to be escaped > inside a text block, therefore it is a big boon in readability when you > are generating text with a lot of quotes (like HTML or XML). > > > 3. Use a template langauge > > By template language it means the likes of Cheetah, Myghty, Mako, or > Genshi as JJ mentioned. The parallel in Java world is JSP and Velocity. > They are routinely used in webpage generation because they are more > powerful and makes complex project easier to maintain. It also mean to > create an interfacing point between programmers and designers. The con is > the dependency on third party library, more new language to learn and also > a risk of lock-in to a third-party language. Also while the goal is > provide a high degree of separation between code and the template, in > practice it is never perfect and we often find code spill over to the > template. > > > Depends on the complexity of the problem, all approach has their > appropiate use. In theory more separation is better. But if you have a > simple problem, it maybe burdensome to invoke a template library and edit > two separate files. > > I especially emphasize triple quote not because it the best solution to > every problem but that it is an overlooked feature in Python that often > significantly improve string operations as oppose to using a lot of string > concatenations. It is also a big improvement in readability. > > > Wai Yip > > > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From aahz at pythoncraft.com Wed Feb 14 04:47:46 2007 From: aahz at pythoncraft.com (Aahz) Date: Tue, 13 Feb 2007 19:47:46 -0800 Subject: [Baypiggies] Two distinct categories of newbies In-Reply-To: References: <32ef362c7a25f2e88a66b9d27384ef2a@well.com> Message-ID: <20070214034746.GA1076@panix.com> On Sat, Feb 10, 2007, Stephen McInerney wrote: > > (e.g. I mentioned before the book "PERL to Python Migration" by Martin > C Brown - it only addresses the syntax and library reference, but it's > the best I've found.) ...unfortunately, that means it's still not good enough. I won't say it's the worst Python book I've seen, but it definitely ranks among the worst. It contains many errors and shows little awareness of Pythonic style. Speaking as someone who came to Python "from" Perl (I actually have a lot of other languages under my belt), I think the best approach is to simply learn Python on its own terms. I beat my head against the wall for almost two months before I started to "get it", and I blame trying to use Python as if it were Perl for that. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From aahz at pythoncraft.com Wed Feb 14 05:00:13 2007 From: aahz at pythoncraft.com (Aahz) Date: Tue, 13 Feb 2007 20:00:13 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: References: <8249c4ac0702091604o54e306cfu8f60dabe670f57aa@mail.gmail.com> <32ef362c7a25f2e88a66b9d27384ef2a@well.com> <200702111801.31819.ddf@lka.com> Message-ID: <20070214040013.GB1076@panix.com> On Tue, Feb 13, 2007, Shannon -jj Behrens wrote: > > #) Using try/except for flow control: > > """Try to actually log the user in. > > BASIC IDEA: A million things can go wrong, and there are several ways to > succeed. You want to check for the ways that can succeed and continue on as > soon as one of them does. You want the non-local flow of control that > exceptions provide, but you need it for both success *and* failure. > > """ > > def doLoginAction(self): > """Try to actually log the user in.""" > class PasswordAccepted(Exception): pass > try: > if check_password(): # This may raise KeyError. > raise PasswordAccepted > do_more_expensive_work() > and_even_more_expensive_work() > if check_other_password(): # This may raise KeyError. > raise PasswordAccepted > raise KeyError > except KeyError: > self.setError("Invalid username or password.") > return > except PasswordAccepted: > pass > continue_successfully() This really should not call setError(), it should simply raise ValueError (ValueError is for invalid data). Here's a more-complicated working example from my TextDB.py module illustrating multiple levels of control flow managed with exceptions: class Excluded(StandardError): pass class Found(StandardError): pass class NotFound(StandardError): pass def _fuzzy_match(string, filter): return string.find(filter) >= 0 def _exact_match(string, filter): return string == filter # Includes by default are ANDed; excludes are always ORed # Use "|" to OR includes; "!" indicates exclude def filter(db, FilterString=None, fields=None, FuzzyMatch=True): includes, excludes = _buildFilters(FilterString) if fields is not None: fields = re_comma_field.split(fields) for i in range(len(fields)): fields[i] = fields[i].lower() if FuzzyMatch: match = _fuzzy_match else: match = _exact_match result = [] for record in db: if fields is None: curr_fields = record.keys() else: curr_fields = [] for field in fields: if field in record: curr_fields.append(field) try: for field in curr_fields: for item in record[field]: item = item.lower() for filter in excludes: if match(item, filter): raise Excluded except Excluded: continue try: for ORlist in includes: for filter in ORlist: try: for field in curr_fields: for item in record[field]: if match(item, filter): raise Found except Found: break else: raise NotFound except NotFound: continue else: result.append(record) return result -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From aahz at pythoncraft.com Wed Feb 14 05:06:05 2007 From: aahz at pythoncraft.com (Aahz) Date: Tue, 13 Feb 2007 20:06:05 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: <78b3a9580702131550o1344a107sebaf312155a8b396@mail.gmail.com> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <78b3a9580702131550o1344a107sebaf312155a8b396@mail.gmail.com> Message-ID: <20070214040605.GC1076@panix.com> On Tue, Feb 13, 2007, wesley chun wrote: > > my process mgmt background is now a little rusty, so remind me: does > the OS help "defrag" heap chunks at all during the lifetime of a > process? if so, how often? is it time- or capacity-based? No, but PyMalloc does. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From aahz at pythoncraft.com Wed Feb 14 05:18:50 2007 From: aahz at pythoncraft.com (Aahz) Date: Tue, 13 Feb 2007 20:18:50 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks In-Reply-To: <5.1.0.14.0.20070209204012.00be9ae8@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <20070214041850.GD1076@panix.com> [top-posting for once to preserve Dennis's code without require people to read over it for my material] There are several aspects to your code that I would object to if you were submitting it to me for code review: * Your internal indentation makes this difficult to maintain * URL generation should be done with function calls, for example: def make_link(url, **kwargs): q = url_quote params = [ q(i[0])+'='+q(i[1]) for i in kwargs.items() ] params = '&'.join(params) return url + '?' + params make_link('edt_main.py', slct='edit', class='tree_open32', index=key, act=act) * Using += makes for bad performance * Hardcoding image size attributes is horrible * For that matter, hardcoding URLs is a Bad Idea * Interleaving program logic with HTML makes it difficult to follow both Triple-quoting doesn't solve any of these problems directly, but it would allow you to take more of a templating approach, particularly if you used dict interpolation instead of tuple interpolation. On Fri, Feb 09, 2007, Dennis Reinhardt wrote: > > Here is a code fragment from my talk last night (foil 15, I believe). How > would you re-write this to utilize triple quoting? The task here is to > build a two level visual tree structure: > > # build entire initial tree structure > def init_tree(ht_obj): > html = "" > index = 0 > last_exe = "" > for xml_entry in util_actwin.display_list("enm", "+"): > exe_name = str_extract(xml_entry, ["enm"]) > keye = safe_int(str_extract(xml_entry, ["key"])) > act = str_extract(xml_entry, ["act"]) > #logger("init_tree %s %s" % (keye, exe_name)) > fname, exe = exe_name.split(".") > if fname != last_exe: > html += "" > if fname == expanded_node: > html += "" > else: > html += "\r\n\r\n" % hovered_img(ht_obj, index) > html += "" % > get_program_image(fname) > html += "" % fname > html += "" > html += "" > if fname == expanded_node: > html += "" > html += "" > parm_index = safe_int_default(ht_obj.param("index"), -1) > if parm_index == keye: > html += "" > html += "" > else: > html += "" % hovered_img(ht_obj, index) > html += "" > html += "" % get_caption(xml_entry) > html += "" > else: > pass > last_exe = fname > index += 1 > html += "
href=edt_main.py?slct=expand&fname=%s>" % fname > html += "<%s>%s 
  html += "width=32 height=32 border=0> html += "&class=tree_open32" > html += "&index=%s" % keye > html += "&act=%s" % act > html += "><%s> html += "width=16 height=16 border=0>%s
" > return html -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From grayarea at reddagger.org Wed Feb 14 07:43:03 2007 From: grayarea at reddagger.org (jwithers) Date: Tue, 13 Feb 2007 22:43:03 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <1171435383.9349.13.camel@localhost> > I agree with JJ that template language is another good alternative, > especially for more complex generation. While this is subjective and > everyone have different criteria, I consider the approach of interleaving > Python code with the target output hard to maintain. It goes back to the > Java Servlet approach and the many addon projects later to provide better > alternatives. > Wai Yip > I have found TAL to be good for taking care of that. Templates, but you are close to forced to move your code outside the templates. Most people don't seem to like it much, but it makes me happy. Most of Zope gets on my nerves in one way or another, but TAL makes for better separation than the majority of templating systems, and avoids the ugly of building your html inside your code. jpw -- jwithers From bob at redivi.com Wed Feb 14 07:40:05 2007 From: bob at redivi.com (Bob Ippolito) Date: Tue, 13 Feb 2007 22:40:05 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: <1171435383.9349.13.camel@localhost> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <1171435383.9349.13.camel@localhost> Message-ID: <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> On 2/13/07, jwithers wrote: > > > I agree with JJ that template language is another good alternative, > > especially for more complex generation. While this is subjective and > > everyone have different criteria, I consider the approach of interleaving > > Python code with the target output hard to maintain. It goes back to the > > Java Servlet approach and the many addon projects later to provide better > > alternatives. > > > Wai Yip > > > > I have found TAL to be good for taking care of that. Templates, but you > are close to forced to move your code outside the templates. Most people > don't seem to like it much, but it makes me happy. Most of Zope gets on > my nerves in one way or another, but TAL makes for better separation > than the majority of templating systems, and avoids the ugly of building > your html inside your code. Genshi offers the same paradigm as TAL but uses Python syntax and is a bit friendlier to those who want to put code in templates. It's a pretty good middle ground in my experience. -bob From drewp at bigasterisk.com Wed Feb 14 08:03:49 2007 From: drewp at bigasterisk.com (Drew Perttula) Date: Tue, 13 Feb 2007 23:03:49 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - stan In-Reply-To: References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <45D2B455.7030100@bigasterisk.com> This example is getting some good discussion. I would use the "stan" templating system inside nevow, myself. My version is below: > On 2/9/07, Dennis Reinhardt wrote: >> # build entire initial tree structure >> def init_tree(ht_obj): >> html = "" >> index = 0 >> last_exe = "" >> for xml_entry in util_actwin.display_list("enm", "+"): >> exe_name = str_extract(xml_entry, ["enm"]) >> keye = safe_int(str_extract(xml_entry, ["key"])) >> act = str_extract(xml_entry, ["act"]) >> #logger("init_tree %s %s" % (keye, exe_name)) >> fname, exe = exe_name.split(".") >> if fname != last_exe: >> html += "" >> if fname == expanded_node: >> html += "" >> else: >> html += "\r\n\r\n" % hovered_img(ht_obj, index) >> html += "" % >> get_program_image(fname) >> html += "" % fname >> html += "" >> html += "" >> if fname == expanded_node: >> html += "" >> html += "" >> parm_index = safe_int_default(ht_obj.param("index"), -1) >> if parm_index == keye: >> html += "" >> html += "" >> else: >> html += "" % hovered_img(ht_obj, index) >> html += "" >> html += "" % get_caption(xml_entry) >> html += "" >> else: >> pass >> last_exe = fname >> index += 1 >> html += "
> href=edt_main.py?slct=expand&fname=%s>" % fname >> html += "<%s>%s 
 > html += "width=32 height=32 border=0>> html += "&class=tree_open32" >> html += "&index=%s" % keye >> html += "&act=%s" % act >> html += "><%s>> html += "width=16 height=16 border=0>%s
" >> return html # # nevow/stan version, completely untested # from nevow import flat, tags as T, entities # build entire initial tree structure def init_tree(ht_obj): index = 0 last_exe = "" for xml_entry in util_actwin.display_list("enm", "+"): exe_name = str_extract(xml_entry, ["enm"]) keye = safe_int(str_extract(xml_entry, ["key"])) act = str_extract(xml_entry, ["act"]) #logger("init_tree %s %s" % (keye, exe_name)) fname, exe = exe_name.split(".") if fname != last_exe: cols = [] if fname == expanded_node: cols.append(T.td[T.img(src="image/slct32.gif", border=0)]) else: cols.append(T.td[ T.a(href="edt_main.py?slct=expand&fname=%s" % fname)[ hovered_img(ht_obj, index)] ]) cols.extend([ T.td[T.img(src=get_program_image(fname), width=32, height=32)], T.td[fname], T.td[entities.nbsp], ]) rows.append(T.tr[cols]) if fname == expanded_node: parm_index = safe_int_default(ht_obj.param("index"), -1) if parm_index == keye: cols = [T.td[T.img(src="image/slct32.gif", border=0)], T.td[T.img(src=get_action_image(xml_entry), width=32, height=32, border=0)]] else: cols = [T.td[T.a(href=("edt_main.py?slct=edit" "&class=tree_open32" "&index=", keye, "&act=", act) )[hovered_img(ht_obj, index)]], T.td[T.img(src=get_action_image(xml_entry), width=16, height=16, border=0)]] rows.extend([T.tr[T.td[entities.nbsp], cols, T.td[get_caption(xml_entry)]]]) else: pass last_exe = fname index += 1 table = T.table(border=0)[rows] return flat.flatten(table) Some notes: The python lists and tuples in the xml-creating code will simply disappear in the output. T.p["foo", "bar"] renders to "

foobar

". Nevow gets quoting right, so probably some of the other code could be simplified. hovered_img() should return a stan structure instead of the insides of an img tag, too. The output of mine will be proper xml, which has some advantages. It won't be pretty-indented, but there's absolutely nothing interesting to see in the xml output. It'll be correct. What you might want to see is the DOM structure that you made, and firebug's DOM viewer is The Way to view that structure. It won't hide any information from you, and you can highlight back and forth between your DOM and the rendered page. So awesome. My version of the code has 2/3 as many "words" as the original, as counted by wc. Does that make it easier to maintain? I'm not sure, but I do know that making maintenance edits on stan code is a breeze. You _can't make_ invalid xml, which takes care of the first hurdle with free-form text templating. The code can also be indented according to normal python rules, which means your python editor is working _with_ you on this. Don't like (or can't use) the nevow project? This same XML shorthand was rewritten in a standalone project http://cheeseshop.python.org/pypi/Breve/1.0.35 I don't have any experience with breve. If it's really the stan part of nevow, then I say it's great. Here's an article on stan which goes beyond the xml output system and into the dynamic templating part (i.e. putting in fields that are filled with dynamic values at render time): http://www.kieranholland.com/code/documentation/nevow-stan/ From larryt at winfirst.com Wed Feb 14 00:27:08 2007 From: larryt at winfirst.com (larryt at winfirst.com) Date: Tue, 13 Feb 2007 23:27:08 +0000 (UTC) Subject: [Baypiggies] pyjamas Message-ID: <20070213232708.EE5B7AC25C@mail.sacsys.com> Does anybody know the nature of formal, informal or planned future Google support for pyjamas? Some of our GIS programmers recently tested it and found it to be much less mature than GWT. thanks, larry From aahz at pythoncraft.com Wed Feb 14 15:08:19 2007 From: aahz at pythoncraft.com (Aahz) Date: Wed, 14 Feb 2007 06:08:19 -0800 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) In-Reply-To: <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> <1171435383.9349.13.camel@localhost> <6a36e7290702132240o5965dda5x9d0c6eb135b1185f@mail.gmail.com> Message-ID: <20070214140819.GA5088@panix.com> On Tue, Feb 13, 2007, Bob Ippolito wrote: > On 2/13/07, jwithers wrote: >> >> I have found TAL to be good for taking care of that. Templates, but you >> are close to forced to move your code outside the templates. Most people >> don't seem to like it much, but it makes me happy. Most of Zope gets on >> my nerves in one way or another, but TAL makes for better separation >> than the majority of templating systems, and avoids the ugly of building >> your html inside your code. > > Genshi offers the same paradigm as TAL but uses Python syntax and is a > bit friendlier to those who want to put code in templates. It's a > pretty good middle ground in my experience. Haven't used either, but I've used Quixote a bit, and that's extremely nice for templates that focus mostly on programming. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM From larryt at winfirst.com Wed Feb 14 08:31:17 2007 From: larryt at winfirst.com (larryt at winfirst.com) Date: 14 Feb 2007 07:31:17 +0000 Subject: [Baypiggies] Output generation - (string operations/triple quote/template) Message-ID: Aahz writes: > [...] I've used Quixote a bit, and that's extremely > nice for templates that focus mostly on programming. I found it so as well. A couple of unexpected quoting behaviors, but a bit of trial and error gets through it, and I think there's been some recent work to improve it in that area as well. -larry From DennisR at dair.com Wed Feb 14 17:22:15 2007 From: DennisR at dair.com (Dennis Reinhardt) Date: Wed, 14 Feb 2007 08:22:15 -0800 Subject: [Baypiggies] Discussion for newbies/beginner night talks - stan In-Reply-To: <45D2B455.7030100@bigasterisk.com> References: <1171081738.2A2879EE@gf28.dngr.org> <5.1.0.14.0.20070209204012.00be9ae8@localhost> Message-ID: <5.1.0.14.0.20070214082207.00beb440@localhost> At 11:03 PM 2/13/2007, Drew Perttula wrote: >Some notes: >The python lists and tuples in the xml-creating code will simply >disappear in the output. T.p["foo", "bar"] renders to "

foobar

". Hmmm... I thought the x[y] syntax was doing an element access on dict or list x to find element y. If x is an function, then I am guessing that x[y] is shorthand for z = [y] x(z) or something like that. A snippet from Dennis: >> html += "
> html += "&class=tree_open32" >> html += "&index=%s" % keye >> html += "&act=%s" % act >> html += "><%s><%s> >> html += "&class=tree_open32" > >> html += "&index=%s" % keye > >> html += "&act=%s" % act > >> html += "><%s><%s>