From rshepard at appl-ecosys.com Fri May 2 18:00:52 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Fri, 2 May 2008 09:00:52 -0700 (PDT) Subject: [portland] Step Value in range() Message-ID: Is it possible to write a range() call with a less-than-integral step? Specifically, I would like to call range(0.0, 100.0, 0.1). It seems this is not allowed; only integers need apply. Any way of using floats in range()? Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation Voice: 503-667-4517 Fax: 503-667-8863 From kirby.urner at gmail.com Fri May 2 18:40:24 2008 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 2 May 2008 09:40:24 -0700 Subject: [portland] Step Value in range() In-Reply-To: References: Message-ID: The popular Numeric package, also NumPy, has arange as a built-in, allowing just what you suggest. I like installing VPython (Visual Python) from VPython.org, as that'll give you a working Numeric right out of the box, plus these other cool tools, including plots (very simple, but there're plenty of other add-ons for fancy). Relevant (sort of): http://mybizmo.blogspot.com/2008/04/plotting-with-vpython.html http://controlroom.blogspot.com/2008/04/sa-classnotes-2008426.html Or do stuff like: for x in [(1.00 + n * 0.01) for n in range(11)] 'n stuff. Kirby IDLE 1.2.1 >>> [(1.00 + n * 0.01) for n in range(11)] [1.0, 1.01, 1.02, 1.03, 1.04, 1.05, 1.0600000000000001, 1.0700000000000001, 1.0800000000000001, 1.0900000000000001, 1.1000000000000001] On Fri, May 2, 2008 at 9:00 AM, Rich Shepard wrote: > Is it possible to write a range() call with a less-than-integral step? > Specifically, I would like to call range(0.0, 100.0, 0.1). It seems this is > not allowed; only integers need apply. > > Any way of using floats in range()? > > Rich > > -- > Richard B. Shepard, Ph.D. | Integrity Credibility > Applied Ecosystem Services, Inc. | Innovation > Voice: 503-667-4517 Fax: 503-667-8863 > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From python at dylanreinhardt.com Fri May 2 18:44:20 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Fri, 2 May 2008 09:44:20 -0700 Subject: [portland] Step Value in range() In-Reply-To: References: Message-ID: <4c645a720805020944u13d5a08as7eb7fc6918446cfc@mail.gmail.com> I don't know of one off-hand... but you could add a few zeroes to your range and divide them off with a list comprehension, ex: [ i/1000.0 for i in range(10) ] To get the floats 0 to .9, stepping .001 On Fri, May 2, 2008 at 9:00 AM, Rich Shepard wrote: > Is it possible to write a range() call with a less-than-integral step? > Specifically, I would like to call range(0.0, 100.0, 0.1). It seems this is > not allowed; only integers need apply. > > Any way of using floats in range()? > > Rich > > -- > Richard B. Shepard, Ph.D. | Integrity Credibility > Applied Ecosystem Services, Inc. | Innovation > Voice: 503-667-4517 Fax: 503-667-8863 > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From python at dylanreinhardt.com Fri May 2 18:46:44 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Fri, 2 May 2008 09:46:44 -0700 Subject: [portland] Step Value in range() In-Reply-To: <4c645a720805020944u13d5a08as7eb7fc6918446cfc@mail.gmail.com> References: <4c645a720805020944u13d5a08as7eb7fc6918446cfc@mail.gmail.com> Message-ID: <4c645a720805020946h18fe45dfwa16f09580aa3c172@mail.gmail.com> On Fri, May 2, 2008 at 9:44 AM, Dylan Reinhardt wrote: > [ i/1000.0 for i in range(10) ] > > To get the floats 0 to .9, stepping .001 Check that... 0 to .009, stepping .001 Kirby's solution is probably the correct one, though. From rshepard at appl-ecosys.com Fri May 2 19:00:41 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Fri, 2 May 2008 10:00:41 -0700 (PDT) Subject: [portland] Step Value in range() In-Reply-To: References: Message-ID: On Fri, 2 May 2008, kirby urner wrote: > The popular Numeric package, also NumPy, has arange as a built-in, > allowing just what you suggest. Numeric is deprecated and I've installed numpy. I use arange(), but wondered if range() was also capable of non-interger steps. > I like installing VPython (Visual Python) from VPython.org, as that'll > give you a working Numeric right out of the box, plus these other cool > tools, including plots (very simple, but there're plenty of other > add-ons for fancy). Looks like a winduhs tool. I know of no linux/*BSD coding language that's Visual anything. So, the answer to my question is 'no.' Thanks, Kirby, Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation Voice: 503-667-4517 Fax: 503-667-8863 From rshepard at appl-ecosys.com Fri May 2 19:01:23 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Fri, 2 May 2008 10:01:23 -0700 (PDT) Subject: [portland] Step Value in range() In-Reply-To: <4c645a720805020944u13d5a08as7eb7fc6918446cfc@mail.gmail.com> References: <4c645a720805020944u13d5a08as7eb7fc6918446cfc@mail.gmail.com> Message-ID: On Fri, 2 May 2008, Dylan Reinhardt wrote: > I don't know of one off-hand... but you could add a few zeroes to your > range and divide them off with a list comprehension, ex: > > [ i/1000.0 for i in range(10) ] > > To get the floats 0 to .9, stepping .001 I'll stick with numpy's arange(), then. Thanks, Dylan, Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation Voice: 503-667-4517 Fax: 503-667-8863 From kirby.urner at gmail.com Fri May 2 20:45:43 2008 From: kirby.urner at gmail.com (kirby urner) Date: Fri, 2 May 2008 11:45:43 -0700 Subject: [portland] Step Value in range() In-Reply-To: References: Message-ID: On Fri, May 2, 2008 at 10:00 AM, Rich Shepard wrote: > Looks like a winduhs tool. I know of no linux/*BSD coding language that's > Visual anything. You find instructions for installing VPython on Linux, Mac but it's a pain unless you just grab 3.1.1 through Ubuntu (where I run it sometimes). Works great with student learners, part of my Saturday Academy classes (preparing for tomorrow's as we speak). It's an open source C++ library out of Carnegie-Mellon, nothing to do with the Visual * products out of Microsoft. But I can see where you might be confused. > > So, the answer to my question is 'no.' >>> help(range) Help on built-in function range in module __builtin__: range(...) range([start,] stop[, step]) -> list of integers Return a list containing an arithmetic progression of integers. range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0. When step is given, it specifies the increment (or decrement). For example, range(4) returns [0, 1, 2, 3]. The end point is omitted! These are exactly the valid indices for a list of 4 elements. Guess so. > > Thanks, Kirby, > > > > Rich > > -- > Richard B. Shepard, Ph.D. | Integrity Credibility > Applied Ecosystem Services, Inc. | Innovation > Voice: 503-667-4517 Fax: 503-667-8863 > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From rshepard at appl-ecosys.com Fri May 2 20:59:19 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Fri, 2 May 2008 11:59:19 -0700 (PDT) Subject: [portland] Step Value in range() In-Reply-To: References: Message-ID: On Fri, 2 May 2008, kirby urner wrote: > You find instructions for installing VPython on Linux, Mac but it's a pain > unless you just grab 3.1.1 through Ubuntu (where I run it sometimes). > Works great with student learners, part of my Saturday Academy classes > (preparing for tomorrow's as we speak). Ah, so. > It's an open source C++ library out of Carnegie-Mellon, nothing to do with > the Visual * products out of Microsoft. But I can see where you might be > confused. Not in the same category with Visual COBOL then. :-) Thanks for the clarification, Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation Voice: 503-667-4517 Fax: 503-667-8863 From igal at pragmaticraft.com Sat May 3 11:27:55 2008 From: igal at pragmaticraft.com (Igal Koshevoy) Date: Sat, 03 May 2008 02:27:55 -0700 Subject: [portland] pdxruby meeting: Tuesday, May 6, 7pm, CubeSpace Message-ID: <481C301B.7000204@pragmaticraft.com> The next meeting of the Portland Ruby Brigade is coming up, and this meeting's content should be of interest to both Ruby and Python programmers. PRESENTATIONS: * AppDrop: An open alternative to Google App Engine SUMMARY: AppDrop provides a proof-of-concept system for easily hosting and scaling web applications. It demonstrates how applications written for Google's App Engine can be ported to other platforms. AppDrop runs on Amazon EC2, currently hosts Python applications, and uses Ruby on Rails and ngnix as its backend. All the AppDrop code is open source and contributions are welcome. For more information, please visit: appdrop.com SPEAKER: Chris Anderson is the author of AppDrop, creator of Grabb.it, and founder of the independent music store Music For Dozens. * SortableColumns: A Rails gem/plugin for easing the pain of creating sortable HTML tables. SUMMARY: SortableColumns uses flexible YAML config files to specify the nature of the columns in an HTML table. It can be used with any ActiveRecord result set (works with custom SQL fields) and multiple data-set definitions can be specified per model. Currently supports plain HTML tables or it can be used with the YUI4Rails gem/plugin to easily create YUI DataTables. You can see a demo of the library at sortablecolumns.heroku.com/ and get the Gem from rubyforge.org/projects/sortablecolumns/ . Bryan can also talk about his limited experience with the Heroku application hosting service if there is interest. SPEAKER: Bryan Donovan works at Sun Microsystems, where he turns tedious spreadsheet-driven processes into automated Rails-driven processes. He also developed UrbanDrinks.com, the sortable stats pages at The Hardball Times baseball site, and the rubystats gem. He has nothing to do with Brian Donovan at brian.maybeyoureinsane.net/blog/category/ruby/ From outofthenet at gmail.com Mon May 5 21:47:23 2008 From: outofthenet at gmail.com (Chris Foster) Date: Mon, 5 May 2008 12:47:23 -0700 Subject: [portland] Interesting Ruby meeting tomorrow Message-ID: <6d642e220805051247g47b2aabeq2dfdd481a215a29@mail.gmail.com> Igal, from the Ruby Brigade was hoping someone would post this to the Python list. There have been a lot of overlapping topics this past year (mercurial, git, testing, now GAE). The last Ruby meeting I attended had at least three pythonistas, three smalltalkers, and an assortment of Javascript and PHP experts in addition to the Ruby guys. It's good stuff. Date: Sat, May 3 2008 2:27 am > From: Igal Koshevoy > > > The next meeting of the Portland Ruby Brigade is coming up, and this > meeting's content should be of interest to both Ruby and Python > programmers. > > > PRESENTATIONS: > > * AppDrop: An open alternative to Google App Engine > > SUMMARY: AppDrop provides a proof-of-concept system for easily hosting > and scaling web applications. It demonstrates how applications written > for Google's App Engine can be ported to other platforms. AppDrop runs > on Amazon EC2, currently hosts Python applications, and uses Ruby on > Rails and ngnix as its backend. All the AppDrop code is open source and > contributions are welcome. For more information, please visit: appdrop.com > > SPEAKER: Chris Anderson is the author of AppDrop, creator of Grabb.it, > and founder of the independent music store Music For Dozens. > > > * SortableColumns: A Rails gem/plugin for easing the pain of creating > sortable HTML tables. > > SUMMARY: SortableColumns uses flexible YAML config files to specify the > nature of the columns in an HTML table. It can be used with any > ActiveRecord result set (works with custom SQL fields) and multiple > data-set definitions can be specified per model. Currently supports > plain HTML tables or it can be used with the YUI4Rails gem/plugin to > easily create YUI DataTables. You can see a demo of the library at > sortablecolumns.heroku.com/ and get the Gem from > rubyforge.org/projects/sortablecolumns/ . Bryan can also talk about his > limited experience with the Heroku application hosting service if there > is interest. > > SPEAKER: Bryan Donovan works at Sun Microsystems, where he turns tedious > spreadsheet-driven processes into automated Rails-driven processes. He > also developed UrbanDrinks.com, the sortable stats pages at The Hardball > Times baseball site, and the rubystats gem. He has nothing to do with > Brian Donovan at brian.maybeyoureinsane.net/blog/category/ruby/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rshepard at appl-ecosys.com Thu May 8 03:53:56 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Wed, 7 May 2008 18:53:56 -0700 (PDT) Subject: [portland] Any Mathematical Coders Here? Message-ID: Is anyone in the group highly conversant with distribution function algorithms? I've been spending too much time trying to find a formula/algorithm that will generate sigmoid curves (both S- or Z-shaped) given the two ends, the midpoint, and the inflection point. While the Boltzmann function appears to work if the width of the curve is about 50% the width of the x axis, it never reaches y=0.0 or y=1.0 with finite widths. And, the inflection point drops well below y=0.5 if the curve width is about 30% of the x-axis range. I've tried a bunch of other approaches (including some suggestions from a subscriber to the NumPy mail list), but those suggestions are just not working for me. The Hill function looked promising, but I've not been able to find what the theta and n represent in the formula. The arctangent function _almost_ works in a limited number of cases. It's been too many years since I fully understood the mathematics of distribution functions, and even then a lot of my attention was focused on the log-normal distribution. Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation Voice: 503-667-4517 Fax: 503-667-8863 From markgross at thegnar.org Thu May 8 04:59:56 2008 From: markgross at thegnar.org (mark gross) Date: Wed, 7 May 2008 19:59:56 -0700 Subject: [portland] Any Mathematical Coders Here? In-Reply-To: References: Message-ID: <20080508025956.GB29459@thegnar.org> On Wed, May 07, 2008 at 06:53:56PM -0700, Rich Shepard wrote: > Is anyone in the group highly conversant with distribution function > algorithms? I've been spending too much time trying to find a > formula/algorithm that will generate sigmoid curves (both S- or Z-shaped) > given the two ends, the midpoint, and the inflection point. > > While the Boltzmann function appears to work if the width of the curve is > about 50% the width of the x axis, it never reaches y=0.0 or y=1.0 with > finite widths. And, the inflection point drops well below y=0.5 if the > curve > width is about 30% of the x-axis range. > > I've tried a bunch of other approaches (including some suggestions from a > subscriber to the NumPy mail list), but those suggestions are just not > working for me. > > The Hill function looked promising, but I've not been able to find what > the theta and n represent in the formula. > > The arctangent function _almost_ works in a limited number of cases. > > It's been too many years since I fully understood the mathematics of > distribution functions, and even then a lot of my attention was focused on > the log-normal distribution. I know enough to get into trouble. But I don't know what a sigmoind cure is other than http://mathworld.wolfram.com/SigmoidFunction.html which isn't very helpful. If you are substituting in arctan's for this curve then I have to think you are looking for something that "looks" like something as opposed to something that means anything. If you are just looking for a "shape" and not something that means much you can do splines and besior(sp) curves. --mgross -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From rshepard at appl-ecosys.com Thu May 8 14:58:54 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Thu, 8 May 2008 05:58:54 -0700 (PDT) Subject: [portland] Any Mathematical Coders Here? In-Reply-To: <20080508025956.GB29459@thegnar.org> References: <20080508025956.GB29459@thegnar.org> Message-ID: On Wed, 7 May 2008, mark gross wrote: > I know enough to get into trouble. But I don't know what a sigmoind cure > is other than http://mathworld.wolfram.com/SigmoidFunction.html which > isn't very helpful. No, the sigmoidal function doesn't work. > If you are substituting in arctan's for this curve then I have to think > you are looking for something that "looks" like something as opposed to > something that means anything. Arctan doesn't work, either. I need a function which will provide a y value for any given x value in the domain. Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation Voice: 503-667-4517 Fax: 503-667-8863 From markgross at thegnar.org Thu May 8 15:22:26 2008 From: markgross at thegnar.org (mark gross) Date: Thu, 8 May 2008 06:22:26 -0700 Subject: [portland] Any Mathematical Coders Here? In-Reply-To: References: <20080508025956.GB29459@thegnar.org> Message-ID: <20080508132226.GA30334@thegnar.org> On Thu, May 08, 2008 at 05:58:54AM -0700, Rich Shepard wrote: > On Wed, 7 May 2008, mark gross wrote: > >> I know enough to get into trouble. But I don't know what a sigmoind cure >> is other than http://mathworld.wolfram.com/SigmoidFunction.html which >> isn't very helpful. > > No, the sigmoidal function doesn't work. > >> If you are substituting in arctan's for this curve then I have to think >> you are looking for something that "looks" like something as opposed to >> something that means anything. > > Arctan doesn't work, either. I need a function which will provide a y > value for any given x value in the domain. ? you must be thinking of some "new math" where atan is not a function. (sure you need to pick a branch cut for its domain, but so what?) You need to be much more forthcoming with the problem before I can oelp you. --mgross -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: From freyley at gmail.com Thu May 8 21:21:13 2008 From: freyley at gmail.com (Jeff Schwaber) Date: Thu, 8 May 2008 12:21:13 -0700 Subject: [portland] CubeSpace Open House Message-ID: <8db4a1910805081221r54ca71cepfc2c7365a4aead96@mail.gmail.com> Hey Pythonistas, CubeSpace's having an open house to show off the space, answer questions, hang out and party. That sort of thing. You are all invited. In addition, anybody you know, especially anybody who might be interested in workspace or meeting space, is also invited. Here's the details: Wednesday, May 14th 4pm-8pm at CubeSpace Jeff From freyley at gmail.com Thu May 8 21:21:40 2008 From: freyley at gmail.com (Jeff Schwaber) Date: Thu, 8 May 2008 12:21:40 -0700 Subject: [portland] Meeting next week Message-ID: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> Hey Pythonistas, We have a meeting next Tuesday. Thoughts? Jeff From gdmilner at gmail.com Thu May 8 23:35:31 2008 From: gdmilner at gmail.com (Greg Milner) Date: Thu, 8 May 2008 14:35:31 -0700 Subject: [portland] Meeting next week In-Reply-To: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> Message-ID: <552920590805081435k63a76863wa9140d4cb763498e@mail.gmail.com> I have been reading IronPython in Action lately and would like to know if anyone is interested in IronPython in general. Thanks, Greg On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: > Hey Pythonistas, > > We have a meeting next Tuesday. Thoughts? > > Jeff > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > -- Greg Milner -------------- next part -------------- An HTML attachment was scrubbed... URL: From freyley at gmail.com Thu May 8 23:37:59 2008 From: freyley at gmail.com (Jeff Schwaber) Date: Thu, 8 May 2008 14:37:59 -0700 Subject: [portland] Meeting next week In-Reply-To: <552920590805081435k63a76863wa9140d4cb763498e@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <552920590805081435k63a76863wa9140d4cb763498e@mail.gmail.com> Message-ID: <8db4a1910805081437g61e2054en817d8e517db15315@mail.gmail.com> On Thu, May 8, 2008 at 2:35 PM, Greg Milner wrote: > I have been reading IronPython in Action lately and would like to know if > anyone is interested in IronPython in general. Yes! I'd like to hear the latest in IronPython. Jeff > Thanks, > > Greg > > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: > >> Hey Pythonistas, >> >> We have a meeting next Tuesday. Thoughts? >> >> Jeff >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> http://mail.python.org/mailman/listinfo/portland >> > > > > -- > Greg Milner > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From gdmilner at gmail.com Fri May 9 01:46:31 2008 From: gdmilner at gmail.com (Greg Milner) Date: Thu, 8 May 2008 16:46:31 -0700 Subject: [portland] Meeting next week In-Reply-To: <8db4a1910805081437g61e2054en817d8e517db15315@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <552920590805081435k63a76863wa9140d4cb763498e@mail.gmail.com> <8db4a1910805081437g61e2054en817d8e517db15315@mail.gmail.com> Message-ID: <552920590805081646r769a2a5aw2d23df9f98e5c8cd@mail.gmail.com> Well, I'm no expert and I am only on chapter 4 but I was hoping someone else would have more knowledge or just be willing to participate in a discussion, opinions, etc. I don't feel qualified to give an actual talk about it. SQL Server is my area of expertise. I would be more than happy to give a talk on that with a few days warning if anyone is ever interested. Thanks. On Thu, May 8, 2008 at 2:37 PM, Jeff Schwaber wrote: > On Thu, May 8, 2008 at 2:35 PM, Greg Milner wrote: > > I have been reading IronPython in Action lately and would like to know if > > anyone is interested in IronPython in general. > > Yes! I'd like to hear the latest in IronPython. > > Jeff > > > Thanks, > > > > Greg > > > > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber > wrote: > > > >> Hey Pythonistas, > >> > >> We have a meeting next Tuesday. Thoughts? > >> > >> Jeff > >> _______________________________________________ > >> Portland mailing list > >> Portland at python.org > >> http://mail.python.org/mailman/listinfo/portland > >> > > > > > > > > -- > > Greg Milner > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > http://mail.python.org/pipermail/portland/attachments/20080508/1d387297/attachment.htm > > > > _______________________________________________ > > Portland mailing list > > Portland at python.org > > http://mail.python.org/mailman/listinfo/portland > > > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > -- Greg Milner -------------- next part -------------- An HTML attachment was scrubbed... URL: From hallettj at gmail.com Fri May 9 10:18:26 2008 From: hallettj at gmail.com (Jesse Hallett) Date: Fri, 9 May 2008 01:18:26 -0700 Subject: [portland] Meeting next week In-Reply-To: <552920590805081646r769a2a5aw2d23df9f98e5c8cd@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <552920590805081435k63a76863wa9140d4cb763498e@mail.gmail.com> <8db4a1910805081437g61e2054en817d8e517db15315@mail.gmail.com> <552920590805081646r769a2a5aw2d23df9f98e5c8cd@mail.gmail.com> Message-ID: <8a02878f0805090118u60b0d9a5pa70930d0db0c66af@mail.gmail.com> I have been wanting to give a talk about a revision control system I wrote as a web server plugin. But it's written in Ruby. That's probably not close enough, is it? On Thu, May 8, 2008 at 4:46 PM, Greg Milner wrote: > Well, I'm no expert and I am only on chapter 4 but I was hoping someone else > would have more knowledge or just be willing to participate in a discussion, > opinions, etc. I don't feel qualified to give an actual talk about it. > > SQL Server is my area of expertise. I would be more than happy to give a > talk on that with a few days warning if anyone is ever interested. > > Thanks. > > On Thu, May 8, 2008 at 2:37 PM, Jeff Schwaber wrote: > >> On Thu, May 8, 2008 at 2:35 PM, Greg Milner wrote: >> > I have been reading IronPython in Action lately and would like to know if >> > anyone is interested in IronPython in general. >> >> Yes! I'd like to hear the latest in IronPython. >> >> Jeff >> >> > Thanks, >> > >> > Greg >> > >> > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber >> wrote: >> > >> >> Hey Pythonistas, >> >> >> >> We have a meeting next Tuesday. Thoughts? >> >> >> >> Jeff >> >> _______________________________________________ >> >> Portland mailing list >> >> Portland at python.org >> >> http://mail.python.org/mailman/listinfo/portland >> >> >> > >> > >> > >> > -- >> > Greg Milner >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: < >> http://mail.python.org/pipermail/portland/attachments/20080508/1d387297/attachment.htm >> > >> > _______________________________________________ >> > Portland mailing list >> > Portland at python.org >> > http://mail.python.org/mailman/listinfo/portland >> > >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> http://mail.python.org/mailman/listinfo/portland >> > > > > -- > Greg Milner > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From mccredie at gmail.com Fri May 9 18:38:26 2008 From: mccredie at gmail.com (Matt McCredie) Date: Fri, 9 May 2008 09:38:26 -0700 Subject: [portland] Meeting next week In-Reply-To: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> Message-ID: <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> I don't know if anybody has given a talk in one of the meetings I didn't attend but I wouldn't mind hearing about SQLAlchemy, or something similar. I was also thinking of giving a talk on configuration files. I had been discussing with co-workers how to use configuration files in python, and it turned into a discussion on using python files as configuration files, and we came up with some interesting constructs to do that. I don't really have anything prepared yet though. I can throw something together over the weekend though. Matt On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: > Hey Pythonistas, > > We have a meeting next Tuesday. Thoughts? > > Jeff > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From carlos.hanson at gmail.com Fri May 9 20:24:25 2008 From: carlos.hanson at gmail.com (Carlos Hanson) Date: Fri, 9 May 2008 11:24:25 -0700 Subject: [portland] Meeting next week In-Reply-To: <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> Message-ID: I'm new to the list. I haven't yet worked out if I can attend the meetings, but I just started playing with SQLAlchemy. I am using it in Django. So far it is very cool and pretty straight forward. Carlos Hanson On Fri, May 9, 2008 at 9:38 AM, Matt McCredie wrote: > I don't know if anybody has given a talk in one of the meetings I > didn't attend but I wouldn't mind hearing about SQLAlchemy, or > something similar. > > I was also thinking of giving a talk on configuration files. I had > been discussing with co-workers how to use configuration files in > python, and it turned into a discussion on using python files as > configuration files, and we came up with some interesting constructs > to do that. I don't really have anything prepared yet though. I can > throw something together over the weekend though. > > Matt > > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: >> Hey Pythonistas, >> >> We have a meeting next Tuesday. Thoughts? >> >> Jeff >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> http://mail.python.org/mailman/listinfo/portland >> > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > -- Carlos Hanson From Robert.Lugg at synopsys.com Fri May 9 20:28:39 2008 From: Robert.Lugg at synopsys.com (Robert Lugg) Date: Fri, 9 May 2008 11:28:39 -0700 Subject: [portland] Meeting next week In-Reply-To: <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> Message-ID: <81EC0BF5B088B046A96CC9D3A6D3DCE005192F6A@US01WEMBX2.internal.synopsys.com> I would be interested in your techniques for using Python as configuration files. Robert -----Original Message----- From: portland-bounces+robert.lugg=synopsys.com at python.org [mailto:portland-bounces+robert.lugg=synopsys.com at python.org] On Behalf Of Matt McCredie Sent: Friday, May 09, 2008 9:38 AM To: Python Users Group -- Portland, Oregon USA Subject: Re: [portland] Meeting next week I don't know if anybody has given a talk in one of the meetings I didn't attend but I wouldn't mind hearing about SQLAlchemy, or something similar. I was also thinking of giving a talk on configuration files. I had been discussing with co-workers how to use configuration files in python, and it turned into a discussion on using python files as configuration files, and we came up with some interesting constructs to do that. I don't really have anything prepared yet though. I can throw something together over the weekend though. Matt On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: > Hey Pythonistas, > > We have a meeting next Tuesday. Thoughts? > > Jeff > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > _______________________________________________ Portland mailing list Portland at python.org http://mail.python.org/mailman/listinfo/portland From python at dylanreinhardt.com Fri May 9 20:36:03 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Fri, 9 May 2008 11:36:03 -0700 Subject: [portland] Meeting next week In-Reply-To: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> Message-ID: <4c645a720805091136j280f84fep81a66ee426371a07@mail.gmail.com> I've been mostly working with Turbogears (+ SQLAlchemy) lately... currently working on a lightweight CMS. If anything about that holds any interest, I'm happy to throw something together. +1 for hearing more about Django, for what that's worth. Dylan On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: > Hey Pythonistas, > > We have a meeting next Tuesday. Thoughts? > > Jeff > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From richardson.michael.t at gmail.com Fri May 9 20:37:07 2008 From: richardson.michael.t at gmail.com (Michael Richardson) Date: Fri, 9 May 2008 11:37:07 -0700 Subject: [portland] Meeting next week In-Reply-To: <4c645a720805091136j280f84fep81a66ee426371a07@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <4c645a720805091136j280f84fep81a66ee426371a07@mail.gmail.com> Message-ID: <88532159-E83E-4B3C-8710-65D016D0896A@gmail.com> The Portland Django user group is planning a meeting for next week - we could just combine the two if there's interest. On May 9, 2008, at 11:36 AM, Dylan Reinhardt wrote: > I've been mostly working with Turbogears (+ SQLAlchemy) lately... > currently working on a lightweight CMS. > > If anything about that holds any interest, I'm happy to throw > something together. > > +1 for hearing more about Django, for what that's worth. > > Dylan > > > > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber > wrote: >> Hey Pythonistas, >> >> We have a meeting next Tuesday. Thoughts? >> >> Jeff >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> http://mail.python.org/mailman/listinfo/portland >> > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland From carlos.hanson at gmail.com Fri May 9 20:45:06 2008 From: carlos.hanson at gmail.com (Carlos Hanson) Date: Fri, 9 May 2008 11:45:06 -0700 Subject: [portland] Meeting next week In-Reply-To: <4c645a720805091136j280f84fep81a66ee426371a07@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <4c645a720805091136j280f84fep81a66ee426371a07@mail.gmail.com> Message-ID: I played with Turbogears before Django. I think it used SQLObject at the time. I really like Django. I am excited about using SQLAlchemy, so I can get multiple databases. I have a multi-db patched Django installation, but it uses an older revision than the current development version. This looks promising though: A project to create SQLAlchemy mapping of Django models onto a SQLAlchemy backend. http://gitorious.org/projects/django-sqlalchemy Carlos On Fri, May 9, 2008 at 11:36 AM, Dylan Reinhardt wrote: > I've been mostly working with Turbogears (+ SQLAlchemy) lately... > currently working on a lightweight CMS. > > If anything about that holds any interest, I'm happy to throw > something together. > > +1 for hearing more about Django, for what that's worth. > > Dylan > > > > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: >> Hey Pythonistas, >> >> We have a meeting next Tuesday. Thoughts? >> >> Jeff >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> http://mail.python.org/mailman/listinfo/portland >> > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > -- Carlos Hanson From jek at discorporate.us Fri May 9 21:12:26 2008 From: jek at discorporate.us (jason kirtland) Date: Fri, 09 May 2008 12:12:26 -0700 Subject: [portland] SQLAlchemy @ PDXPUG (was Re: Meeting next week) In-Reply-To: <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> <9e95df10805090938h42e3b47evcad30ad220e31b33@mail.gmail.com> Message-ID: <4824A21A.3090903@discorporate.us> As it happens, I'll be doing a presentation on SQLAlchemy for the Portland PostgreSQL Users Group next Thursday. (5/15, 7pm, FreeGeek) I'll be presenting SQLAlchemy 0.5, which was just merged into the svn trunk a few moments ago and will go into alpha soon. I'll mostly be demoing ORM queries, eager-loading and inheritance, plus some cool and pragmatic blending of ORM and relational operations that are now easy in 0.5. I'm happy to do a talk for PDX Python too, but I'm not up to back-to-back talks this month. I can also speak to Michael Trier's excellent django-sqlalchemy project somewhat, albeit mostly from an under the hood perspective. -jek Matt McCredie wrote: > I don't know if anybody has given a talk in one of the meetings I > didn't attend but I wouldn't mind hearing about SQLAlchemy, or > something similar. > > I was also thinking of giving a talk on configuration files. I had > been discussing with co-workers how to use configuration files in > python, and it turned into a discussion on using python files as > configuration files, and we came up with some interesting constructs > to do that. I don't really have anything prepared yet though. I can > throw something together over the weekend though. > > Matt > > On Thu, May 8, 2008 at 12:21 PM, Jeff Schwaber wrote: >> Hey Pythonistas, >> >> We have a meeting next Tuesday. Thoughts? >> >> Jeff >> _______________________________________________ >> Portland mailing list >> Portland at python.org >> http://mail.python.org/mailman/listinfo/portland >> > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From adam at therobots.org Fri May 9 21:21:27 2008 From: adam at therobots.org (Adam Lowry) Date: Fri, 09 May 2008 12:21:27 -0700 Subject: [portland] Meeting next week In-Reply-To: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> References: <8db4a1910805081221r2ed3ae72me43d7960e4ac6322@mail.gmail.com> Message-ID: <4824A437.5080002@therobots.org> Jeff Schwaber wrote: > We have a meeting next Tuesday. Thoughts? I had thrown around the idea of doing a short demo of Twill, which is an web automation and testing system implemented as a simple language and a easy to use Python library. If any of you saw my lightning talk on mechanize last year, it's a related project--it uses mechanize as the back end and puts a friendlier face on it. Any interest? This would be short, maybe 10 minutes or so -- it's pretty simple. Adam From adam at therobots.org Wed May 14 18:42:10 2008 From: adam at therobots.org (Adam Lowry) Date: Wed, 14 May 2008 09:42:10 -0700 Subject: [portland] Links from last night Message-ID: <482B1662.8090501@therobots.org> twill: a simple scripting language for Web browsing http://twill.idyll.org/ mechanize: browser library twill is based on http://wwwsearch.sourceforge.net/mechanize/ z3c.rml: An alternative implementation of ReportLab's RML PDF generation XML format http://pypi.python.org/pypi/z3c.rml Adam From freyley at gmail.com Wed May 14 19:23:21 2008 From: freyley at gmail.com (Jeff Schwaber) Date: Wed, 14 May 2008 10:23:21 -0700 Subject: [portland] Links from last night In-Reply-To: <482B1662.8090501@therobots.org> References: <482B1662.8090501@therobots.org> Message-ID: <8db4a1910805141023j6800bfceq16a8188c07a769c3@mail.gmail.com> I mentioned the Calagator project last night. They're at http://www.calagator.org They just got a fancy new frontend and are looking good. Their next meeting is at noon today, at Backspace. And more meetings beyond that can be found at their website, as they're a community calendar. Jeff From jek at discorporate.us Mon May 19 22:15:52 2008 From: jek at discorporate.us (jason kirtland) Date: Mon, 19 May 2008 13:15:52 -0700 Subject: [portland] Free Python Magazine subscriptions for user group members Message-ID: <4831DFF8.9000708@discorporate.us> This just in! I'm happy to assemble the list of group members who've signed up- ping me off-list w/ the email you used after you sign up. > Python Magazine would like to offer free 3 month PDF subscriptions > for members of Python user groups. > [...] > This promotional is open to members of user groups who discuss Python- > related topics. > > To take advantage of the offer, each member of the group should go to > our web site (http://www.pythonmagazine.com) and set up an account > (that's already free). When they register, the site will ask them for > an email address to identify the account. If a single member of the > group sends me a list of all the email addresses used, along with the > name of the user group represented, I'll make sure we enable the > subscriptions. > > Thanks, > Doug > > Doug Hellmann > Technical Editor > Python Magazine From gdmilner at gmail.com Mon May 19 22:53:19 2008 From: gdmilner at gmail.com (Greg Milner) Date: Mon, 19 May 2008 13:53:19 -0700 Subject: [portland] Free Python Magazine subscriptions for user group members In-Reply-To: <4831DFF8.9000708@discorporate.us> References: <4831DFF8.9000708@discorporate.us> Message-ID: <552920590805191353p126d2c1dj75403d6d0f608a49@mail.gmail.com> Hi, Count me in. I have registered. Thanks. -Greg gdmilner at gmail.com On Mon, May 19, 2008 at 1:15 PM, jason kirtland wrote: > This just in! I'm happy to assemble the list of group members who've > signed up- ping me off-list w/ the email you used after you sign up. > > Python Magazine would like to offer free 3 month PDF subscriptions for >> members of Python user groups. [...] >> This promotional is open to members of user groups who discuss Python- >> related topics. >> >> To take advantage of the offer, each member of the group should go to our >> web site (http://www.pythonmagazine.com) and set up an account (that's >> already free). When they register, the site will ask them for an email >> address to identify the account. If a single member of the group sends me >> a list of all the email addresses used, along with the name of the user >> group represented, I'll make sure we enable the subscriptions. >> >> Thanks, >> Doug >> >> Doug Hellmann >> Technical Editor >> Python Magazine >> > > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > -- Greg Milner -------------- next part -------------- An HTML attachment was scrubbed... URL: From jek at discorporate.us Tue May 20 18:21:18 2008 From: jek at discorporate.us (jason kirtland) Date: Tue, 20 May 2008 09:21:18 -0700 Subject: [portland] Free Python Magazine subscriptions for user group members In-Reply-To: <4831DFF8.9000708@discorporate.us> References: <4831DFF8.9000708@discorporate.us> Message-ID: <4832FA7E.70609@discorporate.us> I sent Doug the first batch of folks from Portland. I'll start a second list if anyone else wants in. Cheers, Jason jason kirtland wrote: > This just in! I'm happy to assemble the list of group members who've > signed up- ping me off-list w/ the email you used after you sign up. > >> Python Magazine would like to offer free 3 month PDF subscriptions >> for members of Python user groups. >> [...] >> This promotional is open to members of user groups who discuss Python- >> related topics. >> >> To take advantage of the offer, each member of the group should go to >> our web site (http://www.pythonmagazine.com) and set up an account >> (that's already free). When they register, the site will ask them for >> an email address to identify the account. If a single member of the >> group sends me a list of all the email addresses used, along with the >> name of the user group represented, I'll make sure we enable the >> subscriptions. From adam at therobots.org Tue May 20 18:29:31 2008 From: adam at therobots.org (Adam Lowry) Date: Tue, 20 May 2008 09:29:31 -0700 Subject: [portland] Free Python Magazine subscriptions for user group members In-Reply-To: <4832FA7E.70609@discorporate.us> References: <4831DFF8.9000708@discorporate.us> <4832FA7E.70609@discorporate.us> Message-ID: <4832FC6B.8010702@therobots.org> jason kirtland wrote: > I sent Doug the first batch of folks from Portland. I'll start a second > list if anyone else wants in. > > Cheers, > Jason Hey, sorry I missed this yesterday. I'd like in, too. I registered as alowry at kavi.com Thanks From Robert.Lugg at synopsys.com Tue May 20 18:51:32 2008 From: Robert.Lugg at synopsys.com (Robert Lugg) Date: Tue, 20 May 2008 09:51:32 -0700 Subject: [portland] Free Python Magazine subscriptions for user group members In-Reply-To: <4832FA7E.70609@discorporate.us> References: <4831DFF8.9000708@discorporate.us> <4832FA7E.70609@discorporate.us> Message-ID: <81EC0BF5B088B046A96CC9D3A6D3DCE00520ED5D@US01WEMBX2.internal.synopsys.com> I would be interested. Sorry I couldn't send this to just you Jason. Robert -----Original Message----- From: portland-bounces+robert.lugg=synopsys.com at python.org [mailto:portland-bounces+robert.lugg=synopsys.com at python.org] On Behalf Of jason kirtland Sent: Tuesday, May 20, 2008 9:21 AM To: Python Users Group -- Portland, Oregon USA Subject: Re: [portland] Free Python Magazine subscriptions for user group members I sent Doug the first batch of folks from Portland. I'll start a second list if anyone else wants in. Cheers, Jason jason kirtland wrote: > This just in! I'm happy to assemble the list of group members who've > signed up- ping me off-list w/ the email you used after you sign up. > >> Python Magazine would like to offer free 3 month PDF subscriptions >> for members of Python user groups. >> [...] >> This promotional is open to members of user groups who discuss Python- >> related topics. >> >> To take advantage of the offer, each member of the group should go to >> our web site (http://www.pythonmagazine.com) and set up an account >> (that's already free). When they register, the site will ask them for >> an email address to identify the account. If a single member of the >> group sends me a list of all the email addresses used, along with the >> name of the user group represented, I'll make sure we enable the >> subscriptions. _______________________________________________ Portland mailing list Portland at python.org http://mail.python.org/mailman/listinfo/portland From python at dylanreinhardt.com Tue May 20 22:53:10 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Tue, 20 May 2008 13:53:10 -0700 Subject: [portland] Google I/O - free reg available Message-ID: <4c645a720805201353j7066cb4fj68feed25ee165c05@mail.gmail.com> Hey all, I'm registered for Google I/O next week in San Francisco but will be unable to attend. The registration is non-refundable, but *is* transferable. I'm willing to donate this to anyone who is serious about going. First come, first served. More info about the event: http://code.google.com/events/io/about.html Dylan From brett at rdnzl.net Tue May 20 23:47:54 2008 From: brett at rdnzl.net (Brett Carter) Date: Tue, 20 May 2008 14:47:54 -0700 Subject: [portland] Free Python Magazine subscriptions for user group members In-Reply-To: <4831DFF8.9000708@discorporate.us> References: <4831DFF8.9000708@discorporate.us> Message-ID: <4833470A.30100@rdnzl.net> Hey jason, add me too if it's not too late: 'brett at rdnzl.net'. -Brett jason kirtland wrote: > This just in! I'm happy to assemble the list of group members who've > signed up- ping me off-list w/ the email you used after you sign up. > >> Python Magazine would like to offer free 3 month PDF subscriptions >> for members of Python user groups. [...] >> This promotional is open to members of user groups who discuss Python- >> related topics. >> >> To take advantage of the offer, each member of the group should go to >> our web site (http://www.pythonmagazine.com) and set up an account >> (that's already free). When they register, the site will ask them >> for an email address to identify the account. If a single member of >> the group sends me a list of all the email addresses used, along with >> the name of the user group represented, I'll make sure we enable the >> subscriptions. >> >> Thanks, >> Doug >> >> Doug Hellmann >> Technical Editor >> Python Magazine > > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland From rshepard at appl-ecosys.com Wed May 21 00:40:39 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Tue, 20 May 2008 15:40:39 -0700 (PDT) Subject: [portland] Nested for loops, 4 levels deep Message-ID: I have been trying since yesterday morning to figure out how to nest for loops four levels deep. I've tried the suggestions offered by you folks as solutions to my previous needs in working with lists of tuples. This time I've had no problems getting three deep, but I cannot successfully (and properly) extract the last level. I'm confident that you'll show me several different ways of getting the desired result. I start with a list of tuples called appData.rules. Each tuple consists of 5 strings; we can refer to them as 'c,' 's,' 'v,' 'n,' and 't.' What I need is to print the hierarchies. That is, for each 'c' print all the 's' associated with it; for each 's' print each of its associated 'v'; for each 'v' print its associated 'n' and 't' in a two-column table Earlier in the module I define three lists of tuples: compList, subList, and varList. I use these to print the hierarchies of the first three items in each tuple. Here's the working code: proper = lambda t: (t[0], t[1], t[2], t[3]) ivr.write('\\section{Rules}') appData.rules.sort(key=proper) for c in compList: curComp = None for row in appData.rules: if row[0] == c[1] and row[0] != curComp: ivr.write('\\subsection{%s}' % c[1]) ivr.write('\n''\n') for s in subList: if row[0] == s[0]: ivr.write('\\subsubsection{%s}' % s[1]) ivr.write('\n''\n') for v in varList: if row[0] == v[2] and s[1] == v[3]: ivr.write(v[0]) ivr.write('\n''\n') """ in here is where I want to create a table for rows 3 and 4, where they belong to the specific c, s, and v """ curComp = row[0] A page of the output is attached. I can get only 1 n/t pair printing for each c/s/v combination, or I have all n/t pairs repeating. I probably need another for loop, but those I've tried failed miserably. Rich -------------- next part -------------- A non-text attachment was scrubbed... Name: inputVars.pdf Type: application/pdf Size: 13528 bytes Desc: URL: From python at dylanreinhardt.com Wed May 21 01:13:04 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Tue, 20 May 2008 16:13:04 -0700 Subject: [portland] Nested for loops, 4 levels deep In-Reply-To: References: Message-ID: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> Could you paste in a small sample of the tuples you're using? Maybe enough data to render 5 through 5.2.1 would do it... Dylan On Tue, May 20, 2008 at 3:40 PM, Rich Shepard wrote: > I have been trying since yesterday morning to figure out how to nest for > loops four levels deep. I've tried the suggestions offered by you folks as > solutions to my previous needs in working with lists of tuples. This time > I've had no problems getting three deep, but I cannot successfully (and > properly) extract the last level. I'm confident that you'll show me several > different ways of getting the desired result. > > I start with a list of tuples called appData.rules. Each tuple consists of > 5 strings; we can refer to them as 'c,' 's,' 'v,' 'n,' and 't.' What I need > is to print the hierarchies. That is, for each 'c' print all the 's' > associated with it; for each 's' print each of its associated 'v'; for each > 'v' print its associated 'n' and 't' in a two-column table > > Earlier in the module I define three lists of tuples: compList, subList, > and varList. I use these to print the hierarchies of the first three items > in each tuple. > > Here's the working code: > > proper = lambda t: (t[0], t[1], t[2], t[3]) > > ivr.write('\\section{Rules}') > > appData.rules.sort(key=proper) > > for c in compList: > curComp = None > for row in appData.rules: > if row[0] == c[1] and row[0] != curComp: > ivr.write('\\subsection{%s}' % c[1]) > ivr.write('\n''\n') > for s in subList: > if row[0] == s[0]: > ivr.write('\\subsubsection{%s}' % s[1]) > ivr.write('\n''\n') > for v in varList: > if row[0] == v[2] and s[1] == v[3]: > ivr.write(v[0]) > ivr.write('\n''\n') > """ > in here is where I want to create a table for rows 3 > and 4, where they belong to the specific c, s, and v > """ > curComp = row[0] > > A page of the output is attached. > > I can get only 1 n/t pair printing for each c/s/v combination, or I have > all n/t pairs repeating. I probably need another for loop, but those I've > tried failed miserably. > > Rich > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: inputVars.pdf > Type: application/pdf > Size: 13528 bytes > Desc: URL: > > _______________________________________________ > Portland mailing list > Portland at python.org > http://mail.python.org/mailman/listinfo/portland > From rshepard at appl-ecosys.com Wed May 21 01:33:54 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Tue, 20 May 2008 16:33:54 -0700 (PDT) Subject: [portland] Nested for loops, 4 levels deep In-Reply-To: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> References: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> Message-ID: On Tue, 20 May 2008, Dylan Reinhardt wrote: > Could you paste in a small sample of the tuples you're using? Dylan, Here is compList[]; the 'c' are item[1]: [(u'Economic', u'Jobs'), (u'Economic', u'Infrastructure'), (u'Economic', u'Housing'), (u'Economic', u'TaxBase'), (u'Economic', u'Traffic'), (u'Economic', u'Roads'), (u'Economic', u'MedicalCare'), (u'Economic', u'Sustainability'), (u'Natural', u'Wildlife'), (u'Natural', u'Wetlands'), (u'Natural', u'Hydrology'), (u'Natural', u'AirQuality'), (u'Natural', u'WaterQuality'), (u'Natural', u'Topography'), (u'Natural', u'GroundWater'), (u'Natural', u'Soils'), (u'Societal', u'Aesthetics'), (u'Societal', u'Noise'), (u'Societal', u'Recreation'), (u'Societal', u'QualityOfLife'), (u'Societal', u'HealthEffects'), (u'Societal', u'EnvironJustice'), (u'Societal', u'CulturalHeritage'), (u'Societal', u'UrbanGrowth')] Here are examples of the subComps ('s') and vars ('v') associated with a comp ('c'): Infrastructure Roads Number Condition Capacity Maintainability WaterSupply PotableWater WasteTreatment ImpervSurface Amount MedicalCare Capacity Proximity SizeSupported Coverage Adequacy AHArating StaffSize StaffTurnover Wildlife Fish Variety HabitatComplexity SpecialConcern Abundance and here are a few tuples from appData.rules: [(u'Wildlife', u'Fish', u'Abundance', u'WFA1', u'if abundance is few then goodness is very not increased'), (u'Wildlife', u'Fish', u'Abundance', u'WFA2', u'if abundance is moderate then goodness is not increased'), (u'Wildlife', u'Fish', u'Abundance', u'WFA3', u'if abundance is many then goodness is slightly increased'), (u'Wildlife', u'Fish', u'HabitatComplexity', u'WFH1', u'if habitatcomplexity is low then goodness is very not increased'), (u'Wildlife', u'Fish', u'HabitatComplexity', u'WFH2', u'if habitatcomplexity is high then goodness is very increased'), (u'Wildlife', u'Fish', u'SpecialConcern', u'WFS1', u'if specialconcerns are few then goodness is very increased'), (u'Wildlife', u'Fish', u'SpecialConcern', u'WFS2', u'if specialconcerns are moderate then goodness is slightly not increased'), (u'Wildlife', u'Fish', u'SpecialConcern', u'WFS3', u'if specialconcerns are many then goodness is very not increased'), (u'Wildlife', u'Fish', u'Variety', u'WFV1', u'if variety is low then goodness is very not increased'), (u'Wildlife', u'Fish', u'Variety', u'WFV2', u'if variety is high then goodness is very increased')] Does this provide the data you want? If not, I'll try again. Thanks, Rich From python at dylanreinhardt.com Wed May 21 02:43:29 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Tue, 20 May 2008 17:43:29 -0700 Subject: [portland] Nested for loops, 4 levels deep In-Reply-To: References: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> Message-ID: <4c645a720805201743qf7f6d78ld58010f103d0da2f@mail.gmail.com> On Tue, May 20, 2008 at 4:33 PM, Rich Shepard wrote: [snip] > and here are a few tuples from appData.rules: > > [(u'Wildlife', u'Fish', u'Abundance', u'WFA1', u'if abundance is few then > goodness is very not increased'), (u'Wildlife', u'Fish', u'Abundance', > u'WFA2', u'if abundance is moderate then goodness is not increased'), [snip > Does this provide the data you want? If not, I'll try again. Let's assume it does... :-) If I understand correctly, you want the data to lay out something like this: Wildlife Fish Abundance WFA1 if abundance is few then... WFA2 if abundance is moderate then... WFA3 if abundance is many then... Assuming that to be the case, what about: for v in varList: if row[0] == v[2] and s[1] == v[3]: ivr.write(v[0]) ivr.write('\n''\n') subitems = [tuple(item[-2:]) for item in varList if item[:3] == v[:3]] for item in subitems: ivr.write('\t%s\t%s\n' % item) Untested, obviously... but maybe that's close enough to be useful? HTH, Dylan From rshepard at appl-ecosys.com Wed May 21 15:42:23 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Wed, 21 May 2008 06:42:23 -0700 (PDT) Subject: [portland] Nested for loops, 4 levels deep In-Reply-To: <4c645a720805201743qf7f6d78ld58010f103d0da2f@mail.gmail.com> References: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> <4c645a720805201743qf7f6d78ld58010f103d0da2f@mail.gmail.com> Message-ID: On Tue, 20 May 2008, Dylan Reinhardt wrote: > If I understand correctly, you want the data to lay out something like this: > > Wildlife > Fish > Abundance > WFA1 if abundance is few then... > WFA2 if abundance is moderate then... > WFA3 if abundance is many then... Dylan, This is correct. The rule number/rule text pairs will be in a table, but that's a formatting detail. > Assuming that to be the case, what about: > > for v in varList: > if row[0] == v[2] and s[1] == v[3]: > ivr.write(v[0]) > ivr.write('\n''\n') > subitems = [tuple(item[-2:]) for item in varList if item[:3] == v[:3]] > for item in subitems: > ivr.write('\t%s\t%s\n' % item) > > Untested, obviously... but maybe that's close enough to be useful? I understand the list comprehension, but my modifications don't help. The multiple pairs at the lowest level are in appData.rules, not in v[]. I tried several variants, the latest being: subitems = [tuple(item[-2:]) for item in appData.rules if appData.rules[2] == v[0]] followd by 'print subitems', but only empty lists are printed. This is the conundrum that set me chasing my tail the past couple of days: how to iterate through the rows of appData.rules[] to pull out the appropriate last two items in each tuple where the first three items have been specified. Rich From python at dylanreinhardt.com Wed May 21 16:10:30 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Wed, 21 May 2008 07:10:30 -0700 Subject: [portland] Nested for loops, 4 levels deep In-Reply-To: References: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> <4c645a720805201743qf7f6d78ld58010f103d0da2f@mail.gmail.com> Message-ID: <4c645a720805210710n67b49d9s119dcbecc5a5b869@mail.gmail.com> On Wed, May 21, 2008 at 6:42 AM, Rich Shepard wrote: > On Tue, 20 May 2008, Dylan Reinhardt wrote: >> for v in varList: >> if row[0] == v[2] and s[1] == v[3]: >> ivr.write(v[0]) >> ivr.write('\n''\n') >> subitems = [tuple(item[-2:]) for item in varList if item[:3] == >> v[:3]] >> for item in subitems: >> ivr.write('\t%s\t%s\n' % item) >> >> Untested, obviously... but maybe that's close enough to be useful? > > I understand the list comprehension, but my modifications don't help. The > multiple pairs at the lowest level are in appData.rules, not in v[]. I tried > several variants, the latest being: > > subitems = [tuple(item[-2:]) for item in appData.rules if appData.rules[2] > == v[0]] OK... I can see that I got the appData part wrong... but I'm pretty sure you're going to want to select table items by comparing a range to a range, aren't you? You're interested in all the n's and t's that share the same c, s, and v. How about this: subitems = [tuple(item[-2:]) for item in appData.rules if item[:3] == (c[1], s[1], v[0])] I'm not sure I extracted c, s, and v correctly... I'm getting a little lost in there. But the data you want consists of all the rows in appData.rules where the first three elements match c, s, and v. This might not be the *exact* thing you're looking for, but should provide the correct answer once the correct comparison is made. HTH, Dylan From rshepard at appl-ecosys.com Wed May 21 16:42:02 2008 From: rshepard at appl-ecosys.com (Rich Shepard) Date: Wed, 21 May 2008 07:42:02 -0700 (PDT) Subject: [portland] Nested for loops, 4 levels deep In-Reply-To: <4c645a720805210710n67b49d9s119dcbecc5a5b869@mail.gmail.com> References: <4c645a720805201613w58c0a76y130d19ea5c412d53@mail.gmail.com> <4c645a720805201743qf7f6d78ld58010f103d0da2f@mail.gmail.com> <4c645a720805210710n67b49d9s119dcbecc5a5b869@mail.gmail.com> Message-ID: On Wed, 21 May 2008, Dylan Reinhardt wrote: > You're interested in all the n's and t's that share the same c, s, and > v. How about this: > > subitems = [tuple(item[-2:]) for item in appData.rules if item[:3] == > (c[1], s[1], v[0])] Perfect! Slicing item and matching to a tuple is an approach I've not seen before. > I'm not sure I extracted c, s, and v correctly... I'm getting a little > lost in there. But the data you want consists of all the rows in > appData.rules where the first three elements match c, s, and v. This > might not be the *exact* thing you're looking for, but should provide the > correct answer once the correct comparison is made. You hit it dead on, Dylan. What I did not do in my list comprehension attempts was to cast the result to a tuple. This has been a powerful lesson. Thank you very much. Rich