<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Roxy Light on Medium]]></title>
        <description><![CDATA[Stories by Roxy Light on Medium]]></description>
        <link>https://medium.com/@zombiezen?source=rss-6ba9d934b9e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CsHcTNzxAy3LQFJFfKIuVw.jpeg</url>
            <title>Stories by Roxy Light on Medium</title>
            <link>https://medium.com/@zombiezen?source=rss-6ba9d934b9e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:43:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zombiezen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Get Things Done]]></title>
            <link>https://medium.com/@zombiezen/how-i-get-things-done-4a0b4af9dd2c?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a0b4af9dd2c</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[gtd]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Wed, 17 Oct 2018 21:54:02 GMT</pubDate>
            <atom:updated>2018-10-17T21:54:02.076Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Sustaining productivity by Capturing, Clarifying, Organizing, Reflecting, and Engaging</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IfDOS199G3KNlKzRSsZYvA.jpeg" /><figcaption>My in tray, memo pad, pen, and dry erase marker.</figcaption></figure><p>In this blog post, I’m to do a deep dive into the specific steps and tools that I used to achieve this new mindfulness. If you haven’t read <a href="https://medium.com/@zombiezen/my-story-of-getting-things-done-e00d0d5a136d">my first blog post about Getting Things Done</a>, you should take a look. I’m not recommending the tools here in any capacity other than from my own personal viewpoint: I’m not getting paid to promote these. I still recommend reading <a href="http://a.co/d/aVMm2Ax"><em>Getting Things Done</em></a> by David Allen to understand the theory and reasoning for why to use particular tools, and adapt for your own circumstances.</p><p>To recap from my first post: the <em>Getting Things Done</em> methodology is designed to take in all the inputs from our day-to-day lives and gives us a structure to find what do with them and when to do them. My current system contains about 500 distinct items. That was taking quite a toll! The problem is how to surface the subset of those items precisely when they’re relevant.</p><p>To give a quick overview of the tools I use:</p><ul><li>For capture, I use a combination of <a href="https://todoist.com/">Todoist</a>, physical in-trays, memo pads, and a digital voice recorder.</li><li>For organizing next actions and projects, I use Todoist.</li><li>For organizing appointments, I use Google Calendar.</li><li>For reference materials, I use Google Keep, Google Drive, and a small physical filing cabinet.</li></ul><h3>Capture</h3><p>The first phase in <em>Getting Things Done</em> is Capture. The key is to externalize all the inputs going through your head. The goal is quantity, not quality, so it’s essential to have ubiquitous tools for capturing “stuff”. The Todoist Android app provides a convenient home screen widget that lets me quickly jump to typing new items. The ubiquity of my phone means this works for 80% of stuff that I capture. However, when I am in the car and have a random thought or I need to take down a lot of information quickly, the phone doesn’t work as well. I keep a digital voice recorder in my car which I transcribe to Todoist when I have reached my destination. In cases where I’m taking in a lot of input, I use memo pads. I’ve also found memo pads are great for keeping next to my bed in case something is keeping me up.</p><p>Another interesting aspect is stuff that comes in through digital means. For me, that is email and GitHub issues. Gmail’s search capability is so good that I don’t worry about labeling email anymore: I just have the inbox and I archive messages once I’ve determined what I want to do with them. GitHub is similar, but I found that I wanted to have all my GitHub work auto-linked in Todoist, so I could just click to jump right to the issue. I have rigged up an <a href="https://developers.google.com/apps-script/">Apps Script</a> periodic trigger to poll notifications from GitHub and deliver new ones into my Todoist inbox, which shortens the time it takes me to clarify them.</p><p>What’s critical during the Capture phase isn’t high-fidelity or importance. Coverage is key. I don’t worry about forgetting things now that I have a high degree of confidence that everything that I could possibly need to do is entering my system. As a result, I don’t obsessively check my email or messages anymore. And as I’ve progressed, I’ve started to even jot down things that I’m pretty sure I won’t do, just so that I can defer the judgement to later. When I have some time to think and plan, I move onto the next phase.</p><h3>Clarify</h3><p>Now that everything I haven’t figured out what to do with is in either my digital or physical inboxes, the next step is for me to Clarify what this “stuff” means to me. For each thing that I’ve captured, I ask myself:</p><ol><li>Is this actionable? If not, it goes into trash, my “Someday/Maybe” project in Todoist, or my reference system — Google Drive, Google Keep, and a small physical file cabinet.</li><li>Do I need to do more than one discrete thing to act upon this? If there are multiple actions that need to be taken to accomplish the goal, I create a new project in Todoist and sketch it out there.</li><li>What is the next action?</li><li>Will it take less than 2 minutes? If so, do it!</li><li>Am I the right person to do it? If not, delegate it and organize it with a Waiting label.</li><li>Otherwise, take it out of the inbox and organize it.</li></ol><p>While this checklist is simple enough to keep in my head, it forces me to answer a number of questions before a task goes anywhere onto my list of next actions. This keeps the list tidy and easy to understand at any given moment.</p><h3>Organize</h3><p>Now that I’ve identified a concrete task to do, the next important step is to organize it so that I can find it later. Organizing my next actions enables me to find tasks I can act on right now, and more importantly, so I don’t see tasks I can’t act on. No point stressing over something I can’t do! I use labels in Todoist to organize my tasks. The most important labels I have are for the task’s context, for example: Home, Office, Errands, Phone, Coding, Email, Meeting. I also have labels for individual people I frequently communicate with and for roughly how long something will take. I never set a “priority” on tasks, as this is only useful relative to other tasks I could do at a given moment. Once I’m ready to Engage — get things done — these labels are tremendously useful.</p><p>The other aspect of Todoist I use is to organize my next actions into projects. My projects are grouped into categories: Personal, Work, and Travel (which has implications for both other areas). I also keep “Someday/Maybe” projects for both Personal and Work where I can park ideas. Within a project, tasks don’t nest: only projects nest. Day-to-day, I seldom look at the projects themselves; when I review my tasks at the end of the week, the projects help me identify whether there’s more to do.</p><h3>Reflect</h3><p>At the end of every week, I block off two hours to just sit through and look at all of my tasks one-by-one. When I first read this suggestion in <em>Getting Things Done</em>, I balked: what could I possibly do for two whole hours for this? And every week, I use the whole time. For my first weekly reviews, I would make tweaks to the system: new labels, new filters, new projects, new ideas, and new parts of my life to apply the system to. The review is a catharsis. By laying out all the current threads that I have, patterns begin to emerge. In the first month, I was able to find several key places where I was doing work that should have been delegated and discovered a whole area that was getting neglected. While I may have found these out without <em>Getting Things Done</em>, the weekly review made these tangible and surfaced the issues much more quickly.</p><p>By organizing actions into projects, it also becomes clear during weekly review where I need to brainstorm more tasks or drop a project. Most of the time, when I finish a task on a project, the next action is clear, but sometimes when I get to weekly review, the project is empty without being done. This forces me to look at what I need to be doing but am not. Other times, there are projects that just keep being in the same state week after week, which is usually a sign that this doesn’t matter enough to me to keep doing it. It helps me to let go: when I see all the other stuff I could be doing, it makes it easier to say “no” to lesser projects.</p><h3>Engage</h3><p>By the time I’ve gone through all these steps, I have a complete, indexed inventory of everything in my head and I’m ready to go. While this process seem onerous, it’s important to remember that I do each of these things in batches, and not all back-to-back. When I get home after work, I’m not planning out my whole week. Instead, I quickly check to see whether I have any 2-minute tasks I can do at home so that I can get to relaxing. If my partner brings up that we need to get something at the store this week, then I simply note it in my Todoist inbox and move on. I know that I’ll clarify it later. In fact, I’d say the largest benefit of this system isn’t finding out what I need to do, it’s knowing that there isn’t anything I need to do right now. It’s a huge relief.</p><p>Todoist’s filters feature makes it really easy to surface organized tasks. I have a number of filters set up based on context and time estimate, like “2 Minutes @ Home”, “Emails to Write”, “Coding on Work Laptop”, and “Errands”. While each of these surfaces tasks from across my personal and work projects, I can enforce certain rules (e.g. I don’t do work at home) and hide irrelevant things (e.g. if I’m waiting on a water filter to be delivered, I can’t install the water filter even though I’m at home). That’s where the labels are really handy: a few seconds on the way out of the inbox makes all the difference when I’m ready to do things.</p><h3>Summary</h3><p>This is a faithful adaptation of Allen’s <em>Getting Things Done</em>, with minor tweaks to suit how I work and think about things. While I am still developing my habits and becoming more productive, even my initial efforts have significantly lowered my day-to-day stress. None of these steps added burden on me. I find these efforts provide structure onto what I was already doing. I hope this post helps you see how even just a few shifts can help you be productive, too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a0b4af9dd2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Story of Getting Things Done]]></title>
            <link>https://medium.com/@zombiezen/my-story-of-getting-things-done-e00d0d5a136d?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/e00d0d5a136d</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[gtd]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Wed, 17 Oct 2018 21:53:54 GMT</pubDate>
            <atom:updated>2018-10-17T21:53:54.188Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Going from high stress to high productivity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eM-XyPB08EqBOf7J2_ILmg.jpeg" /></figure><p>It was a packed day: all meetings that required my attendance. The only breaks were for breakfast and lunch and a lone 30-minute break between other meetings. I had to meet with my remote manager, my new product manager, one of my team members, and customer liaisons for a new customer we were hoping to work with. On top of that, it was Agile sprint planning day — I had to run the task planning meeting and moderate two design discussion meetings. In between all that, I needed to write up my top accomplishments to my manager for performance review. The previous night, I realized that one of my mentoring meetings tomorrow didn’t have enough time to actually accomplish my mentee’s goals. All the while, a wave of emails and pings were crashing in. How was I going to get this all done?</p><p>While this was certainly not a typical day for me (I wouldn’t keep doing this if it was!), I think we’ve all experienced times in our lives where there’s things we want to do, but just don’t know how we would get there. I certainly have, even when things were far less busy. I would write things down on post-its on my monitor, but it was hit-or-miss whether I’d be remembering everything. Even when I did get everything done, it would seem like an accident. I would forget to do things. A constant source of background anxiety would be the question: “is there something else I forgot to do?” Things that I wanted to do — sharing photos I took, checking out a new video game, keeping up with friends, and so forth — would pile up too. At the end of most days, I would be exhausted, my brain buzzing with all the things I wasn’t doing instead of the things I did.</p><p>But the first week of August, everything changed: I read <a href="http://a.co/d/aVMm2Ax"><em>Getting Things Done</em></a> by David Allen. This was a book on my radar for years, ever since my dad started using the workflow. I had just launched a product at work, so there were a bunch of threads of work that I was struggling to keep up with. The <em>Getting Things Done</em> methodology is composed of five activities: <em>Capture</em>,<em> Clarify</em>,<em> Organize</em>,<em> Reflect</em>, and <em>Engage</em>. The first step, <em>Capture</em>, is to gather “stuff” that is pulling on your attention. When you have time in the next few days, you <em>Clarify</em> what you want to do about each thing (perhaps nothing!). As you do this, you <em>Organize</em> the next actions so that you can find them later when you can <em>Engage</em> with them — actually doing things. Periodically, you <em>Reflect</em> on the projects you have assembled out of these actions to ensure you are doing the right things. I hoped that <em>Getting Things Done</em> would help with landing my product launch. What I got was far more.</p><p>As I read the book, I could see the direct path from where I was now to a better sustained state, unlike other “life hacks” and temporary fixes. Allen is quite upfront: adopting <em>Getting Things Done</em> requires a fair chunk of time to get your own system set up. Since the objective is to close <em>all</em> the open loops you’ve accumulated, Allen’s guidance is to dump any organization system you had before and then clarify and organize them. This includes documents, memorabilia, and reminders. Everything that is pulling on you. I found that this took me the better part of a weekend. I dumped out all my paper files and random bins of stuff that had accumulated over the years. I just never had “enough time” to deal with them before. A large amount of it had outlived its usefulness, but there was a significant portion that I wanted to keep or do something about. I then wrote down clear, actionable next steps in Todoist for that which remained, categorizing the steps with labels like “Home” or “30 minutes”. The labels weren’t perfect at first, but as I reviewed them and I organized more things, they got better as I got more clarity on how to separate each of these things.</p><p>Within a few weeks, I was already seeing benefits. Instead of being wildly reactive and worrying about missing things, I was confident that my system already had all the things. When I sat down to work, I could look at exactly the set of things that I could actually do instead of being cluttered with a bunch of things that I couldn’t do. If you were to look at the sequence of what I do, it wouldn’t be logically connected other than “well these two things both needed to happen on the computer”. And that’s precisely why I’m doing them: it’s advancing something forward while I’m still in that mode. And I’m adapting and switching activities depending on what I can do at a given time. Echoing Allen here: all these elements I already did (keeping a calendar) or knew how to do (organize by home or work), but I never combined them in this way.</p><p>Going back to my packed day, what did I end up doing? I knew that I wasn’t going to have time to capture any of the new inputs (email, pings, etc.), so I focused on fitting in the actions I had on my “Today” list in the time blocks I had. Since the calendar meeting could be moved quickly, I did that first. As I met with people during the day, I pulled up the list I had for each person and checked in about all the things I needed to with them. When they would tell me about new things, I’d make a note and put it in my ever-growing in tray. I wrote up and emailed my performance accomplishments — building on top of the outline I brainstormed the day before — during the only 30-minute break I had. I even got a few more things done than I expected: I checked in with my manager about a referral candidate, brainstormed project plans for 2019, called customer service about the balance of a gift card that I had found in my apartment the night before, and rescheduled a meeting with a new hire. My breakfast and lunch were unperturbed: I needed them to relax. In random moments and on my bus ride home, I cleared my inbox to zero by clarifying and organizing the next steps needed for each. In short, everything that I could do, I did, and you know what? At the end of the day, I was energized and proud of what I accomplished, not tired and stressed.</p><p><em>Getting Things Done</em> transformed how I work and live. I’m happier, I exercise more (I have a daily reminder), I work more efficiently, and I spend more time with the people I care about. Overall, I’m just more present and relaxed. When my mind wanders to something else, I can jot down the other thought and then return to what I want to be doing now. I’m focused in meetings and social gatherings. When something comes up, I can prioritize it quickly and decide whether it can wait or not and be sure that I will do it when the time is right. Having the system around is like having the sort of quest system you’d find in a video game: everything is clear and laid out, and doing the things becomes enjoyable.</p><p>I’ve written up this post because I don’t think the benefits in the <em>Getting Things Done</em> approach are unique to me. I see <em>Getting Things Done</em> as a fantastic tool for addressing the stress brought on by everyday life. I’m not getting paid for this; my hope is that by sharing my story that it can help others who are struggling with the same problems. And I think it will: when I’ve talked with people about the problems I was facing, their eyes lit up and couldn’t ask questions fast enough. If, like them, you’ve read this far and you’re curious to know more details about how I’ve set up <em>Getting Things Done</em>, check out my <a href="https://medium.com/@zombiezen/how-i-get-things-done-4a0b4af9dd2c">follow-up blog post</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e00d0d5a136d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Life of a Go Infrastructure Maintainer]]></title>
            <link>https://medium.com/@zombiezen/life-of-a-go-infrastructure-maintainer-cb1419308eb5?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb1419308eb5</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Thu, 22 Feb 2018 21:14:45 GMT</pubDate>
            <atom:updated>2018-02-22T22:18:05.273Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>I originally gave this as a talk at the Seattle Go Meetup on 2017–02–16 (<a href="https://youtu.be/-83IMVS_aWU?t=18m8s">video</a>). The following is a refined version of the talk, not just a verbatim transcript, based on my speaker notes.</p><h3>What do I do?</h3><p>I am the Tech Lead for Go on Cloud at Google. When you hear this, you may think, “Ross creates libraries.” And that could be reasonable. Google offers a Cloud Platform for hosting and that has a whole bunch of services. You need Go libraries to be able to talk to these services. But it turns out, creating libraries is a rather infrequent occurrence. More often, a library already exists, so creating a new one would result in this scenario:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*oIbadEnUpC87I110.png" /><figcaption><a href="https://xkcd.com/927/">Standards</a> from xkcd by Randall Munroe. Used under a <a href="https://creativecommons.org/licenses/by-nc/2.5/">Creative Commons License</a>.</figcaption></figure><p>Clearly we don’t want 15 competing libraries.</p><p>Perhaps a better description of what I do is “maintaining libraries.” But the term maintenance traditionally implies that the software is fundamentally staying the same: bugs are fixed or functionality is added on top of a solid base. It sounds almost peaceful. But more often that not, when we throw an API into the wild, we get bug reports where our customers use libraries in ways we don’t expect. The libraries behave in ways that neither we or our users expect. The typical engineering response would be not to do that: “You’re holding it wrong!” But this is short-sighted: the better engineering response is to make it impossible to “hold” the library wrong. This makes for simpler, more robust systems, especially as we add and adapt new functionality to handle these cases.</p><p>Tension comes because you <em>can’t</em> break anybody’s existing applications. These applications are part of many people’s day-to-day; businesses want these fixes, but don’t want to subject themselves to churn to get them. But just about any change can break applications, even seemingly innocuous ones. Imagine the following contrived contacts library:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0aa3500d4f11467ecdfc6f86cfe23614/href">https://medium.com/media/0aa3500d4f11467ecdfc6f86cfe23614/href</a></iframe><p>And an application with tests that uses it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/992eea728e997aaaf00c70e982a89fd6/href">https://medium.com/media/992eea728e997aaaf00c70e982a89fd6/href</a></iframe><p>Imagine that after lots of feedback, we realize that most everybody using this contacts library wants to get the contact’s favorite number. We add a new field, which we think should be a safe change. After all, we’re merely layering new functionality, not changing existing functionality.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9787afb144e86c6d5bf5a1a9441e33f/href">https://medium.com/media/b9787afb144e86c6d5bf5a1a9441e33f/href</a></iframe><p>But this breaks the test above! reflect.DeepEqual notices that the golden input’s FavoriteNumber is zero (implicit because the composite literal does not initialize the field), which is different from the received FavoriteNumber.</p><p>Given that this seemingly innocuous change broke the tests, how do I as an infrastructure maintainer gain confidence that I’m not breaking anything? Automated testing. Before joining the Go Cloud team, I worked on its counterpart team of Go inside Google. Google has a really strong testing culture where its product teams write their own automated tests. HEAD is always expected to pass tests; breaking changes should be rolled back ASAP. (This has been <a href="https://cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository/fulltext">written about extensively</a>.) This is great, because I can just make my change in my local working copy, then run every affected test. This is harder outside Google, but the principle remains the same: if a customer has written good tests, they can catch breakages by running their test suite on the updated dependencies before rolling them out.</p><p>The value of writing tests has been extolled endlessly; I am writing here to inform you of the costs of writing bad tests. As you can tell from this example, a broken test does not mean a broken application. Perhaps the test is trying to avoid accidentally leaking new fields to the client (over JSON serialization perhaps), but more often than not, tests overspecify their expectations. This makes my job more difficult. The most (somberingly) accurate description of my job as a maintainer is: <strong>I fight bad tests.</strong></p><h3>Lessons from Fighting Bad Tests</h3><p>Here are specific patterns in Go that have hindered me in improving libraries.</p><ul><li><strong>Please don’t use reflect.DeepEqual.</strong> If you do this, I can’t add fields. Using reflect.DeepEqual tends to overspecify which fields are significant for the test, at the sake of some momentary convenience while writing. The <a href="https://github.com/google/go-cmp">go-cmp</a> package was designed to avoid this problem.</li><li><strong>Please don’t use encoding/gob. Especially on structs you don’t own.</strong> Again, I can’t add (or reorder) fields. There are better alternatives out there, like JSON or protobufs. I have seen this cause breakages in the wild because a library I was working on reordered fields and caused a service to start issuing different pagination tokens. It happens.</li><li><strong>Please don’t check Error(). … But when you do, please use strings.Contains. </strong>I can’t add new error details that give more context. If you compare on the exact error string, then any new (or removed) bytes from that string will cause a failure.</li><li><strong>Write structs, not interfaces.</strong> If there’s only one implementation of a method call, then there’s only one codepath that has to be reasoned about. Only add abstraction when you need it.</li><li><strong>Report bugs.</strong> If a library has a bug, report it to the upstream author. If we can’t see a problem, we can’t fix it.</li></ul><h3>Why does this happen?</h3><p>Taking a step back, why do bad tests happen? What is the common thread that connects these issues? The problem here is that making seemingly miniscule changes in a library is causing large problems in an application. This is captured much more eloquently by Hyrum Wright, a former Google software engineer:</p><blockquote>Given <strong>enough use</strong>, there is <strong>no such thing as a private implementation</strong>.<br>That is, if an interface has enough consumers, they will collectively depend on every aspect of the implementation, intentionally or not. This effect serves to constrain changes to the implementation, which must now conform to both the explicitly documented interface, as well as the implicit interface captured by usage. We often refer to this phenomenon as “bug-for-bug compatibility.”</blockquote><p>(Emphasis mine, <a href="http://www.hyrumslaw.com/">original here</a>.)</p><p>The takeaway for your next new shiny application is that to avoid churn whenever you update, follow these rules:</p><ul><li><strong>Only depend on the <em>documented</em> interface</strong> where possible. If you want specific behavior, ask for it to be documented.</li><li><strong>Only test what you need.</strong> No test is better than a brittle test.</li><li><strong>Use fakes, not mocks.</strong> If a part is hard to use under test, then either write a fake or redesign your part.</li></ul><p>(It’s worth noting that all of the examples are phrased in terms of tests, but if you’re depending on implicit behavior in production, <em>REALLY</em> rethink your usage.)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb1419308eb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Canceling I/O in Go Cap’n Proto]]></title>
            <link>https://medium.com/@zombiezen/canceling-i-o-in-go-capn-proto-5ae8c09c5b29?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ae8c09c5b29</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[rpc]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Fri, 12 Jan 2018 17:08:07 GMT</pubDate>
            <atom:updated>2018-01-12T17:08:07.776Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>A Go Experience Report about Context</h4><p>This report details an experience I had while writing an RPC system in Go. While Go’s standard I/O libraries make a great many things simple, I found cancellation to be more complex than I would have liked. Parts of this situation have improved in the last couple of Go releases (as I have noted below). I hope this positive trend continues in a way that allows the Go ecosystem to easily propagate cancellation, deadlines, and request values. My intent in this report — as well as the <a href="https://golang.org/issue/20280">proposal</a> I created back in May 2017 — is to give background and feedback to inform future design decisions. Suggestions for solutions welcome!</p><p>(Thanks to Ian Lance Taylor, Damien Neil, Cassandra Salisbury, and Andrew Bonventre for reviewing this report for accuracy and clarity.)</p><h3>An Overview</h3><p>For several years, I have been the maintainer of the <a href="https://github.com/capnproto/go-capnproto2">Go Cap’n Proto library</a> in my spare time. Cap’n Proto specifies both a binary <a href="https://capnproto.org/encoding.html">serialization format</a> and an <a href="https://capnproto.org/rpc.html">RPC protocol</a>. While this library has shown me a number of places where I think Go can improve (and this may be the first of many experience reports), I’d like to focus on a particular problem that can be explained without any knowledge of the library.</p><p>The basic building block of the RPC library is the Conn object. Simplifying a bit, there are two concurrent tasks that operate on Conn:</p><ol><li>A goroutine that reads messages from the wire, processes them, then sends back zero or more messages in response. For example, receiving an “RPC return” message consults some internal Conn state, then sends back an “RPC return acknowledged” message before reading the next message. I call this the receive goroutine.</li><li>The application sends RPCs, which translate to messages being sent on the wire. The responses from the remote peer are later read by the receive goroutine.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d07c5e60d59d303483b090ec1b13418/href">https://medium.com/media/8d07c5e60d59d303483b090ec1b13418/href</a></iframe><h3>The Closing Act</h3><p>The problem at hand is how to stop a Conn’s receive loop once it has started. A naive approach would be:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e205cbe30ab092ef88d1a631617d2ca5/href">https://medium.com/media/e205cbe30ab092ef88d1a631617d2ca5/href</a></iframe><p>However, this approach has two problems:</p><ol><li>In the Cap’n Proto RPC specification, implementations are supposed to send an explicit abort message as the last message before intentionally closing a connection. Calling Close shuts down both the reading and writing end of the io.ReadWriteCloser, making it impossible to send the abort message.</li><li>Calling Close concurrently with Read on a generic io.ReadCloser is not explicitly declared safe. For example, until Go 1.9, calling Close concurrently with Read on an *os.File (such as with a Unix pipe) would result in a data race (<a href="https://golang.org/issue/7970">#7970</a>). However, types that implement net.Conn explicitly allow calling Close concurrently with Read.</li></ol><p>Another approach could be to close the reading half of the connection first using <a href="https://godoc.org/net#TCPConn.CloseRead">CloseRead</a>, with the intent to interrupt the Read. This is a bit unwieldy: CloseRead and CloseWrite are only available on TCPConn and UnixConn, and the semantics on how they interact with concurrent operations is not documented as of Go 1.9. However, Read is not the only I/O call in the receive goroutine. Remember that the receive goroutine doesn’t just read messages from the wire: it also sends them. When the CloseRead comes in, the receive goroutine may be in the middle of sending a response to an already received message. It would be desirable to stop it from sending more messages while shutting down.</p><p>This is a classic example of what Context is supposed to be used for: propagating cancellation down the call stack. Ideally, I would write:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbd94b0c6b35cb15978f71e502a91f5a/href">https://medium.com/media/cbd94b0c6b35cb15978f71e502a91f5a/href</a></iframe><p>Plumbing the Context through helper function is tedious but possible. In cases like ReadFull, I would likely have to reimplement the function. The crucial part is actually interrupting the I/O operation. io.Reader and io.Writer do not take in a Context, nor do they provide a simple way to cancel the operation. So how can I accomplish this in Go 1.9?</p><h3>Starting Simple: Canceling a Write</h3><p>In the scope of Cap’n Proto, cancelable writes are easy to graft on top of Context-unaware io.Writers, the reason being that partial writes corrupt the stream. A cancel signal should be ignored once bytes have hit the wire. Therefore, checking for cancelation before calling Write is enough for this use case. For writers that respect SetWriteDeadline, I can spin up a separate goroutine that listens for the Done signal and sets an immediate deadline to interrupt the Write.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/593d811c49af118c9fa8282742197e52/href">https://medium.com/media/593d811c49af118c9fa8282742197e52/href</a></iframe><h3>Don’t Interrupt Me; I’m Reading</h3><p>Canceling a read is much more complicated. Often, I want to cancel the read when there isn’t any data available. Readers conventionally return what is buffered instead of waiting for more, so Read returns quickly in those circumstances. For readers that implement SetReadDeadline, I can employ the same technique as for writing, but I’m left in a strange place if the reader does not implement SetReadDeadline.</p><p>One way I can simulate interrupting the Read call is by always calling Read in another goroutine, and then selecting on Context.Done and a channel that produces the result of the Read call. The caveat is that at some point, the goroutine calling Read needs to be waited upon or else resources leak. In the Cap’n Proto RPC case, canceling the read will likely occur shortly before Conn closes the io.ReadWriteCloser, so any abandoned Read will not need to stay around for long. However, I still have a problem: given a generic io.ReadCloser, I cannot guarantee that it is safe to call Close concurrently with Read. There is fundamentally no way to address this: such an io.Reader cannot be stopped safely.</p><p>There’s one other wrinkle: Read can’t be wrapped in a single function like Write. Write’s contract is to block until its input is written, which means that I can gather up all that I need to write into one byte slice then call the above function. Read may intentionally return less than requested, so often multiple Read calls are necessary. This is usually handled by routines like io.ReadFull, which I don’t want to give up or duplicate to do context-plumbing. To support my existing io.Reader-based code, as well as to maintain the state of the abandoned goroutine, I had to create an io.Reader that curries the Context:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46bc5c05efb8a9f87c343c13f2441740/href">https://medium.com/media/46bc5c05efb8a9f87c343c13f2441740/href</a></iframe><h3>What Works</h3><p>SetReadDeadline and SetWriteDeadline are flexible enough to allow me to graft cancelation and deadline awareness onto Readers and Writers. However, when I first started looking at this problem (around Go 1.7 and 1.8), this meant pipes (being *os.File) had to be excluded. Starting with Go 1.9, it is now possible to interrupt an *os.File.Read call with *os.File.Close in a safe manner, making the leaky Reader fallback safe for any type of file. In Go 1.10, *os.File gains the SetReadDeadline and SetWriteDeadline methods (<a href="https://golang.org/issue/22114">#22114</a>), which will make pipes work with the timeout interrupt approach. (Go 1.10 also adds os.IsTimeout.)</p><h3>What Doesn’t Work</h3><p>My solution works for the narrow problem of propagating Context cancellation and deadlines to specific io.Reader and io.Writer types that I needed, but at the cost of an additional goroutine and complexity. The goroutine seems unnecessary: one could imagine a version of the Go runtime poller that takes in a Done channel instead of a deadline. It’s also not intuitive that you can set an immediate deadline to interrupt a concurrent call. In the first draft of this post, I set deadlines in the future and checked for Context.Done in a loop (thanks to Ian Lance Taylor for pointing out the more efficient implementation above). On the complexity side, there’s a large amount of my custom io.Reader implementation dedicated to handling the abandon-able goroutine. The check for deadline support is fairly boilerplate, and it would be nice to eliminate it.</p><p>There’s also complexity must necessarily be pushed onto users of the library: I have to document that io.Readers passed to the connection must either have a SetReadDeadline method or be safe to call Read concurrently with Close. This stomps on one of the key benefits of Go’s I/O interfaces: anything that implements the interface should just work. Library users now must carefully inspect the io.ReadWriteClosers they pass into my RPC library. And further, it makes it harder to compose I/O types. If the user wanted to create a custom io.ReadWriteCloser that uses *bufio.Reader on another io.Reader, they have to know to wrap SetReadDeadline as well, and it has to “poke through” *bufio.Reader to the underlying Reader’s SetReadDeadline. If the I/O operations had a standard way of propagating Context, then this wouldn’t be necessary.</p><h4>A Note on Context values</h4><p>One further observation: the solution I used in Cap’n Proto does not work for Context values. If I needed to propagate a Context value into the io.ReadWriteCloser (say for observability purposes), then I would be out of luck. While I don’t have a concrete need for this within this library, I have seen other places where this would be useful — notably in Google Cloud Storage’s <a href="https://godoc.org/cloud.google.com/go/storage#Reader">storage.Reader</a> and <a href="https://godoc.org/cloud.google.com/go/storage#Writer">storage.Writer</a>. The GCS package works around the lack of Context by currying the Context, similar to what this package does. It would be nice to address this use case, but I haven’t thought about it in as much depth.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ae8c09c5b29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rewriting moviegolf.com]]></title>
            <link>https://medium.com/google-cloud/rewriting-moviegolf-com-e5c01fd396dc?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5c01fd396dc</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[movies]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Mon, 22 May 2017 18:00:23 GMT</pubDate>
            <atom:updated>2017-05-22T18:00:23.208Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Reflecting on 8 years of programming experience</h4><p>In April, I relaunched <a href="https://www.moviegolf.com/">moviegolf.com</a>, a website I’ve operated since 2009. Since this is one of the flashier programs I’ve written and certainly one of the longest-lasting, I wanted to recount its history. My style of programming has definitely shifted in the intervening years.</p><h3>What is Movie Golf?</h3><p>From the site’s <a href="https://www.moviegolf.com/about">about page</a>:</p><blockquote>Movie Golf is a movie trivia game — like <a href="http://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon">Six Degrees of Kevin Bacon</a> — that involves connecting movies. The object of the game is to connect two seemingly different movies by putting the fewest intermediaries. To putt to another film, you must find a common actor. For example, you can putt from “Legally Blonde” to “Pleasantville” via Reese Witherspoon.</blockquote><p>It’s a game my dad (Jeff Light) and his friends at OSU developed many years ago, but it boils down to <a href="https://en.wikipedia.org/wiki/Shortest_path_problem">a basic CS graph problem</a>: find the optimal path between two movie nodes where each edge is an actor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*F5w2zL1e_fujR9yocoCD6w.png" /><figcaption>An undirected graph connecting Movie A to Movie Z. The optimal path goes through Movie B, with Actor 1 connecting Movie A to Movie B and Actor 2 connecting Movie B to Movie Z. In order for an edge to exist between two movies, the actor must have been in both movies. The bottom shows a suboptimal path, going from Movie A to Movie C to Movie D to Movie Z. There are often many ways to traverse between two movies.</figcaption></figure><h3>Version 1.0</h3><p>I originally wrote a Python solver for this game back in early 2009. At the time, I was quite enamored with <a href="https://en.wikipedia.org/wiki/Freebase">Freebase</a> and noticed that I could download a medium-sized file (couldn’t have been more than a few dozen megabytes) and get information on about roughly 60,000 movies. This included cast listings, directors, and cinematographers. Everything. Remembering this game my dad taught me, I coded up a hacky command-line solver that would read the whole dump into a hash map and then find the path between two given movies. I showed this to my friends, who were excited, but understandably wanted a more accessible way to play the game. Since I was on an <a href="https://cloud.google.com/appengine/">App Engine</a> + <a href="https://www.djangoproject.com/">Django</a> kick at the time, a website seemed the way to go.</p><p>For those who haven’t used App Engine, it spins up virtual server instances in response to how much traffic you use and shuts them down when you’re not using them. The cost of “read an entire multi-megabyte file from disk on startup” per instance didn’t seem like a good idea to me back then. Nowadays, I wouldn’t bat an eye, but back then, I didn’t have a grip on relative speeds of things. So I decided “hey I should put this in a database”. This was a good idea; this is what I do in the new version. The cringeworthy idea (in hindsight) was my choice of database: I used <a href="https://cloud.google.com/datastore/">Cloud Datastore</a>. Don’t get me wrong: Datastore is a fine storage system, but it is not <a href="https://en.wikipedia.org/wiki/Relational_model">relational</a>, which is precisely what a problem like Movie Golf requires. To find adjacent films, I was issuing a query per actor in a film. To put this in perspective, assume that on average movies have: (all handwaving, but roughly true) 3 actors in them, connect to 90 other movies, and have an overlap factor of 50%. Connecting a pair of movies with two intermediaries would requiring querying Datastore over a network 12423 times! Even if each query was 1 millisecond, this would be over 12 seconds of wall-clock time. By comparison, my new system only issues a fraction of the queries, all in-memory.</p><p>While it’s easy for me to pick on myself now, these decisions were made because I did not understand the underlying systems I was using. I did not learn about <a href="https://en.wikipedia.org/wiki/Join_(SQL)">SQL joins</a> until many years later. When I gave up on using App Engine, I wrote a small on-disk B-tree index that would store the adjacent films directly. Little did I know, this is exactly what SQL databases do under the hood.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qy-W8S3ztRS-NIJ2W8ys4g.png" /><figcaption>A screen capture of moviegolf.com’s landing page, circa 2013. Very minimalist. The search form at the top is where you type in two movies. I also tried to provide a logged-in experience where you could save and vote on golfs, but I was the only one who ever did.</figcaption></figure><p>The site worked well enough and supported a variety of movie-related queries. However, it had one key disadvantage: the data was never up to date. You could search for a particular movie and click a button to refresh that single movie. This didn’t scale at all and required manual end-user effort. When you’re trying to surface connections during a golf search, you want movies you <em>didn’t</em> ask for to be updated. Over time, movies become more connected, since new movies will bring together actors in new ways. But at least there was some data.</p><p>As a novice, I was satisfied.</p><h3>8 Years Later…</h3><p>In 2010, Google acquired Freebase. Five years later, Freebase was shut down. moviegolf.com no longer had any data. Look on my website, ye Mighty, and despair!</p><p>With one formal Computer Science degree and 4 years of work experience under my belt, I decided that I wanted to replace the derelict website. My priorities were to study the Go on Google Cloud Platform experience and to keep any ongoing maintenance effort to a minimum. My free time is at a premium, so everything should be simple, write-once, and easy to debug.</p><h4>Data Ingestion</h4><p>Getting the data was by far the most complicated part of the whole endeavor and the major factor that kept me away from this rewrite. I had to find a new data source and this time, I wanted it to be as live as possible. No more manual updates and no more hosting of user-generated content. Let somebody else be moderator. IMDB was the obvious candidate, and they do publish data dumps, but I was unclear as to whether their licensing terms would fit my use case. Getting a lawyer for connecting movies seemed absurd. When Freebase was shut down, their data was migrated to Wikidata. This seemed perfect: a data model I already understood with weekly dumps, an API for fetching recent changes, and a <a href="https://www.wikidata.org/wiki/Wikidata:Database_download/en#License">CC0-licensed</a> corpus.</p><p>Since most of the other interesting bits (actually golfing, showing data via HTML) required data, and using real data tests the system more than fake data, I took a week and built this first. The Wikidata dumps come as compressed JSON records, one per line. The uncompressed corpus is 1.7 billion entities, taking up 111 gigabytes! While this sounds infeasibly large, I only want a small fraction of that data: just the movies and actors. While the records for films have obvious indicators in the stream, Wikidata does not provide an indicator for actors. To determine which entities are actors, you must keep a running list of which record IDs show up in the cast of each film. As such, my importer needed to walk over the data once to just find out which records it should keep, then walk over the data again to collect these records into a database. Once the code was tested and built, it took about an hour to download and decompress the dump, and then an hour and a half to run the importer. Most of this is disk-bound, so I could have benefited from a higher speed disk on my desktop. This was good enough to get initial development going: a 40 megabyte corpus with real data.</p><h4>Updating the Data</h4><p>However, downloading the dumps every week would obviously be impractical because of both time and space restrictions. I’d have to pay for far more cloud storage than I’d actually need and the data would be quite stale. Further, the longer it takes for a single conceptual operation to take place, the more likely it is for something to kill that job in the middle. Yay Murphy’s Law! Instead, as I alluded to above, I wrote another service (the updater) that consults the Wikidata recent changes API to see the entities that were modified since the last import and then read the changes directly from the website instead of the dumps. In my small-scale tests on my laptop, I noticed that it took roughly 1 minute to process 500 entity changes (the vast majority of them are not even movie related). I measured the number of changes that are made in a 24-hour period and found it to be roughly 160,000, which is about 7,000 changes per hour. I wanted each import run to take less than 10 minutes, so I decided to run the updater job every 30 minutes.</p><p>You may notice a problem here: what if the updater starts lagging behind? Let’s say the updater crashes on one or more of the runs. It could then start taking on a larger than normal workload, thus causing it to miss the next scheduled run because it was still running. And further, when I go to cut over from the initial dump import, how do I catch up with the roughly 3 hours that were missed while the dump was being imported? To solve these concerns, I specify a maximum time span that any one import can operate on. I chose a value that’s a little over the run frequency: 45 minutes. This way, the system will have a much more predictable load, even when it’s playing catch-up. As long as it doesn’t run more than 30 days behind (the Wikidata recent changes limit), then it’s fine.</p><p>Having done all this, I started looking at hosting.</p><h4>Price-Driven Architecture</h4><p>One of the most surprisingly useful tools in the GCP repertoire is the <a href="https://cloud.google.com/products/calculator/">Pricing Calculator</a>. It allows you to plug in your predicted usage and get an idea of how your bill would increase. Scaling in some ways are more expensive than others. Load balancing is the most expensive, with CPU and RAM running a close second. Storage is cheap. Without the calculator, I wouldn’t have had a prayer of making these decisions without months of billing trial-and-error with redesigns.</p><p>Pricing also forced me to simplify my initial design. Originally, I thought I would use Cloud PostgreSQL, but even running an out-of-SLA shared instance was more expensive than I wanted. To avoid the Cloud PostgreSQL instance, I settled on storing a SQLite database in Cloud Storage. The live serving traffic only ever needs to read from the database, so there’s no write contention. This way, I could use the production data during local development. This also simplified my integration tests, as I didn’t need to stand up a full SQL server, just a file.</p><p>After working at Google for years, I have become accustomed to <a href="https://landing.google.com/sre/book/chapters/service-best-practices.html">“N + 2” redundancy</a>: always deploy with 2 more instances than you need to run the service. This allows you to handle a planned instance outage (upgrading your service) and an unplanned outage (something dies). This is fine if you need to be highly available and can afford the resources. But moviegolf.com does not need to be high-availability. moviegolf.com’s budget is out-of-pocket (i.e. “as low as possible”). While I would love to be running moviegolf.com with even 99% reliability, a much more reasonable <a href="https://landing.google.com/sre/book/chapters/service-level-objectives.html">Service Level Objective</a> would be 90%. N = 1 it is.</p><p>Lesson learned as a GCP hobbyist: you want to run the least number of instances possible, even if you pack slightly more into that one instance. This rules out Google Container Engine, since it runs on multiple nodes. I also ruled out App Engine (Flex or Standard) for my project, since I wanted to split apart the functionality into multiple Docker images. My reasoning: if I want to scale up in the future, I don’t want to rule out Container Engine. Even though the pricing limited me in some regards, it forced me to examine important trade-offs for my solutions. Even though my potential load is small now, I have a scaling plan.</p><p>Given these constraints, I developed two Go servers in addition to the Updater I outlined above. These all run in separate Docker containers on one Google Compute Engine instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62wfDMW4WdOR6Ah7TOj6_Q.png" /><figcaption>Three Go services (the HTTP Frontend, the Backend, and the Updater). Both the Backend and the Updater obtain a SQLite database from Google Cloud Storage.</figcaption></figure><h4>Frontend and Backend</h4><p>Once I had the data from the dump importer in a SQL-queryable form, the backend server was straightforward to write. It is an RPC service that downloads the SQLite file from Cloud Storage and then runs queries to find the optimal golf between movies. It uses a simple breadth-first search. The advantage of splitting this out as a separate binary is for ease of integration testing, and also ease of scaling. You could imagine that when I scale up, I could start giving more CPU cores to backend services, while continuing to have a minimal set of resources for the frontend. The frontend is similarly straightforward: take HTTP requests, translate them into backend requests, and then render HTML. Once the data is available, the rest is easy.</p><p>For debugging, I integrated both of these servers with Stackdriver Logs and Stackdriver Tracing. Stackdriver Log Metrics are good enough to act as a whitebox monitoring source, so I can monitor increases in 500-level HTTP error responses. These out-of-the-box tools are what make GCP rock.</p><h4>DevOps Time!</h4><p>To deploy this, I used Google Compute Engine directly. I used the new Container-Optimized OS, so I could run my stateless Docker jobs — notice how Google Cloud Storage is the only service with mutable state. Frontend, backend, and updater only have local caches of the database, so they are entirely disposable. I can update the site by creating a fresh instance and deleting the old one, although in practice, I just update the systemd units and restart the services. Again, if I could use a load balancer, this would be easier.</p><p>One unfortunate side-effect of using Google Compute Engine is that it is up to you, the DevOp, to plumb logs into Stackdriver Logs. While there does exist a Logging Agent, it is intended to be used in a non-Dockerized environment. To work around this, I ended up creating a systemd unit that would pipe journalctl output to a FIFO, another systemd unit that would send the pipe’s data to a google-fluentd Docker container via stdin, and then using a google-fluentd config that sends stdin to Stackdriver. The google-fluentd config (the hardest part) looks like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd081120a6bb0498b21d505b54b7ce7b/href">https://medium.com/media/dd081120a6bb0498b21d505b54b7ce7b/href</a></iframe><p>But as a friend pointed out to me, I should probably just rip google-fluentd out and write a custom log forwarding job in Go. A task for another day! If I was running in a more supported configuration, this would have been easier. As is, it was relatively easy to get this running on GCP.</p><h3>Lessons Learned</h3><p>In short, my experience has taught me to always be mindful of tradeoffs when designing — whether that be on simplicity, reliability, price, resource usage, or speed. The set of tradeoffs I consider has broadened over time. The newer version of Movie Golf has more parts, but each part conceptually does one thing that can be tested and can fail independently. An understanding of how data storage systems work has definitely helped guide me to a better design. But it’s interesting how close my final approach is to my first approach: load a file into memory and run the golf queries. For me, that’s been the greatest lesson I’ve learned: only add essential complexity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5c01fd396dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/rewriting-moviegolf-com-e5c01fd396dc">Rewriting moviegolf.com</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phone Security Quick Tips]]></title>
            <link>https://medium.com/@zombiezen/phone-security-quick-tips-ca66152bd2a1?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca66152bd2a1</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Mon, 30 Jan 2017 18:02:02 GMT</pubDate>
            <atom:updated>2017-01-30T18:02:02.975Z</atom:updated>
            <content:encoded><![CDATA[<h4>Keep your phone and your communications safe</h4><p>Cyber security has become critical to ensuring public safety in the US. There’s an absence of good coherent information, and people are rightfully scared and confused. I’m drafting another article that explains cyber security principles in greater depth, but it’s not ready yet. Until then, I’ll get straight to the practical tips:</p><ol><li><strong>Encrypt your phone.</strong> <a href="https://www.cnet.com/how-to/how-to-encrypt-your-ios-or-android-device/">Instructions from CNET</a>. This protects someone from looking at your phone’s storage without knowing the passcode. If you only follow one step from this guide, follow this one.</li><li><strong>Use </strong><a href="https://whispersystems.org/"><strong>Signal</strong></a> for communications. Messages and voice calls made through Signal are encrypted such that only the two devices communicating can read the messages. However, if you don’t encrypt your phone, then the messages can be compromised with physical access to the phone. Encrypt your phone!</li><li>If you think you are about to be detained by police, <strong>turn off your phone</strong>. Police can legally coerce you to touch the fingerprint scanner, but cannot legally make you divulge a passcode (<a href="https://www.theatlantic.com/technology/archive/2016/05/iphone-fingerprint-search-warrant/480861/">source</a>). By turning off your phone, your phone “forgets” the decryption key to the storage, thus requiring the passcode on boot. If you are participating in protests or other situations requiring elevated security, <strong>disable fingerprint scanning for sign-in</strong>.</li><li>Be cautious of apps you install and use a phone from a reputable manufacturer. I trust Apple and Google, but use your own discretion.</li></ol><p>Beyond this, the usual security advice applies — don’t visit sites you don’t trust and use HTTPS where possible. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca66152bd2a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reaching Consensus]]></title>
            <link>https://medium.com/@zombiezen/reaching-consensus-b33041bb38f?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b33041bb38f</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[conversations]]></category>
            <category><![CDATA[meetings]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Thu, 01 Dec 2016 21:49:21 GMT</pubDate>
            <atom:updated>2016-12-01T21:49:21.822Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>The 3 challenges you must overcome to effect change.</h4><p>(This post started off as an email to a colleague. They asked me for feedback on how to speed up an agreement on technical issues. Halfway through my response, I realized the advice I was giving was broadly useful and I wanted to write it up more thoroughly.)</p><p>So you want to write some code or do something that affects more than just you. Great! Whenever this happens, you will face three basic challenges:</p><ol><li>Find the stakeholders.</li><li>Explain the problem to the stakeholders.</li><li>Listen to and address concerns that the stakeholders have.</li></ol><p>Once you’ve done all three, you’re done! The actual work is usually straightforward once your team is supporting you.</p><h3>Many Meetings</h3><p>While challenges 1 and 2 can take time, challenge 3 is the one that requires the most dialogue. While technology has given us many tools for communicating, I still find that the quickest way to reach a resolution is face-to-face. There’s a lot of nuance that people provide in-person that gets lost in written communication. Confusion, concern, and excitement are easy to see on someone’s face. Emojis don’t cut it. Videoconferencing has gotten good enough that it is an acceptable substitute, but if you can, gather in the same physical room. The last step in reaching consensus should be a meeting.</p><p>But I know what you’re thinking: more meetings? Nobody likes those! In my experience, meetings become distasteful to a person when they suffer through too many where they silently ask “why am I here?”. If you’re spending time in a meeting explaining what the stakeholders should be deciding on, you are wasting everyone’s time. Every attendee should know what is to be discussed before they walk into the (virtual) room. Every attendee should have a stake in the outcome. And especially if you are in a large company or an open source project with multiple time zones and different offices, wasting carefully coordinated time is frustrating for everyone. The key to an effective meeting is preparation.</p><h3>Explaining the Problem</h3><p>While preparing for the meeting, you will probably develop an idea for a solution. Good! However, if you can’t articulate the <em>problem</em> you have, people will nitpick on insignificant details of your solution, or worse: you will <strong>solve the wrong problem</strong>. Whenever you start to see a problem that needs fixing, write up a Google Doc describing the problem. It doesn’t have to be a long description — in fact, it probably shouldn’t— but it must be able to summarize the problem to someone with only passing familiarity with your area of expertise. Using a Google Doc will enable your audience to contribute to the problem description.</p><p>Now you may be thinking that writing every problem down is arduous. “I don’t need to write it down. The problem is simple! All that is wrong is…” Think of writing a problem description as an investment. True, it may take you longer to write the problem down than verbally explaining the problem. However: you are now a single point of failure. If you need to give the explanation to someone new, you must recite your prior explanation, taking away from valuable problem-solving time. It’s an issue of scale. If explaining a problem with the written word takes X time, then the amount of your time that it takes to explain it to Y people is still X, not X times Y, like it would be verbally. The written word has a high return on investment of your time.</p><h3>Finding Stakeholders</h3><p>Writing down your problem in an easily shareable format gives you another advantage: you no longer have to be physically present for someone else to receive the knowledge. If you share your document with a few folks that you know are stakeholders, they can recommend who else may care about the problem (or they can just share the document to other stakeholders directly!). The challenge of finding stakeholders is a breeze once you solve the challenge of explaining your problem.</p><h3>Build Consensus on the Foundation</h3><p>This brings us back to the meeting. All the people you need are in a room. They understand the problem, and now they can tell you what they need. I could list some tips on how to have this conversation, but any advice I could give has already been written in much greater depth in <a href="http://www.crucialconversations.com/"><em>Crucial Conversations</em></a> by Kerry Patterson et al. If you haven’t read this book, it’s a light read with great insights — I can’t recommend it enough. But even if you skip the book, overcoming the first two challenges (finding stakeholders and explaining the problem) will help the stakeholders express their concerns to you in a meaningful way. Your meeting will not waste time. Your attendees have personal involvement and understand the significance of what you’re trying to solve.</p><p>While most of my experience is in software development, I believe that these three challenges are applicable to all disciplines. The particulars of how you overcome them may differ in your environment, but they’re always there. I hope that by looking at your problem through this lens, you are able to reach consensus efficiently. Go forth and influence the world!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b33041bb38f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Allegory of The Witness]]></title>
            <link>https://medium.com/@zombiezen/the-allegory-of-the-witness-546b3ce5fcfc?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/546b3ce5fcfc</guid>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[the-witness]]></category>
            <category><![CDATA[storytelling]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Sun, 21 Feb 2016 22:23:50 GMT</pubDate>
            <atom:updated>2016-02-21T22:23:50.586Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<p><em>SPOILER WARNING: I wanted to share my views on the subject matter in The Witness. By necessity, this article does discuss the ending of the game in general terms. However, I do my best to avoid talking about specifics.</em></p><p>When I started writing this review, it began with “I liked <em>The Witness</em>, <strong>BUT</strong>…” I was frustrated. I couldn’t fathom what the ending meant. What I was supposed to glean from this experience? How do the voice-overs fit together? Why was I shown this?</p><p>But then I had an epiphany: I felt this same frustration before. Many times. Every time I solved a puzzle in the game. And so I began to see the prevalent puzzle mechanic as a metaphor for the game itself. “Solving” the story isn’t the point.</p><p>I recommend <em>The Witness</em>. If you’re considering playing it, do it. But bear in mind that it’s not a traditional story, and you may be disappointed if you treat it that way.</p><h3>What is The Witness?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jrj8gXipOl8UHP24SdPgGQ.png" /><figcaption>The river that flows through the island. Courtesy of The Witness media page.</figcaption></figure><p><em>The Witness</em> is a first-person puzzle game released on January 26, 2016. Its gameplay is non-linear and very visual (evocative of the <em>Myst</em> series). The art direction feels similar to that of <em>Team Fortress 2</em>: natural, simplified, and impressionistic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dROJ-4e5nCY6dB2iDNhNAg.jpeg" /><figcaption>A typical puzzle. Image from <a href="https://www.youtube.com/watch?v=Ori84HcnmYE">here</a></figcaption></figure><p>Any discussion of <em>The Witness</em> must mention the puzzles. It’s the core mechanic in the game. You start at the circle and draw a line to the line cap (like the one at the top of picture). As you can see, there are other pieces, but the joy of the game is discovering their meaning and how they interact. It’s a perfect information puzzle, so the only limit to solving any given puzzle is your ingenuity and background knowledge. This is simultaneously the most satisfying and the most frustrating part of the game.</p><h3>The Allegory</h3><p>There’s a lot of speculation around what the game is about and what the ending means. I don’t claim that this is the definitive interpretation or even a good one, but it’s the one that resonated with me.</p><p>Without giving too much away, when you arrive at “the end”, the scene that unfolds seemingly erases all of the progress you’ve made. I felt cheated. But then I stumbled onto an idea that redeemed the ending for me.</p><p>The game is not a story in the traditional sense — it is an allegory. It is less <em>The Talos Principle</em> than it is <em>The Stanley Parable</em> or <em>Journey</em>. The progression through the game symbolizes life. And ultimately, the statement I gleaned from <em>The Witness</em> is that the journey is a reward: both in-game and out.</p><p>Each of the puzzles is a life experience: you gain knowledge or move something forward. Why does the player solve these puzzles? There’s nothing extrinsic motivating the player: no stakes, no stated goal, no timer. The motivation is intrinsic. It’s fun. It satisfies our curiosity to see what happens when we solve each puzzle. And so it is in life. We live life for this intrinsic value. And so the game ends with stripping us of the external motivation and leaving us with knowledge and perspective, which is what we truly gained. The voice-overs in the game confirm this message time and time again. Mechanically, some puzzles can’t be solved until you learn something from another puzzle, even if you find the later puzzle first. As you grow as a person, certain experiences help you solve problems you thought impossible at first. Solving a particular puzzle doesn’t really mean anything.</p><p>Does it follow, then, that the game’s message that life has no meaning? Hardly. <em>The Witness</em> is a mirror, not a painting. It doesn’t give you an answer. It asks you — the player — to find one. This is why I was initially frustrated with the ending. I wanted external validation where there is none. The meaning of a life is what we imbue in the experiences we have. And that is an allegory worth experiencing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=546b3ce5fcfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning]]></title>
            <link>https://medium.com/student-voices/learning-3e5fd120cfc0?source=rss-6ba9d934b9e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e5fd120cfc0</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Roxy Light]]></dc:creator>
            <pubDate>Tue, 02 Feb 2016 00:59:04 GMT</pubDate>
            <atom:updated>2016-02-02T00:59:04.128Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*N2Lh11oLWvdtqoY1.jpg" /><figcaption>The image macro I see all the time: “Well, another day has passed. I didn’t use Algebra once.”</figcaption></figure><p>Not all people like or are good at math. I can relate to that: I am not good at nor particularly care for history. You don’t have to be good at every subject or enjoy every subject. But I respect history, because I know that there are important conclusions that people can make by studying historical patterns. Likewise, math (and algebra) deserves respect.</p><p>Algebra is not about “solving for x”; algebra is about dealing with an unknown. There are many things you won’t know on a given day: how long it takes to get to work, what time you’ll go to bed, the number of times you smile. We deal with these every day. You leave a little earlier for work because yesterday’s traffic was bad, you sleep in a little later, you find friends who make you smile more. This is what Algebra is really about, but it takes a more formal notation so it can apply to anything.</p><p>So why does this mantra of pride in not using Algebra resonate with so many people? Because the way that math is presented at most schools is absolutely horrid. It’s shoved down your throat without context. “SOLVE FOR X.” I’ve seen what this method of teaching does to people. You want to prove that teacher wrong: you don’t need this dumb stuff that you’re being forced to learn. But would you still feel this way if you knew what it could do?</p><p>For four years, I mentored a high school robotics team. Many of the students who joined the team didn’t particularly like math, but liked the idea of building robots. They never thought they were smart enough to grasp those concepts. They couldn’t “solve for x”. The problem was that they didn’t know what they were solving. As soon as “x” became “the distance between where the robot arm is and where you want it to be”, it finally clicked. It’s a breathtaking experience to see a student go from “I’m not good enough” to “I learned this thing in school today, let me try it out on the robot”. Now math is a way for these kids to have control over their world. It’s not just something they understand, but a tool they can use to help them pursue their dreams.</p><p>Maybe you didn’t use algebra today. Fine. But the people who created the device you used to post this mantra sure did.</p><p><em>Originally published at </em><a href="http://zombieetc.tumblr.com/post/89064094242/well-another-day-has-passed-i-didnt-use-algebra-once"><em>zombieetc.tumblr.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e5fd120cfc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/student-voices/learning-3e5fd120cfc0">Learning</a> was originally published in <a href="https://medium.com/student-voices">Student Voices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>