<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Snail in a Turtleneck</title>
	
	<link>http://www.kchodorow.com/blog</link>
	<description>kristina chodorow's blog</description>
	<lastBuildDate>Tue, 18 Jun 2013 04:00:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kchodorow" /><feedburner:info uri="kchodorow" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Music Gremlins is Approved!</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/nRc1Ij5Fcl4/</link>
		<comments>http://www.kchodorow.com/blog/2013/06/17/music-gremlins-is-approved/#comments</comments>
		<pubDate>Tue, 18 Jun 2013 04:00:45 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2614</guid>
		<description><![CDATA[My iPad app is approved and going live on July 1st! Music Gremlins is an ear-training game where you beat gremlins by matching the notes that they play. Different types of gremlins demand different strategies. As a musician, I found it very difficult to practice relative pitch and this makes it easier and more fun. [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/06/icon144x144.png" alt="Derpy gremlin" width="144" height="144" class="alignright size-full wp-image-2616" /></p>
<p>My iPad app is approved and going live on July 1st!</p>
<p>Music Gremlins is an ear-training game where you beat gremlins by matching the notes that they play.  Different types of gremlins demand different strategies. As a musician, I found it very difficult to practice relative pitch and this makes it easier and more fun.</p>
<p>I wanted to have Music Gremlins be more game-like, but it turned out kind of like Mavis Beacon Teaches Typing for ear training.  Oh well, I hope that at least musicians still find it useful.  And it&#8217;s only my first attempt. </p>
<p>Details: it&#8217;s also only for iPad at the moment but it <em>is</em> totally free.</p>
<h4>The App Store Process</h4>
<p>Last weekend, Music Gremlins was almost ready to go so I put in a focused effort to finish it up.  I spent all weekend doing a thousand little &#8220;last things&#8221; and submitted it for review on Sunday.  </p>
<p>It took me hours to actually submit the damn thing.  If you ever come across Apple&#8217;s &#8220;Download Application Loader&#8221;, <em>run away</em>.  The Application Loader is a pit of hell from which there is no escape.  You can upload your app directly through XCode, which involves a mere hour or so of swearing.  </p>
<p>Once XCode has uploaded your app for you, you get an automated email that your app is &#8220;Waiting for Review.&#8221;  The review process for my app was painless, but Music Gremlins didn&#8217;t exactly stretch the bounds of iOS.  I uploaded it on Sunday, June 9th and they got back to me today (June 17th), which was a lot faster than I expected.  I got several emails today, that my app was &#8220;In review,&#8221; &#8220;Processing,&#8221; and finally:</p>
<p><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/06/app-store-approval.png" alt="App Store Approval" width="849" height="246" class="aligncenter size-full wp-image-2615" /></p>
<p>Screenshot from the final game:</p>
<p><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/06/iOS-Simulator-Screen-shot-Jun-9-2013-9.41.59-AM-300x225.png" alt="iOS Simulator Screen shot Jun 9, 2013 9.41.59 AM" width="300" height="225" class="aligncenter size-medium wp-image-2619" /></p>
<p>Unfortunately, I forgot to remove the debugging framerate, so you can see the frame rate in the lower left corner.  This is a screen shot from the simulator and is running at 20fps, but on my iPad it runs at 60fps (yay!).  I&#8217;m going to try to remove that by July 1st&#8230;</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/nRc1Ij5Fcl4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/06/17/music-gremlins-is-approved/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/06/17/music-gremlins-is-approved/</feedburner:origLink></item>
		<item>
		<title>It’s turtles all the way down</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/sYYrJfpC2NM/</link>
		<comments>http://www.kchodorow.com/blog/2013/06/15/its-turtles-all-the-way-down/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 20:14:28 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2609</guid>
		<description><![CDATA[&#8220;Turtles all the way down&#8221; is a concept that Java handles very nicely: public class Turtle &#123; Turtle prevTurtle; &#160; public Turtle&#40;Turtle prevTurtle&#41; &#123; if &#40;prevTurtle == null&#41; &#123; throw new RuntimeException&#40;&#34;It's turtles all the way down.&#34;&#41;; &#125; this.prevTurtle = prevTurtle; &#125; &#125; (Probably there should be a special FiniteTurtleException, but I wanted to keep [...]]]></description>
				<content:encoded><![CDATA[<p>&#8220;<a href="http://en.wikipedia.org/wiki/Turtles_all_the_way_down">Turtles all the way down</a>&#8221; is a concept that Java handles very nicely:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Turtle <span style="color: #009900;">&#123;</span>
    Turtle prevTurtle<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> Turtle<span style="color: #009900;">&#40;</span>Turtle prevTurtle<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>prevTurtle <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">RuntimeException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;It's turtles all the way down.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">prevTurtle</span> <span style="color: #339933;">=</span> prevTurtle<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>(Probably there should be a special <code>FiniteTurtleException</code>, but I wanted to keep the code compact.)</p>
<p>Similarly for other circular references:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Chicken <span style="color: #009900;">&#123;</span>
    Egg cameFrom<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> Chicken<span style="color: #009900;">&#40;</span>Egg hatchedFrom<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        cameFrom <span style="color: #339933;">=</span> hatchedFrom<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Egg <span style="color: #009900;">&#123;</span>
    Chicken cameFrom<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> Egg<span style="color: #009900;">&#40;</span>Chicken mother<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        cameFrom <span style="color: #339933;">=</span> mother<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>You can do it in C-like languages, but you need to be a little clever in your header files, which takes some of the fun out of it.</p>
<p><center><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/06/yertle-225x300.jpg" alt="Yertle the Turtle" width="225" height="300" class="aligncenter size-medium wp-image-2610" /></center></p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/sYYrJfpC2NM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/06/15/its-turtles-all-the-way-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/06/15/its-turtles-all-the-way-down/</feedburner:origLink></item>
		<item>
		<title>Adding an Assertion Macro in Objective-C</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/PvYoPDuMjaQ/</link>
		<comments>http://www.kchodorow.com/blog/2013/05/23/adding-an-assertion-macro-in-objective-c/#comments</comments>
		<pubDate>Thu, 23 May 2013 13:21:25 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2599</guid>
		<description><![CDATA[TL;DR: #define CHECK(val) NSAssert((val), @#val) &#160; // Then use: CHECK(/* something (hopefully) true */); Long version: iOS made the the somewhat bizarre choice that dereferencing a null pointer is not an error. The program just ignores that line and keeps going. Now this causes fewer crashes (yay-ish), but when I developing I&#8217;d really like the [...]]]></description>
				<content:encoded><![CDATA[<p>TL;DR:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objective-c" style="font-family:monospace;">#define CHECK(val) NSAssert((val), @#val)
&nbsp;
// Then use:
CHECK(/* something (hopefully) true */);</pre></td></tr></table></div>

<p>Long version:</p>
<p>iOS made the the somewhat bizarre choice that dereferencing a null pointer is not an error.  The program just ignores that line and keeps going.  Now this causes fewer crashes (yay-ish), but when I developing I&#8217;d really like the program to fail fast instead of just skipping huge swaths of code.</p>
<p>As far as I can tell, there&#8217;s no way to make dereferencing a null pointer an error.  Thus, I&#8217;ve started adding asserts everywhere that I expect values to not be null:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objective-c" style="font-family:monospace;">NSAssert(my_var != nil, @&quot;my_var isn't supposed to be nil&quot;);</pre></td></tr></table></div>

<p>I wrote that all of once and decided I needed a macro:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objective-c" style="font-family:monospace;">#define CHECK(val) NSAssert((val), @#val)</pre></td></tr></table></div>

<p>Now, I can just say:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objective-c" style="font-family:monospace;">CHECK(my_var != nil);</pre></td></tr></table></div>

<p>At compile time, the assert&#8217;s message will automatically be set to the string <code>@"my_var != nil"</code> (that&#8217;s what the preprocessor instruction # does: it means &#8220;wrap in quotes&#8221;).</p>
<p>Most libraries have a macro like this for asserting, but I&#8217;ve never programmed it myself.  Nifty stuff!</p>
<p>P.S. If you need to debug the macro, you can run Objective-C files through GCC normally to see the preprocessor output:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-E</span> Gremlins.m <span style="color: #000000; font-weight: bold;">&gt;</span> Gremlins.E</pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/kchodorow/~4/PvYoPDuMjaQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/05/23/adding-an-assertion-macro-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/05/23/adding-an-assertion-macro-in-objective-c/</feedburner:origLink></item>
		<item>
		<title>MongoDB: The Definitive Guide 2nd Edition is Out!</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/qbJmWP292SU/</link>
		<comments>http://www.kchodorow.com/blog/2013/05/20/mongodb-the-definitive-guide-2nd-edition-is-out/#comments</comments>
		<pubDate>Mon, 20 May 2013 15:39:20 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2588</guid>
		<description><![CDATA[The second edition of MongoDB: The Definitive Guide is now available from O&#8217;Reilly! It covers both developing with and administering MongoDB. The book is language-agnostic: almost all of the examples are in JavaScript. Upgrading from a previous edition? If you have read the first edition, the new edition covers a lot of new material (it [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://shop.oreilly.com/product/0636920028031.do"><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/05/tdg.gif" alt="MongoDB: The Definitive Guide" width="180" height="236" class="alignright size-full wp-image-2592" /></a></p>
<p>The second edition of <a href="http://shop.oreilly.com/product/0636920028031.do">MongoDB: The Definitive Guide</a> is now available from O&#8217;Reilly!  It covers both developing with and administering MongoDB.  The book is language-agnostic: almost all of the examples are in JavaScript.</p>
<h4>Upgrading from a previous edition?</h4>
<p>If you have read the first edition, the new edition covers a lot of new material (it is twice as long!).  Everything has been updated  and lots of sections on new features have been added.  </p>
<h4>Translations</h4>
<p>I hear O&#8217;Reilly is working with their translators to get this edition translated into other languages, but I tend to be the last to hear about that so I don&#8217;t know what the schedule is.</p>
<h4>So&#8230;</h4>
<p>Pick up a copy and let me know what you think!</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/qbJmWP292SU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/05/20/mongodb-the-definitive-guide-2nd-edition-is-out/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/05/20/mongodb-the-definitive-guide-2nd-edition-is-out/</feedburner:origLink></item>
		<item>
		<title>First Two Weeks at Google</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/jvu3UWcxw9A/</link>
		<comments>http://www.kchodorow.com/blog/2013/04/21/first-two-weeks-at-google/#comments</comments>
		<pubDate>Sun, 21 Apr 2013 21:44:22 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2578</guid>
		<description><![CDATA[I&#8217;ve been at Google two weeks now and I&#8217;m loving it so far. My team is great and the work&#8217;s very interesting, but I can&#8217;t talk about what I&#8217;m doing, so: There&#8217;s a ton of orientation stuff new employees have to do, which hasn&#8217;t been much fun. There was a scavenger hunt (which is the [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been at Google two weeks now and I&#8217;m loving it so far.  My team is great and the work&#8217;s very interesting, but I can&#8217;t talk about what I&#8217;m doing, so:</p>
<p>There&#8217;s a ton of orientation stuff new employees have to do, which hasn&#8217;t been much fun. There was a scavenger hunt (which is the kind of thing I usually loathe) but we did find some cool stuff.  One of the places on the list was &#8220;the music room.&#8221;  When we went in it was a soundproofed room with a half-dozen guitars along one wall, an electric drumset, synth, a mic, soundboard, amps&#8230; it was amazing.  </p>
<p>Other things I&#8217;ve discovered so far are:</p>
<ul>
<li>The library, which has big comfy armchairs and couches, shelves of physical books, and a sci-fi touch interface for checking out ebooks.
<li>The juice bar: free smoothies anytime.
<li>The workshop with metal/wood crafting supplies and a 3D printer.
</ul>
<p>I also got this, er, <em>unique</em> hat:</p>
<p><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/04/image-e1366464609430-224x300.jpg" alt="Google beanie" width="224" height="300" class="aligncenter size-medium wp-image-2580" /></p>
<p>If anyone wants a propellor beanie, let me know.</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/jvu3UWcxw9A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/04/21/first-two-weeks-at-google/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/04/21/first-two-weeks-at-google/</feedburner:origLink></item>
		<item>
		<title>Stock Option Basics</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/k6i4pRZ5vLg/</link>
		<comments>http://www.kchodorow.com/blog/2013/04/09/stock-option-basics/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 13:09:06 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2542</guid>
		<description><![CDATA[Here&#8217;s what I wish I&#8217;d known when I started working at 10gen. Disclaimer: don&#8217;t take this as financial advice, consult someone who actually knows what they&#8217;re talking about before making any financial decisions, this is for entertainment purposes only, etc. Also, the numbers used below do not match any startup that I know of, they&#8217;re [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s what I wish I&#8217;d known when I started working at 10gen.  <em>Disclaimer: don&#8217;t take this as financial advice, consult someone who actually knows what they&#8217;re talking about before making any financial decisions, this is for entertainment purposes only, etc.  Also, the numbers used below do not match any startup that I know of, they&#8217;re just hypothetical.</em></p>
<h2>Intro to Stock Options</h2>
<p>Stock options are the option to buy X shares of stock in a company at a guaranteed price of $Y per stock.  Generally, they have some time constraints: they are doled out to you slowly over 3-5 years (the <em>vesting schedule</em>) and expire after a certain number of years if you don&#8217;t buy them.  </p>
<p>$Y is the <em>strike price</em>, the price of the stock when you&#8217;re given your stock grant.  Basically, it is determined by taking the value of the company (say, $2,000,000) and dividing it by the number of shares that have been issued (say, 5,000,000).  This would give you a strike price of $0.40.</p>
<p>If the company is successful, the stock price should be higher when you sell the shares.  For example, say that the startup above is successful and their stock price rises to $5.00.  Now you can buy your shares for $0.40 and sell them for $5.00, making a nice $4.60 profit on each share.</p>
<p>Except you can&#8217;t, because of taxes.  If you are the kind of person who doesn&#8217;t know what a stock option is, you probably have <em>common</em>, or <em>non-qualified</em> stock options (companies prefer this type because you&#8217;ll be footing the tax bill instead of them).  For non-qualified stock, you get taxed twice: when you buy (or <em>exercise</em>) your options and a second time when you sell the stock (these are called <em>taxable events</em>).</p>
<p>Let&#8217;s say you&#8217;re in the situation above: you have 10,000 shares with a strike price of $0.40 and you want to exercise your options.  The current price is $5.  You exercise your options for $4,000 ($0.40 * 10,000).  However, according to the government, you just &#8220;made&#8221; $46,000 ($5*10,000 &#8211; $4,000), which you&#8217;ll now be taxed on.  I have no idea how this tax rate is computed, but for me it was ridiculous.  If my options matched this example (they don&#8217;t), I would have had to pay ~$30,000 in taxes (about 60% tax rate).  Also, you have to hand the company a check for these taxes when you exercise the options, you can&#8217;t put it off until April.</p>
<p>So be careful: if you own a lot of options and the price rises a lot, you can &#8220;golden handcuff&#8221; yourself to a place because you cannot pay the taxes to actually buy your options.</p>
<p>The second taxable event is when you sell the stock.  If you sell the stock within a year, you&#8217;re hammered again with short-term capital gains taxes. If you wait for more than a year to sell, you &#8220;only&#8221; get hit with long-term capital gains taxes.</p>
<h2>Negotiating Options</h2>
<p>When you get a job at a startup, often part of the offer will be stock options.  If the startup is early stage, I&#8217;d recommend pretending that your options will be totally worthless forever.  Is the salary acceptable on those conditions?  (Almost every other startup I know of has failed in the time 10gen&#8217;s been around).</p>
<p>In retrospect, I wish I had negotiated more stock options instead of more salary when I started at 10gen, but if I was joining an early-stage startup again, I would do the same thing: not sacrifice salary for options. </p>
<p>The exception is if you&#8217;re joining a startup at a later stage and you&#8217;re pretty sure they&#8217;ll be successful.  In that case, you might want to negotiate for more options.</p>
<h2>Option Expiration</h2>
<p>Typically, options have an expiration date.  Make sure you buy them before they expire (if you want them).  Also, options are typically designed as an incentive to stay, so they don&#8217;t follow you after you leave the company.  If you quit or are fired, you&#8217;ll have to buy any vested ones before or shortly after leaving.</p>
<h2>Buying Unvested Options</h2>
<p>You can buy unvested options, but I can&#8217;t see why you would unless you&#8217;re pretty sure the company&#8217;s going to succeed, you&#8217;ll be there until the options vest, and you&#8217;re trying to avoid the tax hit.  If all those hold true, <a href="http://maxschireson.com/2011/08/23/startup-stock-options-explained/">Max Schireson</a> wrote a good blog post on what you need to know about that.  In fact, go read his post regardless, because it&#8217;s a really good and more technical coverage of a lot of these points.</p>
<h2>Dilution</h2>
<p>In the example above, you have 10,000 shares out of 5,000,000, meaning you own (or could own) 0.2% of the company, you tech mogul.  However, whenever there&#8217;s a round of funding typically more shares are issued.  Thus, instead of there being 5,000,000 shares, there are now 10,000,000 and you only own 0.1% of the company.  Your company should tell you how many stocks are <em>outstanding</em> (the number issued in total) if you ask.  I think this number is typically confidential, but I&#8217;ve heard people advise that you should ask during salary negotiations, so YMMV.</p>
<p>The other significant event is board meetings, where the board decides how much the company is worth.  This changes what the current stock price is.  Funding rounds also often have an effect on price.</p>
<h2>Stockholder Privileges</h2>
<p>Even if you&#8217;re at an early-stage startup, it might be worth buying a few shares to get <a href="http://www.investopedia.com/articles/01/050201.asp#axzz2NYV09E92">stockholders rights</a>.  Find out how many shares you need to buy to get these, if you want a look at the books and so on.</p>
<h2>Keeping Your Documents</h2>
<p>Particularly at an early-stage startup, there may not be anyone keeping track of this stuff.  When 10gen got an Finance/HR person, I asked them about the options grants they had on record and they were missing my original hiring grant.  Luckily, I still had the paperwork.  Keep everything safe somewhere, just in case.</p>
<h2>Exercise Quickly</h2>
<p>If you&#8217;re leaving a company, get on exercising your options as quickly as possible.  You generally have a limited time period before your options disappear and your company might have arbitrary restrictions on when you can exercise (like &#8220;not within a month of a board meeting&#8221;).  Also, it&#8217;s not exactly a speedy process: it took 10gen three weeks from when I signed the paperwork and gave them the checks to actually send the stock certificates.  You don&#8217;t want to have to be dealing with HR at your last company while you&#8217;re dealing with new hire HR at your new job.</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/k6i4pRZ5vLg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/04/09/stock-option-basics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/04/09/stock-option-basics/</feedburner:origLink></item>
		<item>
		<title>Recruiting in all the wrong places</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/Z66oGyQxmy4/</link>
		<comments>http://www.kchodorow.com/blog/2013/04/04/recruiting-in-all-the-wrong-places/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 21:41:20 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2573</guid>
		<description><![CDATA[A recruiter had an email exchange at me the other day. It started with the standard recruiter email: Hi Kristina, How are you enjoying 10Gen? Any interest in going to something earlier stage? I&#8217;m working with a client in &#60;field I&#8217;m not interested in&#62;. Obviously the specificities of that are fascinating. Let me know if [...]]]></description>
				<content:encoded><![CDATA[<p>A recruiter had an email exchange at me the other day.  It started with the standard recruiter email:</p>
<blockquote><p>
Hi Kristina,</p>
<p>How are you enjoying 10Gen? Any interest in going to something earlier stage? I&#8217;m working with a client in &lt;field I&#8217;m not interested in&gt;. Obviously the specificities of that are fascinating. Let me know if you&#8217;d be interested in hearing more.
</p></blockquote>
<p>I ignored it.  A few minutes later, I got a follow-up email from him:</p>
<blockquote><p>
Subject: Whoop, how humiliating</p>
<p>Just saw on LinkedIn you left 10gen last month. Do you have plans for what&#8217;s next?
</p></blockquote>
<p>Closer, but not quite.  A few minutes later:</p>
<blockquote><p>
Ach! Forgive me. Congratulations on the Google job.</p>
<p>Should you ever need the services of an incompetent sourcer, please, don&#8217;t hesitate to reach out!
</p></blockquote>
<p>And I kind of wished that I needed a recruiter because that was pretty funny.</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/Z66oGyQxmy4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/04/04/recruiting-in-all-the-wrong-places/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/04/04/recruiting-in-all-the-wrong-places/</feedburner:origLink></item>
		<item>
		<title>Programming a State Machine</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/SLyEji96HgM/</link>
		<comments>http://www.kchodorow.com/blog/2013/03/23/programming-a-state-machine/#comments</comments>
		<pubDate>Sat, 23 Mar 2013 10:15:37 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2558</guid>
		<description><![CDATA[My attempts at game programming usually turn into impenetrable spaghetti code: &#8220;If the player walks through this door, then have him talk to the princess, unless he&#8217;s killed a guard, in which case the guards attack, or if he comes out of the secret passage&#8230;&#8221; The game I&#8217;m working on now is pretty simple, but [...]]]></description>
				<content:encoded><![CDATA[<div id="attachment_2559" class="wp-caption alignright" style="width: 310px"><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/monster-whole-note.png" alt="A monster modeled after a dog in my neighborhood." width="300" height="193" class="size-full wp-image-2559" /><p class="wp-caption-text">A monster modeled after a dog in my neighborhood.</p></div>
<p>My attempts at game programming usually turn into impenetrable spaghetti code: &#8220;If the player walks through this door, then have him talk to the princess, unless he&#8217;s killed a guard, in which case the guards attack, or if he comes out of the secret passage&#8230;&#8221;</p>
<p>The game I&#8217;m working on now is pretty simple, but I&#8217;ve kept it really clean (so far) by using a state machine to keep track of what should happen when.  Basically, each scene in the game is a state.  There&#8217;s an overarching state machine which runs the current state on each tap.  A state can either return itself or choose a new state to run next time.</p>
<p>In Objective C (+cocos2d), a state looks like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@interface</span> State <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
    CCLayer <span style="color: #002200;">*</span>ui;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> init<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CCLayer<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>layer;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">Class</span><span style="color: #002200;">&#41;</span> processTouch<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITouch<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touch withEvent<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIEvent<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>event;
&nbsp;
<span style="color: #a61390;">@end</span></pre></td></tr></table></div>

<p>The <code>processTouch</code> function either returns <code>nil</code>, which means &#8220;run me again next time&#8221; or the next state to run. The other half is a &#8220;machine&#8221; to run the states:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// -----------------</span>
<span style="color: #11740a; font-style: italic;">// Interface</span>
<span style="color: #11740a; font-style: italic;">// -----------------</span>
&nbsp;
<span style="color: #a61390;">@interface</span> StateMachine <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
    State <span style="color: #002200;">*</span>currentState;
    CCLayer <span style="color: #002200;">*</span>ui;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> init<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CCLayer<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>layer;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span> processTouch<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITouch<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touch withEvent<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIEvent<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>event;
&nbsp;
<span style="color: #a61390;">@end</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// -----------------</span>
<span style="color: #11740a; font-style: italic;">// Implementation</span>
<span style="color: #11740a; font-style: italic;">// -----------------</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> StateMachine
&nbsp;
<span style="color: #11740a; font-style: italic;">// Initialize the state machine by setting currentState to the first state</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> init<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CCLayer<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>layer <span style="color: #002200;">&#123;</span>
    self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        ui <span style="color: #002200;">=</span> layer;
        currentState <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>FirstState alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">:</span>ui<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Run this from the UI's touch dispatcher: it runs the current state's processing code</span>
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span> processTouch<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITouch<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touch withEvent<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIEvent<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>event <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">Class</span> nextState <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>currentState processTouch<span style="color: #002200;">:</span>touch withEvent<span style="color: #002200;">:</span>event<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>nextState <span style="color: #002200;">!=</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        currentState <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#40;</span>State<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>nextState alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">:</span>ui<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></td></tr></table></div>

<p>Then, you might have an implementation like this for a swords &#038; sorcery RPG:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@interface</span> PalaceDungeonState <span style="color: #002200;">:</span> State <span style="color: #002200;">&#123;</span>
    Guard <span style="color: #002200;">*</span>guard;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> PalaceDungeonState
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> init<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CCLayer<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>layer <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// Use ui to render a dungeon</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>State<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> processTouch<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITouch<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touch withEvent<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIEvent<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>event <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>guard.alive<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        <span style="color: #002200;">&#91;</span>guard updatePosition<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    CGPoint touched <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>ui convertTouchToNodeSpace<span style="color: #002200;">:</span>touch<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">switch</span> <span style="color: #002200;">&#40;</span>touched<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">case</span> GUARD<span style="color: #002200;">:</span>
         <span style="color: #002200;">&#91;</span>guard dies<span style="color: #002200;">&#93;</span>;
         <span style="color: #a61390;">break</span>;
    <span style="color: #a61390;">case</span> STAIRWAY<span style="color: #002200;">:</span>
         <span style="color: #a61390;">return</span> PalaceStairwayState;
    <span style="color: #a61390;">case</span> SECRET_PASSAGE<span style="color: #002200;">:</span>
         <span style="color: #a61390;">return</span> SecretPassageState;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #a61390;">return</span> <span style="color: #a61390;">nil</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></td></tr></table></div>

<p>I&#8217;m not thrilled with doing so much work in the <code>init</code>, so for this type of game I&#8217;d probably move that to a <code>start</code> method that would be called by StateMachine on state changes.</p>
<p>Regardless, I&#8217;ve found this makes it a lot easier to make a complicated sequence of events while keeping my code readable.</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/SLyEji96HgM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/03/23/programming-a-state-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/03/23/programming-a-state-machine/</feedburner:origLink></item>
		<item>
		<title>Mad Art Skillz</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/3pgi5lLa2vs/</link>
		<comments>http://www.kchodorow.com/blog/2013/03/15/mad-art-skillz/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 21:45:08 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2549</guid>
		<description><![CDATA[With all this free time, I&#8217;ve been working on an iOS game. I&#8217;m not even close to done yet, but I&#8217;ve wrestled Objective C into submission and now and I&#8217;m working on some assets. It&#8217;s going to be musical, so here&#8217;s Beethoven: And here&#8217;s a demon (it plays the piano): And the player character, Calliope: [...]]]></description>
				<content:encoded><![CDATA[<p>With all this free time, I&#8217;ve been working on an iOS game.  I&#8217;m not even close to done yet, but I&#8217;ve wrestled Objective C into submission and now and I&#8217;m working on some assets.  It&#8217;s going to be musical, so here&#8217;s Beethoven:</p>
<p><a href="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/beethoven.png"><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/beethoven.png" alt="beethoven" width="150" height="147" class="aligncenter size-full wp-image-2550" /></a></p>
<p>And here&#8217;s a demon (it plays the piano):</p>
<p><a href="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/monster21.png"><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/monster21.png" alt="monster2" width="200" height="111" class="aligncenter size-full wp-image-2553" /></a></p>
<p>And the player character, Calliope:</p>
<p><a href="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/calliope.png"><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/calliope.png" alt="calliope" width="270" height="345" class="aligncenter size-full wp-image-2556" /></a></p>
<p>If you ever need to make some vector art, Chris Hildenbrand&#8217;s blog, <a href="http://2dgameartforprogrammers.blogspot.com/">2D Game Art for Programmers</a>, is <em>fantastic</em>.  It teaches you how to create awesome vector art using Inkscape (which is free).  I had never done vector art before and his instructions are perfect for beginners.</p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/3pgi5lLa2vs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/03/15/mad-art-skillz/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/03/15/mad-art-skillz/</feedburner:origLink></item>
		<item>
		<title>Finished The Definitive Guide</title>
		<link>http://feedproxy.google.com/~r/kchodorow/~3/1ap82k7Hn3g/</link>
		<comments>http://www.kchodorow.com/blog/2013/03/08/finished-the-definitive-guide/#comments</comments>
		<pubDate>Fri, 08 Mar 2013 19:03:47 +0000</pubDate>
		<dc:creator>Kristina Chodorow</dc:creator>
				<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.kchodorow.com/blog/?p=2535</guid>
		<description><![CDATA[Or at least the writing it, it still has to be tech edited, &#8220;real&#8221; edited, illustrated, formatted, etc. The second edition is going to be about 400 pages (almost twice the length of the first edition), with majorly expanded sections on sharding, replication, and server administration. Phew. Now, some mea culpas: To those of you [...]]]></description>
				<content:encoded><![CDATA[<p>Or at least the writing it, it still has to be tech edited, &#8220;real&#8221; edited, illustrated, formatted, etc. The second edition is going to be about 400 pages (almost twice the length of the first edition), with majorly expanded sections on sharding, replication, and server administration.</p>
<p>Phew.</p>
<p>Now, some mea culpas:</p>
<p>To those of you who sent me schemas: I&#8217;m sorry if I never got back to you! I decided to go in a different direction and ended up not using any of them.  Sorry to waste people&#8217;s time (but they were fascinating to read).</p>
<p>To those of you who sent in a schema and I asked for your mailing address: I forgot to forward those emails to my personal account before leaving 10gen so I&#8217;ve lost the addresses.  Please resend your address to my personal email (k dot chodorow at gmail dot com).</p>
<p><img src="http://www.kchodorow.com/blog/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-1.57.54-PM.png" alt="Screen Shot 2013-03-08 at 1.57.54 PM" width="1050" height="536" class="aligncenter size-full wp-image-2536" /></p>
<img src="http://feeds.feedburner.com/~r/kchodorow/~4/1ap82k7Hn3g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kchodorow.com/blog/2013/03/08/finished-the-definitive-guide/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.kchodorow.com/blog/2013/03/08/finished-the-definitive-guide/</feedburner:origLink></item>
	</channel>
</rss>
