So, once upon a time (January 2003), I wrote a rather neat little article about an algorithm I invented called a “Bip Buffer”. It’s basically a circular buffer, split into two parts. It makes writing TCP/IP networking code easier and faster, because it allows you to operate on data contiguously as much as possible. This increases throughput.
(And hey, they’re teaching it at Brunel University in the UK – EE2066 - Computer Architecture & Digital Systems has a reference to it in their powerpoints. Yay ego boost!)
I originally invented it while at Intelligent Ion, working on an ultra-fast miniaturized Mass Spectrometer. I needed something that would act as a circular buffer, and I couldn’t find anything available that didn’t write one byte at a time. So a bit of thought later, a few Aha! moments, and hey presto! Something that let me squirt data FAST through our pipes, and that actually was worthy of writing up.
So I wrote a little article and put it up on CodeProject along with full source code. The only requirement for using the code was that you send me an email if you use it, letting me know how it’s being used. Just because I’m curious.
That, by the way, was the only requirement. No, it’s not public domain, but it’s a hell of a light licensing requirement.
Anyway… fast forward to a few years later.
A Few Years Later
By now, I’ve had about 8 emails. Not bad, I thought. Okay, maybe it wasn’t as cool as I thought, but still, it was worth it. Cool little thing to have in my bag of tricks.
One was from an observatory who were going to use it in their code. They’ve given me a standing offer to come check the place out whenever I’m in town. I love offers like that – I get to meet very cool people along the way, and I’m all about new and exciting experiences.
Fast forward even more years later, to the present day.
Even More Years Later – The Present Day
Just for kicks, I decided to do a search to see where my little chunk o’ code has been used. And that’s where things got interesting.
You see, it’s in the Google Android Source Code now. Don’t believe me? Check this out:
It’s not quite the same code, but it certainly has the same name for the data structure, and uses my algorithm. Here’s a snippet from that page:
* basically, we use two circular buffers, each one corresponding to a given
* each buffer is implemented as two regions:
* region A which is (a_start,a_end)
* region B which is (0, b_end) with b_end <= a_start
* an empty buffer has: a_start = a_end = b_end = 0
* a_start is the pointer where we start reading data
* a_end is the pointer where we start writing data, unless it is BUFFER_SIZE,
* then you start writing at b_end
* the buffer is full when b_end == a_start && a_end == BUFFER_SIZE
* there is room when b_end < a_start || a_end < BUFER_SIZE
* when reading, a_start is incremented, it a_start meets a_end, then
* we do: a_start = 0, a_end = b_end, b_end = 0, and keep going on..
And I’ve never had an email from Google so much as telling me they’re using it. This is bad, folks. I had ONE single requirement to use that algorithm & code. Only one. And it was tiny.
On the plus side, however, my algorithm and a variant of my code has now been reused in every Android device out there. Nice kudos.
Or it would be nice kudos if they’d sent me the email. Or even left a link in the code to my original article. To add insult to injury, this is at the top of the source file:
/* Copyright (C) 2007-2008 The Android Open Source Project
** This software is licensed under the terms of the GNU General Public
** License version 2, as published by the Free Software Foundation, and
** may be copied, distributed, and modified under those terms.
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
Not only do they claim copyright over everything, but they GPL’d it as well. I hate the GPL; I don’t have a problem with the BSD license. But GPL? No, sorry, I gave away my original code for everyone to use – not to virally license it.
Here’s my original copyright, for comparison:
Copyright (c) 2003 Simon Cooke, All Rights Reserved
Licensed royalty-free for commercial and non-commercial
use. All that I ask is that you send me an email
telling me that you're using my code. It'll make me
feel warm and fuzzy inside. [email protected] to prevent spam
But boy, that code looks a lot different than mine. I wonder where that came from?
So Where DID It Come From?
Well, Nettee is using the code – but they attribute it to me originally in the docs. So no harm no foul there. (Thanks guys – you rock).
PyroEmu is using it too: http://svn.assembla.com/svn/pyroemu/trunk/src/pyroemu-shared/Network/CircularBuffer.cpp – and they attribute the algorithm for me, but claim the code for themselves… personally, I think my version was cleaner. Still at least they attributed it to me.
But Google? Nooooooo.
And yes, I know I’m blowing this up a bit out of proportion. I don’t mind Google using my code – and let me make that very clear yes, google, you can use my code and algorithm. Please don’t take this as any kind of request to remove it. But in this day and age when we can’t all be Donald Knuth any more, it’d be nice to get some credit for my work. Especially because that’s all I asked for it. I didn’t even patent it.
Credit where it’s due, Open Sourceys. Don’t get all giddy about your free culture without giving back to those who make it possible for you.
And stop putting GPL on my code. It’ll give you hives.(more...)