Better HN
topnewbestaskshowjobs
Log inSign up

erikrose

25 karma · joined Feb 19, 2011 (15y ago) · 15 submissions

Submissions

1.

Have an open-source, terminal-based Halloween.(gist.github.com ↗)

1 points · by erikrose · 13y ago · discuss

comment 14y ago · link · parent

Perhaps we can bang a Snowball stemmer against it and get pretty good coverage on the whole language.

comment 14y ago · link · parent

Btw, here's an example of somebody trying to do sentiment analysis on tweets: http://www.sentiment140.com/search?hl=en&query=romney.

comment 14y ago · link · parent

What you're talking about in the last paragraph is sentiment analysis. This is really cool stuff, but it's tricky. Even if you have 2 humans do sentiment analysis independently, they agree with each other only 70% of the time. Computers tend to do worse, of course.

What makes it extra challenging is that tweets are short, so you have wide error bars on the sorts of math you'd depend on in larger corpuses. I think you'd have to actually bang a parser against it and try to understand what the tweeter is saying.

comment 14y ago · link · parent

Good ideas, all. There are a couple more debates. :-)

In the meantime, if you want to play with filters, feel free to try this super-alpha toy I threw together the other day: https://www.votizen.com/twitter-fight/. It works on a rolling 24-hour window of Romney- or Obama-mentioning tweets. Buggy as heck, but fun to play with!

comment 14y ago · link · parent

You're telling me. :-) We spent 2 years getting all those lists together and normalizing them. We're midway through a refresh now—new normalization framework, new matching algorithms, etc., etc.

comment 14y ago · link · parent

Twitter's actually the hardest nut to crack—pretty sparse user info available. Facebook and LinkedIn have a much higher hit rate, but they don't have such easy streams to grab.

comment 14y ago · link · parent

And getting lower tomorrow. And then going up in efficacy, while maintaining confidence. There's a ton more we can do with this. :-)

comment 14y ago · link · parent

Deferring the setup is first a matter of politeness, an artifact of my opinion that importing a module shouldn't have (possibly surprising) side effects on the environment.

As for hanging everything off the Terminal instance, the motivation is that there's significant state on it that you might want to customize. Things like type (ANSI, vt100, etc.) and whether to suppress or force styling affect the result of formatting methods. See http://packages.python.org/blessings/#blessings.Terminal.__i.... I've several times benefitted by making a formatting-suppressed Terminal and passing it around.

I fully endorse you saying...

    term = Terminal()
...at the top level of some module and referencing it there. Then you get the init-on-import behavior you want, but it's not forced on anybody who'd rather not have it.

Cheers!

comment 14y ago · link · parent

Oh, and for any who like the look of Blessings but don't have any terminal projects afoot, shoppers who looked at this item also viewed...

A sequel to itertools: http://pypi.python.org/pypi/more-itertools/ (The upcoming 2.1 will include all the routines from the "recipes" section of the docs as well.)

A front end for the popular Nose test runner that shows a progress bar and tracebacks during tests (via blessings, of course): http://pypi.python.org/pypi/nose-progressive/

A shim for using Nose with Django (and making your tests go 4x as fast): http://pypi.python.org/pypi/django-nose/

While on the subject of Django, here's a little shim to let you write lightweight management subcommands (and generate commands at runtime, if you want to go crazy): http://pypi.python.org/pypi/django-subcommander/

comment 14y ago · link · parent

So glad you're enjoying Blessings! I've had fun writing it.

I'd love to hear what kind of projects other folks are doing with it. Any neat hacks? One of my fun little demos is this terminal-dwelling Game of Life: http://pypi.python.org/pypi/conway/. I was thinking of adding an interactive mode so you can draw your own patterns and set them free; it would be an excuse to add key trapping to Blessings.

12.

Parsing Horrible Things with Python [video](pyvideo.org ↗)

2 points · by erikrose · 14y ago · discuss

comment 14y ago · link · parent

What people never seem to bring up is that C has just as many parenthesis; they're just not adjacent quite as often.

(do something to these (and these)) vs. do(something, to, these, and(these))

In any case, you really do things with whitespace, so none of it matters.

comment 14y ago · link · parent

Very nice! What deviations do you plan to make from Scheme? And the ever-fearful question: what about debugging?

comment 15y ago · link · parent

Also, pushd and popd. And "cd -". And ctrl-Z and fg to jump out of your editor for a moment. And dragging dirs from the Finder (or whatever) to the terminal.