[CentralOH] 2016-12-02 道場 Scribbles 落書/惡文? advent of code: Pretty and Ugly; duck typing; Counter; __missing__; .casefold(); kivy; loose table legs

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Sun Dec 4 12:14:23 EST 2016


six folks tonight

Which cell is more readable for you? Cell #1, #2, or #5?
What makes the other cells less readable?
    http://nbviewer.jupyter.org/github/james-prior/cohpy/blob/master/20161202-dojo-advent-of-code-day-01-part-1-route-distance.ipynb
First focuses on readability, then descends into obfuscation.
There is some deliciously nasty stuff in there.

inspired by:
    https://github.com/hakim89/adventofcode/blob/a21c50118f7ed1630c5a5280bb7baaa6aa48aee9/day-01.py

desert challenge
adventofcode.com

wp:manhattan distance
wp:cardinal direction

airplane names

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

new version of Learning Python updated 2016-10-14.

Duck typing according to Raymond

    Never use the tests isinstance() and issubclass().
    Don't do type checks.

    Everywhere you did type checks,
    it precluded you from the ability to do duck typing.

    Anybody who puts in type checks is defeating duck typing.

    In my first six months of doing Python, I put type checks everywhere.

    My next six months were taking them all back out.

    The maturing of a Python programmer is to not use isinstance() anywhere.

wp:Red_pill_and_blue_pill

Counter()

    is just a dictionary, can put anything in it
        floats, Decimals, 'kitchen sinks'

Raymond loves __missing__ method.

Python Lex & Yacc
https://pypi.python.org/pypi/ply
wp:yacc
wp:Lex (software)

.casefold() is the new .lower()

https://www.djangoproject.com/
django szNJ6DqrqoA

found long lost brand new 32 GB USB flash drive Cruzer Fit in book bag
was lost about 3.5 years

someone
gave up on kivy

someone else
showed "hello" touch screen app made with kivy

forgot to bring wrenches and nail polish to tighten loose table legs
    1/2?, 9/16?, 5/8?
    3/8 drive ratchet and sockets
    just wrenches


More information about the CentralOH mailing list