Archive for the ‘Rant’ Category

Eat your own dogfood

Wednesday, July 2nd, 2008

Now we know why Laura is doing so well on the growth charts. - by booleansplitIf you’re developing a web service of any kind, eat your own dogfood. Build something using your web service. In fact, build many things using your web service. Do it early and often before you release your web service to the public. Find out what sucks about your web service, what’s broken and what’s simply downright inconvenient about your web service and then fix it. If you find you want to murder someone while using your own web service, imagine what your consumers will think of it.

All too often I find myself running into web services that are inconvenient to use from a developer standpoint. Often it’s because the people implementing the web service build whatever’s convenient for them. Spend some time building applications using your web service, make a list of the things that were harder than they should have been and then go fix them. Your users will thank you.

Photo by booleansplit

Important safety tips when handling json-c

Monday, March 10th, 2008

We’ve been using json-c internally for parsing and generating JSON in my new project. It’s a pretty nasty interface to work with, so I’ve been considering putting a prettier face on it for C++ developers. Today I sat down to do that. Instead, I spent many hours allowing json-c to repeatedly win games of roshambo.

It started out simply enough, a simple class to wrap the json_object:

#include <string>
#include <json/json_object.h>

class JsonObject {
    private:
        json_object* obj;
        JsonObject();

    public:
        static JsonObject parse(const std::string& json);
        ~JsonObject();
};

There wasn’t much to it at this point, but I had enough to set up my Makefile to check that everything compiled properly. Sadly…it did not. While the compilation step was successful, linking wasn’t so fortunate:

libjsonwrapper.so.1: undefined reference to `json_object_put(json_object*)’
libjsonwrapper.so.1: undefined reference to `json_tokener_parse(char*)’

I spent some time (and by some time I mean most of Sunday) futzing with the Makefile, making sure json-c was properly installed, compiling my own version of json-c, checking different hardware architectures and operating systems…all with no luck whatsoever. I even looked at some other code that we have that uses json-c, checking out the Makefile to see what that code was doing that I wasn’t.

At around 8:45pm I took a break and went for Sunday bowling (Homestead Lanes does a special on Sunday nights, it’s great…you should go sometime). When I got home, I dug back in. Still no dice.

So I went back to the other code we’d written that uses json-c and looked at some other things. Finally, I happened upon it:

#include <json/json.h>

It’s subtle, but including json.h instead of json_object.h makes all the difference in the world. At first I didn’t want to know why, I was just mad that it mattered at all. Obviously json.h is some aggregate header that keeps you from having to #include every little file you need. But clearly it’s also performing a little black magic along the way that does something to affect linking. Ready to lose my shit, I dug into the header:

#ifdef __cplusplus
extern "C" {
#endif

#include "bits.h"
#include "debug.h"
#include "linkhash.h"
#include "arraylist.h"
#include "json_util.h"
#include "json_object.h"
#include "json_tokener.h"

#ifdef __cplusplus
}
#endif

Whoomp there it is: extern “C”. If you include json.h it does the right thing and makes everything inside of json-c use C linkage when compiling C++. If you don’t include json.h and instead include one of the files that it includes…then nothing uses C linkage causing the linker to FAIL.

Thanks json-c for consuming a day of my life that I can never have back.

Dear Akismet…

Monday, January 1st, 2007

So there I am, minding my own business, checking my feeds, responding to reader comments. Suddenly, I noticed that my last comment hasn’t shown up. Thanks to the ever-paranoid Akismet, it was marked as spam. Fortunately, I was able to locate it in the Akismet admin among 800+ pieces of actual spam. I marked it not spam, so you can actually read the comment now.

First, I have no idea why it was flagged as spam. Far as I can tell, there’s no big keywords that I would suspect in it. Second, and this is most important, I was once again logged in as a WordPress admin when this happened. Yes, this has happened before, about six months ago.

Dear Akismet…if the person posting the comment is logged in as a WordPress admin…it’s probably not spam. Even if it is spam, they’re logged in as a WordPress admin. All they have to do is go to the “manage” page and get their comment out of the spam jail. Blocking spam for people with high privileges is, at best, only going to slow someone down. At worst, well…it pisses me off. Did I mention I was logged in as a WordPress admin?

Yes, I am running v.lates of the Akismet plugin (1.2.1). And yes, I have the source to the Akismet plugin so I suppose I could jump in with my own two hands and deal with this code kung-foo style and perhaps that’s what I’ll do. Until then, I’m going to sit here and stew a bit (and scan my 800+ pieces of spam for anything else Akismet put in there). Maybe Toni will crack the Automattic whip for me.

When will faxing die?

Tuesday, October 24th, 2006

I’m in the middle of selling my house, part of my aforementioned relocation to the Bay Area. As part of that, I need to sign a bunch of paperwork to get the process rolling. The only problem is that the paperwork is in Folsom and I’m in Sunnyvale. What’s the solution? The fax. I have to get the documents faxed to me so I can sign them and then fax them back.

Seriously, if there’s one piece of technology that should have been obsoleted by the Internet years ago, it’s the fax machine. It’s a pain to find one and once you do, you get charged per page to use it. Email, on the other hand, is free and vastly more useful and ubiquitous.

Of course, even if you could email the documents back and forth, there’s still the small matter of your signature. You need to find a printer to print out the documents and then a scanner to scan the signed documents. Oddly enough, nobody actually cares about the signature. Sure, they’ll say they care about it. That they have to have it. That the document isn’t legal without it. But will they actually verify it? No, I could dip my cat’s paw in ink, have them scribble something on the page and call it my signature. Nobody would complain. The document would be perfectly legal.

It would have been just as much a verification of my consent to ask me over the phone as it would be to make me fax something with a handwritten signature.

Sucking will continue until morale improves

Friday, August 4th, 2006

What is it with me and Bloglines (we have history)? Lately it’s been all manners of busted. When I click on feeds that supposedly have unread items, Bloglines will pop up an empty list. Additionally, Bloglines has regressed to showing me TONS of feed items from as far back as a week ago, none of which have been updated.

Yesterday it started doing something new, though. I subscribe to Lifehacker. On either Wednesday or Thursday (I can’t remember which) I flagged some article using the “Keep New” checkbox. I do that a lot when I encounter an article I want to read but don’t presently have time for. Bloglines keeps it flagged new so I can go back to find it. In the left column, where Bloglines lists out my unread feeds, Bloglines shows it as “Lifehacker 0 (1)”, meaning no unread articles and one Keep New item. When I click on the feed, however, zero articles show up (there should be one).

It’s a shame that Bloglines breaks in such frustrating ways. Without the breaking, Bloglines is a very simple, usable application. It does what it should: presents you a list of your feeds and any new or updated articles. Unless it’s busted.

We could all learn something from MySpace

Sunday, July 16th, 2006

I think MySpace is ugly as hell. I think it’s full of crap that nobody really wants to look at. And yet…somehow, it gets a TON of traffic (more than Yahoo! Mail, allegedly). I just don’t get it. My company gets smacked around for having a couple of ads sprinkled about the page, yet every teenager in America can have a page with falling snowflakes, shitty background music, stupid banter and epilepsy inducing backgrounds and it gets a ton of traffic. Somebody call the coroner and tell him to bring a body bag for our good friend, Common Sense.

Tonight I was looking through my access logs and I noticed most of my referrals come from MySpace. Shocking, I simply couldn’t believe the amount of traffic that appears to be coming to me via MySpace. So I clicked on a few referrers to see what’s on those pages that could possibly be linking to me. I didn’t realize doing so automatically transfers one to the inner ring of the seventh circle of hell. I haven’t seen something this visually offensive since college (oh my god…my roommate washed his tighty-whities with a red shirt and he’s going to walk around the room in them). As if it’s not bad enough that I’m blind, I’m going deaf from the awful background music. To top it off, my browser has slowed to a crawl, the result of heart shaped raindrops falling down the page and dozens of YouTube videos loading simultaneously, preventing me from banishing the evil tab that spawned this foul demon. What on earth did I do to deserve this? Did I offend someone? Did I lose a bet with god?

Does anybody remember that website/book, Web Pages that Suck? It’s like MySpace looked at every example from that book and thought, “hmm…how can we make it easy for people who don’t know what a web page is to make a web page JUST LIKE THIS?” Then they made a business out of it! Somehow they even convinced someone to buy it for $580,000,000! I feel like I’m taking crazy pills!

This does, however, give me an idea. A sure fire hit. I’m going to spend a little time doing some research on the road. I’m going to find all the worst drivers in the world and I’m going to learn what makes them tick. Then, I’m going to take that knowledge and (get this) OPEN MY OWN DRIVING SCHOOL! I’ll teach people how to piss off every driver on the road. How to drive 55 in the fast lane. How to change lanes without signaling. How to double park. How to apply makeup while they drive. It’ll be an instant hit. MySpace has proven the business model works. All you have to do is offer consumers the means to become incredibly annoying and they will literally beat a path to your door!