pre-release: North Bay Python meeting announcement

Please take a moment to review your details and reply with OK or edits.
Subject and below is what will go out and also will be used to title the videos.

Subject: 
ANN: North Bay Python at Mystic Theatre Sat November 2, 10p


North Bay Python
=========================
When: 10 AM Saturday November 2, 2019
Where: Mystic Theatre

https://2019.northbaypython.org/schedule/

Topics
------
1. Opening Remarks


(Needs description.) 
 recording release: yes license: CC BY  

2. To **** With Passwords!
Jacob Kaplan-Moss

(Needs description.) 
 recording release: yes license: CC BY  

3. A Gradual Introduction to Types
Laura Hampton

**Long Description: **

When I was learning Python, my teacher told me that in order to understand what my code was doing, I needed to know the value and type of every variable. I’ve found it to be valuable advice for debugging and for understanding my code. Python’s type checking tools enable types to be programmatically analyzed before runtime, allowing developers to write code that is easier to reason about and avoids certain types of bugs. Because of this, several large projects have adopted type checking for their Python codebases. 

Recent versions of Python allow dynamic and static typing in the same application. In the past, types have been handled by the Python interpreter in an implicit way. Python 3.0 added syntax for annotating types in functions, and this was extended to allow declaring the types of variables in 3.6. (As a side effect, it’s possible to declare a variable without assigning it a value!)  

This talk will cover gradual typing and how type annotations can make Python behave like a statically typed language, the benefits and drawbacks of using a type checker, and cover some examples of handling type checking cases using the `mypy` library. Newer programmers will find that type checking is a useful debugging tool that gives insight into what their code is doing. More experienced programmers will learn more about how type checking is implemented in Python, and will be able to live peacefully with code that behaves as both dynamically and statically typed. 


**Outline (30 minutes): **

* Dynamic and static typing (4 mins)
* Gradual typing, and how type declarations can work with dynamic typing and make Python behave more like a statically typed language (6 mins)
* Python’s tools for type checking - MyPy and the typing library (3 mins)
* The difference between structural typing and nominal typing (4 mins)
* Interesting type annotation cases in `mypy` (8 mins)
(Functions that return None; 
Annotating lists, tuples and other container types; 
Annotating classes before they are instantiated; 
Using protocols for structural typing; 
Any type)
* When to use a type checker, and what kinds of errors it can catch (and which it can’t ) (5 mins)


**Outline (40 minutes):** 

* Dynamic and static typing (4 mins)
* Gradual typing, and how type declarations can work with dynamic typing and make Python behave more  like a statically typed language (5 mins)
* Python’s tools for type checking - MyPy and the typing library ( 3 mins)
* The difference between structural typing and nominal typing (4 mins)
* Annotating code with mypy (8 mins)
(Functions that return None; 
Annotating lists, tuples and other container types;
`Typevar` and creating your own types; 
Annotating classes before they are instantiated;
Any type)
* The type hierarchy and relationships between types (4 mins)
* Type protocols (how methods implemented on a type affect its behavior) (4 mins) 
* Generic types and type variables (4 mins) 
* When to use a type checker, and what kinds of errors it can catch (and which it can’t) (4 mins)

The types of variables provide insight into a program’s behavior and the validity of its results. This talk will cover Python’s resources for validating type.  It will discuss using type checking as a debugging tool, how gradual typing can make Python behave like a statically typed language, and cover some edge cases in typing with the mypy library.
 recording release: yes license: CC BY-SA  

4. How I turned a podcast into a business with Python (and some Other Tools we won't talk about)
Jay Miller

We will cover the building of a podcast the easy and hard way. I started with the hard way that includes using Flask and PyMongo (plus a lot of string formatting) to build my site and host my feed. Then I will cover why I stopped doing that and opted to go with a more traditional host. 

Next I will talk about my editing process as a whole and how I use python + requests to do things like add guests to a mailing list and trigger some automations (like social media posts)

Finally I will cover the steps that I took to turn my skills into a business around marketing and editing. This includes:

* automating mailing lists and email creation with maligun.
* automating Newsletter builds for clients with Javascript and eventually python (Requests, Beautifulsoup + Jinja)
* automating my billing process with with stripe.

I've been interviewing people in tech for the past 4 years. Last year I turned this into a business where I help other content creators with their brand. 

In this talk I will break down some of the tools that I used to make turn the podcast into a boutique business by using a lot of python and some awesome folks in the python community!
 recording release: yes license: CC BY-SA  

5. The blameless post mortem: how embracing failure makes us better
Chris Wilcox

In today’s world of developing services we tend to move fast and with that comes mistakes. This talk will discuss using post-mortems to turn incidents into opportunities for improvement, instead of just an opportunity to assign blame.

While developing software, bugs and mistakes are inevitable. Come to hear how we can improve the approaches we often take as software developers to work better with one another in heated moments of failure and the aftermath of incidents. Through better interactions we can build better teams and create better services.

In my career I have worked in a blameless post-mortem and a blame-full post mortem environment, across a variety of projects ranging from individual python libraries, to core infrastructure for a cloud. I am excited to share how I think not assigning blame when things go wrong results in a better team and a better product.
.

In today’s world of developing services we tend to move fast and with that comes mistakes. This talk will discuss using post-mortems to turn incidents into opportunities for improvement, instead of just an opportunity to assign blame.
 recording release: yes license: CC BY-SA  

6. The Secret Life Of Python
Steve Dower

Python 3.8 is about to be released, and hackers are worried. For years, being able to access Python on someone else's machine has meant freedom, power, immunity, and most importantly, reliable cross-platform malware. Some of the most powerful hacking tools are written in Python, and it needs to end.

While the bad guys are worried, the good guys are celebrating. Python 3.8 is bringing some new features through auditing events and the verified open hook. No longer will Python be a black box within your system, but the log stream available through auditing hooks will let you know whenever it is being (mis)used. Being able to verify code files before they are executed allows administrators to detect tampering and ensure the integrity of their system, rather than allowing attackers to infiltrate and persist.

In this session, we will see why hackers love the power and flexibility of Python. We will implement actual auditing hooks to expose their secret acts, and see some of the operating system features that are now available to Python developers. Rather than being a vulnerability in your environment, these features make it an early warning system, helping protect you and your users from the biggest threats in our always-connected world.

Python 3.8 includes new features for security engineers to allow greater insight and awareness when your network is under attack (which is every day). This session will investigate the need for these hooks and how they are used to protect your production servers and your users.
 recording release: yes license: CC BY-SA  

7. See CPython run: Getting to know your Python interpreter
James Bennett

Python is a pretty neat language, but without an interpreter it doesn't do much. And although lots of people use the CPython interpreter (which is the main implementation of the Python language) every day, its workings are still a mystery even to many experienced Python programmers. So rather than explain features of Python the language, this talk will cover the interpreter itself, how it runs your code, and how you can use knowledge of the interpreter to figure out why your Python code behaves the way it does.

To get started, we'll briefly look at some real questions asked on Python forums, wondering about strange, or at least unexplained, behaviors of Python. Like: Why does a different way of writing the same code sometimes run faster? Why does the behavior of the `is` operator seem to be inconsistent for some kinds of values? And what's the deal with all those ".pyc" files Python likes to leave all over the place? How and where would we start looking for answers to these?

Then we'll take a look at the overall life cycle of Python code. We'll start with Python source code, and see how Python parses it into an abstract syntax tree (AST), how you can ask Python to show you the AST for a given piece of code, and how to read and understand it. Next we'll look at the transformation from AST to Python bytecode, what a Python code object looks like and how it's built, and how you can access it and understand the bytecode. Finally we'll see how the CPython virtual machine runs the compiled bytecode, and what's going on as it does so.

Then we'll dive into the infrastructure of the interpreter, pointing out where to go to see things like the low-level implementations of Python's built-in types, the bytecode interpreter loop, the AST and bytecode optimizers, and more, along with tips on how the interpreter's source code is organized and how to find and read things you're interested in.

Finally we'll circle back to some of the original questions about Python behavior, and see how they can be answered by using knowledge of how the CPython interpreter works, along with tools and tactics for making it easier to dig into what Python's doing with your code, and references for further reading and learning.

You might run a Python interpreter multiple times a day, but do you really know what it's doing while it runs your code? And if Python is doing something that seems strange, where might you start looking to figure out why? Come find out in this guided tour of how the CPython interpreter works!
 recording release: yes license: CC BY-SA  

8. How To Build a Terrible Robot
Paloma Fautley

Python is an amazing language that reduces the barrier to entry for beginners and is an essential language for most programmers. The language is relatively simple to learn, but with the huge amount of libraries and packages available you can use the same language for an inconceivable number of applications.  In contrast, hardware becomes obsolete quickly, making a small mistake can be costly (in time and $$), and is highly specific to each application. Because of this, when I tell Python programmers that they should be building more robots I get dirty looks. People like the idea of building awesome robots, but don’t want to go through the pain of getting started. In my talk I want to share some tips for learning to be fluent in hardware using MicroPython and simple prototyping techniques.

After my talk you should know:
1. What MicroPython is and how you can implement it
2. How to write a simple MicroPython program
3. How to hook up simple sensors and actuators
4. Additional resources to learn more

People always talk about failing fast, but nobody teaches you how to actually do that, or ever gives you many second chances when you do fail. I’m going to do my best to convince you to step into the world of hardware using MicroPython and simple electronics to build something useless and to see what you can learn from that experience.
 recording release: yes license: CC BY-SA  

9. Let's build a video game, train a bot to play it, and deploy it on a smartphone in 30 minutes
Paris Buttfield-Addison

In this session, we’ll build a little smartphone game, train a bot to play it using reinforcement learning, Python, and TensorFlow, and deploy it to a smartphone.

In 30minutes. We’ll show you how easy it is to add ML-powered intelligence to video games or simulations, and how inference on smartphones is easier than it’s ever been: modern, powerful tools like Unity’s ML-Agents, Python, and TensorFlow make the complex easy. And it’s a lot of fun.

First, we’ll spend 10 minutes of the session:

* showcasing the absolute basics game engines
* creating an arcade game, live on stage
* adding some art, to make the game look pretty!

Second, we’ll spend 10 minutes of the session:

* implementing an agent, using Python and TensorFlow, that is rewarded for playing the game
* training the agent to play
* giving the agent some character

Finally, we’ll spend the last 10 minutes of the session:

* preparing our trained model for deployment onto a smartphone
* building the game and optimizing both the gameplay and ML-components for a smartphone
* showing the audience the game, running live on a phone!

This is an engaging, fast-paced, and surprisingly in-depth exploration of how powerful modern game engines can be used for quick, relatively easy, but incredibly powerful state of the art machine learning and training, and how powerful inference on-device is, for mobile AI.

You don’t need to be a game developer to see the benefits. Join us for 30minutes of rapid live coding, and engaging banter while we show what’s really possible with Python, TensorFlow for ML, game engines/simulations, and mobile devices!

In this session, we'll build a little smartphone game, train a bot to play it using reinforcement learning with Python and TensorFlow, and deploy it to a smartphone. In 30 minutes we'll show you how easy it is to add machine learning (ML)-powered intelligence to video games and simulations, and how useful it can be to visualize ML problems. It'll be fun, and you'll learn the fundamentals of ML.
 recording release: yes license: CC BY-SA  

10. Make your code come alive: using interactive Jupyter notebooks outside of the sciences
Ludovico Bianchi

Combining code, output, and prose in a single interface,
Jupyter notebooks are ideally suited for exploratory data analysis,
making them an increasingly essential tool in the sciences and in data science.

Thanks to the efforts of the open-source community behind them,
an expanding panorama of tools, extensions, and open standards emerged,
effectively turning Jupyter notebooks into a versatile platform that can be used successfully
outside its more typical fields of application.

The talk's main focus is on interactivity in Jupyter,
and specifically strategies and tools that can be used to gradually add functionality to existing code in just a few steps,
using examples from outside the areas of science or data science.

After a brief introduction about Jupyter, we'll explore:

- How to make your objects feel at home in the notebook with custom rich output methods;
- How to turn a function into an interactive dashboard with as few as a single line of code with ipywidgets;
- How to convert a notebook into a standalone web application with Voilà;
- How to share notebooks that everyone can run with one click using Binder

By the end of this talk, folks who are new to Jupyter will receive an overview of Jupyter's features for interactivity,
while experienced users will have the chance to look at different use cases for familiar tools.

Jupyter notebooks are known for their popularity in the sciences and data science,
but their powerful features make them useful far beyond just analyzing data and plotting graphs.
This talk will explore ways to create and share interactive Jupyter notebooks,
and how they can be used in a wide range of domains as a simple but effective tool to make software more usable and accessible.
 recording release: yes license: CC BY-SA  

11. The New York Times: Sustainable Systems, Powered by Python
Sharon Tartarone, Michael Laing

Delivering modern and reliable photo tools to an ever-evolving newsroom depends on building sustainable systems for both end-users and developers.

For our end-users, we provide resilient, highly available systems that can quickly resume processing when faced with unexpected errors and crashes. For our developers, we build flexible, maintainable systems that can be enhanced and tested with ease and in parallel. 

Our systems are built upon Python-based open-source tools and methodologies which have enabled us to implement fail-fast error handling, module packaging, command-line tooling with click, plugin-based features with pluggy, productive development with black, code quality and type checks with mypy and flake8, and automatic doc generation using sphinx.

We’ll review how and why we’ve leveraged these tools and do a deep dive into the technology using a publicly available set of example github repositories that attendees can reference.

For our users, we provide resilient, highly available systems that quickly resume processing when faced with unexpected errors and crashes. For our developers, we build flexible, maintainable systems that can be enhanced and tested with ease and in parallel. We’ll review how and why we’ve leveraged Python-based open-source tools and methods to enable this and do a deep dive into the technology.
 recording release: yes license: CC BY-SA  

12. Writing a PEG parser for fun and profit
Guido van Rossum

(Needs description.) 
 recording release: yes license: CC BY  

13. Opening Remarks Day 2


(Needs description.) 
 recording release: yes license: CC BY  

14. From Prison to Python
Shadeed Wallace-Stepter

(Needs description.) 
 recording release: yes license: CC BY  

15. Mass Decarceration: If We Don’t Hire People With Felony Convictions, Who Will?
Jessica McKellar

This is Part II of a 2-part keynote for North Bay PyCon 2019 by Sha Wallace-Stepter and Jessica McKellar, and covers concrete actions technologists can take to change our criminal justice system. Find part I, on Sha's life story in the prison system, here: http://youtu.be/jNBsrLzHVgM
 recording release: yes license: CC BY  

16. Script Layering for large-scale number crunching in Python
Catherine Moroney

Python's combination of number-crunching and plotting prowess, combined with scripting makes it easy to submit a massive number of scientific jobs in a fully-automated fashion.  I often need to run hundreds or thousands of orbits through the processing software and by dividing the duty into multiple scripts, each calling the one below, I have a customizable and automated way of finding the input files, caching them to a local disk, creating the input files, submitting each orbit to our batch-processing system and monitoring their progress so the entire chain consisting of 10-15 executables can all be run in order with a single command.

Python's scripting capabilities, combined with its number-crunching utility make it very easy to gather up all the data, submit thousands of jobs and then monitor their progress, all with a single command.  One script submits a single orbit, another one calls the first to run a month or year worth of data, and then a third calls the second to run the entire processing chain.  Script layering!
 recording release: yes license: CC BY-SA  

17. PhD not required: a layperson's guide to reading journal articles
Julia Duimovich

Despite having "learned" how to read a journal article in school, the skill stopped at reading - I didn't really know how to apply what I'd learned to my professional practice. I could read an article on byte code optimization and then go back to work without gaining any practical takeaways.  I felt so discouraged because I wasn't really getting anywhere. Once you've read something, you need to be able to use it in some way, or else it becomes trivia. And it takes time to build this skill. 
Developing it has huge benefits, however - building your base knowledge of the field,  discerning what is bragging and what has technical value, engaging with proposals that are out of your area of expertise, designing experiments, and improving your technical writing. 
Specifically, I'll be reviewing a paper on reverse debugging to demonstrate some techniques. You can follow along here if you'd like, although it is not recommended that you read the paper in advance. https://www.usenix.org/system/files/osdi18-cui.pdf

The gap between industry & academics is wide and tough to bridge.  Not only are journal articles intimidating, they aren't always topical to software engineers. However, there are a ton of benefits to reading journal articles if you know what and how to read them. You'll leave this talk wanting to find yourself a journal article or two, a beverage, and a quiet space so you can learn something new!
 recording release: yes license: CC BY-SA  

18. What is a Coroutine Anyway?
John Reese

This talk will start with basic concepts of functions, including how they are represented in memory, how state is tracked, and how function calls interact with the stack. We’ll then cover the common methods of running multiple functions concurrently, as well as the benefits and difficulties of concurrency in Python.  

We’ll then introduce the concept of coroutines, a variant of functions, and discuss how coroutines manage state and execution differently from functions. We’ll show some high level examples of coroutines that communicate with each other, and look at how they can be of use for I/O bound workloads. 

Then we’ll finish by showing how coroutines are implemented in Python, what the async/await keywords are actually doing when you use them in your code, and how all of these concepts are leveraged by the AsyncIO framework to build high performance applications in modern, clean Python.

AsyncIO uses coroutines to deliver high performance from a single thread. But coroutines can be mysterious. How do they work? Starting from first principles, we’ll take a look at the basic concepts of coroutines and the unique problems they solve, then finish by deconstructing the core pieces of the AsyncIO framework.

This talk is for developers of all backgrounds. No CS degree required!
 recording release: yes license: CC BY-SA  

19. Snek: A Python-Inspired Language for Tiny Embedded Computers
Keith Packard

Tiny embedded computers, like the original Arduino, are great for
automating simple tasks. What they are not great at is providing an
easy-to-learn environment for new programmers.

As a part of a middle school robotics course based on Lego, I've
developed a new language, Snek, which runs on these machines. Snek can
run in as little as 32kB of ROM and 2kB of RAM. It provides a simpler,
safer, easier to explore environment than C++. Snek is a subset of the
Python language and comes with a host-based IDE written in Python that
runs on Linux, Mac OS X and Windows.

This presentation will describe the Snek language along with a few of
the interesting implementation details including:

 * A new parser generator, lola, that generates
   a parser 1/10 the size of bison

 * An in-place compacting garbage collector

 * A fine hack for representing values in 32 bits that includes 32-bit
   floats

 * Some challenges with Python syntax and
   semantics which make it difficult to fit into a small
   environment.

There will also be a demonstration of a few Snek-based Lego robots
along with a description of how Snek has been integrated into the
classroom environment. Comparisons with other embedded Python
implementations will also be provided, including Micro Python, Circuit
Python and full Python running on systems like the Raspberry PI.

Attendees will learn something about how interpreted Python
implementations operate, how Python can be used in embedded systems
and what teaching programming to middle school students (10-14 years
old) is like.

Snek is a subset of Python which runs on Arduino hardware. It has been
designed as part of a programming class for people ages 12-14 where
the students build robots using Lego and program them in multiple
languages. Learn how Python interpreters work, some unexpected
challenges in Python semantics and what its like to teach kids Python
while building Lego robots.
 recording release: yes license: CC BY-SA  

20. Keep Calm and Mind the Docs
Andrea Kao

Documentation is critical to the long-term health of any software system. The more complex the system, the more likely it is better served with visual tools than it is with the written word. And visual communication can take varied forms: from sketches, cartoons, or animations that narrate a single concept or describe a single workflow, to diagrams that detail multiple, tangled threads of business logic.

In this talk, we’ll discuss the advantages of using imagery to convey technical messages. For one thing, imagery can bypass or cut through the obstacles of language barriers, limited attentional bandwidth, and limited memory. Furthermore, the usage of drawings or diagrams can be an effective technique for combating the inertia and lethargic feelings that can accompany the software development process itself. I’ll give examples from my own experience as a technical writer and as a human being.

This talk references discussions from the Write the Docs community (for example, the usage of rST versus Markdown). It draws specific inspiration from Alicja Raszkowksa’s Draw the Docs presentation and community heroes like Julia Evans, among others. It will also quote thinkers in media studies (e.g., Marshall McLuhan, Susan Sontag), as well as explore studies in neuroscience and mindfulness. We'll talk about the emotional labor that's inherent in creating and reading documentation, and we'll talk about how the documentation process can become more humane.

This talk explores the challenges and shortcomings of written documentation in contrast to the capabilities of visual communication (e.g., diagrams or drawings). Communication is a form of emotional labor, after all. We’ll also discuss ideas from the Write the Docs community, along with concepts from media studies, neuroscience, and the study of mindfulness.
 recording release: yes license: CC BY-SA  

21. What is a PLC and how do I talk Python to it?
Jonas Neubert

Walk into any factory and you will see a Programmable Logic Controller (PLC). It's the small box that has a memory card and an Ethernet cable on one side, and lots of colorful wires connected to the other end. Inside runs the logic that turns inputs from sensors into outputs to robots, conveyor belts and other machinery. PLCs evolved from relay banks in the 1970s and have ruled the world of industrial automation since then.

In the first half of this talk we will take a look at how they work, how to program them, and why a strange language called "ladder logic" is (still) the lingua franca for programming them. In a short on-stage demo I will write some PLC code to control a device on stage.

It's 2019 now and just running a PLC isn't quite enough anymore. Everyone is talking about the "Industrial Internet of Things" and they have connected their PLCs to the company network. The second half of the talk will look at how we can connect to PLCs to read data and influence the running program with Python.

How do you program the physical world with Python? Programmable Logic Controllers (PLCs) are the devices that control HVAC systems, factories, power plants, ..., everything! In this talk, I will bring a traffic signal on stage and program a PLC to control it. We'll then go over several examples for how to use Python to collect data from the system and send data to influence its behavior.
 recording release: yes license: CC BY-SA  

22. A-hunting We Will Go: Debugging pytest with Django
Cris Ewing

Debugging code is a skill we all must learn, but one that is rarely taught particularly well. We speak about “reading the traceback” as if that alone is sufficient to lead us to the solution to all our problems. But what happens when it isn’t enough? When the traceback is the symptom of a problem that happened elsewhere, or elsewhen? How do you approach debugging when the leads are slim?

This talk presents the tools of debugging couched in a very specific tale of a particular bug hunt. The specific bug is a good one because it presents a number of the classic tough problems in debugging. It starts with an intermittent failure. It has a traceback that is completely remote from the actual cause of the problem. It involves the interaction of three separate systems: a web framework, a test framework, and a database. And in the end, the cause is so small, and the solution so simple, that it serves to remind us all to be humble in the face of the complexity we deal in daily.

During this talk, you'll learn about ways to use printing and logging as well as pdb.  You'll see how core Python tools like dbapi2 and the inspect module can help to solve common problems. You'll learn how to spot new avenues for exploration, and how to figure out when you're in a blind alley.

The talk is entertaining for folks of any level, but it’s probably of most use to beginner and intermediate programmers.

So you’ve got a bug and you can’t see where to begin? Well, let me tell you, I’ve been there. Have a seat and I'll tell you a story of a bug that cost me three days and ended in three lines of code. I promise you’ll laugh, you’ll cry, and when we’re finished, you might see a path to start your own hunt.
 recording release: yes license: CC BY-SA  

23. Python, Government, and Contracts: providing a tool to investigate corruption
Froilán Irizarry Rivera

In the two years after Hurricane Maria struck Puerto Rico there has been a sharp increase in investigative journalism on the island. Most of these investigations have been around questionable contracts awarded by different government entities and officials in Puerto Rico. No-bid contracts like the ones award to White Fish and later to Cobra Acquisitions have generated national outrage. Lack of transparency, costly mismanagement, and abuse of power can be found throughout.

The Office of the Comptroller of Puerto Rico has built a tool that lets you search and download contract documents (after they’ve been redacted of sensitive information). While it serves its purpose of making this information available, the tool does not permit any mass data analysis or download. In less than a week we were able to release a very early version of our tool to improve this. 

Our goal was to present a "better" way to search and use this data, create a sustainable project that could be easily used, while also keeping effort and cost to a minimum. For all these reasons we landed on using Python and Django. Django and the ecosystem around it presents an amazing opportunity to minimize effort and cost for a civic tech project while providing a robust way to manage the processes and data of a project like ContratosPR. Django's admin give use a central place to glance which contract documents need to be requested, OCR'ed, and provides the tools to execute the request process. All of this in combination with great docs and an amazing community made them a clear choice.

In the years after Hurricane Maria there has been a sharp increase in investigative journalism in Puerto Rico. Most of these investigations have been around questionable contracts awarded by different government entities and officials. We've used Python and Django to create a tool that consumes an unwieldy government site to make this data more accessible to  journalist and citizens.
 recording release: yes license: CC BY-SA  

24. Conference Close


(Needs description.) 
 recording release: yes license: CC BY  



Location
--------
Mystic Theatre


About the group
---------------