From jjinux at gmail.com Sun Aug 1 07:12:12 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Sat, 31 Jul 2010 22:12:12 -0700 Subject: [Baypiggies] Any experience with Tornado server In-Reply-To: <385223.62771.qm@web120717.mail.ne1.yahoo.com> References: <300973.14676.qm@web120716.mail.ne1.yahoo.com> <4C53DCE9.1050507@xs4all.nl> <385223.62771.qm@web120717.mail.ne1.yahoo.com> Message-ID: You may enjoy my talk: http://jjinux.blogspot.com/2009/12/python-concurrency.html On Jul 31, 2010 2:50 AM, "Sukanta ganguly" wrote: Great review, Thanks SG ------------------------------ *From:* Michiel Overtoom *To:* baypiggies at python.org *Cc:* Sukanta ganguly *Sent:* Sat, July 31, 2010 1:20:57 AM *Subject:* Re: [Baypiggies] Any experience with Tornado server Sukanta ganguly wrote: > I would be very interested in learning from anybody about their experi... _______________________________________________ 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: From aahz at pythoncraft.com Mon Aug 2 19:58:20 2010 From: aahz at pythoncraft.com (Aahz) Date: Mon, 2 Aug 2010 10:58:20 -0700 Subject: [Baypiggies] Fwd: nested list help In-Reply-To: References: Message-ID: <20100802175820.GA6603@panix.com> On Tue, Jul 27, 2010, Robert Zuber wrote: > > I too find myself wishing that list methods returned a reference > to the list so that I could chain those calls or use them in list > comprehensions. Look forward to anyone's input on why they don't. It's a signal. Here's a fake example for why they don't: >>> a = [2, 7, 3, 0] >>> b = a.sort() >>> a [0, 2, 3, 7] # WTF?!?!?!?! IOW, it's too easy to forget about shared references, so mutating methods return None. However, Python does provide (at least in this case) a simple solution: >>> a = [2, 7, 3, 0] >>> b = sorted(a) >>> a [2, 7, 3, 0] >>> b [0, 2, 3, 7] See also http://docs.python.org/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "....Normal is what cuts off your sixth finger and your tail..." --Siobhan From Mike.Villarreal at adeccona.com Wed Aug 4 21:09:00 2010 From: Mike.Villarreal at adeccona.com (Villarreal, Mike) Date: Wed, 4 Aug 2010 15:09:00 -0400 Subject: [Baypiggies] Python Programmer Message-ID: Application process: Please forward your credentials to mike.villarreal at adeccona.com and your availability to have a phone interview. Principal: University of California Position: Python Programmer Location: Work form home office Duration: 2 Days (evening hours are ok) Pay rate: $50/hr w2 (budgeted) Manager would do a check in, 4 hours following the start of the assignment to ensure that there is positive progress. The programmer will work from home and simply email the final results as well as the corresponding source code to the hiring manager. Project: Screen scraping online App stores (Android, Apple, BlackBerry, OV Nokia) Looking to have two or three Python scripts written to help with an ongoing research project. For an accomplished programmer, the scripts should take no more than a day or two. Description: A specific App store and database schema will be provided as a function of the specific app store. Descend the app store application hierarchy storing the app tree hierarchy and details of each application version and application developer. Skills Required: Must be able to provide examples of your work Python programming Network Screen Scraping Python regular expression parsing of HTML and XML Python HTTP calls library Python DB-API to MySQL MySQL database design and administration Deliverables: [1] Fully encapsulated Python script and associated import files running under Python 2.4 Can be manually invoked from the command line and as a cron job (incremental updates) Is tested on both a LAMP and MAMP stack to scrape a parameterized target site (the site is fixed but the site is parametrized for our readability and modularity) Will dump the results to a MySQL database version 5.0.77 in one of two modes [a] build a new database [b] incremental update of an existing database. [2] MySQLdump of the database as built on a complete run of the target site (see above [a]). Mike Villarreal mike.villarreal at adeccona.com O: (408) 296-8414 ext. 25 M: (408) 940-5071 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeff.enderwick at gmail.com Thu Aug 5 04:34:23 2010 From: jeff.enderwick at gmail.com (Jeff Enderwick) Date: Wed, 4 Aug 2010 19:34:23 -0700 Subject: [Baypiggies] Python Programmer In-Reply-To: References: Message-ID: I don't think that you need to scrape in the AAPL case: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-enterprise-partner-feed.html On Wed, Aug 4, 2010 at 12:09 PM, Villarreal, Mike wrote: > Application process: Please forward your credentials to > mike.villarreal at adeccona.com and your availability to have a phone > interview. > > > Principal:??????????????????????University of California > > Position:?????????????????????? Python Programmer > > Location:????????????????????? Work form home office > > Duration:????????????????????? 2 Days (evening hours are ok) > > Pay rate:?????????????????????? $50/hr w2 (budgeted) > > > > Manager would do a check in, 4 hours following the start of the assignment > to ensure that there is positive progress. The programmer will work from > home and simply email the final results as well as the corresponding source > code to the hiring manager. > > > > Project: > > Screen scraping online?App stores (Android, Apple, BlackBerry,?OV Nokia) > > Looking to have two or three Python scripts written to help with an ongoing > research project.? For an accomplished programmer, the scripts should take > no more than a day or two. > > > > Description: > > A specific App store and database schema will be provided as a function of > the specific app store.? Descend the app store application hierarchy storing > the app tree hierarchy and details of each application version and > application developer. > > > > > > Skills?Required: > > Must be able to provide examples of your work > > Python programming > > Network Screen Scraping > > Python regular expression parsing of HTML and XML > > Python HTTP calls library > > Python DB-API to MySQL > > MySQL database design and administration > > > > > > Deliverables: > > [1] Fully encapsulated Python script and associated import files running > under Python 2.4 > > Can be manually invoked from the command line and as a cron job (incremental > updates) > > Is tested on both a LAMP and MAMP stack to scrape a parameterized target > site (the site is fixed but the site is parametrized for our readability and > modularity) > > Will dump the results to a MySQL database version 5.0.77 in one of two modes > [a] build a new database [b] incremental update of an existing database. > > > > [2] MySQLdump of the database as built on a complete run of the target site > (see above [a]). > > > > > > Mike Villarreal > > mike.villarreal at adeccona.com > > O: (408) 296-8414 ? ?ext. 25 > > M: (408) 940-5071 > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From kpguy1975 at gmail.com Thu Aug 5 06:37:11 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Thu, 5 Aug 2010 10:07:11 +0530 Subject: [Baypiggies] string to list question Message-ID: Suppose i have this string: z = 'AT/CG' How do i get this list: zlist = ['A','T/C','G'] -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at lolapps.com Thu Aug 5 06:43:26 2010 From: brian at lolapps.com (Brian Rue) Date: Wed, 4 Aug 2010 21:43:26 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Naive solution: zlist = [z[0], z[1:4], z[4]] On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: > Suppose i have this string: > z = 'AT/CG' > > How do i get this list: > > zlist = ['A','T/C','G'] > > > _______________________________________________ > 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: From recursive.cookie.jar at gmail.com Thu Aug 5 06:48:39 2010 From: recursive.cookie.jar at gmail.com (Zachary Collins) Date: Thu, 5 Aug 2010 13:48:39 +0900 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Use an re, like so: >>> import re >>> a = "AB/DE" >>> [s.group() for s in re.finditer("([A-Z]/[A-Z]|[A-Z])", a)] ['A', 'B/D', 'E'] 2010/8/5 Brian Rue : > Naive solution: > zlist = [z[0], z[1:4], z[4]] > > On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >> >> Suppose i have this string: >> z = 'AT/CG' >> >> How do i get this list: >> >> zlist = ['A','T/C','G'] >> >> >> _______________________________________________ >> 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 kpguy1975 at gmail.com Thu Aug 5 06:48:44 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Thu, 5 Aug 2010 10:18:44 +0530 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: I am afraid i was looking for a more general solution. Let's say the string is: z = 'AT/CGACATACG/C' and i want zlist = ['A','T/C','G','A','C','A','T','A','C','G/C'] On Thu, Aug 5, 2010 at 10:13 AM, Brian Rue wrote: > Naive solution: > > zlist = [z[0], z[1:4], z[4]] > > On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: > >> Suppose i have this string: >> z = 'AT/CG' >> >> How do i get this list: >> >> zlist = ['A','T/C','G'] >> >> >> _______________________________________________ >> 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: From brian at lolapps.com Thu Aug 5 06:51:31 2010 From: brian at lolapps.com (Brian Rue) Date: Wed, 4 Aug 2010 21:51:31 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Why didn't you say so? :) Looks like Zach's code will do the trick. On Wed, Aug 4, 2010 at 9:48 PM, Vikram K wrote: > > I am afraid i was looking for a more general solution. Let's say the string > is: > z = 'AT/CGACATACG/C' > and i want > zlist = ['A','T/C','G','A','C','A','T','A','C','G/C'] > > > On Thu, Aug 5, 2010 at 10:13 AM, Brian Rue wrote: > >> Naive solution: >> >> zlist = [z[0], z[1:4], z[4]] >> >> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >> >>> Suppose i have this string: >>> z = 'AT/CG' >>> >>> How do i get this list: >>> >>> zlist = ['A','T/C','G'] >>> >>> >>> _______________________________________________ >>> 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: From andrew at atoulou.se Thu Aug 5 06:52:50 2010 From: andrew at atoulou.se (Andrew Toulouse) Date: Wed, 4 Aug 2010 21:52:50 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: <80984491-8D6C-4A85-ACE9-2B4B7361F277@atoulou.se> Looks like you're trying to turn it into a bunch of tokens. I'm assuming you have an arbitrarily long string. You could loop through each character in the input, append it to the stack, determine whether the stack is a valid token, and output it (and reset the stack if so). In pseudocode: def tokenizer(z): def isValid(characterList): return true if characterList is ['A'], ['T','/','G'], or ['C'] #this is pseudocode stack = [] for character in z: stack.append(character) if (isValid(stack)): yield ''.join(stack) print(list(tokenizer("AT/CG"))) Disclaimer: This is absolutely not super-optimal and is untested (and my Python is rusty, I've been doing almost all Java and Objective-C lately) but it should get the job done if you just need something quick, I think. On Aug 4, 2010, at 9:43 PM, Brian Rue wrote: > Naive solution: > > zlist = [z[0], z[1:4], z[4]] > > On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: > Suppose i have this string: > z = 'AT/CG' > > How do i get this list: > > zlist = ['A','T/C','G'] > > > _______________________________________________ > 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: From andrew at atoulou.se Thu Aug 5 06:54:46 2010 From: andrew at atoulou.se (Andrew Toulouse) Date: Wed, 4 Aug 2010 21:54:46 -0700 Subject: [Baypiggies] string to list question In-Reply-To: <80984491-8D6C-4A85-ACE9-2B4B7361F277@atoulou.se> References: <80984491-8D6C-4A85-ACE9-2B4B7361F277@atoulou.se> Message-ID: Hm. Other people had the idea of using regexes, and theirs looks better. D'oh. Ignore me. On Aug 4, 2010, at 9:52 PM, Andrew Toulouse wrote: > Looks like you're trying to turn it into a bunch of tokens. I'm assuming you have an arbitrarily long string. > > You could loop through each character in the input, append it to the stack, determine whether the stack is a valid token, and output it (and reset the stack if so). In pseudocode: > > def tokenizer(z): > def isValid(characterList): > return true if characterList is ['A'], ['T','/','G'], or ['C'] #this is pseudocode > > stack = [] > for character in z: > stack.append(character) > if (isValid(stack)): > yield ''.join(stack) > > print(list(tokenizer("AT/CG"))) > > Disclaimer: This is absolutely not super-optimal and is untested (and my Python is rusty, I've been doing almost all Java and Objective-C lately) but it should get the job done if you just need something quick, I think. > > On Aug 4, 2010, at 9:43 PM, Brian Rue wrote: > >> Naive solution: >> >> zlist = [z[0], z[1:4], z[4]] >> >> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >> Suppose i have this string: >> z = 'AT/CG' >> >> How do i get this list: >> >> zlist = ['A','T/C','G'] >> >> >> _______________________________________________ >> 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: From kpguy1975 at gmail.com Thu Aug 5 07:17:09 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Thu, 5 Aug 2010 10:47:09 +0530 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: This works. Thanks. On Thu, Aug 5, 2010 at 10:18 AM, Zachary Collins < recursive.cookie.jar at gmail.com> wrote: > Use an re, like so: > > >>> import re > >>> a = "AB/DE" > >>> [s.group() for s in re.finditer("([A-Z]/[A-Z]|[A-Z])", a)] > ['A', 'B/D', 'E'] > > > 2010/8/5 Brian Rue : > > Naive solution: > > zlist = [z[0], z[1:4], z[4]] > > > > On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: > >> > >> Suppose i have this string: > >> z = 'AT/CG' > >> > >> How do i get this list: > >> > >> zlist = ['A','T/C','G'] > >> > >> > >> _______________________________________________ > >> 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: From mamin at mbasciences.com Thu Aug 5 11:29:04 2010 From: mamin at mbasciences.com (Minesh B. Amin) Date: Thu, 05 Aug 2010 02:29:04 -0700 Subject: [Baypiggies] Complimentary class on SPM.Python Message-ID: <1281000544.3777.36.camel@lusaka> As a follow-up to the well-received talks at BayPIGgies (June + July 2010), MBA Sciences is pleased to announce a complimentary class on SPM.Python scheduled for Monday, August 9 (7PM - 9PM) at the Mountain View Community Center. This class will provide a concise, yet practical, hands-on introduction to techniques for leveraging up to 512 cores when exploiting parallelism using SPM.Python. We'll begin by introducing the notion of parallel management patterns, an approach to decomposing problems when exploiting parallelism, but in a technology and language agnostic manner. Armed with these patterns, we shall review key features of SPM.Python: * pshell suite of parallel shell managers that permit the running of any application in parallel * pinterp suite of parallel python interpreters that permit the running of any (serial) python module in parallel At the end of this informal 2-hour hands-on class, attendees will be able to walk away with actionable tips on the what/why/how to exploit various forms of parallelism using SPM.Python. The complete itinerary of the class may be found at www.mbasciences.com. No parallel programming experience is required. Bring a laptop with a supported Linux distribution to try the exercises, or simply follow along. Space is limited. Please RSVP by sending an email to register at mbasciences.com stating: (a) your name, and (b) your affiliation. Looking forward to seeing one and all! Regards, Minesh -- MBA Sciences, Inc (www.mbasciences.com) Tel #: 650-938-4306 Email: mamin at mbasciences.com From aahz at pythoncraft.com Thu Aug 5 14:47:20 2010 From: aahz at pythoncraft.com (Aahz) Date: Thu, 5 Aug 2010 05:47:20 -0700 Subject: [Baypiggies] BayPIGgies and Open Source (was: Complimentary class on SPM.Python) In-Reply-To: <1281000544.3777.36.camel@lusaka> References: <1281000544.3777.36.camel@lusaka> Message-ID: <20100805124720.GA19812@panix.com> On Thu, Aug 05, 2010, Minesh B. Amin wrote: > > As a follow-up to the well-received talks at BayPIGgies (June + July > 2010), MBA Sciences is pleased to announce a complimentary class on > SPM.Python scheduled for Monday, August 9 (7PM - 9PM) at the Mountain > View Community Center. > -- > MBA Sciences, Inc (www.mbasciences.com) Because I've been too busy to attend BayPIGgies meetings, I didn't pay much attention earlier, but I'm a bit concerned that we devoted two meetings to a single commercial product, especially one that doesn't offer an Open Source license and doesn't list prices on its website. (Let alone my bias against websites that require JavaScript to view them.) Part of the reason I haven't offered to repeat my OSCON talk about the work I'm doing at egnyte.com is because I think that BayPIGgies should have a strong bias in favor of Open Source because Python itself is Open Source. What do other people think? Did people who attended the meetings about SPM feel that they got enough technical value even if they never use SPM? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "....Normal is what cuts off your sixth finger and your tail..." --Siobhan From tony at tcapp.com Thu Aug 5 15:40:12 2010 From: tony at tcapp.com (Tony Cappellini) Date: Thu, 5 Aug 2010 06:40:12 -0700 Subject: [Baypiggies] BayPIGgies and Open Source (was: Complimentary class on SPM.Python) In-Reply-To: <20100805124720.GA19812@panix.com> References: <1281000544.3777.36.camel@lusaka> <20100805124720.GA19812@panix.com> Message-ID: > Part of the reason I haven't offered to repeat my OSCON talk about the > work I'm doing at egnyte.com is because I think that BayPIGgies should > have a strong bias in favor of Open Source because Python itself is Open > Source. -1 > What do other people think? ?Did people who attended the meetings about > SPM feel that they got enough technical value even if they never use SPM? The presentation on SPM was interesting enough for me, even though I don't see an immediate need for it in my day-day work. Whether the topic is Open Source or not should not have any bearing on presentations at BayPiggies. This has never been a requirement in the past, and should not be one now. We are always struggling to get people to do presentations, Any topic with some Python-relevance is just fine with me, adding additional criteria on top of that would make it even more difficult. On that note- I recently became aware of yet another commercial Python Debugger, and have invited this company to do a presentation on this product. Unfortunately, their office in the Bay Area does not have a technical person. Because we were struggling to find presenters recently, I told Jim I would do a presentation on Wing IDE, yet another commercial product. From glen at glenjarvis.com Thu Aug 5 18:01:38 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Thu, 5 Aug 2010 09:01:38 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Vikram, I recognize this domain in many of the questions that have been asked. There are several times where I've thought, "That *so* isn't the most ideal 'Computer Science' way to do something." But, I also recognize that, especially in the Biological world, we have no control how we receive the data and thus, we still have to solve problems like those reviewed. So, I normally don't challenge the base assumption in the question because I know from experience, we don't always get the most ideal inputs to work with. HOWEVER, I do want to challenge this one because I know there's a standard way that this is represented in the Biological community without using three characters for a single base. I recognize your original question of z = 'AT/CG' to mean, In Biological terms, that: "Zee equals the string of three nucleotide bases. The first base is Adenine. The second base is either Thymine or Cytosine. The third base is Guanine." There's a *much* better (and commonly accepted) way to represent this. The way this is traditionally is represented is with the extended genetic alphabet ( http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html). In this case, the middle base would be represented by the letter Y as that means either Thymine or Cytosine. I feel it's much better to represent this as: z = 'AYG' Then, the string will work without any expected manipulations. I would always work with the alphabet and not put the three character string back in as this alphabet is defined and accepted in the community. However, if one wanted to they still could later represent this in a 'lookup dictionary' such as follows if the output ever needed to be in a the format in question. lookup = {'R': 'G/A', 'Y': 'T/C', 'M': 'A/C',....} Cheers, Glen On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: > Suppose i have this string: > z = 'AT/CG' > > How do i get this list: > > zlist = ['A','T/C','G'] > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Thu Aug 5 18:33:09 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Thu, 5 Aug 2010 09:33:09 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Although a minor point as the following will work just fine, however, the character class should be [ACGT] instead of [A-Z] as the alphabet for the domain is smaller. (possibly through in a U depending upon the source of the data). Cheers, Glen > Use an re, like so: > >>>> import re >>>> a = "AB/DE" >>>> [s.group() for s in re.finditer("([A-Z]/[A-Z]|[A-Z])", a)] > ['A', 'B/D', 'E'] > > > 2010/8/5 Brian Rue : >> Naive solution: >> zlist = [z[0], z[1:4], z[4]] >> >> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >>> >>> Suppose i have this string: >>> z = 'AT/CG' >>> >>> How do i get this list: >>> >>> zlist = ['A','T/C','G'] >>> >>> >>> _______________________________________________ >>> 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 From jim at well.com Thu Aug 5 20:00:47 2010 From: jim at well.com (jim) Date: Thu, 05 Aug 2010 11:00:47 -0700 Subject: [Baypiggies] BayPIGgies and Open Source (was: Complimentary class on SPM.Python) In-Reply-To: References: <1281000544.3777.36.camel@lusaka> <20100805124720.GA19812@panix.com> Message-ID: <1281031247.1987.65.camel@jim-laptop> great thanks to aahz for raising the topic. tony's response seems dead on right. the following is my attempt briefly to explain how i approach the job of getting and coordinating speakers for baypiggies, respond to aahz comment re Minesh's two talks, and present a plea for help. i worry about the direction of the baypiggies group in that i want it to persist. technical groups seem to have "seasons" in which attendance and character of focus changes. Our change of venue from Google to Symantec (thanks to tony and symantec) preceded a drop in attendance. The recent appearance of other groups that focus on Python (mainly in San Francisco) seems to coincide with a drop in attendance (with respect to average attendance at the google campus meetings). the point: i've stepped up my efforts a little bit to excite baypiggies activities. myself, i'm close to virulent in my support of free, libre, open source stuff. as baypiggies' speaker-getter/coordinator i lean strongly toward floss topics. i am not opposed to commercial efforts. getting speakers for main topics as well as newbie nuggets is a struggle. i make an effort to get speakers. a few members, notably tony and jj, have recruited speakers. i exercise no filtering on their efforts; my job is to let everyone know of dates open and help out by making sure no one books a conflicting date. as to my own efforts to get speakers, my criteria include * free, libre (liberty vs no-cost), open source * interesting and timely technical issues * inclusion of python code examples in the presentation * speaker has reasonable presentation abilities (low bar) * reasonable expectation that the topic and/or speaker will positively affect baypiggies. re my efforts, i offer to help speakers tune their presentations; i'm open to supporting speakers other baypiggies members recruit, but i don't usually offer ("stick my nose in"). probably worth noting: i've learned that i am the default meeting moderator. my policy is that the person who recruits the speaker should be the meeting moderator. i believe the meeting moderator should be low-key: someone to move the meeting through its phases--it's the speakers who should be the focus of attention. i'm open to any discussion, suggestions, changes, opposition... to the above general approach. as to the specifics of Minesh's two presentations: * the topic seems large in scope and important: that the difficulty of getting speakers led me to suggest to Minesh that he make two talks, one general to the topic and the other specific to his efforts. * i encouraged him to participate in the BayPIGgies mailing list discussion, to provide access to his product, and to promote the free class he's recently advertised. * i believed that the topic and Minesh's efforts met the criteria i use (above) and would have a positive effect on baypiggies mailing list and attendance. note that i view aahz' comment as a positive result (any discussion is good discussion). looking back, the two talks look successful. if you've read this far, you're likely interested in the baypiggies group. please help get speakers for newbie nuggets and primary topics, please talk up baypiggies to the greater technical community, and please contribute to the baypiggies mailing list. (and remember, the focus is python and related technologies with as little as possible focus on administrative meta-issues.) helping to get speakers can be as simple as noting topics for which you'd like a presentation: what recent developments in Python pique your interest? On Thu, 2010-08-05 at 06:40 -0700, Tony Cappellini wrote: > > Part of the reason I haven't offered to repeat my OSCON talk about the > > work I'm doing at egnyte.com is because I think that BayPIGgies should > > have a strong bias in favor of Open Source because Python itself is Open > > Source. > > -1 > > > What do other people think? Did people who attended the meetings about > > SPM feel that they got enough technical value even if they never use SPM? > > The presentation on SPM was interesting enough for me, even though I > don't see an immediate need for it in my day-day work. > > Whether the topic is Open Source or not should not have any bearing on > presentations at BayPiggies. > This has never been a requirement in the past, and should not be one now. > > We are always struggling to get people to do presentations, > > Any topic with some Python-relevance is just fine with me, adding > additional criteria on top of that > would make it even more difficult. > > On that note- I recently became aware of yet another commercial Python > Debugger, and have invited this company to do > a presentation on this product. Unfortunately, their office in the Bay > Area does not have a technical person. > > Because we were struggling to find presenters recently, I told Jim I > would do a presentation on Wing IDE, > yet another commercial product. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From jwilliams at pictopia.com Thu Aug 5 20:17:43 2010 From: jwilliams at pictopia.com (James Williams) Date: Thu, 5 Aug 2010 11:17:43 -0700 Subject: [Baypiggies] Back-end Perl/Python Developer Message-ID: <48181B27-EB34-4042-B19C-2B636C383577@pictopia.com> Position: Back-end Developer Description: Pictopia.com is looking for an additional full-time engineer to help maintain and evolve our ecommerce and photo fulfillment systems. You will primarily be working with Perl, Python, and MySQL, but knowledge of many other technologies is useful. Operations span image production, transaction processing, database management, system administration and a host of other tasks. Responsibilities: ? Application changes ? Develop tools to better support Account Executives, Customer Service, and other developers ? Create/utilize tools to monitor system and application processes ? Assist with Linux, Apache, and MySQL administration and troubleshooting Required Skills: ? Perl (this may be flexible based on your other proficiencies) ? Python and knowledge of a Python-based MVC framework (optimally Django 1.x) ? MySQL ? 2 years minimum real world experience engineering web solutions for LAMP stacks ? Practical experience developing in a *nix environment ? Strong verbal, written, analytical and communication skills Additional skills: ? XSLT ? XML ? Javascript ? Experience with Apache configuration ? Linux system administration ? Database administration (preferably MySQL) This is a high-visibility position within a very small team, and the ideal candidate will be a dedicated, hands on professional who can take ownership of tasks with minimal oversight. We value positive attitudes and professionals who can successfully navigate through ambiguous and challenging situations. Candidates are required to be on- site in our Emeryville offices, as there is a high degree of interaction between all parts of the business. We offer an exciting and unique opportunity for the ambitious developer who wants to play a large part in one of the net?s next e- commerce sensations! TO APPLY: email resume and cover letter to hr6 {@} pictopia.com. No recruiters or phone calls please. From mamin at mbasciences.com Thu Aug 5 20:29:55 2010 From: mamin at mbasciences.com (Minesh B. Amin) Date: Thu, 05 Aug 2010 11:29:55 -0700 Subject: [Baypiggies] BayPIGgies and Open Source (was: Complimentary class on SPM.Python) In-Reply-To: <1281031247.1987.65.camel@jim-laptop> References: <1281000544.3777.36.camel@lusaka> <20100805124720.GA19812@panix.com> <1281031247.1987.65.camel@jim-laptop> Message-ID: <1281032995.2224.13.camel@lusaka> Hi Jim/Tony/Aahz/Folks, You all have raised valid points ... points that I discussed with Jim in the background as he alluded to. Thanks to input from Jim, I have gone out of my way to give presentations with two goals in mind: +) introduce what I believe are very powerful concepts on how to think about issues in this field of parallel software, and +) show how a specific capability goes about solving various aspects so that the whole presentation is grounded in the reality that all of us as software engineers face on a day to day bases; That this presentation is not some pie in the sky approach no what is, at the end of the day, a very sexy topic. Again, thanks for raising valid points. I hope you see what motivated my approach. Cheers! Minesh On Thu, 2010-08-05 at 11:00 -0700, jim wrote: > > great thanks to aahz for raising the topic. tony's > response seems dead on right. > > the following is my attempt briefly to explain how i > approach the job of getting and coordinating speakers > for baypiggies, respond to aahz comment re Minesh's two > talks, and present a plea for help. > > i worry about the direction of the baypiggies group > in that i want it to persist. technical groups seem to > have "seasons" in which attendance and character of > focus changes. Our change of venue from Google to > Symantec (thanks to tony and symantec) preceded a drop > in attendance. The recent appearance of other groups > that focus on Python (mainly in San Francisco) seems to > coincide with a drop in attendance (with respect to > average attendance at the google campus meetings). > the point: i've stepped up my efforts a little bit > to excite baypiggies activities. > > myself, i'm close to virulent in my support of free, > libre, open source stuff. as baypiggies' > speaker-getter/coordinator i lean strongly toward floss > topics. > i am not opposed to commercial efforts. > getting speakers for main topics as well as newbie > nuggets is a struggle. > i make an effort to get speakers. > a few members, notably tony and jj, have recruited > speakers. i exercise no filtering on their efforts; my > job is to let everyone know of dates open and help out > by making sure no one books a conflicting date. > as to my own efforts to get speakers, my criteria > include > * free, libre (liberty vs no-cost), open source > * interesting and timely technical issues > * inclusion of python code examples in the presentation > * speaker has reasonable presentation abilities (low bar) > * reasonable expectation that the topic and/or speaker > will positively affect baypiggies. > re my efforts, i offer to help speakers tune their > presentations; i'm open to supporting speakers other > baypiggies members recruit, but i don't usually offer > ("stick my nose in"). > > probably worth noting: i've learned that i am the > default meeting moderator. my policy is that the person > who recruits the speaker should be the meeting moderator. > i believe the meeting moderator should be low-key: > someone to move the meeting through its phases--it's > the speakers who should be the focus of attention. > > i'm open to any discussion, suggestions, changes, > opposition... to the above general approach. > > as to the specifics of Minesh's two presentations: > * the topic seems large in scope and important: that > the difficulty of getting speakers led me to suggest > to Minesh that he make two talks, one general to the > topic and the other specific to his efforts. > * i encouraged him to participate in the BayPIGgies > mailing list discussion, to provide access to his > product, and to promote the free class he's recently > advertised. > * i believed that the topic and Minesh's efforts met > the criteria i use (above) and would have a positive > effect on baypiggies mailing list and attendance. note > that i view aahz' comment as a positive result (any > discussion is good discussion). > looking back, the two talks look successful. > > if you've read this far, you're likely interested > in the baypiggies group. please help get speakers for > newbie nuggets and primary topics, please talk up > baypiggies to the greater technical community, and > please contribute to the baypiggies mailing list. (and > remember, the focus is python and related technologies > with as little as possible focus on administrative > meta-issues.) > helping to get speakers can be as simple as noting > topics for which you'd like a presentation: what > recent developments in Python pique your interest? > > > > > On Thu, 2010-08-05 at 06:40 -0700, Tony Cappellini wrote: > > > Part of the reason I haven't offered to repeat my OSCON talk about the > > > work I'm doing at egnyte.com is because I think that BayPIGgies should > > > have a strong bias in favor of Open Source because Python itself is Open > > > Source. > > > > -1 > > > > > What do other people think? Did people who attended the meetings about > > > SPM feel that they got enough technical value even if they never use SPM? > > > > The presentation on SPM was interesting enough for me, even though I > > don't see an immediate need for it in my day-day work. > > > > Whether the topic is Open Source or not should not have any bearing on > > presentations at BayPiggies. > > This has never been a requirement in the past, and should not be one now. > > > > We are always struggling to get people to do presentations, > > > > Any topic with some Python-relevance is just fine with me, adding > > additional criteria on top of that > > would make it even more difficult. > > > > On that note- I recently became aware of yet another commercial Python > > Debugger, and have invited this company to do > > a presentation on this product. Unfortunately, their office in the Bay > > Area does not have a technical person. > > > > Because we were struggling to find presenters recently, I told Jim I > > would do a presentation on Wing IDE, > > yet another commercial product. > > _______________________________________________ > > 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 -- MBA Sciences, Inc (www.mbasciences.com) Tel #: 650-938-4306 Email: mamin at mbasciences.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Thu Aug 5 18:47:34 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Thu, 5 Aug 2010 09:47:34 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: <55DE076C-A0B6-4536-85E6-89B6B06720B4@glenjarvis.com> 'Through' should have been 'throw'... Sorry. Glen > Although a minor point as the following will work just fine, however, the character class should be [ACGT] instead of [A-Z] as the alphabet for the domain is smaller. (possibly through in a U depending upon the source of the data). > > Cheers, > > > Glen > > >> Use an re, like so: >> >>>>> import re >>>>> a = "AB/DE" >>>>> [s.group() for s in re.finditer("([A-Z]/[A-Z]|[A-Z])", a)] >> ['A', 'B/D', 'E'] >> >> >> 2010/8/5 Brian Rue : >>> Naive solution: >>> zlist = [z[0], z[1:4], z[4]] >>> >>> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >>>> >>>> Suppose i have this string: >>>> z = 'AT/CG' >>>> >>>> How do i get this list: >>>> >>>> zlist = ['A','T/C','G'] >>>> >>>> >>>> _______________________________________________ >>>> 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 From mikeyp at lahondaresearch.org Fri Aug 6 00:29:18 2010 From: mikeyp at lahondaresearch.org (Michael Pittaro) Date: Thu, 5 Aug 2010 15:29:18 -0700 Subject: [Baypiggies] BayPIGgies and Open Source (was: Complimentary class on SPM.Python) In-Reply-To: <1281032995.2224.13.camel@lusaka> References: <1281000544.3777.36.camel@lusaka> <20100805124720.GA19812@panix.com> <1281031247.1987.65.camel@jim-laptop> <1281032995.2224.13.camel@lusaka> Message-ID: On Thu, Aug 5, 2010 at 5:47 AM, Aahz wrote: > On Thu, Aug 05, 2010, Minesh B. Amin wrote: > > > > As a follow-up to the well-received talks at BayPIGgies (June + July > > 2010), MBA Sciences is pleased to announce a complimentary class on > > SPM.Python scheduled for Monday, August 9 (7PM - 9PM) at the Mountain > > View Community Center. > > -- > > MBA Sciences, Inc (www.mbasciences.com) > > Because I've been too busy to attend BayPIGgies meetings, I didn't pay > much attention earlier, but I'm a bit concerned that we devoted two > meetings to a single commercial product, especially one that doesn't > offer an Open Source license and doesn't list prices on its website. > (Let alone my bias against websites that require JavaScript to view > them.) > > Part of the reason I haven't offered to repeat my OSCON talk about the > work I'm doing at egnyte.com is because I think that BayPIGgies should > have a strong bias in favor of Open Source because Python itself is Open > Source. > > What do other people think? Did people who attended the meetings about > SPM feel that they got enough technical value even if they never use SPM? > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > I definitely lean towards FLOSS topics. I think some commercial software topics are OK, as long as they are relevant to Python developers. Pure product pitches aren't going to cut it for me, and if there's a FLOSS alternative, I'd prefer to hear about that in detail. When I talked about the SnapLogic project back in 2007, my exchanges with Jim on the draft presentation concentrated on Python experiences, not a product pitch (even though the code was GPL.) Minesh did a good job of balancing things, but I would have loved to get into the 'secret sauce' behind the scenes, and proprietary source makes that impossible. Parallelism + Python are an interesting enough topic for me that I was still interested. Glen provided working decorator code, with all the behind the scenes magic, much more useful in day to day work. mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From kpguy1975 at gmail.com Fri Aug 6 06:50:58 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Fri, 6 Aug 2010 10:20:58 +0530 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Hi Glen, thanks for your response. I am afraid i did not present the problem with clarity in my original query. The more generalized query is what if: z = 'ATC/GACTGAGC/TAG' and i want zlist = ['ATC/G','ACT','GAG','C/TAG'] The biology behind this is not as what you have understood. Here is the problem for you and others interested (i am simplying this as much as i can since i dont know your biological background): 'C/G' and 'C/T' are SNPs (single nucleotide polymorphisms, which can be thought of simply as 'change') in a particular genome being studied when compared to the NCBI reference genome. A specific nucleotide (say 'A') is being represented by two alternative nucleotides (say 'A/G') in the genome being investigated. The alternative nucleotides could occur because at that position there is a difference in the coding and complementary DNA strands (think of this as a difference between the paternal and maternal DNA strands at that position). When i take the exon regions of a gene (that are making proteins) in the genome being studied i need to break up the dna string corresponding to the exon region in groups of three to get the codons and then find the corresponding amino acid sequence using the genetic code. In doing this i want something like 'A/G' to be taken as a single character. ['AT/CG'] will be then correspond to two alternative amino acids corresponding to ATC and ATG. [ATG (DNA) corresponds to AUG(mRNA). ] On Thu, Aug 5, 2010 at 9:31 PM, Glen Jarvis wrote: > Vikram, > > I recognize this domain in many of the questions that have been asked. > There are several times where I've thought, "That *so* isn't the most ideal > 'Computer Science' way to do something." But, I also recognize that, > especially in the Biological world, we have no control how we receive the > data and thus, we still have to solve problems like those reviewed. > > So, I normally don't challenge the base assumption in the question > because I know from experience, we don't always get the most ideal inputs to > work with. HOWEVER, I do want to challenge this one because I know there's a > standard way that this is represented in the Biological community without > using three characters for a single base. I recognize your original question > of z = 'AT/CG' to mean, In Biological terms, that: > > "Zee equals the string of three nucleotide bases. The first base is > Adenine. The second base is either Thymine or Cytosine. The third base is > Guanine." > > There's a *much* better (and commonly accepted) way to represent this. > > The way this is traditionally is represented is with the extended > genetic alphabet ( > http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html). In > this case, the middle base would be represented by the letter Y as that > means either Thymine or Cytosine. > > I feel it's much better to represent this as: > > z = 'AYG' > > Then, the string will work without any expected manipulations. I would > always work with the alphabet and not put the three character string back in > as this alphabet is defined and accepted in the community. However, if one > wanted to they still could later represent this in a 'lookup dictionary' > such as follows if the output ever needed to be in a the format in question. > > lookup = {'R': 'G/A', > 'Y': 'T/C', > 'M': 'A/C',....} > > Cheers, > > > Glen > > > On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: > >> Suppose i have this string: >> z = 'AT/CG' >> >> How do i get this list: >> >> zlist = ['A','T/C','G'] >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies >> > > > > -- > Whatever you can do or imagine, begin it; > boldness has beauty, magic, and power in it. > > -- Goethe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recursive.cookie.jar at gmail.com Fri Aug 6 06:59:22 2010 From: recursive.cookie.jar at gmail.com (Zachary Collins) Date: Fri, 6 Aug 2010 13:59:22 +0900 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Speaking of, if you need to break it up into groups of 3's or anything else, you can very easily change the regex I gave to accomodate this or any multitude of possible grammars you can conceive. I gave my solution not as a definite biology solution, but as a "hey, here's the simplest most pythonic way to solve parsing like that" that can be redefined for your domain. So if you want groups of 3 within that grammar, you could try: >>> import re >>> z = "ATC/GACTGAGC/TAG" >>> [s.group() for s in re.finditer("([A-Z]/[A-Z]|[A-Z]){3}", z)] ['ATC/G', 'ACT', 'GAG', 'C/TAG'] And yes, if you want to restrict the domain, you can change A-Z to whatever characters are actually available in the domain. This is just a simple took me 5 seconds approach that gives you the general direction to solving any multitude of parsing string problems you might think of. The Python library loves you :] 2010/8/6 Vikram K : > Hi Glen, > thanks for your response. I am afraid i did not present the problem with > clarity in my original query. The more generalized query is what if: > > z = 'ATC/GACTGAGC/TAG' > > and? i want > zlist = ['ATC/G','ACT','GAG','C/TAG'] > > The biology behind this is not as what you have understood. Here is the > problem for you and others interested (i am simplying this as much as i can > since i dont know your biological background): > 'C/G' and 'C/T' are SNPs (single nucleotide polymorphisms, which can be > thought of simply as 'change') in a particular genome being studied when > compared to the NCBI reference genome. A specific nucleotide (say 'A') is > being represented by two alternative nucleotides (say 'A/G') in the genome > being investigated. The alternative nucleotides could occur because at that > position there is a difference in the coding and complementary DNA strands > (think of this as a difference between the paternal and maternal DNA strands > at that position). > > When i take the exon regions of a gene (that are making proteins)? in the > genome being studied i need to break up the dna string corresponding to the > exon region in groups of? three to get the codons and then find the > corresponding amino acid sequence using the genetic code. In doing this i > want something like 'A/G' to be taken as a single character. ['AT/CG'] will > be then correspond to two alternative amino acids corresponding to ATC and > ATG. [ATG (DNA) corresponds to AUG(mRNA). ] > > On Thu, Aug 5, 2010 at 9:31 PM, Glen Jarvis wrote: >> >> Vikram, >> ?? ?I recognize this domain in many of the questions that have been asked. >> There are several times where I've thought, "That *so* isn't the most ideal >> 'Computer Science' way to do something." But, I also recognize that, >> especially in the Biological world, we have no control how we receive the >> data and thus, we still have to solve problems like those reviewed. >> ?? So, I normally don't challenge the base assumption in the question >> because I know from experience, we don't always get the most ideal inputs to >> work with. HOWEVER, I do want to challenge this one because I know there's a >> standard way that this is represented in the Biological community without >> using three characters for a single base. I recognize your original question >> of?z = 'AT/CG' to?mean, In Biological terms, that: >> "Zee equals the string of three nucleotide bases. The first base is >> Adenine. The second base is either Thymine or Cytosine. The third base is >> Guanine." >> There's a *much* better (and commonly accepted) way to represent this. >> The way this is traditionally is represented is with the extended >> genetic?alphabet?(http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html). >> In this case, the middle base would be represented by the letter Y as that >> means either Thymine or Cytosine. >> I feel it's much better to represent this as: >> z = 'AYG' >> Then, the string will work without any expected manipulations. I would >> always work with the alphabet and not put the three character string back in >> as this alphabet is defined and accepted in the community. However, if one >> wanted to they still could later represent this in a 'lookup dictionary' >> such as follows if the output ever needed to be in a the format in question. >> lookup = {'R': 'G/A', >> ?? ? ? ? ? ? ?'Y': 'T/C', >> ?? ? ? ? ? ? ?'M': 'A/C',....} >> Cheers, >> >> Glen >> >> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >>> >>> Suppose i have this string: >>> z = 'AT/CG' >>> >>> How do i get this list: >>> >>> zlist = ['A','T/C','G'] >>> >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> http://mail.python.org/mailman/listinfo/baypiggies >> >> >> >> -- >> Whatever you can do or imagine, begin it; >> boldness has beauty, magic, and power in it. >> >> -- Goethe > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From glen at glenjarvis.com Fri Aug 6 07:44:01 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Thu, 5 Aug 2010 22:44:01 -0700 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Vikram, Thank you for this. I really appreciate it. I didn't catch that this was SNP data. And, I do see snip data represented as, for example, 'C/G'. I see the IUPAC extended genetic alphabet used when we are uncertain in DNA modeling. For example, if I was to see 'ACGRC', I would know that this means either 'ACGGC' or 'ACGAC'. Since R has this built-in meaning, according to this extended genetic alphabet: Symbol Meaning G G A A T T C C R G or A Y T or C M A or C K G or T S G or C W A or T H A, C or T B G, T or C V G, C or A D G, A or T N any of the four bases With that said, I don't see SNP data represented this way. I don't yet undertand why not. I don't see how this symbology can be used for data that I see in FASTA files, but not in SNPs. From a computer science perspective, it makes much more sense to me to store this in an 'already tokenized form where the tokens are easy to parse' (that is, each letter in a string representing a token already). Using your previous example, you want to represent 'A/G' as a single character. That is 'R' as defined by the IUPAC extended genetic alphabet. Thus, string 'ARG' maps to codon AUG(mRNA) and thus to a Methionine residue. For what it's worth, I work at a phylogenomic lab at UC Berkeley and we deal with proteins instead of DNA. So, I may be missing something. Our mapping (our amino acid symbol of X for any amino acid, or B for either Asparagine or aspartic acid, for example) is similar. I totally don't get how to read SNPs, so, I admit, I could be missing something big. I'm very curious why the IUPAC extended genetic alphabet is not applicable to the relevant portions of SNPs. Do you know why this is the case? Could you explain what I'm missing on why this couldn't be represented this way? Cheers, Glen On Thu, Aug 5, 2010 at 9:50 PM, Vikram K wrote: > Hi Glen, > thanks for your response. I am afraid i did not present the problem with > clarity in my original query. The more generalized query is what if: > > z = 'ATC/GACTGAGC/TAG' > > and i want > zlist = ['ATC/G','ACT','GAG','C/TAG'] > > The biology behind this is not as what you have understood. Here is the > problem for you and others interested (i am simplying this as much as i can > since i dont know your biological background): > 'C/G' and 'C/T' are SNPs (single nucleotide polymorphisms, which can be > thought of simply as 'change') in a particular genome being studied when > compared to the NCBI reference genome. A specific nucleotide (say 'A') is > being represented by two alternative nucleotides (say 'A/G') in the genome > being investigated. The alternative nucleotides could occur because at that > position there is a difference in the coding and complementary DNA strands > (think of this as a difference between the paternal and maternal DNA strands > at that position). > > When i take the exon regions of a gene (that are making proteins) in the > genome being studied i need to break up the dna string corresponding to the > exon region in groups of three to get the codons and then find the > corresponding amino acid sequence using the genetic code. In doing this i > want something like 'A/G' to be taken as a single character. ['AT/CG'] will > be then correspond to two alternative amino acids corresponding to ATC and > ATG. [ATG (DNA) corresponds to AUG(mRNA). ] > > On Thu, Aug 5, 2010 at 9:31 PM, Glen Jarvis wrote: > >> Vikram, >> >> I recognize this domain in many of the questions that have been asked. >> There are several times where I've thought, "That *so* isn't the most ideal >> 'Computer Science' way to do something." But, I also recognize that, >> especially in the Biological world, we have no control how we receive the >> data and thus, we still have to solve problems like those reviewed. >> >> So, I normally don't challenge the base assumption in the question >> because I know from experience, we don't always get the most ideal inputs to >> work with. HOWEVER, I do want to challenge this one because I know there's a >> standard way that this is represented in the Biological community without >> using three characters for a single base. I recognize your original question >> of z = 'AT/CG' to mean, In Biological terms, that: >> >> "Zee equals the string of three nucleotide bases. The first base is >> Adenine. The second base is either Thymine or Cytosine. The third base is >> Guanine." >> >> There's a *much* better (and commonly accepted) way to represent this. >> >> The way this is traditionally is represented is with the extended >> genetic alphabet ( >> http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html). In >> this case, the middle base would be represented by the letter Y as that >> means either Thymine or Cytosine. >> >> I feel it's much better to represent this as: >> >> z = 'AYG' >> >> Then, the string will work without any expected manipulations. I would >> always work with the alphabet and not put the three character string back in >> as this alphabet is defined and accepted in the community. However, if one >> wanted to they still could later represent this in a 'lookup dictionary' >> such as follows if the output ever needed to be in a the format in question. >> >> lookup = {'R': 'G/A', >> 'Y': 'T/C', >> 'M': 'A/C',....} >> >> Cheers, >> >> >> Glen >> >> >> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >> >>> Suppose i have this string: >>> z = 'AT/CG' >>> >>> How do i get this list: >>> >>> zlist = ['A','T/C','G'] >>> >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> http://mail.python.org/mailman/listinfo/baypiggies >>> >> >> >> >> -- >> Whatever you can do or imagine, begin it; >> boldness has beauty, magic, and power in it. >> >> -- Goethe >> > > -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From kpguy1975 at gmail.com Fri Aug 6 08:48:31 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Fri, 6 Aug 2010 12:18:31 +0530 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: Because if you represent a SNP with a single character you would not be able to distinguish between homozygous and heterozygous SNPs. On Fri, Aug 6, 2010 at 11:14 AM, Glen Jarvis wrote: > Vikram, > > Thank you for this. I really appreciate it. I didn't catch that this > was SNP data. And, I do see snip data represented as, for example, 'C/G'. > > I see the IUPAC extended genetic alphabet used when we are uncertain in > DNA modeling. For example, if I was to see 'ACGRC', I would know that this > means either 'ACGGC' or 'ACGAC'. Since R has this built-in meaning, > according to this extended genetic alphabet: > > Symbol Meaning > G G > A A > T T > C C > R G or A > Y T or C > M A or C > K G or T > S G or C > W A or T > H A, C or T > B G, T or C > V G, C or A > D G, A or T > N any of the four bases > > With that said, I don't see SNP data represented this way. I don't yet > undertand why not. I don't see how this symbology can be used for data that > I see in FASTA files, but not in SNPs. > > From a computer science perspective, it makes much more sense to me to > store this in an 'already tokenized form where the tokens are easy to parse' > (that is, each letter in a string representing a token already). > > Using your previous example, you want to represent 'A/G' as a single > character. That is 'R' as defined by the IUPAC extended genetic alphabet. > Thus, string 'ARG' maps to codon AUG(mRNA) and thus to a Methionine residue. > > For what it's worth, I work at a phylogenomic lab at UC Berkeley and we > deal with proteins instead of DNA. So, I may be missing something. Our > mapping (our amino acid symbol of X for any amino acid, or B for > either Asparagine or aspartic acid, for example) is similar. I totally don't > get how to read SNPs, so, I admit, I could be missing something big. > > I'm very curious why the IUPAC extended genetic alphabet is not > applicable to the relevant portions of SNPs. Do you know why this is the > case? Could you explain what I'm missing on why this couldn't be represented > this way? > > > Cheers, > > > Glen > > On Thu, Aug 5, 2010 at 9:50 PM, Vikram K wrote: > >> Hi Glen, >> thanks for your response. I am afraid i did not present the problem with >> clarity in my original query. The more generalized query is what if: >> >> z = 'ATC/GACTGAGC/TAG' >> >> and i want >> zlist = ['ATC/G','ACT','GAG','C/TAG'] >> >> The biology behind this is not as what you have understood. Here is the >> problem for you and others interested (i am simplying this as much as i can >> since i dont know your biological background): >> 'C/G' and 'C/T' are SNPs (single nucleotide polymorphisms, which can be >> thought of simply as 'change') in a particular genome being studied when >> compared to the NCBI reference genome. A specific nucleotide (say 'A') is >> being represented by two alternative nucleotides (say 'A/G') in the genome >> being investigated. The alternative nucleotides could occur because at that >> position there is a difference in the coding and complementary DNA strands >> (think of this as a difference between the paternal and maternal DNA strands >> at that position). >> >> When i take the exon regions of a gene (that are making proteins) in the >> genome being studied i need to break up the dna string corresponding to the >> exon region in groups of three to get the codons and then find the >> corresponding amino acid sequence using the genetic code. In doing this i >> want something like 'A/G' to be taken as a single character. ['AT/CG'] will >> be then correspond to two alternative amino acids corresponding to ATC and >> ATG. [ATG (DNA) corresponds to AUG(mRNA). ] >> >> On Thu, Aug 5, 2010 at 9:31 PM, Glen Jarvis wrote: >> >>> Vikram, >>> >>> I recognize this domain in many of the questions that have been >>> asked. There are several times where I've thought, "That *so* isn't the most >>> ideal 'Computer Science' way to do something." But, I also recognize that, >>> especially in the Biological world, we have no control how we receive the >>> data and thus, we still have to solve problems like those reviewed. >>> >>> So, I normally don't challenge the base assumption in the question >>> because I know from experience, we don't always get the most ideal inputs to >>> work with. HOWEVER, I do want to challenge this one because I know there's a >>> standard way that this is represented in the Biological community without >>> using three characters for a single base. I recognize your original question >>> of z = 'AT/CG' to mean, In Biological terms, that: >>> >>> "Zee equals the string of three nucleotide bases. The first base is >>> Adenine. The second base is either Thymine or Cytosine. The third base is >>> Guanine." >>> >>> There's a *much* better (and commonly accepted) way to represent this. >>> >>> The way this is traditionally is represented is with the extended >>> genetic alphabet ( >>> http://www.hrbc-genomics.net/training/bcd/Curric/PrwAli/node7.html). In >>> this case, the middle base would be represented by the letter Y as that >>> means either Thymine or Cytosine. >>> >>> I feel it's much better to represent this as: >>> >>> z = 'AYG' >>> >>> Then, the string will work without any expected manipulations. I would >>> always work with the alphabet and not put the three character string back in >>> as this alphabet is defined and accepted in the community. However, if one >>> wanted to they still could later represent this in a 'lookup dictionary' >>> such as follows if the output ever needed to be in a the format in question. >>> >>> lookup = {'R': 'G/A', >>> 'Y': 'T/C', >>> 'M': 'A/C',....} >>> >>> Cheers, >>> >>> >>> Glen >>> >>> >>> On Wed, Aug 4, 2010 at 9:37 PM, Vikram K wrote: >>> >>>> Suppose i have this string: >>>> z = 'AT/CG' >>>> >>>> How do i get this list: >>>> >>>> zlist = ['A','T/C','G'] >>>> >>>> >>>> _______________________________________________ >>>> Baypiggies mailing list >>>> Baypiggies at python.org >>>> To change your subscription options or unsubscribe: >>>> http://mail.python.org/mailman/listinfo/baypiggies >>>> >>> >>> >>> >>> -- >>> Whatever you can do or imagine, begin it; >>> boldness has beauty, magic, and power in it. >>> >>> -- Goethe >>> >> >> > > > -- > Whatever you can do or imagine, begin it; > boldness has beauty, magic, and power in it. > > -- Goethe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kpguy1975 at gmail.com Fri Aug 6 09:11:29 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Fri, 6 Aug 2010 12:41:29 +0530 Subject: [Baypiggies] string to list question In-Reply-To: References: Message-ID: thought a bit more about this and i have a further comment to make. The genome data files i am working with are representing a SNP in the A/T or A/G or C/G, etc. form. Makes more sense *not* to convert a T/C to Y because eventually i really want the amino acid and i would finally want AT/CG to be converted into ATG and ACG and convert ATG and ACG into the two corresponding amino acids using the genetic code. On Fri, Aug 6, 2010 at 12:18 PM, Vikram K wrote: > Because if you represent a SNP with a single character you would not be > able to distinguish between homozygous and heterozygous SNPs. > > On Fri, Aug 6, 2010 at 11:14 AM, Glen Jarvis wrote: > >> Vikram, >> >> Thank you for this. I really appreciate it. I didn't catch that this >> was SNP data. And, I do see snip data represented as, for example, 'C/G'. >> >> I see the IUPAC extended genetic alphabet used when we are uncertain >> in DNA modeling. For example, if I was to see 'ACGRC', I would know that >> this means either 'ACGGC' or 'ACGAC'. Since R has this built-in meaning, >> according to this extended genetic alphabet: >> >> Symbol Meaning >> G G >> A A >> T T >> C C >> R G or A >> Y T or C >> M A or C >> K G or T >> S G or C >> W A or T >> H A, C or T >> B G, T or C >> V G, C or A >> D G, A or T >> N any of the four bases >> >> With that said, I don't see SNP data represented this way. I don't yet >> undertand why not. I don't see how this symbology can be used for data that >> I see in FASTA files, but not in SNPs. >> >> From a computer science perspective, it makes much more sense to me to >> store this in an 'already tokenized form where the tokens are easy to parse' >> (that is, each letter in a string representing a token already). >> >> Using your previous example, you want to represent 'A/G' as a single >> character. That is 'R' as defined by the IUPAC extended genetic alphabet. >> Thus, string 'ARG' maps to codon AUG(mRNA) and thus to a Methionine residue. >> >> For what it's worth, I work at a phylogenomic lab at UC Berkeley and >> we deal with proteins instead of DNA. So, I may be missing something. Our >> mapping (our amino acid symbol of X for any amino acid, or B for >> either Asparagine or aspartic acid, for example) is similar. I totally don't >> get how to read SNPs, so, I admit, I could be missing something big. >> >> I'm very curious why the IUPAC extended genetic alphabet is not >> applicable to the relevant portions of SNPs. Do you know why this is the >> case? Could you explain what I'm missing on why this couldn't be represented >> this way? >> >> >> Cheers, >> >> >> Glen >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From Donald at damagents.com Fri Aug 6 20:27:30 2010 From: Donald at damagents.com (Donald James) Date: Fri, 6 Aug 2010 11:27:30 -0700 Subject: [Baypiggies] Front-End Python/Django Web Developer role in Menlo Park Message-ID: Hello, all; I wanted to reach out to the list regarding a full-time Front-End Web Development role that I have with a stealth-mode startup that is looking to change the way that people are protected online. They're well & recently funded, and have a small core group in place, so this is very good time to get in at the ground-floor level, and really help drive the direction of the company's future. With regards to the position itself, the candidate would participate in the selection of development tools, design and implementation of the presentation layer, in addition to some back-end integration work. The ideal candidate would need to have experience with Django/Python, in addition to HTML, CSS, Javascript (using one or more Javascript framework) and AJAX. Since they're still in stealth-mode, I can't say much else regarding what they're working on without an NDA, although one of the components of the UI is based on social gaming/game mechanics, so candidates that have experience with Facebook platforms or social gaming is a HUGE plus. This is NOT an "equity-only" position, and the salary range for this role may top out at around $115K-$120K or so, although it's dependent upon the candidate in question. I've got a great relationship with the Founder, so this is not just a position where a recruiter is "putting bodies over the fence and hoping something sticks." They're looking to get someone on board very quickly, so if this position sounds interesting to you, please feel free to respond to me directly, and I'll answer any questions that you may have. Thanks, everyone. -Donald Donald James Recruiter www.digitalartistmanagement.com www.linkedin.com/in/dkjames www.twitter.com/dam_agents -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 4390 bytes Desc: image001.gif URL: From aahz at pythoncraft.com Sun Aug 8 00:04:56 2010 From: aahz at pythoncraft.com (Aahz) Date: Sat, 7 Aug 2010 15:04:56 -0700 Subject: [Baypiggies] Death of IronPython? Message-ID: <20100807220456.GA23609@panix.com> http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "...if I were on life-support, I'd rather have it run by a Gameboy than a Windows box." --Cliff Wells From keith at dartworks.biz Sun Aug 8 20:34:04 2010 From: keith at dartworks.biz (Keith Dart) Date: Sun, 8 Aug 2010 11:34:04 -0700 Subject: [Baypiggies] Death of IronPython? In-Reply-To: <20100807220456.GA23609@panix.com> References: <20100807220456.GA23609@panix.com> Message-ID: <20100808113404.042165f1@dartworks.biz> === On Sat, 08/07, Aahz wrote: === > http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html === Interesting blog. But it was more about IronRuby than IronPython. I liked the idea of the DLR and IronPython. Interesting internal perspective. But I read that as more evidence of the demise of Microsoft itself. -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From DennisR at dair.com Sun Aug 8 20:46:40 2010 From: DennisR at dair.com (Dennis Reinhardt) Date: Sun, 08 Aug 2010 11:46:40 -0700 Subject: [Baypiggies] Death of IronPython? In-Reply-To: <20100807220456.GA23609@panix.com> References: <20100807220456.GA23609@panix.com> Message-ID: <20100808190101.67577EE9AE@mail.python.org> At 03:04 PM 8/7/2010, you wrote: >http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html A shame but only after a fashion. I tried Iron Python + Visual Studio. The promise of this combo to me is that GUI interfaces could be created visually and then implemented by Python code. Well, yes, ok. But the class implementing the GUI was effectively STATIC. I could not define class variables or methods. IIRC, the static limitation ruled out spawning worker threads that were dynamic. I stopped looking at Iron Python about a year ago. I also gave up on Visual Studio at the same time. C Python works just fine and without dynamic Visual Studio integration, I didn't see any advantage to Iron Python. I understand that running under the .NET CLR is a difference over native Windows API via ctypes. For me, that difference is not an advantage but merely a difference. Dennis --------------------------------- | Dennis | DennisR at dair.com | | Reinhardt | http://www.dair.com | --------------------------------- From nstinemates at gmail.com Sun Aug 8 21:27:56 2010 From: nstinemates at gmail.com (Nick Stinemates) Date: Sun, 8 Aug 2010 12:27:56 -0700 Subject: [Baypiggies] Hi again Message-ID: It's been a while and I have only posted a few times. I want to re-introduce myself. My name is Nick Stinemates, 25 years old, married +2kids (2 and 3.) I've been hacking on python apps for a couple of years and use it in my daily work. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Mon Aug 9 00:00:47 2010 From: aleax at google.com (Alex Martelli) Date: Sun, 8 Aug 2010 15:00:47 -0700 Subject: [Baypiggies] Death of IronPython? In-Reply-To: <20100808190101.67577EE9AE@mail.python.org> References: <20100807220456.GA23609@panix.com> <20100808190101.67577EE9AE@mail.python.org> Message-ID: On Sun, Aug 8, 2010 at 11:46 AM, Dennis Reinhardt wrote: > At 03:04 PM 8/7/2010, you wrote: >> >> >> http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html > > A shame but only after a fashion. ?I tried Iron Python + Visual Studio. ?The > promise of this combo to me is that GUI interfaces could be created visually > and then implemented by Python code. This can be done, cross-platform, with Qt (though I don't know of an IDE that supports both Qt visual GUI design and Python development -- but then I'm NOT an IDE person, so the fact that I don't know of one doesn't mean there aren't several;-)... and with PySide you now have a pretty liberal OS license on your work (PyQt itself is still "GPL or pay"). I'd be surprised if by now PyGtk and wxPython weren't at feature parity with Qt on this subject. Alex From aahz at pythoncraft.com Mon Aug 9 17:33:39 2010 From: aahz at pythoncraft.com (Aahz) Date: Mon, 9 Aug 2010 08:33:39 -0700 Subject: [Baypiggies] Pre-interview quiz Message-ID: <20100809153339.GA29526@panix.com> >From a just-posted job ad on python.org, seems reasonable to me (though not the style I'd use if I were recruiting): http://mouthwateringmedia.com/smarty-pants-tester/ -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "...if I were on life-support, I'd rather have it run by a Gameboy than a Windows box." --Cliff Wells From nstinemates at gmail.com Mon Aug 9 18:01:30 2010 From: nstinemates at gmail.com (Nick Stinemates) Date: Mon, 9 Aug 2010 09:01:30 -0700 Subject: [Baypiggies] Pre-interview quiz In-Reply-To: <20100809153339.GA29526@panix.com> References: <20100809153339.GA29526@panix.com> Message-ID: Question 4 is a little ridiculous and lacking a lot of information. The real question they're getting at is: *How do you make sure your app performs under load?* * * *Probably bonus points if you know the difference between Performance/Scalability.* * * * * On Mon, Aug 9, 2010 at 8:33 AM, Aahz wrote: > >From a just-posted job ad on python.org, seems reasonable to me (though > not the style I'd use if I were recruiting): > > http://mouthwateringmedia.com/smarty-pants-tester/ > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > "...if I were on life-support, I'd rather have it run by a Gameboy than a > Windows box." --Cliff Wells > _______________________________________________ > 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: From Chris.Clark at ingres.com Mon Aug 9 21:31:43 2010 From: Chris.Clark at ingres.com (Chris Clark) Date: Mon, 09 Aug 2010 12:31:43 -0700 Subject: [Baypiggies] Qt and Python - was Re: Death of IronPython? In-Reply-To: References: <20100807220456.GA23609@panix.com> <20100808190101.67577EE9AE@mail.python.org> Message-ID: <4C60579F.9080502@ingres.com> Alex Martelli wrote: > On Sun, Aug 8, 2010 at 11:46 AM, Dennis Reinhardt wrote: > >> At 03:04 PM 8/7/2010, you wrote: >> >>> http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html >>> >> A shame but only after a fashion. I tried Iron Python + Visual Studio. The >> promise of this combo to me is that GUI interfaces could be created visually >> and then implemented by Python code. >> > > This can be done, cross-platform, with Qt (though I don't know of an > IDE that supports both Qt visual GUI design and Python development -- > but then I'm NOT an IDE person, so the fact that I don't know of one > doesn't mean there aren't several;-)... and with PySide you now have a > pretty liberal OS license on your work (PyQt itself is still "GPL or > pay"). I'd be surprised if by now PyGtk and wxPython weren't at > feature parity with Qt on this subject. > RE QT, I personally think PyQT will gradually die.... replaced by PySide (lgpl). I've not yet tried to use it in anger yet, so I'm not sure if it is usable yet but if you are a QT/Python user I'd seriously consider PySide for future projects. http://www.pyside.org/ for more information. Chris From andrew at atoulou.se Mon Aug 9 22:48:05 2010 From: andrew at atoulou.se (Andrew Akira Toulouse) Date: Mon, 9 Aug 2010 13:48:05 -0700 Subject: [Baypiggies] Qt and Python - was Re: Death of IronPython? In-Reply-To: <4C60579F.9080502@ingres.com> References: <20100807220456.GA23609@panix.com> <20100808190101.67577EE9AE@mail.python.org> <4C60579F.9080502@ingres.com> Message-ID: (OT) I've never understood why they didn't call it QtPy. It's much catchier. On Mon, Aug 9, 2010 at 12:31 PM, Chris Clark wrote: > Alex Martelli wrote: >> >> On Sun, Aug 8, 2010 at 11:46 AM, Dennis Reinhardt >> wrote: >> >>> >>> At 03:04 PM 8/7/2010, you wrote: >>> >>>> >>>> >>>> http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html >>>> >>> >>> A shame but only after a fashion. ?I tried Iron Python + Visual Studio. >>> ?The >>> promise of this combo to me is that GUI interfaces could be created >>> visually >>> and then implemented by Python code. >>> >> >> This can be done, cross-platform, with Qt (though I don't know of an >> IDE that supports both Qt visual GUI design and Python development -- >> but then I'm NOT an IDE person, so the fact that I don't know of one >> doesn't mean there aren't several;-)... and with PySide you now have a >> pretty liberal OS license on your work (PyQt itself is still "GPL or >> pay"). ?I'd be surprised if by now PyGtk and wxPython weren't at >> feature parity with Qt on this subject. >> > > RE QT, I personally think PyQT will gradually die.... replaced by PySide > (lgpl). I've not yet tried to use it in anger yet, so I'm not sure if it is > usable yet but if you are a QT/Python user I'd seriously consider PySide for > future projects. http://www.pyside.org/ for more information. > > Chris > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From seth at lolapps.com Tue Aug 10 02:30:39 2010 From: seth at lolapps.com (Seth Dawson) Date: Mon, 9 Aug 2010 17:30:39 -0700 Subject: [Baypiggies] Lead Performance Engineer at Lolapps, Inc Message-ID: Hey There! We are looking for a Performance Lead to join our growing team here at Lolapps, Inc, a social games and apps start-up in San Francisco. It's a fun, smart team and we really do LOL around here! Please email me if you are interested at seth at lolapps.com. -Seth Performance Engineer (Lead) We're looking for a seasoned performance engineer. You know the thrill and the terror of an unexpected traffic storm that's railed your application. You think on your feet, adapt and make a genius patch that let's your servers hold to see out the storm, then hit the whiteboard to start architecting a solution that will handle the next storm with ease. You'll get to: * Work in an innovative space that is expanding into a billion dollar industry. * Design and implement large chunks of scalability features. * Help make key infrastructure decisions (databases, replication layouts, caching solutions, etc.). * Experiment with the newest emerging open-source technologies. * Test your ideas and strategies out on millions of users and enormous data sets. * Head up a small team of experienced engineers (if you are willing and able). * Have fun. Play ping pong, foosball, video games. * Eat. We buy your lunches. Ideally, you: * Love python and can code it in your sleep. * Working knowledge of Linux, scripting, and SQL. * Understand when MySQL is great and experiment with NoSQL solutions (Memcached/Mongo/Redis/Cassandra) * Know how to put together a web-application stack. (We use Pylons/Paste.) * Enjoy bouncing ideas of your teammates to build up solutions no one person could of thought up him or herself. * Care about your implementations and find yourself compulsively checking that your latest experimental deploy is working the way you thought it would. -- Seth Dawson Senior Technical Recruiter LOLApps 116 New Montgomery St. 7th floor San Francisco, CA 94105 C: 415 515 2654 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryceverdier at gmail.com Tue Aug 10 02:39:21 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Mon, 09 Aug 2010 17:39:21 -0700 Subject: [Baypiggies] Death of IronPython? In-Reply-To: References: <20100807220456.GA23609@panix.com> <20100808190101.67577EE9AE@mail.python.org> Message-ID: <4C609FB9.4090505@gmail.com> Recently I was running around Stackoverflow, and hit across a question similar to this (off) topic discussion. Long story short, it linked to the eric IDE, which does integrated qt-designer with PyQT. The cool part is that it uses these technologies itself. http://eric-ide.python-projects.org/ Besides that, it seems like its a pretty nice IDE. I'm trying it out now and liking it so far. Bryce On 08/08/2010 03:00 PM, Alex Martelli wrote: > On Sun, Aug 8, 2010 at 11:46 AM, Dennis Reinhardt wrote: > >> At 03:04 PM 8/7/2010, you wrote: >> >>> >>> http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html >>> >> A shame but only after a fashion. I tried Iron Python + Visual Studio. The >> promise of this combo to me is that GUI interfaces could be created visually >> and then implemented by Python code. >> > This can be done, cross-platform, with Qt (though I don't know of an > IDE that supports both Qt visual GUI design and Python development -- > but then I'm NOT an IDE person, so the fact that I don't know of one > doesn't mean there aren't several;-)... and with PySide you now have a > pretty liberal OS license on your work (PyQt itself is still "GPL or > pay"). I'd be surprised if by now PyGtk and wxPython weren't at > feature parity with Qt on this subject. > > > Alex > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From glen at glenjarvis.com Wed Aug 11 19:14:15 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Wed, 11 Aug 2010 10:14:15 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas Message-ID: Does anyone have any Pyjamas skills? It's a python to javascript compiler apparently. If you do, would you want to talk about it sometime? If so talk to Jim. If you don't know Pyjamas, do you know someone who does? I'd like to see a talk on it, personally... and know zip outside what I said in this email.. Cheers, Glen -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Wed Aug 11 20:01:40 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Wed, 11 Aug 2010 11:01:40 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas/Extended thread Message-ID: For that matter, I would be interested in any/all of these as a quick talk. This way I can decide if I want to learn more about them. This lifted from Moshir Mikael's posting nin Linked-In Open Source Group posting: To take the most of value out of this discussion, I'm listing some interesting Python projects that tend to bring front end to Python (or Python to frontend): 1) Luban ( http://docs.danse.us/pyre/luban/sphinx/ ) sophisticated and young UI framework, willing to unify UI programming, still have to demonstrate that it plays well with web frameworks 2) pyjamas ( http://pyjs.org/ ) : a port of gwt, very smart, with will to unify ui programming like Luban, but not too supported like this discussion shows ;) , pyjamas may be hard to extend for newbies 3) pyvascript ( http://www.allbuttonspressed.com/blog/django/2010/07/PyvaScript-Pythonic-syntax-for-your-browser ) : a python inspired langage for the browser, playing well with other javascript framework (especially jquery) 4) toscawidgets ( http://toscawidgets.org/ ) : a patchwork of various, rather incomplete javascript frameworks wrappers, built on top of turbogears -- latest news 2008 5) mochikit :( http://mochikit.com/ ) : a javascript framework inspired from python 6) coffeescript ( http://jashkenas.github.com/coffee-script/ ) : funny initiative to make javascript look like Python, early development, supposed to play well with other js libs 7) skupt ( http://www.skulpt.org/ ) : radical approach of python right in the browser, very beta 8) ironpython ( http://www.voidspace.org.uk/ironpython/silverlight/index.shtml ) : only for .net, Python in the browser with silverlight, early stage but promising 9) diesel framework ( http://dieselweb.org/lib/ ) suppose to provide a UI package, but no clue about it Cheers, Glen On Wed, Aug 11, 2010 at 10:14 AM, Glen Jarvis wrote: > Does anyone have any Pyjamas skills? It's a python to javascript compiler > apparently. > > If you do, would you want to talk about it sometime? If so talk to Jim. If > you don't know Pyjamas, do you know someone who does? > > I'd like to see a talk on it, personally... and know zip outside what I > said in this email.. > > Cheers, > > > Glen > -- > Whatever you can do or imagine, begin it; > boldness has beauty, magic, and power in it. > > -- Goethe > -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Wed Aug 11 20:37:44 2010 From: aleax at google.com (Alex Martelli) Date: Wed, 11 Aug 2010 11:37:44 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas/Extended thread In-Reply-To: References: Message-ID: On Wed, Aug 11, 2010 at 11:01 AM, Glen Jarvis wrote: > For that matter, I would be interested in any/all of these as a quick talk. > This way I can decide if I want to learn more about them. +1, except my interest is mostly on points 1, 2 and 3 (not so much on 4 and following ones). Alex > This lifted from Moshir Mikael's posting nin Linked-In Open Source Group > posting: > > To take the most of value out of this discussion, I'm listing some > interesting Python projects that tend to bring front end to Python (or > Python to frontend): > 1) Luban (?http://docs.danse.us/pyre/luban/sphinx/?) sophisticated and young > UI framework, willing to unify UI programming, still have to demonstrate > that it plays well with web frameworks > 2) pyjamas (?http://pyjs.org/?) : a port of gwt, very smart, with will to > unify ui programming like Luban, but not too supported like this discussion > shows ;) , pyjamas may be hard to extend for newbies > 3) pyvascript > (?http://www.allbuttonspressed.com/blog/django/2010/07/PyvaScript-Pythonic-syntax-for-your-browser?) > : a python inspired langage for the browser, playing well with other > javascript framework (especially jquery) > 4) toscawidgets (?http://toscawidgets.org/?) : a patchwork of various, > rather incomplete javascript frameworks wrappers, built on top of turbogears > -- latest news 2008 > 5) mochikit :(?http://mochikit.com/?) : a javascript framework inspired from > python > 6) coffeescript (?http://jashkenas.github.com/coffee-script/?) : funny > initiative to make javascript look like Python, early development, supposed > to play well with other js libs > 7) skupt (?http://www.skulpt.org/?) : radical approach of python right in > the browser, very beta > 8) ironpython > (?http://www.voidspace.org.uk/ironpython/silverlight/index.shtml?) : only > for .net, Python in the browser with silverlight, early stage but promising > 9) diesel framework (?http://dieselweb.org/lib/?) suppose to provide a UI > package, but no clue about it > > > Cheers, > > Glen > > > > On Wed, Aug 11, 2010 at 10:14 AM, Glen Jarvis wrote: >> >> Does anyone have any Pyjamas skills? It's a python to javascript compiler >> apparently. >> If you do, would you want to talk about it sometime? If so talk to Jim. If >> you don't know Pyjamas, do you know someone who does? >> I'd like to see a talk on it, personally... and know zip outside what I >> said in this email.. >> Cheers, >> >> Glen >> -- >> Whatever you can do or imagine, begin it; >> boldness has beauty, magic, and power in it. >> >> -- Goethe > > > > -- > Whatever you can do or imagine, begin it; > boldness has beauty, magic, and power in it. > > -- Goethe > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From cuba at iotacenter.org Wed Aug 11 19:56:00 2010 From: cuba at iotacenter.org (Larry Cuba) Date: Wed, 11 Aug 2010 10:56:00 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas In-Reply-To: References: Message-ID: <6.2.5.6.2.20100811105427.08408048@well.com> +1 vote for Pyjamas talk. At 10:14 AM 8/11/2010, Glen wrote: >Does anyone have any Pyjamas skills? It's a python to javascript compiler apparently. > >If you do, would you want to talk about it sometime? If so talk to Jim. If you don't know Pyjamas, do you know someone who does? > >I'd like to see a talk on it, personally... and know zip outside what I said in this email.. > >Cheers, > > >Glen >-- >Whatever you can do or imagine, begin it; >boldness has beauty, magic, and power in it. > >-- Goethe >_______________________________________________ >Baypiggies mailing list >Baypiggies at python.org >To change your subscription options or unsubscribe: >http://mail.python.org/mailman/listinfo/baypiggies From bender at onsrc.com Wed Aug 11 22:35:49 2010 From: bender at onsrc.com (Ryan Delucchi) Date: Wed, 11 Aug 2010 13:35:49 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas In-Reply-To: <6.2.5.6.2.20100811105427.08408048@well.com> References: <6.2.5.6.2.20100811105427.08408048@well.com> Message-ID: <89FB5F85-E1CF-4211-81AA-FD6D555BCEA7@onsrc.com> Also if the talk could include how to get pyjamas working on the google app engine, that would also be cool. Btw: the next meeting is the 19th correct? Ryan Sent from my iPad On Aug 11, 2010, at 10:56 AM, Larry Cuba wrote: > > > +1 vote for Pyjamas talk. > > > At 10:14 AM 8/11/2010, Glen wrote: >> Does anyone have any Pyjamas skills? It's a python to javascript compiler apparently. >> >> If you do, would you want to talk about it sometime? If so talk to Jim. If you don't know Pyjamas, do you know someone who does? >> >> I'd like to see a talk on it, personally... and know zip outside what I said in this email.. >> >> Cheers, >> >> >> Glen >> -- >> Whatever you can do or imagine, begin it; >> boldness has beauty, magic, and power in it. >> >> -- Goethe >> _______________________________________________ >> 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 tony at tcapp.com Wed Aug 11 22:51:16 2010 From: tony at tcapp.com (Tony Cappellini) Date: Wed, 11 Aug 2010 13:51:16 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas In-Reply-To: <89FB5F85-E1CF-4211-81AA-FD6D555BCEA7@onsrc.com> References: <6.2.5.6.2.20100811105427.08408048@well.com> <89FB5F85-E1CF-4211-81AA-FD6D555BCEA7@onsrc.com> Message-ID: On Wed, Aug 11, 2010 at 1:35 PM, Ryan Delucchi wrote: > Also if the talk could include how to get pyjamas working on the google app engine, that would also be cool. > > Btw: the next meeting is the 19th correct? No, it's the 26th. Always the 4th Thursday, unless there are special circumstances From bender at onsrc.com Wed Aug 11 23:42:42 2010 From: bender at onsrc.com (Ryan Delucchi) Date: Wed, 11 Aug 2010 14:42:42 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas In-Reply-To: References: <6.2.5.6.2.20100811105427.08408048@well.com> <89FB5F85-E1CF-4211-81AA-FD6D555BCEA7@onsrc.com> Message-ID: <1FFCB35A-EEC4-43AF-B2E9-5C709BC54CB6@onsrc.com> Errr .. Can't make it then :-( ... Hopefully one of these days I will be able to go again. Sent from my iPad On Aug 11, 2010, at 1:51 PM, Tony Cappellini wrote: > On Wed, Aug 11, 2010 at 1:35 PM, Ryan Delucchi wrote: >> Also if the talk could include how to get pyjamas working on the google app engine, that would also be cool. >> >> Btw: the next meeting is the 19th correct? > > No, it's the 26th. Always the 4th Thursday, unless there are special > circumstances From Chris.Clark at ingres.com Thu Aug 12 20:27:12 2010 From: Chris.Clark at ingres.com (Chris Clark) Date: Thu, 12 Aug 2010 11:27:12 -0700 Subject: [Baypiggies] Idea for talk: Pyjamas In-Reply-To: <89FB5F85-E1CF-4211-81AA-FD6D555BCEA7@onsrc.com> References: <6.2.5.6.2.20100811105427.08408048@well.com> <89FB5F85-E1CF-4211-81AA-FD6D555BCEA7@onsrc.com> Message-ID: <4C643D00.6050503@ingres.com> Ryan Delucchi wrote: > Also if the talk could include how to get pyjamas working on the google app engine, that would also be cool. > That not what pyjamas is for, pyjamas is for running stuff on the desktop in one form or another. Pyjamas is not a server side component. Either you use Pyjamas Desktop and it is a desktop app running in Python, or it is Python translated into javascript so it runs in the browser (along with a widget set). For the browser deployment, you might have the Pyjamas app make json (or xml) calls to a GAE app but you don't run Pyjamas on a server. See http://pyjs.org/ for more details, as you you've exhausted my knowledge :-) Chris From glen at glenjarvis.com Fri Aug 13 18:58:28 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Fri, 13 Aug 2010 09:58:28 -0700 Subject: [Baypiggies] The skinny on Pyjamas Message-ID: As posted by James, here's the quick skinny on pyjamas if you never heard of it. As a pyjamas user, I thought I'd chime in. I have been using pyjamas for about a year and a half. It is a breath of fresh air for developing web front ends. My front ends tend to be very application-like, with lots of data-driven widgets. The widget set in pyjamas is very basic, but it is very easy to create new widgets that do exactly what the application needs. This is IMHO where pyjamas particularly shines; if you need a UI widget that is not provided, you just create it. In python. Additionally, if you need some code that works identically on the front end and the back end, it is just a matter of importing it (in python) on both sides. For example, I wanted rc4 encryption for an app (don't ask!). It was a quick hack from the Wikipedia pseudocode to make a module in python. Then, I imported that module into my pyjamas code, and I imported exactly the same module into my back-end code. It worked flawlessly. I would be remiss if I did not mention that PureMVC also works in pyjamas. While there is some effort needed to get through the jargon, the event system and component code separation you get with PureMVC are worth the effort if you are doing anything complex. The minimum back end for a data-driven app in pyjamas only needs to serve static files (your compiled pyjamas app), together with a JSON-RPC listener, which can be in any language, and can be installed in most frameworks. A JSON-RPC call in pyjamas (once set up) looks a lot like a function call. You have to use an async methodology, but that has its blessings as well. I see that you worry that pyjamas is not ready for prime-time yet. It is true that pyjamas has a rather small following, and an even smaller advertising budget. There is no big corporation backing pyjamas. However, Luke Leighton is managing the project probably as well as an open source project can be. Test coverage is very good, particularly for the python-to-javascript translator. The python implementation is fairly complete; do you really need "eval" and "exec"? Actually, those may be available down the pike. In general, if you write something that does not work, it will be a flaw in your code, not the framework. Fortunately, you can recompile with a "debug" flag, and it will give you a good hint of where you went wrong. If that is not good enough, the mailing list is quite responsive, if you do not expect too much hand-holding. Pyjamas compiles separate code for each of the major web browsers; it started as a python port of GWT in (fluffy) java. The GWT documentation still applies in most cases, though in practice I tend to keep a gedit window open with several pyjamas UI modules for reference. The source for any widget tends to be small and readable. Widget styling uses CSS, which alleviates one major headache in UI design. You can addStyleName or removeStylename for any widget anytime you want, and the web browser just obeys. The generated javascript files are pretty big, but if you enable compression in the web server, load time can be acceptable even on dial-up. Since pyjamas will make you think in a data-driven way, popular pages could easily be done with standard templates from your back end framework, and you could reserve your pyjamas pages for your users that need a truly interactive experience. It is not an either-or decision here. With CSS, this can be seamless. I have only touched on the major things I love about pyjamas. There is more. The main advice is: don't be afraid to try pyjamas; you'll be happy you did. Use the version in the svn/git repository; it is the most up-to-date (small crowd: not very frequent releases). You already know python. Dive into the source at pyjamas/library/pyjamas/ui for the widgets. Play with and build the examples at pyjamas/examples. It's more mature than you think. Posted by James Washington -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Fri Aug 13 19:09:00 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Fri, 13 Aug 2010 10:09:00 -0700 Subject: [Baypiggies] The skinny on Pyjamas In-Reply-To: References: Message-ID: To be fair, I also saw posts talking about performance issues and how treads are locks for several seconds. I still want to learn more. Anyone going to give a talk? Glen El Aug 13, 2010, a las 9:58 AM, Glen Jarvis escribi?: > As posted by James, here's the quick skinny on pyjamas if you never heard of it. > > > > As a pyjamas user, I thought I'd chime in. I have been using pyjamas for about a year and a half. It is a breath of fresh air for developing web front ends. My front ends tend to be very application-like, with lots of data-driven widgets. The widget set in pyjamas is very basic, but it is very easy to create new widgets that do exactly what the application needs. This is IMHO where pyjamas particularly shines; if you need a UI widget that is not provided, you just create it. In python. > > Additionally, if you need some code that works identically on the front end and the back end, it is just a matter of importing it (in python) on both sides. For example, I wanted rc4 encryption for an app (don't ask!). It was a quick hack from the Wikipedia pseudocode to make a module in python. Then, I imported that module into my pyjamas code, and I imported exactly the same module into my back-end code. It worked flawlessly. > > I would be remiss if I did not mention that PureMVC also works in pyjamas. While there is some effort needed to get through the jargon, the event system and component code separation you get with PureMVC are worth the effort if you are doing anything complex. > > The minimum back end for a data-driven app in pyjamas only needs to serve static files (your compiled pyjamas app), together with a JSON-RPC listener, which can be in any language, and can be installed in most frameworks. A JSON-RPC call in pyjamas (once set up) looks a lot like a function call. You have to use an async methodology, but that has its blessings as well. > > I see that you worry that pyjamas is not ready for prime-time yet. It is true that pyjamas has a rather small following, and an even smaller advertising budget. There is no big corporation backing pyjamas. However, Luke Leighton is managing the project probably as well as an open source project can be. Test coverage is very good, particularly for the python-to-javascript translator. The python implementation is fairly complete; do you really need "eval" and "exec"? Actually, those may be available down the pike. In general, if you write something that does not work, it will be a flaw in your code, not the framework. Fortunately, you can recompile with a "debug" flag, and it will give you a good hint of where you went wrong. If that is not good enough, the mailing list is quite responsive, if you do not expect too much hand-holding. > > Pyjamas compiles separate code for each of the major web browsers; it started as a python port of GWT in (fluffy) java. The GWT documentation still applies in most cases, though in practice I tend to keep a gedit window open with several pyjamas UI modules for reference. The source for any widget tends to be small and readable. > > Widget styling uses CSS, which alleviates one major headache in UI design. You can addStyleName or removeStylename for any widget anytime you want, and the web browser just obeys. > > The generated javascript files are pretty big, but if you enable compression in the web server, load time can be acceptable even on dial-up. Since pyjamas will make you think in a data-driven way, popular pages could easily be done with standard templates from your back end framework, and you could reserve your pyjamas pages for your users that need a truly interactive experience. It is not an either-or decision here. With CSS, this can be seamless. > > I have only touched on the major things I love about pyjamas. There is more. The main advice is: don't be afraid to try pyjamas; you'll be happy you did. Use the version in the svn/git repository; it is the most up-to-date (small crowd: not very frequent releases). You already know python. Dive into the source at pyjamas/library/pyjamas/ui for the widgets. Play with and build the examples at pyjamas/examples. It's more mature than you think. > Posted by James Washington -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at atoulou.se Fri Aug 13 19:27:47 2010 From: andrew at atoulou.se (Andrew Akira Toulouse) Date: Fri, 13 Aug 2010 10:27:47 -0700 Subject: [Baypiggies] The skinny on Pyjamas In-Reply-To: References: Message-ID: The most important question for me: How good is Pyjamas' own documentation? On Fri, Aug 13, 2010 at 9:58 AM, Glen Jarvis wrote: > As posted by James, here's the quick skinny on pyjamas if you never heard of > it. > > > As a pyjamas user, I thought I'd chime in. I have been using pyjamas for > about a year and a half. It is a breath of fresh air for developing web > front ends. My front ends tend to be very application-like, with lots of > data-driven widgets. The widget set in pyjamas is very basic, but it is very > easy to create new widgets that do exactly what the application needs. This > is IMHO where pyjamas particularly shines; if you need a UI widget that is > not provided, you just create it. In python. > > Additionally, if you need some code that works identically on the front end > and the back end, it is just a matter of importing it (in python) on both > sides. For example, I wanted rc4 encryption for an app (don't ask!). It was > a quick hack from the Wikipedia pseudocode to make a module in python. Then, > I imported that module into my pyjamas code, and I imported exactly the same > module into my back-end code. It worked flawlessly. > > I would be remiss if I did not mention that PureMVC also works in pyjamas. > While there is some effort needed to get through the jargon, the event > system and component code separation you get with PureMVC are worth the > effort if you are doing anything complex. > > The minimum back end for a data-driven app in pyjamas only needs to serve > static files (your compiled pyjamas app), together with a JSON-RPC listener, > which can be in any language, and can be installed in most frameworks. A > JSON-RPC call in pyjamas (once set up) looks a lot like a function call. You > have to use an async methodology, but that has its blessings as well. > > I see that you worry that pyjamas is not ready for prime-time yet. It is > true that pyjamas has a rather small following, and an even smaller > advertising budget. There is no big corporation backing pyjamas. However, > Luke Leighton is managing the project probably as well as an open source > project can be. Test coverage is very good, particularly for the > python-to-javascript translator. The python implementation is fairly > complete; do you really need "eval" and "exec"? Actually, those may be > available down the pike. In general, if you write something that does not > work, it will be a flaw in your code, not the framework. Fortunately, you > can recompile with a "debug" flag, and it will give you a good hint of where > you went wrong. If that is not good enough, the mailing list is quite > responsive, if you do not expect too much hand-holding. > > Pyjamas compiles separate code for each of the major web browsers; it > started as a python port of GWT in (fluffy) java. The GWT documentation > still applies in most cases, though in practice I tend to keep a gedit > window open with several pyjamas UI modules for reference. The source for > any widget tends to be small and readable. > > Widget styling uses CSS, which alleviates one major headache in UI design. > You can addStyleName or removeStylename for any widget anytime you want, and > the web browser just obeys. > > The generated javascript files are pretty big, but if you enable compression > in the web server, load time can be acceptable even on dial-up. Since > pyjamas will make you think in a data-driven way, popular pages could easily > be done with standard templates from your back end framework, and you could > reserve your pyjamas pages for your users that need a truly interactive > experience. It is not an either-or decision here. With CSS, this can be > seamless. > > I have only touched on the major things I love about pyjamas. There is more. > The main advice is: don't be afraid to try pyjamas; you'll be happy you did. > Use the version in the svn/git repository; it is the most up-to-date (small > crowd: not very frequent releases). You already know python. Dive into the > source at pyjamas/library/pyjamas/ui for the widgets. Play with and build > the examples at pyjamas/examples. It's more mature than you think. > Posted by James Washington > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From smcbutler at gmail.com Sun Aug 15 00:24:52 2010 From: smcbutler at gmail.com (Simon Butler) Date: Sat, 14 Aug 2010 15:24:52 -0700 Subject: [Baypiggies] Python/Django developer needed Message-ID: Hi, we are a San Francisco based startup company and are looking for a Python/Django person to help with some front end development. We're looking for 5+ years Python experience with some design experience, jquery, javascript, SQL, CSS design. Thx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom.simons at gmail.com Mon Aug 16 19:43:10 2010 From: tom.simons at gmail.com (Tom Simons) Date: Mon, 16 Aug 2010 10:43:10 -0700 Subject: [Baypiggies] Python & Django: No module named _sqlite3 Message-ID: Python newbie here - I've been replacing our awk & ksh scripts for reports with it. I liked the Django demo on Windows so much that I volunteered to implement our tiny website using Django on RHEL AS5 Linux boxes. Now I'm running into trouble getting Python, Django, & SQLite working on RHEL AS5. I don't really require compiling from source, but I did so to get the latest versions (& I thought Python > 2.5 came with SQLite already installed). What am I missing in the installs below? The Django "manage.py syncdb" gets error "No module named _sqlite3". Does Django installation require more than the link to Python-2.7/lib/python2.7/site-packages? $ tar xf Python-2.7.tgz #Install Python 2.7 $ cd Python-2.7 $ mkdir /apps/Python-2.7 $ chown simonst /apps/Python-2.7 $ ./configure --prefix=/apps/Python-2.7 $ make $ sudo make install $ export PATH=/apps/Python-2.7/bin:$PATH $ python -V Python 2.7 $ tar xzf sqlite-amalgamation-3.7.0.1.tar.gz #Install sqlite 3.7.0.1 $ cd sqlite-3.7.0.1 $ ./configure --prefix=/apps/sqlite-3.7.0 $ make $ sudo make install $ export PATH=/apps/sqlite-3.7.0/bin:$PATH $ sqlite3 -version 3.7.0.1 $ sudo tar xzf Django-1.2.1.tar.gz -C /apps #Install Django 1.2.1 $ cd /apps/Django-1.2.1 $ sudo ln -s /apps/Django-1.2.1/django /apps/Python-2.7/lib/python2.7/site-packages $ export PATH=/apps/Django-1.2.1/django/bin:$PATH $ django-admin.py --version 1.2.1 (see attachment for more detail) $ django-admin.py startproject mysite #Start Django project $ cd mysite $ ./manage.py runserver #Show Django dev server is ok $ ./manage.py startapp blog #Start Django Blog app $ vi blog/models.py $ vi settings.py $ ./manage.py syncdb #Build database Traceback (most recent call last): File "./manage.py", line 11, in . . . . . File "/apps/Python-2.7/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 34, in raise ImproperlyConfigured("Error loading %s: %s" % (module, exc)) django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- $ tar xf Python-2.7.tgz #Install Python 2.7 $ cd Python-2.7 $ mkdir /apps/Python-2.7 $ chown simonst /apps/Python-2.7 $ ./configure --prefix=/apps/Python-2.7 $ make $ sudo make install $ export PATH=/apps/Python-2.7/bin:$PATH $ python -V Python 2.7 $ tar xzf sqlite-amalgamation-3.7.0.1.tar.gz #Install sqlite 3.7.0.1 $ cd sqlite-3.7.0.1 $ ./configure --prefix=/apps/sqlite-3.7.0 $ make $ sudo make install $ export PATH=/apps/sqlite-3.7.0/bin:$PATH $ sqlite3 -version 3.7.0.1 $ sudo tar xzf Django-1.2.1.tar.gz -C /apps #Install Django 1.2.1 $ cd /apps/Django-1.2.1 $ sudo ln -s /apps/Django-1.2.1/django /apps/Python-2.7/lib/python2.7/site-packages $ export PATH=/apps/Django-1.2.1/django/bin:$PATH $ django-admin.py --version 1.2.1 $ django-admin.py startproject mysite #Start Django project $ cd mysite $ ./manage.py runserver #Show Django dev server is ok Validating models... 0 errors found Django version 1.2.1, using settings 'mysite.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [16/Aug/2010 10:59:26] "GET / HTTP/1.1" 200 2051 < Ctl-C> $ ./manage.py startapp blog #Start Django Blog app $ vi blog/models.py $ cat blog/models.py from django.db import models class BlogPost(models.Model): title = models.CharField(max_length=150) body = models.TextField() timestamp = models.DateTimeField() $ vi settings.py $ diff settings.py settings.py_ORIG 14,15c14,15 < 'ENGINE': 'django.db.backends.sqlite3', < 'NAME': '/var/db/django.db', --- > 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. > 'NAME': '', # Or path to database file if using sqlite3. 92c92,93 < 'django.contrib.admin', --- > # Uncomment the next line to enable the admin: > # 'django.contrib.admin', $ ./manage.py syncdb #Build database Traceback (most recent call last): File "./manage.py", line 11, in execute_manager(settings) File "/apps/Python-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/apps/Python-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/apps/Python-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 257, in fetch_command klass = load_command_class(app_name, subcommand) File "/apps/Python-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 67, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/apps/Python-2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/apps/Python-2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 7, in from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal File "/apps/Python-2.7/lib/python2.7/site-packages/django/core/management/sql.py", line 5, in from django.contrib.contenttypes import generic File "/apps/Python-2.7/lib/python2.7/site-packages/django/contrib/contenttypes/generic.py", line 6, in from django.db import connection File "/apps/Python-2.7/lib/python2.7/site-packages/django/db/__init__.py", line 75, in connection = connections[DEFAULT_DB_ALIAS] File "/apps/Python-2.7/lib/python2.7/site-packages/django/db/utils.py", line 91, in __getitem__ backend = load_backend(db['ENGINE']) File "/apps/Python-2.7/lib/python2.7/site-packages/django/db/utils.py", line 32, in load_backend return import_module('.base', backend_name) File "/apps/Python-2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/apps/Python-2.7/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 34, in raise ImproperlyConfigured("Error loading %s: %s" % (module, exc)) django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3 From rami.chowdhury at gmail.com Mon Aug 16 20:13:39 2010 From: rami.chowdhury at gmail.com (Rami Chowdhury) Date: Tue, 17 Aug 2010 00:13:39 +0600 Subject: [Baypiggies] Python & Django: No module named _sqlite3 In-Reply-To: References: Message-ID: Hey Tom, Welcome to Python! On Aug 16, 2010, at 23:43 , Tom Simons wrote: > > What am I missing in the installs below? The Django "manage.py syncdb" gets error "No module named _sqlite3". > > Does Django installation require more than the link to Python-2.7/lib/python2.7/site-packages? > It shouldn't -- what does your Python path (sys.path) look like? ------------- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simeonf at gmail.com Mon Aug 16 20:31:48 2010 From: simeonf at gmail.com (Simeon Franklin) Date: Mon, 16 Aug 2010 11:31:48 -0700 Subject: [Baypiggies] Python & Django: No module named _sqlite3 In-Reply-To: References: Message-ID: See http://stackoverflow.com/questions/233320/cannot-import-sqlite-with-python-2-6 It looks like there are problems building python from source with sqlite3 support if the sqlite dev headers aren't installed. Can you find the missing .so file ($ locate _sqlite3.so)? If so I would symlink it into the python site-packages directory... -regards Simeon Franklin On Mon, Aug 16, 2010 at 10:43 AM, Tom Simons wrote: > Python newbie here - I've been replacing our awk & ksh scripts for reports > with it.? I liked the Django demo on Windows so much that I volunteered to > implement our tiny website using Django on RHEL AS5 Linux boxes. > > Now I'm running into trouble getting Python, Django, & SQLite working on > RHEL AS5.? I don't really require compiling from source, but I did so to get > the latest versions (& I thought Python > 2.5 came with SQLite already > installed). > > What am I missing in the installs below? The Django "manage.py syncdb" gets > error "No module named _sqlite3". > > Does Django installation require more than the link to > Python-2.7/lib/python2.7/site-packages? > > $ tar xf Python-2.7.tgz????????????????????? #Install Python 2.7 > $ cd Python-2.7 > $ mkdir?????????? /apps/Python-2.7 > $ chown simonst?? /apps/Python-2.7 > $ ./configure --prefix=/apps/Python-2.7 > $ make > $ sudo make install > $ export PATH=/apps/Python-2.7/bin:$PATH > $ python -V > Python 2.7 > > > $ tar xzf sqlite-amalgamation-3.7.0.1.tar.gz #Install sqlite 3.7.0.1 > $ cd sqlite-3.7.0.1 > $ ./configure --prefix=/apps/sqlite-3.7.0 > $ make > $ sudo make install > $ export PATH=/apps/sqlite-3.7.0/bin:$PATH > $ sqlite3 -version > 3.7.0.1 > > $ sudo tar xzf Django-1.2.1.tar.gz -C /apps? #Install Django 1.2.1 > $ cd /apps/Django-1.2.1 > $ sudo ln -s /apps/Django-1.2.1/django > /apps/Python-2.7/lib/python2.7/site-packages > $ export PATH=/apps/Django-1.2.1/django/bin:$PATH > $ django-admin.py --version > 1.2.1 > > ?(see attachment for more detail) > > $ django-admin.py startproject mysite??????? #Start Django project > $ cd mysite > $ ./manage.py runserver????????????????????? #Show Django dev server is ok > $ ./manage.py startapp blog????????????????? #Start Django Blog app > $ vi? blog/models.py > $ vi settings.py > > $ ./manage.py syncdb???????????????????????? #Build database > Traceback (most recent call last): > ? File "./manage.py", line 11, in > ? .? .? .? .? . > ? File > "/apps/Python-2.7/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", > line 34, in > ??? raise ImproperlyConfigured("Error loading %s: %s" % (module, exc)) > django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 > or sqlite3 modules (tried in that order): No module named _sqlite3 > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From bdbaddog at gmail.com Mon Aug 16 20:33:38 2010 From: bdbaddog at gmail.com (William Deegan) Date: Mon, 16 Aug 2010 11:33:38 -0700 Subject: [Baypiggies] Python & Django: No module named _sqlite3 In-Reply-To: References: Message-ID: Tom, You may want to take a look at setuptools and easy_install for installing modules. It will pull the dependencies for you (like CPAN). In this case your python build may not have picked up the location you installed sqlite3 at. ./configure --help on python to see if there's a flag to specify where sqlite3 lives. You'll likely need to rebuild. -Bill On Mon, Aug 16, 2010 at 11:13 AM, Rami Chowdhury wrote: > Hey Tom, > > Welcome to Python! > > On Aug 16, 2010, at 23:43 , Tom Simons wrote: > > > What am I missing in the installs below? The Django "manage.py syncdb" gets > error "No module named _sqlite3". > > Does Django installation require more than the link to > Python-2.7/lib/python2.7/site-packages? > > > It shouldn't -- what does your Python path (sys.path) look like? > > > > ------------- > Rami Chowdhury > "Never assume malice when stupidity will suffice." -- Hanlon's Razor > 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) > > > _______________________________________________ > 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: From mikeyp at lahondaresearch.org Mon Aug 16 21:03:16 2010 From: mikeyp at lahondaresearch.org (Michael Pittaro) Date: Mon, 16 Aug 2010 15:03:16 -0400 Subject: [Baypiggies] Python & Django: No module named _sqlite3 In-Reply-To: References: Message-ID: When building Python from source, I have developed the habit of running the tests after the build > ./configure .... > make > make test The test output will tell you which modules weren't built, and which test skips were unexpected. I think Simeon was going in the right direction; the sqlite modules probably didn't build because the development headers are missing. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Mon Aug 16 21:47:25 2010 From: bdbaddog at gmail.com (William Deegan) Date: Mon, 16 Aug 2010 12:47:25 -0700 Subject: [Baypiggies] Python & Django: No module named _sqlite3 In-Reply-To: References: Message-ID: All, If you modify setup.py around line 973, you can add the include path for your install of sqlite. Do that , make distclean, and then do configure, make, make test. I'm surprised there's no flag for configure to point to it. -Bill On Mon, Aug 16, 2010 at 12:03 PM, Michael Pittaro < mikeyp at lahondaresearch.org> wrote: > When building Python from source, I have developed the habit of running the > tests after the build > > > ./configure .... > > make > > make test > > The test output will tell you which modules weren't built, and which test > skips were unexpected. > > I think Simeon was going in the right direction; the sqlite modules > probably didn't build because the development headers are missing. > > > > > _______________________________________________ > 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: From andywiggin at gmail.com Mon Aug 16 21:55:57 2010 From: andywiggin at gmail.com (Andy Wiggin) Date: Mon, 16 Aug 2010 12:55:57 -0700 Subject: [Baypiggies] Python & Django: No module named _sqlite3 In-Reply-To: References: Message-ID: I had what sounds like a similar problem when building my own sqlite and Python 2.5.4. I believe the root problem was that the Python build script could not find the sqlite header files so the _sqlite3.so was not built. My solution was simply to add the correct C compiler flag to the standard env variable before calling configure for Python. E.g. (using csh): setenv CPPFLAGS -I/my-root-path/sqlite3/include ./configure ... make make install As suggested, there may be a way to accomplish the same thing using ./configure options, etc. Regards, Andy On Mon, Aug 16, 2010 at 12:03 PM, Michael Pittaro wrote: > When building Python from source, I have developed the habit of running the > tests after the build > >> ./configure .... >> make >> make test > > The test output will tell you which modules weren't built, and which test > skips were unexpected. > > I think Simeon was going in the right direction; the sqlite modules probably > didn't build because the development headers are missing. > > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From ml at lolapps.com Fri Aug 20 18:51:16 2010 From: ml at lolapps.com (Mary Stephens) Date: Fri, 20 Aug 2010 09:51:16 -0700 Subject: [Baypiggies] Seeking Talented Server Engineer to work on scalability issues Message-ID: We're looking for a seasoned performance engineer. You know the thrill and the terror of an unexpected traffic storm that's railed your application. You think on your feet, adapt and make a genius patch that let's your servers hold to see out the storm, then hit the whiteboard to start architecting a solution that will handle the next storm with ease. You'll get to: * Work in an innovative space that is expanding into a billion dollar industry. * Design and implement large chunks of scalability features. * Help make key infrastructure decisions (databases, replication layouts, caching solutions, etc.). * Experiment with the newest emerging open-source technologies. * Test your ideas and strategies out on millions of users and enormous data sets. * Head up a small team of experienced engineers (if you are willing and able). * Have fun. Play ping pong, foosball, video games. * Eat. We buy your lunches. Ideally, you: * Love python and can code it in your sleep. * Working knowledge of Linux, scripting, and SQL. * Understand when MySQL is great and experiment with NoSQL solutions (Memcached/Mongo/Redis/Cassandra) * Know how to put together a web-application stack. (We use Pylons/Paste.) * Enjoy bouncing ideas of your teammates to build up solutions no one person could of thought up by themself. * Care about your implementations and find yourself compulsively checking that your latest experimental deploy is working the way you thought it would. CLICK HERE TO APPLY: http://hire.jobvite.com/j/?cj=oQ3mVfwU&s=BayPIGgies -- Mary Lee Stephens Director of HR & Recruitment Lolapps, Inc. 415-302-3767 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at well.com Tue Aug 24 16:33:04 2010 From: jim at well.com (jim) Date: Tue, 24 Aug 2010 07:33:04 -0700 Subject: [Baypiggies] BayPIGgies meeting Thursday, August 26, 2010: Instrumentation with Python Message-ID: <1282660384.3383.456.camel@jim-laptop> BayPIGgies meeting Thursday, August 26, 2010: Instrumentation with Python Tonight's talk is Instrumentation with Python by Keith Dart Meetings usually start with a Newbie Nugget, a short discussion of an essential Python feature, especially for those new to Python. Tonight's Newbie Nugget: defaultdict from the Python High-performance container datatypes, by Glen Jarvis LOCATION Symantec Corporation Symantec Vcafe 350 Ellis Street Mountain View, CA 94043 http://maps.google.com/maps/ms?oe=utf-8&client=firefox-a&ie=UTF8&fb=1&split=1&gl=us&ei=w6i_Sfr6MZmQsQOzlv0v&hl=en&t=h&msa=0&msid=116202735295394761637.00046550c09ff3d96bff1&ll=37.397693,-122.053707&spn=0.002902,0.004828&z=18 BayPIGgies meeting information is available at http://www.baypiggies.net/ ------------------------ Agenda ------------------------ ..... 7:30 PM ........................... General hubbub, inventory end-of-meeting announcements, any first-minute announcements. ..... 7:35 PM to 7:40 PM ................ Tonight's Newbie Nugget: defaultdict from the Python High-performance container datatypes, by Glen Jarvis ..... 7:40 PM to 8:40 PM (or so) ................ Instrumentation with Python by Keith Dart This talk overs the use of Python in test and measurement using the open-source code base "powerdroid" for illustration. This includes instrument control by IEEE-488 bus and software interfaces and includes numpy array usage and matplotlib usage. ..... 8:40 PM to 9:30 PM ................ Mapping and Random Access Mapping is a rapid-fire audience announcement of issues, hiring, events, and other topics. Random Access follows people immediately to allow follow up on the announcements and other interests. From aahz at pythoncraft.com Tue Aug 24 21:36:30 2010 From: aahz at pythoncraft.com (Aahz) Date: Tue, 24 Aug 2010 12:36:30 -0700 Subject: [Baypiggies] I hate tech support Message-ID: <20100824193630.GA28440@panix.com> http://successfulsoftware.net/2010/08/24/10-things-non-technical-users-dont-understand-about-your-software/ -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "...if I were on life-support, I'd rather have it run by a Gameboy than a Windows box." --Cliff Wells From glen at glenjarvis.com Thu Aug 26 21:58:26 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Thu, 26 Aug 2010 12:58:26 -0700 Subject: [Baypiggies] Python course at UC Berkeley Message-ID: This email was sent to me at UC Berkeley and I thought I'd pass it along to any BayPIGgies who may be interested... Subject: New CSE course in "Python for Scientific Computing" I wanted to call your attention to a new Computational Science and Engineering (CSE;http://cse.berkeley.edu/) seminar class called "Python for Scientific Computing," being organized by Josh Bloom, a professor in the astronomy department. The course (AY250; CCN 06180) may be taken for credit by undergraduates or graduate students and may be audited by anyone contacting the professor directly (jbloom at astro.berkeley.edu). The course meets Mondays 2-5pm at Hearst 310. The first meeting (this Monday) is optional. The course starts in earnest the Monday after Labor Day. Here is a short description of the course: This seminar-based course, based on the Python (python.org) language, provides a detailed overview of the techniques and core packages used in modern scientific research computing. It is intended for upper-division undergraduates and first/second year graduate students in the physical science disciplines. The Python language, and associated packages, provides a powerful open-source framework suitable for many, if not most, research needs in data-intensive disciplines. It is an object-oriented scripting language that is draws the best elements from many often-used languages in science research (Perl, Interactive Data Language [IDL], C++, Java, Matlab, Fortran, Ruby, ..), is easily connected to legacy C and Fortran codes, makes use of architecture-tuned vector and matrix manipulation packages, has mature plotting and statistical/physical packages, and can be straightforwardly parallelized on multicore and distributed hardware infrastructures. Cheers, Glen -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.conrad at gmail.com Fri Aug 27 01:55:30 2010 From: alexandre.conrad at gmail.com (Alexandre Conrad) Date: Thu, 26 Aug 2010 16:55:30 -0700 Subject: [Baypiggies] BayPIGgies meeting Thursday, August 26, 2010: Instrumentation with Python In-Reply-To: <1282660384.3383.456.camel@jim-laptop> References: <1282660384.3383.456.camel@jim-laptop> Message-ID: Hello list, I just moved to the Bay Area 2 weeks ago and I would like to attend to this Python meeting tonight. I can get there by bus but it seems awfully long. And there doesn't seem to be as many transportation options after the meeting. As I don't have a car yet, I was wondering if, by any chance, someone going to the meeting tonight was driving by Santa Clara and willing to pick me up (and return)? I live near El Camino Real/Monroe or Scott Blvd. I would greatly appreciate. If you are going earlier for diner (if something is planned), I would match that schedule as well. That would be your chance to get a free beer. :) Please reply privately. Thank you. Alex 2010/8/24 jim : > > BayPIGgies meeting Thursday, August 26, 2010: Instrumentation with > Python > > > Tonight's talk is Instrumentation with Python > by Keith Dart > > > Meetings usually start with a Newbie Nugget, a short discussion of > an essential Python feature, especially for those new to Python. > Tonight's Newbie Nugget: defaultdict from the Python High-performance > container datatypes, by Glen Jarvis > > > LOCATION > Symantec Corporation > Symantec Vcafe > 350 Ellis Street > Mountain View, CA 94043 > http://maps.google.com/maps/ms?oe=utf-8&client=firefox-a&ie=UTF8&fb=1&split=1&gl=us&ei=w6i_Sfr6MZmQsQOzlv0v&hl=en&t=h&msa=0&msid=116202735295394761637.00046550c09ff3d96bff1&ll=37.397693,-122.053707&spn=0.002902,0.004828&z=18 > > BayPIGgies meeting information is available at > http://www.baypiggies.net/ > > > ------------------------ Agenda ------------------------ > > > ..... 7:30 PM ........................... > General hubbub, inventory end-of-meeting announcements, any > first-minute announcements. > > > ..... 7:35 PM to 7:40 PM ................ > Tonight's Newbie Nugget: defaultdict from the Python High-performance > container datatypes, by Glen Jarvis > > > ..... 7:40 PM to 8:40 PM (or so) ................ > > Instrumentation with Python > by Keith Dart > > This talk overs the use of Python in test and measurement using the > open-source code base "powerdroid" for illustration. This includes > instrument control by IEEE-488 bus and software interfaces and > includes numpy array usage and matplotlib usage. > > > ..... 8:40 PM to 9:30 PM ?................ > Mapping and Random Access > > Mapping is a rapid-fire audience announcement of issues, hiring, > events, and other topics. > > Random Access follows people immediately to allow follow up on the > announcements and other interests. > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From cappy2112 at gmail.com Fri Aug 27 07:08:20 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Thu, 26 Aug 2010 22:08:20 -0700 Subject: [Baypiggies] Beautiful Code: Multidimensional Iterators in NumPy Message-ID: While Keith was talking about his instrumentation and NumPy tonight, I remembered an interesting chapter from Beautiful Code on Multidimensional Iterators in NumPy. http://oreilly.com/catalog/9780596510046/ While this chapter doesn't directly apply to Keith's talk, it's incredibly interesting for those who use NumPy. This chapter isn't about Python, but the underlying code which makes Numpy arrays fast & efficient. Our webmaster, Bill Deegan, wrote this review on Beautiful Code http://tinyurl.com/28uyst4 There are many other interesting chapter in this book. Please read it! From cappy2112 at gmail.com Fri Aug 27 07:26:34 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Thu, 26 Aug 2010 22:26:34 -0700 Subject: [Baypiggies] Looking for YouTube presenters for upcoming meetings Message-ID: Do we have any of the YouTube staff on the list? If any of you work with YouTube employees who are working on an interesting project, would you ask if they would be interested in giving a presentation at an upcoming meeting? Thanks From glen at glenjarvis.com Fri Aug 27 08:16:22 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Thu, 26 Aug 2010 23:16:22 -0700 Subject: [Baypiggies] Notes on defaultdict Message-ID: Here are notes with code that I used in my Newbie Nugget presentation today. This will give you time to review the code line by line (good suggestion Wesley) and get a feel for what is happening. As a reminder: The input is: input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] And, we want an output dictionary so that something like this is reported: output['red'] = [1] output['blue'] = [2, 4] output['yellow'] = [1, 3] There are lots of ways to do this, and I invite other suggestions/input. If we were to start with these few lines, we'll see some limited success: Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] >>> >>> output = {} >>> >>> output['yellow'] = [1] >>> output['yellow'].append(3) >>> >>> print output {'yellow': [1, 3]} But, how do we sort this out so that we always initialize the value to be a list value If we forget, we'll see something like this [continuing from above] >>> print output {'yellow': [1, 3]} >>> output['blue'].append(2) Traceback (most recent call last): File "", line 1, in KeyError: 'blue' We can't append something to the stuff that is associated with the 'blue' key, because nothing exists yet for the blue key. We need to initialize it before we can append to it. So, what we really want is to have some type of default behavior given to us. For example, Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] >>> >>> output = {} >>> >>> for color, value in input: ... if output.has_key(color): ... output[color].append(value) ... else: ... output[color] = [value] ... >>> print output {'blue': [2, 4], 'red': [1], 'yellow': [1, 3]} One could argue that this is just fine -- this is very clear, and it works. And, frankly, there's merit to that argument. However, if we did this many times with many different types of dictionaries, and we couldn't really make a generic routine that we could use to handle this, we'll have this same pattern over and over: if something.has_key(?): something[?] = else: something[?] = What if there was another design pattern to do this? What if you could somehow set a 'default' behavior so that, if the key didn't exist, you automatically got, in our example, a list so you could append to it. That is, we'd have code that looked like this: output[color].append(value) This does fit our brain, because we really just want to append values as we're going and not have to think of the special case of (oh, if the key exists do this; or if it doesn't, do that; etc.) The collections.defaultdict object does the above. However, before we talk about it -- there will be some in the audience that will say, "Wait a minute? This is what setdefault does." And, they'd be right. So, let's take a break from this newbie nugget to give you another newbie nugget -- the setdefult (unless you already know about it). The set default method can be used on a dictionary to set the default for a key. And, it can be done multiple times without causing a problem. So, for my output dictionary, if I set the default to a list (for the key yellow, for example), then whenever I access the output dictionary through the yellow key, I get a dictionary automatically. And, thus, we can tack an 'append' on to that list that's given to us by default. Here's an example: Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)]>>> >>> output = {} >>> >>> for color, value in input: ... output.setdefault(color, []).append(value) ... >>> print output {'blue': [2, 4], 'red': [1], 'yellow': [1, 3]} For each key in the dictionary, the default value is a list and the value is appended to it. Although, it does seem we're having to set the default for every single key -- not for any key in the dictionary. But, that's a good transition to the collections.defaultdict because that's exactly what it does. >>> from collections import defaultdict >>> >>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] >>> >>> output = defaultdict(list) >>> >>> for color, value in input: ... output[color].append(value) ... >>> print output defaultdict(, {'blue': [2, 4], 'red': [1], 'yellow': [1, 3]}) Don't be scared about this extra output -- just notice that the colors have the right lists. If you wanted to print these out by keys, you'll still get the results that you want: >>> print output['blue'] [2, 4] What a default dictionary type is, it's simply a subclassed version of the dictionary that does a few special things. You give it a basic 'factory function' -- in our case a list -- and that's what's initialized for a key the first time it is accessed. We don't have to worry if the key was previously initialized, etc.. Some will argue that this is less explicit -- and I would probably have been one of them when I first started preparing this newbie nugget. But, after doing over this a few times to explain it, I've finally started to come on board to the idea. We're explicitly stating the default type when we initialize the defaultdict variable. I especially like it that the default dict gives a default type for any key -- not for a specific key as setdefault seems to do (correct me if I misspeak here). But, more than anything, it's *much faster* than doing it the other ways.. But, I want you to prove that to yourself and to me? I have created a 1 GB file with colors and numbers. I'll give you this file so that you can read it in and create the dictionary of your choice, with the method of your choice. You can time how long it takes for dictionary creation, with the list appending, and everything. Remember that your dictionary will be in memory and will be about a gig of ram also. If your machine doesn't have those resources, read only half the file. In fact, it would be interesting to do this for a random number of records in the file, multiple times, to get a feel for how this grows for each data type. Come on, it'll be good practice if you've never done this before? Lets compare notes when you're finished. -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferringb at gmail.com Fri Aug 27 13:00:44 2010 From: ferringb at gmail.com (Brian Harring) Date: Fri, 27 Aug 2010 04:00:44 -0700 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: References: Message-ID: <20100827110044.GG18926@hrair> On Thu, Aug 26, 2010 at 11:16:22PM -0700, Glen Jarvis wrote: > >>> for color, value in input: > > ... if output.has_key(color): > > ... output[color].append(value) > > ... else: > > ... output[color] = [value] > > ... Use 'color in output', avoid the has_key... if this is targeted as an intro to python, has_key should *not* be mentioned- it's slower than doing 'in' due to method lookup and it was punted from py3k. Been frowned upon for a long while. Teaching someone new to python, either you can tell them about list.index, dict.has_key, or you can tell them about the 'in' operator. Expose new folk to just the latter, they have one rule to know- specifically knowing about the containment protocol. This is generally the pythonic way- who cares if it's a dict or a list or a tuple, if it quacks like a duck (does containment), then treat it like a duck (it's sequence like). > What a default dictionary type is, it's simply a subclassed version of > the dictionary that does a few special things. > > You give it a basic 'factory function' -- in our case a list -- and > that's what's initialized for a key the first time it is accessed. We > don't have to worry if the key was previously initialized, etc.. Instantiated if the key is missing, rather than 'first time access'. It's pedantic correction, but the wording you're using here conflicts with- d = defaultdict(list) d[1].append(2) del d[1] print d[1] > Some will argue that this is less explicit -- and I would probably have > been one of them when I first started preparing this newbie nugget. > But, after doing over this a few times to explain it, I've finally > started to come on board to the idea. We're explicitly stating the > default type when we initialize the defaultdict variable. > > I especially like it that the default dict gives a default type for any > key -- not for a specific key as setdefault seems to do (correct me if > I misspeak here). The phrasing/selling point here is questionable; how it reads to me is claiming that all key/vals wind up using that factory function (trying to sell the notion of 'default type' specifically), which isn't the case. Might want to reword that. As for setdefault, the phrasing there is further confusing. setdefault has no notion of default type... it's purely "if the key doesn't exist, use this default". > But, more than anything, it's *much faster* than doing it the other > ways.. But, I want you to prove that to yourself and to me? I have > created a 1 GB file with colors and numbers. I'll give you this file so > that you can read it in and create the dictionary of your choice, with > the method of your choice. You really shouldn't be trying to sell defaultdict on it's speed since it's not much of a gurantee. Consider the following: python -m timeit -n 1000 -s 'from collections import defaultdict;' \ $'d=defaultdict(lambda :[0])\nfor x in xrange(1000):d[x].append(1)' 1000 loops, best of 3: 794 usec per loop # optimized variant. python -m timeit -n 1000 -s 'from collections import defaultdict;from functools import partial' \ $'d=defaultdict(partial(list, [0]))\nfor x in xrange(1000):d[x].append(1)' 1000 loops, best of 3: 723 usec per loop python -m timeit -n 1000 -s 'pass' \ $'d={}\nfor x in xrange(1000):d.setdefault(x, [0]).append(1)' 1000 loops, best of 3: 546 usec per loop python -m timeit -n 1000 -s 'pass' \ $'d={}\nfor x in xrange(1000):\n if x in d:d[x].append(1)\n else:d[x]=[0,1]' 1000 loops, best of 3: 282 usec per loop To be clear, for the scenario of defaultdict(list), defaultdict *is* around 20% faster than the optimized dict equivalent (py2.6 timings specifically). Where defaultdict breaks down is when instantiation is semi complex- if you have to rely on lambda for example, the frame overhead is going to add up pretty quick. In addition, reliance on defaultdict means you lose the ability to do site specific faster versions ([0,1] for example). Pretty much, if you're going to sell folk on defaultdict, sell them on code cleanliness: # consider this: d = {} for key, (subkey, val) in source_items: if key in d: if subkey in d[key]: d[key][subkey].extend(subval) else: d[key][subkey] = list(subval) else: d[key] = {subkey:list(subval)} # simplified... d = {} for key, (subkey, val) in source_items: d.setdefault(key, {}).setdefault(subkey, []).extend(val) # or using defaultdict d = defaultdict(partial(defaultdict, list)) for key, (subkey, val) in source_items: d[key][subkey].extend(val) While that's an abbreviated example, if one imagines the logic being a fair bit more complex for assignment/mangling of subkey/val, the slightly tricky defaultdict setup used in the last example is offset in maintenance costs pretty quickly via not having to dink around with setdefault or equivalent logic. Hell, consider the following- def f(): return defaultdict(f) my_tree = f() my_tree[1][2][3][4][5][6][7][8][9] my_tree[1][3] Stuff like that really is the power of defaultdict (more the power of __missing__, but you seem to be skipping that detail in your nugget thingy-mo-bob). ~harring -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From recursive.cookie.jar at gmail.com Fri Aug 27 14:39:41 2010 From: recursive.cookie.jar at gmail.com (Zach Collins) Date: Fri, 27 Aug 2010 07:39:41 -0500 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: <20100827110044.GG18926@hrair> References: <20100827110044.GG18926@hrair> Message-ID: Personally, I'm frequently tempted to just try: output[color].append(value) except: output[color] = [value] It's pythonic because I'm a lazy arse :P On Aug 27, 2010, at 6:00 AM, Brian Harring wrote: > On Thu, Aug 26, 2010 at 11:16:22PM -0700, Glen Jarvis wrote: >>>>> for color, value in input: >> >> ... if output.has_key(color): >> >> ... output[color].append(value) >> >> ... else: >> >> ... output[color] = [value] >> >> ... > > Use 'color in output', avoid the has_key... if this is targeted as an > intro to python, has_key should *not* be mentioned- it's slower than > doing 'in' due to method lookup and it was punted from py3k. Been > frowned upon for a long while. > > Teaching someone new to python, either you can tell them about > list.index, dict.has_key, or you can tell them about the 'in' > operator. Expose new folk to just the latter, they have one rule to > know- specifically knowing about the containment protocol. > > This is generally the pythonic way- who cares if it's a dict or a list > or a tuple, if it quacks like a duck (does containment), then treat it > like a duck (it's sequence like). > > >> What a default dictionary type is, it's simply a subclassed version of >> the dictionary that does a few special things. >> >> You give it a basic 'factory function' -- in our case a list -- and >> that's what's initialized for a key the first time it is accessed. We >> don't have to worry if the key was previously initialized, etc.. > > Instantiated if the key is missing, rather than 'first time access'. > It's pedantic correction, but the wording you're using here conflicts > with- > > d = defaultdict(list) > d[1].append(2) > del d[1] > print d[1] > > >> Some will argue that this is less explicit -- and I would probably have >> been one of them when I first started preparing this newbie nugget. >> But, after doing over this a few times to explain it, I've finally >> started to come on board to the idea. We're explicitly stating the >> default type when we initialize the defaultdict variable. >> >> I especially like it that the default dict gives a default type for any >> key -- not for a specific key as setdefault seems to do (correct me if >> I misspeak here). > > The phrasing/selling point here is questionable; how it reads to me is > claiming that all key/vals wind up using that factory function > (trying to sell the notion of 'default type' specifically), which > isn't the case. Might want to reword that. > > As for setdefault, the phrasing there is further confusing. > setdefault has no notion of default type... it's purely "if the key > doesn't exist, use this default". > > >> But, more than anything, it's *much faster* than doing it the other >> ways.. But, I want you to prove that to yourself and to me? I have >> created a 1 GB file with colors and numbers. I'll give you this file so >> that you can read it in and create the dictionary of your choice, with >> the method of your choice. > > > You really shouldn't be trying to sell defaultdict on it's speed since > it's not much of a gurantee. > > Consider the following: > > python -m timeit -n 1000 -s 'from collections import defaultdict;' \ > $'d=defaultdict(lambda :[0])\nfor x in xrange(1000):d[x].append(1)' > 1000 loops, best of 3: 794 usec per loop > > # optimized variant. > python -m timeit -n 1000 -s 'from collections import defaultdict;from functools import partial' \ > $'d=defaultdict(partial(list, [0]))\nfor x in xrange(1000):d[x].append(1)' > 1000 loops, best of 3: 723 usec per loop > > python -m timeit -n 1000 -s 'pass' \ > $'d={}\nfor x in xrange(1000):d.setdefault(x, [0]).append(1)' > 1000 loops, best of 3: 546 usec per loop > > python -m timeit -n 1000 -s 'pass' \ > $'d={}\nfor x in xrange(1000):\n if x in d:d[x].append(1)\n else:d[x]=[0,1]' > 1000 loops, best of 3: 282 usec per loop > > To be clear, for the scenario of defaultdict(list), defaultdict *is* > around 20% faster than the optimized dict equivalent (py2.6 timings > specifically). > > Where defaultdict breaks down is when instantiation is semi complex- > if you have to rely on lambda for example, the frame overhead is going > to add up pretty quick. In addition, reliance on defaultdict means > you lose the ability to do site specific faster versions ([0,1] for > example). > > Pretty much, if you're going to sell folk on defaultdict, sell them on > code cleanliness: > > # consider this: > d = {} > for key, (subkey, val) in source_items: > if key in d: > if subkey in d[key]: > d[key][subkey].extend(subval) > else: > d[key][subkey] = list(subval) > else: > d[key] = {subkey:list(subval)} > > # simplified... > d = {} > for key, (subkey, val) in source_items: > d.setdefault(key, {}).setdefault(subkey, []).extend(val) > > # or using defaultdict > d = defaultdict(partial(defaultdict, list)) > for key, (subkey, val) in source_items: > d[key][subkey].extend(val) > > > While that's an abbreviated example, if one imagines the logic being > a fair bit more complex for assignment/mangling of subkey/val, the > slightly tricky defaultdict setup used in the last example is offset > in maintenance costs pretty quickly via not having to dink around > with setdefault or equivalent logic. > > Hell, consider the following- > > def f(): > return defaultdict(f) > > my_tree = f() > my_tree[1][2][3][4][5][6][7][8][9] > my_tree[1][3] > > Stuff like that really is the power of defaultdict (more the power of > __missing__, but you seem to be skipping that detail in your nugget > thingy-mo-bob). > > ~harring > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From glen at glenjarvis.com Fri Aug 27 18:23:13 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Fri, 27 Aug 2010 09:23:13 -0700 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: <20100827110044.GG18926@hrair> References: <20100827110044.GG18926@hrair> Message-ID: Brian, This was a freakin' awesome critical analysis. I didn't know about the 'has_key' being punted. As I have seen the 'in' used (and liked it), I didn't realize one was preferred over the other. I agree that the 'in' is a much more pythonic way to do this. (I didn't realize it was faster too). Very good call. When I did the decorator newbie nugget, I also got some *really* valuable feedback -- for example -- simply don't use "decorator.py" as my example to import from because it confused everyone when I did "from decorator import ..." -- they thought it was a built in library. I hadn't even thought of it, but that was *great* advise and a great learning experience for me. I'm getting the best end of the deal where, when I present something like this, I get incredible feedback and learn more about it than I ever would have by just reading on my own... KUDOS to all and thanks for the feedback. Hopefully this has also been helpful to everyone else.... It certainly has been for me... Cheers, Glen On Fri, Aug 27, 2010 at 4:00 AM, Brian Harring wrote: > On Thu, Aug 26, 2010 at 11:16:22PM -0700, Glen Jarvis wrote: > > >>> for color, value in input: > > > > ... if output.has_key(color): > > > > ... output[color].append(value) > > > > ... else: > > > > ... output[color] = [value] > > > > ... > > Use 'color in output', avoid the has_key... if this is targeted as an > intro to python, has_key should *not* be mentioned- it's slower than > doing 'in' due to method lookup and it was punted from py3k. Been > frowned upon for a long while. > > Teaching someone new to python, either you can tell them about > list.index, dict.has_key, or you can tell them about the 'in' > operator. Expose new folk to just the latter, they have one rule to > know- specifically knowing about the containment protocol. > > This is generally the pythonic way- who cares if it's a dict or a list > or a tuple, if it quacks like a duck (does containment), then treat it > like a duck (it's sequence like). > > > > What a default dictionary type is, it's simply a subclassed version of > > the dictionary that does a few special things. > > > > You give it a basic 'factory function' -- in our case a list -- and > > that's what's initialized for a key the first time it is accessed. We > > don't have to worry if the key was previously initialized, etc.. > > Instantiated if the key is missing, rather than 'first time access'. > It's pedantic correction, but the wording you're using here conflicts > with- > > d = defaultdict(list) > d[1].append(2) > del d[1] > print d[1] > > > > Some will argue that this is less explicit -- and I would probably > have > > been one of them when I first started preparing this newbie nugget. > > But, after doing over this a few times to explain it, I've finally > > started to come on board to the idea. We're explicitly stating the > > default type when we initialize the defaultdict variable. > > > > I especially like it that the default dict gives a default type for > any > > key -- not for a specific key as setdefault seems to do (correct me if > > I misspeak here). > > The phrasing/selling point here is questionable; how it reads to me is > claiming that all key/vals wind up using that factory function > (trying to sell the notion of 'default type' specifically), which > isn't the case. Might want to reword that. > > As for setdefault, the phrasing there is further confusing. > setdefault has no notion of default type... it's purely "if the key > doesn't exist, use this default". > > > > But, more than anything, it's *much faster* than doing it the other > > ways.. But, I want you to prove that to yourself and to me? I have > > created a 1 GB file with colors and numbers. I'll give you this file > so > > that you can read it in and create the dictionary of your choice, with > > the method of your choice. > > > You really shouldn't be trying to sell defaultdict on it's speed since > it's not much of a gurantee. > > Consider the following: > > python -m timeit -n 1000 -s 'from collections import defaultdict;' \ > $'d=defaultdict(lambda :[0])\nfor x in xrange(1000):d[x].append(1)' > 1000 loops, best of 3: 794 usec per loop > > # optimized variant. > python -m timeit -n 1000 -s 'from collections import defaultdict;from > functools import partial' \ > $'d=defaultdict(partial(list, [0]))\nfor x in xrange(1000):d[x].append(1)' > 1000 loops, best of 3: 723 usec per loop > > python -m timeit -n 1000 -s 'pass' \ > $'d={}\nfor x in xrange(1000):d.setdefault(x, [0]).append(1)' > 1000 loops, best of 3: 546 usec per loop > > python -m timeit -n 1000 -s 'pass' \ > $'d={}\nfor x in xrange(1000):\n if x in d:d[x].append(1)\n > else:d[x]=[0,1]' > 1000 loops, best of 3: 282 usec per loop > > To be clear, for the scenario of defaultdict(list), defaultdict *is* > around 20% faster than the optimized dict equivalent (py2.6 timings > specifically). > > Where defaultdict breaks down is when instantiation is semi complex- > if you have to rely on lambda for example, the frame overhead is going > to add up pretty quick. In addition, reliance on defaultdict means > you lose the ability to do site specific faster versions ([0,1] for > example). > > Pretty much, if you're going to sell folk on defaultdict, sell them on > code cleanliness: > > # consider this: > d = {} > for key, (subkey, val) in source_items: > if key in d: > if subkey in d[key]: > d[key][subkey].extend(subval) > else: > d[key][subkey] = list(subval) > else: > d[key] = {subkey:list(subval)} > > # simplified... > d = {} > for key, (subkey, val) in source_items: > d.setdefault(key, {}).setdefault(subkey, []).extend(val) > > # or using defaultdict > d = defaultdict(partial(defaultdict, list)) > for key, (subkey, val) in source_items: > d[key][subkey].extend(val) > > > While that's an abbreviated example, if one imagines the logic being > a fair bit more complex for assignment/mangling of subkey/val, the > slightly tricky defaultdict setup used in the last example is offset > in maintenance costs pretty quickly via not having to dink around > with setdefault or equivalent logic. > > Hell, consider the following- > > def f(): > return defaultdict(f) > > my_tree = f() > my_tree[1][2][3][4][5][6][7][8][9] > my_tree[1][3] > > Stuff like that really is the power of defaultdict (more the power of > __missing__, but you seem to be skipping that detail in your nugget > thingy-mo-bob). > > ~harring > -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Fri Aug 27 18:30:13 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Fri, 27 Aug 2010 09:30:13 -0700 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: References: <20100827110044.GG18926@hrair> Message-ID: Zach, I hear ya :) The if color in output: blah; else: blah is the simplest way -- and the way I was most comfortable with until trying to put this newbie nugget together... There are a couple of things in the try/except that being lazy will get you in trouble -- the most notable, in my opinion, is the 'except' on any condition. What if, for whatever reason, the output[color].append(value) takes a very long time (minutes) for some strange scenario that we can cook up? If you want to interrupt it during this time, no Keyboard Interruption will be excepted as all exceptions are caught.... This is also against the PEP-8 coding standard: - When catching exceptions, mention specific exceptions whenever possible instead of using a bare 'except:' clause. For example, use: try: import platform_specific_module except ImportError: platform_specific_module = None A bare 'except:' clause will catch SystemExit and KeyboardInterrupt exceptions, making it harder to interrupt a program with Control-C, and can disguise other problems. If you want to catch all exceptions that signal program errors, use 'except Exception:'. 2010/8/27 Zach Collins > Personally, I'm frequently tempted to just > > try: > output[color].append(value) > except: > output[color] = [value] > > It's pythonic because I'm a lazy arse :P > > On Aug 27, 2010, at 6:00 AM, Brian Harring wrote: > > > On Thu, Aug 26, 2010 at 11:16:22PM -0700, Glen Jarvis wrote: > >>>>> for color, value in input: > >> > >> ... if output.has_key(color): > >> > >> ... output[color].append(value) > >> > >> ... else: > >> > >> ... output[color] = [value] > >> > >> ... > > > > Use 'color in output', avoid the has_key... if this is targeted as an > > intro to python, has_key should *not* be mentioned- it's slower than > > doing 'in' due to method lookup and it was punted from py3k. Been > > frowned upon for a long while. > > > > Teaching someone new to python, either you can tell them about > > list.index, dict.has_key, or you can tell them about the 'in' > > operator. Expose new folk to just the latter, they have one rule to > > know- specifically knowing about the containment protocol. > > > > This is generally the pythonic way- who cares if it's a dict or a list > > or a tuple, if it quacks like a duck (does containment), then treat it > > like a duck (it's sequence like). > > > > > >> What a default dictionary type is, it's simply a subclassed version of > >> the dictionary that does a few special things. > >> > >> You give it a basic 'factory function' -- in our case a list -- and > >> that's what's initialized for a key the first time it is accessed. We > >> don't have to worry if the key was previously initialized, etc.. > > > > Instantiated if the key is missing, rather than 'first time access'. > > It's pedantic correction, but the wording you're using here conflicts > > with- > > > > d = defaultdict(list) > > d[1].append(2) > > del d[1] > > print d[1] > > > > > >> Some will argue that this is less explicit -- and I would probably > have > >> been one of them when I first started preparing this newbie nugget. > >> But, after doing over this a few times to explain it, I've finally > >> started to come on board to the idea. We're explicitly stating the > >> default type when we initialize the defaultdict variable. > >> > >> I especially like it that the default dict gives a default type for > any > >> key -- not for a specific key as setdefault seems to do (correct me if > >> I misspeak here). > > > > The phrasing/selling point here is questionable; how it reads to me is > > claiming that all key/vals wind up using that factory function > > (trying to sell the notion of 'default type' specifically), which > > isn't the case. Might want to reword that. > > > > As for setdefault, the phrasing there is further confusing. > > setdefault has no notion of default type... it's purely "if the key > > doesn't exist, use this default". > > > > > >> But, more than anything, it's *much faster* than doing it the other > >> ways.. But, I want you to prove that to yourself and to me? I have > >> created a 1 GB file with colors and numbers. I'll give you this file > so > >> that you can read it in and create the dictionary of your choice, with > >> the method of your choice. > > > > > > You really shouldn't be trying to sell defaultdict on it's speed since > > it's not much of a gurantee. > > > > Consider the following: > > > > python -m timeit -n 1000 -s 'from collections import defaultdict;' \ > > $'d=defaultdict(lambda :[0])\nfor x in xrange(1000):d[x].append(1)' > > 1000 loops, best of 3: 794 usec per loop > > > > # optimized variant. > > python -m timeit -n 1000 -s 'from collections import defaultdict;from > functools import partial' \ > > $'d=defaultdict(partial(list, [0]))\nfor x in > xrange(1000):d[x].append(1)' > > 1000 loops, best of 3: 723 usec per loop > > > > python -m timeit -n 1000 -s 'pass' \ > > $'d={}\nfor x in xrange(1000):d.setdefault(x, [0]).append(1)' > > 1000 loops, best of 3: 546 usec per loop > > > > python -m timeit -n 1000 -s 'pass' \ > > $'d={}\nfor x in xrange(1000):\n if x in d:d[x].append(1)\n > else:d[x]=[0,1]' > > 1000 loops, best of 3: 282 usec per loop > > > > To be clear, for the scenario of defaultdict(list), defaultdict *is* > > around 20% faster than the optimized dict equivalent (py2.6 timings > > specifically). > > > > Where defaultdict breaks down is when instantiation is semi complex- > > if you have to rely on lambda for example, the frame overhead is going > > to add up pretty quick. In addition, reliance on defaultdict means > > you lose the ability to do site specific faster versions ([0,1] for > > example). > > > > Pretty much, if you're going to sell folk on defaultdict, sell them on > > code cleanliness: > > > > # consider this: > > d = {} > > for key, (subkey, val) in source_items: > > if key in d: > > if subkey in d[key]: > > d[key][subkey].extend(subval) > > else: > > d[key][subkey] = list(subval) > > else: > > d[key] = {subkey:list(subval)} > > > > # simplified... > > d = {} > > for key, (subkey, val) in source_items: > > d.setdefault(key, {}).setdefault(subkey, []).extend(val) > > > > # or using defaultdict > > d = defaultdict(partial(defaultdict, list)) > > for key, (subkey, val) in source_items: > > d[key][subkey].extend(val) > > > > > > While that's an abbreviated example, if one imagines the logic being > > a fair bit more complex for assignment/mangling of subkey/val, the > > slightly tricky defaultdict setup used in the last example is offset > > in maintenance costs pretty quickly via not having to dink around > > with setdefault or equivalent logic. > > > > Hell, consider the following- > > > > def f(): > > return defaultdict(f) > > > > my_tree = f() > > my_tree[1][2][3][4][5][6][7][8][9] > > my_tree[1][3] > > > > Stuff like that really is the power of defaultdict (more the power of > > __missing__, but you seem to be skipping that detail in your nugget > > thingy-mo-bob). > > > > ~harring > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Fri Aug 27 19:41:56 2010 From: bdbaddog at gmail.com (William Deegan) Date: Fri, 27 Aug 2010 10:41:56 -0700 Subject: [Baypiggies] zope/plone errors on baypiggies.net Message-ID: Greetings, Do we have any zope/plone ista's who can help straighten out some errors on the plone instance which hosts baypiggies.net? Here's the stack trace I"m seeing: Traceback (innermost last): Module ZPublisher.Publish, line 119, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 42, in call_object Module Shared.DC.Scripts.Bindings, line 313, in __call__ Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec Module Products.CMFCore.FSPageTemplate, line 216, in _exec Module Products.CMFCore.FSPageTemplate, line 155, in pt_render Module Products.PageTemplates.PageTemplate, line 98, in pt_render Module zope.pagetemplate.pagetemplate, line 117, in pt_render - Warning: Macro expansion failed - Warning: exceptions.KeyError: 'obj' Module zope.tal.talinterpreter, line 271, in __call__ Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 891, in do_useMacro Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 536, in do_optTag_tal Module zope.tal.talinterpreter, line 521, in do_optTag Module zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 957, in do_defineSlot Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 536, in do_optTag_tal Module zope.tal.talinterpreter, line 521, in do_optTag Module zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 861, in do_defineMacro Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 957, in do_defineSlot Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 536, in do_optTag_tal Module zope.tal.talinterpreter, line 521, in do_optTag Module zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 536, in do_optTag_tal Module zope.tal.talinterpreter, line 525, in do_optTag Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 949, in do_defineSlot Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 861, in do_defineMacro Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 536, in do_optTag_tal Module zope.tal.talinterpreter, line 521, in do_optTag Module zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 861, in do_defineMacro Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 891, in do_useMacro Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 855, in do_condition Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 855, in do_condition Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 534, in do_optTag_tal Module zope.tal.talinterpreter, line 516, in no_tag Module zope.tal.talinterpreter, line 346, in interpret Module zope.tal.talinterpreter, line 760, in do_insertStructure_tal Module zope.tal.talinterpreter, line 784, in insertHTMLStructure Module zope.tal.talinterpreter, line 65, in __init__ Module zope.tal.talgenerator, line 41, in __init__ AttributeError: 'ZopeContext' object has no attribute 'getCompilerError' -------------- next part -------------- An HTML attachment was scrubbed... URL: From rami.chowdhury at merton.oxon.org Fri Aug 27 19:54:59 2010 From: rami.chowdhury at merton.oxon.org (Rami Chowdhury) Date: Fri, 27 Aug 2010 23:54:59 +0600 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: References: Message-ID: Hey Glen, Great notes -- thanks for posting them, I'm glad to see them as I wasn't able to be at the meeting. Did you mention the __missing__ magic method, in Python 2.5 and up, which can be used for defaultdict-like (and other fun) behavior? Cheers, Rami On Fri, Aug 27, 2010 at 12:16, Glen Jarvis wrote: > Here are notes with code that I used in my Newbie Nugget presentation today. > This will give you time to review the code line by line (good suggestion > Wesley) and get a feel for what is happening. > > As a reminder: > The input is: > input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] > And, we want an output dictionary so that something like this is reported: > output['red'] = [1] > output['blue'] = [2, 4] > output['yellow'] = [1, 3] > > There are lots of ways to do this, and I invite other suggestions/input. > If we were to start with these few lines, we'll see some limited success: > Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> >>>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', >>>> 1)] >>>> >>>> output = {} >>>> >>>> output['yellow'] = [1] >>>> output['yellow'].append(3) >>>> >>>> print output > {'yellow': [1, 3]} > But, how do we sort this out so that we always initialize the value to be a > list value If we forget, we'll see something like this > [continuing from above] >>>> print output > {'yellow': [1, 3]} >>>> output['blue'].append(2) > Traceback (most recent call last): > ??File "", line 1, in > KeyError: 'blue' > We can't append something to the stuff that is associated with the 'blue' > key, because nothing exists yet for the blue key. We need to initialize it > before we can append to it. > So, what we really want is to have some type of default behavior given to > us. For example, > Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> >>>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', >>>> 1)] >>>> >>>> output = {} >>>> >>>> for color, value in input: > ... ? ? if output.has_key(color): > ... ? ? ? ? output[color].append(value) > ... ? ? else: > ... ? ? ? ? output[color] = [value] > ... >>>> print output > {'blue': [2, 4], 'red': [1], 'yellow': [1, 3]} > > One could argue that this is just fine -- this is very clear, and it works. > And, frankly, there's merit to that argument. > However, if we did this many times with many different types of > dictionaries, and we couldn't really make a generic routine that we could > use to handle this, we'll have this same pattern over and over: > if something.has_key(?): > ?? ?something[?] = > else: > ?? ?something[?] = > > What if there was another design pattern to do this? What if you could > somehow set a 'default' behavior so that, if the key didn't exist, you > automatically got, in our example, a list so you could append to it. That > is, we'd have code that looked like this: > ?? ?output[color].append(value) > This does fit our brain, because we really just want to append values as > we're going and not have to think of the special case of (oh, if the key > exists do this; or if it doesn't, do that; etc.) > The collections.defaultdict object does the above. However, before we talk > about it -- there will be some in the audience that will say, "Wait a > minute? ?This is what setdefault does." And, they'd be right. > So, let's take a break from this newbie nugget to give you another newbie > nugget -- the setdefult (unless you already know about it). > The set default method can be used on a dictionary to set the default for a > key. And, it can be done multiple times without causing a problem. So, for > my output dictionary, if I set the default to a list (for the key yellow, > for example), then whenever I access the output dictionary through the > yellow key, I get a dictionary automatically. And, thus, we can tack an > 'append' on to that list that's given to us by default. Here's an example: > Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. >>>> >>>> >>>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', >>>> 1)]>>> >>>> output = {} >>>> >>>> for color, value in input: > ... ? ? output.setdefault(color, []).append(value) > ... >>>> print output > {'blue': [2, 4], 'red': [1], 'yellow': [1, 3]} > For each key in the dictionary, the default value is a list and the value is > appended to it. Although, it does seem we're having to set the default for > every single key -- not for any key in the dictionary. > But, that's a good transition to the collections.defaultdict because that's > exactly what it does. >>>> from collections import defaultdict >>>> >>>> input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', >>>> 1)] >>>> >>>> output = defaultdict(list) >>>> >>>> for color, value in input: > ... ? ? output[color].append(value) > ... >>>> print output > defaultdict(, {'blue': [2, 4], 'red': [1], 'yellow': [1, 3]}) > Don't be scared about this extra output -- just notice that the colors have > the right lists. If you wanted to print these out by keys, you'll still get > the results that you want: >>>> print output['blue'] > [2, 4] > What a default dictionary type is, it's simply a subclassed version of the > dictionary that does a few special things. > You give it a basic 'factory function' -- in our case a list -- and that's > what's initialized for a key the first time it is accessed. We don't have to > worry if the key was previously initialized, etc.. > Some will argue that this is less explicit -- and I would probably have been > one of them when I first started preparing this newbie nugget. But, after > doing over this a few times to explain it, I've finally started to come on > board to the idea. We're explicitly stating the default type when we > initialize the defaultdict variable. > I especially like it that the default dict gives a default type for any key > -- not for a specific key as setdefault seems to do (correct me if I > misspeak here). > But, more than anything, it's *much faster* than doing it the other ways.. > But, I want you to prove that to yourself and to me? I have created a 1 GB > file with colors and numbers. I'll give you this file so that you can read > it in and create the dictionary of your choice, with the method of your > choice. > You can time how long it takes for dictionary creation, with the list > appending, and everything. > Remember that your dictionary will be in memory and will be about a gig of > ram also. If your machine doesn't have those resources, read only half the > file. In fact, it would be interesting to do this for a random number of > records in the file, multiple times, to get a feel for how this grows for > each data type. > Come on, it'll be good practice if you've never done this before? Lets > compare notes when you're finished. > -- > Whatever you can do or imagine, begin it; > boldness has beauty, magic, and power in it. > > -- Goethe > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) From Chris.Clark at ingres.com Fri Aug 27 19:54:27 2010 From: Chris.Clark at ingres.com (Chris Clark) Date: Fri, 27 Aug 2010 10:54:27 -0700 Subject: [Baypiggies] Graham Dumpleton (mod_wsgi) will be in the Bay Area in Sept Message-ID: <4C77FBD3.5020703@ingres.com> Anyone interested in a mod_wsgi talk? See http://blog.dscpl.com.au/2010/08/2010-modwsgi-world-road-show.html for info and contact information. I'm not clear what his dates are though. Chris From glen at glenjarvis.com Fri Aug 27 20:22:43 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Fri, 27 Aug 2010 11:22:43 -0700 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: References: Message-ID: > > Great notes -- thanks for posting them, I'm glad to see them as I > wasn't able to be at the meeting. > > Did you mention the __missing__ magic method, in Python 2.5 and up, > which can be used for defaultdict-like (and other fun) behavior? > I didn't... I didn't know about it, actually... In the future, I obviously need to send this *first* to BayPIGgies a few weeks ahead to get all of this valuable feedback up front. There are still layers to learn/understand here. We have *plenty* of choices to handle this one itty bitty situation... Cheers, Glen -- Whatever you can do or imagine, begin it; boldness has beauty, magic, and power in it. -- Goethe -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Clark at ingres.com Fri Aug 27 21:01:59 2010 From: Chris.Clark at ingres.com (Chris Clark) Date: Fri, 27 Aug 2010 12:01:59 -0700 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: References: Message-ID: <4C780BA7.8060200@ingres.com> Great discussion, thanks for kicking this off Glen! As Brian pointed out syntax/simplicity is the reason for default dict, performance is not in the running. I actually almost never use the defaultdict, part of the reason is that I'm often on a pre 2.5 interpreter. You can use the regular dict and still keep the code fairly clean using get(), but it isn't as nice as defaultdict. """Performance figures/output from my desktop: 12.9385441449 def_dict 6.60369553361 reg_dict """ import timeit def def_dict(): from collections import defaultdict # NOTE needs python 2.5+ input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] output = defaultdict(list) for color, value in input: output[color].append(value) def reg_dict(): input = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)] output2 = {} for color, value in input: tmp_entry = output2.get(color, []) tmp_entry.append(value) output2[color] = tmp_entry if __name__ == '__main__': names = ['def_dict', 'reg_dict'] m = 5 m = 1000000 for name in names: t = timeit.Timer('%s()' % name, 'from __main__ import %s' % name) tmp_time = t.timeit(m) print tmp_time, name NOTE I followed Brian's approach of timing the import from collections, and setting up the source list. Chris Glen Jarvis wrote: > > Great notes -- thanks for posting them, I'm glad to see them as I > wasn't able to be at the meeting. > > Did you mention the __missing__ magic method, in Python 2.5 and up, > which can be used for defaultdict-like (and other fun) behavior? > > > I didn't... I didn't know about it, actually... In the future, I > obviously need to send this *first* to BayPIGgies a few weeks ahead to > get all of this valuable feedback up front. There are still layers to > learn/understand here. We have *plenty* of choices to handle this one > itty bitty situation... > > Cheers, > > > Glen > -- > Whatever you can do or imagine, begin it; > boldness has beauty, magic, and power in it. > > -- Goethe > ------------------------------------------------------------------------ > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From cappy2112 at gmail.com Fri Aug 27 20:51:42 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Fri, 27 Aug 2010 11:51:42 -0700 Subject: [Baypiggies] For the Ipython users Message-ID: Last night I mentioned a rewrite of IPython was in the works, but didn't recall the details Here is that information.... http://ipythonzmq.blogspot.com/2010/08/ipython-zmq-status.html From keith at dartworks.biz Fri Aug 27 21:20:36 2010 From: keith at dartworks.biz (Keith Dart) Date: Fri, 27 Aug 2010 12:20:36 -0700 Subject: [Baypiggies] Notes on defaultdict In-Reply-To: References: <20100827110044.GG18926@hrair> Message-ID: <20100827122036.0dda629a@dartworks.biz> On Fri, 27 Aug 2010 07:39:41 -0500 Zach Collins wrote: > try: > output[color].append(value) > except: > output[color] = [value] That's a pretty good way to do it, except for the bare "except" part. You should specifically catch the expected exception only. try: output[color].append(value) except KeyError: output[color] = [value] That is generally the best practice for any exception handling. Only catch what you are prepared to handle in your current scope. -- -- ------------------------------ Keith Dart ================================= From michael at fandomhome.com Fri Aug 27 20:49:44 2010 From: michael at fandomhome.com (Michael R. Bernstein) Date: Fri, 27 Aug 2010 12:49:44 -0600 (MDT) Subject: [Baypiggies] zope/plone errors on baypiggies.net In-Reply-To: References: Message-ID: <10288.209.189.131.15.1282934984.squirrel@mail1.webfaction.com> William Deegan wrote: > Greetings, > > Do we have any zope/plone ista's who can help straighten out some errors > on the plone instance which hosts baypiggies.net? > > Here's the stack trace I'm seeing: William, I can make time to look at this over the weekend. Meanwhile, please feel free to email me the details of the setup, and the context in which you're getting that traceback. -- Michael R. Bernstein http://www.michaelbernstein.com From nad at acm.org Fri Aug 27 23:00:38 2010 From: nad at acm.org (Ned Deily) Date: Fri, 27 Aug 2010 14:00:38 -0700 Subject: [Baypiggies] Graham Dumpleton (mod_wsgi) will be in the Bay Area in Sept References: <4C77FBD3.5020703@ingres.com> Message-ID: In article <4C77FBD3.5020703 at ingres.com>, Chris Clark wrote: > Anyone interested in a mod_wsgi talk? See > http://blog.dscpl.com.au/2010/08/2010-modwsgi-world-road-show.html for > info and contact information. > > I'm not clear what his dates are though. +1 -- Ned Deily, nad at acm.org From bpalmer at gmail.com Sat Aug 28 00:12:42 2010 From: bpalmer at gmail.com (Brian Palmer) Date: Fri, 27 Aug 2010 15:12:42 -0700 Subject: [Baypiggies] Looking for YouTube presenters for upcoming meetings In-Reply-To: References: Message-ID: On Thu, Aug 26, 2010 at 10:26 PM, Tony Cappellini wrote: > Do we have any of the YouTube staff on the list? > > If any of you work with YouTube employees who are working on an > interesting project, would you ask if they would be interested in > giving a presentation at an upcoming meeting? > I'll ask around to see if there's anything particularly interesting and pythonic. -------------- next part -------------- An HTML attachment was scrubbed... URL: From keith at dartworks.biz Sat Aug 28 00:28:00 2010 From: keith at dartworks.biz (Keith Dart) Date: Fri, 27 Aug 2010 15:28:00 -0700 Subject: [Baypiggies] tip for moving to Python 3 Message-ID: <20100827152800.5903a9b7@dartworks.biz> FYI, I started putting the following in my new Python 2.x code: from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals (up near the top, first code lines), and also: #!/usr/bin/python2.6 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab:fenc=utf-8 At the very top. This tells both Python and the editor (if it's vim) that the file contains utf-8 strings. This is to prepare the code (and my mind) for Python 3. -- -- ------------------------------ Keith Dart ================================= From simeonf at gmail.com Sat Aug 28 00:46:43 2010 From: simeonf at gmail.com (Simeon Franklin) Date: Fri, 27 Aug 2010 15:46:43 -0700 Subject: [Baypiggies] Graham Dumpleton (mod_wsgi) will be in the Bay Area in Sept In-Reply-To: <4C77FBD3.5020703@ingres.com> References: <4C77FBD3.5020703@ingres.com> Message-ID: On Fri, Aug 27, 2010 at 10:54 AM, Chris Clark wrote: > Anyone interested in a mod_wsgi talk? See > http://blog.dscpl.com.au/2010/08/2010-modwsgi-world-road-show.html for info > and contact information. +1 From aahz at pythoncraft.com Sat Aug 28 00:51:42 2010 From: aahz at pythoncraft.com (Aahz) Date: Fri, 27 Aug 2010 15:51:42 -0700 Subject: [Baypiggies] tip for moving to Python 3 In-Reply-To: <20100827152800.5903a9b7@dartworks.biz> References: <20100827152800.5903a9b7@dartworks.biz> Message-ID: <20100827225142.GA27860@panix.com> On Fri, Aug 27, 2010, Keith Dart wrote: > > FYI, I started putting the following in my new Python 2.x code: > > from __future__ import absolute_import > from __future__ import print_function > from __future__ import unicode_literals as long as you're doing that, you should probably go whole-hog: from __future__ import division -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "...if I were on life-support, I'd rather have it run by a Gameboy than a Windows box." --Cliff Wells From keith at dartworks.biz Sat Aug 28 01:00:42 2010 From: keith at dartworks.biz (Keith Dart) Date: Fri, 27 Aug 2010 16:00:42 -0700 Subject: [Baypiggies] tip for moving to Python 3 In-Reply-To: <20100827225142.GA27860@panix.com> References: <20100827152800.5903a9b7@dartworks.biz> <20100827225142.GA27860@panix.com> Message-ID: <20100827160042.13d6871e@dartworks.biz> On Fri, 27 Aug 2010 15:51:42 -0700 Aahz wrote: > as long as you're doing that, you should probably go whole-hog: > > from __future__ import division Good point. How could I forget that? ;-) -- -- ------------------------------ Keith Dart ================================= From keith at dartworks.biz Sat Aug 28 01:19:11 2010 From: keith at dartworks.biz (Keith Dart) Date: Fri, 27 Aug 2010 16:19:11 -0700 Subject: [Baypiggies] tip for moving to Python 3 In-Reply-To: <20100827225142.GA27860@panix.com> References: <20100827152800.5903a9b7@dartworks.biz> <20100827225142.GA27860@panix.com> Message-ID: <20100827161911.6df5dd21@dartworks.biz> On Fri, 27 Aug 2010 15:51:42 -0700 Aahz wrote: > as long as you're doing that, you should probably go whole-hog: oh, and you can also start using the "format" string method and functions. Using the associated "{}" syntax. name = "World" print("Hello {0}!".format(name)) -- -- ------------------------------ Keith Dart ================================= From nad at acm.org Sat Aug 28 01:31:38 2010 From: nad at acm.org (Ned Deily) Date: Fri, 27 Aug 2010 16:31:38 -0700 Subject: [Baypiggies] tip for moving to Python 3 References: <20100827152800.5903a9b7@dartworks.biz> <20100827225142.GA27860@panix.com> <20100827160042.13d6871e@dartworks.biz> Message-ID: In article <20100827160042.13d6871e at dartworks.biz>, Keith Dart wrote: > On Fri, 27 Aug 2010 15:51:42 -0700 > Aahz wrote: > > > as long as you're doing that, you should probably go whole-hog: > > > > from __future__ import division > > Good point. How could I forget that? ;-) And take a look at Six, "simple utilities for wrapping over differences between Python 2 and Python 3", from Python core developer Benjamin Peterson: http://pypi.python.org/pypi/six -- Ned Deily, nad at acm.org From jim at well.com Sat Aug 28 02:09:05 2010 From: jim at well.com (jim) Date: Fri, 27 Aug 2010 17:09:05 -0700 Subject: [Baypiggies] Graham Dumpleton (mod_wsgi) will be in the Bay Area in Sept In-Reply-To: References: <4C77FBD3.5020703@ingres.com> Message-ID: <1282954145.1911.5.camel@jim-laptop> Upcoming BayPIGgies meetings: September 23: Alex Martelli, Design Patterns October 28: Consulting as a Career Choice, Panel November 25: Thanksgiving # what to do? December 23: Two Days before Xmas # what to do? As to Chris Clark, there's the Noisebridge venue in San Francisco where he'd be welcome to speak; where in the Mountain View area could we set up a special meet? On Fri, 2010-08-27 at 15:46 -0700, Simeon Franklin wrote: > On Fri, Aug 27, 2010 at 10:54 AM, Chris Clark wrote: > > Anyone interested in a mod_wsgi talk? See > > http://blog.dscpl.com.au/2010/08/2010-modwsgi-world-road-show.html for info > > and contact information. > > +1 > _______________________________________________ > 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 Sat Aug 28 02:35:56 2010 From: jim at well.com (jim) Date: Fri, 27 Aug 2010 17:35:56 -0700 Subject: [Baypiggies] Graham Dumpleton (mod_wsgi) will be in the Bay Area in Sept In-Reply-To: <1282954145.1911.5.camel@jim-laptop> References: <4C77FBD3.5020703@ingres.com> <1282954145.1911.5.camel@jim-laptop> Message-ID: <1282955756.1911.15.camel@jim-laptop> (well, that was garbled. here's an improved response: ) We're booked for September 23, but let's consider finding an alternative time and place for Graham to speak, either at some place in the southbay or at noisebridge in SF or both. "Both" sounds good to me as there are a lot of pythonistas in the city and east bay that might not make it to the south bay and vice versa. On Fri, 2010-08-27 at 17:09 -0700, jim wrote: > Upcoming BayPIGgies meetings: > September 23: Alex Martelli, Design Patterns > October 28: Consulting as a Career Choice, Panel > November 25: Thanksgiving # what to do? > December 23: Two Days before Xmas # what to do? > > As to Chris Clark, there's the Noisebridge venue in > San Francisco where he'd be welcome to speak; where in > the Mountain View area could we set up a special meet? > > > > On Fri, 2010-08-27 at 15:46 -0700, Simeon Franklin wrote: > > On Fri, Aug 27, 2010 at 10:54 AM, Chris Clark wrote: > > > Anyone interested in a mod_wsgi talk? See > > > http://blog.dscpl.com.au/2010/08/2010-modwsgi-world-road-show.html for info > > > and contact information. > > > > +1 > > _______________________________________________ > > 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 mparker at energy-solution.com Mon Aug 30 18:28:52 2010 From: mparker at energy-solution.com (Marla Parker) Date: Mon, 30 Aug 2010 16:28:52 +0000 Subject: [Baypiggies] Graham Dumpleton visit Message-ID: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> I contacted Graham Dumpleton last week to let him know that my company would like to meet him and host an open talk if he is ever in the SF Bay area, and he replied conveniently enough about his first trip to the US coming up in October. Then he blogged about it and Jim commented that bay piggies would like to host a talk, too. So my question is: how many people would likely show up for a talk by Graham Dumpleton (mr. mod_wsgi) in SF? 10-20 or 100? I think SF would be most convenient for Graham - he is on a family vacation and only in SF for a few specific days, which he has yet to verify precisely. Possibly the only evening he could speak is Friday, October 8, but that is yet to be confirmed. Jim if you want to take this off list I'd be interested in what venue space you have in SF for a talk like this. I was thinking of trying to get space at the Pacific Energy Center because it is a really nice space for classes and meetings and having a bunch of python developers show up there might inspire more of them to figure out how to use their skills to tackle climate change. Marla From eric at ericwalstad.com Mon Aug 30 19:05:40 2010 From: eric at ericwalstad.com (Eric Walstad) Date: Mon, 30 Aug 2010 10:05:40 -0700 Subject: [Baypiggies] Graham Dumpleton visit In-Reply-To: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> References: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> Message-ID: Hi Marla, On Mon, Aug 30, 2010 at 9:28 AM, Marla Parker wrote: > So my question is: ?how many people would likely show up for a talk by Graham Dumpleton (mr. mod_wsgi) in SF? ?10-20 or 100? Many thanks to you and Energy Solutions for offering to host a talk by Graham. Please count me in. I'd like to suggest/request the mod_wsgi discussion include a bit of best practices for a resource efficient deployment (embedded mode vs daemon mode) with an eye toward django-specific issues. Eric. From hyperneato at gmail.com Mon Aug 30 19:19:55 2010 From: hyperneato at gmail.com (Isaac) Date: Mon, 30 Aug 2010 10:19:55 -0700 Subject: [Baypiggies] Graham Dumpleton visit In-Reply-To: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> References: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> Message-ID: +1 On Mon, Aug 30, 2010 at 9:28 AM, Marla Parker wrote: > > I contacted Graham Dumpleton last week to let him know that my company > would like to meet him and host an open talk if he is ever in the SF Bay > area, and he replied conveniently enough about his first trip to the US > coming up in October. Then he blogged about it and Jim commented that bay > piggies would like to host a talk, too. > > So my question is: how many people would likely show up for a talk by > Graham Dumpleton (mr. mod_wsgi) in SF? 10-20 or 100? > > I think SF would be most convenient for Graham - he is on a family vacation > and only in SF for a few specific days, which he has yet to verify > precisely. Possibly the only evening he could speak is Friday, October 8, > but that is yet to be confirmed. > > Jim if you want to take this off list I'd be interested in what venue space > you have in SF for a talk like this. I was thinking of trying to get space > at the Pacific Energy Center because it is a really nice space for classes > and meetings and having a bunch of python developers show up there might > inspire more of them to figure out how to use their skills to tackle climate > change. > > Marla > > > _______________________________________________ > 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: From simeonf at gmail.com Mon Aug 30 19:20:17 2010 From: simeonf at gmail.com (Simeon Franklin) Date: Mon, 30 Aug 2010 10:20:17 -0700 Subject: [Baypiggies] Graham Dumpleton visit In-Reply-To: References: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> Message-ID: +1 - I'd likely be there. On Mon, Aug 30, 2010 at 10:05 AM, Eric Walstad wrote: > Hi Marla, > > On Mon, Aug 30, 2010 at 9:28 AM, Marla Parker > wrote: >> So my question is: ?how many people would likely show up for a talk by Graham Dumpleton (mr. mod_wsgi) in SF? ?10-20 or 100? > Many thanks to you and Energy Solutions for offering to host a talk by > Graham. ?Please count me in. ?I'd like to suggest/request the mod_wsgi > discussion include a bit of best practices for a resource efficient > deployment (embedded mode vs daemon mode) with an eye toward > django-specific issues. > > Eric. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From jim at systemateka.com Mon Aug 30 19:31:21 2010 From: jim at systemateka.com (jim) Date: Mon, 30 Aug 2010 10:31:21 -0700 Subject: [Baypiggies] Graham Dumpleton visit In-Reply-To: References: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> Message-ID: <1283189481.1899.61.camel@jim-laptop> Hi, I've been on Graham's blogger.com site https://www.blogger.com/comment.g?blogID=2363643920942057324&postID=7567106415871410774 and he's replied that he'll be available for one Friday evening during the time he's in the SF bay area. He doesn't know the date yet, his wife is making arrangements, he'll know soon. I asked if he'll be in SF proper or in some other part of the bay area. No reply to that question. If SF proper, perhaps the noisebridge location would be good (it's near a BART stop and major SF Muni lines and perhaps more convenient not only for Graham but for people coming from north bay and mid- and south-peninsula)? Energy Solutions is close to the 19th Street Oakland BART station (also convenient to BART). Opinions or ideas? On Mon, 2010-08-30 at 10:05 -0700, Eric Walstad wrote: > Hi Marla, > > On Mon, Aug 30, 2010 at 9:28 AM, Marla Parker > wrote: > > So my question is: how many people would likely show up for a talk > > by Graham Dumpleton (mr. mod_wsgi) in SF? 10-20 or 100? > Many thanks to you and Energy Solutions for offering to host a talk by > Graham. Please count me in. I'd like to suggest/request the mod_wsgi > discussion include a bit of best practices for a resource efficient > deployment (embedded mode vs daemon mode) with an eye toward > django-specific issues. > > Eric. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From fred at kas-group.com Mon Aug 30 19:33:59 2010 From: fred at kas-group.com (Fred C) Date: Mon, 30 Aug 2010 10:33:59 -0700 Subject: [Baypiggies] Graham Dumpleton visit In-Reply-To: References: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> Message-ID: On Aug 30, 2010, at 10:20 AM, Simeon Franklin wrote: > +1 - I'd likely be there. +1 - if this is not too early in the afternoon I can be there. > > On Mon, Aug 30, 2010 at 10:05 AM, Eric Walstad wrote: >> Hi Marla, >> >> On Mon, Aug 30, 2010 at 9:28 AM, Marla Parker >> wrote: >>> So my question is: how many people would likely show up for a talk by Graham Dumpleton (mr. mod_wsgi) in SF? 10-20 or 100? >> Many thanks to you and Energy Solutions for offering to host a talk by >> Graham. Please count me in. I'd like to suggest/request the mod_wsgi >> discussion include a bit of best practices for a resource efficient >> deployment (embedded mode vs daemon mode) with an eye toward >> django-specific issues. >> >> Eric. >> _______________________________________________ >> 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 -- Writing Java code is like using a sledgehammer to hang a picture frame. Fred C. fred at bsdhost.net http://kiq.me/JP From bryceverdier at gmail.com Mon Aug 30 22:57:01 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Mon, 30 Aug 2010 13:57:01 -0700 Subject: [Baypiggies] Graham Dumpleton visit In-Reply-To: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> References: <9AE59768-0AE8-4FFD-BB85-DE42F508AD28@energy-solution.com> Message-ID: <4C7C1B1D.6030101@gmail.com> +1, but would prefer more of a night than afternoon talk. (Working swing sucks sometimes.) Bryce On 08/30/2010 09:28 AM, Marla Parker wrote: > I contacted Graham Dumpleton last week to let him know that my company would like to meet him and host an open talk if he is ever in the SF Bay area, and he replied conveniently enough about his first trip to the US coming up in October. Then he blogged about it and Jim commented that bay piggies would like to host a talk, too. > > So my question is: how many people would likely show up for a talk by Graham Dumpleton (mr. mod_wsgi) in SF? 10-20 or 100? > > I think SF would be most convenient for Graham - he is on a family vacation and only in SF for a few specific days, which he has yet to verify precisely. Possibly the only evening he could speak is Friday, October 8, but that is yet to be confirmed. > > Jim if you want to take this off list I'd be interested in what venue space you have in SF for a talk like this. I was thinking of trying to get space at the Pacific Energy Center because it is a really nice space for classes and meetings and having a bunch of python developers show up there might inspire more of them to figure out how to use their skills to tackle climate change. > > Marla > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies