RSSAmplifier

Blog

late.am

late.amRSS feed ↗32 posts

Latest posts

Flask-PyMongo, Back from the Dead

homesteading.com Long ago, when I worked at MongoDB I created Flask-PyMongo to make it easy for programmers using Flask to use the database. Fast forward almost 8 years, during which time I wasn't a consistent user of either Flask or MongoDB, and Flask-PyMongo has fallen into disrepair. MongoDB, PyMongo, and Flask have moved on, and Flask-PyMongo hasn't been kept up to date. There are more than…

Now Seeking PyGotham Program Committee Members

marc thiele Last year’s PyGotham had a great program committee of four organizers and eight volunteers. Unfortunately due to the constrained timeline of the 2017 conference and everyone’s individual schedules, we had only a few chances to meet, and never as the full group. The major consequence of this is that the final talk decisions were effectively made by a smaller group, mostly conference…

Diversity at PyGotham

This year, for the first time, PyGotham is asking everyone who has submitted a talk to our Call for Proposals to fill out a brief demographic survey to help support our efforts to ensure that PyGotham is representative of the Python community we believe in, welcoming to all our conference attendees, and helps to broaden and advance the conversation on diversity and representation that the wider…

PyGotham Talk Voting Retrospective

PyGotham 2017 is less than two weeks away! (Do you have your ticket yet? Use code "IVOTED" for 25% off! ) As we ramp up for the final conference, I wanted to take a moment to share some thoughts on our experiment with public talk voting this year. Håkan Forss

PyGotham Talk Voting is Open!

For the first time, the PyGotham program committee is looking for you, our potential attendees, speakers, and community, to help us shape the conference by voting on the 195 talk proposals we've received. We're going to hold open voting until August 7th, after which the Program Committee will use the votes to inform our final selections for the conference.

Submit to PyGotham's CFP

I'm honored to be an organizer on the program committee for PyGotham 2017 this year, and I encourage you all to submit a talk to our little conference. PyGotham will be held October 6, 7, and 8 in New York City, and the Call for Proposals is open until July 18. PyGotham attendees are diverse, come from varied backgrounds and skill levels, and have lives and interests beyond Python programming.…

Introducing Tox-Docker

Today I released Tox-Docker to GitHub and the Python Package Index . Tox-Docker is a plugin for Tox , which, you guessed it, manages one or more Docker containers during test runs.

Delete Your Dead Code!

A few days ago, Ned Batchelder 's post on deleting code made the rounds on HN , even though it was originally written in 2002. Here I want to echo a few of Ned's points, and take a stronger stance than he did: delete code as soon as you know you don't need it any more, no questions asked. I'll also offer some tips from the trenches for how to identify candidate dead code. This is the second in an…

Demystifying Logistic Regression

For our hackathon this week, I, along with several co-workers, decided to re-implement Vowpal Wabbit (aka "VW") in Go as a chance to learn more about how logistic regression , a common machine learning approach, works, and to gain some practical programming experience with Go. Though our hackathon project focused on learning Go, in this post I want to spotlight logistic regression, which is far…

Should Sense

I've just finished reading Dan Pupius' Medium article on Software Engineer Traits , where he lays out four characteristics of great software engineers. I agree with his assessment, and want to add one more quality to the discussion -- something I call "should sense".

Click Prediction with Vowpal Wabbit

My co-worker Sam Steingold and I have a new article at the Magnetic engineering blog about how we predict clicks in real-time online advertising.

Optimize Python with Closures

Magnetic's real-time bidding system, written in pure Python, needs to keep up with a tremendous volume of incoming requests. On an ordinary weekday, our application handles about 300,000 requests per second at peak volumes, and responds in under 10 milliseconds. It should be obvious that at this scale optimizing the performance of the hottest sections of our code is of utmost importance. This is…

Good Test, Bad Test

A good test suite is a developer's best friend -- it tells you what your code does and what it's supposed to do. It's your second set of eyes as you're working, and your safety net before you go to production. By contrast, a bad test suite stands in the way of progress -- whenever you make a small change, suddenly fifty tests are failing, and it's not clear how or why the cases are related to your…

Crickets

It's been real quiet around here. Like, tumbleweed-rolling-by quiet.

How to Rebuild a Virtualenv in Heroku

Today I managed to get myself a little bit stuck with Heroku's otherwise seamless Python support. In an earlier revision of my app, I had used -e to install an editable version of a package (the version of the package I needed had not yet been released to PyPI, so I pointed pip at Github). Since then, the version I need has been released. So, update requirements.txt , then git push heroku master ,…

A Modest Proposal for Tech Conferences

After more difficulty than expected , I'm at PyOhio , and once again I found myself not taking notes during today's sessions, but madly scrambling to open browser tabs to each of the open source projects, blog posts, and other online resources the presenters mentioned. It's a rush to keep up, particularly with laundry-list-of-links slides! The sessions at PyOhio (and most other conferences I…

What the heck is an xrange?

Pop quiz: how would you implement Python's xrange (known in Python 3.x as range ) in Python and without making a list or any other sequence type? If you answered "with a generator," you'd be wrong! And it's likely because you've only ever used an xrange in code like: for i in xrange ( 10 ): # do something 10 times In this case (where the xrange is only used as an "argument" to a for loop), a…

The exec Statement and A Python Mystery

A few weeks ago I examined Python code objects using the dis module. In that post, I showed several examples of executing code objects created at runtime using the exec statement; here we'll explore compile() 's compliment, exec , how to invoke it, and some of the quirks of using it.

A Python "Cast Constructor"

Very occasionally, I write code where I'm given an object of some class (usually from a library call), but I wish to use additional methods on that class as though they had been defined there. In some languages (Objective-C shines in this regard with categories ), you can do this very naturally. In Python, most people probably resort to monkey patching to accomplish this.

Exploring Python Code Objects

Inspired by David Beazley 's Keynote at PyCon , I've been digging around in code objects in Python lately. I don't have a particular axe to grind, nor some particular task to solve (yet?), so consider this post just some notes and ramblings that might be of interest (and my apologies if not). Disclaimer: This post is about CPython version 2.7, though much of it is also likely true for other…

Time to Answer @PythonQuestions

What's your new year's resolution? One of mine is to be more active in helping and mentoring new Pythonistas, which is why I wrote the twitter bot behind @PythonQuestions . Inspired by the @MongoQuestion twitter bot, @PythonQuestions tweets new Stack Overflow questions tagged "Python".

Hitchhiker's Guide to Python

I first heard about The Hitchhiker's Guide to Python at PyCodeConf a few months ago. It's a fantastic idea: open source, community-driven documentation on how to do Python right: everything from how to learn Python, to how to write idiomatic code, to how to distribute your projects, to surveys of best-of-breed open source projects and libraries you can build projects and applications on top of.…

Customize Virtualenvwrapper for Fun and Profit

Yaniv Aknin (whose blog I found through Planet Python ) recently blogged about his ZSH and virtualenv setup. As I was reading it, I recognized that he's solving some of the same problems I only recently solved myself (though through a very different approach than he took), so I figured I would share it, too.

Truncating HTML with Python

On the 10gen events pages we show a table of sessions for our MongoDB Day conferences, some of which are quite crowded . In order to try to keep the table relatively sanely laid out, we truncate the session descriptions to about 150 characters, and add a "Read More" link which expands to show the full description.

Keystone: A Simple Python Web Framework

After a conversation with my friend and co-worker Jesse Davis last week about Python web frameworks, I had an idea: what if there were a Python web framework that combined some of the simplicity of workflow and deployment of PHP with the readability and embodiment of best practices of Python? This should be a framework targeted towards folks who want to (or need to) learn web development, but…

Ensuring Write-Your-Own-Reads Consistency in MongoDB

In a question on StackOverflow a few days ago, a user was asking how to ensure that a document hasn't changed between when a client read the document and wrote to it. If user A reads the document and makes some changes (through a web form, for instance), the change should be accepted if and only if no other user B has updated the document since when user A read the document. MongoDB doesn't…

Web A/B Testing with Dabble

Thanks to a series of recent posts on the SvN blog , I've been thinking more about my little Python A/B testing framework, Dabble . I built Dabble to A/B test (sometimes also called "split test") features on 10gen.com . Following the advice of a blog post I've since lost track of, Dabble configures A/B test parameters entirely in code, follows procedure for independent testing, and generally works…

On Job "Requirements"

If you look at pretty much any job posting, you'll see some variation on this (in this case, for a hypothetical web programming position): Requirements: BSc in Computer Science or equivalent 2-5 years web development experience Expert in Java, SQL, HTML, CSS, Javascript Strong communicator Able to multi-task The numbers, degrees, and technologies will vary from one job to another, but the basic…

Never Use Source Control GUIs!

Just received this IM from my friend, Nick : 11 : 48 : 58 AM Nick : kjsahfdlkjashdflkajshdflkjh 11 : 49 : 02 AM Nick : it was the git gui itself 11 : 49 : 09 AM Nick : it periodically refreshes 11 : 49 : 14 AM Nick : with a forked git process Version control GUIs are uniformly evil . They entice you with a multitude of colors, and 1-pixel lines; their siren song is one-click commits and graphical…

Professor, a MongoDB Profile Viewer

I presented Professor , my MongoDB profile viewer and analyzer, this past Tuesday at the New York MongoDB User Group . Professor aims to use the new features in the MongoDB 2.0 profiler to make profile information intelligible and actionable. It's open-source (BSD-licensed) and written in Python and Flask .

The new Profiler in MongoDB 2.0

One of my favorite features in MongoDB 2.0 is the finer-grained output of the database profiler. In earlier versions, the bulk of the profile information was contained within a (structured, parseable) string, but as of 2.0 the fields have been broken out and made queryable.

Hello, Plog

I've wanted to start writing a blog for the past few months. By which I mean, writing blog posts. But why focus on writing great content when you can write great software instead? Allow me to introduce Plog , the software running late.am . Read on to see how Flask , Mongoengine , and MongoDB can work together to create something beautiful.