<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>In which we worry and complain out loud in our outside voice.
(ask me anything)</description><title>Concern</title><generator>Tumblr (3.0; @csm)</generator><link>http://csm.tumblr.com/</link><item><title>Cease-and-desist-holes: CrossFit Inc.</title><description>&lt;p&gt;CrossFit, Inc. recently sent me a cease and desist notice for my app, &lt;a href="http://wodapp.com/"&gt;WOD&lt;/a&gt;, because I mentioned &amp;#8220;CrossFit&amp;#8221; in the description and title of the app.&lt;/p&gt;

&lt;p&gt;I contend that I was using &amp;#8220;CrossFit&amp;#8221; in a descriptive manner, and that my usage may have been interpreted as fair use. I wanted to work with CrossFit Inc. to clear this up, but they decided instead to be hard-line fuckheads about it. I&amp;#8217;ve removed my app from the store, and submitted a new version that makes no mention of &amp;#8220;CrossFit&amp;#8221; in the app metadata.&lt;/p&gt;

&lt;p&gt;I sent their threat to chillingeffects.org; if it gets published there I&amp;#8217;ll point it out.&lt;/p&gt;

&lt;p&gt;CrossFit Inc. are being dicks. They&amp;#8217;re a shitty company, and I would hope people start to distance themselves from them, because being an affiliate gives you nothing but branding.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/51599117446</link><guid>http://csm.tumblr.com/post/51599117446</guid><pubDate>Tue, 28 May 2013 17:00:51 -0700</pubDate><category>legal</category><category>cease-and-desist</category><category>trademark</category><category>crossfit</category></item><item><title>parislemon:

dbreunig:


Asteroid Discovery from 1980 - 2011, by...</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/ONUSP23cmAE?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://parislemon.com/post/45366705778/dbreunig-asteroid-discovery-from-1980-2011" class="tumblr_blog"&gt;parislemon&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://drewb.org/post/45348841595/asteroid-discovery-from-1980-2011-by-scott"&gt;dbreunig&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Asteroid Discovery from 1980 - 2011, by &lt;a href="http://www.youtube.com/watch?annotation_id=annotation_79355&amp;feature=iv&amp;src_vid=S_d-gs0WoUw&amp;v=ONUSP23cmAE"&gt;Scott Manley&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is terrifying. We’re a moving target.&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://csm.tumblr.com/post/45377985217</link><guid>http://csm.tumblr.com/post/45377985217</guid><pubDate>Thu, 14 Mar 2013 16:34:14 -0700</pubDate></item><item><title>How bug reports for my iOS app go</title><description>User: Hey! There's this problem.&lt;br /&gt;&#13;
Me: I'm sorry, can you give me details about this problem?&lt;br /&gt;&#13;
User: *details*&lt;br /&gt;&#13;
Me: Hm, I see. I looked at it, and it looks like you did something wrong, and there really isn't anything I can do about it. *I'm secretly hoping that now you'll just drop it and go away.*&lt;br /&gt;&#13;
User: oh...</description><link>http://csm.tumblr.com/post/45302196891</link><guid>http://csm.tumblr.com/post/45302196891</guid><pubDate>Wed, 13 Mar 2013 16:34:14 -0700</pubDate></item><item><title>Help Kafka</title><description>&lt;a href="http://caseymarshall.com/help-kafka/"&gt;Help Kafka&lt;/a&gt;: &lt;p&gt;As a follow-up, after another rough day and a sour outlook, our dog’s results came back stable and slightly improved today. We’re looking for some help — any help — in covering the costs of her treatment.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/42470508129</link><guid>http://csm.tumblr.com/post/42470508129</guid><pubDate>Wed, 06 Feb 2013 17:40:13 -0800</pubDate></item><item><title>Kafkaesque</title><description>&lt;p&gt;It happened shockingly quickly, faster that I would have guessed, though the signs were there. I had, unfortunately, attributed these early signs as simply a reaction to the new medication we had introduced, since they weren&amp;#8217;t specific, and she only seemed diminished, not on any brink of anything.&lt;/p&gt;

&lt;p&gt;Kafka had her first seizures when she was around 10 months. At first, I simply thought she was having a more active dream, since she seemed to be just running. It became clear that this was something else, when on our morning walk she collapsed and had a clear seizure. Working with the vet, we quickly started her on phenobarbital to try and curb the seizures. Over the months that followed, her seizures became more frequent and severe, and we were gradually increasing her dosage. She would typically have a seizure in the middle of the night; all too often if she started with one seizure, more would follow, three, four, five, each a half hour or hour after the previous one. We would use emergency valium, or would make many trips to the emergency vet in the middle of the night. The seizures came regularly, every one or two weeks.&lt;/p&gt;

&lt;p&gt;We increased the phenobarbital dosage, then added potassium bromide, then levetiracetam (also known as Keppra, in its non-generic form). The seizures did start to get less severe, and we had fewer cluster incidents, but it still wasn&amp;#8217;t enough. We had finally added zonisamide into the mix, and began weaning her off the phenobarbital. She was getting weaker, and more unstable, and we backed the phenobarbital off more aggressively, and left the potassium bromide out entirely.&lt;/p&gt;

&lt;p&gt;During the week, her appetite waned, and she became more and more lethargic. We figured it was because of the zonisamide — introduced to her just a few weeks prior — that that was dampening her appetite. She would sleep most of the day, but would greet me happily when I got home, and would still go on walks, though she was getting slower and slower, and would trip and fall occasionally. Saturday she was pretty bad, listless, slept most of the day, ate very little, and generally looked to be in poor shape.&lt;/p&gt;

&lt;p&gt;Sunday morning she started vomiting, early while we were still in bed. I noticed too that the whites of her eyes were turning yellow. I bought some milk thistle, some high-quality dog treats, and fed her those as she laid with me on the couch. As the day waned, she became more and more unable to walk, until she crawled her way into the bedroom, and crouched to pee on the carpet, her head was in a corner, sitting in her urine, and could barely move. I moved her away from the urine spot, and she laid there, barely moving. I looked at her and the darkness of the urine she had left, and gave the animal hospital a call. I described her symptoms, and they told me it was a good idea to bring her in given those symptoms. I carried her to my car, drove out to the vet&amp;#8217;s office, and carried her in.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m certain if I hadn&amp;#8217;t called the vet and brought her in for treatment, she would have died that night.&lt;/p&gt;

&lt;p&gt;The vet that was on staff broke the news to us, compassionately, that our dog&amp;#8217;s liver was failing, and that her prognosis was not good. The vet told us that she might not make it though the night, and that we may be left with no option but humane euthanization. They gave her an IV, and gave her a plasma transfusion. We took the opportunity to go see her in the ICU, IV in her arm and a plastic cone around her neck. She weakly kissed both of us and tried crawling out of the cage to come with us.&lt;/p&gt;

&lt;p&gt;That night was tense, the two of us waiting for a call that might mean our sweet, lovely, young dog had died. The vet only called to ask for our permission to give her the plasma transfusion, which would help with her blood clotting, and would make her feel better. I gladly gave them permission, not minding the additional cost it meant.&lt;/p&gt;

&lt;p&gt;No other calls came until morning, when the vet called to let us know that she had survived, and had done well, and was continuing to do well. Ultrasound of her internal organs showed no damage to her other organs, and her liver did not look as bad as it could have been. Over the course of the day she gained more energy, ate more, and was able to walk around and sniff the vet&amp;#8217;s office when I came for a visit. She is still well in straits, and we don&amp;#8217;t know how well she will recover, how long she will live after this, or how well we can control her seizures going forward.&lt;/p&gt;

&lt;p&gt;I didn&amp;#8217;t know if I should write this now, because it&amp;#8217;s not over yet, but I felt I had to say something. I&amp;#8217;ve thought a lot about what I might write, or what I might say, if sweet Kafka had died, or if we put her down, and I&amp;#8217;ve needed an outlet for these feelings. Everything could change in a moment, and I could go back to the intense anger and grief that gripped me last night. But I&amp;#8217;m guardedly optimistic, hoping for the best.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/42328396223</link><guid>http://csm.tumblr.com/post/42328396223</guid><pubDate>Mon, 04 Feb 2013 19:34:34 -0800</pubDate><category>epilepsy</category><category>dogs</category></item><item><title>A simple proposal</title><description>&lt;p&gt;To mention the elephant in the room up front, I can no longer support or even allow firearm ownership in the United States to continue. Yes, I don&amp;#8217;t want you to have guns any longer. I believe they are barbaric and dangerous, they have no place whatsoever in a civilized society, and that banning private ownership of them is the only way the United States can achieve some semblance of modern civilization.&lt;/p&gt;

&lt;p&gt;Now, I know this is a nigh-on impossible thing to put into place, given the inertia of gun ownership in this country. I know we revere the second amendment to the constitution like it was gospel, handed down from above by our all-knowing forefathers and so much thus infallible and closed off to change. I know that gun owners harbor the fantasy that the reason they should have the right to own their guns is primarily to stop some fanciful version of the US government that no longer worked to maintain the health and happiness of its people (I am a hard core armchair liberal and it makes me seethe when I see the police acting like jackbooted thugs towards simple political protests, so I can sympathize easily with that anti-authoritarian standpoint).&lt;/p&gt;

&lt;p&gt;So, thus, I have a proposal. The second amendment may remain intact, and you may retain ownership of all of your firearms. You may even own high-caliber, fully-automatic firearms. You may clean, fix, and shoot them as much as you like.&lt;/p&gt;

&lt;p&gt;But what you cannot do is own them in public society or in private residences.&lt;/p&gt;

&lt;p&gt;See, what I&amp;#8217;d like to see put in place are established, licensed places — I will call them &lt;em&gt;armories&lt;/em&gt; — where you are allowed to store, clean, fix, modify, and discharge firearms. You are not allowed to remove weapons or ammunition from the premises of the armory except in certain restricted scenarios, to facilitate hunting. You will be in charge of purchasing and maintaining your weapons, and for a small fee (bolstered by public funding), you will be able to store your weapons in a secure place. You may visit the armory at any time: you will be given keys and/or credentials so you may enter the armory and practice with your firearms (locks granting access to an armory will require transparent, public implementations, so backdoors or centralized lockdowns are impossible). Armories will be guarded on a continuous basis (but surveillance that can be centralized will be forbidden, so as not to allow a tyrannical government to stop its people from a deserved revolt), to prevent gun owners from removing their weapons from the armory.&lt;/p&gt;

&lt;p&gt;So if gun ownership really is about maintaining a democracy against tyrannical governments, and it &lt;em&gt;isn&amp;#8217;t&lt;/em&gt; about your simple, base desire to wield mortal power over other people, than the armory idea should be a fine one and in line with the principles of the second amendment.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/39287980976</link><guid>http://csm.tumblr.com/post/39287980976</guid><pubDate>Sun, 30 Dec 2012 22:42:55 -0800</pubDate></item><item><title>Maps</title><description>&lt;p&gt;Dammit, don&amp;#8217;t make me go and be an Apple apologist, but jeez everybody. So to start off:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;Apple&amp;#8217;s Maps app in iOS 6 has flaws.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Probably few people outside of Apple and Google know why Apple decided to make their own Maps app. It may have been Apple snubbing Google; Google might have demanded terms that Apple couldn&amp;#8217;t accept.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;But so, some points I have to make:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;A lot of complaints are that Apple was not able, in version 1.0 of an app, to create a complete, height-accurate, textured model &lt;em&gt;of the entire fucking Earth&lt;/em&gt; down to the last building. Yeah, fuck them, why couldn&amp;#8217;t they do that in 6 months?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Making a mapping app of the caliber they&amp;#8217;re shooting for is &lt;em&gt;hard&lt;/em&gt;. They&amp;#8217;ve gotten as far as they have in a fairly short amount of time; Google has had years to improve their map system. I want to see just how great Apple can make their mapping system, once they have time to mature it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The vector-based map implementation is, actually, incredibly good. My biggest complaint with Google&amp;#8217;s maps app was always the shitty tile loading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I hope Apple contributes improvements back to OpenStreetMap, based on usage of their app. If they just do that, the entire exercise of creating their own Maps app will be worth it, and worth us not having the best, most-accurate, Maps app that is one day old.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maps and directions are extremely important apps for a smartphone. Do you really think Apple wants to be beholden to Google as its exclusive partner for this area? Would you want to be beholden to Google for something so vital?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;</description><link>http://csm.tumblr.com/post/31994288243</link><guid>http://csm.tumblr.com/post/31994288243</guid><pubDate>Fri, 21 Sep 2012 11:32:07 -0700</pubDate><category>apple</category><category>maps</category><category>fuck-google</category></item><item><title>I had a dream last night where I was writing some code, but it was also an equation, and I had a...</title><description>&lt;p&gt;I had a dream last night where I was writing some code, but it was also an equation, and I had a spark of discovery where I could replace much of the complexity with the &amp;#8220;Galois Constant&amp;#8221;. It even appeared on the screen as a blackboard bold capital G that glowed golden. But I needed to know the value of the Galois Constant so I could fill it in.&lt;/p&gt;

&lt;p&gt;And then I grabbed my phone off the nightstand, in real life, to look up the value of the Galois Constant. There is no such thing as the Galois Constant.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/31605237160</link><guid>http://csm.tumblr.com/post/31605237160</guid><pubDate>Sat, 15 Sep 2012 12:42:38 -0700</pubDate></item><item><title>Sparrow</title><description>&lt;p&gt;So what happened.&lt;/p&gt;

&lt;p&gt;The small team that developed Sparrow was acquired by Google, and presumably each of the five of them made out/will make a lot of money through that acquisition. Large rewards of money are generally good things, and so this is a very good thing for these people, individually.&lt;/p&gt;

&lt;p&gt;Sparrow itself will no longer be developed, and all of us who use it and love it dearly will miss it. This is generally a bad thing, and yes, we all recognize that this isn&amp;#8217;t something we have control over nor something we are in a position to make demands about, but it is still a bad thing.&lt;/p&gt;

&lt;p&gt;The Sparrow team will presumably begin working on Gmail at Google. Gmail&amp;#8217;s web interface is nice, many power users like it&amp;#8217;s feature set, and many novice users like its simplicity, though I in particular hate using it. The iOS app for Gmail is generally regarded as a joke. So, if the Sparrow team is able to bring their expertise to the platform and make it better, this may be a good thing for users of the platform.&lt;/p&gt;

&lt;p&gt;However, what made the Sparrow team great was its small size and its caliber of people, working intensely on a focused goal. What tends to happen when superstar indie developers get swallowed by a giant corporation with a very different dynamic and culture, and when that giant corporation has bottom-line values that are very different from the values of a small company (say, maximizing advertising revenue, instead of making lovely products that sell well), is that these developers are unable to contribute anything remarkable, because the aforementioned culture and priority differences. What tends to happen, then, is that the developer waits around for as long as he needs to in order to receive any retention bonus, and then he jumps ship because he now has financial leeway to pursue something more inventive and fun. So at the end of it all, the large corporation killed off a product loved by many, and got nothing tangible in return, which is a bad thing.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/27774028051</link><guid>http://csm.tumblr.com/post/27774028051</guid><pubDate>Sun, 22 Jul 2012 11:23:51 -0700</pubDate></item><item><title>The Word of Notch: On Patents</title><description>&lt;a href="http://notch.tumblr.com/post/27751395263/on-patents"&gt;The Word of Notch: On Patents&lt;/a&gt;: &lt;p&gt;&lt;a href="http://notch.tumblr.com/post/27751395263/on-patents" class="tumblr_blog"&gt;notch&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let’s say you’re Neo, and you were the first person ever to come up with the idea of a novel. It’s like a short story, but longer, and you’re really proud of it.&lt;/p&gt;
&lt;p&gt;Trinity then runs up to you and takes one of the few printed copies of your novel. You don’t want her to do that, as you paid good…&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://csm.tumblr.com/post/27771285355</link><guid>http://csm.tumblr.com/post/27771285355</guid><pubDate>Sun, 22 Jul 2012 10:33:59 -0700</pubDate></item><item><title>Where your priorities lie</title><description>&lt;p&gt;I watched both presentations early this morning on the apparent discovery of the Higgs boson, and I noticed something. Even though the CMS presentation had better typesetting, colors, and format, it was a muddled mess, presented poorly, even for a highly technical, jargon-laden technical talk. The ATLAS talk was better structured and presented, even if it was set with worse typography and colors.&lt;/p&gt;

&lt;p&gt;So please, &lt;em&gt;shut the fuck up&lt;/em&gt; about the ATLAS presentation slides being set in Comic Sans. Yes, there are better fonts, but shut the fuck up.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/26517040065</link><guid>http://csm.tumblr.com/post/26517040065</guid><pubDate>Wed, 04 Jul 2012 15:02:08 -0700</pubDate></item><item><title>Is there any kind of log file viewing software for OS X that can actually keep up with the end of...</title><description>&lt;p&gt;Is there any kind of log file viewing software for OS X that can actually &lt;em&gt;keep up&lt;/em&gt; with the end of the file? Because, Console seems like it can&amp;#8217;t ever be convinced to follow a log file.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/26025753215</link><guid>http://csm.tumblr.com/post/26025753215</guid><pubDate>Wed, 27 Jun 2012 14:47:37 -0700</pubDate></item><item><title>Details that turn ideas bad</title><description>&lt;p&gt;&lt;strong&gt;Peeling your orange over the sink:&lt;/strong&gt; fine idea, good way to capture the mess.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leaving the peel there:&lt;/strong&gt; fuck you.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/22284144204</link><guid>http://csm.tumblr.com/post/22284144204</guid><pubDate>Wed, 02 May 2012 16:27:28 -0700</pubDate></item><item><title>I&amp;#8217;m not sure how to feel about the Oracle vs. Google lawsuit thing over Java.

On one hand,...</title><description>&lt;p&gt;I&amp;#8217;m not sure how to feel about the Oracle vs. Google lawsuit thing over Java.&lt;/p&gt;

&lt;p&gt;On one hand, it&amp;#8217;s shameful, and not all that surprising, that a company like Oracle is breaking the promises that Sun put forth in being the steward of Java. It&amp;#8217;s a huge damper to freedom when they place onerous restrictions on usage of the language (GNU Classpath would probably infringe on Oracle&amp;#8217;s copyrights, if they win this), and it sets a bad precedent in the software world. It&amp;#8217;s already absurd enough that so many patent lawsuits are being thrown around; this will add an even-more-ridiculous hammer companies can wield to sue instead of innovate.&lt;/p&gt;

&lt;p&gt;On the other hand, fuck Google.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/21457223485</link><guid>http://csm.tumblr.com/post/21457223485</guid><pubDate>Fri, 20 Apr 2012 15:50:50 -0700</pubDate></item><item><title>I think Python has made me sufficiently lazy that now every Java method I create ends with throws...</title><description>&lt;p&gt;I think Python has made me sufficiently lazy that now every Java method I create ends with &lt;code&gt;throws Exception&lt;/code&gt;.&lt;/p&gt;</description><link>http://csm.tumblr.com/post/20991905525</link><guid>http://csm.tumblr.com/post/20991905525</guid><pubDate>Thu, 12 Apr 2012 16:48:05 -0700</pubDate><category>hacking</category></item><item><title>“Happy” tax season…</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m2dpbgKMmK1qz7c3uo1_250.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;“Happy” tax season…&lt;/p&gt;</description><link>http://csm.tumblr.com/post/20973040887</link><guid>http://csm.tumblr.com/post/20973040887</guid><pubDate>Thu, 12 Apr 2012 11:14:04 -0700</pubDate></item><item><title>How CouchDB Revision Number Generation Works</title><description>&lt;p&gt;&lt;em&gt;(Technical post, yadda yadda)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;CouchDB uses data-derived revision numbers for documents stored in it; these revision numbers are a big aid in replicating databases between servers: it&amp;#8217;s trivial to tell if two replicas were starting with the same revision history because the revision numbers tell the story exactly.&lt;/p&gt;

&lt;p&gt;The short answer to how CouchDB generates these revision numbers is &amp;#8220;it&amp;#8217;s the MD5 of the document and its attachments&amp;#8221;, but the truth is unfortunately not that simple. If you check out the &lt;a href="http://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=blob;f=src/couchdb/couch_db.erl;h=81e97f2fe7f624015f1e01506afb0eef3eaac7e9;hb=HEAD#l653"&gt;code that computes revisions&lt;/a&gt;, you will see this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;couch_util:md5(term_to_binary([Deleted, OldStart, OldRev, Body, Atts2]))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which looks simple, but unfortunately is &lt;em&gt;too&lt;/em&gt; simple: the above depends on Erlang&amp;#8217;s encoding of &amp;#8220;terms&amp;#8221; into binary strings (the &lt;code&gt;term_to_binary&lt;/code&gt; call), and the hash is computed on that binary string.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;An aside: shit like this is super lazy, and destroys interoperability with other systems. If you ever have to encode something into binary for purposes like hashing, use a common format. Don&amp;#8217;t ever depend on language-specific encodings like this.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is, happily, not &lt;em&gt;too&lt;/em&gt; difficult to compute this encoding — the format is pretty well &lt;a href="http://www.erlang.org/doc/apps/erts/erl_ext_dist.html"&gt;documented online&lt;/a&gt;. The hash is made over a list with five elements: a &lt;code&gt;Deleted&lt;/code&gt; flag, an &lt;code&gt;OldStart&lt;/code&gt; number (this seems to be the update sequence of the document), an &lt;code&gt;OldRev&lt;/code&gt; value (this is the MD5 hash of the previous version of the document), a &lt;code&gt;Body&lt;/code&gt; (the document, the object that was decoded from JSON), and an &lt;code&gt;Atts2&lt;/code&gt; list (I believe these are the attachments; I haven&amp;#8217;t investigated how this variable is hashed, so I&amp;#8217;ll just treat it as an empty list below).&lt;/p&gt;

&lt;p&gt;First, to start off, you will need to emit six bytes for the serialization prologue, list begin marker, and list length (which is 5). Lengths are usually four bytes, in big-endian byte order:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;83 6c 00 00 00 05                                 |.l....|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And the sequence always ends with a nil value (all lists end with a nil list); the stream will always end with the byte &lt;code&gt;0x6a&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, encode whether the document is a deleted version or not; CouchDB keeps &amp;#8220;tombstone&amp;#8221; entries for documents that have been deleted, for proper revision tracking. The deleted marker is a boolean, but actually gets encoded &lt;em&gt;as an atom&lt;/em&gt;, so if your document is deleted, emit the atom &lt;code&gt;true&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;64 00 04 74 72 75 65                              |d..true|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If not, emit the atom &lt;code&gt;false&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;64 00 05 66 61 6c 73 65                           |d..false|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next the sequence number, which is emitted as an integer in one of two ways; if it fits into one byte, emit a &amp;#8220;small int&amp;#8221; (the example below is for a sequence == 0):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;61 00                                             |a.|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If it&amp;#8217;s larger than a byte, emit it as a normal, four-byte integer (below the value is 256):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;62 00 00 01 00                                    |b....|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;OldRev&lt;/code&gt; field is either null (for the first revision of a document), or a 16-byte string. For the null case, just emit a small integer 0, as above. For a non-null revision, emit a binary string, which consists of a marker, the length as four bytes, then that many bytes. For example, the 16-byte revision string consisting of all &lt;code&gt;0xff&lt;/code&gt; bytes:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;6d 10 ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |m...............|
ff ff                                             |..|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;Body&lt;/code&gt; is the trickiest one; it is the &lt;em&gt;decoded&lt;/em&gt; JSON document, minus internal variables like &lt;code&gt;_rev&lt;/code&gt; and &lt;code&gt;_id&lt;/code&gt;. It is represented as:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;A tuple with arity 1, which contains:&lt;/li&gt;
&lt;li&gt;A list, containing as many key/value pairs as are in the document, each of which is:&lt;/li&gt;
&lt;li&gt;A tuple with arity 2, which contains the key (a binary string), followed by the value.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For example, the JSON document:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    "foo": "bar",
    "baz": "baz",
    "quux": 1234,
    "boolean": true,
    "otherboolean": false,
    "list": [ 1, 2, 3 ],
    "obj": { "a": "b" }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Becomes this, in Erlang:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{[
    {&amp;lt;&amp;lt;102,111,111&amp;gt;&amp;gt;,&amp;lt;&amp;lt;98,97,114&amp;gt;&amp;gt;},
    {&amp;lt;&amp;lt;98,97,122&amp;gt;&amp;gt;,&amp;lt;&amp;lt;98,97,122&amp;gt;&amp;gt;},
    {&amp;lt;&amp;lt;113,117,117,120&amp;gt;&amp;gt;,1234},
    {&amp;lt;&amp;lt;98,111,111,108,101,97,110&amp;gt;&amp;gt;,true},
    {&amp;lt;&amp;lt;111,116,104,101,114,98,111,111,108,101,97,110&amp;gt;&amp;gt;,false},
    {&amp;lt;&amp;lt;108,105,115,116&amp;gt;&amp;gt;,[1,2,3]},
    {&amp;lt;&amp;lt;111,98,106&amp;gt;&amp;gt;,{[{&amp;lt;&amp;lt;97&amp;gt;&amp;gt;,&amp;lt;&amp;lt;98&amp;gt;&amp;gt;}]}}
]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The order of keys in the source document is preserved, so there is no dependence on hash order or other implementation details.&lt;/p&gt;

&lt;p&gt;The mapping between JSON types and Erlang is:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Booleans are mapped to the atoms &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Nulls are mapped to the atom &lt;code&gt;null&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Integers are integers.&lt;/li&gt;
&lt;li&gt;Floating-point numbers are floating-point numbers.&lt;/li&gt;
&lt;li&gt;Strings are binary strings.&lt;/li&gt;
&lt;li&gt;Lists are lists.&lt;/li&gt;
&lt;li&gt;Objects are arity-1 tuples, containing a list of key/value pairs, as arity-2 tuples.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Booleans, nulls, integers, and strings should be obvious from the usage above. Now, for the rest of the possible items:&lt;/p&gt;

&lt;p&gt;Float values begin with the marker &lt;code&gt;0x63&lt;/code&gt; followed by 31 bytes that contain the string representation of the float, as if formatted with the format string &lt;code&gt;"%.20e&lt;/code&gt;. If the string is shorter than 31 bytes, it is padded with zero bytes.&lt;/p&gt;

&lt;p&gt;Lists should be obvious from above; they begin with the byte &lt;code&gt;0x6c&lt;/code&gt;, have the number of items in the list as a four-byte integer in big endian byte order, and end with a nil value, byte &lt;code&gt;0x6a&lt;/code&gt;. E.g.:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;6c 00 00 00 05                                    |l....|
...
6a                                                |j|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Objects begin with a small tuple header, and count of one:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;68 01                                             |h.|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then, there is the list of key/value pairs, encoded as a list like above. Each key/value pair begins with an arity-2 tuple header:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;68 02                                             |h.|
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then the key and the value.&lt;/p&gt;

&lt;p&gt;Serialization can continue from there; keys should be strings, and values can be encoded recursively.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Attr2&lt;/code&gt; element has some form, but I haven&amp;#8217;t determined what yet (my assumption is a list of tuples, mapping the attachment name to its value). If you aren&amp;#8217;t dealing with attachments, emit an empty list (a nil, byte &lt;code&gt;0x6a&lt;/code&gt;).&lt;/p&gt;</description><link>http://csm.tumblr.com/post/18963100318</link><guid>http://csm.tumblr.com/post/18963100318</guid><pubDate>Thu, 08 Mar 2012 13:27:57 -0800</pubDate></item><item><title>I like this picture, because clearly this couple is having a...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_m0j53fy6DJ1qz7c3uo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;I like this picture, because clearly this couple is having a great time viewing their health benefits on their &lt;strike&gt;iPad&lt;/strike&gt;anonymous tablet computer, instead of those messy paper statements.&lt;/p&gt;

&lt;p&gt;Or,&lt;/p&gt;

&lt;p&gt;“Oh gonorrhea treatments are such a laugh!”&lt;/p&gt;

&lt;p&gt;Or,&lt;/p&gt;

&lt;p&gt;“Here honey, let me show you this goatse website.”&lt;/p&gt;</description><link>http://csm.tumblr.com/post/18910790308</link><guid>http://csm.tumblr.com/post/18910790308</guid><pubDate>Wed, 07 Mar 2012 11:35:39 -0800</pubDate></item><item><title>So the Internet is a great thing, no denying. Love it.

And, SOPA and PIPA are shitty laws being...</title><description>&lt;p&gt;So the Internet is a great thing, no denying. Love it.&lt;/p&gt;

&lt;p&gt;And, SOPA and PIPA are shitty laws being pushed by shitty people who think their dying business model is more important than the freedom of everyone else, and these laws need to be strangled in the crib. Granted.&lt;/p&gt;

&lt;p&gt;But yeah, so it took someone trying to take away your YouTube/business model/cat pictures for you to stand up and act? You know there &lt;em&gt;are&lt;/em&gt; more important issues right now, that are hiding comfortably behind the American public&amp;#8217;s ignorance and apathy.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll be glad if our representatives hear our collective, massive &lt;em&gt;AHEM&lt;/em&gt; on this issue, and back off on this legislation. It means our voice works in the goddamn democratic system.&lt;/p&gt;

&lt;p&gt;Why don&amp;#8217;t we use it, then?&lt;/p&gt;</description><link>http://csm.tumblr.com/post/16081947820</link><guid>http://csm.tumblr.com/post/16081947820</guid><pubDate>Wed, 18 Jan 2012 14:57:47 -0800</pubDate></item><item><title>Don't Be Evil*</title><description>&lt;a href="http://blog.mocality.co.ke/2012/01/13/google-what-were-you-thinking/"&gt;Don't Be Evil*&lt;/a&gt;: &lt;p&gt;&lt;a href="http://parislemon.com/post/15785567607/dont-be-evil" class="tumblr_blog"&gt;parislemon&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;*except if evilness is good for business.&lt;/p&gt;
&lt;p&gt;The basics: Google, by way of their &lt;a href="http://www.kbo.co.ke/"&gt;Getting Kenyan Business Online&lt;/a&gt; initiative, stole customers (and data) from rival Mocality. &lt;/p&gt;
&lt;p&gt;Mocality uncovered as much in a clever sting operation, not unlike the one Google itself used to catch Bing “&lt;a href="http://searchengineland.com/google-bing-is-cheating-copying-our-search-results-62914"&gt;borrowing&lt;/a&gt;” search results last year. &lt;/p&gt;
&lt;p&gt;What a fucked up situation. Google has &lt;a href="http://paidcontent.org/article/419-google-investigating-kenyan-client-poaching-allegations/"&gt;fessed up to it&lt;/a&gt;, but is distancing themselves — “a team of people working on a Google project” sure is a funny way of saying “&lt;a href="http://www.kbo.co.ke/faqs"&gt;Google employees&lt;/a&gt;”. Not good. &lt;/p&gt;&lt;/blockquote&gt;</description><link>http://csm.tumblr.com/post/15790675165</link><guid>http://csm.tumblr.com/post/15790675165</guid><pubDate>Fri, 13 Jan 2012 13:42:08 -0800</pubDate></item></channel></rss>
