<?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[bsquared - Medium]]></title>
        <description><![CDATA[thoughts about programming and startups by Brian Brunner - Medium]]></description>
        <link>https://medium.com/b-squared?source=rss----b851875ddc6f---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>bsquared - Medium</title>
            <link>https://medium.com/b-squared?source=rss----b851875ddc6f---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:11:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/b-squared" 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 Fucked Up My iPhone Preorder and Programmed My Way Out Of It]]></title>
            <link>https://medium.com/b-squared/how-i-fucked-up-my-iphone-preorder-and-programmed-my-way-out-of-it-a348466f5502?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/a348466f5502</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:43:54 GMT</pubDate>
            <atom:updated>2016-11-01T16:43:54.323Z</atom:updated>
            <content:encoded><![CDATA[<p>For the second time in 3 years, I fucked up my iPhone preorder. The first time was due to Apple accepting a credit card and the payment inexplicably getting declined. So not really my fault. This time, however, was entirely due to my inability to read directions.</p><p>I used the <a href="https://itunes.apple.com/app/apple-store/id375380948?mt=8">Apple Store</a> app to reserve my preorder. I would then be able to finish my preorder at a later date. Essentially, a preorder for a preorder. Whatever. If it gets me my damn marginally upgraded iDevice I’m fine with it.</p><p>During the process, I selected the wrong payment plan option. After a quick call to Apple, I was told that customer service didn’t care enough to fix the problem. Or that they couldn’t. Or something.</p><p>Anyway, I’m not one to wait. So I decided to over-engineer my way out of the problem.</p><p>I knew the iPhone 7 Plus would most likely require me waiting in line overnight to get one on launch day. There were even some rumblings that the 7 Plus might not be available unless you had a preorder. But I also knew that iPhones are usually available for in-store pickup a few days after release. However, they usually go pretty quick. So naturally, I figured I would build a scraper to do the dirty work of checking for me.</p><p>First things first, I needed to figure out how to get in-store pickup availability info. I took a quick trip through the iPhone order flow and pulled up the in-store pickup availability checker. I checked out the XHR section of the Network Tab of the Chrome Inspector and saw that, thankfully, Apple was using a pretty straightforward JSON API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7Vt76T-QPgO3WurU.png" /></figure><p>JSON APIs, because parsing raw HTML is literally the worst.</p><p>I say thankfully because, in my experience, a lot of e-commerce websites, even those run by big fancy tech companies, tend to do all rendering server side and deliver HTML via their API. This would usually be the point where I’d break out something like <a href="https://pythonhosted.org/pyquery/">pyquery</a> or <a href="https://github.com/cheeriojs/cheerio">cheerio</a>. So it was a relief to be able to just parse the JSON and be done with it.</p><p>For those who are curious, this is the URL I used.</p><pre><a href="http://www.apple.com/shop/retail/pickup-message?parts.0=MN562LL%2FA&amp;location=94063&amp;little=true&amp;cppart=ATT%2FUS">http://www.apple.com/shop/retail/pickup-message?parts.0=MN562LL%2FA&amp;location=94063&amp;little=true&amp;cppart=ATT%2FUS</a></pre><p>It is explicitly for the iPhone 7 Plus Rose Gold 128GB model and it checks near Redwood City. The parts.0 param is a device id that is unique per model. If you are trying this for a different device spec, it’s probably easiest to just repeat my process to get its id. The location param is just your zip code.</p><p>Next up, how to get notified. I’ve worked with <a href="https://www.twilio.com/">Twilio</a> in the past and had nothing but success, so I figured I would get my scraper to notify when iPhones were available for pickup via text.</p><p>Now I just had to glue everything together with some python. I want to say up front that this is functional code. It is not clean code.</p><pre>from twilio.rest import TwilioRestClient<br>import requests<br>import time</pre><pre>ACCOUNT_SID = &#39;XXXXXXXXXXXXXXXXXXXXXX&#39; # Replace with your Twilio account sid<br>AUTH_TOKEN = &#39;XXXXXXXXXXXXXXXXXXXXXX&#39; # Replace with your Twilio auth token</pre><pre>client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)</pre><pre># JSON API URL for checking availability status<br>check_url = &quot;http://www.apple.com/shop/retail/pickup-message?parts.0=MN562LL%2FA&amp;location=94063&amp;little=true&amp;cppart=ATT%2FUS&quot;</pre><pre># Track the last pickup status so we know when it changes<br>lastPickupStatus = &quot;&quot;</pre><pre>while True:</pre><pre>  try:</pre><pre>    # Fetch data about pickup status<br>    body = requests.get(check_url)<br>    data = body.json()<br>    availableStores = []<br>    for store in data[&#39;body&#39;][&#39;stores&#39;]:<br>      status = store[&quot;partsAvailability&quot;][&quot;MN562LL/A&quot;][&quot;storePickupQuote&quot;]<br>      if status != &quot;Currently unavailable&quot;:<br>        availableStores.append({<br>          &quot;name&quot;: store[&quot;storeName&quot;],<br>          &quot;status&quot;: status<br>        })</pre><pre>    # If it&#39;s available, see if we need to send a text<br>    if len(availableStores) &gt; 0:<br>      pickupStatus = &quot;, &quot;.join([<br>        &quot;%s: %s&quot; % (<br>          store[&quot;name&quot;], store[&quot;status&quot;]<br>        ) for store in availableStores<br>      ])</pre><pre>      # if the pickup status has changed since we last sent a text,<br>      # send another text<br>      if pickupStatus != lastPickupStatus:<br>        lastPickupStatus = pickupStatus<br>        client.messages.create(<br>          to=&#39;+12345678910&#39;, # Replace with your phone number<br>          from_=&#39;+19876543210&#39;, # Replace with the number from Twilio<br>          body=&#39;iPhone 7 Plus Pickup Status: %s&#39; % pickupStatus<br>        )</pre><pre>  # Catch-all, mostly just in case we have a network error<br>  # This is sloppy but functional, remember?<br>  except Exception as e:<br>    print e</pre><pre>  # Only check once a minute<br>  time.sleep(60)</pre><p>I slapped this script up on server, set it running and then forgot about it for a few days. And then, about an hour ago, I got a text notifying me that iPhones were available for pickup.</p><p>Moral of the story: if you aren’t detailed-oriented enough to follow directions, at least be smart enough to get yourself out of your dumb mistakes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a348466f5502" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/how-i-fucked-up-my-iphone-preorder-and-programmed-my-way-out-of-it-a348466f5502">How I Fucked Up My iPhone Preorder and Programmed My Way Out Of It</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exciting company is looking for Full Stack mutants!]]></title>
            <link>https://medium.com/b-squared/exciting-company-is-looking-for-full-stack-mutants-43df592ee8a9?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/43df592ee8a9</guid>
            <category><![CDATA[comics]]></category>
            <category><![CDATA[movies]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:43:22 GMT</pubDate>
            <atom:updated>2016-11-01T16:43:21.808Z</atom:updated>
            <content:encoded><![CDATA[<p>I have heard many buzzwords for recruiting talented developers that tried to sex up the position. Ninja. Rockstar. Superstar. You get the idea. Even the term “full stack,” which seems more technical than all the others, has started to take on some sort of edginess. For some reason unbeknownst to me, recruiters feel it is necessary to act like programming is equivalent to playing to a packed house at Coachella or being an assassin.</p><p>Don’t get me wrong. I love software engineering and, at times, it can be very exciting. But, when it comes down to it, I spend roughly 8 hours a day hunched over a desk staring at a monitor, trying to figure out just the right thing to type to make the box in front of me do what I want.</p><p>Last year, however, I received what may be my absolute favorite recruiting email. It’s subject line was “Exciting company is looking for Full Stack mutants!”</p><p>The rest of the email read like a typical recruiting email. Exciting company. Seeking mutants with powers in Python and Javascript. Share with any other mutants you might know. If you have mutant powers yourself, apply!</p><p>I enjoy the <a href="http://en.wikipedia.org/wiki/X-Men">X-Men</a> casually. I’ve seen the movies and caught the occasional episode of the animated series as a kid. But, not being a die hard fan, it took me a few seconds to catch on to the fact that “mutant” was being used in positive way.</p><p>Introducing yourself to someone in a way that has a non-zero chance of coming off as negative is a bad choice. Software Engineers are working professionals and should be taken seriously if you are actually trying to recruit them. It would be unthinkable in any other industry to act this way towards potential employees.</p><p>After all, you wouldn’t try to hire a lawyer by alluding to <a href="http://en.wikipedia.org/wiki/Phoenix_Wright:_Ace_Attorney">Ph0enix Wright</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43df592ee8a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/exciting-company-is-looking-for-full-stack-mutants-43df592ee8a9">Exciting company is looking for Full Stack mutants!</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Post It Notes: The Best Software Project Organization]]></title>
            <link>https://medium.com/b-squared/post-it-notes-the-best-software-project-organization-4f2723dbbe7d?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/4f2723dbbe7d</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[project-management]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:42:56 GMT</pubDate>
            <atom:updated>2016-11-01T16:42:56.447Z</atom:updated>
            <content:encoded><![CDATA[<p>I have a really hard time using most task management and organization software. Jira is too complex for me. Trello requires you to put in a ton of work to develop a system to use it. Asana might be great for managing business-oriented work, but it just doesn’t seem to be that good for managing software development.</p><p>Maybe I just don’t get it or I’m out of touch, but I’ve yet to find anything that works better for me than post it notes.</p><p>Seriously. I manage tasks by keeping a huge number of post it notes stuck to my desk and my monitor. When I work with a team, I typically take tasks assigned to me on whatever lackluster team management solution we’re using and physically write them out. I can stare at everything I need to do. I can easily prioritize things by changing their physical order. When I’m done with a task, I get to actually tear the post it off my desk and throw it away. It’s a nice cathartic experience.</p><p>If I’m honest, Trello has definitely come the <em>closest</em> to being a good product. It is, in many ways, digital post its. It has cards that you can write on. You can organize the cards into lists. The lists can be grouped together into boards.</p><p>In my experience, however, Trello tends to fall apart when you have a single board being used to track tasks for more than two or three people. It just gets too cluttered. I also dislike the sheer amount of cruft that you can add to any single card. You can tag things, add attachments, add checklists (tasks within tasks), make comments, @ mention people and a whole slew of other things. It quickly can become a nightmare. You can try to develop processes on top of trello, but making a team actually use those processes correctly can be tough.</p><p>So, am I calling for another new task manager? Not in the slightest. There are too many of them as it is. I’m just saying that, if you really want to be effective at task management, consider post its. They’ve been around forever, they work great, and they’ll cost you less than the $10 bucks a seat you’re paying for your fancy task management software.</p><p><em>(Since keeping a stack of post its with you at all times is impractical and just ridiculous, I do, despite its shortcomings, begrudgingly recommend Trello.)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f2723dbbe7d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/post-it-notes-the-best-software-project-organization-4f2723dbbe7d">Post It Notes: The Best Software Project Organization</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zookeeper For Distributed Coordination]]></title>
            <link>https://medium.com/b-squared/zookeeper-for-distributed-coordination-2b7bdf4ab465?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/2b7bdf4ab465</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:42:31 GMT</pubDate>
            <atom:updated>2016-11-01T16:42:30.757Z</atom:updated>
            <content:encoded><![CDATA[<p>Building distributed systems is hard work. Consensus algorithms like <a href="https://en.wikipedia.org/wiki/Paxos_%28computer_science%29">Paxos</a> or the new hotness <a href="https://ramcloud.stanford.edu/wiki/download/attachments/11370504/raft.pdf">raft</a> can be tricky to understand and even trickier to implement. Distributed locking mechanisms can be shoehorned into Redis (see the “Locking” section in the <a href="http://redis.io/commands/setnx">SETNX command</a> docs) or <a href="http://bluxte.net/musings/2009/10/28/simple-distributed-lock-memcached">memcached</a>, but these solutions are hacks and not fault tolerant, making them less than ideal.</p><p>But there is a prebaked solution: Apache Zookeeper. If you’ve never directly used Zookeeper, there’s still a good chance that you have used it indirectly. It is integrated with systems like Hadoop, Akka, Kafka and <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/PoweredBy">many others</a>.</p><p>Zookeeper lets you store data in what it calls znodes. Znodes are named with filesystem-like paths, for example, /path/to/node. Znodes are set up in a tree structure. So /foo is the parent of /foo/bar. Unlike a typical filesystem, you can store data in both /foo and /foo/bar. Zookeeper is, in many ways, just a fault tolerant key value store.</p><p>However, zookeeper has a few things that make it unique.</p><ul><li>Zookeeper lets you set up ephemeral znodes, which are destroyed when the client that created them disconnects. This can be used for things like keeping a list of living servers.</li><li>Zookeeper lets you watch certain nodes and get updates when their value changes or when new children are added to them. This can be used for keeping track of living servers and discovering new servers as they become live.</li><li>Zookeeper lets you create nodes with a sequential suffix. This allows you to create queues in zookeeper or set up a chain of automatic failover.</li></ul><p>If you’re looking for a few examples of what you can do by leveraging these features, the official zookeeper docs have <a href="http://zookeeper.apache.org/doc/trunk/zookeeperTutorial.html">some good examples</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b7bdf4ab465" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/zookeeper-for-distributed-coordination-2b7bdf4ab465">Zookeeper For Distributed Coordination</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning a new programming language? You should build redis]]></title>
            <link>https://medium.com/b-squared/learning-a-new-programming-language-you-should-build-redis-c333af4a6330?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/c333af4a6330</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:41:58 GMT</pubDate>
            <atom:updated>2016-11-01T16:41:58.401Z</atom:updated>
            <content:encoded><![CDATA[<p>When I’m learning a new language, I’ll often start with a widely recognized guide (something like <a href="http://learnyouahaskell.com/">Learn You A Haskell</a>) and then, almost always, my next step is to go full steam and build a clone of <a href="http://redis.io/">redis</a>. My goal is to get a working datastore that speaks the redis protocol, saves to disk, and implements all of the basic data structures along with most of the operations you can perform on them.</p><p>I like this approach because it gives you a pretty cool end product (a fully functioning datastore) and also forces you to understand a great deal of concepts in a new language. To build redis, you need to be able to do a pretty wide number of things.</p><ul><li>Understand networking for accepting client connections.</li><li>Understand file operations (reading configs, backing up your data to disk)</li><li>Understand string parsing for interpreting the <a href="http://redis.io/topics/protocol">redis protocol</a>.</li><li>Understand builtin data structures in your new language (Lists, Sets, SortedSets, Hashes)</li><li>Understand concurrency (multiple clients, one underlying datastore)</li><li>Understand object serialization for writing objects to your backup file</li><li>Understand how to structure a project in your new language</li></ul><p>And that is, by no means, an exhaustive list. I like to see if can come up with a way to allow for pluggable data types for adding things like <a href="http://en.wikipedia.org/wiki/Trie">tries</a> that are outside the basic functionality of redis. You could also try implementing<a href="http://redis.io/topics/replication">replication</a> of some type or <a href="http://redis.io/topics/pubsub">pub/sub</a>. Redis is a pretty good base platform that allows you to do a whole lot of experimentation on top of it.</p><p>I’m not really sure this approach is for everyone. But if you, like me, are someone who learns best by doing, building redis can be a quick, directed way to get up to speed in a new programming language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c333af4a6330" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/learning-a-new-programming-language-you-should-build-redis-c333af4a6330">Learning a new programming language? You should build redis</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Replacing the Standard Library — Python Requests]]></title>
            <link>https://medium.com/b-squared/replacing-the-standard-library-python-requests-b19e3e2e325?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/b19e3e2e325</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:41:34 GMT</pubDate>
            <atom:updated>2016-11-01T16:41:34.307Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Sometimes, a language’s standard library is so poorly exposed, undocumented or outdated that it warrants using an external package to replace it.</em></p><p>In Python, making HTTP requests is shockingly cumbersome. A basic GET request is easy enough.</p><pre>import urllib2 response = urllib2.urlopen(&#39;http://example.org/&#39;) html = response.read()</pre><p>But once you start getting into more complicated things, you enter a world that grows increasingly more painful. For example, a post request looks like this.</p><pre>import urllib import urllib2 url = &#39;https://example.org/login&#39; values = {&#39;username&#39; : &#39;bbrunner&#39;, &#39;fullname&#39; : &#39;Brian Brunner&#39;, &#39;requests&#39; : True } data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) the_page = response.read()</pre><p>And if you need to get json back, that’s another import you need to remember. If you want to add in auth or coookies or read compressed data or do anything else that is totally fair game for interacting with HTTP services, urllib/urllib2 pretty much sucks. I’m not going to go into any more examples, because we’d be here all day trying to sort out issues.</p><p>For a modern language, Python is not the best at interacting with the web. Thankfully, there’s a solution that many of you probably know about.<a href="http://docs.python-requests.org/en/latest/">requests</a> is a Python package that, as the name suggests, makes it easy to write HTTP requests. The above examples become single lines of code, and many, many things that are a nightmare with the standard library are made easy.</p><p>A GET request with json</p><pre>jsonResponse = requests.get(&#39;https://example.org/api/json&#39;).json()</pre><p>A POST request</p><pre>data = {&#39;username&#39; : &#39;bbrunner&#39;, &#39;fullname&#39; : &#39;Brian Brunner&#39;, &#39;requests&#39; : True } jsonResponse = requests.post(&#39;https://example.org/api/post/json&#39;, data=data).json()</pre><p>For the sake of brevity, I’m going to stop there, but the <a href="http://docs.python-requests.org/en/latest/user/quickstart/">documentation</a> for requests is rather good, so I suggest you check it out.</p><p>So, in short, unless you have an abnormal, specific need to do so, don’t use urllib/urllib2. Just use requests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b19e3e2e325" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/replacing-the-standard-library-python-requests-b19e3e2e325">Replacing the Standard Library — Python Requests</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[For the Love of God, Ask FizzBuzz]]></title>
            <link>https://medium.com/b-squared/for-the-love-of-god-ask-fizzbuzz-bc2a6cbf39a1?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/bc2a6cbf39a1</guid>
            <category><![CDATA[hiring]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:41:06 GMT</pubDate>
            <atom:updated>2016-11-01T16:41:06.172Z</atom:updated>
            <content:encoded><![CDATA[<p>Software engineering interviews are a very open-ended art form. Every company puts their own particular spin on things so that they can figure out whether or not a candidate is both qualified and a good fit for their team. But there is one thing that I strongly believe every single company should do when interviewing: <strong>ask FizzBuzz.</strong></p><p>Just to be clear, I don’t literally mean that you should ask the specific <a href="http://en.wikipedia.org/wiki/Fizz_buzz#Other_uses">FizzBuzz problem</a>. You can ask any sort of basic, non-brain teaser problem you want.</p><ul><li>Count the number of words in a sentence that start and end with the same letter.</li><li>Print out every other odd number in a list.</li><li>Or, to blatantly steal a question that one of my coworkers likes to ask, print out the diagonals of a matrix.</li></ul><p>And so on. The point is to figure out whether or not someone can actually code.</p><p>Don’t give a candidate a day long programming assignment. Don’t try and bring them on as a contractor for a short stint. Don’t do a code review of a repo on their github. Don’t do much of anything, not until you’ve established that they can solve a trivial problem without any sort of fuss.</p><p>A good resume with a long list of well-known companies and a degree from a top-tier engineering school doesn’t guarantee anything. Even someone who sounds competent on a technical phone-screen might not be able to put down simple code. And to reiterate, I’m not talking about the brain-teaser type problems that pretty much everyone, <a href="http://www.theatlantic.com/business/archive/2013/06/google-finally-admits-that-its-infamous-brainteasers-were-completely-useless-for-hiring/277053/">including Google</a>, knows are useless. It should be something that you could write in under a few<br>minutes while you are hung-over on a Friday morning. Before your first cup of coffee.</p><p>This was all brought up last night when a friend of mine asked for advice on how to conduct a technical interview. I suggested a FizzBuzz type problem (among other things) and he was in a small state of disbelief that something so simple was a necessary question to ask. I reassured him that, yes, it was necessary, as I have seen people flounder on questions like these.</p><p>A solid answer to FizzBuzz is like a firm handshake when meeting your new boss or like opening the door for your date. It’s an introduction that sets a minimum bar and guarantees that neither the interviewer nor the candidate is wasting the other’s time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc2a6cbf39a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/for-the-love-of-god-ask-fizzbuzz-bc2a6cbf39a1">For the Love of God, Ask FizzBuzz</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paying Money To Save It And Doing More With Less]]></title>
            <link>https://medium.com/b-squared/paying-money-to-save-it-and-doing-more-with-less-a849aade97f1?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/a849aade97f1</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:40:35 GMT</pubDate>
            <atom:updated>2016-11-01T16:40:34.425Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, an email thread got started on the all-team mailing list at my office. Everyone in the company, devs and non-devs alike, was asked to take stock of all of the different SaaS products that they were using. When all was said and done, the list that we had compiled numbered around 40 different websites, most of which we pay some monthly fee for.</p><p>This was a little bit of a surprise for me, as we’re a team of less than 20. This means that we use twice as many SaaS products as we have people. If you want to unbundle all of the different services we use that fall under the umbrella of AWS, that number jumps from around 40 to more than 50. Basically, we leverage the crap out of other people’s software.</p><p>Incidentally, most of the software we pay for on the engineering side of things has open-source equivalents that we could run ourselves for free (besides hosting costs). We were recently looking to put together an automated testing setup for our frontend code, and one of our engineers offered to set up <a href="http://jenkins-ci.org/">Jenkins</a> to take care of it. It took all of a minute to decide on a managed, paid alternative instead. Because it was, without a doubt, much cheaper.</p><p>When it comes down to it, all employees, especially software engineers, are fucking expensive. In my experience, salaries are almost always the biggest expense for a technology startup. When you have the choice between having someone spend time setting up a piece of software or just paying a company to do it for you, you should almost always go for the outside solution. This is especially true when your organization is still small, as time spent managing a self-hosted solution would be better spent building out your core product. So, you know, you can actually make money.</p><p>Using outside software even when you could run something yourself is an idea that I’ve found comes naturally to those in more business oriented roles. Engineers are, however, notorious for reinventing things that there are already existing solutions for. I can’t count the number of times I’ve seen people reimplement software that they could just buy for cheap or use for free.</p><p>Quite possibly my favorite instance came from a friend who told me that a startup he had interviewed at had entirely reimplemented nodejs in house because they didn’t want to run software that was “not built here”. It’s not exactly the same as node is, by no means, a SaaS product, but the idea is the similar: stop wasting time on things that have already been done for you.</p><p>So, in short, leverage the crap out of SaaS, even if you could do it yourself. Good SaaS integration is like having extra employees that are way cheaper and don’t require things like insurance and time off.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a849aade97f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/paying-money-to-save-it-and-doing-more-with-less-a849aade97f1">Paying Money To Save It And Doing More With Less</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Science in Real Life: Namespacing]]></title>
            <link>https://medium.com/b-squared/computer-science-in-real-life-namespacing-4e9813eda044?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/4e9813eda044</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:39:44 GMT</pubDate>
            <atom:updated>2016-11-01T16:39:44.342Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>In computer science, namespacing is a solution to the problem of having too few good, sensible names.</em></blockquote><p>I spent this past weekend in Stowe, Vermont as an impostor in a room that didn’t belong to me. Well, technically, it didn’t belong to my fiance, so I guess she was the impostor.</p><p>We got to our hotel at around 11PM, too late for checking in at the front desk. We found what we thought were the keys to our room in an envelope sitting outside the front door. The envelope had my fiance’s last name, Lynch, on it. Upon opening the envelope and reading over the enclosed receipt, I realized that we had gotten keys not to our room, but to the room of one <em>Vicki</em> Lynch.</p><p>I’m not sure if Vicki checked in late too and grabbed our envelope by accident or if the front desk clerk had checked her into our room earlier in the day. Either way, someone had messed up. And really, this all could’ve been prevented with a little extra namespacing.</p><p>In computer science, namespacing is a solution to the problem of having too few good, sensible names. This results in multiple things ending up with the same name. A logical class name for an XML Parser might be Parser, but then what do we call an HTML parser? In Javascript, we might create two seperate objects for HTML and XML, and we might name them, oh, I don’t know, XML and HTML. We then might give those two objects a property that is a Parser class, like XML.Parser and HTML.Parser.</p><p>This might look something like</p><pre>var XML = { Parser : function(args) { // XML parsing code here } } var HTML = { Parser : function(args) { // HTML parsing code here } }</pre><p>Namespacing provides extra context in situations of ambiguity. Poor namespacing in computer science causes errors and makes life confusing. Poor namespacing in real life causes me to call the 800 number for my hotel and complain to an unhelpful phone agent in the middle of the night after traveling for six hours.</p><p>If the hotel would’ve added more context with a little extra namespacing, maybe by having their desk clerk check both the last and first names on the reservation or written the full name on the envelope with the key, I wouldn’t have been annoyed enough to write this half a week after the fact.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e9813eda044" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/computer-science-in-real-life-namespacing-4e9813eda044">Computer Science in Real Life: Namespacing</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forward Inbound Emails to your HTTP Server using Postfix]]></title>
            <link>https://medium.com/b-squared/forward-inbound-emails-to-your-http-server-using-postfix-ddba3eb24df8?source=rss----b851875ddc6f---4</link>
            <guid isPermaLink="false">https://medium.com/p/ddba3eb24df8</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[Brian Brunner]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 16:39:15 GMT</pubDate>
            <atom:updated>2016-11-01T16:39:15.072Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I’ve been building my own personal bookmarking service as a way to play around with AngularJS, RethinkDB and NodeJS. I’ve also felt that the services I was using to catalog my bookmarks were lacking, but that’s another story.</p><p>Anyway, something that I’ve been meaning to build is a feature that allows you to send bookmarks to the service via email, similar to what <a href="http://getpocket.com/">Pocket</a> does. You just send an email to add@getpocket.com, and Pocket will scrape out any urls present within the email and put them in your bookmarks. For me, it’s proved to be a convenient feature when I’m browsing on Mobile Safari, as it’s easy to directly share links from Safari via email.</p><p>So, in short, I’m setting out to add this functionality to my own bookmarking app. I plan on using Postfix to receive emails and send them over https to my internal API server.</p><h3>Step 1 — Setting Up Postfix</h3><p>A first requirement for this feature is that we’re going to need to be able receive emails. There’s tons of inbound email services that will do this part for you (<a href="http://www.mailgun.com/">mailgun</a> and <a href="http://mandrill.com/">mandrill</a> come to mind), but it’s not too complicated to setup a postfix server to do this on your own.</p><p>Use whatever flavor of package management software that your linux distro has to get postfix installed. For ubuntu, this would be something like</p><pre>sudo apt-get install postfix</pre><p>You’ll be guided through a small bit of setup. All you’ll really need to do is set your domain name correctly, since we won’t be using this server to send email.</p><h3>Step 2 — Setup Your DNS Records</h3><p>Next, you’ll need to setup your DNS records for receiving mail. You’ll need three records to receive an email:</p><ol><li>An A record that points to the IP of the server you’re going to be receiving emails on. Your A record should be for a subdomain like mail.example.com.</li><li>A PTR record, essentially a reverse DNS lookup, that points from the IP of the server to it’s domain name.</li><li>A Mail Exchange, or MX, record that lists your all of your mail servers along with their priorities. Since we only have one server in this case, you’re only going to have one entry. The format for this records is multiple lines that look like priority mail.example.com where priority is an integer. So something like 10 mail.example.com is a valid entry.</li></ol><p>You should be able to set these all up with whatever DNS service you currently use.</p><h3>Step 3 — Setup Your Email Aliases</h3><p>Now’s where we get to the fun part. We’re going to use an email alias that pipes emails over http to your API server using curl. First, we need to tell postfix to alias our emails. Open up /etc/postfix/main.cf in your editor of choice and add the following line</p><pre>virtual_alias_maps = hash:/etc/postfix/redirect</pre><p>Now, go ahead and open up /etc/postfix/redirect, the file that we just told postfix to look for alias mappings in, and type in the following</p><pre>user@exmaple.com curl_email</pre><p>Obviously, you need to replace user@example.com with the real address that you want to be receiving messages at. This tells postfix to redirect emails sent to user@example.com to the curl_email alias. You can even use regular expressions in the redirect file as the aliased address if you have multiple addresses or dynamically generated addresses that you want to receive mail on.</p><p>The last step is to actually create the curl_email alias. This alias will pipe the raw content of emails received by postfix to curl so that they can be sent to whatever service needs to process your emails next. Open up the file /etc/aliases and enter the following line</p><pre>curl_email: &quot;|curl --data-binary @- http://example.com/email_received&quot;</pre><p>This line pipes any received messages to STDIN, which we read into our post body in curl using the special notation @-. Using the — data-binary flag rather than the just the normal -d flag preserves the exact content of the email. You’ll need to replace <a href="http://example.com/email_received">http://example.com/email_received</a> with an actual url that handles post requests.</p><h3>Step 4 — Parse That Email!</h3><p>You should now be receiving emails at whatever URL you told curl to use. Actually parsing the emails received by your webserver is an exercise left to the reader, as you probably want to do something specific to your needs.</p><p>Just as an aside, if you’re using NodeJS, I’d recommend checking out the<a href="https://github.com/andris9/mailparser">mailparser</a> library by Andris Reinman. It’ll save you a ton of headache in extracting data from inbound messages.</p><p>And that is it. You now have a way to receive emails on your web server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddba3eb24df8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/b-squared/forward-inbound-emails-to-your-http-server-using-postfix-ddba3eb24df8">Forward Inbound Emails to your HTTP Server using Postfix</a> was originally published in <a href="https://medium.com/b-squared">bsquared</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>