[CentralOH] 2016-08-12 道場 Scribbles 落書/惡文? range() in Python 2 versus range() in Python 3; git rebase imposter syndrome colorburst wheel wheel-builder nested generator expressions sweatlodge

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Mon Aug 15 08:46:17 EDT 2016


range() in Python 2 versus range() in Python 3

The following table shows how long a simple "for i in range(n):"
loop takes to get started. The numbers are from jupyter notebooks
referenced below.

    n           Python 2        Python 3
    ---------   -------------   --------
    10**7       246 ms          780 ns
    10**8       2.41 s          785 ns
    10**9       MemoryError     782 ns
    10**12345   OverflowError   45.2 µs

In Python 2, range() makes a list. One does not get any values
from it until the entire list has been built. For large n,
range(n) takes a long time to make the list and also uses much
memory. For very large values of n, range(n) crashes because
there is not enough memory to hold the list.

In Python 3, range() is a generator. It makes only one value at
a time as needed, so the first value is available immediately,
even for large values of n. The magnitude of n has little effect
on that speed. Also, iterating over range(n) needs very little
memory, so it does not crash, even for extremely large values of
n.

Compare:
    http://nbviewer.jupyter.org/github/james-prior/cohpy/blob/master/20160812-dojo-python2-range.ipynb
    http://nbviewer.jupyter.org/github/james-prior/cohpy/blob/master/20160812-dojo-python3-range.ipynb
diff:
    https://github.com/james-prior/cohpy/blob/master/20160812-dojo-python2-3-range.ipynb.diff

xrange() in Python 2 corresponds to range() in Python 3. See also:
    http://nbviewer.jupyter.org/github/james-prior/cohpy/blob/master/20160318-dojo-python2-range-versus-xrange.ipynb

###############################################################################

git rebase instead of git merge
https://git-scm.com/book/en/v2/Git-Branching-Rebasing#More-Interesting-Rebases
the perils rebasing
https://git-scm.com/book/en/v2/Git-Branching-Rebasing#The-Perils-of-Rebasing

Government Accountability Office Study Confirms: Patent Office Encouraged Examiners To Approve ****** Patents
https://www.techdirt.com/articles/20160803/15513435149/government-accountability-office-study-confirms-patent-office-encouraged-examiners-to-approve-crappy-patents.shtml?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed

If you build it, they won't come: Why your project needs better marketing
https://opensource.com/business/16/8/if-you-build-it-they-wont-come

Advice for building a career in open source
https://opensource.com/business/16/8/building-career-open-source

I'm not an impostor and know exactly what I'm doing
https://opensource.com/business/16/8/impostor-syndrome-and-senior-managers
Maybe I shouldn't be a programmer
https://www.youtube.com/watch?v=j0jjC-20N9w

wp: prefix means Wikipedia
To get good answers, consider following the advice in the links below.
http://catb.org/~esr/faqs/smart-questions.html
http://web.archive.org/web/20090627155454/www.greenend.org.uk/rjk/2000/06/14/quoting.html

Frank Sinatra to hummus
wp:Frank Sinatra
wp:Ava Gardner
wp:The Barefoot Contessa
wp:Barefoot Contessa
wp:Ina Garten
http://barefootcontessa.com/recipes.aspx?RecipeID=647&S=0
wp:Hummus

https://darkartofcoding.com/learning-resources/learning-resources-puzzles/

wp:Colorburst
wp:NTSC
exactly 315/88 = 3.57954[a] MHz

    dojo at 4519_n_high:~$ python3
    Python 3.4.3 (default, Oct 14 2015, 20:33:09)
    [GCC 4.8.4] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 315e6/88
    3579545.4545454546
    >>>
    dojo at 4519_n_high:~$

wp:IBM_Personal_Computer#Original_PC

GeoDjango Database API
Compatibility Tables
https://docs.djangoproject.com/en/1.10/ref/contrib/gis/db-api/#compatibility-tables
Which database would you use for geodjango stuff?

https://github.com/level12/wheel-builder

bolt-ons
    different data types

nbconvert to python
    http://nbconvert.readthedocs.io/en/latest/usage.html#convert-script

bitbucket versus github
    bitbucket has free _private_ repos

lines 71-74 have example of nested generator expressions
    https://github.com/cohpy/challenge-201604-words/blob/master/CWAndrews-OH/text_counter/word_count.py

ARRL handbook
    There is a new edition very year.
    This is a mature field,
    so old versions are just fine for the vast majority of radios.

wp:Military Auxiliary Radio System
wp:Amateur Radio Emergency Service

The Great Sweatlodge
http://05d2db1380b6504cc981-8cbed8cf7e3a131cd8f1c3e383d10041.r93.cf2.rackcdn.com/pyohio-2011/525_pyohio-2011-sqlalchemy-tutorial.ogv


More information about the CentralOH mailing list