From aahz at pythoncraft.com Wed Dec 1 00:06:45 2010 From: aahz at pythoncraft.com (Aahz) Date: Tue, 30 Nov 2010 15:06:45 -0800 Subject: [Baypiggies] Egnyte: junior desktop dev Message-ID: <20101130230644.GA14226@panix.com> I just found out my bosses posted an ad to Craigslist without telling me; I'm reposting here in case anyone looking for a job isn't monitoring Craigslist. ;-) Feel free to ask me questions, but please send resumes to the following address and mention BayPIGgies. We're located in Mountain View near 101 and Shoreline. http://sfbay.craigslist.org/pen/sof/2053182125.html job-mkehu-2053182125 at craigslist.org Egnyte, the hybrid cloud storage company, is looking for a junior software engineer to join the desktop client team. The client runs on Windows and Macintosh computers. Most of the client UI is available through a web interface, served by a CherryPy application running on the desktop. Your job will include improving both the native desktop experience as well as the web UI, work on the installers on both platforms, and generally troubleshoot and fix issues. Requirements: =========== * 1-2 years of programming experience with personal projects or work * BS in Computer Science or equivalent experience * Object Oriented programming e.g. Python, Ruby, JavaScript, Java, etc Useful to have experience in: ===================== * Python * CherryPy or other web frameworks * Windows and Macintosh desktop application development * Tech support or QA * Linux and other Open Source technologies -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From jim at systemateka.com Thu Dec 2 21:54:05 2010 From: jim at systemateka.com (jim) Date: Thu, 02 Dec 2010 12:54:05 -0800 Subject: [Baypiggies] how to IPC with python on linux? Message-ID: <1291323245.2437.53.camel@jim-laptop> how to implement IPC in Python on Linux? There's a local open source group using python on fedora to create an app that looks like a classic threading problem: copying files has the effect of stalling until all files are written, and they'd like a progress bar. They're interested in building separate processes rather than get into threading, and after a brief unproductive hunt in the os and sys modules, i figured some of you all would have not only answers but maybe best practices for writing python programs on the linux OS that can use InterProcess Communication to work together. hopefully, jim From bpalmer at gmail.com Thu Dec 2 22:30:23 2010 From: bpalmer at gmail.com (Brian Palmer) Date: Thu, 2 Dec 2010 13:30:23 -0800 Subject: [Baypiggies] how to IPC with python on linux? In-Reply-To: <1291323245.2437.53.camel@jim-laptop> References: <1291323245.2437.53.camel@jim-laptop> Message-ID: On Thu, Dec 2, 2010 at 12:54 PM, jim wrote: > > how to implement IPC in Python on Linux? > There's a local open source group using python on > fedora to create an app that looks like a classic > threading problem: copying files has the effect of > stalling until all files are written, and they'd > like a progress bar. > The easy answer is to use the multiprocessing package: http://docs.python.org/library/multiprocessing.html Stuff looks like threads but is using multiple processes underneath. -------------- next part -------------- An HTML attachment was scrubbed... URL: From itz at buug.org Thu Dec 2 23:47:16 2010 From: itz at buug.org (Ian Zimmerman) Date: Thu, 02 Dec 2010 14:47:16 -0800 Subject: [Baypiggies] how to IPC with python on linux? In-Reply-To: (Brian Palmer's message of "Thu, 2 Dec 2010 13:30:23 -0800") References: <1291323245.2437.53.camel@jim-laptop> Message-ID: <87pqtjaj2j.fsf@matica.localdomain> Brian> The easy answer is to use the multiprocessing package: Brian> http://docs.python.org/library/multiprocessing.html Heh. I just tried to use multiprocessing for the first time for hgit, my hg-to-git conversion program[1]. My rationale was probably similar to that of jim's group or many other people, i.e. threads are a pain, there's the GIL, etc. But in the end I gave up and used threads. The trouble was that everything I sent over the IPC channel had to be picklable, and worse, the target of a multiprocessing.Process cannot be any callable (as it can for thrading.Thread), but only a module-level function, i.e. no closures or instance methods. These requirements together would pretty much force me to make all the interesting data global. [1] http://pypi.python.org/pypi/hgit/20101202 -- Ian Zimmerman gpg public key: 1024D/C6FF61AD fingerprint: 66DC D68F 5C1B 4D71 2EE5 BD03 8A00 786C C6FF 61AD Ham is for reading, not for eating. From rami.chowdhury at gmail.com Fri Dec 3 01:33:30 2010 From: rami.chowdhury at gmail.com (Rami Chowdhury) Date: Fri, 3 Dec 2010 00:33:30 +0000 Subject: [Baypiggies] how to IPC with python on linux? In-Reply-To: <87pqtjaj2j.fsf@matica.localdomain> References: <1291323245.2437.53.camel@jim-laptop> <87pqtjaj2j.fsf@matica.localdomain> Message-ID: How about D-BUS, or some other more general IPC solution? Python's got good DBUS bindings IIRC... On Dec 2, 2010, at 22:47 , Ian Zimmerman wrote: > > Brian> The easy answer is to use the multiprocessing package: > Brian> http://docs.python.org/library/multiprocessing.html > > Heh. I just tried to use multiprocessing for the first time for hgit, > my hg-to-git conversion program[1]. My rationale was probably similar > to that of jim's group or many other people, i.e. threads are a pain, > there's the GIL, etc. But in the end I gave up and used threads. The > trouble was that everything I sent over the IPC channel had to be > picklable, and worse, the target of a multiprocessing.Process cannot be > any callable (as it can for thrading.Thread), but only a module-level > function, i.e. no closures or instance methods. These requirements > together would pretty much force me to make all the interesting data > global. > > [1] http://pypi.python.org/pypi/hgit/20101202 > > -- > Ian Zimmerman > gpg public key: 1024D/C6FF61AD > fingerprint: 66DC D68F 5C1B 4D71 2EE5 BD03 8A00 786C C6FF 61AD > Ham is for reading, not for eating. > _______________________________________________ > 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 +44-7581-430-517 / +88-0189-245544 / +1-408-597-7068 From brent.tubbs at gmail.com Fri Dec 3 19:56:03 2010 From: brent.tubbs at gmail.com (Brent Tubbs) Date: Fri, 3 Dec 2010 10:56:03 -0800 Subject: [Baypiggies] how to IPC with python on linux? In-Reply-To: References: <1291323245.2437.53.camel@jim-laptop> <87pqtjaj2j.fsf@matica.localdomain> Message-ID: Another solution I played with recently: http://www.rabbitmq.com/tutorial-one-python.html On Thu, Dec 2, 2010 at 4:33 PM, Rami Chowdhury wrote: > How about D-BUS, or some other more general IPC solution? Python's got good DBUS bindings IIRC... > > On Dec 2, 2010, at 22:47 , Ian Zimmerman wrote: > >> >> Brian> The easy answer is to use the multiprocessing package: >> Brian> http://docs.python.org/library/multiprocessing.html >> >> Heh. ?I just tried to use multiprocessing for the first time for hgit, >> my hg-to-git conversion program[1]. ?My rationale was probably similar >> to that of jim's group or many other people, i.e. threads are a pain, >> there's the GIL, etc. ?But in the end I gave up and used threads. ?The >> trouble was that everything I sent over the IPC channel had to be >> picklable, and worse, the target of a multiprocessing.Process cannot be >> any callable (as it can for thrading.Thread), but only a module-level >> function, i.e. no closures or instance methods. ?These requirements >> together would pretty much force me to make all the interesting data >> global. >> >> [1] http://pypi.python.org/pypi/hgit/20101202 >> >> -- >> Ian Zimmerman >> gpg public key: 1024D/C6FF61AD >> fingerprint: 66DC D68F 5C1B 4D71 2EE5 ?BD03 8A00 786C C6FF 61AD >> Ham is for reading, not for eating. >> _______________________________________________ >> 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 > +44-7581-430-517 / +88-0189-245544 / +1-408-597-7068 > > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From tony.loeser at gmail.com Sat Dec 4 02:15:35 2010 From: tony.loeser at gmail.com (Tony Loeser) Date: Fri, 3 Dec 2010 17:15:35 -0800 Subject: [Baypiggies] Syapse: Python jobs in Palo Alto In-Reply-To: References: Message-ID: <1587C95F-9B29-4A72-BA55-87035C4EAABA@gmail.com> As posted to the jobs board: Syapse is a bioinformatics software company formed at Stanford and based in Palo Alto that accelerates biomedical product development by organizing biological results, and enabling scientific project management and collaboration. We utilize semantic technologies and biomedical ontologies to deliver scientifically intelligent web applications to biomedical companies of all sizes. We work with a number of prominent biotech, pharma, and diagnostics companies in the fields of biologics, biomarkers, and molecular diagnostics. More importantly for BayPIGgies, our server code is written in python! We are growing, and have a couple positions that we need to fill with outstanding software engineers. All the details are available here: http://www.syapse.com/jobs.php. Web Application Developer: * Take ownership of components on both the client and server side. * Client: HTML, CSS, Javascript. Prototypes through polished interfaces. * Server: Python, Django, SQL. A growing suite of modular applications. Python Server Developer: * Be (or become) a Django expert. Build a solid foundation for the application suite. * Build internal tools, from content curation to semantic data pipelines. * Back end stuff: MySQL optimization, search indexes, customer-specific cloud deployments, and whatever else it takes. To get in touch, find me (Tony Loeser) at tony at syapse.com. From sampenrose at gmail.com Sun Dec 5 22:37:50 2010 From: sampenrose at gmail.com (Sam Penrose) Date: Sun, 5 Dec 2010 13:37:50 -0800 Subject: [Baypiggies] reading files quickly and efficiently In-Reply-To: References: <201011171330.08869.mvoorhie@yahoo.com> Message-ID: It sounds like the community really came through for the specific case of biology data. For general cases of processing large files, David Beazley's generators-for-systems-programming slide deck has some interesting ideas: http://www.dabeaz.com/generators/Generators.pdf > On Wed, Nov 17, 2010 at 7:43 PM, Ned Deily wrote: >> In article >> , >> ?wesley chun wrote: >>> MODIFIED: >>> f = open ('nr', 'r') >>> print sum(1 for line in f) >>> f.close() >>> >>> can anyone else improve on this? >> >> with open('nr', 'r') as f: >> ?print(sum(1 for line in f)) >> >> should work on any Python from 2.6 to 3.2, and 2.5 with >> ?from __future__ import with_statement >> >> -- >> ?Ned Deily, >> ?nad at acm.org >> >> _______________________________________________ >> 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 Mon Dec 6 21:43:06 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 6 Dec 2010 12:43:06 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters Message-ID: We have no presenters for the Baypiggies meeting on December 16th (special night). Would anyone like to volunteer? If not, we may have to cancel the meeting this month. Thanks Tony From pythonmarco at gmail.com Tue Dec 7 18:04:12 2010 From: pythonmarco at gmail.com (Marco Hornung) Date: Tue, 7 Dec 2010 12:04:12 -0500 Subject: [Baypiggies] find memory leaks in running program Message-ID: Hey, ------------------------------------------------------------------------------------------ questions ------------------------------------------------------------------------------------------ 1. What are the best tools to analyze pythons memory stack, while it is running? 2. Is there a possibility to analyze the memory stack of a program with external programs? (without to change the source code - I am only interested in the object size) 3. Can I sort of "break" into the memory to see what objects consume how much memory? ------------------------------------------------------------------------------------------ my scenario ------------------------------------------------------------------------------------------ I have to debug a multithreaded server, which is written in the twisted-framework. One of the processes has some sort of memory leak - After one of our jobs is finished the main process has still over 59% of the entire memory allocated. I will probably have to recreate our scenario and equip our server with some memory sensors - but it takes 12h to reproduce the scenario and I will have to change the source code(at least I do not know of other options). Therefore I am looking for quicker possibilities to look into what causes our memory leak. Regards, Marco From jason at mischievous.org Tue Dec 7 18:20:57 2010 From: jason at mischievous.org (Jason Culverhouse) Date: Tue, 7 Dec 2010 09:20:57 -0800 Subject: [Baypiggies] find memory leaks in running program In-Reply-To: References: Message-ID: On Dec 7, 2010, at 9:04 AM, Marco Hornung wrote: > Hey, > > ------------------------------------------------------------------------------------------ > questions > ------------------------------------------------------------------------------------------ > 1. What are the best tools to analyze pythons memory stack, while it is running? I've had some luck with Dowser http://www.aminus.net/wiki/Dowser There is a blog post about using it with twisted http://www.aminus.org/blogs/index.php/2008/06/11/tracking-memory-leaks-with-dowser?blog=2 > 2. Is there a possibility to analyze the memory stack of a program with external programs? (without to change the source code - I am only interested in the object size) > 3. Can I sort of "break" into the memory to see what objects consume how much memory? There is always this trick... Just start an imbedded I Python shell from some handler from IPython.Shell import IPShellEmbed; IPShellEmbed()() Then just poke around with the gc module Jason > > ------------------------------------------------------------------------------------------ > my scenario > ------------------------------------------------------------------------------------------ > I have to debug a multithreaded server, which is written in the twisted-framework. One of the processes has some sort of memory leak - After one of our jobs is finished the main process has still over 59% of the entire memory allocated. I will probably have to recreate our scenario and equip our server with some memory sensors - but it takes 12h to reproduce the scenario and I will have to change the source code(at least I do not know of other options). > Therefore I am looking for quicker possibilities to look into what causes our memory leak. > > Regards, > Marco > _______________________________________________ > 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 Tue Dec 7 18:47:41 2010 From: tony at tcapp.com (Tony Cappellini) Date: Tue, 7 Dec 2010 09:47:41 -0800 Subject: [Baypiggies] find memory leaks in running program In-Reply-To: References: Message-ID: Well, it's not a good idea to install yet another package that may introduce more leaks or other problems. Just import pdb and sent a breakpoint where/when you think memory has "leaked" to the point that it's a problem, then As Jason mentioned, poke around with the gc module or other tools >> 3. Can I sort of "break" into the memory to see what objects consume how much memory? > There is always this trick... Just start an imbedded I Python shell from some handler > > from IPython.Shell import IPShellEmbed; IPShellEmbed()() > > Then just poke around with the gc module > Jason > From jjinux at gmail.com Tue Dec 7 22:18:27 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 7 Dec 2010 13:18:27 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: References: Message-ID: I'm asking around, but can't promise anything yet. -jj On Dec 6, 2010 12:43 PM, "Tony Cappellini" wrote: We have no presenters for the Baypiggies meeting on December 16th (special night). Would anyone like to volunteer? If not, we may have to cancel the meeting this month. Thanks Tony _______________________________________________ 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 jim at systemateka.com Tue Dec 7 23:03:49 2010 From: jim at systemateka.com (jim) Date: Tue, 07 Dec 2010 14:03:49 -0800 Subject: [Baypiggies] [Fwd: [PyOP] find memory leaks in running program] Message-ID: <1291759429.2448.7.camel@jim-laptop> forwarding this to the baypiggies list -------- Forwarded Message -------- From: Marco Hornung Reply-to: "Python On the Peninsula \(SF Bay Peninsula\)" To: pyop at python.org Subject: [PyOP] find memory leaks in running program Date: Tue, 7 Dec 2010 12:05:13 -0500 Hey, ------------------------------------------------------------------------------------------ questions ------------------------------------------------------------------------------------------ 1. What are the best tools to analyze pythons memory stack, while it is running? 2. Is there a possibility to analyze the memory stack of a program with external programs? (without to change the source code - I am only interested in the object size) 3. Can I sort of "break" into the memory to see what objects consume how much memory? ------------------------------------------------------------------------------------------ my scenario ------------------------------------------------------------------------------------------ I have to debug a multithreaded server, which is written in the twisted-framework. One of the processes has some sort of memory leak - After one of our jobs is finished the main process has still over 59% of the entire memory allocated. I will probably have to recreate our scenario and equip our server with some memory sensors - but it takes 12h to reproduce the scenario and I will have to change the source code(at least I do not know of other options). Therefore I am looking for quicker possibilities to look into what causes our memory leak. Regards, Marco _______________________________________________ pyop mailing list pyop at python.org http://mail.python.org/mailman/listinfo/pyop From aahz at pythoncraft.com Tue Dec 7 23:13:28 2010 From: aahz at pythoncraft.com (Aahz) Date: Tue, 7 Dec 2010 14:13:28 -0800 Subject: [Baypiggies] find memory leaks in running program In-Reply-To: References: Message-ID: <20101207221328.GB27792@panix.com> On Tue, Dec 07, 2010, Marco Hornung wrote: > > I have to debug a multithreaded server, which is written in the > twisted-framework. One of the processes has some sort of memory leak - > After one of our jobs is finished the main process has still over 59% > of the entire memory allocated. I will probably have to recreate our > scenario and equip our server with some memory sensors - but it takes > 12h to reproduce the scenario and I will have to change the source > code(at least I do not know of other options). This may not be a memory leak; Python often does not return memory to the OS, and even when memory is returned, the OS may leave it allocated to the application. First question is whether the memory usage you see is resident. Next question is whether you leak additional memory if you run the process again. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From cappy2112 at gmail.com Tue Dec 7 23:46:01 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Tue, 7 Dec 2010 14:46:01 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: References: Message-ID: We have a new memeber to the Bay Area & Baypiggies who has offered to do a presentation on "plone, zope, and pyramid. Plone 4 has been an awesome release and the news of pylons -> pyramid and using zope has been an interesting talking point. Not sure if that's of interest to the group?" At this point, since we have no other offers, I'd like to accept this offer unless there is serious reason not to. +1 From alexandre.conrad at gmail.com Wed Dec 8 00:03:25 2010 From: alexandre.conrad at gmail.com (Alexandre Conrad) Date: Tue, 7 Dec 2010 15:03:25 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: References: Message-ID: Unfortunately, I won't make it. I wish I could now that I know there's a Pyramid presentation coming-up. My company is evaluating this framework for future development. Have fun y'all. 2010/12/7 Tony Cappellini > We have a new memeber to the Bay Area & Baypiggies who has offered to > do a presentation on > > "plone, zope, and pyramid. Plone 4 has been an awesome release and the > news of pylons -> pyramid and using zope has been an interesting > talking point. Not sure if that's of interest to the group?" > > At this point, since we have no other offers, I'd like to accept this > offer unless there is serious reason not to. > > +1 > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Alex | twitter.com/alexconrad -------------- next part -------------- An HTML attachment was scrubbed... URL: From janssen at parc.com Wed Dec 8 02:46:08 2010 From: janssen at parc.com (Bill Janssen) Date: Tue, 7 Dec 2010 17:46:08 PST Subject: [Baypiggies] Looking for systems engineer with Python/Java expertise Message-ID: <83977.1291772768@parc.com> Hi! I thought I'd point out that my group at PARC -- the Knowledge, Language, and Interactions research area in the Intelligent Systems Lab -- has an opening for a Python-savvy systems guy. We're looking at large-scale cloud-style deployment of some of our systems. They tend to be tricky; for instance, the UpLib system (http://uplib.parc.com/) is a Python service that runs Java in the same process, courtesy of PyLucene. So, to work on it, you need some experience of both Python servers and Java servers. If you feel that you could get it running on, say, Windows Azure, as well, that's the kind of person we're looking for. If you're confident you can hack anything that's Python/Java, and build scalable systems (millions of users), you might want to take a look at the posting. http://www.parc.com/job/155/member-of-research-staff-ii---intelligent-systems.html Please apply using the on-line form on that page -- not to me. Bill From janssen at parc.com Wed Dec 8 03:03:01 2010 From: janssen at parc.com (Bill Janssen) Date: Tue, 7 Dec 2010 18:03:01 PST Subject: [Baypiggies] [Fwd: [PyOP] find memory leaks in running program] In-Reply-To: <1291759429.2448.7.camel@jim-laptop> References: <1291759429.2448.7.camel@jim-laptop> Message-ID: <84496.1291773781@parc.com> marco> ------------------------------------------------------------------------------------------ marco> questions marco> ------------------------------------------------------------------------------------------ marco> 1. What are the best tools to analyze pythons memory stack, marco> while it is running? 2. Is there a possibility to analyze the marco> memory stack of a program with external programs? (without to marco> change the source code - I am only interested in the object marco> size) 3. Can I sort of "break" into the memory to see what marco> objects consume how much memory? Tough without adding some sort of trace. What I use is Guppy, or actually Heapy. I added a thread to my Python program which runs something like this: while True: heap = hpy().heap() outputfile.write("-=--=--=--=--=- %s\n" % time.time()) heap.dump(outputfile) time.sleep(5 * 60) Then you've got a logfile that shows you the state of the heap as your program progresses. You've still got to write a program to parse the logfile, but at least you have data. Might be able to start a thread like this using gdb to attach to a remote process and start the new thread, too. http://guppy-pe.sourceforge.net/#Guppy See also . Bill From jjinux at gmail.com Wed Dec 8 04:44:18 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Tue, 7 Dec 2010 19:44:18 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: References: Message-ID: +1 On Dec 7, 2010 2:46 PM, "Tony Cappellini" wrote: We have a new memeber to the Bay Area & Baypiggies who has offered to do a presentation on "plone, zope, and pyramid. Plone 4 has been an awesome release and the news of pylons -> pyramid and using zope has been an interesting talking point. Not sure if that's of interest to the group?" At this point, since we have no other offers, I'd like to accept this offer unless there is serious reason not to. +1 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Web at StevePiercy.com Wed Dec 8 06:20:33 2010 From: Web at StevePiercy.com (Steve Piercy - Web Site Builder) Date: Tue, 7 Dec 2010 21:20:33 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: Message-ID: On 12/7/10 at 2:46 PM, cappy2112 at gmail.com (Tony Cappellini) pronounced: > "plone, zope, and pyramid. Plone 4 has been an awesome release and the > news of pylons -> pyramid and using zope has been an interesting > talking point. Not sure if that's of interest to the group?" +1 --steve (new to baypiggies) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA From mrbmahoney at gmail.com Wed Dec 8 15:11:19 2010 From: mrbmahoney at gmail.com (Brian Mahoney) Date: Wed, 8 Dec 2010 06:11:19 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: References: Message-ID: On Tue, Dec 7, 2010 at 2:46 PM, Tony Cappellini wrote: > We have a new memeber to the Bay Area & Baypiggies who has offered to > do a presentation on > > "plone, zope, and pyramid. Plone 4 has been an awesome release and the > news of pylons -> pyramid and using zope has been an interesting > talking point. Not sure if that's of interest to the group?" > > +1 for Plone 4 / pylons / Pyramid and I can be there -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjinux at gmail.com Wed Dec 8 20:09:07 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 8 Dec 2010 11:09:07 -0800 Subject: [Baypiggies] December 16th meeting, looking for topics & presenters In-Reply-To: References: Message-ID: +1! On Tue, Dec 7, 2010 at 2:46 PM, Tony Cappellini wrote: > We have a new memeber to the Bay Area & Baypiggies who has offered to > do a presentation on > > "plone, zope, and pyramid. Plone 4 has been an awesome release and the > news of pylons -> pyramid and using zope has been an interesting > talking point. Not sure if that's of interest to the group?" > > At this point, since we have no other offers, I'd like to accept this > offer unless there is serious reason not to. > > +1 > -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From jjinux at gmail.com Wed Dec 8 20:29:23 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 8 Dec 2010 11:29:23 -0800 Subject: [Baypiggies] find memory leaks in running program In-Reply-To: References: Message-ID: On Tue, Dec 7, 2010 at 9:04 AM, Marco Hornung wrote: > Hey, > > ------------------------------------------------------------------------------------------ > questions > ------------------------------------------------------------------------------------------ > 1. What are the best tools to analyze pythons memory stack, while it is running? > 2. Is there a possibility to analyze the memory stack of a program with external programs? (without to change the source code - I am only interested in the object size) > 3. Can I sort of "break" into the memory to see what objects consume how much memory? > > ------------------------------------------------------------------------------------------ > my scenario > ------------------------------------------------------------------------------------------ > I have to debug a multithreaded server, which is written in the twisted-framework. One of the processes has some sort of memory leak - After one of our jobs is finished the main process has still over 59% of the entire memory allocated. I will probably have to recreate our scenario and equip our server with some memory sensors - but ?it takes 12h to reproduce the scenario and I will have to change the source code(at least I do not know of other options). > Therefore I am looking for quicker possibilities to look into what causes our memory leak. One time I found a memory leak in MySQLdb. It was in C code, and it only happened when you passed a certain argument to the connection parameters that had something to do with decoding. It would only manifest itself after a day. That was really, really hard to find because the leak was invisible from Python's perspective. My approach was to use a process of elimination. I would slowly remove more and more code and try to run the code faster and faster in a loop (making external requests to my server) in order to detect the memory leak more quickly. It took a few days of effort. By the way, it might not be completely relevant, but there was a *fantastic* talk on debugging Ruby on Rails applications using low-level tools: http://scr.bi/debuggingruby http://bit.ly/96dVJ9 A lot of it also applies to Python, but not all of it. That talks was simply incredible. The speaker had used his techniques (which involved a huge range of tools) to find multiple memory leaks and massive performance problems in both Ruby and Rails. Best Regards, -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From jim at systemateka.com Wed Dec 8 20:57:11 2010 From: jim at systemateka.com (jim) Date: Wed, 08 Dec 2010 11:57:11 -0800 Subject: [Baypiggies] Please Respond ASAP: request for support for Linux and open source Message-ID: <1291838231.2447.25.camel@jim-laptop> On Monday, December 13, a TV show called ABC 7 Live will focus on technology and non-profits. They are interested in having supporters of Linux in schools attend and possibly respond to questions. The show airs from 3 pm to 4 pm. Please let Christian know you can participate today by emailing him at Christian Einfeldt (and CC: me at jim at systemateka.com ) The show needs to have a list of participants in advance and will check attendees against the list; they will not admit people not on the list. 7Live is broadcast from the ABC studio located at 900 Front Street, San Francisco, CA 94111. 7Live?s audience entrance is located on the North side of the building on Green Street between Embarcadero and Front Streets. 7liveonline.com jim 415 823 4590 my cellphone, call anytime From bryceverdier at gmail.com Wed Dec 8 22:24:39 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Wed, 08 Dec 2010 13:24:39 -0800 Subject: [Baypiggies] scientific notation: string to int Message-ID: <4CFFF797.4040103@gmail.com> So I've been given a project for work, a large CSV file with many many numbers and such to parse through. The lines that look like this: b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 20,15228831373,80966857300, so I'm curious if there is a way to turn the string of scientific notion into the actual numerical value? All ideas are welcomed and thank in advance, Bryce From jtatum at gmail.com Wed Dec 8 22:41:09 2010 From: jtatum at gmail.com (James Tatum) Date: Wed, 8 Dec 2010 13:41:09 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4CFFF797.4040103@gmail.com> References: <4CFFF797.4040103@gmail.com> Message-ID: Scientific/exponential notation is handled natively by floats: >>> float('2e10') 20000000000.0 >>> float('2e100') 2e+100 >>> float('2e-10') 2.0000000000000001e-10 On Wed, Dec 8, 2010 at 1:24 PM, Bryce Verdier wrote: > So I've been given a project for work, a large CSV file with many many > numbers and such to parse through. The lines that look like this: > > b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec ?2 00:00:00 UTC > 2010,2.96116E+11,0,0, Thu Dec ?2 00:00:00 UTC 2010,577078067 > 20,15228831373,80966857300, > > so I'm curious if there is a way to turn the string of scientific notion > into the actual numerical value? > > All ideas are welcomed and thank in advance, > > Bryce > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From eric.edens at gmail.com Wed Dec 8 22:42:00 2010 From: eric.edens at gmail.com (Eric Edens) Date: Wed, 8 Dec 2010 13:42:00 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4CFFF797.4040103@gmail.com> References: <4CFFF797.4040103@gmail.com> Message-ID: Any ideas for improvement? def foo(baz): '''@param baz - string representation of exp notation, ie "3.2E4" or "3.2E-4" ''' base, exp = map(float,baz.split('E')) return base*10**exp >>> foo ('2.96116E+11') 296116000000.0 >>> foo ('2.96116E-11') 2.96116e-11 >>> foo ('3.2E4') 32000.0 On Wed, Dec 8, 2010 at 1:24 PM, Bryce Verdier wrote: > So I've been given a project for work, a large CSV file with many many > numbers and such to parse through. The lines that look like this: > > b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 > UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 > 20,15228831373,80966857300, > > so I'm curious if there is a way to turn the string of scientific notion > into the actual numerical value? > > All ideas are welcomed and thank in advance, > > Bryce > _______________________________________________ > 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 dalke at dalkescientific.com Wed Dec 8 22:38:01 2010 From: dalke at dalkescientific.com (Andrew Dalke) Date: Wed, 8 Dec 2010 22:38:01 +0100 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4CFFF797.4040103@gmail.com> References: <4CFFF797.4040103@gmail.com> Message-ID: On Dec 8, 2010, at 10:24 PM, Bryce Verdier wrote: > b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 > 20,15228831373,80966857300, > > so I'm curious if there is a way to turn the string of scientific notion into the actual numerical value? >>> float("2.96116E+11") 296116000000.0 >>> Andrew dalke at dalkescientific.com From bryceverdier at gmail.com Wed Dec 8 22:48:32 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Wed, 08 Dec 2010 13:48:32 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: References: <4CFFF797.4040103@gmail.com> Message-ID: <4CFFFD30.90604@gmail.com> Wow guys, thank you all for the quick response. I had no idea the problem would be that easy to solve. Thanks again, Bryce On 12/08/2010 01:38 PM, Andrew Dalke wrote: > On Dec 8, 2010, at 10:24 PM, Bryce Verdier wrote: >> b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 >> 20,15228831373,80966857300, >> >> so I'm curious if there is a way to turn the string of scientific notion into the actual numerical value? > >>>> float("2.96116E+11") > 296116000000.0 > Andrew > dalke at dalkescientific.com > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From keith at dartworks.biz Wed Dec 8 22:51:50 2010 From: keith at dartworks.biz (Keith Dart) Date: Wed, 8 Dec 2010 13:51:50 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4CFFFD30.90604@gmail.com> References: <4CFFF797.4040103@gmail.com> <4CFFFD30.90604@gmail.com> Message-ID: <20101208135150.03094d27@dartworks.biz> === On Wed, 12/08, Bryce Verdier wrote: === > Wow guys, thank you all for the quick response. I had no idea the > problem would be that easy to solve. === Hey, this is Python. ;-) But you did say "int", so if that's what you really want, then: Python> int(float('2.96116E+11')) 296116000000 -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From eric.edens at gmail.com Wed Dec 8 22:52:00 2010 From: eric.edens at gmail.com (Eric Edens) Date: Wed, 8 Dec 2010 13:52:00 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <20101208134756.1813c9c2@dartworks.biz> References: <4CFFF797.4040103@gmail.com> <20101208134756.1813c9c2@dartworks.biz> Message-ID: Everything's right; I just didn't know it was built-in :) On Wed, Dec 8, 2010 at 1:47 PM, Keith Dart wrote: > === On Wed, 12/08, Eric Edens wrote: === > > >>> foo ('2.96116E-11') > > 2.96116e-11 > > === > > What's wrong with just: > > Python> float('2.96116E+11') > 296116000000.0 > > Python> float('2.96116E-11') > 2.96116e-11 > > ? > > > > -- Keith Dart > > -- > > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Keith Dart > public key: ID: 19017044 > > ===================================================================== > -------------- next part -------------- An HTML attachment was scrubbed... URL: From keith at dartworks.biz Wed Dec 8 22:47:56 2010 From: keith at dartworks.biz (Keith Dart) Date: Wed, 8 Dec 2010 13:47:56 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: References: <4CFFF797.4040103@gmail.com> Message-ID: <20101208134756.1813c9c2@dartworks.biz> === On Wed, 12/08, Eric Edens wrote: === > >>> foo ('2.96116E-11') > 2.96116e-11 === What's wrong with just: Python> float('2.96116E+11') 296116000000.0 Python> float('2.96116E-11') 2.96116e-11 ? -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From jeff.sheldon at emsense.com Wed Dec 8 22:39:39 2010 From: jeff.sheldon at emsense.com (Jeff Sheldon) Date: Wed, 8 Dec 2010 15:39:39 -0600 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4CFFF797.4040103@gmail.com> References: <4CFFF797.4040103@gmail.com> Message-ID: In python 2.6 (and later) float() works for this... In [15]: float('2.96116E+11') Out[15]: 296116000000.0 - Jeff -----Original Message----- From: baypiggies-bounces+jeff.sheldon=emsense.com at python.org [mailto:baypiggies-bounces+jeff.sheldon=emsense.com at python.org] On Behalf Of Bryce Verdier Sent: Wednesday, December 08, 2010 1:25 PM To: Baypiggies Subject: [Baypiggies] scientific notation: string to int So I've been given a project for work, a large CSV file with many many numbers and such to parse through. The lines that look like this: b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 20,15228831373,80966857300, so I'm curious if there is a way to turn the string of scientific notion into the actual numerical value? All ideas are welcomed and thank in advance, Bryce _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: http://mail.python.org/mailman/listinfo/baypiggies This email message is confidential and is intended only for the named recipient(s) above, and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. The contents of this email are for discussion purposes only and shall not create a legally binding commitment or agreement of EmSense Corporation, which shall require EmSense Corporation management approval and a formal written agreement signed by both parties. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message from your computer. From keith at dartworks.biz Wed Dec 8 23:46:07 2010 From: keith at dartworks.biz (Keith Dart) Date: Wed, 8 Dec 2010 14:46:07 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: References: <4CFFF797.4040103@gmail.com> Message-ID: <20101208144607.17c49e08@dartworks.biz> === On Wed, 12/08, Jeff Sheldon wrote: === > In python 2.6 (and later) float() works for this... > > In [15]: float('2.96116E+11') > Out[15]: 296116000000.0 === Earlier versions, also: >>> import sys >>> sys.version '2.4.3 (#1, Nov 11 2010, 13:34:43) \n[GCC 4.1.2 20080704 (Red Hat4.1.2-48)]' >>> float('2.96116E+11') 296116000000.0 -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From dalke at dalkescientific.com Thu Dec 9 00:53:46 2010 From: dalke at dalkescientific.com (Andrew Dalke) Date: Thu, 9 Dec 2010 00:53:46 +0100 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <20101208144607.17c49e08@dartworks.biz> References: <4CFFF797.4040103@gmail.com> <20101208144607.17c49e08@dartworks.biz> Message-ID: <5AE33185-2261-4ECE-98BE-8FDEAAC9C02C@dalkescientific.com> On Dec 8, 2010, at 11:46 PM, Keith Dart wrote: > Earlier versions, also: > >>>> import sys >>>> sys.version > '2.4.3 (#1, Nov 11 2010, 13:34:43) \n[GCC 4.1.2 20080704 (Red Hat4.1.2-48)]' >>>> float('2.96116E+11') > 296116000000.0 but not 0.9.1 ;) [xavier:~/ftps/python-0.9.1] dalke% ./src/python >>> eval('2.96116E+11') 296116000000.0 >>> float('2.96116E+11') Unhandled exception: type error: float() argument must be float or int Stack backtrace (innermost last): File "", line 1 >>> There was once upon a time no other way to convert a "float" to a float. [xavier:~/ftps/python-0.9.1] dalke% grep -r atof . ./src/compile.c: extern double atof(); ./src/compile.c: return newfloatobject(atof(s)); Binary file ./src/compile.o matches Binary file ./src/libpython.a matches Binary file ./src/python matches [xavier:~/ftps/python-0.9.1] dalke% grep -r strtod . [xavier:~/ftps/python-0.9.1] dalke% fgrep -r '%f' . [xavier:~/ftps/python-0.9.1] dalke% Andrew dalke at dalkescientific.com From keith at dartworks.biz Thu Dec 9 02:25:20 2010 From: keith at dartworks.biz (Keith Dart) Date: Wed, 8 Dec 2010 17:25:20 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <5AE33185-2261-4ECE-98BE-8FDEAAC9C02C@dalkescientific.com> References: <4CFFF797.4040103@gmail.com> <20101208144607.17c49e08@dartworks.biz> <5AE33185-2261-4ECE-98BE-8FDEAAC9C02C@dalkescientific.com> Message-ID: <20101208172520.7869adfe@dartworks.biz> === On Thu, 12/09, Andrew Dalke wrote: === > but not 0.9.1 ;) === Wow, ok, that's going waaaay back. 8-O So, now we know any version after 2.4 can convert a scientific notation strings simply, but not before or equal to 0.9.1. Dang, I don't have 1.5 around any more to narrow it down further. ;-) Now I'm curious, what's the earliest version of Python anyone has in "production", or personal use? My Gentoo Linux just sprouted 2.7.1 (and 3.1.3) in its "portage" system. So I will be using that from now on. That is supposed to be the very last 2.x version, but with extended maintenance period (more than two years). Anybody using that yet? Or even 3.x? -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From jjinux at gmail.com Thu Dec 9 02:46:12 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 8 Dec 2010 17:46:12 -0800 Subject: [Baypiggies] refactoring support Message-ID: Has anyone had luck with any editors / IDEs that provide refactoring for Python? I know there's Bicycle Repair Man for Emacs, etc. and that PyCharmer has some stuff. I've tried the stuff in NetBeans a little, but not much. I haven't tried the refactoring support in PyDev or WingIDE. Thanks, -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From simeonf at gmail.com Thu Dec 9 02:55:49 2010 From: simeonf at gmail.com (Simeon Franklin) Date: Wed, 8 Dec 2010 17:55:49 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: Have you looked at Rope in Emacs or VI? I think it's newer than Bicycle Repair Man but my experience w/ it is extremely limited. -Simeon On Wed, Dec 8, 2010 at 5:46 PM, Shannon -jj Behrens wrote: > Has anyone had luck with any editors / IDEs that provide refactoring > for Python? ?I know there's Bicycle Repair Man for Emacs, etc. and > that PyCharmer has some stuff. ?I've tried the stuff in NetBeans a > little, but not much. ?I haven't tried the refactoring support in > PyDev or WingIDE. > > Thanks, > -jj > > -- > In this life we cannot do great things. We can only do small things > with great love. -- Mother Teresa > http://jjinux.blogspot.com/ > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From eric at ericwalstad.com Thu Dec 9 03:10:40 2010 From: eric at ericwalstad.com (Eric Walstad) Date: Wed, 8 Dec 2010 18:10:40 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: On Wed, Dec 8, 2010 at 5:46 PM, Shannon -jj Behrens wrote: > Has anyone had luck with any editors / IDEs that provide refactoring > for Python? ?I know there's Bicycle Repair Man for Emacs, etc. and > that PyCharmer has some stuff. ?I've tried the stuff in NetBeans a > little, but not much. ?I haven't tried the refactoring support in > PyDev or WingIDE. I use WingIDE daily but have never checked for refactoring support. My search of its documentation, and its website, turned up nothing on refactoring. I'd be interested to hear what you find. Good luck, EW. From max at theslimmers.net Thu Dec 9 03:22:11 2010 From: max at theslimmers.net (Max Slimmer) Date: Wed, 8 Dec 2010 18:22:11 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: I use wingIde too, found this video/download which indicates there is some new tools in ver 4 http://filesboom.com/torrent/refactoring-in-wing-ide/QrwfdO1x5NQ On Wed, Dec 8, 2010 at 6:10 PM, Eric Walstad wrote: > On Wed, Dec 8, 2010 at 5:46 PM, Shannon -jj Behrens wrote: >> Has anyone had luck with any editors / IDEs that provide refactoring >> for Python? ?I know there's Bicycle Repair Man for Emacs, etc. and >> that PyCharmer has some stuff. ?I've tried the stuff in NetBeans a >> little, but not much. ?I haven't tried the refactoring support in >> PyDev or WingIDE. > > I use WingIDE daily but have never checked for refactoring support. > My search of its documentation, and its website, turned up nothing on > refactoring. ?I'd be interested to hear what you find. > > Good luck, > > EW. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From eric at ericwalstad.com Thu Dec 9 03:39:27 2010 From: eric at ericwalstad.com (Eric Walstad) Date: Wed, 8 Dec 2010 18:39:27 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: On Wed, Dec 8, 2010 at 6:22 PM, Max Slimmer wrote: > I use wingIde too, found this video/download which indicates there is > some new tools in ver 4 > > http://filesboom.com/torrent/refactoring-in-wing-ide/QrwfdO1x5NQ Wow, nice sleuthing. v4 is still Beta; I'm running 3.2.11-1. I'm surprised that their v4 features page[0] doesn't mention the refactoring support either. The refactoring tools I've used in the past are grep, find, sed and Wing's 'Find in files' tool with copy/paste. EW [0] http://wingide.com/wingide/beta From spmcinerney at hotmail.com Thu Dec 9 03:40:42 2010 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Wed, 8 Dec 2010 18:40:42 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: PyDev for Eclipse does basic refactoring (extract method, extract variable, rename method) http://pydev.org/manual_adv_refactoring.html (If you wanted something more powerful, what exactly are you looking for?) Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony at tcapp.com Thu Dec 9 04:35:50 2010 From: tony at tcapp.com (Tony Cappellini) Date: Wed, 8 Dec 2010 19:35:50 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: > I use WingIDE daily but have never checked for refactoring support. > My search of its documentation, and its website, turned up nothing on > refactoring. ?I'd be interested to hear what you find. Ditto. I've been using Wing for just over 4 years, never heard anything about refactoring tools. From jeff at jeffhunter.me Thu Dec 9 05:31:05 2010 From: jeff at jeffhunter.me (Jeff Hunter) Date: Wed, 8 Dec 2010 20:31:05 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: References: Message-ID: <08EBBC6A-5544-41BC-B9A6-302318F796C9@jeffhunter.me> I have been using PyCharm for about a week now. It has refactoring support. I've only used it a couple of times, but it seems to work well. Jeff On Dec 8, 2010, at 5:46 PM, Shannon -jj Behrens wrote: > Has anyone had luck with any editors / IDEs that provide refactoring > for Python? I know there's Bicycle Repair Man for Emacs, etc. and > that PyCharmer has some stuff. I've tried the stuff in NetBeans a > little, but not much. I haven't tried the refactoring support in > PyDev or WingIDE. > > Thanks, > -jj > > -- > In this life we cannot do great things. We can only do small things > with great love. -- Mother Teresa > http://jjinux.blogspot.com/ > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From jjinux at gmail.com Thu Dec 9 06:28:09 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 8 Dec 2010 21:28:09 -0800 Subject: [Baypiggies] refactoring support In-Reply-To: <08EBBC6A-5544-41BC-B9A6-302318F796C9@jeffhunter.me> References: <08EBBC6A-5544-41BC-B9A6-302318F796C9@jeffhunter.me> Message-ID: > Have you looked at Rope in Emacs or VI? Not yet. > (If you wanted something more powerful, what exactly are you looking for?) I'm not looking for anything in particular. I'm just curious. > I have been using PyCharm for about a week now. It has refactoring support. I've only used it a couple of times, but it seems to work well. Yeah, I've been thinking of using PyCharm, but I always feel uncomfortable using proprietary development tools. I might give it a shot anyway. Of course, I'm currently using NetBeans, and I haven't fully explored what it can do yet. Thanks, -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From dalke at dalkescientific.com Thu Dec 9 08:02:58 2010 From: dalke at dalkescientific.com (Andrew Dalke) Date: Thu, 9 Dec 2010 08:02:58 +0100 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <20101208172520.7869adfe@dartworks.biz> References: <4CFFF797.4040103@gmail.com> <20101208144607.17c49e08@dartworks.biz> <5AE33185-2261-4ECE-98BE-8FDEAAC9C02C@dalkescientific.com> <20101208172520.7869adfe@dartworks.biz> Message-ID: On Dec 9, 2010, at 2:25 AM, Keith Dart wrote: > So, now we know any version after 2.4 can convert a scientific notation > strings simply, but not before or equal to 0.9.1. Dang, I don't have 1.5 > around any more to narrow it down further. ;-) In most of the 1.5 series you needed to do string.atof. Here's one example: http://effbot.org/librarybook/string.htm I haven't pinned it down to a specific release yet, but in that link /F says it was 1.6. > Now I'm curious, what's the earliest version of Python anyone has in > "production", or personal use? I think I started with 1.3, perhaps 1.2? That was to learn Python. I first convinced my employer to use it in in 1998 so that was 1.5. Andrew dalke at dalkescientific.com From bryceverdier at gmail.com Thu Dec 9 22:18:20 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Thu, 09 Dec 2010 13:18:20 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: References: <4CFFF797.4040103@gmail.com> Message-ID: <4D01479C.2010605@gmail.com> I knew it was to easy to be true. Help?!?! Traceback (most recent call last): File "./space_report.py", line 58, in file1_class_clients.append(client(x,v)) File "./space_report.py", line 10, in __init__ self.size = float(size) ValueError: could not convert string to float: Commercial Max Space Used This is in python 3.1.2 if that matters. Bryce On 12/08/2010 01:38 PM, Andrew Dalke wrote: > On Dec 8, 2010, at 10:24 PM, Bryce Verdier wrote: >> b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 >> 20,15228831373,80966857300, >> >> so I'm curious if there is a way to turn the string of scientific notion into the actual numerical value? > >>>> float("2.96116E+11") > 296116000000.0 > Andrew > dalke at dalkescientific.com > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From keith at dartworks.biz Thu Dec 9 22:44:20 2010 From: keith at dartworks.biz (Keith Dart) Date: Thu, 9 Dec 2010 13:44:20 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4D01479C.2010605@gmail.com> References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> Message-ID: <20101209134420.586dcc5f@dartworks.biz> === On Thu, 12/09, Bryce Verdier wrote: === > ValueError: could not convert string to float: Commercial Max Space > Used > > > This is in python 3.1.2 if that matters. === Whoa, that's a new one. Not even Google knows about it. Can you supply the actual string here? -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From bryceverdier at gmail.com Thu Dec 9 22:59:57 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Thu, 09 Dec 2010 13:59:57 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <20101209134420.586dcc5f@dartworks.biz> References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> <20101209134420.586dcc5f@dartworks.biz> Message-ID: <4D01515D.9060909@gmail.com> Hey Keith, The best I can do for string is the line from my original posting(client data, NDA, I'm sure you understand): b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 20,15228831373,80966857300, I will say that in the file there are 135 lines in the files. So it's not like there is a lot data to deal with. I wonder if I should move back to 2.7. the code is still being worked on, so don't laugh to hard (constructive critisims are welcomed though) ;) #!/usr/bin/python3 import sys import re from optparse import OptionParser class client(object): def __init__(self, name, size): self.name = name self.size = float(size) self.east_coast = bool(re.search("_E", name)) self.trial = bool(re.search("TR_", name)) self.demo = bool(re.search("_Demo", name)) self.zetta = bool(re.search("zetta|Zetta", name)) def get_size(self): return str(self.size) def get_name(self): return str(self.name) def read_file(filename): file_data = {} with open(filename, 'r') as f: for lines in f: split_lines = lines.split(',') file_data[split_lines[1]] = split_lines[3] return file_data if __name__ == "__main__": file1_clients = {} file2_clients = {} file1_class_clients = [] file2_class_clients = [] usage = "%prog [options]" parser = OptionParser(usage=usage) parser.add_option("-f", "--first", dest="first", help="Older file first, builds table from here.") parser.add_option("-s", "--second", dest="second", help="New file, used for calculating the difference.") (options,args) = parser.parse_args() if not options.first or not options.second: print("The file argument (-f) is nessacary to run this program.\n") parser.print_help() sys.exit(1) file1_clients = read_file(options.first) file2_clients = read_file(options.second) for x,v in file1_clients.items(): file1_class_clients.append(client(x,v)) for x,v in file2_clients.items(): file2_class_clients.append(client(x,v)) for x in file1_class_clients: print(x.get_name() + ":" + x.get_size()) On 12/09/2010 01:44 PM, Keith Dart wrote: > === On Thu, 12/09, Bryce Verdier wrote: === >> ValueError: could not convert string to float: Commercial Max Space >> Used >> >> >> This is in python 3.1.2 if that matters. > === > > Whoa, that's a new one. Not even Google knows about it. Can you supply > the actual string here? > > > > -- Keith Dart > From rami.chowdhury at gmail.com Thu Dec 9 23:53:24 2010 From: rami.chowdhury at gmail.com (Rami Chowdhury) Date: Thu, 9 Dec 2010 22:53:24 +0000 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4D01515D.9060909@gmail.com> References: <4CFFF797.4040103@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> Message-ID: <201012092253.24172.rami.chowdhury@gmail.com> On Thursday 09 December 2010 21:59:57 Bryce Verdier wrote: > Hey Keith, > > The best I can do for string is the line from my original posting(client > data, NDA, I'm sure you understand): > > b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 > UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 > 20,15228831373,80966857300, Well, we already know that string works :S Could you put the setting of self.size in a try/except block, and print out the string that's causing the ValueError? > I will say that in the file there are 135 lines in the files. So it's > not like there is a lot data to deal with. I wonder if I should move > back to 2.7. > > the code is still being worked on, so don't laugh to hard (constructive > critisims are welcomed though) ;) > #!/usr/bin/python3 > > import sys > import re > from optparse import OptionParser > > class client(object): > def __init__(self, name, size): > self.name = name > self.size = float(size) > self.east_coast = bool(re.search("_E", name)) > self.trial = bool(re.search("TR_", name)) > self.demo = bool(re.search("_Demo", name)) > self.zetta = bool(re.search("zetta|Zetta", name)) > > def get_size(self): > return str(self.size) > > def get_name(self): > return str(self.name) I'm by no means an expert but getters and setters don't strike me as particularly Pythonic -- perhaps properties are more so? > > def read_file(filename): > file_data = {} > > with open(filename, 'r') as f: > for lines in f: > split_lines = lines.split(',') > file_data[split_lines[1]] = split_lines[3] > > return file_data > > if __name__ == "__main__": > > file1_clients = {} > file2_clients = {} > file1_class_clients = [] > file2_class_clients = [] > > usage = "%prog [options]" > parser = OptionParser(usage=usage) > parser.add_option("-f", "--first", dest="first", > help="Older file first, builds table from here.") > parser.add_option("-s", "--second", dest="second", > help="New file, used for calculating the difference.") > > (options,args) = parser.parse_args() > > if not options.first or not options.second: > print("The file argument (-f) is nessacary to run this > program.\n") parser.print_help() > sys.exit(1) > > file1_clients = read_file(options.first) > file2_clients = read_file(options.second) > > for x,v in file1_clients.items(): > file1_class_clients.append(client(x,v)) > > for x,v in file2_clients.items(): > file2_class_clients.append(client(x,v)) > > for x in file1_class_clients: > print(x.get_name() + ":" + x.get_size()) > > On 12/09/2010 01:44 PM, Keith Dart wrote: > > === On Thu, 12/09, Bryce Verdier wrote: === > > > >> ValueError: could not convert string to float: Commercial Max Space > >> Used > >> > >> > >> This is in python 3.1.2 if that matters. > > > > === > > > > Whoa, that's a new one. Not even Google knows about it. Can you supply > > the actual string here? > > > > > > > > -- Keith Dart > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies ---- Rami Chowdhury "Strangers are just friends who haven't had enough gin." -- Howdle's Saying +44-7581-430-517 / +88-01819-245544 /+1-408-597-7068 From keith at dartworks.biz Thu Dec 9 23:49:58 2010 From: keith at dartworks.biz (Keith Dart) Date: Thu, 9 Dec 2010 14:49:58 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4D01515D.9060909@gmail.com> References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> Message-ID: <20101209144958.54c3fa64@dartworks.biz> === On Thu, 12/09, Bryce Verdier wrote: === > Hey Keith, > > The best I can do for string is the line from my original > posting(client data, NDA, I'm sure you understand): > > b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 > 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC > 2010,577078067 20,15228831373,80966857300, Ok, I tried this with your code and this as a single line in a file and it worked for me. My modified version prints this: {' clientname_001': '2.96116E+11'} clientname_001:2.96116e+11 It works the same in 2.7 and 3.1 (Linux, x86_64). The only thing I can think of is the there is some other line that is failing, one which does not conform to the pattern you expect and the "float" is not actually being parsed out as you expect. -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From bryceverdier at gmail.com Thu Dec 9 23:50:22 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Thu, 09 Dec 2010 14:50:22 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <201012092253.24172.rami.chowdhury@gmail.com> References: <4CFFF797.4040103@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> <201012092253.24172.rami.chowdhury@gmail.com> Message-ID: <4D015D2E.9090907@gmail.com> On 12/09/2010 02:53 PM, Rami Chowdhury wrote: > On Thursday 09 December 2010 21:59:57 Bryce Verdier wrote: >> Hey Keith, >> >> The best I can do for string is the line from my original posting(client >> data, NDA, I'm sure you understand): >> >> b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 >> UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 >> 20,15228831373,80966857300, > Well, we already know that string works :S Could you put the setting of > self.size in a try/except block, and print out the string that's causing the > ValueError? That is a good idea, I will try that and see what happens. >> I will say that in the file there are 135 lines in the files. So it's >> not like there is a lot data to deal with. I wonder if I should move >> back to 2.7. >> >> the code is still being worked on, so don't laugh to hard (constructive >> critisims are welcomed though) ;) >> #!/usr/bin/python3 >> >> import sys >> import re >> from optparse import OptionParser >> >> class client(object): >> def __init__(self, name, size): >> self.name = name >> self.size = float(size) >> self.east_coast = bool(re.search("_E", name)) >> self.trial = bool(re.search("TR_", name)) >> self.demo = bool(re.search("_Demo", name)) >> self.zetta = bool(re.search("zetta|Zetta", name)) >> >> def get_size(self): >> return str(self.size) >> >> def get_name(self): >> return str(self.name) > I'm by no means an expert but getters and setters don't strike me as > particularly Pythonic -- perhaps properties are more so? > You know, I've looked into that, but I haven't found any good examples yet of how to do that. If you know of any I'm all eyes on learning how to implement them. >> def read_file(filename): >> file_data = {} >> >> with open(filename, 'r') as f: >> for lines in f: >> split_lines = lines.split(',') >> file_data[split_lines[1]] = split_lines[3] >> >> return file_data >> >> if __name__ == "__main__": >> >> file1_clients = {} >> file2_clients = {} >> file1_class_clients = [] >> file2_class_clients = [] >> >> usage = "%prog [options]" >> parser = OptionParser(usage=usage) >> parser.add_option("-f", "--first", dest="first", >> help="Older file first, builds table from here.") >> parser.add_option("-s", "--second", dest="second", >> help="New file, used for calculating the difference.") >> >> (options,args) = parser.parse_args() >> >> if not options.first or not options.second: >> print("The file argument (-f) is nessacary to run this >> program.\n") parser.print_help() >> sys.exit(1) >> >> file1_clients = read_file(options.first) >> file2_clients = read_file(options.second) >> >> for x,v in file1_clients.items(): >> file1_class_clients.append(client(x,v)) >> >> for x,v in file2_clients.items(): >> file2_class_clients.append(client(x,v)) >> >> for x in file1_class_clients: >> print(x.get_name() + ":" + x.get_size()) >> >> On 12/09/2010 01:44 PM, Keith Dart wrote: >>> === On Thu, 12/09, Bryce Verdier wrote: === >>> >>>> ValueError: could not convert string to float: Commercial Max Space >>>> Used >>>> >>>> >>>> This is in python 3.1.2 if that matters. >>> === >>> >>> Whoa, that's a new one. Not even Google knows about it. Can you supply >>> the actual string here? >>> >>> >>> >>> -- Keith Dart >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > > ---- > Rami Chowdhury > "Strangers are just friends who haven't had enough gin." -- Howdle's > Saying > +44-7581-430-517 / +88-01819-245544 /+1-408-597-7068 From jimmy at retzlaff.com Thu Dec 9 23:56:37 2010 From: jimmy at retzlaff.com (Jimmy Retzlaff) Date: Thu, 9 Dec 2010 14:56:37 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4D01479C.2010605@gmail.com> References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> Message-ID: On Thu, Dec 9, 2010 at 1:18 PM, Bryce Verdier wrote: > I knew it was to easy to be true. Help?!?! > > Traceback (most recent call last): > ?File "./space_report.py", line 58, in > ? ?file1_class_clients.append(client(x,v)) > ?File "./space_report.py", line 10, in __init__ > ? ?self.size = float(size) > ValueError: could not convert string to float: Commercial Max Space Used The string after the colon ("Commercial Max Space Used") is what was passed to float. Try float("asdf") to see this in action. So it's likely a problem with the data or how it's being processed. Jimmy From bryceverdier at gmail.com Thu Dec 9 23:58:06 2010 From: bryceverdier at gmail.com (Bryce Verdier) Date: Thu, 09 Dec 2010 14:58:06 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> Message-ID: <4D015EFE.9020800@gmail.com> I figured it out & I'll fess up to it, it was a total ID-10-T error on my part. first list of the file was: Vol UUID, Vol Name, Commercial Timestamp, Commercial Max Space Used, Commercial Bytes Written, Commercial Bytes Read, Zetta Timestamp, Zetta Max Space Used, Zetta Bytes Written, Zetta Bytes Read, Date: Dec 2 2010 I feel so sheepish... oh well, I doubt I'll make this mistake again. Bryce On 12/09/2010 02:54 PM, Jeff Sheldon wrote: > Are you able to tell us what OS you are running on? The part of the error "could not convert string to float:" is coming from the interpreter, but the rest of the message comes from the os/c compiler. > > It almost sounds like it is a hosted machine and some system limit has been reached. It is certainly an interesting error message! > > - Jeff > > -----Original Message----- > From: baypiggies-bounces+jeff.sheldon=emsense.com at python.org [mailto:baypiggies-bounces+jeff.sheldon=emsense.com at python.org] On Behalf Of Bryce Verdier > Sent: Thursday, December 09, 2010 2:00 PM > To: baypiggies at python.org > Subject: Re: [Baypiggies] scientific notation: string to int > > Hey Keith, > > The best I can do for string is the line from my original posting(client > data, NDA, I'm sure you understand): > > b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 > UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 > 20,15228831373,80966857300, > > > I will say that in the file there are 135 lines in the files. So it's > not like there is a lot data to deal with. I wonder if I should move > back to 2.7. > > the code is still being worked on, so don't laugh to hard (constructive > critisims are welcomed though) ;) > #!/usr/bin/python3 > > import sys > import re > from optparse import OptionParser > > class client(object): > def __init__(self, name, size): > self.name = name > self.size = float(size) > self.east_coast = bool(re.search("_E", name)) > self.trial = bool(re.search("TR_", name)) > self.demo = bool(re.search("_Demo", name)) > self.zetta = bool(re.search("zetta|Zetta", name)) > > def get_size(self): > return str(self.size) > > def get_name(self): > return str(self.name) > > > def read_file(filename): > file_data = {} > > with open(filename, 'r') as f: > for lines in f: > split_lines = lines.split(',') > file_data[split_lines[1]] = split_lines[3] > > return file_data > > if __name__ == "__main__": > > file1_clients = {} > file2_clients = {} > file1_class_clients = [] > file2_class_clients = [] > > usage = "%prog [options]" > parser = OptionParser(usage=usage) > parser.add_option("-f", "--first", dest="first", > help="Older file first, builds table from here.") > parser.add_option("-s", "--second", dest="second", > help="New file, used for calculating the difference.") > > (options,args) = parser.parse_args() > > if not options.first or not options.second: > print("The file argument (-f) is nessacary to run this program.\n") > parser.print_help() > sys.exit(1) > > file1_clients = read_file(options.first) > file2_clients = read_file(options.second) > > for x,v in file1_clients.items(): > file1_class_clients.append(client(x,v)) > > for x,v in file2_clients.items(): > file2_class_clients.append(client(x,v)) > > for x in file1_class_clients: > print(x.get_name() + ":" + x.get_size()) > > > On 12/09/2010 01:44 PM, Keith Dart wrote: >> === On Thu, 12/09, Bryce Verdier wrote: === >>> ValueError: could not convert string to float: Commercial Max Space >>> Used >>> >>> >>> This is in python 3.1.2 if that matters. >> === >> >> Whoa, that's a new one. Not even Google knows about it. Can you supply >> the actual string here? >> >> >> >> -- Keith Dart >> > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > > > This email message is confidential and is intended only for the named recipient(s) above, and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. The contents of this email are for discussion purposes only and shall not create a legally binding commitment or agreement of EmSense Corporation, which shall require EmSense Corporation management approval and a formal written agreement signed by both parties. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message from your computer. From keith at dartworks.biz Fri Dec 10 00:51:44 2010 From: keith at dartworks.biz (Keith Dart) Date: Thu, 9 Dec 2010 15:51:44 -0800 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4D015EFE.9020800@gmail.com> References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> <4D015EFE.9020800@gmail.com> Message-ID: <20101209155144.248381ad@dartworks.biz> === On Thu, 12/09, Bryce Verdier wrote: === > I feel so sheepish... oh well, I doubt I'll make this mistake again. === I could use a new wool sweater, so for penance you can shave yourself. ;-) But that is a common error. You can validate the data in a try block in the parser too, and have it return only valid records. e.g: try: value = float(value) except ValueError: coninue Regarding read-only attributes, you can do this: class client(object): def __init__(self, name, size): self.name = name self._size = float(size) self.east_coast = bool(re.search("_E", name)) self.trial = bool(re.search("TR_", name)) self.demo = bool(re.search("_Demo", name)) self.zetta = bool(re.search("zetta|Zetta", name)) @property def size(self): return self._size IMHO, it's better to not convert to string there, in case you ever want the actual float. Printing implicitly converts to a string, anyway. -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From jeff.sheldon at emsense.com Thu Dec 9 23:54:18 2010 From: jeff.sheldon at emsense.com (Jeff Sheldon) Date: Thu, 9 Dec 2010 16:54:18 -0600 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: <4D01515D.9060909@gmail.com> References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> Message-ID: Are you able to tell us what OS you are running on? The part of the error "could not convert string to float:" is coming from the interpreter, but the rest of the message comes from the os/c compiler. It almost sounds like it is a hosted machine and some system limit has been reached. It is certainly an interesting error message! - Jeff -----Original Message----- From: baypiggies-bounces+jeff.sheldon=emsense.com at python.org [mailto:baypiggies-bounces+jeff.sheldon=emsense.com at python.org] On Behalf Of Bryce Verdier Sent: Thursday, December 09, 2010 2:00 PM To: baypiggies at python.org Subject: Re: [Baypiggies] scientific notation: string to int Hey Keith, The best I can do for string is the line from my original posting(client data, NDA, I'm sure you understand): b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 20,15228831373,80966857300, I will say that in the file there are 135 lines in the files. So it's not like there is a lot data to deal with. I wonder if I should move back to 2.7. the code is still being worked on, so don't laugh to hard (constructive critisims are welcomed though) ;) #!/usr/bin/python3 import sys import re from optparse import OptionParser class client(object): def __init__(self, name, size): self.name = name self.size = float(size) self.east_coast = bool(re.search("_E", name)) self.trial = bool(re.search("TR_", name)) self.demo = bool(re.search("_Demo", name)) self.zetta = bool(re.search("zetta|Zetta", name)) def get_size(self): return str(self.size) def get_name(self): return str(self.name) def read_file(filename): file_data = {} with open(filename, 'r') as f: for lines in f: split_lines = lines.split(',') file_data[split_lines[1]] = split_lines[3] return file_data if __name__ == "__main__": file1_clients = {} file2_clients = {} file1_class_clients = [] file2_class_clients = [] usage = "%prog [options]" parser = OptionParser(usage=usage) parser.add_option("-f", "--first", dest="first", help="Older file first, builds table from here.") parser.add_option("-s", "--second", dest="second", help="New file, used for calculating the difference.") (options,args) = parser.parse_args() if not options.first or not options.second: print("The file argument (-f) is nessacary to run this program.\n") parser.print_help() sys.exit(1) file1_clients = read_file(options.first) file2_clients = read_file(options.second) for x,v in file1_clients.items(): file1_class_clients.append(client(x,v)) for x,v in file2_clients.items(): file2_class_clients.append(client(x,v)) for x in file1_class_clients: print(x.get_name() + ":" + x.get_size()) On 12/09/2010 01:44 PM, Keith Dart wrote: > === On Thu, 12/09, Bryce Verdier wrote: === >> ValueError: could not convert string to float: Commercial Max Space >> Used >> >> >> This is in python 3.1.2 if that matters. > === > > Whoa, that's a new one. Not even Google knows about it. Can you supply > the actual string here? > > > > -- Keith Dart > _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: http://mail.python.org/mailman/listinfo/baypiggies This email message is confidential and is intended only for the named recipient(s) above, and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. The contents of this email are for discussion purposes only and shall not create a legally binding commitment or agreement of EmSense Corporation, which shall require EmSense Corporation management approval and a formal written agreement signed by both parties. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message from your computer. From jeff.sheldon at emsense.com Fri Dec 10 01:02:58 2010 From: jeff.sheldon at emsense.com (Jeff Sheldon) Date: Thu, 9 Dec 2010 18:02:58 -0600 Subject: [Baypiggies] scientific notation: string to int In-Reply-To: References: <4CFFF797.4040103@gmail.com> <4D01479C.2010605@gmail.com> <20101209134420.586dcc5f@dartworks.biz> <4D01515D.9060909@gmail.com> Message-ID: I now realize this is incorrect - sorry for my too quick reading of the python source. -----Original Message----- From: baypiggies-bounces+jeff.sheldon=emsense.com at python.org [mailto:baypiggies-bounces+jeff.sheldon=emsense.com at python.org] On Behalf Of Jeff Sheldon Sent: Thursday, December 09, 2010 2:54 PM To: Bryce Verdier; baypiggies at python.org Subject: Re: [Baypiggies] scientific notation: string to int Are you able to tell us what OS you are running on? The part of the error "could not convert string to float:" is coming from the interpreter, but the rest of the message comes from the os/c compiler. It almost sounds like it is a hosted machine and some system limit has been reached. It is certainly an interesting error message! - Jeff -----Original Message----- From: baypiggies-bounces+jeff.sheldon=emsense.com at python.org [mailto:baypiggies-bounces+jeff.sheldon=emsense.com at python.org] On Behalf Of Bryce Verdier Sent: Thursday, December 09, 2010 2:00 PM To: baypiggies at python.org Subject: Re: [Baypiggies] scientific notation: string to int Hey Keith, The best I can do for string is the line from my original posting(client data, NDA, I'm sure you understand): b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec 2 00:00:00 UTC 2010,2.96116E+11,0,0, Thu Dec 2 00:00:00 UTC 2010,577078067 20,15228831373,80966857300, I will say that in the file there are 135 lines in the files. So it's not like there is a lot data to deal with. I wonder if I should move back to 2.7. the code is still being worked on, so don't laugh to hard (constructive critisims are welcomed though) ;) #!/usr/bin/python3 import sys import re from optparse import OptionParser class client(object): def __init__(self, name, size): self.name = name self.size = float(size) self.east_coast = bool(re.search("_E", name)) self.trial = bool(re.search("TR_", name)) self.demo = bool(re.search("_Demo", name)) self.zetta = bool(re.search("zetta|Zetta", name)) def get_size(self): return str(self.size) def get_name(self): return str(self.name) def read_file(filename): file_data = {} with open(filename, 'r') as f: for lines in f: split_lines = lines.split(',') file_data[split_lines[1]] = split_lines[3] return file_data if __name__ == "__main__": file1_clients = {} file2_clients = {} file1_class_clients = [] file2_class_clients = [] usage = "%prog [options]" parser = OptionParser(usage=usage) parser.add_option("-f", "--first", dest="first", help="Older file first, builds table from here.") parser.add_option("-s", "--second", dest="second", help="New file, used for calculating the difference.") (options,args) = parser.parse_args() if not options.first or not options.second: print("The file argument (-f) is nessacary to run this program.\n") parser.print_help() sys.exit(1) file1_clients = read_file(options.first) file2_clients = read_file(options.second) for x,v in file1_clients.items(): file1_class_clients.append(client(x,v)) for x,v in file2_clients.items(): file2_class_clients.append(client(x,v)) for x in file1_class_clients: print(x.get_name() + ":" + x.get_size()) On 12/09/2010 01:44 PM, Keith Dart wrote: > === On Thu, 12/09, Bryce Verdier wrote: === >> ValueError: could not convert string to float: Commercial Max Space >> Used >> >> >> This is in python 3.1.2 if that matters. > === > > Whoa, that's a new one. Not even Google knows about it. Can you supply > the actual string here? > > > > -- Keith Dart > _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: http://mail.python.org/mailman/listinfo/baypiggies This email message is confidential and is intended only for the named recipient(s) above, and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. The contents of this email are for discussion purposes only and shall not create a legally binding commitment or agreement of EmSense Corporation, which shall require EmSense Corporation management approval and a formal written agreement signed by both parties. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message from your computer. _______________________________________________ Baypiggies mailing list Baypiggies at python.org To change your subscription options or unsubscribe: http://mail.python.org/mailman/listinfo/baypiggies This email message is confidential and is intended only for the named recipient(s) above, and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. The contents of this email are for discussion purposes only and shall not create a legally binding commitment or agreement of EmSense Corporation, which shall require EmSense Corporation management approval and a formal written agreement signed by both parties. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message from your computer. From rich at noir.com Fri Dec 10 21:44:40 2010 From: rich at noir.com (K. Richard Pixley) Date: Fri, 10 Dec 2010 12:44:40 -0800 Subject: [Baypiggies] doc bug? sanity check request Message-ID: <4D029138.5070001@noir.com> Could someone please take a quick look at this and let me know whether I'm looking at a doc bug or making some other embarrassingly stupid mistake? And if it is a doc bug, where should I be reporting it? Specifically, for a dir of an instance of a logging.LogRecord, I'm seeing: ['__doc__', '__init__', '__module__', '__str__', 'args', 'created', 'exc_info', 'exc_text', 'filename', 'funcName', 'getMessage', 'levelname', 'levelno', 'lineno', 'module', 'msecs', 'msg', 'name', 'pathname', 'process', 'processName', 'relativeCreated', 'thread', 'threadName'] while the documentation lists a different set of attributes including "lvl": http://docs.python.org/library/logging.html?highlight=logging#logrecord-objects --rich import logging import sys logger = logging.getLogger('') class Myhandler(logging.Handler): def emit(self, record): print >>sys.stderr, 'emit: ' + record.getMessage() print 'dir(record) = {0}'.format(dir(record)) print >>sys.stderr, 'level: ' + record.levelname logger.addHandler(Myhandler()) if __name__ == '__main__': logger.setLevel(logging.DEBUG) logger.debug('this is a test') From brent.tubbs at gmail.com Sat Dec 11 20:20:12 2010 From: brent.tubbs at gmail.com (Brent Tubbs) Date: Sat, 11 Dec 2010 11:20:12 -0800 Subject: [Baypiggies] Mrjob event (Mapreduce Framework For Python) Message-ID: Of interest to BayPIGgies members: On Monday Dec 13 Hacker Dojo will be hosting an event on mrjob, Yelp's recently open-sourced, Python-based framework for doing distributed computing with MapReduce in the cloud. The speaker will be Yelp's own Jimmy Retzlaff. It's free. Hacker Dojo is here: http://www.google.com/maps/place?cid=2122486601784397611 Full details here: http://events.hackerdojo.com/event/384001-mrjob-mapreduce-framework-for-python The event starts at 7:30. Brent From cappy2112 at gmail.com Sun Dec 12 07:29:19 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sat, 11 Dec 2010 22:29:19 -0800 Subject: [Baypiggies] OT: The Future Of Programming Languages Message-ID: Having just reviewed Seven Languages in Seven Weeks http://www.baypiggies.net/index_html/user-group-association-program/BookReviews/seven-languages-in-seven-weeks-a-pragmatic-guide-to-learning-programming-languages-by-bruce-a.-tate-review-by-tony-cappellini I thought this panel would be of interest to many folks here, since it addresses the future of programming languages. http://www.infoq.com/presentations/Future-of-Programming-Languages The panel doesn't address Python directly, but they do talk about issues which are seen across many languages. -------------- next part -------------- An HTML attachment was scrubbed... URL: From keith at dartworks.biz Sun Dec 12 21:57:44 2010 From: keith at dartworks.biz (Keith Dart) Date: Sun, 12 Dec 2010 12:57:44 -0800 Subject: [Baypiggies] OT: The Future Of Programming Languages In-Reply-To: References: Message-ID: <20101212125744.7fafe7ab@dartworks.biz> === On Sat, 12/11, Tony Cappellini wrote: === > The panel doesn't address Python directly, but they do talk about > issues which are seen across many languages. === That was interesting. Too bad they didn't know Python, even though it is becoming very popular. It also seems that newer features of JavaScript have been inspired by Python: https://developer.mozilla.org/en/JavaScript/New_in_JavaScript/1.8 And Python was voted both best overall language and best scripting language by Linux Journal readers. http://www.linuxjournal.com/content/readers-choice-awards-2010 Another message I got from that, between the lines, is that Perl is a dead-end. I did recently look at io, which one of them mentioned. It's pretty cool. It just needs some Posix calls... http://iolanguage.com/ http://ozone.wordpress.com/2006/03/15/blame-it-on-io/ -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From cappy2112 at gmail.com Mon Dec 13 04:21:42 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 12 Dec 2010 19:21:42 -0800 Subject: [Baypiggies] OT: The Future Of Programming Languages In-Reply-To: <20101212125744.7fafe7ab@dartworks.biz> References: <20101212125744.7fafe7ab@dartworks.biz> Message-ID: > > >>That was interesting. You may find this book interesting as well. http://www.baypiggies.net/index_html/user-group-association-program/BookReviews/coders-at-work-reflections-on-the-craft-of-programming-by-peter-seibel-review-by-tony-cappellini Guy Steel is one of the 15 people interviewed, and was in the panel I previously posted about. For the Lispers out there, there is a *lot* of talk about Lisp history and development in this book, *almost* enough to make me want to find out what all the fuss is about. L Peter Deutsch quoted Larry Wall's reference to the Lisp language "a bowl of oatmeal with fingernail clippings in it" (LMAO) As if Larry has any room to talk about the unsightliness of the source code of other languages ;-)) > >>And Python was voted both best overall language and best scripting > >>language by Linux Journal readers. > I believe this was two years in a row, or two years in recent times. > > >>nother > message I got from that, between the lines, is that Perl is a > >>dead-end. > As much as I dislike Perl, I think it still has a lot of life although I'm not holding my breath for Perl 6. I think people can continue using Perl 5 for a long time. Having just read "Seven Languages", and "Coders At Work", it makes me wonder- does the world still need so many languages? Is the trend going for more language development or languages which attempt to consolidate several languages and programming paradigms? Could we survive with say only 10 or 20 languages? I should probably take this offline since I've strayed way off topic, but these books and the panel video bring up so many questions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Mon Dec 13 04:33:05 2010 From: aahz at pythoncraft.com (Aahz) Date: Sun, 12 Dec 2010 19:33:05 -0800 Subject: [Baypiggies] doc bug? sanity check request In-Reply-To: <4D029138.5070001@noir.com> References: <4D029138.5070001@noir.com> Message-ID: <20101213033305.GA25305@panix.com> On Fri, Dec 10, 2010, K. Richard Pixley wrote: > > Could someone please take a quick look at this and let me know > whether I'm looking at a doc bug or making some other embarrassingly > stupid mistake? And if it is a doc bug, where should I be reporting > it? You don't specify what versions of Python you're comparing.... -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From cappy2112 at gmail.com Mon Dec 13 07:05:40 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 12 Dec 2010 22:05:40 -0800 Subject: [Baypiggies] Fwd: Countdown to 2011 Megadeal! Half off all Print Books TODAY ONLY In-Reply-To: <1104043010897.1101335703814.83217.10.6400053F@scheduler> References: <1104043010897.1101335703814.83217.10.6400053F@scheduler> Message-ID: Sorry, no time to put this on the website. It just arrived in my mailbox, and there's only 2 hours left to "today" Good luck for the drawing, and take advantage of the 50% off print books. Click here to view in your browser. [image: ManningWeblogo.medium] *Free ebooks daily! Great discounts! Win an iPad!* 50% off all print books today only! We're nearly halfway through December, but there's still plenty of time to get in on Manning's Countdown to 2011!There's an amazing new *Deal of the Day* every day. Better still, we're *giving away 2 ebooks daily *, and one lucky contestant will *win a 16GB 3G iPad*! To play, just sign up here . Even if you haven't registered yet, you can take advantage of today's special offer and *save 50%* on all print books *TODAY ONLY!!!* Just enter * dotd1213* in the Promotional Code box when you check out at manning.com. This offer applies to all pbooks, including pbooks preordered in MEAP. Recent pbook releases [image: hadoopinaction] Hadoop in Action--Learn how to use Hadoop to write MapReduce programs, from obtaining a copy of Hadoop to setting it up in a cluster and writing data analysis programs. [read more ] [image: extjs] Ext JS in Action--Using this comprehensive, clearly-written guide, you'll master all the major features of Ext JS along with its extensive library of high-quality widgets, intuitive, extensible component model, and easy-to-use API. [read more ] [image: erlangandotp] Erlang and OTP in Action--This book teaches you to apply Erlang's shared-state model for concurrent programming--a completely different way of tackling the problem of parallel programming from the more common multi-threaded approach. [read more ] [image: flex4] Flex 4 in Action--Even if you're new to Flex, this book is all you'll need to make your apps pop using the new Spark components, data services, charting, special effects, and more. [read more ] [image: cloudatyourservice] The Cloud at Your Service--Cloud computing is a fact of the current IT world, and everyone from the app developer to the IT strategist needs to know what's here, what's coming, and how it will affect them. This book presents the when, how, and why of enterprise cloud computing. [read more ] [image: C#2e] C# in Depth, Second Edition--This totally revamped new edition is bang up to date covering C# 4, including Code Contracts. You'll master the subtleties of C#, learn to tame the trickier bits, and go "behind the scenes" to ensure you don't get nasty surprises. [read more ] [image: itextinaction2e] iText in Action, Second Edition--Thoroughly revised version of the bestselling first edition by iText creator Bruno Lowagie. An introduction and a practical guide to iText and the internals of PDF, it covers new functionality added in recent releases and updates all examples to Java 5. [read more ] [image: flexonjava] Flex on Java--Add a dynamic new Flex face to your existing Java apps. Dive beneath the Flex interface and learn the hard-core techniques you need to hook a Flex-based site into a sophisticated Java back-end. [read more ] [image: azureinaction] Azure in Action--A hands-on introduction to Cloud computing using Microsoft Azure. After a quick walk through the basics, it guides you all the way from your first app through more advanced concepts of the Windows Azure Platform. [read more ] [image: silverlight4] Silverlight 4 in Action--Written to be the most comprehensive and useful Silverlight resource available, this book delivers with concise explanations, great examples and thorough details. If you're using Silverlight 4, this is the book to have on your desk. [read more ] [image: springDM] Spring Dynamic Modules in Action--This comprehensive tutorial presents OSGi concepts and maps them to the familiar ideas of the Spring framework. Master powerful techniques like embedding a Spring container inside an OSGi bundle, learn to handle data access and web-based components, and explore topics like unit testing and configuration in OSGi. [read more ] Congratulations to last week's free ebook winners Dec 6:Innes Fisher and Peter Bak NielsenDec 7:Jamie Bradford and Sanja VuksanovicDec 8:Mohamed Chenini and Alberto SmuldersDec 9:Rick Kreiselman and Uwe HusmannDec 10:Clive Norman and Firasat HussainDec 11:Hamish Currie and Christopher CageDec 12:Andrew Psaltis and John McFadden Please forward, tweet, blog, or otherwise share this great discount. Remember, the *50% discount on all pbooks* is good *TODAY ONLY*. Click here to browse pbooks at manning.com *PRINT BESTSELLERS* as of December 8, 2010 1. Ext JS in Action 2. Hello World! Computer Programming for Kids and Other Beginners 3. Silverlight 4 in Action 4. C# in Depth, Second Edition 5. jQuery in Action, Second Edition 6. The Art of Unit Testing 7. JUnit in Action, Second Edition 8. Lucene in Action, Second Edition 9. Algorithms of the Intelligent Web 10. Spring in Action, Second Edition *MEAP BESTSELLERS* as of December 8, 2010 1. Spring in Action, Third Edition 2. Quick & Easy iPhone Programming 3. Spring Roo in Action 4. Secrets of the JavaScript Ninja 5. RabbitMQ in Action 6. Android in Action, Second Edition 7. MacRuby in Action 8. Rails 3 in Action 9. The Joy of Clojure 10. Camel in Action *TODAY'S SPECIAL OFFER* Save half on all pbooks! Enter *dotd1213* in the Promotional Code box when you check out at manning.com . * * This offer applies to all pbooks, including pbooks preordered in MEAP. *TODAY ONLY!!!* Forward email [image: Safe Unsubscribe] This email was sent to cappy2112 at gmail.com by mkt at manning.com. Update Profile/Email Address| Instant removal with SafeUnsubscribe? | Privacy Policy . Manning Publications Co. | Sound View Ct. #3B | Greenwich | CT | 06830 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich at noir.com Mon Dec 13 21:55:04 2010 From: rich at noir.com (K. Richard Pixley) Date: Mon, 13 Dec 2010 12:55:04 -0800 Subject: [Baypiggies] doc bug? sanity check request In-Reply-To: <20101213033305.GA25305@panix.com> References: <4D029138.5070001@noir.com> <20101213033305.GA25305@panix.com> Message-ID: <4D068828.9070604@noir.com> On 12/12/10 19:33 , Aahz wrote: > On Fri, Dec 10, 2010, K. Richard Pixley wrote: >> Could someone please take a quick look at this and let me know >> whether I'm looking at a doc bug or making some other embarrassingly >> stupid mistake? And if it is a doc bug, where should I be reporting >> it? > You don't specify what versions of Python you're comparing.... 2.6.5, but I'm not sure it matters. I have a response from python-dev now. It seems I'm not the only one who misunderstands the doc. The portion I was looking at documents the arguments to the LogRecord constructor. The LogRecord attributes themselves aren't really documented, (although they are hinted at in the section on formatters). Thanks, though. --rich From venkat83 at gmail.com Tue Dec 14 04:42:00 2010 From: venkat83 at gmail.com (Venkatraman S) Date: Tue, 14 Dec 2010 09:12:00 +0530 Subject: [Baypiggies] Python + SVG Message-ID: Has anyone played around creating SVGs with Python? Is this as simple as creating a 'proper' svg compatible XML? -V- http://blizzardzblogs.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From keith at dartworks.biz Tue Dec 14 05:49:14 2010 From: keith at dartworks.biz (Keith Dart) Date: Mon, 13 Dec 2010 20:49:14 -0800 Subject: [Baypiggies] Python + SVG In-Reply-To: References: Message-ID: <20101213204914.37f28f74@dartworks.biz> === On Tue, 12/14, Venkatraman S wrote: === > Has anyone played around creating SVGs with Python? Is this as simple > as creating a > 'proper' svg compatible XML? === I took a cursory look around for such a thing some time ago. I think the best option is to use the Inkscape APIs. Inkscape is mostly implemented in Python, and uses the lxml module, which is widely regarded as being the best XML module for Python. Inkscape allows you to write plugins in Python, and has libraries for creating SVG. I haven't actually got a chance to really dive in and use it, however, but it looks promising. -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From jjinux at gmail.com Tue Dec 14 07:37:27 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Mon, 13 Dec 2010 22:37:27 -0800 Subject: [Baypiggies] OT: The Future Of Programming Languages In-Reply-To: References: <20101212125744.7fafe7ab@dartworks.biz> Message-ID: On Sun, Dec 12, 2010 at 7:21 PM, Tony Cappellini wrote: >> >>That was interesting. > > You may find this book interesting as well. > http://www.baypiggies.net/index_html/user-group-association-program/BookReviews/coders-at-work-reflections-on-the-craft-of-programming-by-peter-seibel-review-by-tony-cappellini > > Guy Steel is one of the 15 people interviewed, and was in the panel I > previously posted about. > > For the Lispers out there, there is a *lot* of talk about Lisp history and > development in this book, *almost* enough to make me want to find out what > all the fuss is about. > > L Peter Deutsch quoted Larry Wall's reference to the Lisp language "a bowl > of oatmeal with fingernail clippings in it" > (LMAO) > > As if Larry has any room to talk about the unsightliness of the source code > of other languages ;-)) > > >> >> >>And Python was voted both best overall language and best scripting >> >>language by Linux Journal readers. > > I believe this was two years in a row, or two years in recent times. > >> >> >>nother message I got from that, between the lines, is that Perl is a >> >>dead-end. > > As much as I dislike Perl, I think it still has a lot of life although I'm > not holding my breath for Perl 6. > I think people can continue using Perl 5 for a long time. > > Having just read "Seven Languages", and "Coders At Work", it makes me > wonder- does the world still need so many languages? > Is the trend going for more language development or languages which attempt > to consolidate several languages and programming paradigms? > > Could we survive with say only 10 or 20 languages? > > I should probably take this offline since I've strayed way off topic, but > these books and the panel video bring up so many questions. Keep the off topic funkiness going! This is my favorite subject ;) -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From cappy2112 at gmail.com Tue Dec 14 17:57:02 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Tue, 14 Dec 2010 08:57:02 -0800 Subject: [Baypiggies] Slides from SciPy India 2010 Message-ID: Below is a post from Fernando Perez, author of IPython "yesterday I gave a ~ 1hr talk on IPython at the Scipy India conference, which is ongoing right now (and where a number of very interesting projects, some using IPython, have been shown). The talk was very well received, and hopefully some of the participants over the next few days will be able to contribute during the sprints (I'll be here until Saturday, lecturing at the tutorials and conducting some sprint work). I've put up the slides here: http://ipython.scipy.org/moin/About/Presentations?action=AttachFile&do=get&target=ipython_scipy10_india.pdf Feedback welcome, as always. This is the first time in quite a while that I've given a comprehensive overview of the project, which was nice to do and came at a very good time, given all the recent progress we've made and the potential for many more interesting things coming ahead. The talk was also videotaped, I'll ping back when I have a link to the video." -------------- next part -------------- An HTML attachment was scrubbed... URL: From mvoorhie at yahoo.com Tue Dec 14 19:04:30 2010 From: mvoorhie at yahoo.com (Mark Voorhies) Date: Tue, 14 Dec 2010 10:04:30 -0800 Subject: [Baypiggies] Python + SVG In-Reply-To: <20101213204914.37f28f74@dartworks.biz> References: <20101213204914.37f28f74@dartworks.biz> Message-ID: <201012141004.30874.mvoorhie@yahoo.com> On Monday, December 13, 2010 08:49:14 pm Keith Dart wrote: > === On Tue, 12/14, Venkatraman S wrote: === > > Has anyone played around creating SVGs with Python? Is this as simple > > as creating a > > 'proper' svg compatible XML? > > === > > I took a cursory look around for such a thing some time ago. I think > the best option is to use the Inkscape APIs. Inkscape is mostly > implemented in Python, and uses the lxml module, which is widely > regarded as being the best XML module for Python. > > Inkscape allows you to write plugins in Python, and has libraries for > creating SVG. I haven't actually got a chance to really dive in and use > it, however, but it looks promising. Yes, lxml is very good for parsing SVG. Chapter 12 of Dive into Python 3 (http://diveintopython3.org/) has a good introduction to lxml (in the context of parsing Atom feeds). Inkscape is very good for debugging SVG -- ctrl-shift-X brings up an XML editor linked to the current document (so you can select graphical objects, see the corresponding XML elements, edit the XML elements and see the change in the displayed object, etc.) The SVGs that Inkscape emits are a bit heavy (it's adding some higher level information for the benefit of the user interface) so depending on your use case, it may be simpler to write SVG directly from Python (similar tradeoffs to generating HTML directly vs. using a templating engine, etc.) Another trick is to generate an SVG with placeholder strings in Inkscape (e.g., for colors, text, etc.) and then dynamically fill them in from Python. If you're generating SVG from data (e.g., plots) Matplotlib (http://matplotlib.sourceforge.net/) is very good. --Mark P.S. The current IPython trunk (https://github.com/ipython/ipython) has a nice Qt interface for playing with Matplotlib and supports copying SVG source directly from a plot in an interactive session. From itz at buug.org Tue Dec 14 22:36:11 2010 From: itz at buug.org (Ian Zimmerman) Date: Tue, 14 Dec 2010 13:36:11 -0800 Subject: [Baypiggies] OT: The Future Of Programming Languages In-Reply-To: (Tony Cappellini's message of "Sun, 12 Dec 2010 19:21:42 -0800") References: <20101212125744.7fafe7ab@dartworks.biz> Message-ID: <87bp4o82b8.fsf@matica.localdomain> Tony> Could we survive with say only 10 or 20 languages? 10, no. 20, maybe. There are a few situations where more or less the same programming style is served by multiple languages or dialects and some of them should just die. (Hello, PHP! Hello, Common Lisp!) -- Ian Zimmerman gpg public key: 1024D/C6FF61AD fingerprint: 66DC D68F 5C1B 4D71 2EE5 BD03 8A00 786C C6FF 61AD Ham is for reading, not for eating. From janssen at parc.com Wed Dec 15 05:18:29 2010 From: janssen at parc.com (Bill Janssen) Date: Tue, 14 Dec 2010 20:18:29 PST Subject: [Baypiggies] OT: The Future Of Programming Languages In-Reply-To: <87bp4o82b8.fsf@matica.localdomain> References: <20101212125744.7fafe7ab@dartworks.biz> <87bp4o82b8.fsf@matica.localdomain> Message-ID: <4216.1292386709@parc.com> Ian Zimmerman wrote: > Tony> Could we survive with say only 10 or 20 languages? > > 10, no. 20, maybe. There are a few situations where more or less the > same programming style is served by multiple languages or dialects and > some of them should just die. (Hello, PHP! Hello, Common Lisp!) Oh, please! (I just finished ripping a new copy of CLtL2 into GNU Info format. :-) But, in that spirit, Hello Ruby! Bill From jim at systemateka.com Wed Dec 15 17:02:26 2010 From: jim at systemateka.com (jim) Date: Wed, 15 Dec 2010 08:02:26 -0800 Subject: [Baypiggies] BayPIGgies meeting Thursday, December 16, 2010: Plone, Zope, Pyramid, Django Message-ID: <1292428946.1942.17.camel@jim-laptop> This meeting's talk is Plone, Zope, Pyramid, Django by Elizabeth Leddy As the first object publishing framework ever, Zope has been through several major overhauls and developed a bad reputation along the way. The reformulation of pylons and repoze into pyramid presents a great opportunity for zope to get back some street cred and offer sincere alternatives to front running frameworks like Django. This discussion will cover the current state of zope based technologies including repoze/pyramid, grok, bluebream, and plone. It will look at the best use cases for each framework, strengths, weaknesses, and deal breakers. If there is time/interest we will look at the zodb and other core zope concepts that you will find in each framework. A python developer since the age of 18, I have been developing zope and plone applications for over 8 years. I am currently a member of the Plone Framework Team and actively develop in multiple Python frameworks. I appreciate diversity in frameworks as well as OSS communities, so you'll frequently hear me talking about both. ......................................... 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: none. 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:35 PM ................ Tonight's Newbie Nugget: none. ..... 7:35 PM to 8:25 PM (or so) ................ The talk: Plone, Zope, Pyramid, Django ..... 8:25 PM to 8:55 PM (or so) ................ Questions and Answers ..... 8:55 PM to 9:30 PM (or so) ................ 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 tony at tcapp.com Wed Dec 15 18:29:59 2010 From: tony at tcapp.com (Tony Cappellini) Date: Wed, 15 Dec 2010 09:29:59 -0800 Subject: [Baypiggies] BayPIGgies meeting Thursday, December 16, 2010: Plone, Zope, Pyramid, Django In-Reply-To: <1292428946.1942.17.camel@jim-laptop> References: <1292428946.1942.17.camel@jim-laptop> Message-ID: I'd like to welcome Elizabeth to the Bay Area, and Baypiggies. and I would like to especially thank her for volunteering to do a presentation for us on such short notice. T-H-A-N-K Y-O-U ! On Wed, Dec 15, 2010 at 8:02 AM, jim wrote: > > > This meeting's talk is > Plone, Zope, Pyramid, Django > by Elizabeth Leddy > > ? As the first object publishing framework ever, Zope has been > through several major overhauls and developed a bad reputation > along the way. > ? The reformulation of pylons and repoze into pyramid presents > a great opportunity for zope to get back some street cred and > offer sincere alternatives to front running frameworks like Django. > ? This discussion will cover the current state of zope based > technologies including repoze/pyramid, grok, bluebream, and plone. > It will look at the best use cases for each framework, strengths, > weaknesses, and deal breakers. > If there is time/interest we will look at the zodb and other core > zope concepts that you will find in each framework. > > ? A python developer since the age of 18, I have been developing > zope and plone applications for over 8 years. I am currently a > member of the Plone Framework Team and actively develop in multiple > Python frameworks. > ? I appreciate diversity in frameworks as well as OSS communities, > so you'll frequently hear me talking about both. > > ......................................... > > 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: none. > > > 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:35 PM ................ > Tonight's Newbie Nugget: none. > > > ..... 7:35 PM to 8:25 PM (or so) ................ > The talk: Plone, Zope, Pyramid, Django > > > ..... 8:25 PM to 8:55 PM (or so) ................ > Questions and Answers > > > ..... 8:55 PM to 9:30 PM (or so) ................ > 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 Wed Dec 15 18:37:50 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Wed, 15 Dec 2010 09:37:50 -0800 Subject: [Baypiggies] Apress Publications - new books on Python Message-ID: We are now registered with Apress, and as such we can get review copies of their books. Is anyone interested in reviewing either of these two new books? Python Algorithms: Mastering Basic Algorithms in the Python Language http://www.apress.com/book/view/1430232374 Pro Python System Administration http://www.apress.com/book/view/1430226056 Before replying, please consider your holiday work/travel schedule. By replying, you are actually *committing* to completing the review. We've had more than 10 people take books and never complete the reviews. Please reply off-list thanks Tony From eric at ericwalstad.com Wed Dec 15 19:32:15 2010 From: eric at ericwalstad.com (Eric Walstad) Date: Wed, 15 Dec 2010 10:32:15 -0800 Subject: [Baypiggies] BayPIGgies meeting Thursday, December 16, 2010: Plone, Zope, Pyramid, Django In-Reply-To: <1292428946.1942.17.camel@jim-laptop> References: <1292428946.1942.17.camel@jim-laptop> Message-ID: I'll be driving from San Francisco and have a few seats available if others in SF need a ride. I'd like to leave SF at around 18:30. I'm in the Bernal Heights/Glen Park area. Eric. PS, I noticed the front page of baypiggies.net has the wrong meeting date (Dec 18). From wescpy at gmail.com Thu Dec 16 08:28:26 2010 From: wescpy at gmail.com (wesley chun) Date: Wed, 15 Dec 2010 23:28:26 -0800 Subject: [Baypiggies] PyCon US 2011 Financial Aid applications Message-ID: in case you haven't heard, applications are now being accepted for financial assistance to attend PyCon in Atlanta this March. http://twitter.com/holdenweb/status/14185599443402752 -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Prentice Hall, (c)2007,2001 "Python Fundamentals", Prentice Hall, (c)2009 ? ? http://corepython.com wesley.j.chun :: wescpy-at-gmail.com python training and technical consulting cyberweb.consulting : silicon valley, ca http://cyberwebconsulting.com From kpguy1975 at gmail.com Thu Dec 16 20:38:32 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Thu, 16 Dec 2010 14:38:32 -0500 Subject: [Baypiggies] pickle misbehavior Message-ID: I have two files A and B. In A i am doing the pickling and these are the relevant lines: outf = open('totalpepfinalpickled.txt', 'wb') pickle.dump(trypticprotrev,outf) The variable being pickled if of type dict. In B i am unpickling and these are the relevant lines: f = open ('totalpepfinalpickled.txt') x = pickle.load(f) A runs fine on execution. On running B, i got the following error: Traceback (most recent call last): File "C:\Users\K\filtertest2.py", line 46, in x = pickle.load(f) ValueError: insecure string pickle >>> I went back to A and executed it twice. Then i again executed B and B ran fine and gave expected results. Then i executed A using a much larger data set. Now when i executed B i obtained unexpected results which seem erroneous to me. My solution was to put everything in one file and bypass pickle altogether. But any insights about this error message would be much appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simeonf at gmail.com Thu Dec 16 20:50:58 2010 From: simeonf at gmail.com (Simeon Franklin) Date: Thu, 16 Dec 2010 11:50:58 -0800 Subject: [Baypiggies] pickle misbehavior In-Reply-To: References: Message-ID: On Thu, Dec 16, 2010 at 11:38 AM, Vikram K wrote: > In B i am unpickling and these are the relevant lines: > f = open ('totalpepfinalpickled.txt') > > x = pickle.load(f) > > A runs fine on execution. On running B, i got the following error: Does this still happen if you open the pickle file in binary mode? Eg: >>> f = open('totalpepfinalpickled.txt', 'b') -regards Simeon From jjinux at gmail.com Fri Dec 17 02:23:54 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 16 Dec 2010 17:23:54 -0800 Subject: [Baypiggies] OT: The Future Of Programming Languages In-Reply-To: <4216.1292386709@parc.com> References: <20101212125744.7fafe7ab@dartworks.biz> <87bp4o82b8.fsf@matica.localdomain> <4216.1292386709@parc.com> Message-ID: On Tue, Dec 14, 2010 at 8:18 PM, Bill Janssen wrote: > Ian Zimmerman wrote: > >> Tony> Could we survive with say only 10 or 20 languages? >> >> 10, no. ?20, maybe. ?There are a few situations where more or less the >> same programming style is served by multiple languages or dialects and >> some of them should just die. ?(Hello, PHP! ?Hello, Common Lisp!) > > Oh, please! ?(I just finished ripping a new copy of CLtL2 into GNU Info > format. :-) ?But, in that spirit, Hello Ruby! Did you hear about the program that converts your Common Lisp code to Ruby? Unfortunately I couldn't get it to run because it was written in a dialect of Perl 6 that itself was written in Haskell. (/me giggles) -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From Web at StevePiercy.com Fri Dec 17 11:39:51 2010 From: Web at StevePiercy.com (Steve Piercy - Web Site Builder) Date: Fri, 17 Dec 2010 02:39:51 -0800 Subject: [Baypiggies] Plone, Zope, Pyramid, Django Meeting Follow-up: RBAC Message-ID: As promised at the presentation last night, here are some references on role-based access control (RBAC). http://csrc.nist.gov/groups/SNS/rbac/faq.html This paper is dense, but the diagrams at the end may help illustrate the presented concepts. http://csrc.nist.gov/groups/SNS/rbac/documents/sandhu96.pdf And of course the ubiquitous Wikipedia entry. http://en.wikipedia.org/wiki/Role-based_access_control --steve -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA From eleddy at umich.edu Sat Dec 18 04:24:53 2010 From: eleddy at umich.edu (Elizabeth Leddy) Date: Fri, 17 Dec 2010 19:24:53 -0800 Subject: [Baypiggies] Plone, Zope, Pyramid, Django Meeting Follow-up: RBAC In-Reply-To: References: Message-ID: Thanks Steve! Additionally, for anyone interested in learning the W5H about adapters and how it compares to mixins and traditional subclassing, the best presentation I have seen to date is here: http://www.slideshare.net/aclark/using-grok-to-walk-like-a-duck-brandon-craig-rhodes For anyone who wants to reference the presentation (with documentation links) its here: http://www.slideshare.net/eleddy/2011-year-of-the-fish Liz On Fri, Dec 17, 2010 at 2:39 AM, Steve Piercy - Web Site Builder < Web at stevepiercy.com> wrote: > As promised at the presentation last night, here are some references on > role-based access control (RBAC). > > http://csrc.nist.gov/groups/SNS/rbac/faq.html > > This paper is dense, but the diagrams at the end may help illustrate the > presented concepts. > http://csrc.nist.gov/groups/SNS/rbac/documents/sandhu96.pdf > > And of course the ubiquitous Wikipedia entry. > http://en.wikipedia.org/wiki/Role-based_access_control > > --steve > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > Steve Piercy Web Site Builder Soquel, CA > > > _______________________________________________ > 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 rich at noir.com Sat Dec 18 06:54:00 2010 From: rich at noir.com (K. Richard Pixley) Date: Fri, 17 Dec 2010 21:54:00 -0800 Subject: [Baypiggies] mmap question Message-ID: <4D0C4C78.10604@noir.com> Ok, I'm stumped. I have two files. They are the same size and I've mmaped them both into xmap and ymap. I'd like to compare their contents but without copying them into yet another chunk of memory before I do so. There should be a way to bitblt these things. The only things I can think to do involve forcing a string copy first. xmap[:] == ymap[:] bytearray(xmap) == bytearray(ymap) xmap.read() == ymap.read() Can anyone think of a way to do this without first copying them to strings? --rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich at noir.com Sat Dec 18 07:12:36 2010 From: rich at noir.com (K. Richard Pixley) Date: Fri, 17 Dec 2010 22:12:36 -0800 Subject: [Baypiggies] mmap question In-Reply-To: <4D0C4C78.10604@noir.com> References: <4D0C4C78.10604@noir.com> Message-ID: <4D0C50D4.8050007@noir.com> It's like magic! I post... and immediately the answer comes to me. *sigh* xmap.find(ymap) Thanks for, um, being here for me. :). --rich On 20101217 21:54, K. Richard Pixley wrote: > Ok, I'm stumped. > > I have two files. They are the same size and I've mmaped them both > into xmap and ymap. I'd like to compare their contents but without > copying them into yet another chunk of memory before I do so. There > should be a way to bitblt these things. > > The only things I can think to do involve forcing a string copy first. > > xmap[:] == ymap[:] > bytearray(xmap) == bytearray(ymap) > xmap.read() == ymap.read() > > Can anyone think of a way to do this without first copying them to > strings? > > --rich > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kpguy1975 at gmail.com Sun Dec 19 08:15:51 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Sun, 19 Dec 2010 02:15:51 -0500 Subject: [Baypiggies] pickle misbehavior In-Reply-To: References: Message-ID: tried with f = open('totalpepfinalpickle.txt', 'b') and got the following error: Traceback (most recent call last): File "C:\Users\K\filtertest3.py", line 40, in f = open ('totalpepfinalpickled.txt', 'b') ValueError: mode string must begin with one of 'r', 'w', 'a' or 'U', not 'b' >>> Also tried with f = open('totalpepfinalpickle.txt', 'rb') and got the usual error: Traceback (most recent call last): File "C:\Users\K\filtertest3.py", line 42, in x = pickle.load(f) ValueError: insecure string pickle On Thu, Dec 16, 2010 at 2:50 PM, Simeon Franklin wrote: > On Thu, Dec 16, 2010 at 11:38 AM, Vikram K wrote: > > In B i am unpickling and these are the relevant lines: > > f = open ('totalpepfinalpickled.txt') > > > > x = pickle.load(f) > > > > A runs fine on execution. On running B, i got the following error: > > Does this still happen if you open the pickle file in binary mode? Eg: > > >>> f = open('totalpepfinalpickled.txt', 'b') > > -regards > Simeon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max at theslimmers.net Sun Dec 19 20:39:33 2010 From: max at theslimmers.net (Max Slimmer) Date: Sun, 19 Dec 2010 11:39:33 -0800 Subject: [Baypiggies] pickle misbehavior In-Reply-To: References: Message-ID: mode must be 'rb' or 'wb' max On Sat, Dec 18, 2010 at 11:15 PM, Vikram K wrote: > tried with f = open('totalpepfinalpickle.txt', 'b') and got the following > error: > > Traceback (most recent call last): > ? File "C:\Users\K\filtertest3.py", line 40, in > ??? f = open ('totalpepfinalpickled.txt', 'b') > ValueError: mode string must begin with one of 'r', 'w', 'a' or 'U', not 'b' >>>> > > Also tried with f = open('totalpepfinalpickle.txt', 'rb') and got the usual > error: > > Traceback (most recent call last): > ? File "C:\Users\K\filtertest3.py", line 42, in > ??? x = pickle.load(f) > ValueError: insecure string pickle > > > On Thu, Dec 16, 2010 at 2:50 PM, Simeon Franklin wrote: >> >> On Thu, Dec 16, 2010 at 11:38 AM, Vikram K wrote: >> > In B i am unpickling and these are the relevant lines: >> > f = open ('totalpepfinalpickled.txt') >> > >> > x = pickle.load(f) >> > >> > A runs fine on execution. On running B, i got the following error: >> >> Does this still happen if you open the pickle file in binary mode? Eg: >> >> >>> f = open('totalpepfinalpickled.txt', 'b') >> >> -regards >> Simeon > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From aahz at pythoncraft.com Mon Dec 20 00:32:01 2010 From: aahz at pythoncraft.com (Aahz) Date: Sun, 19 Dec 2010 15:32:01 -0800 Subject: [Baypiggies] pickle misbehavior In-Reply-To: References: Message-ID: <20101219233201.GA5042@panix.com> On Sun, Dec 19, 2010, Vikram K wrote: > > Also tried with f = open('totalpepfinalpickle.txt', 'rb') and got the usual > error: > > Traceback (most recent call last): > File "C:\Users\K\filtertest3.py", line 42, in > x = pickle.load(f) > ValueError: insecure string pickle Sorry, no time to backtrack to the earlier post, but did you make sure that the pickle was *written* in binary mode? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From cappy2112 at gmail.com Mon Dec 20 05:51:35 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Sun, 19 Dec 2010 20:51:35 -0800 Subject: [Baypiggies] The next Python Cookbook will be "Python 3 Al The Way" Message-ID: http://dabeaz.blogspot.com/2010/12/oreilly-python-cookbook-python-3-all.html From keith at dart.us.com Mon Dec 20 06:23:34 2010 From: keith at dart.us.com (Keith Dart) Date: Sun, 19 Dec 2010 21:23:34 -0800 Subject: [Baypiggies] mmap question In-Reply-To: <4D0C50D4.8050007@noir.com> References: <4D0C4C78.10604@noir.com> <4D0C50D4.8050007@noir.com> Message-ID: <20101219212334.5d75d550@dart.us.com> === On Fri, 12/17, K. Richard Pixley wrote: === > Thanks for, um, being here for me. :). === You're welcome. :-) -- Keith Dart -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart ===================================================================== From jeff.enderwick at gmail.com Wed Dec 22 06:19:02 2010 From: jeff.enderwick at gmail.com (Jeff Enderwick) Date: Tue, 21 Dec 2010 21:19:02 -0800 Subject: [Baypiggies] python-based test frameworks? Message-ID: Hi All, I need to test a web front-end and a rest api in an automated fashion. Both are implemented w/Django, if that helps. Does anyone have a set of tools/frameworks that they love? Bonus points for frameworks authored in Python. TIA, Jeff From luca.pellicoro at gmail.com Wed Dec 22 06:55:14 2010 From: luca.pellicoro at gmail.com (Luca Pellicoro) Date: Tue, 21 Dec 2010 21:55:14 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: References: Message-ID: Hey Jeff, My favorite subject: python automated test frameworks. In terms of test harness, there's the built in unittest library [1] which will only get you so far. I've been happy with nosetest [2] as it is easily extensible. Also, Testify from Yelp is a newer version of all this [3]. Checkout stackoverflow for: python test frameworks. For the front end testing, selenium [4], which has a python driver, is probably one the best things out there. There's an active community of users [5] in the bay area. I'm curious to hear about other's experience on the topic. Luca 1. http://docs.python.org/library/unittest.html 2. http://somethingaboutorange.com/mrl/projects/nose/1.0.0/ 3. http://engineeringblog.yelp.com/2010/10/now-testify.html 4. http://seleniumhq.org/ 5. http://www.meetup.com/seleniumsanfrancisco/ On Tue, Dec 21, 2010 at 9:19 PM, Jeff Enderwick wrote: > Hi All, > > I need to test a web front-end and a rest api in an automated fashion. > Both are implemented w/Django, if that helps. > Does anyone have a set of tools/frameworks that they love? Bonus > points for frameworks authored in Python. > > TIA, > Jeff > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From itz at buug.org Wed Dec 22 07:01:13 2010 From: itz at buug.org (Ian Zimmerman) Date: Tue, 21 Dec 2010 22:01:13 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: (Jeff Enderwick's message of "Tue, 21 Dec 2010 21:19:02 -0800") References: Message-ID: <87pqsu4a8m.fsf@matica.localdomain> Jeff> Hi All, I need to test a web front-end and a rest api in an Jeff> automated fashion. Both are implemented w/Django, if that helps. Jeff> Does anyone have a set of tools/frameworks that they love? Bonus Jeff> points for frameworks authored in Python. buildbot: http://trac.buildbot.net/ -- Ian Zimmerman gpg public key: 1024D/C6FF61AD fingerprint: 66DC D68F 5C1B 4D71 2EE5 BD03 8A00 786C C6FF 61AD Ham is for reading, not for eating. From luca.pellicoro at gmail.com Wed Dec 22 07:22:14 2010 From: luca.pellicoro at gmail.com (Luca Pellicoro) Date: Tue, 21 Dec 2010 22:22:14 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: <87pqsu4a8m.fsf@matica.localdomain> References: <87pqsu4a8m.fsf@matica.localdomain> Message-ID: On Tue, Dec 21, 2010 at 10:01 PM, Ian Zimmerman wrote: > > Jeff> Hi All, I need to test a web front-end and a rest api in an > Jeff> automated fashion. ?Both are implemented w/Django, if that helps. > Jeff> Does anyone have a set of tools/frameworks that they love? Bonus > Jeff> points for frameworks authored in Python. > > buildbot: http://trac.buildbot.net/ I'd consider buildbot more of a build tool then a testing framework but hudson (written in java) is a bit simpler to get into and there's fabric (in python). http://hudson-ci.org/ http://docs.fabfile.org/0.9.3/ > > -- > Ian Zimmerman > gpg public key: 1024D/C6FF61AD > fingerprint: 66DC D68F 5C1B 4D71 2EE5 ?BD03 8A00 786C C6FF 61AD > Ham is for reading, not for eating. > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From keith at dartworks.biz Wed Dec 22 07:41:06 2010 From: keith at dartworks.biz (Keith Dart) Date: Tue, 21 Dec 2010 22:41:06 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: References: Message-ID: <20101221224106.57e44ae4@dartworks.biz> === On Tue, 12/21, Jeff Enderwick wrote: === > Does anyone have a set of tools/frameworks that they love? Bonus > points for frameworks authored in Python. === Well, I love the one I wrote. :-) http://code.google.com/p/pycopia/ It is actually a component of a larger framework, yet more complete than most others. There is also support for selenium and webdriver. I recommend compiling and using the alpha version of selenium Ver. 2 (aka webdriver). The Pycopia framework already ties those frameworks into its runner, environment model, and reporting. To write a webdriver test just but test case objects into a suite that is a subclass of the WebDriverSuite class. However, the Pycopia framework is large and has many dependencies and configuration steps. It is therefore intended to be deployed on some kind of "appliance" platform. Either a dedicated Gentoo Linux PC or a VMware virtual machine. You can't just install it like it was an application. -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From aahz at pythoncraft.com Wed Dec 22 16:27:36 2010 From: aahz at pythoncraft.com (Aahz) Date: Wed, 22 Dec 2010 07:27:36 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: References: Message-ID: <20101222152736.GA3725@panix.com> On Tue, Dec 21, 2010, Luca Pellicoro wrote: > > For the front end testing, selenium [4], which has a python driver, is > probably one the best things out there. There's an active community of > users [5] in the bay area. I've used Selenium in the past and my current company also uses Selenium (although I'm not currently involved in that part of the project). However, if I were making a choice from scratch I would definitely consider Windmill. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From eleddy at umich.edu Wed Dec 22 18:31:25 2010 From: eleddy at umich.edu (Elizabeth Leddy) Date: Wed, 22 Dec 2010 09:31:25 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: <20101222152736.GA3725@panix.com> References: <20101222152736.GA3725@panix.com> Message-ID: > > > For the front end testing, selenium [4], which has a python driver, is > > probably one the best things out there. There's an active community of > > users [5] in the bay area. > > I've used Selenium in the past and my current company also uses Selenium > (although I'm not currently involved in that part of the project). > However, if I were making a choice from scratch I would definitely > consider Windmill. > I like windmill as well but selenium can be integrated with hudson so I tend to choose selenium. Big ups for that. Liz > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > "Think of it as evolution in action." --Tony Rand > _______________________________________________ > 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 jjinux at gmail.com Wed Dec 22 22:40:42 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 22 Dec 2010 13:40:42 -0800 Subject: [Baypiggies] python-based test frameworks? In-Reply-To: References: Message-ID: On Tue, Dec 21, 2010 at 9:19 PM, Jeff Enderwick wrote: > Hi All, > > I need to test a web front-end and a rest api in an automated fashion. > Both are implemented w/Django, if that helps. > Does anyone have a set of tools/frameworks that they love? Bonus > points for frameworks authored in Python. I'd use Nose and wsgi_intercept. I don't think Selenium is appropriate for testing a REST API (nor is Windmill). wsgi_intercept can help you test WSGI apps in process. Use Twill if you need a simulated browser, which it sounds like you don't. One of these days, I want to try out: https://github.com/heynemann/pyccuracy/wiki/ https://github.com/rlisagor/freshen They're replacements for Cucumber in Ruby. However, in the interest of keeping it simple, I say go with Nose and wsgi_intercept. Happy Hacking! -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From tony at tcapp.com Thu Dec 23 06:52:08 2010 From: tony at tcapp.com (Tony Cappellini) Date: Wed, 22 Dec 2010 21:52:08 -0800 Subject: [Baypiggies] Calling presenters for 2011 Message-ID: Since someone kicked off a thread regarding unit test frameworks and since there were so many replies, who wants to pony up to do a presentation in early 2011? I think we have someone for January- so Feb-Dec is wide open. Do I have any takers ???? From jimmy at retzlaff.com Thu Dec 23 07:34:44 2010 From: jimmy at retzlaff.com (Jimmy Retzlaff) Date: Wed, 22 Dec 2010 22:34:44 -0800 Subject: [Baypiggies] Calling presenters for 2011 In-Reply-To: References: Message-ID: If I'm not the person for January, then I'd like to take February to demonstrate Yelp's mrjob: http://engineeringblog.yelp.com/2010/10/mrjob-distributed-computing-for-everybody.html Jimmy On Wed, Dec 22, 2010 at 9:52 PM, Tony Cappellini wrote: > Since someone kicked off a thread regarding unit test frameworks and > since there were so many replies, > who wants to pony up to do a presentation in early 2011? > > I think we have someone for January- so Feb-Dec is wide open. > Do I have any takers ???? > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From luca.pellicoro at gmail.com Thu Dec 23 07:49:51 2010 From: luca.pellicoro at gmail.com (Luca Pellicoro) Date: Wed, 22 Dec 2010 22:49:51 -0800 Subject: [Baypiggies] Calling presenters for 2011 In-Reply-To: References: Message-ID: On Wed, Dec 22, 2010 at 10:34 PM, Jimmy Retzlaff wrote: > If I'm not the person for January, then I'd like to take February to > demonstrate Yelp's mrjob: > > http://engineeringblog.yelp.com/2010/10/mrjob-distributed-computing-for-everybody.html +1 From kpguy1975 at gmail.com Thu Dec 23 23:14:10 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Thu, 23 Dec 2010 17:14:10 -0500 Subject: [Baypiggies] hardware question Message-ID: Recently i got funding to buy a new laptop. The choice is between Apple (which i have never ever used), or HP/Dell. Since most of my computational work will be using python i wanted to ask others on this forum about whether there would be any compatibility issues with using the various python libraries (matplotlib, scipy, numpy, Biopython, etc.) when using Python on the Mac. Thanks Vikram -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.conrad at gmail.com Fri Dec 24 01:31:57 2010 From: alexandre.conrad at gmail.com (Alexandre Conrad) Date: Thu, 23 Dec 2010 16:31:57 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: What I would do: I'd take a mac and install Ubuntu. So you get the nice hardware with the nice OS and don't have to worry about Python compatibility issues (my co-workers most of the time struggle compiling C extensions). FYI, I am an ex-Windows user that switched to Ubuntu 2 years ago and got a nice Mac from work 3 months ago. I felt like a baby giraffe learning on how to stand on its legs on a frozen lake. Two days later I returned it for a Thinkpad. I later learned I could install Ubuntu on a Mac (doh!). According to my co-worker, using the latest Ubuntu worked just fine out of the box on his Mac. There was only one tweak required for the webcam to work (a quick Google search tells you how). If you are a Windows user, I am not sure this helped you though. Well that said, I think I'd install Windows if I can't get along with Mac OS. :) Sent from my fantastic HTC Hero On Dec 23, 2010 2:14 PM, "Vikram K" wrote: Recently i got funding to buy a new laptop. The choice is between Apple (which i have never ever used), or HP/Dell. Since most of my computational work will be using python i wanted to ask others on this forum about whether there would be any compatibility issues with using the various python libraries (matplotlib, scipy, numpy, Biopython, etc.) when using Python on the Mac. Thanks Vikram _______________________________________________ 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 jason at mischievous.org Fri Dec 24 02:10:22 2010 From: jason at mischievous.org (Jason Culverhouse) Date: Thu, 23 Dec 2010 17:10:22 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: Just my 2 cents, 6 years python development on Mac (g4 and x86) and deployment on Ubuntu, no problems encountered on Mac that didn't have some analogue on Ubuntu. Jason On Dec 23, 2010, at 4:31 PM, Alexandre Conrad wrote: > What I would do: I'd take a mac and install Ubuntu. So you get the nice hardware with the nice OS and don't have to worry about Python compatibility issues (my co-workers most of the time struggle compiling C extensions). > > FYI, I am an ex-Windows user that switched to Ubuntu 2 years ago and got a nice Mac from work 3 months ago. I felt like a baby giraffe learning on how to stand on its legs on a frozen lake. Two days later I returned it for a Thinkpad. I later learned I could install Ubuntu on a Mac (doh!). According to my co-worker, using the latest Ubuntu worked just fine out of the box on his Mac. There was only one tweak required for the webcam to work (a quick Google search tells you how). > > If you are a Windows user, I am not sure this helped you though. Well that said, I think I'd install Windows if I can't get along with Mac OS. :) > > Sent from my fantastic HTC Hero > > >> On Dec 23, 2010 2:14 PM, "Vikram K" wrote: >> >> Recently i got funding to buy a new laptop. The choice is between Apple (which i have never ever used), or HP/Dell. >> >> Since most of my computational work will be using python i wanted to ask others on this forum about whether there would be any compatibility issues with using the various python libraries (matplotlib, scipy, numpy, Biopython, etc.) when using Python on the Mac. >> >> Thanks >> Vikram >> >> _______________________________________________ >> 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 alexandre.conrad at gmail.com Fri Dec 24 03:04:09 2010 From: alexandre.conrad at gmail.com (Alexandre Conrad) Date: Thu, 23 Dec 2010 18:04:09 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: I think what I missed the most on mac was Ubuntu's package management system. I know there's mac port but it just doesn't seem as slick. Again, just my 2 cent. Anyway, the thread is about hardware and I'd go for a mac as it is very well built. Then you can have your OS of choice on top. Sent from my fantastic HTC Hero On Dec 23, 2010 5:10 PM, "Jason Culverhouse" wrote: Just my 2 cents, 6 years python development on Mac (g4 and x86) and deployment on Ubuntu, no problems encountered on Mac that didn't have some analogue on Ubuntu. Jason On Dec 23, 2010, at 4:31 PM, Alexandre Conrad wrote: > What I would do: I'd take a mac and instal... -------------- next part -------------- An HTML attachment was scrubbed... URL: From bbdada at gmail.com Fri Dec 24 03:35:32 2010 From: bbdada at gmail.com (Nick S Kanakakorn) Date: Thu, 23 Dec 2010 18:35:32 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: I installed free VirtualBox http://www.virtualbox.org/wiki/Downloads on Mac and use Ubuntu for development work. I use Mac for other goodies (itune, email, PDF and etc). I think it combines best of both world. On Thu, Dec 23, 2010 at 2:14 PM, Vikram K wrote: > Recently i got funding to buy a new laptop. The choice is between Apple > (which i have never ever used), or HP/Dell. > > Since most of my computational work will be using python i wanted to ask > others on this forum about whether there would be any compatibility issues > with using the various python libraries (matplotlib, scipy, numpy, > Biopython, etc.) when using Python on the Mac. > > Thanks > Vikram > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- -Nick Kanakakorn -------------- next part -------------- An HTML attachment was scrubbed... URL: From pivanov314 at gmail.com Fri Dec 24 03:40:41 2010 From: pivanov314 at gmail.com (Paul Ivanov) Date: Thu, 23 Dec 2010 18:40:41 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: <20101224024041.GI28779@ykcyc> Jason Culverhouse, on 2010-12-23 17:10, wrote: > Just my 2 cents, 6 years python development on Mac (g4 and x86) and deployment on Ubuntu, no problems encountered on Mac that didn't have some analogue on Ubuntu. > Jason Jason, Can you be more specific about what kind of development you're talking about? web? pure python? The reason I ask is that it doesn't sound typical for the packages Vikram specifically mentioned. > >> Since most of my computational work will be using python i wanted to ask others on this forum about whether there would be any compatibility issues with using the various python libraries (matplotlib, scipy, numpy, Biopython, etc.) when using Python on the Mac. I'm also a user of numpy, matplotlib, scipy and friends. I run ubuntu so you can take mine as just comments from the peanut gallery, but I interact with other folks using a similar computing environment on other platforms here at UC Berkeley (both through the py4science group we have, and this past semester through TA-ing). My impression is that OS X users run into a lot more problems getting these particular packages up and running on OS X (just for starters: will you use system python, fink, macports, something else? oh my!). I think most end up grabbing Enthought's EPD - since it's free for academic use [1] (with the caveat that EPD resolves the 'which python' issue by shipping with its own python - but you do get all of numpy, scipy, matplotlib, ipython, etc. bundled in there). As for the Alexandre's comment about putting Ubuntu on a Mac to get both the software and the hardware - I think this may only be argued with respect to build quality these days - not the underlying hardwar. Apple tends to charge more for systems with the identical processor and memory configuration, compared to most of the other computer manufacturers out there. 1. http://www.enthought.com/products/edudownload.php -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From alexandre.conrad at gmail.com Fri Dec 24 03:59:43 2010 From: alexandre.conrad at gmail.com (Alexandre Conrad) Date: Thu, 23 Dec 2010 18:59:43 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: <20101224024041.GI28779@ykcyc> Message-ID: I agree that macs are more expensive and I think its kind of a rip-off. But it sounds like Vikram is getting "funding" and I assumed he's not paying for it (company?). ;) But still they are powerful, pretty light, good autonomy, nice graphic card, sharp screen, etc... That said, I think you'll still need to get used to a different keyboard layout and the formerly know "apple-key" for shortcuts. And the lack of "del" key. Sent from my fantastic HTC Hero On Dec 23, 2010 6:41 PM, "Paul Ivanov" wrote: Jason Culverhouse, on 2010-12-23 17:10, wrote: > Just my 2 cents, 6 years python development on Mac... Jason, Can you be more specific about what kind of development you're talking about? web? pure python? The reason I ask is that it doesn't sound typical for the packages Vikram specifically mentioned. > >> Since most of my computational work will be using python i wanted to ask others on this forum ... I'm also a user of numpy, matplotlib, scipy and friends. I run ubuntu so you can take mine as just comments from the peanut gallery, but I interact with other folks using a similar computing environment on other platforms here at UC Berkeley (both through the py4science group we have, and this past semester through TA-ing). My impression is that OS X users run into a lot more problems getting these particular packages up and running on OS X (just for starters: will you use system python, fink, macports, something else? oh my!). I think most end up grabbing Enthought's EPD - since it's free for academic use [1] (with the caveat that EPD resolves the 'which python' issue by shipping with its own python - but you do get all of numpy, scipy, matplotlib, ipython, etc. bundled in there). As for the Alexandre's comment about putting Ubuntu on a Mac to get both the software and the hardware - I think this may only be argued with respect to build quality these days - not the underlying hardwar. Apple tends to charge more for systems with the identical processor and memory configuration, compared to most of the other computer manufacturers out there. 1. http://www.enthought.com/products/edudownload.php -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk0UCCkACgkQe+cmRQ8+KPcfvACbBQK71Rm0XUtBGeGBTfz3B32c oucAniUxwmhBCtJgsIhiCsySDnOllGsz =H5N+ -----END PGP SIGNATURE----- _______________________________________________ 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 alexandre.conrad at gmail.com Fri Dec 24 06:10:06 2010 From: alexandre.conrad at gmail.com (Alexandre Conrad) Date: Thu, 23 Dec 2010 21:10:06 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: 2010/12/23 Fred C > > I don't seen the point of buying a mac to remove MacOC and turn it into a > PC. > If you don't want to use MacOS, you rather buy a PC it will be less > expensive. > True. But at least he can get to try MacOS for some time, and can switch later if he doesn't like it as he is was wondering if he should go with a Mac or not. It's gives him a chance to test MacOS but it has a cost. That was my point. -- Alex | twitter.com/alexconrad -------------- next part -------------- An HTML attachment was scrubbed... URL: From fred at kas-group.com Fri Dec 24 05:53:22 2010 From: fred at kas-group.com (Fred C) Date: Thu, 23 Dec 2010 20:53:22 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: I don't seen the point of buying a mac to remove MacOC and turn it into a PC. If you don't want to use MacOS, you rather buy a PC it will be less expensive. -fred- On Dec 23, 2010, at 6:04 PM, Alexandre Conrad wrote: > I think what I missed the most on mac was Ubuntu's package management system. I know there's mac port but it just doesn't seem as slick. Again, just my 2 cent. > > Anyway, the thread is about hardware and I'd go for a mac as it is very well built. Then you can have your OS of choice on top. > > Sent from my fantastic HTC Hero > > >> On Dec 23, 2010 5:10 PM, "Jason Culverhouse" wrote: >> >> Just my 2 cents, 6 years python development on Mac (g4 and x86) and deployment on Ubuntu, no problems encountered on Mac that didn't have some analogue on Ubuntu. >> Jason >> >> >> On Dec 23, 2010, at 4:31 PM, Alexandre Conrad wrote: >> >> > What I would do: I'd take a mac and instal... >> > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From spmcinerney at hotmail.com Fri Dec 24 09:21:38 2010 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Fri, 24 Dec 2010 00:21:38 -0800 Subject: [Baypiggies] hardware question Message-ID: Vikram, The Berkeley scientific computing people use scientific Python on Macs a lot without complaint, suggest you ask them: https://cirl.berkeley.edu/view/Py4Science Python(x,y) distribution probably has most of the scientific packages you need: http://code.google.com/p/pythonxy/wiki/StandardPlugins however it currently has no Mac distribution (Windows + Linux) but the maintainer would love to find such a volunteer: http://code.google.com/p/pythonxy/issues/detail?id=90 Regards, Stephen >Subject: [Baypiggies] hardware question > >Recently i got funding to buy a new laptop. The choice is between Apple (which i have never ever used), or HP/Dell. > >Since most of my computational work will be using python i wanted to ask others on this forum about whether there would be any compatibility issues with using the various python libraries (matplotlib, scipy, numpy, Biopython, etc.) when using Python on the Mac. > >Thanks >Vikram -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Fri Dec 24 17:22:09 2010 From: aahz at pythoncraft.com (Aahz) Date: Fri, 24 Dec 2010 08:22:09 -0800 Subject: [Baypiggies] hardware question In-Reply-To: References: Message-ID: <20101224162209.GA22132@panix.com> On Thu, Dec 23, 2010, Vikram K wrote: > > Recently i got funding to buy a new laptop. The choice is between Apple > (which i have never ever used), or HP/Dell. > > Since most of my computational work will be using python i wanted to ask > others on this forum about whether there would be any compatibility issues > with using the various python libraries (matplotlib, scipy, numpy, > Biopython, etc.) when using Python on the Mac. There's one simple reason why I absolutely stick with Macs for laptops: sleep Just Works. Supposedly there's been progress in recent years, but I still often see people booting up their laptops instead of just waking them from sleep when it's not a Mac. Get a Mac with 8GB RAM and you'll have plenty of room for virtual machines for Ubuntu, Windows, or whatever. Overall, I'm happier when I'm using my Ubuntu desktop at home, mainly because Macs are somewhat keyboard-unfriendly, although you can do an awful lots with the Mac keyboard if you invest some time learning. (Surprisingly, Windows and Ubuntu are mostly in a dead heat for keyboard friendliness.) If you are familiar with and like Gnome/KDE virtual screens, you will hate the Mac implementation. You should get a mouse with your Mac if you have sweaty fingers, the capacitive trackpad sometimes goes wonky. I've used 13", 15", and 17" laptops. IMO 15" is the best compromise between screen size and portability. Get the anti-glare screen, the glossy is one thing I dislike about my current Mac. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From glen at glenjarvis.com Mon Dec 27 21:22:49 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Mon, 27 Dec 2010 12:22:49 -0800 Subject: [Baypiggies] Elance, Guru, Contract Work etc. In-Reply-To: References: <4CCEF910.8010705@sanfransystems.com> Message-ID: To drudge up an old thread, I had some experience today that re-emphasizes this same point over and over. I posted a job on Elance for a web page redesign. It's a single page, but I want a very distinct look and feel that I described. I need someone with talent as I have no graphical talent at all and I want an expert to give me a look and feel. I have invited many people, regardless of price, to bid on this -- I simply took a glance at the portfolios, and if there were sufficient examples, I sent an invite. However, when I saw things below $20/hour, I was very skeptical and scrutinized the portfolio a bit more. There could be genuine talent for that price, but too often too cheap of a price made me skeptical of talent. I have been inundated with "We'll give you as many revisions as you want for free" type of messages. I am a programmer and can do a good deal of the backend stuff myself. What I want is someone with an artistic vision that could help me produce a look-and-feel that I can't myself. And, that requires talent (talent that I don't have). No matter or revisions are going to replace that. My job was already set at $100+/hour. And, I would happily pay that to get what I want (although it is a small job). This is not an unusual stance. At the end of the day, people across the world know that quality costs. Again, we're reminded that in sites like this, it's not always the cheapest price that gets the bid. This is true for Graphic Designers and Programmers. Cheers, Glen On Mon, Nov 1, 2010 at 11:49 AM, Glen Jarvis wrote: > Although there's a lot of merit in what you say, it's not universal to > sites like this. I found people who paid a lot more because they knew I > lived within the silicon valley area and there's a perception of a lot > higher quality. > > So, yes, some times -- maybe even most of the time -- you'll find customers > like this. But, it's not always the case and it'd be silly to exclude the > possibility of finding those clients. > > My Madrid customer is a perfect example. And, he originally came from > Elance until we built up a working relationship and work outside of Elance. > > Cheers, > > > Glen > > El Nov 1, 2010, a las 10:29 AM, Roderick Llewellyn < > roderick at sanfransystems.com> escribi?: > > > I avoid sites like these like the plague. This is priceline.com for > programmers, where the advantage is totally with the one offering the job. > You're competing with the entire world for these jobs, so the whole game is > to drive down your compensation to the lowest possible level on the planet. > Do you really want to be paid the going wage in Bangalore? No problem if > that reflects your cost of living (i.e., you live in Bangalore). But since > this is BayPiggies, you probably live in the Bay Area. So you're paying the > highest cost of living after Manhattan, and getting paid the lowest wages on > Earth. That's a problem! Your client cares not that you live in the Bay > Area. > > > > I agree with the caveat against fixed-price bids. These are VERY > dangerous in programming. It's one thing to ask a construction contractor > for a fixed-price bid on building a deck. There are not many unknowns there. > In programming, once you have negotiated a fixed price, the client has a > huge incentive to make endless change orders. Naturally you can refuse to > take them, asking for an hourly rate on each one. But since a fixed-price > bid usually means you get paid little or nothing until the job is done, if > client is unsatisfied with your negotiating stance, he will probably not pay > you at all. And generally forget the courts; they are so complicated, take > so long, and are so advantageous to the side with more money and patience > that any contract you sign is almost meaningless anyway. I have major > experience here I assure you! So be wary of any contract longer than a month > or two which won't pay you until completion. Of course, you could always > arrange to meet under a bridge, you bringing your software, client bringing > his money, and both taking no more than three armed guards.... I'm sure > you've seen that movie too! > > > > If you take tiny jobs, like write an ascii-to-integer converter kind of > thing, you will spend far more time looking for work, negotiating, phone > calls, etc., than you will spend actually doing work. Since you will often > not be willing to take the Bangalore-level wage that will be offered, you > will not get or take most jobs. Look instead for longer-term contracts. Try > to find something where you have unusual skills or abilities. If the job is > to download a LAMP suite and get it running, writing 100 lines of glue code > in the process, you're competing against every kid on the planet, because > almost everybody can do that. It's not really even software engineering. If > on the other hand you know how to optimize MySQL queries better than Joe the > Plumber... oops I meant Programmer, you have a better chance. > > > > My two cents! - Rod L. > > _______________________________________________ > > 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 jjinux at gmail.com Tue Dec 28 06:24:20 2010 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Mon, 27 Dec 2010 21:24:20 -0800 Subject: [Baypiggies] Calling presenters for 2011 In-Reply-To: References: Message-ID: On Wed, Dec 22, 2010 at 10:34 PM, Jimmy Retzlaff wrote: > If I'm not the person for January, then I'd like to take February to > demonstrate Yelp's mrjob: > > http://engineeringblog.yelp.com/2010/10/mrjob-distributed-computing-for-everybody.html Can you expand the talk to cover an hour? +1 -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ From jimmy at retzlaff.com Tue Dec 28 06:36:09 2010 From: jimmy at retzlaff.com (Jimmy Retzlaff) Date: Mon, 27 Dec 2010 21:36:09 -0800 Subject: [Baypiggies] Calling presenters for 2011 In-Reply-To: References: Message-ID: On Mon, Dec 27, 2010 at 9:24 PM, Shannon -jj Behrens wrote: > On Wed, Dec 22, 2010 at 10:34 PM, Jimmy Retzlaff wrote: >> If I'm not the person for January, then I'd like to take February to >> demonstrate Yelp's mrjob: >> >> http://engineeringblog.yelp.com/2010/10/mrjob-distributed-computing-for-everybody.html > > Can you expand the talk to cover an hour? > > +1 > > -jj Yep, I gave a one hour talk at Hacker Dojo on the same topic earlier this month - it's roughly the same 5 minute talk some of you saw in San Francisco plus looking at a progression of code examples to see how easy some things are with MapReduce. Jimmy From cappy2112 at gmail.com Tue Dec 28 06:53:26 2010 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 27 Dec 2010 21:53:26 -0800 Subject: [Baypiggies] replacement for urllib2 that can handle xhtml Message-ID: What's the best module/package for parsing xhtml? HTMLParser is built in, but is there another package which is more like urlib2 or Beautiful Soup- but handles xhtml? thanks From brent.tubbs at gmail.com Tue Dec 28 07:00:44 2010 From: brent.tubbs at gmail.com (Brent Tubbs) Date: Mon, 27 Dec 2010 22:00:44 -0800 Subject: [Baypiggies] Calling presenters for 2011 In-Reply-To: References: Message-ID: I was at the Hacker Dojo talk. Highly recommended. Hope it gets picked up for PyCon. But tying this back to the original thread ... Didn't Yelp also just release a testing framework called Testify? Jimmy, do you know if any Yelpers would like to speak on that as well? Brent On Mon, Dec 27, 2010 at 9:36 PM, Jimmy Retzlaff wrote: > On Mon, Dec 27, 2010 at 9:24 PM, Shannon -jj Behrens wrote: >> On Wed, Dec 22, 2010 at 10:34 PM, Jimmy Retzlaff wrote: >>> If I'm not the person for January, then I'd like to take February to >>> demonstrate Yelp's mrjob: >>> >>> http://engineeringblog.yelp.com/2010/10/mrjob-distributed-computing-for-everybody.html >> >> Can you expand the talk to cover an hour? >> >> +1 >> >> -jj > > Yep, I gave a one hour talk at Hacker Dojo on the same topic earlier > this month - it's roughly the same 5 minute talk some of you saw in > San Francisco plus looking at a progression of code examples to see > how easy some things are with MapReduce. > > Jimmy > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From keith at dartworks.biz Tue Dec 28 07:58:00 2010 From: keith at dartworks.biz (Keith Dart) Date: Mon, 27 Dec 2010 22:58:00 -0800 Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: References: Message-ID: <20101227225800.3a8bdfae@dartworks.biz> === On Mon, 12/27, Tony Cappellini wrote: === > What's the best module/package for parsing xhtml? > HTMLParser is built in, but is there another package which is more > like urlib2 or Beautiful Soup- but handles xhtml? === I use the one I wrote. ;-) I like it. Here is an example of using it: Python> from pycopia.WWW import XHTML Python> doc=XHTML.get_document("http://www.kdart.com/resume_for_Keith_Dart.xhtml") Python> print doc.get_path("/html/body/h1")

Resume for Keith Dart

That is my resume in XHTML format, previously validated. You can also verify it is standards compliant XHTML by trying to open it in MS Internet Explorer and watch it fail. ;-) It parses into what I call the Pythonic Object Model, or POM. The code is viewable here: http://code.google.com/p/pycopia/source/browse/trunk/WWW/pycopia/WWW/XHTML.py -- Keith Dart -- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keith Dart public key: ID: 19017044 ===================================================================== From jimmy at retzlaff.com Tue Dec 28 08:11:16 2010 From: jimmy at retzlaff.com (Jimmy Retzlaff) Date: Mon, 27 Dec 2010 23:11:16 -0800 Subject: [Baypiggies] Calling presenters for 2011 In-Reply-To: References: Message-ID: On Mon, Dec 27, 2010 at 10:00 PM, Brent Tubbs wrote: > I was at the Hacker Dojo talk. ?Highly recommended. ?Hope it gets > picked up for PyCon. Thanks for the kind words. :) > But tying this back to the original thread ... Didn't Yelp also just > release a testing framework called Testify? ?Jimmy, do you know if any > Yelpers would like to speak on that as well? Another Yelper, Rhett, is putting together a talk he hopes to deliver at PyCon about Testify. I'll talk to him to see if he can't give it here too. Here's the blog post he authored to announce Testify: http://engineeringblog.yelp.com/2010/10/now-testify.html Yelp is trying to open source more and more of the tools we've created that aren't too specific to our business - and other than mobile apps, almost everything we do is Python. As we get more projects out there I'll see if we can't get talks prepared about them. Jimmy ---- Yelp is hiring - http://jobvite.com/m?3WAh0fwx From aahz at pythoncraft.com Tue Dec 28 16:05:34 2010 From: aahz at pythoncraft.com (Aahz) Date: Tue, 28 Dec 2010 07:05:34 -0800 Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: References: Message-ID: <20101228150534.GA14415@panix.com> On Mon, Dec 27, 2010, Tony Cappellini wrote: > > What's the best module/package for parsing xhtml? HTMLParser is > built in, but is there another package which is more like urlib2 or > Beautiful Soup- but handles xhtml? lxml? (Never used it myself, but xhtml is supposed to be xml-compliant, therefore lxml would be the obvious choice. ElementTree also ought to work.) -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From kpguy1975 at gmail.com Tue Dec 28 16:51:09 2010 From: kpguy1975 at gmail.com (Vikram K) Date: Tue, 28 Dec 2010 10:51:09 -0500 Subject: [Baypiggies] nested list to dict question Message-ID: I have a nested list which looks something like this: x = [['104', '4501919'], ['104', '237681091'], ['104', '7669477'], ['100528064', '315259111']] I wish to convert this to a dict type which looks something like this: y = {'104': ['4501919', '237681091', '7669477'], '100528064': ['315259111']} Please help! Thanks Vikram -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at timhatch.com Tue Dec 28 17:06:01 2010 From: tim at timhatch.com (Tim Hatch) Date: Tue, 28 Dec 2010 08:06:01 -0800 Subject: [Baypiggies] nested list to dict question In-Reply-To: References: Message-ID: <57d4c2602cbf0205467db2ddf61dc04b.squirrel@webmail.timhatch.com> > I have a nested list which looks something like this: > > x = [['104', '4501919'], ['104', '237681091'], ['104', '7669477'], > ['100528064', '315259111']] You could try something like this... if you know the identical keys will always be adjacent there might be another way too. y = {} for k, v in x: y.setdefault(k, []).append(v) Tim From tim at timhatch.com Tue Dec 28 17:06:24 2010 From: tim at timhatch.com (Tim Hatch) Date: Tue, 28 Dec 2010 08:06:24 -0800 Subject: [Baypiggies] nested list to dict question Message-ID: > I have a nested list which looks something like this: > > x = [['104', '4501919'], ['104', '237681091'], ['104', '7669477'], > ['100528064', '315259111']] You could try something like this... if you know the identical keys will always be adjacent there might be another way too. y = {} for k, v in x: y.setdefault(k, []).append(v) Tim From fred at kas-group.com Tue Dec 28 17:06:29 2010 From: fred at kas-group.com (Fred C) Date: Tue, 28 Dec 2010 08:06:29 -0800 Subject: [Baypiggies] nested list to dict question In-Reply-To: References: Message-ID: <892E159B-E044-40A5-BA89-40F3CA8C94F2@kas-group.com> y = {} for k, v in x: y.setdefault(k, []).append(v) On Dec 28, 2010, at 7:51 AM, Vikram K wrote: > I have a nested list which looks something like this: > > x = [['104', '4501919'], ['104', '237681091'], ['104', '7669477'], ['100528064', '315259111']] > > I wish to convert this to a dict type which looks something like this: > > y = {'104': ['4501919', '237681091', '7669477'], '100528064': ['315259111']} > > Please help! > > Thanks > Vikram > > > _______________________________________________ > 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 jimmy at retzlaff.com Tue Dec 28 17:47:53 2010 From: jimmy at retzlaff.com (Jimmy Retzlaff) Date: Tue, 28 Dec 2010 08:47:53 -0800 Subject: [Baypiggies] nested list to dict question In-Reply-To: References: Message-ID: On Tue, Dec 28, 2010 at 7:51 AM, Vikram K wrote: > I have a nested list which looks something like this: > > x = [['104', '4501919'], ['104', '237681091'], ['104', '7669477'], > ['100528064', '315259111']] > > I wish to convert this to a dict type which looks something like this: > > y = {'104': ['4501919', '237681091', '7669477'], '100528064': ['315259111']} This is a great use for defaultdict (I haven't run this, there might be a dumb error - but I've written it a gillion times): from collections import defaultdict y = defaultdict(list) for k, v in x: y[k].append(v) See http://docs.python.org/library/collections.html#collections.defaultdict - your example is almost exactly the same as the example in the docs. Jimmy ---- Yelp is hiring - http://jobvite.com/m?3WAh0fwx From tony at tcapp.com Tue Dec 28 18:42:53 2010 From: tony at tcapp.com (Tony Cappellini) Date: Tue, 28 Dec 2010 09:42:53 -0800 Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: <20101228150534.GA14415@panix.com> References: <20101228150534.GA14415@panix.com> Message-ID: It appears my url was misformed (OE). When I had initially tried opening the url with urllib2.urlopen(), an exception was thrown. When I saw the xml in the header, I had thought that urllib2 wasn't compatible with it. But it works now. On Tue, Dec 28, 2010 at 7:05 AM, Aahz wrote: > On Mon, Dec 27, 2010, Tony Cappellini wrote: >> >> What's the best module/package for parsing xhtml? ?HTMLParser is >> built in, but is there another package which is more like urlib2 or >> Beautiful Soup- but handles xhtml? > > lxml? ?(Never used it myself, but xhtml is supposed to be xml-compliant, > therefore lxml would be the obvious choice. ?ElementTree also ought to > work.) > -- > Aahz (aahz at pythoncraft.com) ? ? ? ? ? <*> ? ? ? ? http://www.pythoncraft.com/ > > "Think of it as evolution in action." ?--Tony Rand > _______________________________________________ > 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 Tue Dec 28 18:58:16 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 28 Dec 2010 09:58:16 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google Message-ID: This is only peripherally Pythonic (as it is really an HTML question). However, this is the community I feel most comfortable asking first. is anyone familiar with XFN 1.1? Are there any benefits of incorporating XFN into a website? Does Google do any SEO optimization with XFN? Cheers, Glen -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Tue Dec 28 22:10:27 2010 From: aahz at pythoncraft.com (Aahz) Date: Tue, 28 Dec 2010 13:10:27 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: References: Message-ID: <20101228211027.GA19311@panix.com> On Tue, Dec 28, 2010, Glen Jarvis wrote: > > This is only peripherally Pythonic (as it is really an HTML question). > However, this is the community I feel most comfortable asking first. is > anyone familiar with XFN 1.1? Are there any benefits of incorporating XFN > into a website? Does Google do any SEO optimization with XFN? What is XFN? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Think of it as evolution in action." --Tony Rand From glen at glenjarvis.com Tue Dec 28 22:21:35 2010 From: glen at glenjarvis.com (Glen Jarvis) Date: Tue, 28 Dec 2010 13:21:35 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: <20101228211027.GA19311@panix.com> References: <20101228211027.GA19311@panix.com> Message-ID: Per second link in Google: http://gmpg.org/xfn/ I don't know much more than this. Glen On Tue, Dec 28, 2010 at 1:10 PM, Aahz wrote: > On Tue, Dec 28, 2010, Glen Jarvis wrote: > > > > This is only peripherally Pythonic (as it is really an HTML question). > > However, this is the community I feel most comfortable asking first. is > > anyone familiar with XFN 1.1? Are there any benefits of incorporating XFN > > into a website? Does Google do any SEO optimization with XFN? > > What is XFN? > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > "Think of it as evolution in action." --Tony Rand > _______________________________________________ > 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 donnamsnow at gmail.com Wed Dec 29 01:35:32 2010 From: donnamsnow at gmail.com (Donna Snow) Date: Tue, 28 Dec 2010 16:35:32 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: References: <20101228211027.GA19311@panix.com> Message-ID: Intriguing - example: http://www.7nights.com/asterisk/ I couldn't find any actual markup in view source? Donna Snow (now residing in Henderson, NV and working as a Webmaster) On Tue, Dec 28, 2010 at 1:21 PM, Glen Jarvis wrote: > Per second link in Google: > > http://gmpg.org/xfn/ > > I don't know much more than this. > > Glen > > > On Tue, Dec 28, 2010 at 1:10 PM, Aahz wrote: > >> On Tue, Dec 28, 2010, Glen Jarvis wrote: >> > >> > This is only peripherally Pythonic (as it is really an HTML question). >> > However, this is the community I feel most comfortable asking first. is >> > anyone familiar with XFN 1.1? Are there any benefits of incorporating >> XFN >> > into a website? Does Google do any SEO optimization with XFN? >> >> What is XFN? >> -- >> Aahz (aahz at pythoncraft.com) <*> >> http://www.pythoncraft.com/ >> >> "Think of it as evolution in action." --Tony Rand >> _______________________________________________ >> 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 donnamsnow at gmail.com Wed Dec 29 01:42:13 2010 From: donnamsnow at gmail.com (Donna Snow) Date: Tue, 28 Dec 2010 16:42:13 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: References: <20101228211027.GA19311@panix.com> Message-ID: <.li>Chicago Sports TalkChicago sports forum message board. Bulls, Bears, Blackhawks, Fire, Cubs, White Sox discussion At http://www.bradbice.com/ - in his "links" section.. but why? Is that like adding "tags"? Donna On Tue, Dec 28, 2010 at 4:35 PM, Donna Snow wrote: > Intriguing - > > example: > > http://www.7nights.com/asterisk/ > > > > I couldn't find any actual markup in view source? > > Donna Snow > (now residing in Henderson, NV and working as a Webmaster) > > > On Tue, Dec 28, 2010 at 1:21 PM, Glen Jarvis wrote: > >> Per second link in Google: >> >> http://gmpg.org/xfn/ >> >> I don't know much more than this. >> >> Glen >> >> >> On Tue, Dec 28, 2010 at 1:10 PM, Aahz wrote: >> >>> On Tue, Dec 28, 2010, Glen Jarvis wrote: >>> > >>> > This is only peripherally Pythonic (as it is really an HTML question). >>> > However, this is the community I feel most comfortable asking first. is >>> > anyone familiar with XFN 1.1? Are there any benefits of incorporating >>> XFN >>> > into a website? Does Google do any SEO optimization with XFN? >>> >>> What is XFN? >>> -- >>> Aahz (aahz at pythoncraft.com) <*> >>> http://www.pythoncraft.com/ >>> >>> "Think of it as evolution in action." --Tony Rand >>> _______________________________________________ >>> 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 mech422 at gmail.com Wed Dec 29 01:46:42 2010 From: mech422 at gmail.com (Steve Hindle) Date: Tue, 28 Dec 2010 17:46:42 -0700 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: References: <20101228211027.GA19311@panix.com> Message-ID: Since XHTML is XML - you can incorporate new tags and attributes by changing the DTD... looks like this is just a hack to add a relationship attribute to href's... with a bit of standardization I'm guessing Steve On Tue, Dec 28, 2010 at 2:21 PM, Glen Jarvis wrote: > Per second link in Google: > http://gmpg.org/xfn/ > I don't know much more than this. > Glen > > On Tue, Dec 28, 2010 at 1:10 PM, Aahz wrote: >> >> On Tue, Dec 28, 2010, Glen Jarvis wrote: >> > >> > This is only peripherally Pythonic (as it is really an HTML question). >> > However, this is the community I feel most comfortable asking first. is >> > anyone familiar with XFN 1.1? Are there any benefits of incorporating >> > XFN >> > into a website? Does Google do any SEO optimization with XFN? >> >> What is XFN? >> -- >> Aahz (aahz at pythoncraft.com) ? ? ? ? ? <*> >> http://www.pythoncraft.com/ >> >> "Think of it as evolution in action." ?--Tony Rand >> _______________________________________________ >> 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 mech422 at gmail.com Wed Dec 29 01:52:14 2010 From: mech422 at gmail.com (Steve Hindle) Date: Tue, 28 Dec 2010 17:52:14 -0700 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: References: <20101228211027.GA19311@panix.com> Message-ID: btw - it appears they skip the 'change the DTD' step, which should work for XML compliant tools, as they should ignore tags and attributes they don't recognize On Tue, Dec 28, 2010 at 2:21 PM, Glen Jarvis wrote: > Per second link in Google: > http://gmpg.org/xfn/ > I don't know much more than this. > Glen > > On Tue, Dec 28, 2010 at 1:10 PM, Aahz wrote: >> >> On Tue, Dec 28, 2010, Glen Jarvis wrote: >> > >> > This is only peripherally Pythonic (as it is really an HTML question). >> > However, this is the community I feel most comfortable asking first. is >> > anyone familiar with XFN 1.1? Are there any benefits of incorporating >> > XFN >> > into a website? Does Google do any SEO optimization with XFN? >> >> What is XFN? >> -- >> Aahz (aahz at pythoncraft.com) ? ? ? ? ? <*> >> http://www.pythoncraft.com/ >> >> "Think of it as evolution in action." ?--Tony Rand >> _______________________________________________ >> 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 keith at dart.us.com Wed Dec 29 04:51:27 2010 From: keith at dart.us.com (Keith Dart) Date: Tue, 28 Dec 2010 19:51:27 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google References: <20101228211027.GA19311@panix.com> Message-ID: <20101228195127.4e1efb17@dart.us.com> === On Tue, 12/28, Steve Hindle wrote: === > Since XHTML is XML - you can incorporate new tags and attributes by > changing the DTD... > looks like this is just a hack to add a relationship attribute to > href's... with a bit of standardization I'm guessing === It can also use XML namespaces. SVG can work that way. -- Keith Dart From mech422 at gmail.com Wed Dec 29 05:02:41 2010 From: mech422 at gmail.com (Steve Hindle) Date: Tue, 28 Dec 2010 21:02:41 -0700 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: <20101228195127.4e1efb17@dart.us.com> References: <20101228211027.GA19311@panix.com> <20101228195127.4e1efb17@dart.us.com> Message-ID: My (limited) understanding of namespaces led me to believe that required a namespace prefix on the tag ? like Zope's MeTAL namespace ? The system mentioned below just hung an extra attribute off an element with no namespace tag ? Steve On Tue, Dec 28, 2010 at 8:51 PM, Keith Dart wrote: > === On Tue, 12/28, Steve Hindle wrote: === >> Since XHTML is XML - you can incorporate new tags and attributes by >> changing the DTD... >> looks like this is just a hack to add a relationship attribute to >> href's... with a bit of standardization I'm guessing > === > > It can also use XML namespaces. SVG can work that way. > > > -- Keith Dart > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From keith at dart.us.com Wed Dec 29 05:07:05 2010 From: keith at dart.us.com (Keith Dart) Date: Tue, 28 Dec 2010 20:07:05 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google References: <20101228211027.GA19311@panix.com> <20101228195127.4e1efb17@dart.us.com> Message-ID: <20101228200705.65f99183@dart.us.com> === On Tue, 12/28, Steve Hindle wrote: === > My (limited) understanding of namespaces led me to believe that > required a namespace prefix on the tag ? like Zope's MeTAL namespace ? > The system mentioned below just hung an extra attribute off an > element with no namespace tag ? > === That's right. But I didn't look at the site. Just saying that modifying the DTD is not required. -- Keith Dart From mech422 at gmail.com Wed Dec 29 10:25:54 2010 From: mech422 at gmail.com (Steve Hindle) Date: Wed, 29 Dec 2010 02:25:54 -0700 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: <20101228200705.65f99183@dart.us.com> References: <20101228211027.GA19311@panix.com> <20101228195127.4e1efb17@dart.us.com> <20101228200705.65f99183@dart.us.com> Message-ID: Huh - rel is actually a stock html4 attribute, and not an add-on... there's also a 'rev' (reverse) attribute. those are new to me :-P Steve On Tue, Dec 28, 2010 at 9:07 PM, Keith Dart wrote: > === On Tue, 12/28, Steve Hindle wrote: === >> My (limited) understanding of namespaces led me to believe that >> required a namespace prefix on the tag ? like Zope's MeTAL namespace ? >> ?The system mentioned below just hung an extra attribute off an >> element with no namespace tag ? >> > === > > That's right. But I didn't look at the site. Just saying that modifying > the DTD is not required. > > > -- Keith Dart > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From rami.chowdhury at gmail.com Wed Dec 29 14:46:11 2010 From: rami.chowdhury at gmail.com (Rami Chowdhury) Date: Wed, 29 Dec 2010 13:46:11 +0000 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: References: <20101228200705.65f99183@dart.us.com> Message-ID: <201012291346.11731.rami.chowdhury@gmail.com> On Wednesday 29 December 2010 09:25:54 Steve Hindle wrote: > Huh - rel is actually a stock html4 attribute, and not an add-on... > there's also a 'rev' (reverse) attribute. Are those OK on all elements, though? I know they were acceptable on but on ? > > those are new to me :-P > > Steve > > On Tue, Dec 28, 2010 at 9:07 PM, Keith Dart wrote: > > === On Tue, 12/28, Steve Hindle wrote: === > > > >> My (limited) understanding of namespaces led me to believe that > >> required a namespace prefix on the tag ? like Zope's MeTAL namespace ? > >> The system mentioned below just hung an extra attribute off an > >> element with no namespace tag ? > > > > === > > > > That's right. But I didn't look at the site. Just saying that modifying > > the DTD is not required. > > > > > > -- Keith Dart > > _______________________________________________ > > 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 ---- Rami Chowdhury "Be the change you wish to see in the world." -- Mahatma Gandhi +44-7581-430-517 / +88-01819-245544 /+1-408-597-7068 From alecf at flett.org Wed Dec 29 23:17:59 2010 From: alecf at flett.org (Alec Flett) Date: Wed, 29 Dec 2010 14:17:59 -0800 Subject: [Baypiggies] XFN, Web Frameworks and Google In-Reply-To: <201012291346.11731.rami.chowdhury@gmail.com> References: <20101228200705.65f99183@dart.us.com> <201012291346.11731.rami.chowdhury@gmail.com> Message-ID: rel= has been around for ages! :) http://www.w3.org/TR/html4/struct/links.html#adef-rel This is one of the major ways google encourages people to decorate their blogs to neutralize spammy comments: http://googleblog.blogspot.com/2005/01/preventing-comment-spam.html But XFN was one of the first attempts to standardize the use of 'rel' for anything semantic... the theory is/was that you could actually determine a social graph from a set of blogs, if everyone just used rel= appropriately in their blogrolls (Remember those?) - it still has some use here and there (see technorati.com) but never really got widespread adoption... Alec On Wed, Dec 29, 2010 at 5:46 AM, Rami Chowdhury wrote: > On Wednesday 29 December 2010 09:25:54 Steve Hindle wrote: > > Huh - rel is actually a stock html4 attribute, and not an add-on... > > there's also a 'rev' (reverse) attribute. > > Are those OK on all elements, though? I know they were acceptable on > but > on ? > > > > > those are new to me :-P > > > > Steve > > > > On Tue, Dec 28, 2010 at 9:07 PM, Keith Dart wrote: > > > === On Tue, 12/28, Steve Hindle wrote: === > > > > > >> My (limited) understanding of namespaces led me to believe that > > >> required a namespace prefix on the tag ? like Zope's MeTAL namespace ? > > >> The system mentioned below just hung an extra attribute off an > > >> element with no namespace tag ? > > > > > > === > > > > > > That's right. But I didn't look at the site. Just saying that modifying > > > the DTD is not required. > > > > > > > > > -- Keith Dart > > > _______________________________________________ > > > 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 > > > ---- > Rami Chowdhury > "Be the change you wish to see in the world." -- Mahatma Gandhi > +44-7581-430-517 / +88-01819-245544 /+1-408-597-7068 > _______________________________________________ > 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 janssen at parc.com Fri Dec 31 04:46:31 2010 From: janssen at parc.com (Bill Janssen) Date: Thu, 30 Dec 2010 19:46:31 PST Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: References: Message-ID: <21076.1293767191@parc.com> BeautifulSoup does xhtml, too. Bill Tony Cappellini wrote: > What's the best module/package for parsing xhtml? > HTMLParser is built in, but is there another package which is more > like urlib2 or Beautiful Soup- but handles xhtml? > > thanks > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From charles.merriam at gmail.com Fri Dec 31 07:22:33 2010 From: charles.merriam at gmail.com (Charles Merriam) Date: Thu, 30 Dec 2010 22:22:33 -0800 Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: <21076.1293767191@parc.com> References: <21076.1293767191@parc.com> Message-ID: This shows up on the mailing list every now and then. lxml is faster, more tolerant, etc., than Beautful Soup and the built in ones.. Enjoy On Thu, Dec 30, 2010 at 7:46 PM, Bill Janssen wrote: > > BeautifulSoup does xhtml, too. > > Bill > > Tony Cappellini wrote: > > > What's the best module/package for parsing xhtml? > > HTMLParser is built in, but is there another package which is more > > like urlib2 or Beautiful Soup- but handles xhtml? > > > > thanks > > _______________________________________________ > > 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.orgis shows > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From ken at seehart.com Fri Dec 31 18:03:29 2010 From: ken at seehart.com (Ken Seehart) Date: Fri, 31 Dec 2010 18:03:29 +0100 Subject: [Baypiggies] hardware question In-Reply-To: <20101224162209.GA22132@panix.com> References: <20101224162209.GA22132@panix.com> Message-ID: <4D1E0CE1.3090907@seehart.com> On 12/24/2010 05:22 PM, Aahz wrote: > On Thu, Dec 23, 2010, Vikram K wrote: >> Recently i got funding to buy a new laptop. The choice is between Apple >> (which i have never ever used), or HP/Dell. >> >> Since most of my computational work will be using python i wanted to ask >> others on this forum about whether there would be any compatibility issues >> with using the various python libraries (matplotlib, scipy, numpy, >> Biopython, etc.) when using Python on the Mac. > There's one simple reason why I absolutely stick with Macs for laptops: > sleep Just Works. Supposedly there's been progress in recent years, but > I still often see people booting up their laptops instead of just waking > them from sleep when it's not a Mac. Get a Mac with 8GB RAM and you'll > have plenty of room for virtual machines for Ubuntu, Windows, or > whatever. > > Overall, I'm happier when I'm using my Ubuntu desktop at home, mainly > because Macs are somewhat keyboard-unfriendly, although you can do an > awful lots with the Mac keyboard if you invest some time learning. > (Surprisingly, Windows and Ubuntu are mostly in a dead heat for keyboard > friendliness.) If you are familiar with and like Gnome/KDE virtual > screens, you will hate the Mac implementation. > > You should get a mouse with your Mac if you have sweaty fingers, the > capacitive trackpad sometimes goes wonky. > > I've used 13", 15", and 17" laptops. IMO 15" is the best compromise > between screen size and portability. Get the anti-glare screen, the > glossy is one thing I dislike about my current Mac. I'm going to buy a new laptop for PYCON, and the Mac virtual machine idea is tempting. The one issue I have is whether it is possible to run CUDA code in a windows vm and a ubuntu vm on a mac. Anyone know about this? From janssen at parc.com Fri Dec 31 20:34:57 2010 From: janssen at parc.com (Bill Janssen) Date: Fri, 31 Dec 2010 11:34:57 PST Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: References: <21076.1293767191@parc.com> Message-ID: <44349.1293824097@parc.com> Charles Merriam wrote: > This shows up on the mailing list every now and then. > > lxml is faster, more tolerant, etc., than Beautful Soup and the built in ones.. Happy to take your word for that, but it's got various prereqs and I've found it a pain to install (on Macs, which lack an integrated package system). So I tend to stick to BeautifulSoup. Horses for courses... Bill > > > Enjoy > > On Thu, Dec 30, 2010 at 7:46 PM, Bill Janssen wrote: > > > > BeautifulSoup does xhtml, too. > > > > Bill > > > > Tony Cappellini wrote: > > > > > What's the best module/package for parsing xhtml? > > > HTMLParser is built in, but is there another package which is more > > > like urlib2 or Beautiful Soup- but handles xhtml? > > > > > > thanks > > > _______________________________________________ > > > 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.orgis shows > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies From st1999 at gmail.com Fri Dec 31 21:03:32 2010 From: st1999 at gmail.com (ST1999) Date: Fri, 31 Dec 2010 12:03:32 -0800 Subject: [Baypiggies] replacement for urllib2 that can handle xhtml In-Reply-To: References: <21076.1293767191@parc.com> Message-ID: lxml is *much* faster than BeautifulSoup (as I recall, a speaker at 2009 PyCon suggested it was 20 to 30 times faster) and should be used unless there is a compelling reason not to. Also, I'm not sure how much BeautifulSoup is being maintained at this point. - Shailen Tuli On Thu, Dec 30, 2010 at 10:22 PM, Charles Merriam wrote: > This shows up on the mailing list every now and then. > > lxml is faster, more tolerant, etc., than Beautful Soup and the built in > ones.. > > > Enjoy > > On Thu, Dec 30, 2010 at 7:46 PM, Bill Janssen wrote: > > > > BeautifulSoup does xhtml, too. > > > > Bill > > > > Tony Cappellini wrote: > > > > > What's the best module/package for parsing xhtml? > > > HTMLParser is built in, but is there another package which is more > > > like urlib2 or Beautiful Soup- but handles xhtml? > > > > > > thanks > > > _______________________________________________ > > > 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.orgis shows > > 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 janssen at parc.com Fri Dec 31 21:09:55 2010 From: janssen at parc.com (Bill Janssen) Date: Fri, 31 Dec 2010 12:09:55 PST Subject: [Baypiggies] puzzle: binding invocation context for a function call during a class declaration Message-ID: <45251.1293826195@parc.com> I'm puzzling out how one would ape a declarative language in Python. For instance, take a language that has declarations like concept Foo { is-a A; is-a B; part-of X; public int counter; public analogue bar; } expression Bletch { expresses Foo; counter = 3; } where "concept", "public", "is-a", "part-of", "int", "analogue", "expression", and "expresses" are all keywords. Since it's largely declarative, I'd naturally express it in Python as a set of class declarations: from mylang import is_a, part_of, Concept, Expression, attribute, public, analogue, expresses class Foo (Concept): is_a(A); is_a(B); part_of(X); counter = attribute(public, int) bar = attribute(public, analogue) class Bletch (Expression): expresses(Foo) counter = 3 Now, my question is, how can I capture the invocation context of a function, so that I can know that "is_a(A)" is being called as part of the definition of class "Foo"? Do functions called during the evaluation of a class leave their return result somewhere, for instance, so that I could define a metaclass to do something with that result? Right now, I'm using the fragile workaround of _relationships = [] def _store_relationship (x, rel): primary = inspect.stack()[2][0].f_code.co_name _relationships.append((primary, rel, x)) is_a = lambda x: _store_relationship(x, "is-a") If I was willing to use Python 3, I could use class decorators instead, I suppose. But I'd like to nest these declarations inside the class definition if I can. Any ideas would be appreciated. Bill From recursive.cookie.jar at gmail.com Fri Dec 31 21:25:10 2010 From: recursive.cookie.jar at gmail.com (Zachary Collins) Date: Fri, 31 Dec 2010 15:25:10 -0500 Subject: [Baypiggies] puzzle: binding invocation context for a function call during a class declaration In-Reply-To: <45251.1293826195@parc.com> References: <45251.1293826195@parc.com> Message-ID: You're trying to create more complicated symantics than is necessary to solve this problem. How about class Foo (Concept): things_i_am = [A, B] ? 2010/12/31 Bill Janssen : > I'm puzzling out how one would ape a declarative language in Python. > For instance, take a language that has declarations like > > ?concept Foo { > ? ?is-a A; > ? ?is-a B; > ? ?part-of X; > > ? ?public int counter; > ? ?public analogue bar; > ?} > > ?expression Bletch { > > ? ?expresses Foo; > > ? ?counter = 3; > ?} > > where "concept", "public", "is-a", "part-of", "int", "analogue", > "expression", and "expresses" are all keywords. > > Since it's largely declarative, I'd naturally express it in Python as a > set of class declarations: > > ?from mylang import is_a, part_of, Concept, Expression, attribute, public, analogue, expresses > > ?class Foo (Concept): > > ? ?is_a(A); > ? ?is_a(B); > ? ?part_of(X); > > ? ?counter = attribute(public, int) > ? ?bar = attribute(public, analogue) > > ?class Bletch (Expression): > > ? ?expresses(Foo) > ? ?counter = 3 > > Now, my question is, how can I capture the invocation context of a > function, so that I can know that "is_a(A)" is being called as part of > the definition of class "Foo"? ?Do functions called during the > evaluation of a class leave their return result somewhere, for instance, > so that I could define a metaclass to do something with that result? > > Right now, I'm using the fragile workaround of > > ?_relationships = [] > ?def _store_relationship (x, rel): > ? ? ?primary = inspect.stack()[2][0].f_code.co_name > ? ? ?_relationships.append((primary, rel, x)) > ?is_a = lambda x: _store_relationship(x, "is-a") > > If I was willing to use Python 3, I could use class decorators instead, > I suppose. ?But I'd like to nest these declarations inside the class > definition if I can. > > Any ideas would be appreciated. > > Bill > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From janssen at parc.com Fri Dec 31 22:23:24 2010 From: janssen at parc.com (Bill Janssen) Date: Fri, 31 Dec 2010 13:23:24 PST Subject: [Baypiggies] puzzle: binding invocation context for a function call during a class declaration In-Reply-To: References: <45251.1293826195@parc.com> Message-ID: <47097.1293830604@parc.com> You're suggesting I do everything with attributes. Yes, that's a possibility, but it doesn't really answer the question I raised, which is about capturing the invocation context for a function call that happens during the definition of a class. Bill Zachary Collins wrote: > You're trying to create more complicated symantics than is necessary > to solve this problem. > > How about > class Foo (Concept): > things_i_am = [A, B] > > ? > > 2010/12/31 Bill Janssen : > > I'm puzzling out how one would ape a declarative language in Python. > > For instance, take a language that has declarations like > > > > ?concept Foo { > > ? ?is-a A; > > ? ?is-a B; > > ? ?part-of X; > > > > ? ?public int counter; > > ? ?public analogue bar; > > ?} > > > > ?expression Bletch { > > > > ? ?expresses Foo; > > > > ? ?counter = 3; > > ?} > > > > where "concept", "public", "is-a", "part-of", "int", "analogue", > > "expression", and "expresses" are all keywords. > > > > Since it's largely declarative, I'd naturally express it in Python as a > > set of class declarations: > > > > ?from mylang import is_a, part_of, Concept, Expression, attribute, public, analogue, expresses > > > > ?class Foo (Concept): > > > > ? ?is_a(A); > > ? ?is_a(B); > > ? ?part_of(X); > > > > ? ?counter = attribute(public, int) > > ? ?bar = attribute(public, analogue) > > > > ?class Bletch (Expression): > > > > ? ?expresses(Foo) > > ? ?counter = 3 > > > > Now, my question is, how can I capture the invocation context of a > > function, so that I can know that "is_a(A)" is being called as part of > > the definition of class "Foo"? ?Do functions called during the > > evaluation of a class leave their return result somewhere, for instance, > > so that I could define a metaclass to do something with that result? > > > > Right now, I'm using the fragile workaround of > > > > ?_relationships = [] > > ?def _store_relationship (x, rel): > > ? ? ?primary = inspect.stack()[2][0].f_code.co_name > > ? ? ?_relationships.append((primary, rel, x)) > > ?is_a = lambda x: _store_relationship(x, "is-a") > > > > If I was willing to use Python 3, I could use class decorators instead, > > I suppose. ?But I'd like to nest these declarations inside the class > > definition if I can. > > > > Any ideas would be appreciated. > > > > Bill > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > >