May 31st, 2011 § § permalink

(photo courtesy of Sean MacEntee via flickr)
Some interesting bits and pieces (leftovers) from the weekend — I have a tendency to queue up a pile of “read later” stuff or emailing myself a pile of things to talk about/link to/etc. Sometimes, I actually get to go through it all. Today — I get to share it to!
First up — Michael Foord (fuzzyman) did two excellent posts — the first is on privacy in Python — not big-P privacy, but rather the programming/object privacy. It’s a good read because it reenforces the point that even if you think you’re being clever and hiding something in a closure to make it private, you can still get access to it. Remember too — dunders (__foo) are just name-mangling. In Python, nothing is private (insert bad tasting joke about Python being facebook here).
Michael’s second post is on the NamedTuple kerfluffle that was stirred up Kristjan Valur’s post on the use of exec() and namedtuple (short version: namedtuple creates a string defining the class and then calls exec to create the object. I think Michael is spot on — I think exec() gets a bad rap frankly, sure — it’s something of a hand-grenade, if you use it wrong, you’re going to get hurt, but in this case I have to agree with Raymond in his comment on bug 3974 — the current implementation is clear and maintainable. I don’t like the sternness of the reply — but he is right. Kristjan’s use-case is an interesting one, but I don’t think it’s one that warrants the removal of the existing implementation. I’m wondering if a “fallback if exec doesn’t exist” is worth inclusion.
Then again, I’ve spoken to people who refuse to use namedtuples because they now know how the sausage is made. I still think the sausage is delicious.
Next is a pretty interesting discussion on a presentation that came out of Pixar on getting over embarrassment in order to get things done — I don’t have much to add above the comments on hacker news, except to say I think the same mental blocks they talk about for animators apply to programmers, writers, etc. We hide from code reviews, we hide our writing until we think it’s “Pitch Perfect” — when in reality, we shouldn’t. We should be sharing, discussing and collaborating earlier, more frequently and more often.
Share and Ship early and often — see also “Don’t Go Dark”.
Finally, I was happy to see the “Quick and Easy Debugging in Python” post from Jeet Sukumaran — it’s always nice to evolve past sprinkling print fairy dust all over your code for debugging — even if we all still do it despite knowing or using PDB. Just to add to his post, if you want to increase your PDB-Fu, I recommend this “Debugging in Python” post by Steve Ferg, and the official documentation for PDB. We should really add a HOWTO for this.
p.s. For additional good-reading, check out “Priorities Don’t Exist in a Vacuum” and “First Care”- while not germane to what’s I’ve already written about, they’re a good essays on priorities. Thanks to the latest “Back to Work” podcast.
(photo courtesy of Sean MacEntee via flickr)
Some interesting bits and pieces (leftovers) from the weekend - I have a tendency to queue up a pile of "read later" stuff or emailing myself a pile of things to talk about/link to/etc. Sometimes, I actually get to go through it all. Today - I get to ...
May 25th, 2011 § § permalink
Preamble
There’s been some recent discussion about DjangoCon(.eu | .us) and whether or not speakers should have to pay for admission as well — see Chris Wanstrath’s (of Github) tweets (here and here) and this Convore thread for examples. Obviously, as PyCon is the “big dog” so to speak for Python conferences, everyone looks to “us” for a model to work from, or how we manage things. I’ve seen a lot of poop slung towards the DjangoCon organizers, mainly due to a lack of knowing “why” certain policies (such as “Everyone Pays”) exist for DjangoCon, PyCon, and other conferences.
As co-chair and program committee chair last year, and program committee chair the year before, and now chair for the next two years — I figured it might be good to take a moment to explain the rationale behind PyCon’s approach — as well as some statistics about the budget. I’m not going to state that this policy is perfect; nor that it won’t be changed; I also will not release the budget publicly — I don’t think giving everyone a spreadsheet without the context of the hundreds of man hours of work that go into it is useful, at all.
Important Note: PyCon is organized and managed by the Python Software Foundation — this means that, as part of being a 501c3 charity, some of the financials from past PyCon is available as part of publicly accessible financial documents of the foundation. You can find those on the PSF’s site.
The same reasoning may not apply to a conference that is organized by a commercial entity or is done for profit. OSCON is a commercial conference, so having speakers get in free is generally expected. DjangoCon.us is in the middle — it is organized for profit by a commercial entity, but it also contributes heavily back to the Django Software Foundation. DjangoCon.eu is managed differently as well.
» Read the rest of this entry «
Preamble
There's been some recent discussion about DjangoCon(.eu | .us) and whether or not speakers should have to pay for admission as well - see Chris Wanstrath's (of Github) tweets (here and here) and this Convore thread for examples. Obviously, as PyCon is the "big dog" so to speak for Python conferences, everyone looks to ...
May 22nd, 2011 § § permalink
I had a bit of an idea that almost turned into another crank based on yesterday’s blog post “On Family, Cranking and Changing” — the “code equivalent” for the idea stemming from the Artists Way’s concept of “Morning Pages”/750Words and the Writing Down the Bones concept of “Keeping the Hands Moving”.
I made the mistake however, of asking on twitter — never, ever ask a bunch of programmers quote “What do you think the char count or line number of a reasonably sized Python module is?” — never. Just don’t. I’m not even asking that here. Instead, I’m giving you a simple idea for a web application. Take the implementation of github’s gist’s/pastebin, mash it up with a built in code editor (such as Ace), and kick out a programmer’s version of 750 Words. The goal is not to force people to share code publicly — if they want, let them flip that bit (or just post/link to github’s gist system). The goal is to encourage programmers/hackers to explore/write some new:
And I mean new — not something bogged down by their every day projects. It could just be a clever one liner ala Raymond’s python tips. It could be a few-hundred-line piece of code that just tracks how many times they’ve watched their favorite show using some cool module. Just keep the hand moving; just take 3, 10 or 30 minutes a day and keep a private code journal of new ideas, concepts, etc. Write some morning pages.
Project Euler is algorithm problem solving, so it doesn’t fulfill the goal. Code Kata’s come damn close (see also Coding Horror’s take) — but again, those are focused on providing a problem, and then having someone come up with a solution. I’d like something that just sets forth the ideas exposed for writers above, and sets it in a programming context.
If you want, allow users to seed it with suggested ideas. So that when a user logs in, they might have set a “preferred programming language(s)” and get a a little javascript popup with a problem sourced from another user, like say “use python threads” or “write an application that forks”. This latter part ties into an idea I had stemming from Zed’s original “Learn Python The Hard Way” posting — too many of these practice sites focus on algorithms and mathematical things that probably won’t help you in the next 8 hours. Something that had problems like “send a receive UDP messages from a socket” and the like — focusing on common, practical things.
Anyways so what are the requirements for “XXXcode” or “xxxlinesaday”/etc:
- Allow signup/signin
- Allow public sharing of journals/non public
- Allow submitted “ideas”
- Outline the idea stemming from the Artists Way/Writing Down the Bones.
- Make it look decent (I’m tired of ugly programmer sites. Go get something from themeforest if you need it)
There ya go. Take it and run with it if you want. Just stop bothering me about lines of code in a module. Man you guys can be pedantic.

I had a bit of an idea that almost turned into another crank based on yesterday's blog post "On Family, Cranking and Changing" - the "code equivalent" for the idea stemming from the Artists Way's concept of "Morning Pages"/750Words and the Writing Down the Bones concept of "Keeping the Hands Moving".
I made the mistake ...
May 21st, 2011 § § permalink
Introduction
Sometime on May 6th — over two weeks ago now — I shot out a innocuous tweet asking what might be a good blog topic. I think I said something like “python, family, .…” — the overwhelming majority of them responded with “write something on family”, ironically, as I was reading those responses sitting at a stop light (yeah, I know — don’t yell at me) I got a phone call from my wife asking me to come home immediately. You see, my wife is very, very pregnant with our second child, and it’s not been an easy pregnancy for her. We’ve had a lot of scares, and we’ve spent a fair amount of time in and out of our local hospital — so when she said “come home right now” — you can expect that everything else pretty much evacuated my brain except that.
I guess the twitter responses acted as sort of a cosmic hint as to what was coming — the abbreviated version being that my wife, bless her soul, was deemed “high risk” and admitted to the hospital on the 6th — with the expectation that she would not leave until she gave birth. Fast forward two weeks in the hospital, a myriad of tests, blowing out budgets on gas (what the hell) and being a “Single Dad” for most of that that time, and I can happily report that mommy and baby are stable, but still hanging out inside my wife.
These past two weeks taught me a lot about myself, about my family — some things that I thought I knew were brought to task and tested — heck, some of the things I was going to write about were put to the ultimate test. You may not really care about any of this — I’d go someplace else at this point if that’s the case. I do hope to outline my thoughts on balancing things (though I remain terrible at it) and finding the time. You’re not going to find a cure all, or a hack that will “just make things work” — that doesn’t exist.
» Read the rest of this entry «
Introduction
Sometime on May 6th - over two weeks ago now - I shot out a innocuous tweet asking what might be a good blog topic. I think I said something like "python, family, ...." - the overwhelming majority of them responded with "write something on family", ironically, as I was reading those responses sitting ...
May 5th, 2011 § § permalink
Preamble
A recent post on Hacker News entitled “Why I still don’t contribute to open source” raised a series of thoughts in my head — but then, before I could even take the time to generate the smallest of replies, Brian Curtin swooped in and made probably one of the single best comments in reply, and on the subject of contribution that I’ve ever read. The original post; and Brian’s excellent reply were enough to get me obsessing about this subject again — eager to share my thoughts and feelings on it.
A while ago (almost exactly a year, oddly enough) I posted a question here to my blog — “Why aren’t You Contributing (to Python)” — the replies to that post, both in the original comments, Hacker News, Reddit and other thoughtful responses by Tim Golden, Yaniv Aknin and Brian Curtin made me sit back and think for a long time what we — as a “python core” team could do to help reduce the friction and overall barrier to contributing to core itself. It also made me take a step back and ask myself why I contribute to Python — not just via core, but also to PyCon and the PSF.
» Read the rest of this entry «
Preamble
A recent post on Hacker News entitled "Why I still don't contribute to open source" raised a series of thoughts in my head - but then, before I could even take the time to generate the smallest of replies, Brian Curtin swooped in and made probably one of the single best comments in reply, ...
May 1st, 2011 § § permalink
On Friday of last week, a new post I wrote for my employer (Nasuni) went up — “Encryption Keys, User Data and Subpoenas”. In that post, I got to outline, in clear “non slippery” language how my employer manages encryption keys, what data they have access to, etc. One of my favorite quotes:
If a customer has provided their own encryption key(s) — Nasuni, or the cloud provider, do not have those keys, and can not provide them as part of a subpoena or other legal process. We can not decrypt or access your data. We can not supply a key which we do not have. This is not policy or trust level protection: It’s impossible.
We offer auto-generated and escrowed keys as a convenience to the user — the benefits of having this feature outweigh the cost. A user or company who knows nothing about encryption keys and key escrow can still have strong data security and instantaneous disaster recovery, they can install a Filer in minutes and immediately be up and running.
» Read the rest of this entry «
On Friday of last week, a new post I wrote for my employer (Nasuni) went up - "Encryption Keys, User Data and Subpoenas". In that post, I got to outline, in clear "non slippery" language how my employer manages encryption keys, what data they have access to, etc. One of my favorite quotes:
If a ...