[CentralOH] 2013-07-05 道場 Scribbles 落書/惡文?

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Sat Jul 6 16:50:03 CEST 2013


The worst Python book I have ever seen showed up:

    Introduction to Python Programming and Developing GUI Applications with PyQT
    by B.M. Harwani Course Technology CENGAGE Learning

The indentation of code was inconsistent.
Use of whitespace around operators and = was inconsistent.
There were magic numbers.
The code in the book did not follow PEP 8,
so it leads beginners to bad habits. 
At first glance the font for code seemed to be a monospace font,
but upon later inspection, was some kind of variable width font.

The person who brought that book will try to return it to Microcenter,
and borrowed a copy of Learning Python 4th Edition by Mark Lutz.
By the way, the 5th edition of Learning Python is due out soon.

The one example of code that was brought to my attention for help
had subtle side effects. It had something like:

    [[0 for i in range(3)] for j in range(3)]

that I simplified to:

    [[0] * 3] * 3

but my simplification broke the code that followed in the book.
The following code demonstrates the subtle difference.

N = 3

def do_foo(foo):
    print foo
    n = 0
    for i in range(N):
        for j in range(N):
            foo[i][j] = n
            n += 1
    print foo
    print

do_foo([[0 for i in range(N)] for j in range(N)])
do_foo([[0] * 3] * 3)

See the attached ipython notebook.

    Choco Pie

Singapore driver's licenses do not expire
limited by =< 3500 kg and =< 7 passengers (excluding driver)

The usual Chaos by James Gleick, Genius by same,
Gödel, Escher, Bach: An Eternal Golden Braid by Douglas Hofstadter
http://en.wikipedia.org/wiki/Surely_You're_Joking_Mr._Feynman
http://en.wikipedia.org/wiki/What_Do_You_Care_What_Other_People_Think%3F
http://en.wikipedia.org/wiki/Volkswagen_New_Beetle
manual transmission
clutch
CVT
SciPy 2013
Austin
Don't Mess With Texas
moo.com nice business cards
TODAY Talks To Gordon Ramsay
http://www.youtube.com/watch?v=DWrmwABtZBs
better python: numba
https://github.com/numba/numba
NumPy aware dynamic Python compiler using LLVM
http://numba.pydata.org/

http://www.reddit.com/r/Python/comments/1h0qz7/falcon_a_faster_python_interpreter
https://github.com/rjpower/falcon

not to be confused with
http://falconframework.org/
https://pypi.python.org/pypi/falcon/0.1.6.post1

recommended
The Infinity Puzzle by Frank Close

virtualenv is almost mandatory
numpy arrays

http://en.wikipedia.org/wiki/Singapore_Fireworks_Celebrations
Red White and Boom

http://en.wikipedia.org/wiki/Natural_nuclear_fission_reactor
http://en.wikipedia.org/wiki/Liquid_fluoride_thorium_reactor

Work in the cloud with IPython notebook:
https://www.wakari.io/

Soylent Green
Cloud Atlas is very good say two attendees

http://mail.python.org/pipermail/centraloh/2012-July/001336.html
http://mail.python.org/pipermail/centraloh/2012-July/001337.html
https://duckduckgo.com/html/?q=ipython+notebook+checkpoint

https://github.com/ipython/nbconvert
ellisonbg
python nbconvert.py reveal your_slideshow.ipynb
reveal.js
http://lab.hakim.se/reveal-js/
https://github.com/hakimel/reveal.js/



More information about the CentralOH mailing list