From jep200404 at columbus.rr.com Sat Nov 2 18:46:47 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Sat, 2 Nov 2013 13:46:47 -0400 Subject: [CentralOH] =?utf-8?q?2013-11-01_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20131102134647.2ebbdedc.jep200404@columbus.rr.com> Tonight's dojo was more interesting than usual and had over half a dozen folks. The following tip from Brandon was a hit. python -m SimpleHTTPServer 8000 It made it easier than netcat to share an Ipython Notebook file. It also got one person to create their first web page. Thanks again Brandon! spelink and cApitalIZation are imprtnt. Halloween and chmod 777 Someone brought sphagnum moss for pawpaw seeds. One person was beginning to understand classes and objects. They were on the cusp of an ahah/epiphany moment. Need to play with pip install toolz Put big honking rubber feet on the bottom of a laptop that was always running its fan hard. After adding the big honking rubber feet, which raised up the laptop much, the laptop runs cooler. Is there a correlation between Esperanto speakers and their politics? https://en.wikipedia.org/wiki/The_Elements_of_Typographic_Style https://en.wikipedia.org/wiki/The_Elements_of_Style http://en.wikipedia.org/wiki/The_Elements_of_Programming_Style http://en.wikipedia.org/wiki/Triphthong http://en.wikipedia.org/wiki/Monophthong http://en.wikipedia.org/wiki/Diphthong https://en.wikipedia.org/wiki/Domain_name_registrar http://lifehacker.com/5683682/five-best-domain-name-registrars http://www.google.com/intl/en_ALL/images/srpr/logo9w.png http://en.wikipedia.org/wiki/Borg_(Star_Trek) Blue Screen of Death basicwebpage.html Put your text here. RVM http://en.wikipedia.org/wiki/Ruby_Version_Manager wordpress (PHP framework) drupal (PHP framework) Joomla (CRM based on PHP) CMS wp:django-cms wp:Gall?Peters projection social equality wp:Somebody's_Going_to_Emergency,_Somebody's_Going_to_Jail wp:twilio wp:direct inward dialing wp:2001: A Space Odyssey (film) wp:Dirty Harry wp:Magnum Force wp:Play Misty for Me It's convenient to have both 32-bit and 64-bit virtual machines (VMs) for testing. pmman.com makes it easy If it takes one woman nine months to bear a child, then two women should be able to bear the child in half the time. wp:Fred_Brooks wp:The Mythical Man-Month The Physics of System Design Posted on December 8, 2011 by jawildman (Jim Wildman) http://www.mobilelinuxlab.com/?p=14 Damian Conway's presentation "Fun with Dead Languages" was a fantastic tour de force. http://www.cojug.org/downloads//DamianConwayAnnoucement.pdf http://www.cse.ohio-state.edu/speaker/speaker121.shtml If you ever have a chance to see it, DO SO!!! wp:lisp wp:lithp wp:lisp (programming language) http://www.nostarch.com/lisp.htm http://spanish.about.com/cs/qa/a/q_lisp.htm Designing Web Usability: The Practice of Simplicity (by Jakob Nielsen?) wp:The Design of Everyday Things wp:Don't Make Me Think From miller.eric.t at gmail.com Sat Nov 2 18:52:35 2013 From: miller.eric.t at gmail.com (Eric Miller) Date: Sat, 2 Nov 2013 13:52:35 -0400 Subject: [CentralOH] not exactly python-specific, but noteworthy in our circles Message-ID: http://arstechnica.com/security/2013/10/meet-badbios-the-mysterious-mac-and-pc-malware-that-jumps-airgaps/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Wed Nov 6 04:19:35 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Tue, 5 Nov 2013 22:19:35 -0500 Subject: [CentralOH] cStringIO Message-ID: <20131105221935.35e7209e.jep200404@columbus.rr.com> The code below is ugly, very ugly. There has to be a better way. What is it? file = cStringIO.StringIO(s) while True: t = file.read(chunk_size) if not t: break print len(t), repr(t) file.close() For the full context, see the attached ipython notebook. -------------- next part -------------- A non-text attachment was scrubbed... Name: cohpy-20131105.ipynb Type: application/octet-stream Size: 6658 bytes Desc: not available URL: From iynaix at gmail.com Wed Nov 6 04:36:52 2013 From: iynaix at gmail.com (iynaix) Date: Wed, 6 Nov 2013 11:36:52 +0800 Subject: [CentralOH] cStringIO In-Reply-To: <20131105221935.35e7209e.jep200404@columbus.rr.com> References: <20131105221935.35e7209e.jep200404@columbus.rr.com> Message-ID: Hi Jim, I would write it like this (warning: functional code ahead): from functools import partial f = cStringIO.StringIO(s) records = iter(partial(f.read, CHUNK_SIZE), '') for r in records: print CHUNK_SIZE, repr(r) f.close() Some quick notes: 1. partial() in this case returns a function that reads CHUNK_SIZE blocks at a time. 2. iter() with a second sentinel argument would iterate until the sentinel is returned, at which point it is terminates. 3. file is a python builtin function, as an alias for open, not a good name for a variable. :) Cheers, XY On Wed, Nov 6, 2013 at 11:19 AM, wrote: > The code below is ugly, very ugly. > There has to be a better way. > What is it? > > file = cStringIO.StringIO(s) > while True: > t = file.read(chunk_size) > if not t: > break > print len(t), repr(t) > file.close() > > For the full context, see the attached ipython notebook. > > > _______________________________________________ > 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 Wed Nov 6 14:07:54 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Wed, 6 Nov 2013 08:07:54 -0500 Subject: [CentralOH] cStringIO In-Reply-To: References: <20131105221935.35e7209e.jep200404@columbus.rr.com> Message-ID: <20131106080754.3f951b9c.jep200404@columbus.rr.com> On Wed, 6 Nov 2013 11:36:52 +0800, iynaix wrote: > from functools import partial > > f = cStringIO.StringIO(s) > records = iter(partial(f.read, CHUNK_SIZE), '') > for r in records: > print CHUNK_SIZE, repr(r) > f.close() Thanks! That's much better than my ugly code. > print CHUNK_SIZE, repr(r) If one is going to print CHUNK_SIZE, one might as well do it outside the loop. I wanted to see the size of individual r's, particularly the last one which can be different than CHUNK_SIZE, hence the len(r) as follows. print len(r), repr(r) > 3. file is a python builtin function, as an alias for open, not a good name > for a variable. :) Wow, that was pretty stupid of me. Thanks for catching that. From joe at joeshaw.org Wed Nov 6 15:01:21 2013 From: joe at joeshaw.org (Joe Shaw) Date: Wed, 6 Nov 2013 09:01:21 -0500 Subject: [CentralOH] cStringIO In-Reply-To: <20131106080754.3f951b9c.jep200404@columbus.rr.com> References: <20131105221935.35e7209e.jep200404@columbus.rr.com> <20131106080754.3f951b9c.jep200404@columbus.rr.com> Message-ID: Hi, I'd probably also make use of contextlib.closing rather than managing the file by itself. with contextlib.closing(cStringIO.StringIO(s)) as f: # previous code here, no need to explicitly close() the file afterward This ensures that the file is closed even in the case of error (and is, IMO, cleaner than a try-finally block) Joe On Wed, Nov 6, 2013 at 8:07 AM, wrote: > On Wed, 6 Nov 2013 11:36:52 +0800, iynaix wrote: > > > from functools import partial > > > > f = cStringIO.StringIO(s) > > records = iter(partial(f.read, CHUNK_SIZE), '') > > for r in records: > > print CHUNK_SIZE, repr(r) > > f.close() > > Thanks! That's much better than my ugly code. > > > print CHUNK_SIZE, repr(r) > > If one is going to print CHUNK_SIZE, > one might as well do it outside the loop. > I wanted to see the size of individual r's, > particularly the last one which can be different > than CHUNK_SIZE, hence the len(r) as follows. > > print len(r), repr(r) > > > 3. file is a python builtin function, as an alias for open, not a good > name > > for a variable. :) > > Wow, that was pretty stupid of me. Thanks for catching that. > > _______________________________________________ > 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 Wed Nov 6 21:52:36 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Wed, 6 Nov 2013 15:52:36 -0500 Subject: [CentralOH] cStringIO In-Reply-To: References: <20131105221935.35e7209e.jep200404@columbus.rr.com> <20131106080754.3f951b9c.jep200404@columbus.rr.com> Message-ID: <20131106155236.6e0a4a5a.jep200404@columbus.rr.com> On Wed, 6 Nov 2013 09:01:21 -0500, Joe Shaw wrote: > I'd probably also make use of contextlib.closing rather than managing the > file by itself. Thanks. That's what I was looking for, and tried but failed to do in the previously attached notebook file. > with contextlib.closing(cStringIO.StringIO(s)) as f: > # previous code here, no need to explicitly close() the file afterward A complete example is in the newly attached ipython notebook file. > This ensures that the file is closed even in the case of error (and is, > IMO, cleaner than a try-finally block) Yum! Context manager goodness! http://docs.python.org/2.7/library/contextlib.html http://docs.python.org/3/library/contextlib.html http://docs.python.org/2.7/library/functools.html#functools.partial http://docs.python.org/2.7/library/functions.html#iter From jep200404 at columbus.rr.com Wed Nov 6 22:13:44 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Wed, 6 Nov 2013 16:13:44 -0500 Subject: [CentralOH] cStringIO: Example Attached In-Reply-To: <20131106155236.6e0a4a5a.jep200404@columbus.rr.com> References: <20131105221935.35e7209e.jep200404@columbus.rr.com> <20131106080754.3f951b9c.jep200404@columbus.rr.com> <20131106155236.6e0a4a5a.jep200404@columbus.rr.com> Message-ID: <20131106161344.09eb8496.jep200404@columbus.rr.com> On Wed, 6 Nov 2013 15:52:36 -0500, jep200404 at columbus.rr.com wrote: > A complete example is in the newly attached ipython notebook file. Oops. It's attached this time. -------------- next part -------------- A non-text attachment was scrubbed... Name: cohpy-20131106-cStringIO-2.ipynb Type: application/octet-stream Size: 1594 bytes Desc: not available URL: From jep200404 at columbus.rr.com Mon Nov 11 15:51:24 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 09:51:24 -0500 Subject: [CentralOH] chr()/ord() Ugliness Message-ID: <20131111095124.72b18328.jep200404@columbus.rr.com> What is a better way of accomplishing the following? chr(ord('A') + i) From miller.eric.t at gmail.com Mon Nov 11 15:56:02 2013 From: miller.eric.t at gmail.com (Eric Miller) Date: Mon, 11 Nov 2013 09:56:02 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111095124.72b18328.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> Message-ID: assuming you want to return the character whose unicode value is 'i' greater that that of 'A', I can't imagine there is a better way to accomplish it than what you have written. Maybe provide some context and share what you feel is wrong with that approach? On Mon, Nov 11, 2013 at 9:51 AM, wrote: > What is a better way of accomplishing the following? > > chr(ord('A') + i) > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wam at cisco.com Mon Nov 11 16:02:41 2013 From: wam at cisco.com (William McVey) Date: Mon, 11 Nov 2013 10:02:41 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111095124.72b18328.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> Message-ID: <5280F191.2080400@cisco.com> On 11/11/2013 09:51 AM, jep200404 at columbus.rr.com wrote: > What is a better way of accomplishing the following? > chr(ord('A') + i) You've listed a method of accomplishing something, but you didn't really specify specifically what you're looking to do. Assuming you want to iterate over each of the uppercase letters or pull letters out by offset, I would probably utilizing indexing or iteration rather than chr/ord conversions, ala: import string string.upper[i] for letter in string.upper: do_something_with_letter(letter) Keep in mind though, this all has a very "ASCII-centric" code smell to it. If you reply back with more details on what you're trying to accomplish, we might be able to give you a more general purpose solution. -- William -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Mon Nov 11 16:29:41 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 10:29:41 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <5280F191.2080400@cisco.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> Message-ID: <20131111102941.2cc68267.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 10:02:41 -0500, William McVey wrote: > On 11/11/2013 09:51 AM, jep200404 at columbus.rr.com wrote: > > What is a better way of accomplishing the following? > > chr(ord('A') + i) > You've listed a method of accomplishing something, > but you didn't really specify specifically what you're looking > to do. I want to get a letter that is i greater than 'A', while iterating over arbitrary iterable. Imagine something like: for i, foo in enumerate(bar): print 'Entity %s is %s' % (chr(ord('A') + i), foo) Since my original posting, I've thought of the following, but I don't know if it's better. Separating the ugliness of ord() and chr() might just make it harder to understand. a = ('hello', 'world', 'foo', 'bar') for c, foo in enumerate(a, ord('A')): print 'Entity %s is %s' % (chr(c), foo) > Assuming you want to > iterate over each of the uppercase letters ... I'm iterating over some arbitrary iterator and need to generate letter 'indexes' for printing. > ... or pull letters out by offset, ... I don't have a list of letters from which to pull. > import string > string.upper[i] I understand 'hello world'.upper(), but not string.upper[i]. From kurtis.mullins at gmail.com Mon Nov 11 16:32:53 2013 From: kurtis.mullins at gmail.com (Kurtis Mullins) Date: Mon, 11 Nov 2013 10:32:53 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111102941.2cc68267.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> Message-ID: http://stackoverflow.com/questions/7001144/range-over-character-in-python On Mon, Nov 11, 2013 at 10:29 AM, wrote: > On Mon, 11 Nov 2013 10:02:41 -0500, William McVey wrote: > > > On 11/11/2013 09:51 AM, jep200404 at columbus.rr.com wrote: > > > What is a better way of accomplishing the following? > > > chr(ord('A') + i) > > > You've listed a method of accomplishing something, > > but you didn't really specify specifically what you're looking > > to do. > > I want to get a letter that is i greater than 'A', > while iterating over arbitrary iterable. > Imagine something like: > > for i, foo in enumerate(bar): > print 'Entity %s is %s' % (chr(ord('A') + i), foo) > > Since my original posting, I've thought of the following, > but I don't know if it's better. Separating the ugliness > of ord() and chr() might just make it harder to understand. > > a = ('hello', 'world', 'foo', 'bar') > for c, foo in enumerate(a, ord('A')): > print 'Entity %s is %s' % (chr(c), foo) > > > Assuming you want to > > iterate over each of the uppercase letters ... > > I'm iterating over some arbitrary iterator > and need to generate letter 'indexes' for printing. > > > ... or pull letters out by offset, ... > > I don't have a list of letters from which to pull. > > > import string > > string.upper[i] > > I understand 'hello world'.upper(), but not string.upper[i]. > > _______________________________________________ > 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 Mon Nov 11 16:34:00 2013 From: michael at yanovich.net (michael at yanovich.net) Date: Mon, 11 Nov 2013 10:34:00 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111102941.2cc68267.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> Message-ID: <5280F8E8.4090604@yanovich.net> I think it might be string.uppercase string.uppercase returns a string of all the capital letters in ASCII. In [1]: import string In [2]: string.uppercase Out[2]: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' and consequently there is a string.lowercase too, but you can shove and index into it and get a specific letter back: In [4]: string.uppercase[3] Out[4]: 'D' On 11/11/2013 10:29 AM, jep200404 at columbus.rr.com wrote: > On Mon, 11 Nov 2013 10:02:41 -0500, William McVey wrote: > >> On 11/11/2013 09:51 AM, jep200404 at columbus.rr.com wrote: >>> What is a better way of accomplishing the following? >>> chr(ord('A') + i) > >> You've listed a method of accomplishing something, >> but you didn't really specify specifically what you're looking >> to do. > > I want to get a letter that is i greater than 'A', > while iterating over arbitrary iterable. > Imagine something like: > > for i, foo in enumerate(bar): > print 'Entity %s is %s' % (chr(ord('A') + i), foo) > > Since my original posting, I've thought of the following, > but I don't know if it's better. Separating the ugliness > of ord() and chr() might just make it harder to understand. > > a = ('hello', 'world', 'foo', 'bar') > for c, foo in enumerate(a, ord('A')): > print 'Entity %s is %s' % (chr(c), foo) > >> Assuming you want to >> iterate over each of the uppercase letters ... > > I'm iterating over some arbitrary iterator > and need to generate letter 'indexes' for printing. > >> ... or pull letters out by offset, ... > > I don't have a list of letters from which to pull. > >> import string >> string.upper[i] > > I understand 'hello world'.upper(), but not string.upper[i]. > > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > > -- Michael Yanovich -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 901 bytes Desc: OpenPGP digital signature URL: From jep200404 at columbus.rr.com Mon Nov 11 16:43:17 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 10:43:17 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> Message-ID: <20131111104317.7a782791.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 10:32:53 -0500, Kurtis Mullins wrote: > http://stackoverflow.com/questions/7001144/range-over-character-in-python Thanks. That had two attractive solutions. 1. Use a custom generator. Since I expect to have letter indexes for printing often, I could put that in some shared module. 2. string.ascii_uppercase[i] I think that's what McVey meant by string.upper[i]. From jep200404 at columbus.rr.com Mon Nov 11 16:46:47 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 10:46:47 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <5280F8E8.4090604@yanovich.net> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> Message-ID: <20131111104647.458b049f.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 10:34:00 -0500, michael at yanovich.net wrote: > I think it might be string.uppercase Thanks! That's even better than string.ascii_uppercase. From wam at cisco.com Mon Nov 11 16:55:32 2013 From: wam at cisco.com (William McVey) Date: Mon, 11 Nov 2013 10:55:32 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111102941.2cc68267.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> Message-ID: <5280FDF4.8080309@cisco.com> [I've reorganized your reply to my mail for clarity in the answer] > I understand 'hello world'.upper(), but not string.upper[i]. That was my mistake. I meant to type string.uppercase[i]: >>> i=5 >>> chr(ord('A') + i) 'F' >>> import string >>> string.uppercase 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> string.uppercase[i] 'F' On 11/11/2013 10:29 AM, jep200404 at columbus.rr.com wrote: > I want to get a letter that is i greater than 'A', > while iterating over arbitrary iterable. What happens if your iterable is longer than the number of letters. Do you want to wrap around back to 'a' again? Do you want to start pulling in punctuation? Lowercase letters? The assumption seems to be that you're dealing with ascii, but when you say "letter greater than 'A'", do you mean by unicode codepoint? ASCII/UTF-8 encoding? > Imagine something like: > > for i, foo in enumerate(bar): > print 'Entity %s is %s' % (chr(ord('A') + i), foo) I think I'd probably chose to use itertools rather than using enumerate to pull offsets. For example: >>> import string, itertools >>> lorem_words=""""Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.""".split() >>> list(itertools.izip(itertools.cycle(string.uppercase), lorem_words)) [('A', '"Lorem'), ('B', 'ipsum'), ('C', 'dolor'), ('D', 'sit'), ('E', 'amet,'), ('F', 'consectetur'), ('G', 'adipisicing'), ('H', 'elit,'), ('I', 'sed'), ('J', 'do'), ('K', 'eiusmod'), ('L', 'tempor'), ('M', 'incididunt'), ('N', 'ut'), ('O', 'labore'), ('P', 'et'), ('Q', 'dolore'), ('R', 'magna'), ('S', 'aliqua.'), ('T', 'Ut'), ('U', 'enim'), ('V', 'ad'), ('W', 'minim'), ('X', 'veniam,'), ('Y', 'quis'), ('Z', 'nostrud'), ('A', 'exercitation'), ('B', 'ullamco'), ('C', 'laboris'), ('D', 'nisi'), ('E', 'ut'), ('F', 'aliquip'), ('G', 'ex'), ('H', 'ea'), ('I', 'commodo'), ('J', 'consequat.'), ('K', 'Duis'), ('L', 'aute'), ('M', 'irure'), ('N', 'dolor'), ('O', 'in'), ('P', 'reprehenderit'), ('Q', 'in'), ('R', 'voluptate'), ('S', 'velit'), ('T', 'esse'), ('U', 'cillum'), ('V', 'dolore'), ('W', 'eu'), ('X', 'fugiat'), ('Y', 'nulla'), ('Z', 'pariatur.'), ('A', 'Excepteur'), ('B', 'sint'), ('C', 'occaecat'), ('D', 'cupidatat'), ('E', 'non'), ('F', 'proident,'), ('G', 'sunt'), ('H', 'in'), ('I', 'culpa'), ('J', 'qui'), ('K', 'officia'), ('L', 'deserunt'), ('M', 'mollit'), ('N', 'anim'), ('O', 'id'), ('P', 'est'), ('Q', 'laborum.')] Note that in this case, I used itertools.cycle to basically repeat the uppercase letter string... However, you could choose to feed the izip other well known strings (strings.letters and strings.printable are possibly good options). The izip() returns an iterable that emits tuples composed of one element off of each of it's set of (iterable) arguments in turn. The conversion of the izip iterator into a list was simply for display purposes. You wouldn't need/want this in your actual code. -- William -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Mon Nov 11 17:29:10 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 11:29:10 -0500 Subject: [CentralOH] Interating Over string.uppercase; Lorem Ipsum In-Reply-To: <5280FDF4.8080309@cisco.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280FDF4.8080309@cisco.com> Message-ID: <20131111112910.1ec7015a.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 10:55:32 -0500, William McVey wrote: > [I've reorganized your reply to my mail for clarity in the answer] That's standard procedure for me. > On 11/11/2013 10:29 AM, jep200404 at columbus.rr.com wrote: > > I want to get a letter that is i greater than 'A', > > while iterating over arbitrary iterable. > What happens if your iterable is longer than the number of letters[?] Then the program should crash, so string.uppercase[i] would be just fine. If we needed to support more than 26 entities, I'd ask to use numbers instead of letters. > >>> lorem_words=... Hmmm. Is there a module for such? Check out https://pypi.python.org/pypi/loremipsum Python's libraries continue to impress me. http://baconipsum.com/?paras=5&type=all-meat&start-with-lorem=1 http://veggieipsum.com/ http://veganipsum.com/ http://tunaipsum.com/?paragraphs=5 > >>> lorem_words=""""Lorem ipsum dolor sit amet, consectetur ... Maybe you meant '"""', not '""""'. From eric at intellovations.com Mon Nov 11 18:27:43 2013 From: eric at intellovations.com (Eric Floehr) Date: Mon, 11 Nov 2013 12:27:43 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111104647.458b049f.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> <20131111104647.458b049f.jep200404@columbus.rr.com> Message-ID: > > I think it might be string.uppercase > > Thanks! > > That's even better than string.ascii_uppercase. > Except that: 1. It won't work in Python 3. 2. It will return different results based on your locale setting (which is why it was removed in Python 3. Changing constants are bad). -Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at yanovich.net Mon Nov 11 18:34:50 2013 From: michael at yanovich.net (michael at yanovich.net) Date: Mon, 11 Nov 2013 12:34:50 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> <20131111104647.458b049f.jep200404@columbus.rr.com> Message-ID: <5281153A.2000201@yanovich.net> On 11/11/2013 12:27 PM, Eric Floehr wrote: > 2. It will return different results based on your locale setting (which is > why it was removed in Python 3. Changing constants are bad). Interesting, I didn't know it changed based on locale. So, I guess in a more general term, if one wanted a way to constantly access letters A-Z it would probably be better to hard code a string like so? In [1]: myupper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' or maybe, In [8]: ''.join([chr(x) for x in range(65,65+26)]) Out[8]: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -- Michael Yanovich -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 901 bytes Desc: OpenPGP digital signature URL: From eric at intellovations.com Mon Nov 11 18:43:09 2013 From: eric at intellovations.com (Eric Floehr) Date: Mon, 11 Nov 2013 12:43:09 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <5281153A.2000201@yanovich.net> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> <20131111104647.458b049f.jep200404@columbus.rr.com> <5281153A.2000201@yanovich.net> Message-ID: > > Interesting, I didn't know it changed based on locale. > > So, I guess in a more general term, if one wanted a way to constantly > access > letters A-Z it would probably be better to hard code a string like so? > No, just use string.ascii_uppercase rather than string.uppercase. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Mon Nov 11 18:50:51 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 12:50:51 -0500 Subject: [CentralOH] Evil Magic Number Ugliness In-Reply-To: <5281153A.2000201@yanovich.net> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> <20131111104647.458b049f.jep200404@columbus.rr.com> <5281153A.2000201@yanovich.net> Message-ID: <20131111125051.6243370b.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 12:34:50 -0500, michael at yanovich.net wrote: > In [8]: ''.join([chr(x) for x in range(65,65+26)]) The following makes clear the meaning of the above evil magic numbers. ''.join([chr(c) for c in range(ord('A'), ord('Z') + 1)]) From michael at yanovich.net Mon Nov 11 18:55:39 2013 From: michael at yanovich.net (michael at yanovich.net) Date: Mon, 11 Nov 2013 12:55:39 -0500 Subject: [CentralOH] Evil Magic Number Ugliness In-Reply-To: <20131111125051.6243370b.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> <20131111104647.458b049f.jep200404@columbus.rr.com> <5281153A.2000201@yanovich.net> <20131111125051.6243370b.jep200404@columbus.rr.com> Message-ID: <52811A1B.4080000@yanovich.net> On 11/11/2013 12:50 PM, jep200404 at columbus.rr.com wrote: > On Mon, 11 Nov 2013 12:34:50 -0500, michael at yanovich.net wrote: > >> In [8]: ''.join([chr(x) for x in range(65,65+26)]) > > The following makes clear the meaning of the above evil magic numbers. > > ''.join([chr(c) for c in range(ord('A'), ord('Z') + 1)]) > Yea, I was just whipping something up as an alternative example to the first thing example I posted; but yea I agree the more "correct" solution would be the example you listed with the magic numbers removed. -- Michael Yanovich -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 901 bytes Desc: OpenPGP digital signature URL: From eric at intellovations.com Mon Nov 11 16:41:29 2013 From: eric at intellovations.com (Eric Floehr) Date: Mon, 11 Nov 2013 10:41:29 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <5280F8E8.4090604@yanovich.net> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> Message-ID: > string.uppercase returns a string of all the capital letters in ASCII. > string.uppercase is locale-dependent, so while in most locales it will be ASCII, it won't in all locales. Because of that fact (i.e. a constant that changes :-), string.uppercase (and lowercase and letters) have been removed from Python 3. So if you want something that works on Python 2 and 3, you'll need to use ascii_uppercase (or ascii_lowercase or ascii_letters). -------------- next part -------------- An HTML attachment was scrubbed... URL: From winningham at gmail.com Mon Nov 11 19:37:06 2013 From: winningham at gmail.com (Thomas Winningham) Date: Mon, 11 Nov 2013 13:37:06 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> Message-ID: just wanted to add how my subconscious wants to solve this if i were doing it: characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" character_relation = lambda c,i : characters[(characters.index(c.upper()) + i)%26] >>> character_relation("a",3) 'D' >>> character_relation("a",-2) 'Y' anyway... i want to say the talk about encoding and such really gets to the point of how old ascii tricks are somewhat inapplicable to our new unicode world. anyway... fun stuff. On Mon, Nov 11, 2013 at 10:41 AM, Eric Floehr wrote: > > string.uppercase returns a string of all the capital letters in ASCII. >> > > string.uppercase is locale-dependent, so while in most locales it will be > ASCII, it won't in all locales. > > Because of that fact (i.e. a constant that changes :-), string.uppercase > (and lowercase and letters) have been removed from Python 3. > > So if you want something that works on Python 2 and 3, you'll need to use > ascii_uppercase (or ascii_lowercase or ascii_letters). > > > > _______________________________________________ > 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 11 19:46:59 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 13:46:59 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> Message-ID: <20131111134659.527341d0.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 10:41:29 -0500, Eric Floehr wrote: [> On Mon, 11 Nov 2013 10:34:00 -0500, michael at yanovich.net wrote:] > > string.uppercase returns a string of all the capital letters in ASCII. > string.uppercase is locale-dependent, so while in most locales it will be > ASCII, it won't in all locales. Sometimes that's not desirable. Sometimes that desirable. > Because of that fact (i.e. a constant that changes :-), string.uppercase > (and lowercase and letters) have been removed from Python 3. What does one use to get the locale dependent uppercase letters? From jep200404 at columbus.rr.com Mon Nov 11 19:57:11 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 13:57:11 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> Message-ID: <20131111135711.3c469442.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 13:37:06 -0500, Thomas Winningham wrote: > characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" It's easy to mistype the above, so something like the following inspired my myano is better: characters = ''.join([chr(c) for c in range(ord('A'), ord('Z') + 1)]) Of course, that ain't very international. For ???????? ????????: characters = ''.join([chr(c) for c in range(ord('?'), ord('?') + 1)]) > character_relation = lambda c,i : characters[(characters.index(c.upper()) + > i)%26] Eschew magic numbers: s/26/len(characters)/ wp:rot13 http://www.ioccc.org/1989/westley.c From jep200404 at columbus.rr.com Mon Nov 11 20:00:20 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 11 Nov 2013 14:00:20 -0500 Subject: [CentralOH] Internationalization of alphabets In-Reply-To: <20131111135711.3c469442.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> <5280F8E8.4090604@yanovich.net> <20131111135711.3c469442.jep200404@columbus.rr.com> Message-ID: <20131111140020.4d326880.jep200404@columbus.rr.com> On Mon, 11 Nov 2013 13:57:11 -0500, jep200404 at columbus.rr.com wrote: > Of course, that ain't very international. For ???????? ????????: > > characters = ''.join([chr(c) for c in range(ord('?'), ord('?') + 1)]) Not. Of course that just make's Thomas' point: On Mon, 11 Nov 2013 13:37:06 -0500, Thomas Winningham wrote: > ... i want to say the talk about encoding and such really gets to the > point of how old ascii tricks are somewhat inapplicable to our new unicode > world. From eric at intellovations.com Mon Nov 11 16:32:31 2013 From: eric at intellovations.com (Eric Floehr) Date: Mon, 11 Nov 2013 10:32:31 -0500 Subject: [CentralOH] chr()/ord() Ugliness In-Reply-To: <20131111102941.2cc68267.jep200404@columbus.rr.com> References: <20131111095124.72b18328.jep200404@columbus.rr.com> <5280F191.2080400@cisco.com> <20131111102941.2cc68267.jep200404@columbus.rr.com> Message-ID: > > I don't have a list of letters from which to pull. > > I understand 'hello world'.upper(), but not string.upper[i]. > Would string.ascii_letters (or the locale-dependent string.letters), or one of the others[1] work? [1] http://docs.python.org/2/library/string.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at intellovations.com Mon Nov 11 21:40:41 2013 From: eric at intellovations.com (Eric Floehr) Date: Mon, 11 Nov 2013 15:40:41 -0500 Subject: [CentralOH] Locale-dependent alphabets Message-ID: > > Because of that fact (i.e. a constant that changes :-), string.uppercase > > (and lowercase and letters) have been removed from Python 3. > > What does one use to get the locale dependent uppercase letters? > I have no idea. the locale module doesn't have any obvious way. You can collate with strcoll() but I don't see any way to actually see the alphabet. Any one know how Python2 string.uppercase, etc. gets it's locale-dependent alphabet, and how you might do it in the Unicode world we now live in? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jep200404 at columbus.rr.com Wed Nov 13 22:08:41 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Wed, 13 Nov 2013 16:08:41 -0500 Subject: [CentralOH] Context Manager for Database Connection Message-ID: <20131113160841.58b9d6b4.jep200404@columbus.rr.com> How would you improve the following context manager for a database connection? import mysql.connector ... class DBOpen: def __init__(self, config): self.config = config.copy() def __enter__(self): self.cnx = mysql.connector.Connect(**self.config) return self.cnx def __exit__(self, exc_type, exc_value, exc_tb): self.cnx.close() ... with DBOpen(connection_config) as cnx: do_something(student_id) The full code is attached in a tarball. Sample output using an actual database[1] follows. (env)test at test:~/mysql$ python foo.py 3 6 (3, 1, 20) (3, 2, 13) (3, 3, 69) (3, 4, 17) (3, 5, 11) (3, 6, 94) (env)test at test:~/mysql$ If that's not a good question, feel free to correct it. Also feel free to correct how other things are done in the code. [1] for 2nd edition of Paul DuBois's "MySQL" http://www.kitebird.com/mysql-book/sampdb-2ed/sampdb.tar.gz -------------- next part -------------- A non-text attachment was scrubbed... Name: tx.tgz Type: application/x-gzip Size: 819 bytes Desc: not available URL: From jep200404 at columbus.rr.com Mon Nov 18 16:09:52 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 18 Nov 2013 10:09:52 -0500 Subject: [CentralOH] =?utf-8?q?2013-11-15_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20131118100952.6eee90e6.jep200404@columbus.rr.com> Someone bought two. One that nobody else touches. Ohto SUPER PROMECHA 1500P http://www.ohto.jpn.org/images/stories/products/drafting/instruction/PM_1500Pseries.jpg http://www.ohto.jpn.org/vmchk/PM-1500.html The Cathedral and the Bazaar A Brief History of Hackerdom open can by rubbing seam on concrete stfw for 10 Life Hacks Every College Student Should Know crazy russian hacker wp:???? wp:Straight_man_(stock_character) wp:Foobar wp:Placeholder name wp:Metasyntactic variable wp:McLean, Virginia https://duckduckgo.com/html/?q=Models.Behaving.Badly Models.Behaving.Badly: Why Confusing Illusion With Reality Can Lead to Disaster, on Wall Street and in Life wp:Fooled by Randomness wp:Nassim Nicholas Taleb wp:The Black Swan (2007 book) wp:List of cognitive biases wp:Emanuel_Derman#Models.Behaving.Badly Conkle's Hollow Ash Cave Cedar Falls Old Man's Cave Rockhouse From jep200404 at columbus.rr.com Mon Nov 18 16:30:48 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Mon, 18 Nov 2013 10:30:48 -0500 Subject: [CentralOH] =?utf-8?q?2013-11-08_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20131118103048.4216b69c.jep200404@columbus.rr.com> pip install toolz The Moon Is a Harsh Mistress Someone brought sphagnum moss for pawpaw seeds. english.chosun.com/site/data/html_dir/2013/10/31/2013103100487.html wget -r -np -a log http://192.168.0.19:8000/ | tail -F log man wget mkdir cd tail >> versus > STFW RTFM http://news.nationalgeographic.com/news/2013/10/131028-when-does-daylight-savings-time-end-november-3/ wp:This is Spinal Tap these go to eleven spontaneous combustion http://www.techspot.com/news/54559-internet-might-someday-lose-its-dependency-on-servers-rely-on-p2p-instead.html http://en.wikipedia.org/wiki/Loudest_band_in_the_world wp:Predictably Irrational tmi rush creek village chauffeur deja vu Bourgeoisie wp:Fallingwater From jep200404 at columbus.rr.com Tue Nov 19 19:41:29 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Tue, 19 Nov 2013 13:41:29 -0500 Subject: [CentralOH] Robot Using Python Message-ID: <20131119134129.4b1d672a.jep200404@columbus.rr.com> ... Tourbot combines Python, pygame, Arduino, and Linux into a mobile telepresence platform. colug.net Ethan Dicks will introduce us to Tourbot: Telepresence with Open Source. From matt at plot.ly Wed Nov 20 21:23:36 2013 From: matt at plot.ly (Matt Sundquist) Date: Wed, 20 Nov 2013 12:23:36 -0800 Subject: [CentralOH] Plotly: Python Plotting and Analytics, In the Browser Message-ID: Hey Python folks in Central OH, Happy Wednesday! I wanted to reach out and let you know about the beta launch of Plotly. Plot.ly is a graphing and analytics project that lets you style publication quality, interactive, web-based graphs with Python or the GUI (Python API here ). You can also use Plotly to collaborate, sharing graphs, data, and projects with others. We just put up an IPython demo (video here ) that I thought I'd pass along, and we'd like to put up more examples from our API gallery as well (where you can also get installation instructions and documentation). And, I'm including a gallery shot below. We just launched, so getting feedback from expert users like you all is much appreciated. We'd love to hear your thoughts and reactions, and if you have any feedback, to hear what you think. Thanks so much, Matt[image: Inline image 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Gallery.png Type: image/png Size: 286629 bytes Desc: not available URL: From jep200404 at columbus.rr.com Sat Nov 23 04:37:00 2013 From: jep200404 at columbus.rr.com (jep200404 at columbus.rr.com) Date: Fri, 22 Nov 2013 22:37:00 -0500 Subject: [CentralOH] =?utf-8?q?2013-11-22_=E9=81=93=E5=A0=B4_Scribbles_?= =?utf-8?b?76SY5pu4L+aDoeaWhz8=?= Message-ID: <20131122223700.5066d9fd.jep200404@columbus.rr.com> Comet Ison http://waitingforison.wordpress.com/november-2013/ http://earthsky.org/space/big-sun-diving-comet-ison-might-be-spectacular-in-2013 wp:Comet_ISON excellent fun romp: I love the bit about the graphical explanation about the sum of square of consecutive fibonacci numbers. TED:Arthur Benjamin: The magic of Fibonacci numbers http://www.ted.com/talks/arthur_benjamin_the_magic_of_fibonacci_numbers.html 17 ?s Even Fibonacci numbers http://projecteuler.net/problem=2 802 ns 1000-digit Fibonacci number http://projecteuler.net/problem=25 not seen tonight: they're magically delicious lucky1988 http://shirt.woot.com/offers/theyre-magically-delicious When Can You Trust a Data Scientist? http://themonkeycage.org/2013/07/21/when-can-you-trust-a-data-scientist/ Why You Should Never Trust a Data Scientist http://themonkeycage.org/2013/07/18/32119/ Hyeonseo Lee: My escape from North Korea http://www.ted.com:80/talks/hyeonseo_lee_my_escape_from_north_korea.html http://www.techdirt.com/articles/20131118/02152325272/warner-bros-admits-to-issuing-bogus-takedowns-gloats-to-court-how-theres-nothing-anyone-can-do-about-that.shtml wp:Unimog Is 3599 prime? (you should be able to figure that out in your head) wp:Michael Lewis wp:Liar's Poker http://www.vanityfair.com/business/2013/09/michael-lewis-goldman-sachs-programmer http://www.vanityfair.com/contributors/michael-lewis http://www.vanityfair.com/business/features/2010/04/wall-street-excerpt-201004 wp:The Big Short wp:Fermat's theorem on sums of two squares Simple continuous testing tool https://pypi.python.org/pypi/conttest/0.0.4 pep8: Vim filetype plugin for running PEP8 on Python files http://www.vim.org/scripts/script.php?script_id=3160 http://www.vim.org/account/profile.php?user_id=20529 http://nvie.com/ https://github.com/nvie http://nvie.com/about/ easy_install versus pip http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install https://webvulture.wordpress.com/2011/11/12/easy_install-vs-pip/ https://pypi.python.org/pypi/q What? Centos does not have wget? What? Centos does not have man pages? centos install new user that can be ssh'd into. https://www.digitalocean.com/community/articles/initial-server-setup-with-centos-6 wp:Statistical_physics https://pypi.python.org/simple/ crate.io https://preview-pypi.python.org/ # alpha; search doesn't work