[CentralOH] CentralOH Digest, Vol 91, Issue 20

timothy spencer smashing_good_show at hotmail.com
Mon Dec 1 20:06:03 CET 2014


I found that video very useful. Thanks Jim. Something that was very interesting was that the placement of keys in the array is not actually random (which I thought), but determined by the last digits in the binary code for the key. Then the next interesting thing is what Python does to the number of slots to minimize the number of collisions, which is to automatically increase the number of slots once the bucket gets 2/3 full. Correct me if I am wrong, but Python does so by using another binary code bit out of the 32 bit code each time for the number of slots, allowing for 16 slots total, then 32, 64...

> From: centraloh-request at python.org
> Subject: CentralOH Digest, Vol 91, Issue 20
> To: centraloh at python.org
> Date: Sun, 30 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. 2014-11-28 ?? Scribbles ??/???: 12doc, dictionaries, hashing,
>       git, divmod, style (jep200404 at columbus.rr.com)
>    2. Re: 2014-11-28 ?? Scribbles ??/???: dictionaries and hashing
>       (jep200404 at columbus.rr.com)
>    3. Re: CountDown.ipynb (jep200404 at columbus.rr.com)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sat, 29 Nov 2014 11:38:24 -0500
> From: jep200404 at columbus.rr.com
> To: centraloh at python.org
> Subject: [CentralOH] 2014-11-28 ?? Scribbles ??/???: 12doc,
> 	dictionaries, hashing, git, divmod, style
> Message-ID: <20141129113824.7b1de298.jep200404 at columbus.rr.com>
> Content-Type: text/plain; charset=US-ASCII
> 
> 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
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Sat, 29 Nov 2014 12:18:06 -0500
> From: jep200404 at columbus.rr.com
> To: "Mailing list for Central Ohio Python User Group \(COhPy\)"
> 	<centraloh at python.org>
> Subject: Re: [CentralOH] 2014-11-28 ?? Scribbles ??/???: dictionaries
> 	and hashing
> Message-ID: <20141129121806.31aeb6d9.jep200404 at columbus.rr.com>
> Content-Type: text/plain; charset=US-ASCII
> 
> 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, ...
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Sat, 29 Nov 2014 16:05:01 -0500
> From: jep200404 at columbus.rr.com
> To: "Mailing list for Central Ohio Python User Group \(COhPy\)"
> 	<centraloh at python.org>
> Subject: Re: [CentralOH] CountDown.ipynb
> Message-ID: <20141129160501.20a3bcee.jep200404 at columbus.rr.com>
> Content-Type: text/plain; charset=US-ASCII
> 
> On Fri, 28 Nov 2014 22:17:22 -0500, pybokeh <pybokeh at gmail.com> 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.
> 
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
> 
> 
> ------------------------------
> 
> End of CentralOH Digest, Vol 91, Issue 20
> *****************************************
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20141201/301daf12/attachment.html>


More information about the CentralOH mailing list