<?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 Philip Brown on Medium]]></title>
        <description><![CDATA[Stories by Philip Brown on Medium]]></description>
        <link>https://medium.com/@philipdbrown?source=rss-4ea3b288a03a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sQyd7HeMqISY400JuZn5gg.jpeg</url>
            <title>Stories by Philip Brown on Medium</title>
            <link>https://medium.com/@philipdbrown?source=rss-4ea3b288a03a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 05:21:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@philipdbrown/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[Blank Page Syndrome : Can Docker Really Help Me? Up & Running with Docker]]></title>
            <link>https://philipdbrown.medium.com/blank-page-syndrome-can-docker-really-help-me-up-running-with-docker-b5f8c20f77b6?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5f8c20f77b6</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[docker-stack]]></category>
            <category><![CDATA[beginning-docker]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Fri, 05 Jul 2019 19:24:22 GMT</pubDate>
            <atom:updated>2019-07-05T19:31:52.778Z</atom:updated>
            <content:encoded><![CDATA[<h3>Blank Page Syndrome : Can Docker Really Help Me? Up &amp; Running with Docker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*b1gYCFQY8IbwysMKJ4-XsA.jpeg" /></figure><p>So there is this tool called Docker. First off, it is great, and totally worth the time to learn. My first question when I hear of a new tool is “Will it really help me?” Will it help me be more efficient, perform faster tasks, or help me be less stressed? Spoiler alert!! Docker answers all those in the affirmative. Ugh, where do I start. I’m glad you asked.</p><p>Docker is a huge ecosystem of networks, containers, Dockerfiles, stacks, services, swarms, and the list goes on. Here, we are going to focus on the blank page. Where can we get started with the most value?</p><h3>Installing Docker</h3><p>The first thing we need to do is install docker. Docker can be installed on Linux, Mac, or Windows, so don’t worry about your installation. However, just a side note. When you install on Mac or Windows, the installation uses a small Linux VM in the background, which does limit you to some functionality, but that is for a more advanced topic, and we are just getting up and running. Visit <a href="https://docs.docker.com/install/">https://docs.docker.com/install/</a> and choose your installation to get up and running.</p><p>Ok, now that Docker is installed, on to the fun parts. We will see how to start a container from the command line, a compose file, and setup for production. I’ve lately been using <a href="http://couchdb.apache.org/">CouchDB</a> to dump in JSON data to allow for querying. We will be working with the <a href="https://hub.docker.com/_/couchdb">official CouchDb Image</a> stored on DockerHub to perform our tasks below.</p><h3>Docker Container</h3><p>According to the <a href="https://www.docker.com/resources/what-container">official Docker website</a>, a container is the following:</p><blockquote>A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.</blockquote><p>In other words, a running instance of a Docker Image is a container and a Docker Image is a package that contains everything you need to run a specific task. If you are familiar with Object-Oriented Programming. Classes are to Images as Objects are to Containers.</p><p>So let’s look at how we would spin up an instance of our CouchDB container(instance) from the official CouchDB Image.</p><pre>docker container run -e COUCHDB_USER=cdbadmin -e COUCHDB_PASSWORD=mysupersecurepassword -v &quot;$(pwd)/data:/opt/couchdb/data&quot; -p 5984:5984 --name my-awesome-couchdb -d couchdb:2.3</pre><p>Holy Poop, Batman!! That is a crazy command. Yes, yes it is. However, there are a lot of cool things going on. Let’s break it down. Again, we aren’t getting too technical to get our blank page filled.</p><pre>docker container run<br>Ugh, we want to spin up a container.</pre><pre>-e ENVVAR=evnval<br>Set Environment Variables established by the Docker Image.</pre><pre>-v ./localpath:/path/in/the/container<br>Set Volumes for persistent storage.  Without them, the container will run, but all data will be lost once the container quits.<br>I have added the $(pwd) to the command to make sure we have an absolute path from inside the directory. This specific command creates a bind mount from the local path to the specific path in the container.</pre><pre>-p local_port:container_port<br>Map a container&#39;s port to a localhost&#39;s port.  Think of this like tunneling.  We will be able to access the container&#39;s 5984 port through the localhost&#39;s 5984 port.</pre><pre>--name<br>Give a helpful name to reference the container by later on.</pre><pre>-d<br>Start a container in detached mode.  In other words, run the container in the background.</pre><pre>couchdb:2.3<br>The name and version of the docker image.  In our case, the official on DockerHub.  Always version the images being used as a general rule. You will thank me later.</pre><p>Before running the command, I would suggest creating a folder somewhere on your system for testing. This will house our volume data as well. Later on, we can remove this folder for clean up.</p><pre>mkdir ~/docker<br>mkdir ~/docker/couchdb<br>cd ~/docker/couchdb</pre><p>Let’s run the `docker container run` command from above and check it out. By running the command we will have an instance of CouchDB running in a docker container accessible by localhost:5984. Give it a try and point your browser at <a href="http://localhost:5984/_utils">http://localhost:5984/_utils</a>. You will be given a login screen like the one below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*6bD7dFiBUQyJ42-DIw_YFQ.png" /></figure><p>Wow, you are up and running with CouchDb. Login and play around with your new CouchDb instance.</p><p>This is great for testing or trying out new tools. There is no need to spin up an entire server and configure to play around with something new.</p><p>Here are a few other docker container commands you will need to know.</p><pre># List all running containers<br>docker container ls</pre><pre># List all containers.  Running or Not<br>docker container ls -a</pre><pre># Stop a running container<br>docker container stop &lt;name or container id&gt;</pre><pre># Remove a stopped container<br>docker container rm &lt;name or container id&gt;</pre><p>Just a note. Since we are using volumes, specifically a bind mount, the data is still around after `docker container rm` is run. You can run the `docker container run` command and pickup where you left off with data ready to go. Pretty cool.</p><h3>Docker Compose (Development)</h3><p>Ok, if you are like me, there is no way on God’s green earth that I will remember or want to type in that command every time I need to run container or later on containers. So let me introduce `docker-compose`. This will need be installed separately from docker. Up to date installation information can be found here: <a href="https://docs.docker.com/compose/install/">https://docs.docker.com/compose/install/</a></p><p>Ok, docker-compose is installed. docker-compose uses a single yaml file for configuration. When you run the command, it will look for the default file docker-compose.yml in your current directory. Let’s create a docker-compose.yml file from the CouchDb command above.</p><pre>version: &#39;3&#39;</pre><pre>services:<br>  my-awesome-couchdb:<br>    image: couchdb:2.3<br>    volumes:<br>      - ./data:/opt/couchdb/data<br>    environment:<br>      COUCHDB_USER: cdbadmin<br>      COUCHDB_PASSWORD: mysupersecurepassword<br>    ports:<br>      - &quot;5984:5984&quot;</pre><p>Let’s break down the commands.</p><pre>version<br>The compose file format version. For now, let&#39;s stick with at least 3 or higher. For a breakdown, visit: <a href="https://docs.docker.com/compose/compose-file/compose-versioning/">https://docs.docker.com/compose/compose-file/compose-versioning/</a></pre><pre>services<br>You can think of services as containers in production.  Multiple services can be configured to work together via a docker-compose file.</pre><pre>my-awesome-couchdb<br>The name of our service/container.</pre><pre>image<br>The Docker Image we will be using from DockerHub including the version.  It is best to always version the image you will be using.</pre><pre>volumes<br>As in the command from the first section, the volume is a bind mount to house the persistent data.</pre><pre>environment<br>Any environment variables used by the image that need to be set.</pre><pre>ports<br>local_port:container_port as before.</pre><p>The command to start the CouchDb instance is now much easier. After saving your docker-compose.yml file, you only need to run the following command within the directory docker-compose.yml is saved:</p><pre>docker-compose up -d</pre><p>`-d` will run the service/container in detached mode, in the background. Go ahead and point your browser to <a href="http://localhost:5984/_utils">http://localhost:5984/_utils</a>. You will again see the login screen. If you changed any data previously, it will still be available because of our bind mount volume.</p><p>Note: docker-compose is not for production. This is a tool only intended to be used for development. This command is much easier to run than the `docker container run` command, and if you have multiple containers to run at the same time, this is a good place to document your command and run them all at the same time.</p><p>To stop your instance from running with docker-compose, run the following within the same directory as your docker-compose.yml file:</p><pre>docker-compose down</pre><h3>Docker Stack (Production)</h3><p>With a few changes to our docker-compose file, we can use it for both development and production. docker-compose will ignore production configurations and vice versa. Let’s modify our current docker-compose file for production:</p><pre>version: &#39;3.3&#39;</pre><pre>services:<br>  couchdb:<br>    image: couchdb:2.3<br>    volumes:<br>      - /absolute/path/data:/opt/couchdb/data<br>    environment:<br>      COUCHDB_USER: cdbadmin<br>      COUCHDB_PASSWORD: mysupersecurepassword<br>    ports:<br>      - &quot;5984:5984&quot;<br>    deploy:<br>      replicas: 1<br>      restart_policy:<br>        condition: on-failure</pre><p>With the additions to the file, we will not be using docker-compose to run our instances. docker-compose is only for development. In production, we should always use <a href="https://docs.docker.com/engine/swarm/">Docker Swarm</a> even if we are using a single server. We won’t go into details, because we just want to get started. To turn on Docker Swarm, run the following command:</p><pre># Show the Current Configuration of Docker<br># You should see: Swarm:inactive<br>docker system info</pre><pre># Activate Swarm<br>docker swarm init</pre><p>Now, you have a single node swarm configured.</p><p>Notice the absolute path to the bind mount volume. This is the best configuration to not have issues. The deploy additions configure the service to only be a single replica and restart on failure. That’s it. Now, our new command to run our configuration in production is:</p><pre>docker stack deploy -c &quot;$(pwd)/docker-compose.yml&quot; my-awesome-couchdb</pre><h3>Conclusion</h3><p>Your page is less blank, but never finished. Docker offers many more configurations and tools allowing you to configure any setup that your environment may need. I have only scratched the surface of this amazing tool myself. We are currently replacing our infrastructure with Docker giving us opportunities to move much quicker and safer. Check out <a href="https://www.docker.com/get-started">Docker’s Website</a>, <a href="https://hub.docker.com/">Docker Hub</a>, and great resources from <a href="https://www.bretfisher.com/docker/">Docker Captain Bret Fisher</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5f8c20f77b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blank Page Syndrome : Angular with Specific CLI]]></title>
            <link>https://philipdbrown.medium.com/https-medium-com-philipdbrown-blank-page-syndrome-angular-with-specific-cli-872395a8ae3?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/872395a8ae3</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[angular-cli]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Wed, 09 Jan 2019 17:09:43 GMT</pubDate>
            <atom:updated>2020-04-01T16:25:15.630Z</atom:updated>
            <content:encoded><![CDATA[<h3>Blank Page Syndrome : Angular with Specific CLI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*CQ5-DoxvQnPLWNrEnw_WZQ.png" /></figure><p>“All the horrors in the world can’t compare to the terrors of the blank page.”</p><p>So when I start a new project, I always have issues getting started. I know what needs to get accomplished, but configuring and setting up the right tools is always the hardest part.</p><p>This addition of the <strong>Blank Page Syndrome</strong> will get us started with an Angular project by setting up a specific Angular CLI version. This issue arose when dealing with multiple projects with different versions of Angular being used. Usually, we want to install the cli globally, but with multiple products with different versions, this isn’t the ideal situation.</p><p>First, we need to make sure that Node and NPM are installed. <a href="https://nodejs.org/en/">https://nodejs.org</a></p><p>After installed, I would suggest installing n globally to allow for the management of Node versions.</p><p>sudo npm install -g n</p><p>Now, if we need to change Node versions in the future, we can do so by using the command: sudo n &lt;version&gt; Example: sudo n 8.9.4</p><p>We can now set up a directory to house the version specific CLI. I’ll be using the latest version, but “latest” can be replaced with a specific version.</p><p>mkdir ~/ng-latest &amp;&amp; cd ~/ng-latest</p><p>Alright, let’s now install the version of the CLI that we need. Again, “latest” can also be replaced with a specific version.</p><p>npm init</p><p>npm install --save-dev @angular/cli@latest</p><p><strong>NOTE:</strong> I have chosen to scaffold the Angular app within the ~/ng-latest directory. With the following commands, you can generate the app anywhere you wish. If the app is generated within the ~/ng-latest directory, you do not have to use the complete path to ng . You only need to use ng . If the generated app is created outside of the ~/ng-latest directory, the complete path will need to be used. In this application, I will use the complete path to ng just for clarification.</p><p>Now we can scaffold the new Angular app with the installed cli version.</p><p>~/ng-latest/node_modules/.bin/ng new my-ng-latest-app</p><p>If we cd ~/ng-latest/my-ng-latest-app and run ng version , you will see the specified version. Happy Days!!</p><p>I hope this helps solve issues as it has for me. This will also allow us to test with specific or the latest version of the cli without having to install the cli globally.</p><p>As always, if you don’t mind, give a clap and recommend this article, share on Twitter or Facebook, or leave a comment. I would really appreciate it. Thanks in advance!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=872395a8ae3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shipping in a Free Shipping World [Our Free Shipping Psyche]]]></title>
            <link>https://philipdbrown.medium.com/shipping-in-a-free-shipping-world-our-free-shipping-psyche-b0a6714b89ed?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0a6714b89ed</guid>
            <category><![CDATA[shipping]]></category>
            <category><![CDATA[internet-retailer]]></category>
            <category><![CDATA[psychology]]></category>
            <category><![CDATA[free-shipping]]></category>
            <category><![CDATA[ecommerce]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Fri, 16 Mar 2018 14:59:28 GMT</pubDate>
            <atom:updated>2018-03-16T21:51:19.625Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*r_onr_ko3MRxAZx5TXNiVQ.png" /></figure><p>Logistics is expensive and difficult, but to many consumers, it is considered free and easy. The contiguous United States is approximately 3.1 million square miles, which is a lot of ground to cover to reach every American requiring labor, fuel, vehicles, maintenance, and administration of millions of packages per day.</p><p>Let’s take a step back and look at “Free Shipping” as an entity. Free shipping is more about psychology than actual costs to the consumer. Amazon offers free two day shipping on products purchased with Prime. In this case, the customer has paid $99 already for this option. I assume Amazon doesn’t care about the $99 but the value that it has psychologically impressed on its customers. The customer has valued the membership over the total purchase cost. Ebay as well has subsequently forced sellers to offer free shipping with their filtration. Customers have the option to filter search results by “Free Shipping” giving the sense of not paying extra. Are there really savings in choosing free shipping or has our free shipping psyche convinced us of the rewards?</p><p>Costs on logistics are on the rise and consumers require faster delivery. Orders that were expected to take a week to arrive a few years ago are now being demanded next day. On top of that, they still expect it to be free, so as eRetailers, what can we do? Can we reverse the psychological impact of “Free Shipping”? I believe some retailers are on the path of doing so with in-store pickup and discounting instead of adding shipping costs. There are still costs associated. So they are, in most cases, just masked into the cost of the product.</p><p>What else can be done? I would love to hear your thoughts and comments on shipping and its impact on your offerings.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0a6714b89ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disputes on Credit Cards for Ecommerce Businesses. What can be done?]]></title>
            <link>https://philipdbrown.medium.com/disputes-on-credit-cards-for-ecommerce-businesses-what-can-be-done-e3e908b4599?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3e908b4599</guid>
            <category><![CDATA[merchant-account]]></category>
            <category><![CDATA[credit-card-fraud]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[merchant-processing]]></category>
            <category><![CDATA[payments]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Wed, 05 Jul 2017 11:33:02 GMT</pubDate>
            <atom:updated>2017-07-05T11:33:02.060Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGL0mnxT5C6BwpFSlPVGTQ.jpeg" /></figure><p>I’ve been strictly in Ecommerce since 2012 selling hardware and building supplies online. Over the past five years, I haven’t seen any evidence that credit card companies are helping merchants fight losses due to credit card fraud. Out of all of the fraudulent disputes we have had, I’m not sure if we have won a single dispute, and the credit card companies are definitely not on the side of the merchant.</p><p>What security measures are in place? A cvc number and zip code? Really? That’s all? I can’t easily contact the owner based on a zip code. We require a full address and phone number. The address is verified as well, but I don’t have time to send the owner mail as a way of communication when we suspect fraud. What would be a verification means and quick communication channel? A simple phone number. The credit card companies already have this information on file. Why can’t this be another verification mechanism? With services like Twilio, we as developers could build simple communication verifications in instances where suspicious transactions are suspected due to verifications failures or internal alerts. This could be a simple and effective solution.</p><p>What are our some other alternatives? Changing an industry is difficult, but if the superpowers in credit offerings don’t want to play, what do you do? In most cases the superpowers in retail aren’t looking to disrupt either, but is it time to defer from the status quo and look for other alternatives. Can we gather enough to band together as merchants and start the cryptocurrency revolution or demand better validation mechanisms?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3e908b4599" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Where are we failing in preparing our children for the workforce?]]></title>
            <link>https://philipdbrown.medium.com/where-are-we-failing-in-preparing-our-children-for-the-workforce-7edffaa0f65a?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7edffaa0f65a</guid>
            <category><![CDATA[workforce]]></category>
            <category><![CDATA[parenting]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Wed, 18 Jan 2017 00:57:55 GMT</pubDate>
            <atom:updated>2017-01-18T01:19:25.078Z</atom:updated>
            <content:encoded><![CDATA[<h3>Where are we failing in preparing our children for the workforce? (Looking back to prepare for the future)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*xIH7c72cXS2y-RbudtEHZQ.jpeg" /></figure><p>As a parent, I want what is best for my son. That doesn’t necessarily mean that I want to make things easy for him. Often times, the moments in life when I have the most growth are during storms that stretch me to my limit. Are our roots deep enough to weather these storms? Often times, I use these experiences to grow deeper roots.</p><p>We’ve been deciding what schools would prepare our son mentally, socially, and physically for life. We have made our decision, and it has to do with a few factors. We want it to be great academically but also alleviate many of the social pressures that I experienced growing up. I spent six years in elementary school developing friends and finding where I fit in the ecosystem that we call school. After starting middle school, all of that development was lost, so I spent the next six years repeating the process. After finding true friends and what my niche was, I was a senior and had to do it all over again in college. I didn’t try as hard there. With the school that we have chosen for our son, he will begin with the peers that he will graduate with. This saves him from experiencing the need to reestablish himself for a second time as I did.</p><p>I want to take on the responsibility, which I should as his parent, to point him as a very precisely aimed arrow in the way he should go. Does that mean he doesn’t make decisions on his own? Absolutely not. I need to spend time with him, know him, know his strengths and weaknesses so he can utilize them to his advantage and reach the highest potential that God created him for.</p><p>In high school, for me, it was about sports, obtaining high marks, and one particular female. Getting good marks doesn’t translate into learning. I didn’t even think about the real world until after I had graduated. I’ve recently spoke with several college graduates that the education they obtained is not being used in their day-to-day job and debt from the investment is a real issue. I’ve even encountered those that complete degrees, enter the workforce, and realize that they hate the field they entered and want to traverse a totally different path.</p><p>Where are we failing in preparing our children for the workforce? After knowing our children and discovering strengths and weaknesses, we fail them in high school. High school should be, in my opinion, the discovery and preparation period before college or entering the workforce. What if our children spent time job shadowing, interning, or apprenticing? How would this affect their choices in their soon to be profession? Would they discover other options or professions that they could contribute to? It is a huge investment in the futures of our children that hopefully pays off equipping them to contribute to society by learning lessons earlier rather than later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7edffaa0f65a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitwise : Using numbers as switches for options and configs.]]></title>
            <link>https://philipdbrown.medium.com/bitwise-r-using-numbers-as-switches-330446c07043?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/330446c07043</guid>
            <category><![CDATA[bitwise]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bitwise-operator]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Fri, 13 Jan 2017 18:27:43 GMT</pubDate>
            <atom:updated>2017-03-10T14:20:28.116Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5qn0uiow8E6CSYG6x4zaQ.jpeg" /></figure><p>Here at SupplyHog.com, we have some interesting challenges to solve and try to do so in interesting ways. We already had a working system, but the building supply and hardware space can pose some challenges of their own. I decided to unearth the idea of using bitwise for our local shipping options. We already have options in place that I didn’t want to touch, so I decided to use <a href="https://en.wikipedia.org/wiki/Bitwise_operation">Bitwise</a> to solve this issue. If you are considering bitwise as a solution, I’m going to assume you know the difference in binary and decimal numbers. With binary numbers, you can consider each bit as a switch for your options.</p><p>I set a range between 128 and 255 for the different options. This would be 10000000–11111111 in binary. The 128 (decimal) bit will just indicate the beginning and ending of the range. There’s really no magic there. The other bits will indicate if the option is selected or not. When you think about it, it is a pretty simple concept. Let’s look at an example of this concept in setting crazy shipping options. Here are the available options for our example:</p><pre>Expedited Shipping : 10000001<br>Regular Truck : 10000001<br>Monster Truck : 10000100<br>U Carry : 10001000<br>Ninja’s Unload : 10010000<br>Include Lunch : 10100000<br>Fully Automated with Robots : 11000000</pre><p>This example is a bit out of the ordinary. Hey, that’s how I keep it interesting.</p><p>Let’s say that someone wanted the following options:</p><ul><li>Expedited Shipping</li><li>Delivered by Monster Truck</li><li>Unloaded by Ninja’s</li><li>Bring lunch as well</li></ul><p>With these selected, the binary would be:</p><pre>#FYI:Not_Actual_Code<br>Exp:MT:Ninj:Lun -&gt; 10110101.</pre><p>In decimal format, this number would be 181. We can save this configuration to our database as an integer. With me so far? How did we get this number? With bitwise operators. Most languages have operators to handle such things. [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators">JS</a>, <a href="http://php.net/manual/en/language.operators.bitwise.php">PHP</a>, <a href="https://ruby-doc.org/core-2.3.1/Fixnum.html">Ruby</a>] I will be writing this example in JavaScript and posting on <a href="http://codepen.io/philipdbrown/pen/PWzKpb">CodePen</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fcodepen.io%2Fphilipdbrown%2Fpen%2FPWzKpb&amp;src=https%3A%2F%2Fcodepen.io%2Fphilipdbrown%2Fembed%2Fpreview%2FPWzKpb%3Fheight%3D600%26amp%3Bslug-hash%3DPWzKpb%26amp%3Bdefault-tabs%3Djs%2Cresult%26amp%3Bhost%3Dhttp%253A%252F%252Fcodepen.io%26amp%3Bembed-version%3D2&amp;type=text%2Fhtml&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/c57c9aa2a93035c2ccd5b06cd6ab6ad8/href">https://medium.com/media/c57c9aa2a93035c2ccd5b06cd6ab6ad8/href</a></iframe><p>First, we will define our options. They will be the decimal form of the binary above.</p><pre>var expedited     = 129, // 10000001<br>    regularTruck  = 130, // 10000010<br>    monsterTruck  = 132, // 10000100<br>    uCarry        = 136, // 10001000<br>    ninjaUnload   = 144, // 10010000<br>    includeLunch  = 160, // 10100000<br>    fullyAutomate = 192; // 11000000</pre><p>Let’s say we have the following form in our HTML ( I know it is ugly, but there is a <a href="http://codepen.io/philipdbrown/pen/PWzKpb">CodePen</a>.):</p><pre>&lt;form id=&quot;bitwiseForm&quot; name=&quot;bitwiseForm&quot;&gt;<br> &lt;div class=&quot;radio&quot;&gt;<br>  &lt;label&gt;<br>   &lt;input checked name=&quot;expeditedOption&quot; type=&quot;radio&quot; value=&quot;0&quot;&gt; Nope<br>  &lt;/label&gt;&lt;br&gt;<br>  &lt;label&gt;<br>   &lt;input name=&quot;expeditedOption&quot; type=&quot;radio&quot; value=&quot;129&quot;&gt; Yes, time machine if you got it.<br>  &lt;/label&gt;<br> &lt;/div&gt;<br> &lt;div class=&quot;radio&quot;&gt;<br>  &lt;label&gt;<br>   &lt;input checked name=&quot;truckOption&quot; type=&quot;radio&quot; value=&quot;130&quot;&gt; Regular Truck<br>  &lt;/label&gt;&lt;br&gt;<br>  &lt;label&gt;<br>   &lt;input name=&quot;truckOption&quot; type=&quot;radio&quot; value=&quot;132&quot;&gt; Monster Truck<br>  &lt;/label&gt;<br> &lt;/div&gt;<br> &lt;div class=&quot;radio&quot;&gt;<br>  &lt;label&gt;<br>   &lt;input checked name=&quot;unloadOption&quot; type=&quot;radio&quot; value=&quot;136&quot;&gt; I&#39;m Strong. I&#39;ll Carry.<br>  &lt;/label&gt;&lt;br&gt;<br>  &lt;label&gt;<br>   &lt;input name=&quot;unloadOption&quot; type=&quot;radio&quot; value=&quot;144&quot;&gt; Ninja&#39;s, of course.<br>  &lt;/label&gt;<br> &lt;/div&gt;<br> &lt;div class=&quot;radio&quot;&gt;<br>  &lt;label&gt;<br>   &lt;input checked name=&quot;lunchOption&quot; type=&quot;radio&quot; value=&quot;0&quot;&gt; I&#39;m on a diet.<br>  &lt;/label&gt;&lt;br&gt;<br>  &lt;label&gt;<br>   &lt;input name=&quot;lunchOption&quot; type=&quot;radio&quot; value=&quot;160&quot;&gt; Absolutely!<br>  &lt;/label&gt;<br> &lt;/div&gt;<br> &lt;div class=&quot;radio&quot;&gt;<br>  &lt;label&gt;<br>   &lt;input checked name=&quot;automateOption&quot; type=&quot;radio&quot; value=&quot;0&quot;&gt; No, I like interacting with humans.<br>  &lt;/label&gt;&lt;br&gt;<br>  &lt;label&gt;<br>   &lt;input name=&quot;automateOption&quot; type=&quot;radio&quot; value=&quot;192&quot;&gt; Yes, how else would you do it?<br>  &lt;/label&gt;<br> &lt;/div&gt;<br> &lt;button class=&quot;btn btn-default&quot; type=&quot;submit&quot;&gt;Calculate&lt;/button&gt;<br>&lt;/form&gt;</pre><p>We will obtain the selections and use the OR (|) bitwise operator to essentially combine the selections down to a single number. The | operator will set the bit to 1 if it is set in at least one of the options.</p><pre>var selection = expeditedOption | truckOption | unloadOption | lunchOption | automateOption;</pre><pre>// Example: 10000001 | 10000010 | 10000100 would result in 10000111</pre><p>There is no need to convert to and from binary to use these operators, so we can now save the “selection” to our database or file to retrieve later AS AN INTEGER!!!</p><p>To obtain the individual selections back, we use the AND (&amp;) bitwise operator to test against the option. The &amp; operator will only set the outcome value’s bit to 1 if the corresponding bits are both 1. <strong>In our case, we have set the options to begin at 128 (10000000). Because of this, we need to subtract 128 from our selection before doing our AND operations. If we didn’t do this, we could not do the operation in a simple if statement.</strong></p><pre>selection -= 128;</pre><pre>if(selection &amp; ninjaUnload) {<br>  console.log(&quot;Ninja&#39;s were selected to unload the shipment.&quot;);<br>}</pre><pre>// Example: 0001111 &amp; 0001000 results in 0001000 which is not 0, so the option was selected.</pre><pre>// Example: 0001111 &amp; 0010000 results in 0000000 which is 0, so the option was NOT selected.</pre><p>That’s all there is to it in using numbers and bitwise operations to save configurations or option selections.</p><p>There are many other uses and operators for using bitwise as a solution. If you are using bitwise, please share your experiences, so we can all learn from each other.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=330446c07043" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oh, PostgreSQL. You surprise me everyday. [Geospatial Search]]]></title>
            <link>https://philipdbrown.medium.com/oh-postgresql-you-surprise-me-everyday-geospatial-search-49e63ea14a18?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/49e63ea14a18</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Tue, 29 Nov 2016 19:53:38 GMT</pubDate>
            <atom:updated>2019-02-06T16:55:20.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arzQpAhEQFRh4UiKnjWuuA.jpeg" /></figure><p>Here at <a href="https://www.supplyhog.com/">SupplyHog.com</a>, I’m always manipulating the experience to match the user. We have just rebooted our site solving problems we have had in the past. This includes product maintenance, partnerships, and offering different sets of products determined by the user’s shipment location. We have done this in the past with great success. The reboot is a little different. The tech that we have available to us now is great and ever improving. I’ve used MySQL as my go-to for many years. In 2015, we decided to move to Postgres mainly for its JSON support. We were already using JSON in our previous stack, but Postgres had some great tools built in. This brings us to today. There is Geospatial support as well. Things I used to do manually. Oh, Postgres. You surprise me everyday. So here is a little taste of what I’m discovering.</p><p>To get started, you need the <a href="https://www.postgresql.org/docs/current/static/cube.html"><strong><em>cube</em></strong></a> and <a href="https://www.postgresql.org/docs/current/static/earthdistance.html"><strong><em>earthdistance</em></strong></a> extensions. First, let’s see if we already have these installed. Do the following to list all of your available extensions:</p><pre>SELECT * FROM pg_available_extensions ORDER BY &quot;name&quot;</pre><p>If the extensions are not found, do the following:</p><pre>CREATE EXTENSION cube;<br>CREATE EXTENSION earthdistance;</pre><p>We need to add some data. Let’s just add some simple locations.</p><pre>-- Create Location Table<br>CREATE TABLE location (<br>    id serial PRIMARY KEY,<br>    name varchar(50) NOT NULL,<br>    longitude double precision NOT NULL,<br>    latitude double precision NOT NULL<br>);</pre><pre>-- Insert Us Some Data (Sites around #CHA)<br>INSERT INTO location(name, latitude, longitude)<br>VALUES (&#39;SupplyHog HQ&#39;, 35.0472780, -85.3071590)<br>,(&#39;Chickamauga Dam&#39;, 35.0975557,-85.2197027)<br>,(&#39;Five Points Mtn Biking&#39;, 34.851249, -85.423983)<br>,(&#39;Harrison Bay State Park&#39;, 35.179631, -85.114359)<br>,(&#39;Mojo Burrito&#39;, 35.0094040,-85.3275640)<br>,(&#39;Rock Creek&#39;, 35.0556150,-85.2803290);</pre><p>Alright, we’ve got our extensions and our data. Now, the magic of geospatial search can be performed.</p><p>So let’s say we are have a current location of:</p><pre>35.0609500, -85.3078294</pre><p>We want to determine which locations are less than 10 miles of our current location. We will also order by distance, so here we go. Note that distance will be in miles.</p><pre>-- When creating points, it is point(long, lat).<br>SELECT *, point(-85.3078294, 35.0609500) &lt;@&gt; point(longitude, latitude)::point as distance <br>FROM location<br>WHERE (point(-85.3078294, 35.0609500) &lt;@&gt; point(longitude, latitude)) &lt; 10<br>ORDER BY distance;</pre><p>You can now easily base queries on geolocations. Pretty cool.</p><p>If you don’t mind, give a clap and recommend this article, share on Twitter or Facebook, or leave a comment. I would really appreciate it. Thanks in advance!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49e63ea14a18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mountain Biking and Startups]]></title>
            <link>https://philipdbrown.medium.com/mountain-biking-and-startups-7818b24dbfbb?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7818b24dbfbb</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[mountain-biking]]></category>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Mon, 21 Sep 2015 18:47:31 GMT</pubDate>
            <atom:updated>2015-09-21T22:41:38.871Z</atom:updated>
            <content:encoded><![CDATA[<p>I took my first mountain biking trip last week to Mulberry Gap in Ellijay, Georgia and tackled 10 miles of the 90 mile Pinhoti Trail. The first ride included some awesome downhill runs with jumps and switchbacks and</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*qXdsb-jqKjEZo4E3bwDs0A.jpeg" /><figcaption>Pinhoti Trail</figcaption></figure><p>manageable uphill climbs. I’m not one to get excited, but that was really fun. Scary at times but fun. After making it through half the trail on the first day, I realized something. This experience was just like running a startup. First, you either take it upon yourself or get talked into something that seems near impossible. I’m really going to start this? You are a little apprehensive and would rather be in the air conditioning of your Toyota. You begin what seems like an impossible climb up a very rough hill. Once you come to the first pinnacle of, what feels like, the top, you take a second to enjoy the view. Man, what an accomplishment. You start down the other side, experience the adrenaline, the jumps, the awesome turns. Then all of a sudden, holy crap another hill! Where did that come from! I thought I was already at the top. I thought the climbing was over. You climb more, fight the urge to quit, and take one-to-the-hand by an angry investor, I mean yellow jacket. You keep going. Again, everything is great. You are dodging trees, jumping roots, fishtailing switchbacks like a pro. Then, again, another freaking hill! When does it end? You contemplate going down the side of the mountain because it seems quicker, but it would ultimately be your demise. You conquer the hill and are off again. This time, it is much steeper, more roots, and smaller runway, I mean path. You are going so fast that you don’t realize you are at the bottom. A minute is taken to catch a breather and to regroup. You now have the wide path of the main road. Although not paved, it is more manageable than the mountain but just as hard. This path, though, never ends.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7818b24dbfbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Onboarding Engineers]]></title>
            <link>https://philipdbrown.medium.com/onboarding-engineers-82f3004e565f?source=rss-4ea3b288a03a------2</link>
            <guid isPermaLink="false">https://medium.com/p/82f3004e565f</guid>
            <dc:creator><![CDATA[Philip Brown]]></dc:creator>
            <pubDate>Tue, 14 Oct 2014 21:13:59 GMT</pubDate>
            <atom:updated>2017-09-26T17:16:21.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxz5I-cX3uOEJuXzjLZK9Q.jpeg" /></figure><p>Here at SupplyHog, I have made mistakes. Mistakes turn into failures only when learning and change doesn’t occur. I recently had a conversation with an investor about onboarding engineers. The fact is unicorns don’t exist, for the most part, and it is very difficult to have a new engineer “hit the ground running.” How do we allow for this transition to be as smooth as possible? Having a clear onboarding process will create a better experience for everyone. In the past, I’ve experienced sink or swim situations as a new developer on a team. It’s scary. It makes you rethink your decision to join the organization, and you become less productive for a longer period of time. After much learning and changing, we have devised a system for onboarding engineers, and it goes a little something like this:</p><p><strong>1. It is important to have the engineer’s development environment set up. Of course, he or she is free to customize, but you want them coding something on the first day.<br>2. Share company history, culture, and other information with them before they arrive. This prevents any surprises on the first day or wasted time filling out needed forms.<br>3. Before the engineer arrives, have a coding-mentor assigned to them. This mentor will work directly with the new engineer and be his or her contact until the engineer is comfortable being a mentor themselves.<br>4. Have a team lunch on the first day. This creates a relaxed environment to chat and get to know each other. Heck, we will be spending lots of time together, so we need to get to know one another. And we like food.</strong></p><p>We don’t want the engineer spending days setting up his or her development environment. We have machine images that we clone with the necessary setup to begin coding right away. In the past, this has been a huge blocking agent for new hires.</p><p>Coding-mentors are a must. As an engineer, I know that most of us have the mentality that we can figure it out on our own, without help. We also don’t want to be a nuisance to anyone, and we always want to be valuable and contributing. By having a dedicated member of the team assigned beforehand, contact can be made with new member prior to arrival. This results in the new engineer feeling more comfortable asking questions and spending less time figuring things out during the first several weeks. The two work one-on-one pair programming together as well, all of which acts as a catalyst for obtaining knowledge of the code base and contributing to the project. Also, we make sure that the new engineer commits something on the first day. This will boost the engineer’s confidence, making his or her transition much easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rm3C_QThMvyzCI5t1MnxSA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SuA6zZj4Ok7bYil77rpxYA.jpeg" /><figcaption>2014 Hackathon</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82f3004e565f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>