How to Get Your Project Moving, or My Ego is Massive and You Should Listen to Me.

So someone asks how they should go about getting a group of people together to work on a software project. I, with a massive ego propped up by very little talent, ability or experience, decided to answer it. Many of these ideas have been said elsewhere in various forms, but this seems to be a nice compaction of them.

How To Get People To Work On Your Project

Start writing it. No, really. Go start coding. Upload the notes, the sketches, whatever. Put it up on Google Code, Rubyforge or something similar. Haunt the IRC channels and mailing lists for the tools you are using and post news everytime you put out a new release. Be sure not to post in places that won’t care, and don’t post too much. Talk about it with friends. Even friends that have no idea what a compiler is.

The nerds will come to you but you’ve got to work your ass off first. No one, absolutely no one, who is any fucking good will come near your project if its nothing more than a few airy ideas. Excepting, of course, those close friends that you’ve already had long discussions with. But if you had friends with a clue, you wouldn’t need to ask this question.

I understand. I, too, have a group of friends who don’t share my peccadilloes. And it can be a strength. It teaches you to hone your description of what you are doing down to its simplest core. It teaches you how to tell yourself what you are doing. Clarity of thought is essential.

Most of your friends won’t understand it. Some will love it for terrible reasons. The rest will think its dumb. If you have a couple of shitty “friends” you only hang around with for historical reasons (like I do) you will invariably have the conversation swiped from you 20 seconds into your 30 second pitch because.. well.. because they are fucking assholes. Almost all of the opinions you hear will be worthless, even from friends with half a clue or more.

Cling to the positive responses. You and I know they mean nothing in relation to the project, but they mean everything in relation to you. It means they think you have good ideas in the areas they understand, and believe in you enough to have good ideas in the areas they don’t. Knowing that can ride you along when you’re coming back from another day at some shitty job to code for 10 more hours before crashing, or, at least, wishing you could crash as you pace your hallway thinking about what needs to be done.

Insomnia, more than likely, will be ever present.

You don’t have to code everyday, if it’s just a side project, but you’ve got to do it damn near. If you aren’t blowing off your friends to work on it at least once a month or more, you aren’t working hard enough on it. If this is really to be a start up, you need to be blowing them off all the time. It sucks. Get used to it. You’ve got a world to change. (Note: I have experience with side projects and have second-hand experience with startups)

But don’t overwork. Insight comes from your brain hashing together your work and your knowledge and your experiences from elsewhere. That mashup club that you heard about? Go check it out. Read some philosophy. Read some comic books. Read something you sort-of-know-about-but-not-really.

Read a shit ton about programming. programming.reddit and Planet Intertwingly are good places to start. The first for what all the cool kids are talking about and the latter for intelligent debate, and odd viewpoints all mixed together. (Er, I should mention I was recently added on to the blog roll there, but I was a huge fan of it way, way before that. In other words, I’m not a self-promoting jerk, just a regular old jerk.)

Write good code. Go back over older code and rewrite it. Then come back later and rewrite it again. Make it better. But don’t stop coding because you can’t “get it right”. If its ugly or sucks or doesn’t pass the tests, put in some placeholder code with a FIXME comment above it. This can be a good place for others to help fill in the gaps but never, ever leave something like that if all you have is the hope that someone will fix it. Ask them, or do it yourself later.

Test. Test a lot. Write tools or use already established tools to make it easier for you. I suggest the latter, though I’ve had to adapt other’s work to test my current “big project“. If your project is different enough or big enough, there’s a chance you’ll be adapting the work of others, too. Testing is what will remind you that you put all of those shitty FIXME comments in your code.

If you stop coding for a couple of days, get pissed at yourself and code angry. Code real fucking angry.

You might break a keyboard, but it’ll be worth it. This is one you have to experience to believe. There is little like coding through your frustration, aggravation and even constipation and finally, finally getting it right.

Anger and love and frustration and elation and sadness and comfort, each of these you will feel when you are coding. Some you’ll feel more than others. All of them will, at some point, make you want to stop. Don’t.

Remember: coding isn’t just putting characters in a text editor, but all those hours you spent thinking don’t count until you punch the fucking keys. Time isn’t your enemy as much as your will to continue on is. And time is a big fucking enemy in a startup.

Go. Go fucking hard. That’s how you get people to come in. Oh, and you’ll probably fail. But it’ll be a good failure. It’ll be the kind of failure that you can turn into a victory later.

People say failure “builds character” or “helps you grow”. That’s pretty much just a bullshit short way of saying this:

You don’t know how you’ll fuck up until you do. The next time you’re about to fuck up, you might see how to not fuck up. You might see a new opportunity because of the way things fucked up, or the state your fuck up left you. Also, some other people with experience or money might see your fuck up and realize that a) you’ve actually got some chops or b) you could have some chops with some help. They will help you. Maybe. Fucking up will be easier next time, except when it doesn’t but if you’ve got chops it all starts coming together. Eventually.

Fail hard. Fail with motherfucking gusto. Succeeding, like flying, is throwing yourself to the ground and missing.

Good luck.

libiconv and rFeedParser

I got a chance to read libiconv’s DESIGN document (found in the tarball) and noticed this passage:

Extensibility

The dlopen(3) approach is good for guaranteeing extensibility if the iconv implementation is distributed without source. (Or when, as in glibc, you cannot rebuild iconv without rebuilding your libc, thus possibly destabilizing your system.)

The libiconv package achieves extensibility through the LGPL license: Every user has access to the source of the package and can extend and replace just libiconv.so.

The places which have to be modified when a new encoding is added are as follows: add an #include statement in iconv.c, add an entry in the table in iconv.c, and of course, update the README and iconv_open.3 manual page.

The upshot of this is that adding new encodings through some iconv-encodings package will be a pain in the ass and would cause breakage in unexpected, fascinating ways. But, there are smarter people than I out there, and maybe something can still be done.

Of course, this also means that we would not get FreeBSD “for free” (though, I imagine xmlparser doesn’t build on it, anyway) and we would have to come up with a solution for it as well.

What a mess.

On rFeedParser

This post is huge but I have not the time to make it smaller. I’m so very tired.

A Quick Introduction

rFeedParser is a RSS/Atom feed parser. It is a translation of Mark Pilgrim’s feedparser from Python to Ruby. It behaves almost exactly the same and passes somewhere near 99% of the tests on a Ubuntu machine. Other platforms suffer from lesser success rates due to differing Iconv installations. The feedparser documentation applies to this work, and almost any deviation from it should be considered a bug. Please file any bugs you find.

This project was inspired by Sam Ruby’s pirate testing idea, one that I hope catches on beyond these feed parsers.

The Basics

require 'rubygems'
require 'rfeedparser'

feed = FeedParser.parse('somefeedurlorfilepath')

first = feed.entries.collect{|e| e['title'] }
second = feed['entries'].collect{|e| e.title }
if first == second
  puts "This is handy when dealing with e['id'], the guid of an item/entry"
end

Installation

Agh. rFeedParser is a monster. Tons of dependencies, some overlapping in areas, and one “not nice” dependency. The “not nice” dependency is on Yoshida Masato’s xmlparser.

You can either install it by hand (be sure to add return in front of stream in saxdriver.rb, line 171), or install through “sudo apt-get install libxml-parser-ruby1.8” if you’re on Ubuntu or another Debian-based Linux, or through the xmlparser gem that I put together that seems to work on only “some” Mac machines but all Linux boxes. xmlparser, of course, depends on the Expat XML parsing library, and be sure to install the -dev, -devel or whatever version has the full headers and libraries available for linking against if you install through MacPorts or by hand.

The Latest and Greatest

The latest version is 0.9.93… Okay, really, the latest version is 0.9.931. There was a minor bug that, if it hadn’t been for the guilt of having put off the user who had brought it to me, I wouldn’t have worried about forgetting in 0.9.93. He/she (no name, just an email address) had been so nice about it.. So, future users, take note: if you see a bug I haven’t fixed yet, guilt seems to work. Also, bribery. Patches certainly don’t hurt.

The 0.9.93 and 0.9.931 updates do a number of things:

  • Fix a horrendous error when handling content:encoded, body, xhtml:body, prodlink and fullitem
  • Added some further support of Yahoo Media RSS. I’ve added support for media:thumbnail and media:content (the latter, only in its “two tag” form). This came directly from a requirement in our project at work. Mark, you should admire my ability to get paid for this.
  • Fixed up the lame ass headers code I had going. I don’t remember what I was on when I wrote it, but it must have been fantastic.
  • py2rtime had some major bugs that I can’t understand how they passed the tests. I will give a dollar to anyone who figures it out, mainly because I don’t want to deal with it. See revision 57, and compare to both revision 58 and the current code in the repository.
  • Use rchardet 1.1. There was a rather serious bug in 1.0. Never use gsub! ever, ever, ever, ever. Maybe sometimes.
  • Some messed up indentation. Neither vim nor Textmate can indent ruby code well, it seems. Or maybe I write weird looking code. Luckily, I’m reading the Dragon book and learning things and I may decide to tackle it.
  • ForgivingURI continues to be something I desperately want to see in the Ruby core libraries. URI.parse shouldn’t puke everytime some loser fucks up his syntax. At least, give me something more than “bad URI(is not URI?)” no matter what the problem is. Something I stole from Bob Aman FeedTools.

Speaking of patches, those interested in helping development can find a bzr repositories for rfeedparser on this very site. This is probably dumb, and a bandwidth hog, but I’m too lazy to either a) go to my workplace and log into my Ubuntu box with bzr-svn or b) patch svn on the Mac laptop I’m currently writing on to put it up on rubyforge.

Gotchas, Monkey Patches and Other Disgusting Things

Now, on to the ugly.

As Sam points out me pointing out, the original feedparser tests require the parsed times to be stored in Python’s 9-tuple format. For those of you who aren’t jargon whores, that’s basically a list of 9 integers specifying the date. Unfortunately, Ruby doesn’t have a method in Time that can take that format. The solution, for our purposes, is to use the py2rtime top-level method I wrote that does the (very easy) task of putting the 9-tuple in a form Time.utc can understand. (Also, Sam’s suggestion of naming it feeddate sounds pretty damn good).

Also, the SGMLParser in HTMLTools is kind of broken. The Regexps don’t really work as intended (which I really need to send in patches for) and its really, really not UTF-8 safe. Oh, god. Making it UTF-8 safe involved code so ugly, so treacherous, that I will probably get cancer from it.

The UTF-8 stuff, of course, isn’t the developers fault. Ruby’s encoding support sucks so much that it seems quite a few people thought it would make writing a decent feed parser nearly impossible.

So, how did I do it? Through beta software, overlapping dependencies, relying on iconv (which is always terribly configured in any operating system) and a total disregard for passing the encoding tests. That’s right, rfp uses both the character-encodings gem and ActiveSupport and we still have dozens of failures and errors, the number of each depending on what OS we’re on!

So, most of the former Eastern Bloc just won’t get to use rFeedParser for a while. Sorry. (Hey, Hungary, it supports your datetimes! Does that make you feel better?)

If someone could magic up some sort of iconv-encodings gem or tarball that can give us a standard iconv install to work with, we might be able to make the encoding situation better. I would do it, however, I have got shit to do that doesn’t make me want to gather up shove ballpoint pens into my brainstem. Or slit my wrists with codepoints. (I’m pretty sure I could come up with a physically realizable way to approximate the latter.) Sigh, maybe I’ll get to it later, but I’d love to have some help.

On to the straight-up monkey patches.

There’s a few on Hpricot, but they have very little impact. Maybe making Hpricot load a bit slower on boot due to the huge element lists I put in there. Also, there is a method called Hpricot.scrub, but it is no longer the Hpricot.scrub that you know so well. It originally was, but I needed to do some extra things that added a couple of scans on top of the two already in there and, suddenly, it was a bottleneck. So, apologies for the confusing name.

(Jeff Hodges’ Trivia Time: The guy who wrote Hpricot#scrub, Michael Moen, is the guy who “officially” put Jeff’s name in for the position at ICTV. He and Jeff work together on the same Ruby on Rails application as members of the ActiveMedia Group. When discussing new problems with Michael, Jeff is often boggled by Michael’s clarity of thought.)

Oh, and one more monkey patch. xmlparser doesn’t return the attributes of the XML tags as a Hash, but SGMLParser does and it would have been pretty damn handy if it did, so I made it do that. The code is in better_attributelist.rb (my filenames are full of ego), and it could be done better, but it suits my purpose.

Other ugly things: ForgivingURI (as mentioned above) and the inconsistent naming of methods that came about after a few bad nights of hacking through Ruby’s inheritance problems. I fixed the actual architectural problem long ago, but left the terrible names in there. So, the self.fooThing and _hasDumbPrefix stuff is my bad. Except for the methods in FeedParserMixin that are named after XML tags. Those names are prefixed with ‘_’ (and is even in the original Python code) in order to work around the differences between the XML parser and SGML parser.

I should also mention the metric ass load of datetime parsing regular expressions I had to write. Another set of patches I need to write, this time to Ruby core. I don’t even want to discuss them. Go look at time_helpers.rb and see how many times I made one problem into two. My code is grody.

The Future of the Tests

Sam brings up the idea of making the tests from the Python feedparser less, er, Pythonic. We could speed up response time If we change the expectations for dates to some method calling a 9-tuple (or rather, a 9-list or 9-Array, or 9-some-datastructure-with-brackets-not-parentheses.) we could get an instant win. I have no idea what I was trying to say here.

Also, the use of u'', u"" and the \unn or \unnnn format for non-ASCII characters in Python had to be hacked around with regular expressions. While the character-encodings gem provides something like the u'' syntax, the \u characters are completely unsupported. It’s really ugly, and kind of painful, esp. if a developer never had much experience with Python. Fortunately, I had a good deal but probably not enough considering the amount of time it took to write those Regexps.

The XML test files are a huge boon and make them more general would make it easier to maintain code equivalence across languages and allow those who are more comfortable in one language to help outside of that language’s project. But, this is all just blue sky stuff for the moment.

And Spent

This post is huge and I need to stop writing. I don’t think I’ve talked about everything I wanted to, but I’m shot. rFeedParser is nice and you should use it and tell other people to use it. Questions and comments are welcome.

Update: A few grammar and spelling clean ups. Sucktasia on ice.

Friggin’ Module Bundles

What was one of the things I wanted the most when I started writing rFeedParser?

This.

The Big Move

I begin the long move out to Los Angeles this Wednesday. I join a long line of nerds who make it good from a bit of code they wrote after finishing their shift at whatever shitty, shitty job they pay the rent with.

Mine was a Paneras. Before that, a Wendy’s. This is post-graduation. I worked at Wendy’s for 3 months after receiving my B.S. in Physics. I’ve never been able to communicate to anyone how truly horrifying that was.

our jobs suck

Horrifying, in part, because I demand something damn near perfection in everything I do, even in my blog posts. And I haven’t written here for so long. My posts here and in my old blogs were kept short because I thought the writing was just terrible.

As you can tell, I’d given up on writing well for a while.

So, I’m moving out to LA this Wednesday. I was recruited for a position in the ActiveMedia Group at ICTV and the job is totally fucking sweet.

I’m working on a Ruby on Rails application and the group is being run, essentially, as a start-up within the larger ICTV company. We’re tying together web video and cable television in some startlingly cool ways. Think of everything everyone has said you should be able to do across the two mediums, and that’s what we’re doing. The weirdest part is how obvious some of the cooler ideas are, but only after you hear about them for the first time. I’m going to start keeping a list for when we can go public with it all. While I’m not sure what’s covered under my NDA, we are getting bids from $MAJORCABLECOMPANIES and it all seems to be out in the open.

Coolness kept secret sucks.

The job and myself will be located in Encino, CA (a suburb of LA) right in the heart of the Valley. No, not the Silicon one, the “like, oh my god” valley. It’s absolutely gorgeous and the Mexican food? Divine.

I’m having a hard time leaving Ohio. Here I gathered up the closest, richest set of friendships I’ve ever had. They are the most talented group of people with such most startlingly divergent abilities. We could easily take over the world and rule with a velvet fist.

Anyway.

I was recruited after Bob Aman of FeedTools fame saw me hyping my translation of Mark Pilgrim’s FeedParser from Python to Ruby, and thought it was pretty good. The translation, of course, is called rFeedParser and it really is pretty good. I’ll have a post on that soon. First, I want to fix the silly options bugs that I was turned on to a little while ago.

Anyway.

I just had to write again. If only to tell the story of the 3 day trip that turned into 5 that turned into a day at home and then 11 days back. That will be coming soon. You’ll love it.

On My Whiteboard Recently: Part 1

  • “Ask more questions.”
  • Agnostica
  • <QM|Fun>= 1

Some that know me might think the first absolutely ridiculous considering current behavior, but they are very wrong. Sorry, guys.

On the Oscillations of the Mixed Aggregates

You should go read the MetaMixed blog. Specifically, the last post that I put up. It will explain pretty much all your questions. Have more? Get a hold of me.

Mixed States is Back

Check it out.

More later.

I Call Do-Over

You don’t get many chances to start again.

I’m giving one a go.