From gslindstrom at gmail.com Wed Dec 10 16:08:59 2008 From: gslindstrom at gmail.com (gslindstrom at gmail.com) Date: Wed, 10 Dec 2008 15:08:59 +0000 Subject: [PyAR2] Progamming Challenge Message-ID: <00221532cd04c1cc3d045db2a35f@google.com> Hello all, It's been pretty quite around here. Nothing going on? My boss turned my on to a great website, www.projecteuler.com, that has a lot of great programming problems to work. I did the first ten problems a few nights ago (the start really easy and ramp up; having a knowledge of mathematics helps see shortcuts). One of my favorite challenges of old is "Given a positive integer N, return a list of the factors of N". Give it a try and post your results. The best (as judged by me) routine will be awarded a tee shirt from wearpython.com. Also, I plan on getting a web site up for us over the holidays. I have an account at webfaction.com that I am not using and want to play a bit with Django. If you have ideas on what to put on the site, please let me know. --greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From srilyk at gmail.com Wed Dec 10 19:32:22 2008 From: srilyk at gmail.com (W W) Date: Wed, 10 Dec 2008 12:32:22 -0600 Subject: [PyAR2] Progamming Challenge In-Reply-To: <00221532cd04c1cc3d045db2a35f@google.com> References: <00221532cd04c1cc3d045db2a35f@google.com> Message-ID: <333efb450812101032y7ace51acq887c3c77fa615de3@mail.gmail.com> On Wed, Dec 10, 2008 at 9:08 AM, wrote: > Hello all, > > It's been pretty quite around here. Nothing going on? For me, just finals week and gearing up to get married on the 20th! So... just a little on the busy side! > One of my favorite challenges of old is "Given a positive integer N, return > a list of the factors of N". Give it a try and post your results. The best > (as judged by me) routine will be awarded a tee shirt from wearpython.com. > > Here's mine, via attachment. I have it setup two ways: unique factors and pairs of factors. I thought about trying to implement a binary tree so it could show the actual factors using a tree type method... but I don't know enough about python yet to do that. Might be a useful exercise though. > Also, I plan on getting a web site up for us over the holidays. I have an > account at webfaction.com that I am not using and want to play a bit with > Django. If you have ideas on what to put on the site, please let me know. > I haven't played with Django at all, but something I always love to do when I'm learning a new language is write a guessing game. The computer "thinks" of a number 1-10 and the user tries to guess it. It's pretty fun - at least I think so :) I don't know how consuming it would be, presumably it would take quite a bit of programming, but I would love to create a paint chat program. http://en.wikipedia.org/wiki/Paint_chat I'm sure some other general pyAR^2 themed stuff would be pretty cool. My 2?? -Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.hermeneutic at gmail.com Thu Dec 11 15:33:06 2008 From: paul.hermeneutic at gmail.com (paul.hermeneutic at gmail.com) Date: Thu, 11 Dec 2008 08:33:06 -0600 Subject: [PyAR2] PyAR2 Digest, Vol 14, Issue 1 In-Reply-To: References: Message-ID: <4a89b8680812110633g723e13a5re6f6f5902eafe319@mail.gmail.com> Greg: Nice idea to have a programming challenge. I assume that you are going to run the submitted code to see that correct results are produced. As the challenges get more complex, it will become more difficult to ensure that no one has sent any malicious code. Is there already, or could we create, an automated system where users could upload their source code? I have seen such web sites for C/C++ code. The system must first ensure that the code is not malicious. This alone might be significant effort. It would then then execute the code and assess the results. Several metrics would be generated that would give an overview of the entry. Correctness of results Speed performance Number of source code lines (LOC) Ratio of comments to LOC Are there other metrics by which source code can be evaluated? -paul From srilyk at gmail.com Thu Dec 11 16:35:56 2008 From: srilyk at gmail.com (W W) Date: Thu, 11 Dec 2008 09:35:56 -0600 Subject: [PyAR2] PyAR2 Digest, Vol 14, Issue 1 In-Reply-To: <4a89b8680812110633g723e13a5re6f6f5902eafe319@mail.gmail.com> References: <4a89b8680812110633g723e13a5re6f6f5902eafe319@mail.gmail.com> Message-ID: <333efb450812110735v1a609011tceb7573e5676ccc6@mail.gmail.com> On Thu, Dec 11, 2008 at 8:33 AM, wrote: > I assume that you are going to run the submitted code to see that > correct results are produced. As the challenges get more complex, it > will become more difficult to ensure that no one has sent any > malicious code. Indeed - even with the ease of which you can /usually/ tell, that's not always the case. One doesn't just have to use the os module to do some wonky things. Although using a linux account with specific permissions (or a virtual env) is an easy way to get most things secure, it's not foolproof. And as most programmers know, if you make something foolproof, the universe makes a better fool ;) > Is there already, or could we create, an automated system where users > could upload their source code? I have seen such web sites for C/C++ > code. The system must first ensure that the code is not malicious. > This alone might be significant effort. It would then then execute > the code and assess the results. Several metrics would be generated > that would give an overview of the entry. > > Correctness of results Depending on the challenge, unless the results are explicitly defined, you can have problems even with this. After all, in my code I get the factors in two different ways: by pair, and unique. I mentioned even the "tree" model. Which one of these is correct or is each one? In the "assignment" it wasn't explicitly declared. Another question is what type should the results be returned as? A list of tuples? A list of integers? A string? A dictionary? Unicode? The hex representation? The more complex the problem, the more opportunities for interpretation, when the results aren't explicitly declared. And as always, sample results are rather helpful. If you say: output should be an ordered list of unique integers, i.e. print factors => [1, 3, 5, 15] Then it leaves little question if print factors=> [{'1':'15', '15':'1', '3':'5', '5':'3'}] is a correct result. While both are lists of unique factors, only one is /only/ a list of unique factors. > Speed performance Number of source code lines (LOC) > Ratio of comments to LOC All rather easy to generate (although it also leaves unanswered whether a docstring counts as a comment, what the count is for end of line codes, i.e. print x # This should output a list of unique factors), etc. > Are there other metrics by which source code can be evaluated? One requires the "human touch" - but ease of understanding (for the most perl-ish award). If your code has zero comments, that could be a good thing - if you programmed it well. Consider the following two statements: print x print factors One of them you probably have no idea what it means, the other one you can guess that it probably prints the factors. You may not know what type factors /is/, but you can be fairly sure that it's some type of aggregation of factors. Anyhow... probably about 3? worth there ;) -Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhjaggars at gmail.com Thu Dec 11 17:31:39 2008 From: jhjaggars at gmail.com (Jesse Jaggars) Date: Thu, 11 Dec 2008 10:31:39 -0600 Subject: [PyAR2] PyAR2 Digest, Vol 14, Issue 1 In-Reply-To: <333efb450812110735v1a609011tceb7573e5676ccc6@mail.gmail.com> References: <4a89b8680812110633g723e13a5re6f6f5902eafe319@mail.gmail.com> <333efb450812110735v1a609011tceb7573e5676ccc6@mail.gmail.com> Message-ID: <52a3495e0812110831he8a4eeegb1c8bbf13b8bb8bb@mail.gmail.com> You could always use http://codepad.org/ to execute the code. From Eric.Foster at modot.mo.gov Thu Dec 18 22:35:32 2008 From: Eric.Foster at modot.mo.gov (Eric.Foster at modot.mo.gov) Date: Thu, 18 Dec 2008 15:35:32 -0600 Subject: [PyAR2] MO GIS Conference 2009: Python Workshop and Sessions Message-ID: The MO GIS 2009 Conference in Feb 2009 will include a Python Workshop 4-hour course as well as an opportunity to present what you've been doing with Python in the GIS arena to GISers across Missouri. For more information, contact me or check the MO GIS Website: http://www.mgisac.org/MOGIS09/HomePage Eric Foster, Senior Transportation Planner MoDOT, 600 NE Colbern Rd. Lee's Summit, MO 64086 (816) 622-6330 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.hermeneutic at gmail.com Fri Dec 19 21:41:10 2008 From: paul.hermeneutic at gmail.com (paul.hermeneutic at gmail.com) Date: Fri, 19 Dec 2008 14:41:10 -0600 Subject: [PyAR2] Python competition Message-ID: <4a89b8680812191241r8fd2d9fq8c60b6b84be43e5a@mail.gmail.com> Develop an interesting app using their product for a chance to win $$$. http://www.resolversystems.com/competition/