Eyes East

feed icon Subscribe / Latest posts / Latest links / Get in touch / About

Two Tricks For a More Interesting VirtualEnv

January 2, 2012 at 2:48 p.m.

Ian Bicking's virtualenv has become one of those apps I just can't code without (or at least, I hate to code without). I have so many quick-hit, one-off, throwaway apps with so many strange and sometimes conflicting dependencies that I can't imagine how I'd get anything done if they all swam in the same soup.

This is all made better by Doug Hellman's virtualenvwrapper, which makes creating and managing virtual environments dead simple.

Given that, here are two tricks I figured out yesterday that could make things a little more interesting:

Using (Some) Global Site ...

Read more...

Using TableFu to Crack Those Tables

January 21, 2011 at 2:33 p.m.

Note: in lieu of other excuses: I have a carnival of journalism post coming soon. Consider this an unrelated holdover to remind you that I do, in fact, still occasionally use this blog.

For a while now, I've been toying with a side project called TableFu. If you follow me on Twitter or Github, you've probably seen it. It might already be in your toolkit (if, for example, you needed to organize a bunch of Youtube videos of Christmas carols).

The project started as a Python port of ProPublica's project of the same name, which is written ...

Read more...

Elegance from Ugliness: Lessons from MongoDB at Chicago Trib

November 5, 2010 at 10:46 a.m.

Chris Groskopf gives us the backstory on building the recently-launced Illinois School Report Cards:

The site is a comprehensive look at how schools across the state performed on standardized tests, with faceted and geographic search and lots of ways to interpret the data. It's the kind of project any regional news organization should be all over, and the Trib did it well (no surprise there).

A couple quick takeaways here:

The data is a mess: Nothing says "government data" like a 210 megabyte text file with 9,000(!) columns. Have a look.

That made the site a good candidate ...

Read more...

My Django Setup

April 7, 2010 at 2:56 p.m.

I picked up my old MacBook from the Apple Store with a new, bigger, and spotless, hard drive, with a fresh install of Leopard.

Time consuming as it is to set up a computer from scratch, it's actually something I'd been meaning to do. The death of my old hard drive just forced me to do so sooner, and a little less gently than I might have liked. But it is nice starting from scratch.

With that in mind, I decided I should set up my development environment the Right Way: with code sandboxed as much as possible ...

Read more...

Django Recipe: A template for any blog post

February 13, 2010 at 8:08 p.m.

One more quick code recipe before I jump back into the Journalism to Django series. In my last post, I mentioned that I set up permalinked paragraphs on a couple recent entries, using a different technique on each one. You might be wondering how I did that.

This is documented, but it took me a while before I realized how simple it is. The key is Django's get_template and select_template functions, which are part of the template system. Get template takes a string and gets a template. Select template chooses the first one that matches from a list or ...

Read more...

Python Recipe: Adding Paragraph-Level Permalinks

February 11, 2010 at 9:06 p.m.

I mentioned in my last post how useful Ben Welsh's code recipe's are. Count this post as my effort to encourage the practice among coding journalists.

Since launching the NewsHour's Annotated State of the Union, I've gotten a few questions about how it worked, particularly about linking comments to paragraphs. What's needed is paragraph-level permalinks. As it turns out, that's pretty easy to do.

The first thing you'll need is a block of clean HTML. Then, you'll need something that can parse and modify that HTML. Fortunately, tools abound.

Doing it server ...

Read more...

Journalism to Django, Part Two: Required Reading

February 7, 2010 at 12:34 a.m.

So, you've gotten the hang of HTML and CSS. You can install Wordpress in five minutes, and you're comfortable mucking with templates. Or you get databases and it's time to get them on a web. Or you read my last post and feel ready for the next step.

Starting Points

At this point, take a look at the Django Book.

You can learn Django and Python at the same time (I did, as have others). But it is worth getting the hang of Python a bit first. Take some time and go through Think Python. It's ...

Read more...

Footnotes on the State of the Union

January 28, 2010 at 10:51 p.m.

Last night the NewsHour went all-in covering State of the Union. We had on-air analysis, video from the Capitol and coverage on our new blog, and a new app to annotate the speech as it happened.

The Analyzer (I can never think of clever names for my apps; this is what everyone here calls it) is built in Django, with a lot of help from jQuery. From pitch to launch took exactly a week, including a working weekend.

The app is built around two main models: Speeches and footnotes. Every footnote is tied to a speech and indexed to a ...

Read more...

From Journalism to Django, Part One: Prerequisites

January 26, 2010 at 10:26 p.m.

Programming is hard.

There's no way around it: Learning to make a computer do things means learning a new form of expression. It is not, in some ways, all that different from learning a spoken language.

But it's also fun in an addictive sort of way. It's like telling your Legos to build themselves. When things start to click, massive problems begin to break apart into a long series of eminently squashable bugs.

Before you start learning Django, a few things I recommend brushing up on:

  • (X)HTML: This is, after all, a framework for building web ...

Read more...

Why Django

January 12, 2010 at 10:37 p.m.

As of this month, I'll have been using Django for two years, and using it professionally for a year. That's a strange thing to think about, because I still have a hard time calling myself a "programmer" (though "web developer" feels easier, for some reason). I am, after all, a politics major with zero formal training in computer science. Yet here we are.

Over the past few months, friends have started asking me about my favorite framework: How'd I get started? Is it as good as the hype? Can I, or should I, learn it?

Well...

Why ...

Read more...