From janmilosh at gmail.com Sat Nov 1 13:56:08 2014 From: janmilosh at gmail.com (Jan Milosh) Date: Sat, 1 Nov 2014 08:56:08 -0400 Subject: [CentralOH] Oct. 2014 COhPy clarifications Message-ID: <74E59F90-50C8-44D3-8A14-C4A75B1C9219@gmail.com> 1. Digital Ocean hosting cost is $5/month for their cheapest plan. It?s billed monthly and there are no tricks like with shared hosting that draws you in for $2/month then raises the cost to $14/month after a year. 2. Heroku hosting is free for a developer account. 3. Both Digital Ocean and Heroku are easily configurable for Python applications. 4. Jekyll is a static site generator that is used with GitHub pages. HTML/CSS/JS only. It?s written in Ruby and uses the Liquid tempting language (by Shopify). You can create a blog or portfolio (with categories, etc.), but there is no database. Page load is super fast. You can redirect your own domain name to your Jekyll site. It uses a git workflow so version control is easy (unlike WordPress, etc.). I?ve created/contributed to two Jekyll sites: http://janmilosh.com and http://cbusjs.github.io. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Sat Nov 1 18:39:45 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 1 Nov 2014 13:39:45 -0400 Subject: [CentralOH] =?utf-8?q?2014-10-31_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz86IEEgSGFsbG93ZWVuIExvdmUgU3Rvcnk=?= Message-ID: <20141101133945.354cd467.jep200404@columbus.rr.com> First, a Halloween love story. How do I love Verizon Wireless? Let me count the ways. http://alturl.com/goapd (www.networkworld.com) http://www.networkworld.com/article/2839606/security0/secretive-unblockable-verizon-perma-cookies-kick-up-privacy-concerns.html See also testers at: https://panopticlick.eff.org/ http://www.christianschenk.org/blog/enhancing-your-privacy-using-squid-and-privoxy/ http://ip.proxy.lc/ https://anonymous-proxy-servers.net/en/help/security_test.html http://ip.cc/proxy-classes.php http://ip-check.info/?lang=en Proxylicious? Hmmm. Revelations around Halloween reminds me of wp:Halloween documents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A hotspot was awesome again. much TDD tonight Write a function that returns the largest factor of a number. jjj at dojo:~ cat factor.sh function largest_factor { factor "$1" | awk '{print $NF}' } jjj at dojo:~ . factor.sh jjj at dojo:~ largest_factor 26 13 jjj at dojo:~ largest_factor 72 3 jjj at dojo:~ OK, now do it in Python, with TDD, without importing any libraries except pytest. http://pytest.org/latest/example/parametrize.html http://pytest.org/latest/_modules/_pytest/mark.html http://pytest.org/latest/assert.html#assert with pytest.raises(ZeroDivisionError): 1 / 0 pytest.raises(ExpectedException, func, *args, **kwargs) pytest.raises(ExpectedException, "func(*args, **kwargs)") http://pythontesting.net/framework/pytest/pytest-introduction/ tmux $EDITOR *.py watch 'git status -s' py.test -f . This TDD stuff reminds me of a presentation that Brandon gave about how code should be organzied. I'm going to have to watch it again. http://pyvideo.org/video/2840/the-clean-architecture-in-python wp:ADD wp:BDD wp:CDD wp:DDD wp:EDD wp:FDD If you want a better more, use less. wp:more (command) wp:less (Unix) http://man.cx/?page=less See LESS_IS_MORE in http://linux.die.net/man/1/less less opts about scrolling (or not needing to) wp:most (Unix) (this one is new to mee) wp:pg (Unix) (this one is also new to me) shimano 70 sram 20 campy(campagnolo) 10 What night(s) are good for dojos? Tuesdays & Fridays are good for one. Tuesday are not good for Gabrielle Tuesday are not good for another, so we stay on Friday. https://www.techdirt.com/blog/netneutrality/articles/20141029/06551128976/detailed-report-shows-how-isps-are-making-business-choice-to-make-your-internet-connection-terrible.shtml When I shop for a car, I bring my big 8" Dobsonian. http://pyvideo.org/search?models=videos.video&q=astronomy http://pyvideo.org/video/2325/skyfield-and-15-years-of-bad-apis https://republicwireless.com/ http://english.chosun.com/site/data/html_dir/2014/11/01/2014110100539.html wp:Burkina Faso bergino.com BNF wp:Backus?Naur Form wp:BNSF http://opensource.com/health/14/10/hospitals-save-using-open-source http://www.zdnet.com/samsung-fires-another-shot-at-microsoft-in-android-patent-battle-7000035310/ Meet the alkane sisters at Ethyl Corp. local links, mostly wx. Let's see how much pipermail buggers them. http://www.columbusgasprices.com/index.aspx?s=Y&fuel=A&area=Columbus+-+Central&area=Columbus+-+East&area=Columbus+-+North&area=Columbus+-+West&tme_limit=8 http://forecast.weather.gov/MapClick.php?CityName=Columbus&state=OH&site=ILN&textField1=39.9889&textField2=-82.9874&e=1 http://forecast.weather.gov/MapClick.php?w0=t&w1=td&w3=sfcwind&w3u=1&w4=sky&w5=pop&w8=rain&w9=snow&w10=fzg&w11=sleet&AheadHour=0&Submit=Submit&FcstType=graphical&textField1=39.98890&textField2=-82.98740&site=all&unit=0&dd=0&bw=0 http://radblast-aws.wunderground.com/cgi-bin/radar/WUNIDS_map?station=CMH&brand=wui&num=6&delay=15&type=TR0&frame=0&scale=1.000&noclutter=0&t=1371131769&lat=0&lon=0&label=you&showstorms=10&map.x=400&map.y=240¢erx=400¢ery=240&transx=0&transy=0&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0 http://radblast-aws.wunderground.com/cgi-bin/radar/WUNIDS_map?station=ILN&brand=wui&num=6&delay=15&type=N0R&frame=0&scale=1.000&noclutter=0&t=1371131330&lat=40.10094070&lon=-83.01473999&label=Worthington%2C+OH&showstorms=0&map.x=400&map.y=240¢erx=400¢ery=240&transx=0&transy=0&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0 http://radblast-aws.wunderground.com/cgi-bin/radar/WUNIDS_map?station=ILN&brand=wui&num=6&delay=15&type=N0R&frame=0&scale=1.000&noclutter=0&t=1371131508&lat=40.10094070&lon=-83.01473999&label=Worthington%2C+OH&showstorms=10&map.x=400&map.y=240¢erx=400¢ery=240&transx=0&transy=0&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0 http://radar.weather.gov/Conus/Loop/centgrtlakes_loop.gif http://radar.weather.gov/Conus/Loop/NatLoop.gif As usual, a wp: prefix means Wikipedia. From jep200404 at columbus.rr.com Sat Nov 1 21:07:02 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 1 Nov 2014 16:07:02 -0400 Subject: [CentralOH] The Clean Architecture in Python is Relevant for TDD In-Reply-To: <20141101133945.354cd467.jep200404@columbus.rr.com> References: <20141101133945.354cd467.jep200404@columbus.rr.com> Message-ID: <20141101160702.27769873.jep200404@columbus.rr.com> Brandon, Thanks again for your presentation. On Sat, 1 Nov 2014 13:39:45 -0400, jep200404 at columbus.rr.com wrote: > This TDD stuff reminds me of a presentation that Brandon gave about how code > should be organzied. I'm going to have to watch it again. > > http://pyvideo.org/video/2840/the-clean-architecture-in-python Oh yeah! It's relevant to the TDD stuff. I will need to watch it again next month after getting some TDD experience. From jep200404 at columbus.rr.com Sat Nov 1 21:19:24 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 1 Nov 2014 16:19:24 -0400 Subject: [CentralOH] Oct. 2014 COhPy clarifications: Scaling Issue In-Reply-To: <74E59F90-50C8-44D3-8A14-C4A75B1C9219@gmail.com> References: <74E59F90-50C8-44D3-8A14-C4A75B1C9219@gmail.com> Message-ID: <20141101161924.475ed27f.jep200404@columbus.rr.com> On Sat, 1 Nov 2014 08:56:08 -0400, Jan Milosh wrote: > http://cbusjs.github.io That does something unusual. It scales nicely for large and small screens. Thanks! From jep200404 at columbus.rr.com Sun Nov 2 01:35:42 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 1 Nov 2014 20:35:42 -0400 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMC0zMSDpgZPloLQgU2NyaWJibGVzOiBU?= =?utf-8?q?DD_demo?= In-Reply-To: <20141101133945.354cd467.jep200404@columbus.rr.com> References: <20141101133945.354cd467.jep200404@columbus.rr.com> Message-ID: <20141101203542.290a2a44.jep200404@columbus.rr.com> On Sat, 1 Nov 2014 13:39:45 -0400, jep200404 at columbus.rr.com wrote: > Write a function that returns the largest factor of a number. > ... in Python, with TDD, > without importing any libraries except pytest. https://github.com/james-prior/tdd-demo From jep200404 at columbus.rr.com Mon Nov 3 18:31:50 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 3 Nov 2014 12:31:50 -0500 Subject: [CentralOH] =?utf-8?q?2014-10-17_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz86IFRSQUYgQXBwbGllZCBpbiBEaWxiZXJ0?= In-Reply-To: <20141018152619.4a4c3d33.jep200404@columbus.rr.com> References: <20141018152619.4a4c3d33.jep200404@columbus.rr.com> Message-ID: <20141103123150.73e7c9af.jep200404@columbus.rr.com> On Sat, 18 Oct 2014 15:26:19 -0400, jep200404 at columbus.rr.com wrote: > Stephanie Winston > TRAF TRAF applied in dilbert: http://dilbert.com/strips/comic/2014-11-02/ From jep200404 at columbus.rr.com Mon Nov 3 23:52:58 2014 From: jep200404 at columbus.rr.com (Jim Prior) Date: Mon, 3 Nov 2014 17:52:58 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMC0yNCDpgZPloLQgU2NyaWJibGVzOiBU?= =?utf-8?q?DD_Code?= In-Reply-To: <20141028210739.2cbc4e22.jep200404@columbus.rr.com> References: <20141028210739.2cbc4e22.jep200404@columbus.rr.com> Message-ID: <20141103175258.49bf1aa6.jep200404@columbus.rr.com> On Tue, 28 Oct 2014 21:07:39 -0400, jep200404 at columbus.rr.com wrote: > TDD is easily defined Code from that dojo is attached. -------------- next part -------------- A non-text attachment was scrubbed... Name: tdd.py Type: application/octet-stream Size: 1613 bytes Desc: not available URL: From jep200404 at columbus.rr.com Sat Nov 8 20:58:31 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 8 Nov 2014 14:58:31 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0wNyDpgZPloLQgU2NyaWJibGVz?= Message-ID: <20141108145831.5b3ae485.jep200404@columbus.rr.com> http://phenomena.nationalgeographic.com/2013/04/26/mind-bending-parasite-permanently-quells-cat-fear-in-mice/ Mice make cats go fast, but mice make you go slow. Touch-typing makes you fast so use software that doesn't require mice such as: editors vi(m) emacs tmux window manager or desktop ratpoison What other keyboard friendly software are folks partial to? Someone from the west side of Dayton (aka Yellow Springs) showed up. Dayton area Python resources: http://www.meetup.com/Dayton-Dynamic-Languages-User-Group/ Catherine Devlin To get a dojo at a convenient time and place, take the initiative and set one up. Don't ask permission[1]. Lerway i3 Qi Wireless charger Nifty universal to micro USB charger receiver DDP: disturbing data point I kvetch, therefore I am. wp:James Burke (science historian) wp:Connections (TV series) wp:Jazz (Ry Cooder album) https://www.python.org/about/success/ https://www.python.org/about/success/honeywell/ https://www.python.org/about/success/forecastwatch/ Vegan likes python http://vegan-recipes.eat4slim.com/wp/2014/10/22/python-2-7-serial-module/ http://www.newyorker.com/magazine/2014/11/03/grain http://pyvideo.org/speaker/337/brandon-rhodes Pronounce "__name__" as "dunder name". https://wiki.python.org/moin/DunderAlias For a long time Python 3 had not been practical to use for many real world projects, because some library one would need would not be available in Python 3. In recent weeks, several Python folks have mentioned that enough of the libraries have been ported to Python 3 that Python 3 can be used for most projects, and encourage everyone to start using Python 3, especially for new projects. Python 3 Wall of Superpowers https://python3wos.appspot.com/ http://rhodesmill.org/brandon/ http://pyvideo.org/speaker/337/brandon-rhodes https://duckduckgo.com/html/?q=is+callable+python Which of the following do you prefer? Why? How would you do it better? 1: test before calling: def foo(): pass def bar(baz=foo): if callable(baz): goo = baz() else goo = baz return goo 2: oh just try it and fall back def foo(): pass def bar(baz=foo): try: goo = baz() except TypeError: goo = baz return goo Cygwin gives folks in MS Windows some helpful UNIXy goodness. wp:Cygwin Installing a unix or Linux virtual machine in a Windows computer is another way of coping with Windows. wp:VirtualBox A new way for people to work together was devised by a student in Finland. It worked great for his project. Someone else wrote about it. Big businesses, such as Netscape, IBM, and Sun read those writings and changed how they ran their businesses because of it. The technique was originally applied to software, but now people are trying it in other fields of work. wp:The Cathedral and the Bazaar http://catb.org/esr/writings/cathedral-bazaar/ How one makes money while giving stuff away is another very interesting topic. C and Python parsing input: jjj at dojo:~$ cat goo.c #include #include int main(int argc,char *argv[]) { int ip[4]; char s[]="192.168.0.123"; sscanf(s,"%d.%d.%d.%d",ip+0,ip+1,ip+2,ip+3); printf("%d %d %d %d\n",ip[0],ip[1],ip[2],ip[3]); } jjj at dojo:~$ ./goo 192 168 0 123 jjj at dojo:~$ ala http://stackoverflow.com/questions/2175080/sscanf-in-python >>> import re >>> r = re.compile('[ \t\n\r:.]+') >>> ip = r.split('192.168.000.123') >>> print ip, map(int, ip) ['192', '168', '000', '123'] [192, 168, 0, 123] >>> As usual, wp: is prefix for wikipedia. There will not be a dojo on November 28th (Black Friday). We do not have the Community Room for November 14th, so we will be meeting out in the open area. [1] It's easier to ask forgiveness than it is to get permission. https://en.wikiquote.org/wiki/Grace_Hopper wp:Grace Hopper From melvyniandrag at gmail.com Sun Nov 9 21:07:13 2014 From: melvyniandrag at gmail.com (Melvyn Drag) Date: Sun, 9 Nov 2014 15:07:13 -0500 Subject: [CentralOH] An infuriating article Message-ID: http://www.itworld.com/article/2826902/enterprise-software/7-days-using-only-keyboard-shortcuts--no-mouse--no-trackpad--no-problem-.html Where the heck is the 1989 study he's talking about? I cannot find it. Maybe its a lie told by cheese eaters. -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Mon Nov 10 04:16:06 2014 From: eric at intellovations.com (Eric Floehr) Date: Sun, 9 Nov 2014 22:16:06 -0500 Subject: [CentralOH] An infuriating article In-Reply-To: References: Message-ID: > > Where the heck is the 1989 study he's talking about? I cannot find it. > Maybe its a lie told by cheese eaters. > I don't think it's a published study, I think it only exists as an "Ask Tog" answer published in 1989. So we have to take Tognazzini's word for it, I guess. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Thu Nov 13 02:19:44 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Wed, 12 Nov 2014 20:19:44 -0500 Subject: [CentralOH] YAML versus Python Message-ID: <20141112201944.18eb00d8.jep200404@columbus.rr.com> I saw some complex data for initial values in an ugly format. Someone else saw it and immediately said to use YAML. I realized that if the configuration data is used only in a Python program, then the configuration data could be a Python module, and just be imported. So now I'm wondering about YAML versus Python. When is YAML more helpful than Python and vice versa? If one needs to use the data in any language other than Python, then Python would be inappropriate, because one would need a Python parser for some other language, which would be rediculous. YAML can be grokked by many languages. If one needs modify the data by a program, then YAML is superior because it's easy to output. Importing Python is easy, but I'm not aware of a way to easily output Python. print(repr(foo)) could be a part of it, but it tends towards long lines which are hard to read. The references in YAML are interesting. It makes me wonder about recursive references in Python. I had not though about recursive data structures in Python. (I have not needed them yet either.) Also, as clean as Python is, it has more syntax cruft to wade through than YAML. YAML is easier to read. Golly, I think I've talked myself into YAML. What can you add about YAML versus Python for static or initializing data? From iynaix at gmail.com Thu Nov 13 03:09:22 2014 From: iynaix at gmail.com (iynaix) Date: Thu, 13 Nov 2014 10:09:22 +0800 Subject: [CentralOH] YAML versus Python In-Reply-To: <20141112201944.18eb00d8.jep200404@columbus.rr.com> References: <20141112201944.18eb00d8.jep200404@columbus.rr.com> Message-ID: Some quick thoughts: If the data is only written and used by your own program, it doesn't make much of a difference whether you use Python (as Django does) or YAML. Obviously if it has to be used in another language or by other tools, Python is probably not a good option. You can output Python (deserialize objects) using the pickle module ( https://docs.python.org/2/library/pickle.html), but it can execute arbitrary code, so do not use it from untrusted sources, which is also very explicitly stated in the official python docs. If the data might possibly be from an outside source, I would go with JSON. YAML is prettier and also a superset of JSON, but some of the more advanced features of YAML are exploitable. Ruby on Rails had a string of vulnerabilities last year based off YAML deserialization. ( https://ronin-ruby.github.io/blog/2013/01/09/rails-pocs.html, https://ronin-ruby.github.io/blog/2013/01/28/new-rails-poc.html). Again, if the source is trusted, then it shouldn't be too big of an issue. Cheers, XY On Thu, Nov 13, 2014 at 9:19 AM, wrote: > I saw some complex data for initial values in an ugly format. > Someone else saw it and immediately said to use YAML. > > I realized that if the configuration data is used only in a > Python program, then the configuration data could be a Python > module, and just be imported. So now I'm wondering about YAML > versus Python. When is YAML more helpful than Python and vice > versa? > > If one needs to use the data in any language other > than Python, then Python would be inappropriate, because one > would need a Python parser for some other language, which > would be rediculous. YAML can be grokked by many languages. > > If one needs modify the data by a program, > then YAML is superior because it's easy to output. > Importing Python is easy, but I'm not aware of a way to easily > output Python. print(repr(foo)) could be a part of it, > but it tends towards long lines which are hard to read. > > The references in YAML are interesting. > It makes me wonder about recursive references in Python. > I had not though about recursive data structures in Python. > (I have not needed them yet either.) > > Also, as clean as Python is, it has more syntax cruft to wade > through than YAML. YAML is easier to read. > > Golly, I think I've talked myself into YAML. > What can you add about YAML versus Python for static or > initializing data? > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeptinker at gmail.com Thu Nov 13 03:37:54 2014 From: deeptinker at gmail.com (Travis Risner) Date: Wed, 12 Nov 2014 21:37:54 -0500 Subject: [CentralOH] YAML versus Python In-Reply-To: References: <20141112201944.18eb00d8.jep200404@columbus.rr.com> Message-ID: <54641982.50000@gmail.com> You may have two other considerations. 1 - Are you the only person who is ever going to modify the configuration? If not, then YAML may be better because the other person is less likely to change something unintended (like changing a tab to spaces or vice-versa). 2 - Do you need rigorous validation? If so, then perhaps XML with an XSD or DTD is the way to go. (Disclaimer - I have never used YAML so there may easily be capabilities my 30 second read missed. :) ) On 11/12/14, 9:09 PM, iynaix wrote: > Some quick thoughts: > > If the data is only written and used by your own program, it doesn't > make much of a difference whether you use Python (as Django does) or > YAML. Obviously if it has to be used in another language or by other > tools, Python is probably not a good option. > > You can output Python (deserialize objects) using the pickle module > (https://docs.python.org/2/library/pickle.html), but it can execute > arbitrary code, so do not use it from untrusted sources, which is also > very explicitly stated in the official python docs. > > If the data might possibly be from an outside source, I would go with > JSON. YAML is prettier and also a superset of JSON, but some of the more > advanced features of YAML are exploitable. Ruby on Rails had a string of > vulnerabilities last year based off YAML deserialization. > (https://ronin-ruby.github.io/blog/2013/01/09/rails-pocs.html, > https://ronin-ruby.github.io/blog/2013/01/28/new-rails-poc.html). Again, > if the source is trusted, then it shouldn't be too big of an issue. > > Cheers, > XY > > On Thu, Nov 13, 2014 at 9:19 AM, > wrote: > > I saw some complex data for initial values in an ugly format. > Someone else saw it and immediately said to use YAML. > > I realized that if the configuration data is used only in a > Python program, then the configuration data could be a Python > module, and just be imported. So now I'm wondering about YAML > versus Python. When is YAML more helpful than Python and vice > versa? > > If one needs to use the data in any language other > than Python, then Python would be inappropriate, because one > would need a Python parser for some other language, which > would be rediculous. YAML can be grokked by many languages. > > If one needs modify the data by a program, > then YAML is superior because it's easy to output. > Importing Python is easy, but I'm not aware of a way to easily > output Python. print(repr(foo)) could be a part of it, > but it tends towards long lines which are hard to read. > > The references in YAML are interesting. > It makes me wonder about recursive references in Python. > I had not though about recursive data structures in Python. > (I have not needed them yet either.) > > Also, as clean as Python is, it has more syntax cruft to wade > through than YAML. YAML is easier to read. > > Golly, I think I've talked myself into YAML. > What can you add about YAML versus Python for static or > initializing data? > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > From jep200404 at columbus.rr.com Mon Nov 17 15:55:41 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 17 Nov 2014 09:55:41 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= Message-ID: <20141117095541.747e03f8.jep200404@columbus.rr.com> This stuff just keeps coming up. Enhance your career by writing code vulnerable to an SQL injection attack! General case: http://en.wikipedia.org/wiki/Code_injection One must develop a general sense about injection attacks and just not allow them, ever. Always use the invulnerable form. Python: exec() gives me the creeps. SQL: http://en.wikipedia.org/wiki/SQL_injection http://www.darkreading.com/attacks-breaches/yet-another-security-firm-breached--employee-email-user-accounts-leaked/d/d-id/1135536 https://www.riskbasedsecurity.com/2014/04/sql-injection-leads-to-bigmoneyjobs-com-leak/ http://www.out-law.com/en/articles/2014/november/fine-should-prompt-businesses-to-address-threat-of-sql-injection-attacks-says-ico/ http://www.scmagazine.com/seventeen-companies-including-banks-and-retailers-named-as-victims-in-hacker-campaign/article/304605/ Thanks to Randall Monroe http://xkcd.com/327/ http://www.explainxkcd.com/wiki/index.php/327:_Exploits_of_a_Mom http://bobby-tables.com/ It's easy to do wrong in Python. For example: query_parameters = { 'column_name': 'id FROM students; DROP TABLE students; SELECT id ', 'table_name': 'students', } query = 'SELECT %(column_name)s FROM %(table_name)s' % query_parameters print query # cursor.execute(query) >>> if True: ... query_parameters = { ... 'column_name': 'id FROM students; DROP TABLE students; SELECT id ', ... 'table_name': 'students', ... } ... query = 'SELECT %(column_name)s FROM %(table_name)s' % query_parameters ... print query ... SELECT id FROM students; DROP TABLE students; SELECT id FROM students >>> It's also easy to do right in Python: query_parameters = ( 'id FROM students; DROP TABLE students; SELECT id ', 'students', ) query = 'SELECT ? FROM ?' cursor.execute(query, query_parameters) It's so easy to do right, there's no excuse for doing it wrong. Again, see http://downloads.egenix.com/python/EPC-2008-Using-the-Python-Database-API.pdf, especially page 17. Some ORMs protect you automatically. However, if you have access to raw SQL in your ORM, then your database is vulnerable. -------------------------------------------------------------------------------- Premature optimization is the root of all evil. First, write for clarity. If the code is not fast enough, then measure to find out which part of the code is too slow and optimize that part. -------------------------------------------------------------------------------- Start with examples of input and output for TDD. MySQL & Oracle kick PostGIS' posterior. https://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/#compatibility-tables Not. Batteries are tempermental. Be gentle to them. http://www.wikihow.com/Extend-Your-Li-Ion-Dell-XPS-M1210-Laptop-Battery-Life http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries Someone showed up who uses Microsoft Windows. What's best way to install both Python 2(.7) _and_ 3(.4) on Windows _with_ Ipython _and_ virtualenv? It's easy to find answers for any one piece, but not for all of them together. Canopy (formerly EPD) is only for 2.7 https://www.python.org/downloads/windows/ https://www.python.org/ftp/python/3.4.2/python-3.4.2.amd64.msi https://www.python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi http://ipython.org/ipython-doc/stable/install/install.html http://ipython.org/install.html I code, therefore I am. wp:James Burke (science historian) wp:Connections (TV series) stupid unicode fun: try: 1 ? 0 except: print u'nuts' else: print u'ok' wp:Friendly_Floatees wp:Moby-Duck What is your favorite color? wp:Monty Python and the Holy Grail http://learnpythonthehardway.org/ Zed Shaw needs help: Should use print functions instead of print statements. http://www.meetup.com/girldevelopitcbus/events/214700282/ Notebook viewer can render notebooks at arbitrary URLs. For example, http://nbviewer.ipython.org/url/colug.net/python/dojo/20140117/word-count-example-rev2.ipynb http://catb.org/esr/writings/cathedral-bazaar/ http://www.codingame.com/ Someone who smashes tiny things into teensier things needs to see a demo of: https://github.com/brandon-rhodes/astronomy-notebooks running sum What's the Pythonic way of doing a running sum? How about in balance.py? http://www.jeffknupp.com/blog/2013/04/07/improve-your-python-yield-and-generators-explained/ http://stackoverflow.com/questions/1790550/running-average-in-python to your health wp:B?n?dictine wp:Benedictine Sisters wp:Avera Health Chet Atkins & Les Paul - Chester & Lester http://xkcd.com/1110/ has a _large_ image. As usual, wp: prefix means Wikipedia. ------------------------------------------------------------------------ Now for some refactoring. [jjj at dojo ~]$ head -999 balance.py ''' What do you like about the various quantify_parens()? What do you dislike about the various quantify_parens()? What do you like about the various parens_are_balanced()? What do you dislike about the various parens_are_balanced()? What do you think about the last sum_ = 0 for doing nothing gracefully? ''' from __future__ import print_function import operator def quantify_parens(s): return [{'(': +1, ')': -1}[c] if c in {'(': +1, ')': -1} else 0 for c in s] def quantify_parens(s): weights = {'(': +1, ')': -1} return [weights[c] if c in weights else 0 for c in s] def quantify_parens(s): weights = {'(': +1, ')': -1} for c in s: try: weight = weights[c] except KeyError: weight = 0 yield weight def quantify_parens(s): weights = {'(': +1, ')': -1} for c in s: try: weight = weights[c] except KeyError: pass else: yield weight def quantify_parens(s): weights = {'(': +1, ')': -1} for c in s: if c in weights: yield weights[c] def parens_are_balanced(s): sum_ = 0 for x in quantify_parens(s): sum_ += x if sum_ < 0: return False return sum_ == 0 def running_op(iterable, op=operator.add, initial=0): running_result = initial for element in iterable: running_result = op(running_result, element) yield running_result def running_sum(iterable, initial=0): sum_ = initial for element in iterable: sum_ += element yield sum_ def parens_are_balanced(s): n = n_unmatched_left_parentheses = 0 for n in running_sum(quantify_parens(s)): if n < 0: return False return n == 0 def main(): strings = [ '', 'hello world', '(', ')', '()', '((())', '((()))', '(a((b)))', '((())))', 'hello(a(b())))world', '(a(b(c)d)e)', ] for s in strings: print( repr(s), list(quantify_parens(s)), sum(quantify_parens(s)), parens_are_balanced(s)) print(list(running_op(range(1, 5), operator.mul, 1))) main() [jjj at dojo ~]$ From eric at intellovations.com Mon Nov 17 16:16:26 2014 From: eric at intellovations.com (Eric Floehr) Date: Mon, 17 Nov 2014 10:16:26 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: <20141117095541.747e03f8.jep200404@columbus.rr.com> References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: > > What's best way to install both Python 2(.7) _and_ 3(.4) on Windows > _with_ > Ipython _and_ virtualenv? It's easy to find answers for any one piece, > but > not for all of them together. Anaconda[1] is a spiritual successor to EPD/Canopy, by Travis Oliphant's new company Continuum Analytics. It supports 3.4, and IPython, but uses conda as the package and environment manager[2]. It's also geared towards the scientific community, but can be used generally. [1] http://www.continuum.io/downloads#py34 [2] http://davebehnke.com/using-python-anaconda-distribution.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From iynaix at gmail.com Mon Nov 17 16:30:44 2014 From: iynaix at gmail.com (iynaix) Date: Mon, 17 Nov 2014 23:30:44 +0800 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: Is the example of the balancing parens an academic exercise? If it isn't, it's probably a lot easier to write: strings = [ '', 'hello world', '(', ')', '()', '((())', '((()))', '(a((b)))', '((())))', 'hello(a(b())))world', '(a(b(c)d)e)', ] for s in strings: print(repr(s), s.count('(') == s.count(')')) Cheers, XY On Mon, Nov 17, 2014 at 11:16 PM, Eric Floehr wrote: > What's best way to install both Python 2(.7) _and_ 3(.4) on Windows >> _with_ >> Ipython _and_ virtualenv? It's easy to find answers for any one >> piece, but >> not for all of them together. > > > Anaconda[1] is a spiritual successor to EPD/Canopy, by Travis Oliphant's > new company Continuum Analytics. It supports 3.4, and IPython, but uses > conda as the package and environment manager[2]. It's also geared towards > the scientific community, but can be used generally. > > [1] http://www.continuum.io/downloads#py34 > [2] http://davebehnke.com/using-python-anaconda-distribution.html > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Mon Nov 17 16:39:49 2014 From: eric at intellovations.com (Eric Floehr) Date: Mon, 17 Nov 2014 10:39:49 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: > > for s in strings: > print(repr(s), s.count('(') == s.count(')')) > But that will return true for ")this) isn't balanced( b)ut (says it( is" -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at joeshaw.org Mon Nov 17 16:52:06 2014 From: joe at joeshaw.org (Joe Shaw) Date: Mon, 17 Nov 2014 10:52:06 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: Hi, I'd probably iterate over the string and increment a paren counter. If it ever went < 0, it's unbalanced and bail out. At the end, if it's > 0, it's not properly closed. This is basically a very lame lexer/parser state machine. Something like: for s in strings: paren_level = 0 for i, c in enumerate(s): if c == '(': paren_level += 1 elif c == ')': paren_level -= 1 if paren_level < 0: print "{}: Unbalanced closing paren at pos {}: '{}'".format(s, i, c) break # obviously would be better to track the position of the last open paren if paren_level > 0: print "{}: Unclosed opening paren somewhere".format(s) Joe On Mon, Nov 17, 2014 at 10:39 AM, Eric Floehr wrote: > for s in strings: >> print(repr(s), s.count('(') == s.count(')')) >> > > But that will return true for ")this) isn't balanced( b)ut (says it( is" > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iynaix at gmail.com Mon Nov 17 17:11:06 2014 From: iynaix at gmail.com (iynaix) Date: Tue, 18 Nov 2014 00:11:06 +0800 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: Ah yes, that test case didn't cross my mind. In that case, a running sum of some kind would be required. def parens_are_balanced(s): _sum = 0 for c in s: if c == '(': _sum += 1 elif c == ')': if _sum == 0: return False _sum -= 1 return _sum == 0 Jim's first 2 implementations of quantify_parens could be turned into generators by substituting the outermost square brackets with parens. Cheers, Xianyi On Mon, Nov 17, 2014 at 11:39 PM, Eric Floehr wrote: > for s in strings: >> print(repr(s), s.count('(') == s.count(')')) >> > > But that will return true for ")this) isn't balanced( b)ut (says it( is" > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brywilharris at gmail.com Mon Nov 17 18:17:21 2014 From: brywilharris at gmail.com (Bryan Harris) Date: Mon, 17 Nov 2014 11:17:21 -0600 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: I find it hard to believe there isn't some sort of "Sanitize Inputs" library. Pypi has a bunch of libraries which do some sort of sanitization. https://pypi.python.org/pypi?%3Aaction=search&term=sanitize&submit=search On Nov 17, 2014 10:52 AM, "Joe Shaw" wrote: > Hi, > > I'd probably iterate over the string and increment a paren counter. If it > ever went < 0, it's unbalanced and bail out. At the end, if it's > 0, it's > not properly closed. This is basically a very lame lexer/parser state > machine. Something like: > > for s in strings: > paren_level = 0 > for i, c in enumerate(s): > if c == '(': > paren_level += 1 > elif c == ')': > paren_level -= 1 > if paren_level < 0: > print "{}: Unbalanced closing paren at pos {}: '{}'".format(s, > i, c) > break > # obviously would be better to track the position of the last open > paren > if paren_level > 0: > print "{}: Unclosed opening paren somewhere".format(s) > > Joe > > On Mon, Nov 17, 2014 at 10:39 AM, Eric Floehr > wrote: > >> for s in strings: >>> print(repr(s), s.count('(') == s.count(')')) >>> >> >> But that will return true for ")this) isn't balanced( b)ut (says it( is" >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brywilharris at gmail.com Mon Nov 17 18:18:38 2014 From: brywilharris at gmail.com (Bryan Harris) Date: Mon, 17 Nov 2014 11:18:38 -0600 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0xNCDpgZPloLQgU2NyaWJibGVzOiBJ?= =?utf-8?q?njection_Attacks?= In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: And exec() should give you the willies. On Nov 17, 2014 10:52 AM, "Joe Shaw" wrote: > Hi, > > I'd probably iterate over the string and increment a paren counter. If it > ever went < 0, it's unbalanced and bail out. At the end, if it's > 0, it's > not properly closed. This is basically a very lame lexer/parser state > machine. Something like: > > for s in strings: > paren_level = 0 > for i, c in enumerate(s): > if c == '(': > paren_level += 1 > elif c == ')': > paren_level -= 1 > if paren_level < 0: > print "{}: Unbalanced closing paren at pos {}: '{}'".format(s, > i, c) > break > # obviously would be better to track the position of the last open > paren > if paren_level > 0: > print "{}: Unclosed opening paren somewhere".format(s) > > Joe > > On Mon, Nov 17, 2014 at 10:39 AM, Eric Floehr > wrote: > >> for s in strings: >>> print(repr(s), s.count('(') == s.count(')')) >>> >> >> But that will return true for ")this) isn't balanced( b)ut (says it( is" >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Mon Nov 17 19:51:36 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 17 Nov 2014 13:51:36 -0500 Subject: [CentralOH] Balance Parentheses Error Messages In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: <20141117135136.0b975861.jep200404@columbus.rr.com> On Mon, 17 Nov 2014 10:52:06 -0500, Joe Shaw wrote: > print "{}: Unclosed opening paren somewhere".format(s) That begs for a stack of unmatched left parentheses (and their positions). Hmmm, The stack would have _just_ the positions. From jep200404 at columbus.rr.com Mon Nov 17 19:54:04 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 17 Nov 2014 13:54:04 -0500 Subject: [CentralOH] Balanced Parentheses In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: <20141117135404.757749bb.jep200404@columbus.rr.com> On Mon, 17 Nov 2014 23:30:44 +0800, iynaix wrote: > Is the example of the balancing parens an academic exercise? Yes, very much so, for thought, practice, and discussion about making good code in both little and big ways. Little things are important because bad code is often death by a thousand cuts, not just one big bad thing. -------------------------------------------------------------------------------- > print(repr(s), s.count('(') == s.count(')')) That reminds me that I should have supplied the test code also so that you knew what the expected results and implied fuller definition of the task were. I do so now in the attachments. The tests passed in the style of https://github.com/james-prior/tdd-demo/blob/master/README.md -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: balance_parens.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: test_parens_are_balanced.py URL: From jep200404 at columbus.rr.com Tue Nov 18 00:39:19 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 17 Nov 2014 18:39:19 -0500 Subject: [CentralOH] Conda Versus Virtualenv In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> Message-ID: <20141117183919.1c2315b2.jep200404@columbus.rr.com> On Mon, 17 Nov 2014 10:16:26 -0500, Eric Floehr wrote: [> On Mon, 17 Nov 2014 09:55:41 -0500, jep200404 at columbus.rr.com wrote:] > > What's best way to install ... _and_ virtualenv? > ... uses conda as the package and environment manager[2]. What do you think of conda versus virtualenv? Would you drop (or have you dropped) virtualenv to use conda instead? From liza at checkio.com Wed Nov 19 01:15:57 2014 From: liza at checkio.com (Liza Avramenko) Date: Tue, 18 Nov 2014 16:15:57 -0800 Subject: [CentralOH] PyOhio Message-ID: Hi PyPeople, I wanted to run by you CheckiO - the game for PyCoders and an open platform for AI gaming. We see a lot of coders using it to pump up their skills by solving and seeing solutions of others, or to teach others to show that coding is fun, or to create and publish their own AI games so that all the world competes at the best algorithms for you challenges. Would love to hear your feedback or simply see CheckiO being helpful to you in any possible ways. Liza Avramenko CEO, CheckiO [image: Inline image 7] [image: Inline image 6] [image: Inline image 3] -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Thu Nov 20 14:40:36 2014 From: eric at intellovations.com (Eric Floehr) Date: Thu, 20 Nov 2014 08:40:36 -0500 Subject: [CentralOH] PyOhio In-Reply-To: References: Message-ID: CheckiO is a pretty cool site that emphasizes the game and social aspects coding puzzles, and it a fun way to sharpen your Python skills. Like other sites like CodeWars, you solve posed problems in code for points. Where it differs from sites like CodeWars is it is more explicitly set up as a game, and more likely to be interesting to school-age programmers. It also focuses completely on Python. Unfortunately, I haven't found within CheckiO a good on-ramp... Like other sites, it assumes you already know how to code. With the more gamey nature of CheckiO (versus say the more StackOverflowish feel of CodeWars), I think it would be a great new way to learn Python. You *could* learn to program with the current set up, but you'd have to be quite dedicated. It presumes you already know what arrays and for loops, etc. are as best as I can tell. Anyway, check it out... it's a fun way to hone your programming skills. CheckiO was also a startup sponsor of PyOhio, and is active in the Python community. Cheers, Eric On Tue, Nov 18, 2014 at 7:15 PM, Liza Avramenko wrote: > Hi PyPeople, > > I wanted to run by you CheckiO > - > the game for PyCoders and an open platform for AI gaming. We see a lot of > coders using it to pump up their skills by solving and seeing solutions of > others, or to teach others to show that coding is fun, or to create and > publish their own AI games so that all the world competes at the best > algorithms for you challenges. > > Would love to hear your feedback or simply see CheckiO being helpful to > you in any possible ways. > > > > Liza Avramenko > > CEO, CheckiO > > > > [image: Inline image 7] > [image: > Inline image 6] > [image: > Inline image 3] > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From liza at checkio.com Fri Nov 21 01:04:32 2014 From: liza at checkio.com (Liza Avramenko) Date: Thu, 20 Nov 2014 16:04:32 -0800 Subject: [CentralOH] PyOhio In-Reply-To: References: Message-ID: Eric, Thank you a lot for such a great overview. And yes, you are totally correct - we don't teach coding, we help people practice and become experts in coding, up to building complex AI systems. We are looking for the best ways to onboard those who came to CheckiO thinking they can learn, either by partnering with some other coding schools where we could refer our users to or building an explicit page with all the best resources to start learning. It has not been announced officially yet but in January we are launching JS as the second language and we are also starting a series of global Top Python Coder competitions, with Japan kicking it off in December. Would love to hear community feedback. Hope you can find value in the game. Have an amazing rest of the week Liza Avramenko CEO, CheckiO [image: Inline image 7] [image: Inline image 6] [image: Inline image 3] On Thu, Nov 20, 2014 at 5:40 AM, Eric Floehr wrote: > CheckiO is a pretty cool site that emphasizes the game and social aspects > coding puzzles, and it a fun way to sharpen your Python skills. Like other > sites like CodeWars, you solve posed problems in code for points. > > Where it differs from sites like CodeWars is it is more explicitly set up > as a game, and more likely to be interesting to school-age programmers. It > also focuses completely on Python. > > Unfortunately, I haven't found within CheckiO a good on-ramp... Like other > sites, it assumes you already know how to code. With the more gamey nature > of CheckiO (versus say the more StackOverflowish feel of CodeWars), I think > it would be a great new way to learn Python. You *could* learn to program > with the current set up, but you'd have to be quite dedicated. It presumes > you already know what arrays and for loops, etc. are as best as I can tell. > > Anyway, check it out... it's a fun way to hone your programming skills. > > CheckiO was also a startup sponsor of PyOhio, and is active in the Python > community. > > Cheers, > Eric > > > On Tue, Nov 18, 2014 at 7:15 PM, Liza Avramenko wrote: > >> Hi PyPeople, >> >> I wanted to run by you CheckiO >> - >> the game for PyCoders and an open platform for AI gaming. We see a lot of >> coders using it to pump up their skills by solving and seeing solutions of >> others, or to teach others to show that coding is fun, or to create and >> publish their own AI games so that all the world competes at the best >> algorithms for you challenges. >> >> Would love to hear your feedback or simply see CheckiO being helpful to >> you in any possible ways. >> >> >> >> Liza Avramenko >> >> CEO, CheckiO >> >> >> >> [image: Inline image 7] >> [image: >> Inline image 6] >> [image: >> Inline image 3] >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at yanovich.net Fri Nov 21 03:37:39 2014 From: michael at yanovich.net (michael at yanovich.net) Date: Thu, 20 Nov 2014 21:37:39 -0500 Subject: [CentralOH] GitHub teaching Git, locally Message-ID: <546EA573.6020808@yanovich.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 GitHub is apparently going to be teaching Git for free at TechColumbus to anybody interested. Though, they are asking people to RSVP first. Many of you might find this interesting for keeping track of changes in your code if you aren't using a version control system already. Also, it seems it is aimed towards beginners of Git and/or GitHub, but if you are skilled in Git and want to help out, they are welcoming people to sign up as mentors. The 'gist': *For*: Git and GitHub beginners. *When*: Monday, November 24, 6:30-9:00pm. *Where*: TechColumbus, 1275 Kinnear Rd., Columbus, OH *RSVP*: https://ti.to/github-events/patchwork-columbus Their blog has more details on the event[1]. [1]: https://github.com/blog/1926-patchwork-night-columbus-ohio-edition -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJUbqVsAAoJEKBpQL3CDq4dVNcQAK002lo84G4bseITUNAXYoQ5 aEUIVfG0OuJ5vXnSmbs9v1IiPNUDLV6SL9fWAvCHrxavsEBrOIAlLfbX9bkyYFaD 1Sa8oEjdZ5vWoQ0JAL5Xl95d2TnwVR9CBLEAd9w9Lh5TYBAAt4x/ggKLGTDUECr2 CKGCVANcqcoYDhEfR3sO2/vqVlmA+SB9D/Z/jJfiomGPBIaHomNCA5czrPCLKmtn N5xUgG5oAvvEaW4v3sBpgVfHcIG+r8utlylGYUCO9G8MfXbEtUajerL6ixcefxml NwfnXW2jvmWG7Dp5rabx62LzwzbX5DRP7q5PkYlpHU47qxoV2XMslX9zUyUFGm47 m3h98wfHlr9MbBdjJokvhvLNBU+Ekl/5X+i56IVEYyfgzYxiiUDjR/nvcEx6lFLq AV4SvXTl5AuMiZNeuXVeJF9qR0zLEXpNaBJXIO+FcBjqLb3WGAAF/mh9U+pA1eeY hx1WRjoJIN2vZ/GErHoRhw9DLpRYuwebCr2pauz4XUdYW+RuNO+xNg0KUCgRz8oe p4RbTO/EHYAfoRMLMKRx8s+SB37AePSwQPDxDUjp6bqYb2TYxYGChLmFyvBMRkJh FULvc9nyVl2GXOgQsV9Mr3vekixnIMb8CXM46kIL2c1x18gWxhZOCV9T8en9ayHY bCWcrgq4XhpGWD3q//lv =KFUP -----END PGP SIGNATURE----- From pybokeh at gmail.com Sat Nov 22 18:34:25 2014 From: pybokeh at gmail.com (pybokeh) Date: Sat, 22 Nov 2014 12:34:25 -0500 Subject: [CentralOH] Conda Versus Virtualenv In-Reply-To: <20141117183919.1c2315b2.jep200404@columbus.rr.com> References: <20141117095541.747e03f8.jep200404@columbus.rr.com> <20141117183919.1c2315b2.jep200404@columbus.rr.com> Message-ID: I have been using conda/miniconda on Windows at work and virtualenv/pyvenv at home on Linux machine. But on my Linux machine, I have dropped pyvenv recently and just use miniconda for now on. It saves so much time from having to compile the source and the miniconda/Anaconda distribution has most of the packages I need. For packages it doesn't have, I can still use pip to install them. The only disadvantage I can think of using miniconda is maybe you have to wait a week or two longer to get the latest and greatest version of a package or when a new version of Python comes out, you'll have to wait even longer still. But that's minor IMO. On Mon, Nov 17, 2014 at 6:39 PM, wrote: > On Mon, 17 Nov 2014 10:16:26 -0500, Eric Floehr > wrote: > > [> On Mon, 17 Nov 2014 09:55:41 -0500, jep200404 at columbus.rr.com wrote:] > > > > What's best way to install ... _and_ virtualenv? > > > ... uses conda as the package and environment manager[2]. > > What do you think of conda versus virtualenv? > Would you drop (or have you dropped) virtualenv to use conda instead? > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdsantiagojr at gmail.com Sat Nov 22 20:02:44 2014 From: jdsantiagojr at gmail.com (John Santiago) Date: Sat, 22 Nov 2014 14:02:44 -0500 Subject: [CentralOH] Conda Versus Virtualenv In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> <20141117183919.1c2315b2.jep200404@columbus.rr.com> Message-ID: This is the first time I have heard of conda. Would you reccommend using it over venv. What are some of the advantages over venv? On Nov 22, 2014 12:34 PM, "pybokeh" wrote: > I have been using conda/miniconda on Windows at work and virtualenv/pyvenv > at home on Linux machine. > But on my Linux machine, I have dropped pyvenv recently and just use > miniconda for now on. > It saves so much time from having to compile the source and the > miniconda/Anaconda distribution > has most of the packages I need. For packages it doesn't have, I can > still use pip to install them. > The only disadvantage I can think of using miniconda is maybe you have to > wait a week or two longer > to get the latest and greatest version of a package or when a new version > of Python comes out, you'll > have to wait even longer still. But that's minor IMO. > > On Mon, Nov 17, 2014 at 6:39 PM, wrote: > >> On Mon, 17 Nov 2014 10:16:26 -0500, Eric Floehr >> wrote: >> >> [> On Mon, 17 Nov 2014 09:55:41 -0500, jep200404 at columbus.rr.com wrote:] >> >> > > What's best way to install ... _and_ virtualenv? >> >> > ... uses conda as the package and environment manager[2]. >> >> What do you think of conda versus virtualenv? >> Would you drop (or have you dropped) virtualenv to use conda instead? >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Sat Nov 22 21:03:29 2014 From: pybokeh at gmail.com (pybokeh) Date: Sat, 22 Nov 2014 15:03:29 -0500 Subject: [CentralOH] Conda Versus Virtualenv In-Reply-To: References: <20141117095541.747e03f8.jep200404@columbus.rr.com> <20141117183919.1c2315b2.jep200404@columbus.rr.com> Message-ID: If you are on Windows machine and will be using numpy/scipy, definitely use conda over virtualenv/pyvenv. On Linux, if you don't mind waiting longer to install packages, then sure go right ahead and use virtualenv/pyvenv over conda. You will then have the latest version of the packages in the repositories. Virtualenv/pyven and conda are similar except with conda, it has pre-compiled packages that it just downloads and then installs right from the get-go. So no compilation step, no need to have C or Fortran compilers. With virtualenv/pyvenv depending on the package, there's an additional and longer compilation step. So if you're using Linux machine and not using packages that depend on C or Fortran compilation, maybe there isn't too much advantage to using conda over virtualenv/pyvenv. But conda has some nifty commands that make it easy to create a python 2 vs python 3 environment. For example, if you install conda installation for python 3, you can still create a python 2 environment by just adding python=2 or python=2.7 in the conda command ( http://continuum.io/blog/anaconda-python-3). I can see if you just want to stick with the tooling that comes with your default Python installation that you would just stick with pyvenv instead of having to install a 3rd party package management system like Anaconda/conda. But for me, I just got tired of the hassle with compiling. For a list of packages that are available by default by conda: http://docs.continuum.io/anaconda/pkg-docs.html CAVEAT: I've only been using Python for maybe 4 or 5 yrs and Linux even less, so I could be wrong with the details. I'm sure a Python veteran can better explain or correct me. All I know for sure, if you're using Windows and need to make Python virtual environments, you really have no choice but use conda. On Nov 22, 2014 2:04 PM, "John Santiago" wrote: > This is the first time I have heard of conda. Would you reccommend using > it over venv. What are some of the advantages over venv? > On Nov 22, 2014 12:34 PM, "pybokeh" wrote: > >> I have been using conda/miniconda on Windows at work and >> virtualenv/pyvenv at home on Linux machine. >> But on my Linux machine, I have dropped pyvenv recently and just use >> miniconda for now on. >> It saves so much time from having to compile the source and the >> miniconda/Anaconda distribution >> has most of the packages I need. For packages it doesn't have, I can >> still use pip to install them. >> The only disadvantage I can think of using miniconda is maybe you have to >> wait a week or two longer >> to get the latest and greatest version of a package or when a new version >> of Python comes out, you'll >> have to wait even longer still. But that's minor IMO. >> >> On Mon, Nov 17, 2014 at 6:39 PM, wrote: >> >>> On Mon, 17 Nov 2014 10:16:26 -0500, Eric Floehr >>> wrote: >>> >>> [> On Mon, 17 Nov 2014 09:55:41 -0500, jep200404 at columbus.rr.com wrote:] >>> >>> > > What's best way to install ... _and_ virtualenv? >>> >>> > ... uses conda as the package and environment manager[2]. >>> >>> What do you think of conda versus virtualenv? >>> Would you drop (or have you dropped) virtualenv to use conda instead? >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >> >> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> >> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Sun Nov 23 05:42:32 2014 From: pybokeh at gmail.com (pybokeh) Date: Sat, 22 Nov 2014 23:42:32 -0500 Subject: [CentralOH] My Python Learning Path Message-ID: A few of us were asked at the last meet-up how they learned Python. So I like to share how I learned. Although I did learn Java before learning Python, so I wasn't completely new to programming. But mind you, I've been only using Python for about 4 or 5 years and mostly around data analysis. I mostly learned from books. The popular ones seem to be: Learning Python by Mark Lutz (very in-depth) Learning Python the Hard Way by Zed Shaw Python Cookbook by David Beazley and Brian K. Jones Writing Idiomatic Python by Jeff Knupp I have read these and they are really good. But my first book and most favorite was "Python Power!: The Comprehensive Guide", but it is sort of old and newer editions for it hasn't been made. So it is just for Python 2. It is my favorite because it showed wide range of practical examples and had just the right amount of depth to get you started. Some Python books can be found here: http://www.it-ebooks.info/search/?q=python&type=title I also have learned from videos, but not too often. My favorite youtube channel is by this guy: https://www.youtube.com/user/sentdex To reinforce what I've learned or to see if I really understood the concepts, I'll try some puzzles at www.codingbat.com/python and recently I've been checking out www.checkio.org. If you're very mathy, people seem to like https://projecteuler.net Oh, I have to put in a word about MATPLOTLIB. Great plotting library, but the official documentation is not great IMO because on some of their examples they show MATLAB-style API usage and on others they show OOP (object oriented programming) style API usage. This really confused the heck out of me. Not until I ran into this awesome tutorial did it really sink in for me: http://nbviewer.ipython.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-4-Matplotlib.ipynb If you don't like the default color or style of MATPLOTLIB, check out style sheets: http://matplotlib.org/users/style_sheets.html But a plotting library that I hope will really take off in popularity is Yhat's ggplot. It isn't quite ready for Python 3 (Python 2 works ok with it), but should be within a few weeks. They finally fixed it in their github repository, but just not yet in production. But creating charts in ggplot is so much more convenient and intuitive in my opinion compared to MATPLOTLIB. But you should still learn MATPLOTLIB since it is so flexible in that you can pretty much control or customize any component or part of a chart. These are non web-based plotting libraries. There are some really neat looking web-based plotting libraries, but as for starting off, they are more complicated to use or setup. After I reached around intermediate level, I then learned about making virtual environments. I won't talk any more further about it, but let's just say you'll eventually want to invest in learning about making virtual environments using pyvenv or Anaconda conda package management system. Finally, in last couple of years I've been learning and using IPython notebooks. They are great and sort of hard to explain to others. Basically, it allows you to run Python code within a browser and share it. It is great for when you want to maintain reproduceability of how you went about running your Python code and explaining it in a nice bloggish/HTML looking format. So you can also embed multimedia format like images or videos. You can create your own IPython notebook server which can be tricky to install by yourself or you can try out cloud-based/3rd party-supplied servers like https://wakari.io or https://cloud.sagemath.com. If you just want to temporarily check out an IPython notebook, you can visit https://tmpnb.org There are some limitations with it, such as you can't grab data from the web that you want to plot. Instead, you'll have to randomly generate your own data locally. Otherwise, it is great for playing around with it. As for getting help, I've gotten help from other Python meet-up members, googled, searched stackoverflow, posted on google groups, and as last resort, used IRC. Of course if you can find a mentor, that'll be the best. I wish I could find one. Well, that's pretty much has been my path to learning Python. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Sun Nov 23 14:03:37 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sun, 23 Nov 2014 08:03:37 -0500 Subject: [CentralOH] My Python Learning Path: Videos Not Too Often: Try Brandon Rhodes' Videos In-Reply-To: References: Message-ID: <20141123080337.4392a58e.jep200404@columbus.rr.com> On Sat, 22 Nov 2014 23:42:32 -0500, pybokeh wrote: > I also have learned from videos, but not too often. Search for Brandon Rhodes at pyvideo.org. From jep200404 at columbus.rr.com Sun Nov 23 17:18:31 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sun, 23 Nov 2014 11:18:31 -0500 Subject: [CentralOH] Some Python Videos In-Reply-To: <20141123080337.4392a58e.jep200404@columbus.rr.com> References: <20141123080337.4392a58e.jep200404@columbus.rr.com> Message-ID: <20141123111831.5470eed5.jep200404@columbus.rr.com> On Sun, 23 Nov 2014 08:03:37 -0500, jep200404 at columbus.rr.com wrote: > On Sat, 22 Nov 2014 23:42:32 -0500, pybokeh wrote: > > > I also have learned from videos, but not too often. > > Search for Brandon Rhodes at pyvideo.org. for beginners: http://pyvideo.org/video/542/pyohio-2011-names-objects-and-plummeting-from for others: http://pyvideo.org/video/524/pyohio-2011-squinting-at-python-objects http://pyvideo.org/video/1599/a-python-sthetic-beauty-and-why-i-python http://pyvideo.org/video/2840/the-clean-architecture-in-python http://pyvideo.org/video/1369/python-design-patterns-1 Separately: http://ipython.org/videos.html From jep200404 at columbus.rr.com Tue Nov 25 01:17:35 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 24 Nov 2014 19:17:35 -0500 Subject: [CentralOH] =?utf-8?q?2014-11-21_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20141124191735.3e39c209.jep200404@columbus.rr.com> Need to come up with a list of stuff for beginners. Where to start to learn Python. How to install it, especially for Microsoft Windows. What other tools and practices are good to have and do. virtualenv (and/or conda?) editors that are designed to be fast to use without using a mouse vim or emacs!!! For windows, which version of emacs should one use? version control: git (slam dunk!) mercurial is good also, but git just dominates mindshare Subversion (aka SVN) is a difficult, awkward, and limiting to use (watch: http://www.youtube.com/watch?v=4XpnKHJAok8) If SVN is a fait accompli where you work, then import the SVN repository in your private git repository, do your real work in git, then export some git versions to SVN respository. Someone else will have to fill in the details on how best to do that. tmux or screen are handy ssh (or putty for Microsoft Windows) It seems that a good way to learn Python is to get a quick start by using the freebie on-line tutorials, then read Learning Python to fill in the gaps and correct errors and bad advice. It seems that all the freebie on-line tutorials have weaknesses. It can be good to study more than one of them at the same time, to compare and contrast them. If you get stuck on one of them, try a different tutorial. Zed Shaw Learn Python The Hard Way http://learnpythonthehardway.org/ How to Think Like a Computer Scientist http://openbookproject.net/thinkcs/python/english2e/ http://interactivepython.org/courselib/static/thinkcspy/index.html Then study Learning Python by Mark Lutz because it is comprehensive, has few errors, and is gentle for beginners. Learning Python is careful to progress incrementally from the simple to the complex, and is careful to not talk about things that have not been defined, except in a few cases where they have to. One could write a comprehensive book that is small, but it would be hard for beginners to follow. To be comprehensive _and_ gentle, it is a HUGE book. The huge size of the book intimidates people, especially beginners, but it should not. It is huge _because_ it is gentle. I have heard good things about Invent Your Own Computer Games with Python, but have no experience with it. It is not a substitute for Learning Python. http://inventwithpython.com/ slice & dice: can insert into and delete from lists >>> a = list(range(5)) >>> a [0, 1, 2, 3, 4] >>> a[2:4] [2, 3] >>> a[2:4] = [] # Deletes from middle of list. >>> a [0, 1, 4] >>> a[2:2] [] >>> a[2:2] = ['hello', 'world'] # Inserts in middle list. >>> a [0, 1, 'hello', 'world', 4] # Appends to end of list. (.append() is better) >>> a[5:5] = ['extra'] >>> a [0, 1, 'hello', 'world', 4, 'extra'] >>> a[0:0] = ['ante'] # Inserts at beginning. >>> a ['ante', 0, 1, 'hello', 'world', 4, 'extra'] >>> (I wonder how much of that reinvents what Jason did in a lightning talk a few months ago.) If one wants to start at 1 and do a loop n times, the common code pattern has a <= n test >>> def do_n_times_starting_at_one(n): ... i = 1 ... while i <= n: ... print i ... i += 1 ... >>> do_n_times_starting_at_one(3) 1 2 3 >>> But starting at one, is usually _not_ what one wants to do in computers. very common code pattern in many programming languages: loop executes n times first value is zero (NOT 1) last value in loop is n-1 (NOT n) test is < n. comparison is <, not <= compared value is n, not n-1 next value is made at end of loop >>> def do_n_times(n): ... i = 0 ... while i < n: ... print i ... i += 1 ... >>> do_n_times(3) 0 1 2 >>> A more Pythonic way of doing the above follows. >>> def do_n_times(n): ... for i in range(n): ... print i ... >>> do_n_times(3) 0 1 2 >>> i is often used to index into data that one is going through. However in Python, one can often go through data one thing at a time, without have an index, so one often does something like the following fake Python code: >>> def do_stuff(data_collection): ... for thing in data_collection: ... print thing ... >>> do_stuff(['hello', 3.14159+2.71828j, True, 42]) hello (3.14159+2.71828j) True 42 >>> http://www.vim.org/download.php#pc Some people like sublime text much. It's proprietary. wp:Sublime Text Indent/unindent EMACS ^C> ^C< vim >> << Can yaml do ordered dicts? Yup. They be called "ordered maps" for YAML. http://yaml.org/type/omap.html http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts Compay Segundo - Buena Vista Social Club youtube.com/watch?v=2h2fdZ6XpR8 Tech Talk: Linus Torvalds on git http://www.youtube.com/watch?v=4XpnKHJAok8 tmux in cygwin Important for TDD The Clean Architecture in Python http://pyvideo.org/video/2840/the-clean-architecture-in-python Maybe conda is OK to use instead of virtualenv. http://technicaldiscovery.blogspot.com/2013/12/why-i-promote-conda.html wp:Ferrari 550 http://www.checkio.org/ (requires javascript) https://github.com/pybokeh Someone had a very cool way of teaching/playing with C++ by using Ipython Notebook. %load_ext cpp stuff http://www.hubspot.com/ >>> 'foo %(ptyhon)s bar' % {'ptyhon': 'hello', 'big': 9999, 'pi': 3.14159} 'foo hello bar' One person likes: Python Power!: The Comprehensive Guide - Python http://www.meetup.com/Papers-We-Love-Columbus/events/189943332/ https://github.com/papers-we-love/papers-we-love https://github.com/papers-we-love/papers-we-love/blob/master/design/out-of-the-tar-pit.pdf?raw=true wp:CiviCRM wp:Affero General Public License wp:Bradley M. Kuhn http://itrevolution.com/the-history-of-devops/ never sleeps wp:Mechanical advantage wp:Gear ratio wp:Bicycle chain wp:sprocket wp:Rust (programming language) From smashing_good_show at hotmail.com Tue Nov 25 02:14:15 2014 From: smashing_good_show at hotmail.com (timothy spencer) Date: Mon, 24 Nov 2014 17:14:15 -0800 Subject: [CentralOH] What is a 'bucket'? In-Reply-To: References: Message-ID: Hello everyone. What is a 'bucket'? I think that I may be over-thinking this. I know that a dictionary is a list of 'key: value' pairs. Is a bucket simply the slot where a pair would go? I am wondering if a bucket is a slot where multiple tuples would go. Like if a dictionary is horizontal, then I am wondering if a bucket then is a vertical slot that can have lots of tuples. Lists within lists.. Then again, perhaps it is just a slot that only holds one key:value pair. I am on Zed Shaw's book in EX 39, and his description is a little odd. Let me know, thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Tue Nov 25 03:41:46 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 24 Nov 2014 21:41:46 -0500 Subject: [CentralOH] What is a 'bucket'? Message-ID: I think based on those comments embedded in Zed's example functions, a "bucket" is a slot that holds a value from any type of container or data structure like a list or tuple or dictionary. At least that is how I interpret it. On Mon, Nov 24, 2014 at 8:14 PM, timothy spencer < smashing_good_show at hotmail.com> wrote: > > Hello everyone. What is a 'bucket'? I think that I may be over-thinking > this. I know that a dictionary is a list of 'key: value' pairs. Is a bucket > simply the slot where a pair would go? I am wondering if a bucket is a slot > where multiple tuples would go. Like if a dictionary is horizontal, then I > am wondering if a bucket then is a vertical slot that can have lots of > tuples. Lists within lists.. Then again, perhaps it is just a slot that > only holds one key:value pair. I am on Zed Shaw's book in EX 39, and his > description is a little odd. > > Let me know, thanks, > > Tim > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Tue Nov 25 03:47:48 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 24 Nov 2014 21:47:48 -0500 Subject: [CentralOH] GitHub teaching Git, locally Message-ID: Thanks for the heads up! Took the class and enjoyed it. I've had a Github account to just back up a collection of my Python code, but never learned how to contribute to other people's project. Now I know how. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pybokeh at gmail.com Tue Nov 25 03:58:04 2014 From: pybokeh at gmail.com (pybokeh) Date: Mon, 24 Nov 2014 21:58:04 -0500 Subject: [CentralOH] =?utf-8?q?2014-11-21_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= In-Reply-To: <20141124191735.3e39c209.jep200404@columbus.rr.com> References: <20141124191735.3e39c209.jep200404@columbus.rr.com> Message-ID: For those wondering what it means when someone say Python code is idiomatic or Pythonic, here is a video that I thought was helpful by a great speaker / Python core developer named Raymond Hettinger: https://www.youtube.com/watch?v=OSGv2VnC0go On Mon, Nov 24, 2014 at 7:17 PM, wrote: > very common code pattern in many programming languages: > > loop executes n times > first value is zero (NOT 1) > last value in loop is n-1 (NOT n) > test is < n. > comparison is <, not <= > compared value is n, not n-1 > next value is made at end of loop > > >>> def do_n_times(n): > ... i = 0 > ... while i < n: > ... print i > ... i += 1 > ... > >>> do_n_times(3) > 0 > 1 > 2 > >>> > > A more Pythonic way of doing the above follows. > > >>> def do_n_times(n): > ... for i in range(n): > ... print i > ... > >>> do_n_times(3) > 0 > 1 > 2 > >>> > > i is often used to index into data that one is going through. > However in Python, one can often go through data one thing at a time, > without have an index, > so one often does something like the following fake Python code: > > >>> def do_stuff(data_collection): > ... for thing in data_collection: > ... print thing > ... > >>> do_stuff(['hello', 3.14159+2.71828j, True, 42]) > hello > (3.14159+2.71828j) > True > 42 > >>> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nludban at columbus.rr.com Tue Nov 25 04:32:10 2014 From: nludban at columbus.rr.com (Neil Ludban) Date: Mon, 24 Nov 2014 22:32:10 -0500 Subject: [CentralOH] What is a 'bucket'? In-Reply-To: References: Message-ID: <20141124223210.5cd1c929.nludban@columbus.rr.com> http://en.wikipedia.org/wiki/Hash_table EX 39 looks like this variation: http://en.wikipedia.org/wiki/Hash_table#Separate_chaining """In the method known as separate chaining, each bucket is independent, and has some sort of list of entries with the same index.""" Note that "index" here is defined as the output of the hash function, and entries are key,value pairs. Compare with another variation where a bucket is a key,value pair: http://en.wikipedia.org/wiki/Hash_table#Open_addressing On Mon, 24 Nov 2014 17:14:15 -0800 timothy spencer wrote: > > > > Hello everyone. What is a 'bucket'? I think that I may be over-thinking this. I know that a dictionary is a list of 'key: value' pairs. Is a bucket simply the slot where a pair would go? I am wondering if a bucket is a slot where multiple tuples would go. Like if a dictionary is horizontal, then I am wondering if a bucket then is a vertical slot that can have lots of tuples. Lists within lists.. Then again, perhaps it is just a slot that only holds one key:value pair. I am on Zed Shaw's book in EX 39, and his description is a little odd. > > Let me know, thanks, > > Tim > From jep200404 at columbus.rr.com Tue Nov 25 15:15:45 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Tue, 25 Nov 2014 09:15:45 -0500 Subject: [CentralOH] Zed's ex39 In-Reply-To: References: Message-ID: <20141125091545.23f4328e.jep200404@columbus.rr.com> On Mon, 24 Nov 2014 17:14:15 -0800, timothy spencer wrote: > I am on Zed Shaw's book in EX 39, ... A URL for that is: http://learnpythonthehardway.org/book/ex39.html > What is a 'bucket'? > Is a bucket simply the slot where a pair would go? The artful terms bucket and slot should be defined before they are used. That they are not is an example of how the on-line tutorials have weaknesses. You should document them in your source code and bring it to a dojo for discussion and rework. The first paragraph on page 25 of Learning Python 5th edition says in part: When people write software, they are not writing it for themselves. In fact, they are not even writing primarily for the computer. Rather good programmers know tha the code is written for the next human being who has to read it in order to maintain or reuse it. If that person cannot understand the code, it's all but useless in a realistic development scenario. In other words, programming is not about being clever and obscure - it's about how clearly your program communicates its purpose. > I know that a dictionary is a list of 'key: value' pairs. That's almost correct. A Python list is ordered. A Python dictionary is not ordered, so a Python dictionary is not a list. > Like if a dictionary is horizontal, then I am wondering if a > bucket then is a vertical slot that can have lots of tuples. Draw me a picture. ASCII art is good. > ... and his description is a little odd. His code for hashmap.py is mediocre. There may be good reasons for the mediocrity in a tutorial, such as serving as an example of how to do things awkwardly, then showing the better way later. Does the author improve the code later? Here are some of the things I notice. That get_slot() returns a copy of the key argument seems superfluous. The key return value is not used in the two places that call get_slot(). So don't return the key. That line 4 of hashmap.py uses range(0, num_buckets) instead of range(num_buckets) is odd. What rationale can you think of for using range(0, num_buckets) instead of range(num_buckets)? I would just use range(num_buckets). It's curious that he uses range() on line 4, but xrange() on line 53. What's the rationale for using one instead of the other? The get_bucket() call on line 39 is redundant with the get_bucket() call on line 23 when get_slot is called on line 40. I would have get_slot() return bucket in its return tuple, and delete line 39. How would the code work if line 57 was a return instead of a break? Which do you prefer? Why? Compare that with line 28. Compare those with using an else: clause for the for loop. What do you think of line 62? Is it necessary? Does it show that the author does not know how Python "does nothing" gracefully? Is the author saving this clutziness for later refactoring or does the author just write mediocre code? Line 25 uses enumerate(). Could you use enumerate() to combine lines 53 and 54? Would that be an improvement or make things worse? Is xrange(len(foo)) ugly or Pythonic? What should delete() do if no "slot" has the key? What's a better name for get()? How about get_value? bucket_id on line 16 is used as an index. I.e., bucket_id is not an ID. It's a feeble name. A better name would be bucket_index. What name is better yet? Most of the free on-line tutorials have weaknesses. I would say that the documentation is a bit thin, and his code should be refactored. You should always be looking for ways that the code could be improved. What other opportunities for improvement do you see? Much code in the real world is worse. On Mon, 24 Nov 2014 21:58:04 -0500, pybokeh wrote: > here is a video that I thought was helpful by a great speaker > / Python core developer named Raymond Hettinger: > https://www.youtube.com/watch?v=OSGv2VnC0go That's a fun video. It covers some of the things I did. How would one change get_slot() after my changes above and after watching the video? From smashing_good_show at hotmail.com Tue Nov 25 15:56:05 2014 From: smashing_good_show at hotmail.com (timothy spencer) Date: Tue, 25 Nov 2014 06:56:05 -0800 Subject: [CentralOH] CentralOH Digest, Vol 91, Issue 16 In-Reply-To: References: Message-ID: I will be looking at those links later today. Thanks for the direction. > From: centraloh-request at python.org > Subject: CentralOH Digest, Vol 91, Issue 16 > To: centraloh at python.org > Date: Tue, 25 Nov 2014 12:00:02 +0100 > > Send CentralOH mailing list submissions to > centraloh at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/centraloh > or, via email, send a message with subject or body 'help' to > centraloh-request at python.org > > You can reach the person managing the list at > centraloh-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of CentralOH digest..." > > > Today's Topics: > > 1. Re: What is a 'bucket'? (Neil Ludban) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 24 Nov 2014 22:32:10 -0500 > From: Neil Ludban > To: "Mailing list for Central Ohio Python User Group \(COhPy\)" > > Cc: timothy spencer > Subject: Re: [CentralOH] What is a 'bucket'? > Message-ID: <20141124223210.5cd1c929.nludban at columbus.rr.com> > Content-Type: text/plain; charset=US-ASCII > > http://en.wikipedia.org/wiki/Hash_table > > EX 39 looks like this variation: > > http://en.wikipedia.org/wiki/Hash_table#Separate_chaining > """In the method known as separate chaining, each bucket is independent, > and has some sort of list of entries with the same index.""" > > Note that "index" here is defined as the output of the hash function, > and entries are key,value pairs. > > > Compare with another variation where a bucket is a key,value pair: > > http://en.wikipedia.org/wiki/Hash_table#Open_addressing > > > On Mon, 24 Nov 2014 17:14:15 -0800 > timothy spencer wrote: > > > > > > > > Hello everyone. What is a 'bucket'? I think that I may be over-thinking this. I know that a dictionary is a list of 'key: value' pairs. Is a bucket simply the slot where a pair would go? I am wondering if a bucket is a slot where multiple tuples would go. Like if a dictionary is horizontal, then I am wondering if a bucket then is a vertical slot that can have lots of tuples. Lists within lists.. Then again, perhaps it is just a slot that only holds one key:value pair. I am on Zed Shaw's book in EX 39, and his description is a little odd. > > > > Let me know, thanks, > > > > Tim > > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > > ------------------------------ > > End of CentralOH Digest, Vol 91, Issue 16 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From smashing_good_show at hotmail.com Wed Nov 26 21:15:11 2014 From: smashing_good_show at hotmail.com (timothy spencer) Date: Wed, 26 Nov 2014 12:15:11 -0800 Subject: [CentralOH] CentralOH Digest, Vol 91, Issue 17 In-Reply-To: References: Message-ID: I will bring my questions into the next Dojo for sure. I haven't gotten all the way through Ex 39 yet. One thing that I have learned that is pretty neat from another tutorial is that I can take one list or dictionary, and set that to a key in another dictionary, creating a dictionary within a dictionary, e.g. I still need to read through that Hash Table page in Wikipedia too. > From: centraloh-request at python.org > Subject: CentralOH Digest, Vol 91, Issue 17 > To: centraloh at python.org > Date: Wed, 26 Nov 2014 12:00:01 +0100 > > Send CentralOH mailing list submissions to > centraloh at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/centraloh > or, via email, send a message with subject or body 'help' to > centraloh-request at python.org > > You can reach the person managing the list at > centraloh-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of CentralOH digest..." > > > Today's Topics: > > 1. Zed's ex39 (jep200404 at columbus.rr.com) > 2. Re: CentralOH Digest, Vol 91, Issue 16 (timothy spencer) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 25 Nov 2014 09:15:45 -0500 > From: jep200404 at columbus.rr.com > To: "Mailing list for Central Ohio Python User Group \(COhPy\)" > > Subject: [CentralOH] Zed's ex39 > Message-ID: <20141125091545.23f4328e.jep200404 at columbus.rr.com> > Content-Type: text/plain; charset=US-ASCII > > On Mon, 24 Nov 2014 17:14:15 -0800, timothy spencer wrote: > > > I am on Zed Shaw's book in EX 39, ... > > A URL for that is: > http://learnpythonthehardway.org/book/ex39.html > > > What is a 'bucket'? > > > Is a bucket simply the slot where a pair would go? > > The artful terms bucket and slot should be defined before they > are used. That they are not is an example of how the on-line > tutorials have weaknesses. You should document them in your > source code and bring it to a dojo for discussion and rework. > > The first paragraph on page 25 of Learning Python 5th edition > says in part: > > When people write software, they are not writing it for > themselves. In fact, they are not even writing primarily > for the computer. Rather good programmers know tha the > code is written for the next human being who has to read > it in order to maintain or reuse it. If that person cannot > understand the code, it's all but useless in a realistic > development scenario. In other words, programming is not > about being clever and obscure - it's about how clearly > your program communicates its purpose. > > > I know that a dictionary is a list of 'key: value' pairs. > > That's almost correct. A Python list is ordered. > A Python dictionary is not ordered, > so a Python dictionary is not a list. > > > Like if a dictionary is horizontal, then I am wondering if a > > bucket then is a vertical slot that can have lots of tuples. > > Draw me a picture. ASCII art is good. > > > ... and his description is a little odd. > > His code for hashmap.py is mediocre. There may be good reasons > for the mediocrity in a tutorial, such as serving as an example > of how to do things awkwardly, then showing the better way later. > Does the author improve the code later? > > Here are some of the things I notice. > > That get_slot() returns a copy of the key argument seems > superfluous. The key return value is not used in the two > places that call get_slot(). So don't return the key. > > That line 4 of hashmap.py uses range(0, num_buckets) instead > of range(num_buckets) is odd. What rationale can you think of > for using range(0, num_buckets) instead of range(num_buckets)? > I would just use range(num_buckets). > > It's curious that he uses range() on line 4, but xrange() on > line 53. What's the rationale for using one instead of the other? > > The get_bucket() call on line 39 is redundant with the > get_bucket() call on line 23 when get_slot is called on > line 40. I would have get_slot() return bucket in its > return tuple, and delete line 39. > > How would the code work if line 57 was a return instead of a break? > Which do you prefer? Why? Compare that with line 28. > Compare those with using an else: clause for the for loop. > > What do you think of line 62? Is it necessary? > Does it show that the author does not know how Python > "does nothing" gracefully? Is the author saving this > clutziness for later refactoring or does the author > just write mediocre code? > > Line 25 uses enumerate(). Could you use enumerate() > to combine lines 53 and 54? Would that be an > improvement or make things worse? > > Is xrange(len(foo)) ugly or Pythonic? > > What should delete() do if no "slot" has the key? > > What's a better name for get()? How about get_value? > > bucket_id on line 16 is used as an index. > I.e., bucket_id is not an ID. > It's a feeble name. A better name would be bucket_index. > What name is better yet? > > Most of the free on-line tutorials have weaknesses. > I would say that the documentation is a bit thin, > and his code should be refactored. You should always > be looking for ways that the code could be improved. > What other opportunities for improvement do you see? > > Much code in the real world is worse. > > On Mon, 24 Nov 2014 21:58:04 -0500, pybokeh wrote: > > > here is a video that I thought was helpful by a great speaker > > / Python core developer named Raymond Hettinger: > > https://www.youtube.com/watch?v=OSGv2VnC0go > > That's a fun video. It covers some of the things I did. > How would one change get_slot() after my changes above > and after watching the video? > > > ------------------------------ > > Message: 2 > Date: Tue, 25 Nov 2014 06:56:05 -0800 > From: timothy spencer > To: "centraloh at python.org" > Subject: Re: [CentralOH] CentralOH Digest, Vol 91, Issue 16 > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > I will be looking at those links later today. Thanks for the direction. > > > From: centraloh-request at python.org > > Subject: CentralOH Digest, Vol 91, Issue 16 > > To: centraloh at python.org > > Date: Tue, 25 Nov 2014 12:00:02 +0100 > > > > Send CentralOH mailing list submissions to > > centraloh at python.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > https://mail.python.org/mailman/listinfo/centraloh > > or, via email, send a message with subject or body 'help' to > > centraloh-request at python.org > > > > You can reach the person managing the list at > > centraloh-owner at python.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of CentralOH digest..." > > > > > > Today's Topics: > > > > 1. Re: What is a 'bucket'? (Neil Ludban) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 24 Nov 2014 22:32:10 -0500 > > From: Neil Ludban > > To: "Mailing list for Central Ohio Python User Group \(COhPy\)" > > > > Cc: timothy spencer > > Subject: Re: [CentralOH] What is a 'bucket'? > > Message-ID: <20141124223210.5cd1c929.nludban at columbus.rr.com> > > Content-Type: text/plain; charset=US-ASCII > > > > http://en.wikipedia.org/wiki/Hash_table > > > > EX 39 looks like this variation: > > > > http://en.wikipedia.org/wiki/Hash_table#Separate_chaining > > """In the method known as separate chaining, each bucket is independent, > > and has some sort of list of entries with the same index.""" > > > > Note that "index" here is defined as the output of the hash function, > > and entries are key,value pairs. > > > > > > Compare with another variation where a bucket is a key,value pair: > > > > http://en.wikipedia.org/wiki/Hash_table#Open_addressing > > > > > > On Mon, 24 Nov 2014 17:14:15 -0800 > > timothy spencer wrote: > > > > > > > > > > > > Hello everyone. What is a 'bucket'? I think that I may be over-thinking this. I know that a dictionary is a list of 'key: value' pairs. Is a bucket simply the slot where a pair would go? I am wondering if a bucket is a slot where multiple tuples would go. Like if a dictionary is horizontal, then I am wondering if a bucket then is a vertical slot that can have lots of tuples. Lists within lists.. Then again, perhaps it is just a slot that only holds one key:value pair. I am on Zed Shaw's book in EX 39, and his description is a little odd. > > > > > > Let me know, thanks, > > > > > > Tim > > > > > > > > > ------------------------------ > > > > Subject: Digest Footer > > > > _______________________________________________ > > CentralOH mailing list > > CentralOH at python.org > > https://mail.python.org/mailman/listinfo/centraloh > > > > > > ------------------------------ > > > > End of CentralOH Digest, Vol 91, Issue 16 > > ***************************************** > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > > ------------------------------ > > End of CentralOH Digest, Vol 91, Issue 17 > ***************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Fri Nov 28 15:39:26 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Fri, 28 Nov 2014 09:39:26 -0500 Subject: [CentralOH] =?utf-8?b?MjAxNC0xMS0yOCDpgZPloLQgRG9qbyBUb25pZ2h0?= In-Reply-To: <20141108145831.5b3ae485.jep200404@columbus.rr.com> References: <20141108145831.5b3ae485.jep200404@columbus.rr.com> Message-ID: <20141128093926.7a5fef5e.jep200404@columbus.rr.com> There _is_ a dojo tonight. Earlier, On Sat, 8 Nov 2014 14:58:31 -0500, jep200404 at columbus.rr.com wrote: > There will not be a dojo on November 28th (Black Friday). That was back when we thought no one would come. However, many people signed up for tonight's dojo, so we are having a dojo like usual. From pybokeh at gmail.com Sat Nov 29 04:17:22 2014 From: pybokeh at gmail.com (pybokeh) Date: Fri, 28 Nov 2014 22:17:22 -0500 Subject: [CentralOH] DOJO November 28, 2014: divmod() and tmpnb.org Message-ID: Thanks to Jim, I found out about the divmod() built-in function. help(divmod) returns: divmod(...) divmod(x, y) -> (div, mod) Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x. Basically, the function returns 2 values in a form of a tuple where the first value is the quotient and the 2nd value is the remainder. example: minutes, seconds = divmod(3600, 60) # unpacking a tuple into 2 variables minutes, seconds = (60, 0) or minutes = 60 and seconds = 0 divmod() came in handy when I tried to make a countdown timer which I am not ashamed of showing how terrible my code is: http://nbviewer.ipython.org/github/pybokeh/ipython_notebooks/blob/master/dates/CountDown.ipynb divmod() eliminated the need for me to handle the remainders of dividing up the years, hours, and minutes. Very nice! I was also curious what other built-in functions are available. You can find out by doing: import builtins dir(builtins) - Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Sat Nov 29 17:38:24 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 29 Nov 2014 11:38:24 -0500 Subject: [CentralOH] =?utf-8?q?2014-11-28_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz86IDEyZG9jLCBkaWN0aW9uYXJpZXMsIGhhc2hpbmcs?= =?utf-8?q?_git=2C_divmod=2C_style?= Message-ID: <20141129113824.7b1de298.jep200404@columbus.rr.com> http://nbviewer.ipython.org/url/colug.net/python/dojo/20141128/dojo-20141128.ipynb We had the place to ourselves, so Wifi was better than usual. wp:Ubuntu Touch wp:BeagleBone#BeagleBone_Black https://pypi.python.org/pypi/pytz wp:associative array One person was confused by looking behind the curtain with Zed's implementation of a toy dictionary in hashmap.py. Hopefully Brandon's video will unconfuse them. Understanding how hashing works and how important it is was confusing. Dictionaries can be implemented with uses hashes, but there are tremendous benefits to using hashes for dictionaries. wp:Hash function wp:Hash table hash tables can be used to make dictionaries efficiently use memory and time. The Mighty Dictionary (#55) http://pyvideo.org/video/276/the-mighty-dictionary-55 http://learnpythonthehardway.org/book/ex39.html Should some functions such as hashkey() be private? What you need to know about datetimes (they are a mess!) http://pyvideo.org/video/946/what-you-need-to-know-about-datetimes Better dates and times for Python https://pypi.python.org/pypi/arrow A dozen dozens is really gross. wp:Gross (unit) >>> seconds = 881812 >>> minutes, second = divmod(s, 60) >>> minutes, second (14696, 52) >>> hours, minutes = divmod(minutes, 60) >>> hours, minutes (244, 56) >>> days, hours = divmod(hours, 24) >>> days, hours (10, 4) >>> days, hours, minutes, seconds = foo(seconds, 60, 60, 24) days, hours, minutes, seconds = foo(seconds, 24, 60, 60) days, hours, minutes, seconds = foo(seconds, (24, 60, 60)) days, hours, minutes, seconds = foo(24, 60, 60, seconds) write foo write foo to handle arbitrary number of divisor arguments Easier to try with just two arguments first, where second argument is sequence of divisors Which order do you want the divisors to be in? What's a good name for foo? wp:PyCharm $ cat ~/.gitconfig ... [alias] co = checkout ci = commit st = status br = branch hist = log --pretty=format:\"%h %ad %s%d [%an]\" --graph --date=short hist = log --pretty=format:\"%h %ad %s%d [%an]\" --graph --date=iso type = cat-file -t dump = cat-file -p Hashing is mighty important for git also. Played with git cloning, merging, fetching, and pushing on command line without using GUI or browser tools. git add remote mid https://github.com/JulianCienfuegos/theREALway git add remote pybokeh https://github.com/pybokeh/theREALway git fetch pybokeh git fetch mid git push origin master git push origin myway git push origin mid Python3 >>> import builtins >>> dir(builtins) ... >>> len(dir(builtins)) 131 >>> 'divmod' in dir(builtins) True >>> binary operators | & ^ ~ | and & work on sets wp:Jar Jar Binks wp:Star Wars wp:George Lucas wp:Comparative mythology wp:The Power of Myth wp:Joseph Campbell wp:Sarah Lawrence College wp:Asimina triloba wp:Eastern Agricultural Complex todo tools vim git import this need to get summary of rules http://cm.bell-labs.com/cm/cs/tpop/index.html wp:The Elements of Style wp:The_Elements_of_Programming_Style#Lessons http://blog.csdn.net/cpp_chen/article/details/7199874 http://bbs.chinaunix.net/thread-104986-1-1.html http://blog.chinaunix.net/uid-23971666-id-307968.html Chet Atkins and Mark Knopfler - Neck and Neck wp: prefix means wikipedia From jep200404 at columbus.rr.com Sat Nov 29 18:18:06 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 29 Nov 2014 12:18:06 -0500 Subject: [CentralOH] =?utf-8?q?2014-11-28_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz86IGRpY3Rpb25hcmllcyBhbmQgaGFzaGluZw==?= In-Reply-To: <20141129113824.7b1de298.jep200404@columbus.rr.com> References: <20141129113824.7b1de298.jep200404@columbus.rr.com> Message-ID: <20141129121806.31aeb6d9.jep200404@columbus.rr.com> On Sat, 29 Nov 2014 11:38:24 -0500, jep200404 at columbus.rr.com wrote: > Dictionaries can be implemented with uses hashes, ... I meant to say: Dictionaries can be implemented without using hashes, ... From jep200404 at columbus.rr.com Sat Nov 29 22:05:01 2014 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 29 Nov 2014 16:05:01 -0500 Subject: [CentralOH] CountDown.ipynb In-Reply-To: References: Message-ID: <20141129160501.20a3bcee.jep200404@columbus.rr.com> On Fri, 28 Nov 2014 22:17:22 -0500, pybokeh wrote: > http://nbviewer.ipython.org/github/pybokeh/ipython_notebooks/blob/master/dates/CountDown.ipynb http://nbviewer.ipython.org/url/colug.net/python/dojo/20141128/dojo-20141128-2-datetime.ipynb yet todo: Write tests, which should have been written before the code that they test. Handle negative deltatimes better. Would like to avoid magic number for duration to sleep. Would be nice to have a wait that takes no more than a specified percentage of CPU, for any CPU.