From gslindstrom at gmail.com Wed Nov 2 21:14:59 2011 From: gslindstrom at gmail.com (Greg Lindstrom) Date: Wed, 2 Nov 2011 15:14:59 -0500 Subject: [PyAR2] Car Talk Puzzler (The Hall of Lights) Message-ID: The Car Talk "Puzzler" this week is a classic (I've heard it opening/closing lockers): *RAY:* This puzzler is from my "ceiling light" series. Imagine, if you will, that you have a long, long corridor that stretches out as far as the eye can see. In that corridor, attached to the ceiling are lights that are operated with a pull cord. There are gazillions of them, as far as the eye can see. Let's say there are 20,000 lights in a row. They're all off. Somebody comes along and pulls on each of the chains, turning on each one of the lights. Another person comes right behind, and pulls the chain on every second light. *TOM:* Thereby turning off lights 2, 4, 6, 8 and so on. *RAY:* Right. Now, a third person comes along and pulls the cord on every third light. That is, lights number 3, 6, 9, 12, 15, etcetera. Another person comes along and pulls the cord on lights number 4, 8, 12, 16 and so on. Of course, each person is turning on some lights and turning other lights off. If there are 20,000 lights, at some point someone is going to come skipping along and pull every 20,000th chain. When that happens, some lights will be on, and some will be off. Can you predict which lights will be on? I wrote a Python program to "solve" this is 8 (non-blank) lines long, including one line, "MAX_LIGHTS = 20000" used to adjust the number of lights for debugging/testing. Let's see how YOU would do it (I'll post mine in a couple days). O'Reilly accidentally sent me an "extra" case of books to give away at PyArkansas (the arrived after the conference). If Marsee will let me give them away, the entry judged "best" will win one of the titles. "Best" is totally subjective but will include (1) Correct Solution and (2) Elegance (is it Pythonic/Understandable?). Python 2 or 3. --greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From waynejwerner at gmail.com Thu Nov 3 19:33:42 2011 From: waynejwerner at gmail.com (Wayne Werner) Date: Thu, 3 Nov 2011 13:33:42 -0500 Subject: [PyAR2] Car Talk Puzzler (The Hall of Lights) In-Reply-To: References: Message-ID: On Wed, Nov 2, 2011 at 3:14 PM, Greg Lindstrom wrote: > > I wrote a Python program to "solve" this is 8 (non-blank) lines long, > including one line, "MAX_LIGHTS = 20000" used to adjust the number of > lights for debugging/testing. Let's see how YOU would do it (I'll post > mine in a couple days). > Using MAXLIGHTS, I've got in 6 lines - one of those is to actually display the output. After searching to confirm my answers were correct, I also came up with an extremely short one-liner - You'd have to use two lines in Python 2, though. -Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: From ccn at panix.com Thu Nov 3 19:17:25 2011 From: ccn at panix.com (Chris Nestrud) Date: Thu, 3 Nov 2011 14:17:25 -0400 Subject: [PyAR2] Car Talk Puzzler (The Hall of Lights) In-Reply-To: References: Message-ID: Here's the method that I used to initially solve the problem. #Begin from collections import defaultdict max_lights = 20000 lights=defaultdict(bool) # defaults to False for i in xrange(1,max_lights+1,1): for j in xrange(i,max_lights+1,i): lights[j] = not lights[j] print("Lights on: %s" % (', '.join((str(l) for l in xrange(1,max_lights+1,1) if lights[l])))) #End Here's the method after realizing the pattern. #Begin from math import sqrt max_lights = 20000 print("Lights on: %s" % (', '.join((str(l*l) for l in xrange(1,int(sqrt(max_lights)+1),1))))) #End I'm going for minimum number of lines rather than "Readability counts." Chris Greg Lindstrom wrote: > The Car Talk "Puzzler" this week is a classic (I've heard it > opening/closing lockers): > > *RAY:* This puzzler is from my "ceiling light" series. Imagine, if you > will, that you have a long, long corridor that stretches out as far as the > eye can see. In that corridor, attached to the ceiling are lights that are > operated with a pull cord. > > There are gazillions of them, as far as the eye can see. Let's say there > are 20,000 lights in a row. > > They're all off. Somebody comes along and pulls on each of the chains, > turning on each one of the lights. Another person comes right behind, and > pulls the chain on every second light. > > *TOM:* Thereby turning off lights 2, 4, 6, 8 and so on. > > *RAY:* Right. Now, a third person comes along and pulls the cord on every > third light. That is, lights number 3, 6, 9, 12, 15, etcetera. Another > person comes along and pulls the cord on lights number 4, 8, 12, 16 and so > on. Of course, each person is turning on some lights and turning other > lights off. > > If there are 20,000 lights, at some point someone is going to come > skipping > along and pull every 20,000th chain. > > When that happens, some lights will be on, and some will be off. Can you > predict which lights will be on? > > I wrote a Python program to "solve" this is 8 (non-blank) lines long, > including one line, "MAX_LIGHTS = 20000" used to adjust the number of > lights for debugging/testing. Let's see how YOU would do it (I'll post > mine in a couple days). > > O'Reilly accidentally sent me an "extra" case of books to give away at > PyArkansas (the arrived after the conference). If Marsee will let me give > them away, the entry judged "best" will win one of the titles. "Best" is > totally subjective but will include (1) Correct Solution and (2) Elegance > (is it Pythonic/Understandable?). Python 2 or 3. > > --greg > _______________________________________________ > PyAR2 mailing list > PyAR2 at python.org > http://mail.python.org/mailman/listinfo/pyar2 > From waynejwerner at gmail.com Thu Nov 3 19:43:02 2011 From: waynejwerner at gmail.com (Wayne Werner) Date: Thu, 3 Nov 2011 13:43:02 -0500 Subject: [PyAR2] Car Talk Puzzler (The Hall of Lights) In-Reply-To: References: Message-ID: On Thu, Nov 3, 2011 at 1:17 PM, Chris Nestrud wrote: > #Begin > from math import sqrt > max_lights = 20000 > print("Lights on: %s" % (', '.join((str(l*l) for l in > xrange(1,int(sqrt(max_lights)+1),1))))) > #End > > You can actually do this one (or two lines...) better: print("Lights on: %s" % (', '.join((str(i) for i in range(1, 20001) if i**.5%1==0.0)))) Or if you're really going for terse: [print(i) for i in range(1,20001) if i**.5%1==0.0] -Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: From gslindstrom at gmail.com Wed Nov 9 13:47:37 2011 From: gslindstrom at gmail.com (Greg Lindstrom) Date: Wed, 9 Nov 2011 06:47:37 -0600 Subject: [PyAR2] Fwd: UG News: Data Science Starter Kit - The Tools You Need to Get Started with Data In-Reply-To: <1320829222.8235.0.085193@post.oreilly.com> References: <1320829222.8235.0.085193@post.oreilly.com> Message-ID: This is from our friends at O'Reilly Publishing. They always support pyArkansas, so give them a look, please. --greg ---------- Forwarded message ---------- From: Marsee Henon & Jon Johns Date: Wed, Nov 9, 2011 at 3:00 AM Subject: UG News: Data Science Starter Kit - The Tools You Need to Get Started with Data To: gslindstrom at gmail.com ** View in browser . *Forward this announcement to your user group or a friend* [image: O'Reilly Books and Videos] [image: Strata: Making Data Work] Data Science Starter Kit The Tools You Need to Get Started with Data This kit includes everything you need *from analysis, visualization, to management.* *"The success of companies like Google, Facebook, Amazon, and Netflix, not to mention Wall Street firms and industries from manufacturing and retail to healthcare, is increasingly driven by better tools for extracting meaning from very large quantities of data. 'Data Scientist' is now the hottest job title in Silicon Valley."* ? Tim O'Reilly Buy any two titles and get the 3rd Free. Or, buy them allfor just *$99*, a $128 savings. [image: Add Starter Kit to Cart] ------------------------------ [image: Data Analysis with Open Source Tools] *Data Analysis with Open Source Tools*: A survey of data analysis from a practitioner ? from histograms to machine learning, this book presents the tools you need to make sense with data. You'll learn how to look at data to discover what it contains, how to capture those ideas in conceptual models, and then feed your understanding back into the organization through business plans, metrics dashboards, and other applications. Ebook: $31.99 [image: Add to Cart] ------------------------------ [image: Think Stats] *Think Stats*: An introduction to statistics for the Python programmer. Think Stats focuses on programming to produce results that turn data into knowledge, not on mathematics and proofs. Ebook: $16.99 [image: Add to Cart] ------------------------------ [image: Designing Data Visualizations] *Designing Data Visualizations*: Telling stories is the missing part of much data analysis. This book teaches how to create visualizations that communicate effectively with your audience. Ebook: $12.99 [image: Add to Cart] ------------------------------ [image: R Cookbook] *R Cookbook*: Over 200 recipes for R users, ranging from the basic to the esoteric. Why re-invent the wheel? This collection of concise, task-oriented recipes makes you productive with R immediately, with solutions ranging from basic tasks to input and output, general statistics, graphics, and linear regression. Ebook: $31.99 [image: Add to Cart] ------------------------------ [image: An Introduction to Machine Learning with Web Data] *An Introduction to Machine Learning with Web Data*: bit.ly lead scientist Hilary Mason shows you how to solve data analysis problems using basic machine learning techniques and frameworks. Ebook: $29.99 [image: Add to Cart] ------------------------------ [image: R in a Nutshell] *R in a Nutshell*: The authoritative guide to what's become the de-facto standard for statistical programming. R in a Nutshell provides a quick and practical way to learn this increasingly popular open source language and environment. Ebook: $35.99 [image: Add to Cart] ------------------------------ [image: Beautiful Data] *Beautiful Data*: In this insightful book, you'll learn from the best data practitioners in the field just how wide-ranging ? and beautiful ? working with data can be. Join 39 contributors as they explain how they developed simple and elegant solutions on projects ranging from the Mars lander to a Radiohead video. Ebook: $35.99 [image: Add to Cart] ------------------------------ [image: Programming Collective Intelligence] *Programming Collective Intelligence*: Takes you into the world of machine learning and statistics, and explains how to draw conclusions about user experience, marketing, personal tastes, and human behavior in general ? all from information that you and others collect every day. Each algorithm is described clearly and concisely with code that can immediately be used on your web site, blog, Wiki, or specialized application. Ebook: $31.99 [image: Add to Cart] [image: oreilly.com] You are receiving this email because you are a User Group contact with O'Reilly Media. Forward this announcement. If you would like to stop receiving these newsletters or announcements from O'Reilly, send an email to *usergroups at oreilly.com* . O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (707) 827-7000 -------------- next part -------------- An HTML attachment was scrubbed... URL: From supercooper at gmail.com Thu Nov 10 15:37:02 2011 From: supercooper at gmail.com (Chad Cooper) Date: Thu, 10 Nov 2011 08:37:02 -0600 Subject: [PyAR2] wxPython book suggestions Message-ID: Hey folks, I'm looking for a wxPython book, and it looks like there aren't a whole lotta choices out there...anyone have any info on either of these titles? wxPython 2.8 Application Development CookbookwxPython in Action Any other learning wxPython resources appreciated as well. Thanks chad -------------- next part -------------- An HTML attachment was scrubbed... URL: From gslindstrom at gmail.com Thu Nov 10 15:48:43 2011 From: gslindstrom at gmail.com (Greg Lindstrom) Date: Thu, 10 Nov 2011 08:48:43 -0600 Subject: [PyAR2] wxPython book suggestions In-Reply-To: References: Message-ID: I have the wxPython in Action Book by Manning. It has lots of code examples but, if memory serves, quite a few typos. It may be out of date as well, as I got it years ago ((C) 2006, unless it has been updated). I really like the Manning series, though. --greg On Thu, Nov 10, 2011 at 8:37 AM, Chad Cooper wrote: > Hey folks, I'm looking for a wxPython book, and it looks like there aren't > a whole lotta choices out there...anyone have any info on either of these > titles? > wxPython 2.8 Application Development Cookbook wxPython > in Action > > Any other learning wxPython resources appreciated as well. > > Thanks > > chad > > _______________________________________________ > PyAR2 mailing list > PyAR2 at python.org > http://mail.python.org/mailman/listinfo/pyar2 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rob at robnet.com Fri Nov 11 05:13:12 2011 From: rob at robnet.com (Rob Nichols) Date: Thu, 10 Nov 2011 22:13:12 -0600 Subject: [PyAR2] wxPython book suggestions In-Reply-To: References: Message-ID: <1108746E36E44093BB4F76764EADD306@robnet.com> I have a "lightly read" copy of the Manning book (? 2006, first printing) I would be happy to loan you. I'm in Little Rock. Email privately if you are interested to arrange convayence. On Thursday, November 10, 2011 at 8:48 AM, Greg Lindstrom wrote: > I have the wxPython in Action Book by Manning. It has lots of code examples but, if memory serves, quite a few typos. It may be out of date as well, as I got it years ago ((C) 2006, unless it has been updated). I really like the Manning series, though. > > --greg > > > On Thu, Nov 10, 2011 at 8:37 AM, Chad Cooper wrote: > > Hey folks, I'm looking for a wxPython book, and it looks like there aren't a whole lotta choices out there...anyone have any info on either of these titles? > > wxPython 2.8 Application Development Cookbook (http://www.amazon.com/wxPython-2-8-Application-Development-Cookbook/dp/1849511780/ref=sr_1_1?s=books&ie=UTF8&qid=1320935461&sr=1-1) wxPython in Action (http://www.amazon.com/Wxpython-Action-Noel-Rappin/dp/1932394621/ref=sr_1_2?s=books&ie=UTF8&qid=1320935461&sr=1-2) > > > > Any other learning wxPython resources appreciated as well. > > > > Thanks > > > > chad > > > > _______________________________________________ > > PyAR2 mailing list > > PyAR2 at python.org (mailto:PyAR2 at python.org) > > http://mail.python.org/mailman/listinfo/pyar2 > > > > _______________________________________________ > PyAR2 mailing list > PyAR2 at python.org (mailto:PyAR2 at python.org) > http://mail.python.org/mailman/listinfo/pyar2 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From supercooper at gmail.com Sat Nov 12 15:53:48 2011 From: supercooper at gmail.com (Chad Cooper) Date: Sat, 12 Nov 2011 08:53:48 -0600 Subject: [PyAR2] Fwd: [Texas] LOOKING TO HIRE PYTHON PROS In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Katie Hayes Date: Fri, Nov 11, 2011 at 3:33 PM Subject: [Texas] LOOKING TO HIRE PYTHON PROS To: texas at python.org Hi Everyone!!! My name is Katie and I recently subscribed to this email chain because my company is currently looking to hire several python developers as soon as possible. I have included the job posting below along with the link to apply, but please feel free to email me back directly with questions or resumes. *About Tippr:* Tippr is the leading provider of white-label technology and services for group buying with our PoweredByTippr? offering, and we are also operator of the third largest consumer group buying website, Tippr.com, which guarantees consumers the best local deals by offering discounts of 50 to 90 percent at local restaurants, spas, theaters and more. PoweredByTippr? offers a full complement of services required to operate a group buying service, and proven expertise garnered by operating our own top-name group buying site. *About the Position:* We are looking for an ambitious and experienced Python Developer to join our development team in *Austin or Seattle*. As part of the core engineering team, you will work closely with a group of hard-working engineers in a fast-paced, challenging environment to help shape the technology landscape and culture of the core product. *Job Overview:* ? Code primarily with Python (we use Django) ? Design and implement new features for immediate release ? Rapidly iterate using user feedback and internal metrics ? Collaborate and work alongside a smart, hard-working group of engineers *Requirements:* ? 2-5+ years web engineering experience ? Solid Python skills ? Familiarity with Django is a plus ? Familiarity with Postgres and GIT ? Very experienced with web application deployment and software design principles ? Strong communication skills and the ability to work out solutions to problems with others ? Ability to identify and prioritize projects and follow through with execution ? Bachelor's degree in Computer Science or related field ? Ecommerce experience a plus ? Experience working in an Agile/Scrum environment Follow this link to apply: http://tipprjobs.theresumator.com/apply/CDtWLq/Python-Developer.html I look forward to hearing from you!!!! *tippr* *Katie Hayes | Recruiting/Office Coordinato?r* Email: katie.hayes at tippr.com Learn: http://www.poweredbytippr.com _______________________________________________ Texas mailing list Texas at python.org http://mail.python.org/mailman/listinfo/texas -------------- next part -------------- An HTML attachment was scrubbed... URL: From gslindstrom at gmail.com Sat Nov 19 14:33:50 2011 From: gslindstrom at gmail.com (Greg Lindstrom) Date: Sat, 19 Nov 2011 07:33:50 -0600 Subject: [PyAR2] Book Winner Message-ID: A couple weeks ago we held a contest to solve the Car Talk "Puzzler". In my judgmentment, the outstanding response came from Carl Burch and, as such, he gets to choose from one of the following O'Reilly books we have left over from pyArkansas: - Head First Python - Learning Python - Natural Language Processing with Python - Collective Intelligence - The Art of Community - Real World INstrumentation If you let me know which one you'd like, Carl, I'll drop it off next time I'm my Hendrix. --greg -------------- next part -------------- An HTML attachment was scrubbed... URL: