Sessions at PyCon US 2012 with slides on Sunday 11th March

Your current filters are…

Clear
  • Parsing Horrible Things with Python

    by Erik Rose

    If you've ever wanted to get started with parsers, here's your chance for a ground-floor introduction. A harebrained spare-time project gives birth to a whirlwind journey from basic algorithms to Python libraries and, at last, to a parser for one of the craziest syntaxes out there: the MediaWiki grammar that drives Wikipedia.

    Some languages were designed to be parsed. The most obvious example is Lisp and its relatives which are practically parsed when they hit the page. However, many others—including most wiki grammars—grow organically and get turned into HTML by sedimentary strata of regular expressions, all backtracking and warring with one another, making it difficult to output other formats or make changes to the language.

    We will explore the tools and techniques necessary to attack one of the hairiest lingual challenges out there: MediaWiki syntax. Join me for an introduction to the general classes of parsing algorithms, from the birth of the field to the state of the art. Learn how to pick the right one. Have a comparative look at a dozen different Python parsing toolkits. And finally, learn some optimization tricks to get a grammar going at a reasonable clip.

    At 12:00pm to 12:30pm, Sunday 11th March

    In E3, Santa Clara Convention Center

  • Sketching a Better Product

    by Idan Gazit

    If writing is a means for organizing your thoughts, then sketching is a means for organizing your thoughts visually. Just as good writing requires drafts, good design requires sketches: low-investment, low-resolution braindumps. Learn how to use ugly sketching to iterate your way to a better product.

    Building a better mousetrap is rarely accomplished in one zenlike moment of clarity—like all creative processes, it is iterative. Sketches are those iterations for things we can see and interact with. They are the key tool used to explore ideas and decide if they have merit; they are just as important in deciding what not to pursue.

    A good sketch is crude and fast. It isn’t necessarily pretty, and more often than not, it consists of just boxes and lines, rarely with color. It doesn’t matter what tools you use, so long as you can do it fast and get your ideas out where everybody can see them. It doesn’t matter if you can’t draw, because everybody can draw boxes and lines.

    This talk will cover sketching as a tool in the interface design process, including both the why and the how of sketches. It will include practical techniques for sucking less at making the kind of sketches that are useful for decision making, as well as tips on simple sketching methods to make it feel like an interface.

    At 12:00pm to 12:30pm, Sunday 11th March

    In D5, Santa Clara Convention Center

  • Building A Python-Based Search Engine

    by Daniel Lindsley

    Search is an increasingly common request in all types of applications as the amount of data all of us deal with continues to grow. The technology/architecture behind search engines is wildly different from what many developers expect. This talk will give a solid grounding in the fundamentals of providing search using Python to flesh out these concepts in a simple library.

    • Core concepts
    • Terminology
    • Document-based
    • Show basic starting code for a document
    • Inverted Index
    • Show a simple inverted index class
    • Stemming
    • N-gram
    • Show a tokenizer/n-gram processor
    • Fields
    • Show a document handler which ties it all together
    • Searching
    • Show a simple searcher (& the whole thing working together)
    • Faceting (likely no demo)
    • Boost (likely no demo)
    • More Like This
    • Wrap up

    At 1:30pm to 2:10pm, Sunday 11th March

    In E3, Santa Clara Convention Center

  • Deep Freeze: building better stand-alone apps with Python

    by Ryan Kelly

    There's more to shipping a stand-alone python app than just running py2exe over your code. Want to deploy automatic updates? Want to be sure it runs on legacy platforms? Want to add professional touches like code signing? And want to do this all in a cross-platform manner? This talk will show you the tools you can use to make your frozen apps better in a variety of small yet important ways.

    Overview

    Python has a powerful and mature suite tools of tools for "freezing" your python scripts into a stand-alone application, including py2exe, py2app, cxfreeze, bbfeezee and PyInstaller. But there's more to shipping a stand-alone app than just running py2exe over your code.

    This talk will show you the tools you can use to make your frozen apps better in a variety of small yet important ways.

    Want to deploy automatic updates? The "esky" package provides a simple API for building, publishing and installing updates, and jumps through all the hoops needed to ensure failed updates won't leave your program unusable.

    Need to run on older versions of OSX or ancient linux boxes? The "myppy" package can build a python runtime optimized for portable deployment and binary compatibility with older systems.

    Want to add code-signing for that professional touch? The "signedimp" package provides cross-platform hooks for code signing and extends the protection to code loaded at runtime.

    Each of these tools has been extracted from a real-life build process for a complex cross-platform application, and each is designed to help make your frozen applications just that little bit better.

    At 1:30pm to 2:10pm, Sunday 11th March

    In D5, Santa Clara Convention Center

  • Improving Documentation with "Beginner's Mind" (or: Fixing the Django Tutorial)

    by Karen Rustad

    This talk evaluates a well-known free software tutorial (the official Django tutorial) from the perspective of a web development novice in order to point out omissions and common sticking points and suggest improvements. More generally, this talk is useful to anyone looking to improve their project's tutorials and other newcomer-targeted documentation by approaching them with "beginner's mind".
    Abstract

    Most free software projects make large, unstated assumptions about the background knowledge and experience of newcomers. Because the people who typically write tutorials or setup documentation for a project are veteran developers intimately familiar with the particulars of the project, it is unfortunately easy to gloss over material or forget the sorts of things that are likely to confuse or turn off newcomers. (How many free software projects assume that newcomers have expertise in bash, or previous experience in distributed version control, or knowledge of how to write a good bug report?) Left to their own devices, everyone designs for people like themselves--not just in software or design, but in documentation as well!

    The solution to this problem is twofold: one, ideally, to "user test" one's entry-level documentation by watching a newcomer attempt to use it and note where they get stuck; and two, more generally, to remember what it was like to be a beginning programmer and/or to make your first free software contribution and accordingly to intentionally cultivate empathy for and consciousness of that state of being.

    For this talk, we will take as an example the official Django tutorial. Django as a project has a reputation for prioritizing having high-quality and complete documentation far higher than many other FOSS projects. However, despite this high prioritization, even Django's tutorial has significant issues in terms of how well it serves new web programmers; it is primarily targeted as experienced web developers and operates better as an advertisement rather than as a how-to. As a result, it misrepresents or omits entirely whole swaths of knowledge which would be key to a newer web developer actually succeeding with Django.

    In this talk, we use the perspective of a web development novice to go through the official Django tutorial, point out omissions and common sticking points, and suggest ways to improve.

    Outline:
    Our hypothetical newcomer
    Imagine a novice programmer--let's say, a CS undergraduate--coming to the Django tutorial for the first time
    Fluent in Python and perhaps a couple other languages
    New to web programming
    Little experience reusing other people's code
    Lots of experience using web applications, some sense of their user-facing capabilities
    No direct experience using SQL / databases
    Critical look at the Django tutorial
    Missing concepts

    Projects vs. apps: "what's the difference, and why do I care?"
    Relatedly, reusing other people's apps -- resources and best practices
    Test driven development -- "what's this tests.py thing for?"
    Missing features

    The biggest "gotcha": handling database schema changes (aka "What do you mean I can't edit my models anymore?")
    HOWTO debug -- "what do I do when something goes wrong?"
    User-facing CRUD -- Tutorial emphasizes built-in admin, but most modern web apps focus on user-generated content instead; "how do I do that in Django?"
    Static file handling and template inheritance -- what would a "Django for designers" guide look like?
    Assumed knowledge

    HOWTO install Django safely (e.g., virtualenv)
    HOWTO deploy to an actual server (even "just" a hosted cloud solution like heroku or ep.io) -- aka "How do I show off this cool app I made to my friends?"
    Historical perspective on why the tutorial is this way
    In 2005, Django's audience was mostly intermediate-to-advanced programmers who were familiar with older, more minimal Python web frameworks
    Django was originally developed for newspapers, hence the admin app emphasis
    Lessons
    Remember, and be empathetic to, the kinds of mistakes you used to make before you became an experienced coder. Don't remember? Find someone who does!
    Link to third-party add-ons that improve the project (e.g., South for migrations)
    Be aware of your dependencies -- not just technical ones, but knowledge ones as well
    And link to third-party tutorials or other resources that teach those well! (e.g. debugging tools, deployment info)
    A tutorial can't cover everything, but it can at least mention nearly everything, with links for further details. A newbie doesn't know an important aspect of your framework exists unless you tell them--blind searching doesn't work very well.
    Know who you are writing for -- and say so.

    At 1:30pm to 2:10pm, Sunday 11th March

    In E2, Santa Clara Convention Center

  • More than just a pretty web framework, the Tornado IOLoop

    by Gavin M. Roy

    Tornado, often thought of as a web development framework and toolset is built on top of a protocol-agnostic IOLoop, presenting an alternative to Twisted as a foundation for asynchronous application development in Python. This talk covers the Tornado IOLoop, its features and the process of writing drivers and applications using it.

    Abstract

    Tornado, often thought of as a web development framework and toolset is built on top of a protocol-agnostic IOLoop, presenting an alternative to Twisted as a foundation for asynchronous application development in Python. This talk covers the Tornado IOLoop, its features and the process of writing drivers and applications using it.

    Outline
    (30 Minutes)

    tornado.IOLoop and tornado.IOStream Introduction (5 Minutes)
    Building an event driven server using IOStream (10 Minutes)
    Options for Socket Reading
    read_until_regex, read_until, ready_bytes, read_until close
    Callbacks and handling events
    Inspecting state
    SSL streams
    Diving Deeper, Using the IOLoop Directly (10 Minutes)
    Registering events on the loop
    When data is available
    When we can write to the socket
    When there are errors on the socket
    Using timers, timeouts and callbacks
    Inspecting the stack and debugging
    Performance Considerations and Closing (5 Minutes)

    At 1:55pm to 2:35pm, Sunday 11th March

  • Diversity in practice: How the Boston Python Meetup grew to 1000 people and over 15% women

    by Asheesh Laroia and Jessica McKellar

    How do you bring more women into programming communities with long-term, measurable results? In this talk we'll analyze our successful effort, the Boston Python Workshop, which brought over 200 women into Boston's Python community this year. We'll talk about lessons learned running the workshop, the dramatic effect it has had on the local user group, and how to run a workshop in your city.

    The Boston Python Workshop is a project-driven introduction to Python for women and their friends. It has run 6 times with the Boston Python Meetup in the last 12 months, bringing over 200 women into the local Python community. By being fully integrated into the main user group, the workshop has helped the Meetup grow to over 2**10 members and consistently draw over 15% women at its events. We'll talk about lessons learned running the workshop, the dramatic effect it has had on the Boston Python Meetup, and what it takes to run an outreach event in your city.

    At 2:10pm to 2:55pm, Sunday 11th March

    In E2, Santa Clara Convention Center

  • Sunday Afternoon Lightning talks (90 minutes)

    by Luke Macken

    At 3:00pm to 4:30pm, Sunday 11th March

    Coverage slide deck