From Irv at furrypants.com Sat Feb 7 02:35:39 2015 From: Irv at furrypants.com (Irv Kalb) Date: Fri, 6 Feb 2015 17:35:39 -0800 Subject: [Baypiggies] Beginners Python course at UCSC Extension Message-ID: Hi, I will be teaching a course called ?Python for Beginners? at UCSC Extension in Santa Clara. The course will go for six weeks and meet on Friday nights from 6:30 to 9:30, starting February 13th. The course is designed for people with no programming experience. So while the course is probably not right for people on this list, maybe someone you know might be interested. Sign ups are open to the general public, and there is still time to register. The course fee is $580. More details are available at: http://course.ucsc-extension.edu/modules/shop/index.html?action=section&OfferingID=3576274 Feel free to contact me directly if you have any questions. Irv From suryavanshi.manu at gmail.com Wed Feb 11 01:47:35 2015 From: suryavanshi.manu at gmail.com (Manu Suryavansh) Date: Tue, 10 Feb 2015 16:47:35 -0800 Subject: [Baypiggies] Looking for a Job - Start immediatley Message-ID: Hi All, I am looking for a python developer job starting asap. I have been programming in Python for the last three years and I have used libraries like Pandas, Scikit-learn, Flask, Numpy etc. I have taken several programming courses on Udacity and Coursera. Professionally I have been working in the semiconductor industry for 7 years and have developed ATE test solutions in C++. I have a H1B visa valid till Oct 2016. If anybody can also provide names of any consulting companies which may be willing to transfer my visa (visa transfer only takes 2 weeks), that will be really helpful. I would appreciate any help. I apologize in advance if this is not appropriate for this mailing list. Github - https://github.com/suryavanshi Projects - http://suryavanshi.github.io/ Codeeval - https://www.codeeval.com/dashboard/ I have attached my resume. Regards, Manu Suryavansh -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Resume_Manu_Python.pdf Type: application/pdf Size: 19316 bytes Desc: not available URL: From motoom at xs4all.nl Wed Feb 11 15:54:51 2015 From: motoom at xs4all.nl (Michiel Overtoom) Date: Wed, 11 Feb 2015 15:54:51 +0100 Subject: [Baypiggies] Looking for a Job - Start immediatley In-Reply-To: References: Message-ID: Hi Manu, I see this in your r?sum?: > Codeeval Programming problems (Top 10%) - http://www.codeeval.com/profile/suryavanshi/ Have you ever gained benefit from this? Also, Python is the most popular language on CodeEval. Greetings, -- "You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes From peter at farrellpolymath.com Thu Feb 19 16:38:07 2015 From: peter at farrellpolymath.com (Peter Farrell) Date: Thu, 19 Feb 2015 07:38:07 -0800 Subject: [Baypiggies] Explore Algebra Using Python Message-ID: Hello to the Group! I'm holding a free Meetup in Burlingame where I'll present some simple Python programs I've put together to help math students (and former math students) explore Algebra topics like solving equations and graphing functions. More info on the Meetup site . Hope to see you there! Peter Farrell -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.hoffman at gmail.com Thu Feb 19 17:08:47 2015 From: paul.hoffman at gmail.com (Paul Hoffman) Date: Thu, 19 Feb 2015 08:08:47 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up Message-ID: Greetings. I have a Python 3.4 program that will keep eating up memory until I tell it to stop; in short, it uses asyncio to launch as many coroutines as the machine can handle. I want to determine approximately how much memory I am using at this moment so I know when to stop consuming more and having the box run out of memory (I already have swapping turned off). Are there well-known patterns for this? I looked in a bunch of places and found nothing, which kinda surprised me. I recognize that it is unlikely that there is a cross-OS method for this, but I would be happy with just something that says "I'm now taking up a total of 3.7 gig" and I can do the "how much is too much" calculation by hand. Pointers are appreciated. --Paul Hoffman -------------- next part -------------- An HTML attachment was scrubbed... URL: From gotszlin at gmail.com Thu Feb 19 20:24:12 2015 From: gotszlin at gmail.com (Luke Gotszling) Date: Thu, 19 Feb 2015 11:24:12 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: Hi Paul, You can try one of these methods: http://fa.bianp.net/blog/2013/different-ways-to-get-memory-consumption-or-lessons-learned-from-memory_profiler/ Also look at the resource module: https://docs.python.org/3.4/library/resource.html Best, Luke On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman wrote: > Greetings. I have a Python 3.4 program that will keep eating up memory > until I tell it to stop; in short, it uses asyncio to launch as many > coroutines as the machine can handle. I want to determine approximately how > much memory I am using at this moment so I know when to stop consuming more > and having the box run out of memory (I already have swapping turned off). > > Are there well-known patterns for this? I looked in a bunch of places and > found nothing, which kinda surprised me. I recognize that it is unlikely > that there is a cross-OS method for this, but I would be happy with just > something that says "I'm now taking up a total of 3.7 gig" and I can do the > "how much is too much" calculation by hand. > > Pointers are appreciated. > > --Paul Hoffman > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -- [image: --] Luke Gotszling [image: http://]about.me/luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Thu Feb 19 18:27:07 2015 From: bdbaddog at gmail.com (William Deegan) Date: Thu, 19 Feb 2015 09:27:07 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: Paul, If you only care about linux you can parse /proc/self/status -Bill On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman wrote: > Greetings. I have a Python 3.4 program that will keep eating up memory > until I tell it to stop; in short, it uses asyncio to launch as many > coroutines as the machine can handle. I want to determine approximately how > much memory I am using at this moment so I know when to stop consuming more > and having the box run out of memory (I already have swapping turned off). > > Are there well-known patterns for this? I looked in a bunch of places and > found nothing, which kinda surprised me. I recognize that it is unlikely > that there is a cross-OS method for this, but I would be happy with just > something that says "I'm now taking up a total of 3.7 gig" and I can do the > "how much is too much" calculation by hand. > > Pointers are appreciated. > > --Paul Hoffman > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.hoffman at gmail.com Thu Feb 19 21:02:57 2015 From: paul.hoffman at gmail.com (Paul Hoffman) Date: Thu, 19 Feb 2015 12:02:57 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: This could be a good shot, but I'm not sure how to use it to get the current amount of memory used by the Python program. If I do a subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of memory used for "cat", not for the enclosing program. --Paul Hoffman On Thu, Feb 19, 2015 at 9:27 AM, William Deegan wrote: > Paul, > > If you only care about linux you can parse /proc/self/status > > -Bill > > On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman > wrote: > >> Greetings. I have a Python 3.4 program that will keep eating up memory >> until I tell it to stop; in short, it uses asyncio to launch as many >> coroutines as the machine can handle. I want to determine approximately how >> much memory I am using at this moment so I know when to stop consuming more >> and having the box run out of memory (I already have swapping turned off). >> >> Are there well-known patterns for this? I looked in a bunch of places and >> found nothing, which kinda surprised me. I recognize that it is unlikely >> that there is a cross-OS method for this, but I would be happy with just >> something that says "I'm now taking up a total of 3.7 gig" and I can do the >> "how much is too much" calculation by hand. >> >> Pointers are appreciated. >> >> --Paul Hoffman >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gotszlin at gmail.com Thu Feb 19 21:04:27 2015 From: gotszlin at gmail.com (Luke Gotszling) Date: Thu, 19 Feb 2015 12:04:27 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: Have you tried with the latest version of psutil, 2.2.1? On Thu, Feb 19, 2015 at 12:01 PM, Paul Hoffman wrote: > I've never had good luck with psutil; seemed flaky both times I tried it. > > Also, I looked at the resource modules, but they don't give useful > information. That is, if you watch "top -o %MEM" in one window and run > Python CLI in another, then eat up a huge amount of memory with something > like a=bytearray(2**32), then free the memory with a=2, you see the memory > be released in "top", but resource.getrusage(resource.RUSAGE_SELF)[2] still > shows the larger amount because it is showing the maximum size used, not > the current. > > Other thoughts? > > --Paul Hoffman > > On Thu, Feb 19, 2015 at 11:24 AM, Luke Gotszling > wrote: > >> Hi Paul, >> >> You can try one of these methods: >> http://fa.bianp.net/blog/2013/different-ways-to-get-memory-consumption-or-lessons-learned-from-memory_profiler/ >> >> Also look at the resource module: >> https://docs.python.org/3.4/library/resource.html >> >> Best, Luke >> >> On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman >> wrote: >> >>> Greetings. I have a Python 3.4 program that will keep eating up memory >>> until I tell it to stop; in short, it uses asyncio to launch as many >>> coroutines as the machine can handle. I want to determine approximately how >>> much memory I am using at this moment so I know when to stop consuming more >>> and having the box run out of memory (I already have swapping turned off). >>> >>> Are there well-known patterns for this? I looked in a bunch of places >>> and found nothing, which kinda surprised me. I recognize that it is >>> unlikely that there is a cross-OS method for this, but I would be happy >>> with just something that says "I'm now taking up a total of 3.7 gig" and I >>> can do the "how much is too much" calculation by hand. >>> >>> Pointers are appreciated. >>> >>> --Paul Hoffman >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >>> >> >> >> >> -- >> >> [image: --] >> Luke Gotszling >> [image: http://]about.me/luke >> >> >> > > -- [image: --] Luke Gotszling [image: http://]about.me/luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrjean1 at gmail.com Thu Feb 19 21:08:33 2015 From: mrjean1 at gmail.com (Jean Brouwers) Date: Thu, 19 Feb 2015 15:08:33 -0500 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: <6B9AD928-9C2E-421C-A203-F0FFE062B618@gmail.com> On Linux, this recipe will work /Jean On Feb 19, 2015, at 3:02 PM, Paul Hoffman wrote: > This could be a good shot, but I'm not sure how to use it to get the current amount of memory used by the Python program. If I do a subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of memory used for "cat", not for the enclosing program. > > --Paul Hoffman > > On Thu, Feb 19, 2015 at 9:27 AM, William Deegan wrote: > Paul, > > If you only care about linux you can parse /proc/self/status > > -Bill > > On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman wrote: > Greetings. I have a Python 3.4 program that will keep eating up memory until I tell it to stop; in short, it uses asyncio to launch as many coroutines as the machine can handle. I want to determine approximately how much memory I am using at this moment so I know when to stop consuming more and having the box run out of memory (I already have swapping turned off). > > Are there well-known patterns for this? I looked in a bunch of places and found nothing, which kinda surprised me. I recognize that it is unlikely that there is a cross-OS method for this, but I would be happy with just something that says "I'm now taking up a total of 3.7 gig" and I can do the "how much is too much" calculation by hand. > > Pointers are appreciated. > > --Paul Hoffman > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.hoffman at gmail.com Thu Feb 19 21:01:27 2015 From: paul.hoffman at gmail.com (Paul Hoffman) Date: Thu, 19 Feb 2015 12:01:27 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: I've never had good luck with psutil; seemed flaky both times I tried it. Also, I looked at the resource modules, but they don't give useful information. That is, if you watch "top -o %MEM" in one window and run Python CLI in another, then eat up a huge amount of memory with something like a=bytearray(2**32), then free the memory with a=2, you see the memory be released in "top", but resource.getrusage(resource.RUSAGE_SELF)[2] still shows the larger amount because it is showing the maximum size used, not the current. Other thoughts? --Paul Hoffman On Thu, Feb 19, 2015 at 11:24 AM, Luke Gotszling wrote: > Hi Paul, > > You can try one of these methods: > http://fa.bianp.net/blog/2013/different-ways-to-get-memory-consumption-or-lessons-learned-from-memory_profiler/ > > Also look at the resource module: > https://docs.python.org/3.4/library/resource.html > > Best, Luke > > On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman > wrote: > >> Greetings. I have a Python 3.4 program that will keep eating up memory >> until I tell it to stop; in short, it uses asyncio to launch as many >> coroutines as the machine can handle. I want to determine approximately how >> much memory I am using at this moment so I know when to stop consuming more >> and having the box run out of memory (I already have swapping turned off). >> >> Are there well-known patterns for this? I looked in a bunch of places and >> found nothing, which kinda surprised me. I recognize that it is unlikely >> that there is a cross-OS method for this, but I would be happy with just >> something that says "I'm now taking up a total of 3.7 gig" and I can do the >> "how much is too much" calculation by hand. >> >> Pointers are appreciated. >> >> --Paul Hoffman >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > > -- > > [image: --] > Luke Gotszling > [image: http://]about.me/luke > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jeffquast.com Thu Feb 19 21:05:23 2015 From: contact at jeffquast.com (Jeff Quast) Date: Thu, 19 Feb 2015 12:05:23 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: just open() it > On Feb 19, 2015, at 12:02 PM, Paul Hoffman wrote: > > This could be a good shot, but I'm not sure how to use it to get the current amount of memory used by the Python program. If I do a subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of memory used for "cat", not for the enclosing program. > > --Paul Hoffman > > On Thu, Feb 19, 2015 at 9:27 AM, William Deegan > wrote: > Paul, > > If you only care about linux you can parse /proc/self/status > > -Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From minesh at gmail.com Thu Feb 19 21:32:40 2015 From: minesh at gmail.com (Minesh Patel) Date: Thu, 19 Feb 2015 12:32:40 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: Along the same lines as Bill mentioned: proc_data = = open('/proc/%s/status' % os.getpid()).read() should work Cheers, Minesh On Thu, Feb 19, 2015 at 12:02 PM, Paul Hoffman wrote: > This could be a good shot, but I'm not sure how to use it to get the > current amount of memory used by the Python program. If I do a > subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of > memory used for "cat", not for the enclosing program. > > --Paul Hoffman > > On Thu, Feb 19, 2015 at 9:27 AM, William Deegan > wrote: > >> Paul, >> >> If you only care about linux you can parse /proc/self/status >> >> -Bill >> >> On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman >> wrote: >> >>> Greetings. I have a Python 3.4 program that will keep eating up memory >>> until I tell it to stop; in short, it uses asyncio to launch as many >>> coroutines as the machine can handle. I want to determine approximately how >>> much memory I am using at this moment so I know when to stop consuming more >>> and having the box run out of memory (I already have swapping turned off). >>> >>> Are there well-known patterns for this? I looked in a bunch of places >>> and found nothing, which kinda surprised me. I recognize that it is >>> unlikely that there is a cross-OS method for this, but I would be happy >>> with just something that says "I'm now taking up a total of 3.7 gig" and I >>> can do the "how much is too much" calculation by hand. >>> >>> Pointers are appreciated. >>> >>> --Paul Hoffman >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >>> >> >> > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -- Thanks, --Minesh -------------- next part -------------- An HTML attachment was scrubbed... URL: From phil at rentlytics.com Thu Feb 19 21:43:04 2015 From: phil at rentlytics.com (Phil Plante) Date: Thu, 19 Feb 2015 12:43:04 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: psutil (2.2.1) worked really well for me on OSX and Windows recently. You might want to give it a try, if platform compatibility is of any concern. ? On Thu, Feb 19, 2015 at 12:32 PM, Minesh Patel wrote: > Along the same lines as Bill mentioned: > > proc_data = = open('/proc/%s/status' % os.getpid()).read() > > should work > > Cheers, > Minesh > > On Thu, Feb 19, 2015 at 12:02 PM, Paul Hoffman > wrote: > >> This could be a good shot, but I'm not sure how to use it to get the >> current amount of memory used by the Python program. If I do a >> subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of >> memory used for "cat", not for the enclosing program. >> >> --Paul Hoffman >> >> On Thu, Feb 19, 2015 at 9:27 AM, William Deegan >> wrote: >> >>> Paul, >>> >>> If you only care about linux you can parse /proc/self/status >>> >>> -Bill >>> >>> On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman >>> wrote: >>> >>>> Greetings. I have a Python 3.4 program that will keep eating up memory >>>> until I tell it to stop; in short, it uses asyncio to launch as many >>>> coroutines as the machine can handle. I want to determine approximately how >>>> much memory I am using at this moment so I know when to stop consuming more >>>> and having the box run out of memory (I already have swapping turned off). >>>> >>>> Are there well-known patterns for this? I looked in a bunch of places >>>> and found nothing, which kinda surprised me. I recognize that it is >>>> unlikely that there is a cross-OS method for this, but I would be happy >>>> with just something that says "I'm now taking up a total of 3.7 gig" and I >>>> can do the "how much is too much" calculation by hand. >>>> >>>> Pointers are appreciated. >>>> >>>> --Paul Hoffman >>>> >>>> _______________________________________________ >>>> Baypiggies mailing list >>>> Baypiggies at python.org >>>> To change your subscription options or unsubscribe: >>>> https://mail.python.org/mailman/listinfo/baypiggies >>>> >>> >>> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > > -- > Thanks, > --Minesh > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.hoffman at gmail.com Thu Feb 19 21:45:02 2015 From: paul.hoffman at gmail.com (Paul Hoffman) Date: Thu, 19 Feb 2015 12:45:02 -0800 Subject: [Baypiggies] Watching how much memory my Python program is taking up In-Reply-To: References: Message-ID: Thanks, all! I think I have enough to move forwards, on a Linux box at least. As as for psutil: I'll look at that again in the future if I need to move to other OSs. --Paul Hoffman On Thu, Feb 19, 2015 at 12:32 PM, Minesh Patel wrote: > Along the same lines as Bill mentioned: > > proc_data = = open('/proc/%s/status' % os.getpid()).read() > > should work > > Cheers, > Minesh > > On Thu, Feb 19, 2015 at 12:02 PM, Paul Hoffman > wrote: > >> This could be a good shot, but I'm not sure how to use it to get the >> current amount of memory used by the Python program. If I do a >> subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of >> memory used for "cat", not for the enclosing program. >> >> --Paul Hoffman >> >> On Thu, Feb 19, 2015 at 9:27 AM, William Deegan >> wrote: >> >>> Paul, >>> >>> If you only care about linux you can parse /proc/self/status >>> >>> -Bill >>> >>> On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman >>> wrote: >>> >>>> Greetings. I have a Python 3.4 program that will keep eating up memory >>>> until I tell it to stop; in short, it uses asyncio to launch as many >>>> coroutines as the machine can handle. I want to determine approximately how >>>> much memory I am using at this moment so I know when to stop consuming more >>>> and having the box run out of memory (I already have swapping turned off). >>>> >>>> Are there well-known patterns for this? I looked in a bunch of places >>>> and found nothing, which kinda surprised me. I recognize that it is >>>> unlikely that there is a cross-OS method for this, but I would be happy >>>> with just something that says "I'm now taking up a total of 3.7 gig" and I >>>> can do the "how much is too much" calculation by hand. >>>> >>>> Pointers are appreciated. >>>> >>>> --Paul Hoffman >>>> >>>> _______________________________________________ >>>> Baypiggies mailing list >>>> Baypiggies at python.org >>>> To change your subscription options or unsubscribe: >>>> https://mail.python.org/mailman/listinfo/baypiggies >>>> >>> >>> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > > -- > Thanks, > --Minesh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjinux at gmail.com Fri Feb 20 04:36:41 2015 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 20 Feb 2015 03:36:41 +0000 Subject: [Baypiggies] Jobs: Software Engineer, Network Tools (Python) Message-ID: About this position: Twitter is looking for experienced Python Software Engineers to join our Network Engineering team. Ideal candidate has experience designing and building tools to visualize and automate processes from start to finish. Twitter's Infrastructure Operations group manages a fast-paced and constantly growing network that seeks to implement cutting-edge technology to power the systems behind one of the world's largest websites and social media platforms. Responsibilities: NMS - Help create and improve both existing and future alerting and monitoring systems - Implement tools to diagnose and correlate network problems, identify root causes, and guide remediation strategies Automation - Design and implement tools to support operational integrity of Twitter's production network infrastructure. - Take ideas and concepts from Network Operations for tools to make their jobs easier and more efficient and turn them into reality. - Design and develop tools to access, process, and visualize network data. - Work with network engineering and operations to identify potential issues, and design elegant, and efficient solutions. - Perform code reviews, evaluate implementations, and provide feedback about potential tool improvements. - Create and manage automation project schedules with the team. Process & Documentation - Build Design and Training Documentation required for each automation project. - Develop and document procedures and best practices for Network Operations infrastructure - Contribute to development and improvement of operational procedures and documentation. - Collaborate with Network Engineering team to automate various processes, build software infrastructure for network monitoring and analysis, aid in capacity planning and architecture change analysis. Requirements: - BS/MS in Computer Science and/or equivalent related experience. - 4 years professional experience in software engineering. - Proficient in Python and/or C/C++, Java. - Proficient in Unix/Linux OS concepts and tools. - Proficient with relational and non-relational databases. - Proficient with web client technologies: HTML, CSS, XML, Javascript, Django, ROR - Proficient with Web Service APIs: REST, XML, JSON - Operational knowledge of deploying, configuring and supporting network monitoring tools (Nagios, Cacti, MRTG ) - Knowledge of design and implementation of network management systems. - Knowledge of TCP/IP fundamentals, network routing protocols (OSPF, IS-IS, BGP, MPLS) and SNMP. - Familiar with Map-Reduce and Data Warehousing technologies: HBase, Hadoop, Pig - Comfortable with Revision Control Systems: Git, Subversion - Experience with solving technical problems in large scale environments. - Ability to keep complex tasks organized, and manage long term, project/milestone based work. Desired Skills - Working knowledge of multiple networking hardware vendor CLI syntax including Juniper, Cisco, Dell/Force10, A10, f5 and Citrix - Participation in open source projects. If you're interested in applying, shoot me your resume. If you're interested in other positions at Twitter, twitter.com/jobs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.n.chippa at gmail.com Sat Feb 21 00:49:19 2015 From: a.n.chippa at gmail.com (Ashok Chippa) Date: Fri, 20 Feb 2015 15:49:19 -0800 Subject: [Baypiggies] A python newbie questoin Message-ID: A newbie python question: THIS WORKS: ethernet.py: ... def test(): buf = [] #eth_gen(buf) buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ '\x07\x08\x09\x0a\x0b\x0c', 0x0800) eth = Eth() eth.unpack(buf) eth.show() root at ashok-vb:/home/achippa/ppl# python ethernet.py smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 THIS DOES NOT WORK: # Build an ethernet header into the specified buffer. # def eth_gen(buf): n = len(buf) buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ '\x07\x08\x09\x0a\x0b\x0c', 0x0800) def test(): buf = [] eth_gen(buf) eth = Eth() eth.unpack(buf) eth.show() # root at ashok-vb:/home/achippa/ppl# !py python ethernet.py Traceback (most recent call last): File "ethernet.py", line 181, in test() File "ethernet.py", line 173, in test eth.unpack(buf) File "ethernet.py", line 89, in unpack dpkt.Packet.unpack(self, buf) File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, in unpack struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): struct.error: unpack requires a string argument of length 14 I have verified (by printing) that calcsize(self.__hdr_fmt__) and self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. Putting the struct.pack(..) in a function (eth_gen()) causes the error... Any idea what may be happening... Thanks a lot -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Sat Feb 21 00:54:28 2015 From: aleax at google.com (Alex Martelli) Date: Fri, 20 Feb 2015 15:54:28 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: struct.pack returns *a string* and struct.unpack accepts *a string*. buf is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf only has one item -- the string in question). No idea of how it can work in the case you say it works:-). Alex On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa wrote: > A newbie python question: > > THIS WORKS: > > ethernet.py: > > ... > def test(): > buf = [] > #eth_gen(buf) > buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ > '\x07\x08\x09\x0a\x0b\x0c', 0x0800) > eth = Eth() > eth.unpack(buf) > eth.show() > > root at ashok-vb:/home/achippa/ppl# python ethernet.py > smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 > > > THIS DOES NOT WORK: > > # Build an ethernet header into the specified buffer. > # > def eth_gen(buf): > n = len(buf) > buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ > '\x07\x08\x09\x0a\x0b\x0c', 0x0800) > def test(): > buf = [] > eth_gen(buf) > eth = Eth() > eth.unpack(buf) > eth.show() > # > > root at ashok-vb:/home/achippa/ppl# !py > python ethernet.py > Traceback (most recent call last): > File "ethernet.py", line 181, in > test() > File "ethernet.py", line 173, in test > eth.unpack(buf) > File "ethernet.py", line 89, in unpack > dpkt.Packet.unpack(self, buf) > File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, in > unpack > struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): > struct.error: unpack requires a string argument of length 14 > > I have verified (by printing) that calcsize(self.__hdr_fmt__) and > self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. > Putting the struct.pack(..) in a function (eth_gen()) causes the error... > > Any idea what may be happening... Thanks a lot > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jeffquast.com Sat Feb 21 00:58:43 2015 From: contact at jeffquast.com (Jeff Quast) Date: Fri, 20 Feb 2015 15:58:43 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: <78D71DDF-01B3-4AB6-AC4F-C0A820090125@jeffquast.com> using statement: buf[idx:] = value as you do, iterates over ?value?, creating an array of [?v?,?a?,?l?,?u?,?e?]. In [0]: def example(buf): ...: buf[len(buf):] = 'world' ...: In [1]: buf = ['hello'] In [2]: example(buf) In [3]: ','.join(buf) Out[3]: 'hello,w,o,r,l,d' I would suggest not passing variables to be modified in-place, but to return new values, and use buf.append, extend, or a re-assignment buf = ?{0}{1}?.format(buf, another_val), etc. At least I suspect that?s your problem, it is hard to see without the missing code. > On Feb 20, 2015, at 3:54 PM, Alex Martelli wrote: > > struct.pack returns *a string* and struct.unpack accepts *a string*. buf is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf only has one item -- the string in question). No idea of how it can work in the case you say it works:-). > > Alex > > On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa > wrote: > A newbie python question: > > THIS WORKS: > > ethernet.py: > > ... > def test(): > buf = [] > #eth_gen(buf) > buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ > '\x07\x08\x09\x0a\x0b\x0c', 0x0800) > eth = Eth() > eth.unpack(buf) > eth.show() > > root at ashok-vb:/home/achippa/ppl# python ethernet.py > smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 > > > THIS DOES NOT WORK: > > # Build an ethernet header into the specified buffer. > # > def eth_gen(buf): > n = len(buf) > buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ > '\x07\x08\x09\x0a\x0b\x0c', 0x0800) > def test(): > buf = [] > eth_gen(buf) > eth = Eth() > eth.unpack(buf) > eth.show() > # > > root at ashok-vb:/home/achippa/ppl# !py > python ethernet.py > Traceback (most recent call last): > File "ethernet.py", line 181, in > test() > File "ethernet.py", line 173, in test > eth.unpack(buf) > File "ethernet.py", line 89, in unpack > dpkt.Packet.unpack(self, buf) > File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, in unpack > struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): > struct.error: unpack requires a string argument of length 14 > > I have verified (by printing) that calcsize(self.__hdr_fmt__) and self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. Putting the struct.pack(..) in a function (eth_gen()) causes the error... > > Any idea what may be happening... Thanks a lot > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From bitsink at gmail.com Sat Feb 21 01:02:09 2015 From: bitsink at gmail.com (Nam Nguyen) Date: Fri, 20 Feb 2015 16:02:09 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: In the case that works, he assigned a new value to "buf" variable, not an element in the list. Nam On Feb 20, 2015 3:55 PM, "Alex Martelli" wrote: > struct.pack returns *a string* and struct.unpack accepts *a string*. buf > is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf only > has one item -- the string in question). No idea of how it can work in the > case you say it works:-). > > Alex > > On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa > wrote: > >> A newbie python question: >> >> THIS WORKS: >> >> ethernet.py: >> >> ... >> def test(): >> buf = [] >> #eth_gen(buf) >> buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >> eth = Eth() >> eth.unpack(buf) >> eth.show() >> >> root at ashok-vb:/home/achippa/ppl# python ethernet.py >> smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 >> >> >> THIS DOES NOT WORK: >> >> # Build an ethernet header into the specified buffer. >> # >> def eth_gen(buf): >> n = len(buf) >> buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >> def test(): >> buf = [] >> eth_gen(buf) >> eth = Eth() >> eth.unpack(buf) >> eth.show() >> # >> >> root at ashok-vb:/home/achippa/ppl# !py >> python ethernet.py >> Traceback (most recent call last): >> File "ethernet.py", line 181, in >> test() >> File "ethernet.py", line 173, in test >> eth.unpack(buf) >> File "ethernet.py", line 89, in unpack >> dpkt.Packet.unpack(self, buf) >> File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, >> in unpack >> struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): >> struct.error: unpack requires a string argument of length 14 >> >> I have verified (by printing) that calcsize(self.__hdr_fmt__) and >> self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. >> Putting the struct.pack(..) in a function (eth_gen()) causes the error... >> >> Any idea what may be happening... Thanks a lot >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.n.chippa at gmail.com Sat Feb 21 01:09:49 2015 From: a.n.chippa at gmail.com (Ashok Chippa) Date: Fri, 20 Feb 2015 16:09:49 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: Thank you Alex, Jeff and Nam. Just after sending the question, I suspected it may be the type instead of length... Thank you for your answers, I think I have enough to fix it now... :-) Thanks a lot, On Fri, Feb 20, 2015 at 3:54 PM, Alex Martelli wrote: > struct.pack returns *a string* and struct.unpack accepts *a string*. buf > is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf only > has one item -- the string in question). No idea of how it can work in the > case you say it works:-). > > Alex > > On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa > wrote: > >> A newbie python question: >> >> THIS WORKS: >> >> ethernet.py: >> >> ... >> def test(): >> buf = [] >> #eth_gen(buf) >> buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >> eth = Eth() >> eth.unpack(buf) >> eth.show() >> >> root at ashok-vb:/home/achippa/ppl# python ethernet.py >> smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 >> >> >> THIS DOES NOT WORK: >> >> # Build an ethernet header into the specified buffer. >> # >> def eth_gen(buf): >> n = len(buf) >> buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >> def test(): >> buf = [] >> eth_gen(buf) >> eth = Eth() >> eth.unpack(buf) >> eth.show() >> # >> >> root at ashok-vb:/home/achippa/ppl# !py >> python ethernet.py >> Traceback (most recent call last): >> File "ethernet.py", line 181, in >> test() >> File "ethernet.py", line 173, in test >> eth.unpack(buf) >> File "ethernet.py", line 89, in unpack >> dpkt.Packet.unpack(self, buf) >> File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, >> in unpack >> struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): >> struct.error: unpack requires a string argument of length 14 >> >> I have verified (by printing) that calcsize(self.__hdr_fmt__) and >> self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. >> Putting the struct.pack(..) in a function (eth_gen()) causes the error... >> >> Any idea what may be happening... Thanks a lot >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> https://mail.python.org/mailman/listinfo/baypiggies >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.n.chippa at gmail.com Sat Feb 21 07:04:25 2015 From: a.n.chippa at gmail.com (Ashok Chippa) Date: Fri, 20 Feb 2015 22:04:25 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: Thought I fixed it :( But seeing this new one: root at ashok-vb:/home/achippa/ppl# vi ethernet.py root at ashok-vb:/home/achippa/ppl# !py python test.py Traceback (most recent call last): File "test.py", line 23, in test() File "test.py", line 14, in test eth.gen(buf) File "/home/achippa/ppl/ethernet.py", line 123, in gen 0x0800) TypeError: 'str' object does not support item assignment root at ashok-vb:/home/achippa/ppl# !vi ethernet.py: ... def gen(self, buf): buf[len(buf):] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ <<<<<<======== line 123 '\x07\x08\x09\x0a\x0b\x0c', 0x0800) ... struct.pack() returns a string, right?!!!! Why does it complain about the assignment? On Fri, Feb 20, 2015 at 4:09 PM, Ashok Chippa wrote: > Thank you Alex, Jeff and Nam. Just after sending the question, I suspected > it may be the type instead of length... Thank you for your answers, I think > I have enough to fix it now... :-) > > Thanks a lot, > > On Fri, Feb 20, 2015 at 3:54 PM, Alex Martelli wrote: > >> struct.pack returns *a string* and struct.unpack accepts *a string*. buf >> is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf only >> has one item -- the string in question). No idea of how it can work in the >> case you say it works:-). >> >> Alex >> >> On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa >> wrote: >> >>> A newbie python question: >>> >>> THIS WORKS: >>> >>> ethernet.py: >>> >>> ... >>> def test(): >>> buf = [] >>> #eth_gen(buf) >>> buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >>> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >>> eth = Eth() >>> eth.unpack(buf) >>> eth.show() >>> >>> root at ashok-vb:/home/achippa/ppl# python ethernet.py >>> smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 >>> >>> >>> THIS DOES NOT WORK: >>> >>> # Build an ethernet header into the specified buffer. >>> # >>> def eth_gen(buf): >>> n = len(buf) >>> buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >>> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >>> def test(): >>> buf = [] >>> eth_gen(buf) >>> eth = Eth() >>> eth.unpack(buf) >>> eth.show() >>> # >>> >>> root at ashok-vb:/home/achippa/ppl# !py >>> python ethernet.py >>> Traceback (most recent call last): >>> File "ethernet.py", line 181, in >>> test() >>> File "ethernet.py", line 173, in test >>> eth.unpack(buf) >>> File "ethernet.py", line 89, in unpack >>> dpkt.Packet.unpack(self, buf) >>> File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, >>> in unpack >>> struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): >>> struct.error: unpack requires a string argument of length 14 >>> >>> I have verified (by printing) that calcsize(self.__hdr_fmt__) and >>> self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. >>> Putting the struct.pack(..) in a function (eth_gen()) causes the error... >>> >>> Any idea what may be happening... Thanks a lot >>> >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.n.chippa at gmail.com Sat Feb 21 07:04:45 2015 From: a.n.chippa at gmail.com (Ashok Chippa) Date: Fri, 20 Feb 2015 22:04:45 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: Thanks for your help. On Fri, Feb 20, 2015 at 10:04 PM, Ashok Chippa wrote: > Thought I fixed it :( But seeing this new one: > > root at ashok-vb:/home/achippa/ppl# vi ethernet.py > root at ashok-vb:/home/achippa/ppl# !py > python test.py > Traceback (most recent call last): > File "test.py", line 23, in > test() > File "test.py", line 14, in test > eth.gen(buf) > File "/home/achippa/ppl/ethernet.py", line 123, in gen > 0x0800) > TypeError: 'str' object does not support item assignment > root at ashok-vb:/home/achippa/ppl# !vi > > > ethernet.py: > ... > def gen(self, buf): > buf[len(buf):] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', > \ <<<<<<======== line 123 > > '\x07\x08\x09\x0a\x0b\x0c', 0x0800) > ... > struct.pack() returns a string, right?!!!! Why does it complain about the > assignment? > > > > On Fri, Feb 20, 2015 at 4:09 PM, Ashok Chippa > wrote: > >> Thank you Alex, Jeff and Nam. Just after sending the question, I >> suspected it may be the type instead of length... Thank you for your >> answers, I think I have enough to fix it now... :-) >> >> Thanks a lot, >> >> On Fri, Feb 20, 2015 at 3:54 PM, Alex Martelli wrote: >> >>> struct.pack returns *a string* and struct.unpack accepts *a string*. >>> buf is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf >>> only has one item -- the string in question). No idea of how it can work >>> in the case you say it works:-). >>> >>> Alex >>> >>> On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa >>> wrote: >>> >>>> A newbie python question: >>>> >>>> THIS WORKS: >>>> >>>> ethernet.py: >>>> >>>> ... >>>> def test(): >>>> buf = [] >>>> #eth_gen(buf) >>>> buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >>>> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >>>> eth = Eth() >>>> eth.unpack(buf) >>>> eth.show() >>>> >>>> root at ashok-vb:/home/achippa/ppl# python ethernet.py >>>> smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 >>>> >>>> >>>> THIS DOES NOT WORK: >>>> >>>> # Build an ethernet header into the specified buffer. >>>> # >>>> def eth_gen(buf): >>>> n = len(buf) >>>> buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >>>> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >>>> def test(): >>>> buf = [] >>>> eth_gen(buf) >>>> eth = Eth() >>>> eth.unpack(buf) >>>> eth.show() >>>> # >>>> >>>> root at ashok-vb:/home/achippa/ppl# !py >>>> python ethernet.py >>>> Traceback (most recent call last): >>>> File "ethernet.py", line 181, in >>>> test() >>>> File "ethernet.py", line 173, in test >>>> eth.unpack(buf) >>>> File "ethernet.py", line 89, in unpack >>>> dpkt.Packet.unpack(self, buf) >>>> File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, >>>> in unpack >>>> struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): >>>> struct.error: unpack requires a string argument of length 14 >>>> >>>> I have verified (by printing) that calcsize(self.__hdr_fmt__) and >>>> self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. >>>> Putting the struct.pack(..) in a function (eth_gen()) causes the error... >>>> >>>> Any idea what may be happening... Thanks a lot >>>> >>>> _______________________________________________ >>>> Baypiggies mailing list >>>> Baypiggies at python.org >>>> To change your subscription options or unsubscribe: >>>> https://mail.python.org/mailman/listinfo/baypiggies >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Sat Feb 21 07:06:17 2015 From: aleax at google.com (Alex Martelli) Date: Fri, 20 Feb 2015 22:06:17 -0800 Subject: [Baypiggies] A python newbie questoin In-Reply-To: References: Message-ID: Strings in Python are immutable (just like in Java & many other modern languages). Alex On Fri, Feb 20, 2015 at 10:04 PM, Ashok Chippa wrote: > Thought I fixed it :( But seeing this new one: > > root at ashok-vb:/home/achippa/ppl# vi ethernet.py > root at ashok-vb:/home/achippa/ppl# !py > python test.py > Traceback (most recent call last): > File "test.py", line 23, in > test() > File "test.py", line 14, in test > eth.gen(buf) > File "/home/achippa/ppl/ethernet.py", line 123, in gen > 0x0800) > TypeError: 'str' object does not support item assignment > root at ashok-vb:/home/achippa/ppl# !vi > > > ethernet.py: > ... > def gen(self, buf): > buf[len(buf):] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', > \ <<<<<<======== line 123 > > '\x07\x08\x09\x0a\x0b\x0c', 0x0800) > ... > struct.pack() returns a string, right?!!!! Why does it complain about the > assignment? > > > > On Fri, Feb 20, 2015 at 4:09 PM, Ashok Chippa > wrote: > >> Thank you Alex, Jeff and Nam. Just after sending the question, I >> suspected it may be the type instead of length... Thank you for your >> answers, I think I have enough to fix it now... :-) >> >> Thanks a lot, >> >> On Fri, Feb 20, 2015 at 3:54 PM, Alex Martelli wrote: >> >>> struct.pack returns *a string* and struct.unpack accepts *a string*. >>> buf is *a list*, not a string. struct.unpack[buf[-1]] (or buf[0] as buf >>> only has one item -- the string in question). No idea of how it can work >>> in the case you say it works:-). >>> >>> Alex >>> >>> On Fri, Feb 20, 2015 at 3:49 PM, Ashok Chippa >>> wrote: >>> >>>> A newbie python question: >>>> >>>> THIS WORKS: >>>> >>>> ethernet.py: >>>> >>>> ... >>>> def test(): >>>> buf = [] >>>> #eth_gen(buf) >>>> buf = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >>>> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >>>> eth = Eth() >>>> eth.unpack(buf) >>>> eth.show() >>>> >>>> root at ashok-vb:/home/achippa/ppl# python ethernet.py >>>> smac = 07:08:09:0a:0b:0c dmac = 01:02:03:04:05:06 type = 0800 >>>> >>>> >>>> THIS DOES NOT WORK: >>>> >>>> # Build an ethernet header into the specified buffer. >>>> # >>>> def eth_gen(buf): >>>> n = len(buf) >>>> buf[n:] = struct.pack('!6s6sH', '\x01\x02\x03\x04\x05\x06', \ >>>> '\x07\x08\x09\x0a\x0b\x0c', 0x0800) >>>> def test(): >>>> buf = [] >>>> eth_gen(buf) >>>> eth = Eth() >>>> eth.unpack(buf) >>>> eth.show() >>>> # >>>> >>>> root at ashok-vb:/home/achippa/ppl# !py >>>> python ethernet.py >>>> Traceback (most recent call last): >>>> File "ethernet.py", line 181, in >>>> test() >>>> File "ethernet.py", line 173, in test >>>> eth.unpack(buf) >>>> File "ethernet.py", line 89, in unpack >>>> dpkt.Packet.unpack(self, buf) >>>> File "/usr/local/lib/python2.7/dist-packages/dpkt/dpkt.py", line 127, >>>> in unpack >>>> struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): >>>> struct.error: unpack requires a string argument of length 14 >>>> >>>> I have verified (by printing) that calcsize(self.__hdr_fmt__) and >>>> self.__hdr_len__ are both 14. The buf has only 14 bytes of ethernet header. >>>> Putting the struct.pack(..) in a function (eth_gen()) causes the error... >>>> >>>> Any idea what may be happening... Thanks a lot >>>> >>>> _______________________________________________ >>>> Baypiggies mailing list >>>> Baypiggies at python.org >>>> To change your subscription options or unsubscribe: >>>> https://mail.python.org/mailman/listinfo/baypiggies >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Sat Feb 21 23:10:55 2015 From: aahz at pythoncraft.com (Aahz) Date: Sat, 21 Feb 2015 14:10:55 -0800 Subject: [Baypiggies] FWD: Programming Myths are the Root of all Evil Message-ID: <20150221221055.GA16983@panix.com> Harmful GOTOs, Premature Optimizations, and Programming Myths are the Root of all Evil http://videlalvaro.github.io/2015/02/programming-myths.html A fairly good rant about using adages unthinkingly, with some interesting historical context. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Need a book? Use your library! From guido at python.org Sun Feb 22 01:20:34 2015 From: guido at python.org (Guido van Rossum) Date: Sat, 21 Feb 2015 16:20:34 -0800 Subject: [Baypiggies] FWD: Programming Myths are the Root of all Evil In-Reply-To: <20150221221055.GA16983@panix.com> References: <20150221221055.GA16983@panix.com> Message-ID: Nice historic overview -- I learned programming in 1974, which means big O wasn't even around... And in the end the moral seems to be that Readability Counts. :-) On Feb 21, 2015 12:11 PM, "Aahz" wrote: > Harmful GOTOs, Premature Optimizations, and Programming Myths are the > Root of all Evil > > http://videlalvaro.github.io/2015/02/programming-myths.html > > A fairly good rant about using adages unthinkingly, with some interesting > historical context. > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > Need a book? Use your library! > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at bot4.us Mon Feb 23 20:35:37 2015 From: dan at bot4.us (Dan Bikle) Date: Mon, 23 Feb 2015 19:35:37 +0000 Subject: [Baypiggies] Dan's Python 101 Sunday Class 2015-03-01 1pm Meetup Message-ID: Python People, The idea behind this class is to teach enough Python to Machine Learning students so they can learn enough NumPy and Pandas to then learn scikit-learn. I invite you to attend. RSVP via Meetup: http://www.meetup.com/Palo-Alto-Data-Science-Association/events/220701369/ Cost: $0.00 Dan From peter at farrellpolymath.com Tue Feb 24 16:03:02 2015 From: peter at farrellpolymath.com (Peter Farrell) Date: Tue, 24 Feb 2015 07:03:02 -0800 Subject: [Baypiggies] Algebra Using Python Meetup 2/28 Message-ID: Just a reminder I'm going to hold a short intro to learning Algebra using Python on Saturday in Burlingame. http://www.meetup.com/SF-Peninsula-Learning-through-Computer-Programming/events/220624076/ Bring your laptop and a math student or two! Thanks, Peter Farrell -------------- next part -------------- An HTML attachment was scrubbed... URL: From aahz at pythoncraft.com Tue Feb 24 17:47:05 2015 From: aahz at pythoncraft.com (Aahz) Date: Tue, 24 Feb 2015 08:47:05 -0800 Subject: [Baypiggies] Explore Algebra Using Python In-Reply-To: References: Message-ID: <20150224164705.GA28994@panix.com> On Thu, Feb 19, 2015, Peter Farrell wrote: > > I'm holding a free Meetup in Burlingame where I'll present some simple > Python programs I've put together to help math students (and former math > students) explore Algebra topics like solving equations and graphing > functions. > > More info on the Meetup site > It's not clear, are you looking for tutor/mentor helpers or what? Also, you should follow Dan Bikle's example and include date/time info in the Subject: line. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Need a book? Use your library! From aahz at pythoncraft.com Tue Feb 24 17:48:26 2015 From: aahz at pythoncraft.com (Aahz) Date: Tue, 24 Feb 2015 08:48:26 -0800 Subject: [Baypiggies] Dan's Python 101 Sunday Class 2015-03-01 1pm Meetup In-Reply-To: References: Message-ID: <20150224164826.GB28994@panix.com> On Mon, Feb 23, 2015, Dan Bikle wrote: > > The idea behind this class is to teach enough Python to Machine > Learning students so they can learn enough NumPy and Pandas to then > learn scikit-learn. > > I invite you to attend. > > RSVP via Meetup: > http://www.meetup.com/Palo-Alto-Data-Science-Association/events/220701369/ Are you looking for tutor/mentor helpers or what? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Need a book? Use your library! From dan at bot4.us Tue Feb 24 20:07:40 2015 From: dan at bot4.us (Dan Bikle) Date: Tue, 24 Feb 2015 19:07:40 +0000 Subject: [Baypiggies] Dan's Python 101 Sunday Class 2015-03-01 1pm Meetup In-Reply-To: <20150224164826.GB28994@panix.com> References: <20150224164826.GB28994@panix.com> Message-ID: I am looking for students. I welcome all skill levels. On 2/24/15, Aahz wrote: > On Mon, Feb 23, 2015, Dan Bikle wrote: >> >> The idea behind this class is to teach enough Python to Machine >> Learning students so they can learn enough NumPy and Pandas to then >> learn scikit-learn. >> >> I invite you to attend. >> >> RSVP via Meetup: >> http://www.meetup.com/Palo-Alto-Data-Science-Association/events/220701369/ > > Are you looking for tutor/mentor helpers or what? > -- > Aahz (aahz at pythoncraft.com) <*> > http://www.pythoncraft.com/ > > Need a book? Use your library! > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -- Some traders make their own luck. We use a robot. http://www.bot4.us