[CentralOH] 2016-04-25 會議 Scribbles 落書/惡文? temperature challenge review doctests magic number thify pretty d3 mondays list date parsing formatting tuple unpacking Nulluary word counting mcilroy knuth negative code djgpp nextstep micro:bit pyboard micropython dnf pi0 i18n leapyear

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Wed Jun 15 21:15:00 EDT 2016


Thanks to Pillar and Chris for their generous hospitality.

pack

    HP hoodie to give away
    HP cooler to give away

presentations

    refactor something

    ask people what music they code to

electrons have spin.
wp:Electron magnetic moment
wp:Atomic orbital

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

Pillar 
    Julie Walker
    talent engagement
        Plugged In
        always looking for polyglot developers
        extreme programming
        test driving
        pair programming
        continuous integration

    hire for life

    apprentice
    journeyman
    craftsman

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

PyOhio is last weekend of July: 30 & 31
deadline for proposals is May 15th

good talks
good people
free

Brian Costlow is head of PyOhio this year

one-day bootcamp for kids
40% for economically disadvantaged youths
community 
    run the race
    west side

looking for sponsors
great way to get your name out

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

ejf leading review of this month's entries

https://github.com/cohpy/challenge-201603-temps
reviewed answer4

    ran on try.jupyter.org
        dependencies only
    named magic number
    almost on the edge of tdd, but not quite
    
    locale issues
        might go back to numbers

review answer1
    python-dateutil

    csv: but it wants file, but did not want to mess with wierd stringio

    doctests
    thify()
    datetime.*.dateformat
    114: doesn't like concatenation (or the way the concatenation was done???)
        print(date.strftime('%B ' + thify(date.day) + ', %Y'))

        print(date.strftime(''.join(['%B ', thify(date.day), ', %Y'])))
        print(date.strftime('%%B %s, %%Y' % thify(date.day))
        print(date.strftime(
            '%%B {dayname}, %%Y'.format(dayname=thify(date.day))))

answer2

    https://github.com/janmilosh/cohpy_temps
    pretty graph!!! by d3 stuff
    hid wxunderground key (not in repo!!!)
    predicts 83F
    mondays = self._mondays_in_month(year, month)
        similar technique to answer4 using list of mondays

            date_list = formatted_date.split('-')
            year = date_list[2]
            month = date_list[0]
            day = date_list[1]

            month, day, year = formatted_date.split('-')

            import datetime
            date = datetime.datetime.strptime(formatted_date, '%m-%d-%Y')
            date.strftime('%Y%m%d')

answer1

    nice:
        naming datetime(2009, 9, 28)
        thify: nice to take that much care
            inflect
                uses serial comma
        date.strftime
        for date in dates: easy on the eyes
        '{d.year}-{d.month}-{d.day}'.format(d=date)
            very readable!!!
        date.strftime('%Y-%m-%d')
        delta for days and months

answer3

    nice:
        copying challenge into markdown cell
        not large, gets to the point

    study http://nbviewer.jupyter.org/url/colug.net/python/dojo/20160429/dojo-20160429-2016-Mar-COhPy_Challenge_Rough-20160513-1144.ipynb

answer4

    nice:
        works on try.jupyter.org
        FIRST_MEETING
        code was short and to the point
        mostly readable
        mondays, get_dates_for_weekday()
            return mondays[-2]

    meh:
        should have used tuple unpacking in:
            [
            x[0]
            for x in c.itermonthdays2(year, month)
            if x[0] and x[1] == weekday] 
        to have been something like:
            [
            day_of_month
            for day_of_month, day_of_week in c.itermonthdays2(year, month)
            if day_of_month and day_of_week == weekday]
        if earliest_date <= date < too_late_date:
            too_late_date is awkward name
            need to rework this
            close to being good, but not there yet
        12 in for month in range(1, 12 + 1):
            should name that magic number
                MONTHS_PER_YEAR = 12
        internationalization

answer5

        'Nulluary'
            cute name
        first time I have ever seen leap year calculation like this:
            if year%4: return False
            if year%100: return True
            if year%400: return False
            return True

answer6

    nice:
        LAST_MONDAY_OF_MONTH = relativedelta(day=31, weekday=MO(-1))
        split() in months = "Jan Feb ... Nov Dec".split()
        pretty plots!!!

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

new challenge
10 most common words (and their counts) of Mary Shelley's Frankenstein

https://github.com/cohpy/challenge-201604-words

Doug McIlroy did this with six short lines.

    http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/
    https://github.com/pdonis/wordcount

"The real hero of programming is the one who writes negative code,"

negative code

    When a change in a program source makes the amount of lines of code
    decrease ('negative' code), while its overall quality, readability
    or speed improves

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

Javascript is not really a bad language, it's just written that way.

-- Jessica Rabbit

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

ejf

what is python?

    specification
        grammar.html
        explanation

cpython
jython
ironpython.net/try
pypy
    wp:Ouroboros
rpython
    statically compiled
brython
    browser python (instead of javascript)
pypy.js
    emscripten compiles to asm.js
micropython.org
    make python into an OS
    micropython board similar power to Pentium PC
Damien George
micro:bit
microbit.co.uk

pyboard was made for micropython
eric was using pyboard
microbit is different board for different purpose
    see colug.net/carpe for continuing coverage

alternative implementations of python

    micropython

sudo dnf install screen

    (yes, dnf is a package installer)
    https://fedoraproject.org/wiki/Features/DNF

forgot to pack pi0

    but later found they _were_ packed

nextstep was so far ahead of everybody else for development platform
visual c++ was misleading misnomer that left a very bad taste in my mouth

friends don't let friends use inittest
pytest rocks

python for (PC)DOS
    https://www.python.org/download/other/
    http://www.caddit.net/pythond
    DJGPP is good
    thank you DJ!

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

    mud @ compuserve
    logged in multiple times while on compuserve premises
    ratcheted up to wizard
    bug report, may I please keep my wizard priviledges.

muons and bogons


More information about the CentralOH mailing list