<?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 Kenneth Ahlstrom on Medium]]></title>
        <description><![CDATA[Stories by Kenneth Ahlstrom on Medium]]></description>
        <link>https://medium.com/@kenahlstrom?source=rss-676efabe4b1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iXn-hCLmd1C5l_Oc.jpeg</url>
            <title>Stories by Kenneth Ahlstrom on Medium</title>
            <link>https://medium.com/@kenahlstrom?source=rss-676efabe4b1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 10:52:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kenahlstrom/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[There are only two futures]]></title>
            <link>https://medium.com/@kenahlstrom/there-are-only-two-futures-efe2437af21a?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/efe2437af21a</guid>
            <category><![CDATA[authoritarian]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[cbdc]]></category>
            <category><![CDATA[control]]></category>
            <category><![CDATA[decentralization]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Wed, 13 Oct 2021 13:40:56 GMT</pubDate>
            <atom:updated>2021-10-13T21:56:50.544Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*PozldPdp-0JY3DNZQzJGxA.png" /></figure><p><strong>January 3rd, 2009:</strong> The world changed forever. As it is with most earth-shattering events, this one did not even register in the consciousness of most people on the planet. But it changed the world nonetheless.</p><p><strong>January 23rd, 2020:</strong> The world changed forever again. This event was more widely noticed, though at the time most of the world still thought that it would not be affected.</p><p>January 23rd, 2020 was the first day of the first lockdown for SARS-CoV-2 — in Hubei Province, China. March, 2020 would then see Italy, New York, New Jersey, and others institute their own lockdowns.</p><p>January 3rd, 2009 was the day Bitcoin was released to the public. Famously, in May 2010, Laszlo Hanyecz paid 10,000 BTC (Bitcoins) for 2 two large pizzas. Currently, (Tuesday, October 12, 2021), 1 BTC is worth $56,239.50 and, in addition to being supported on many payment platforms, is officially accepted as legal tender in the country of El Salvador.</p><p>Two world-changing events, almost exactly 11 years apart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZoHSoUsc_nfaoxACEv0lvQ.jpeg" /><figcaption>If you bought 2 pizzas for 10,000 BTC today, it would be a $562,395,000 transaction.</figcaption></figure><p><strong>Centralized Control vs Decentralized Autonomy</strong></p><p>Each of the two events above are undeniable catalysts on opposite sides of a conflict nearly as old as humanity itself — the conflict between authority and autonomy, between control and freedom.</p><p>Through COVID measures like lockdowns, mask mandates, and vaccine requirements, we have all been asked to sacrifice our own individual freedoms to central authorities in order to gain collective safety.</p><p>Through a decentralized, trust-less, network, Bitcoin and other crypto projects aim to grant individuals financial autonomy through removing the need for centralized banks or monetary policies.</p><p>The future allows for only one outcome — one in which we either embrace the all-controlling central authority or embrace the democratization of decentralized autonomy. We face this choice now because technology has reached a level at which total control is not only possible, but easily implemented.</p><p><strong>Blockchain is the Catalyst</strong></p><p>Don’t worry, this bit is fast and avoids complexity.</p><p>When the World Wide Web was launched, it brought us what can be thought of as <em>“the internet of information”</em>. We are able to share, search for, and find information on any subject we desire. We have even hijacked the web to allow for payments through the sharing of credit card information. However, payment does not actually occur <em>on</em> the internet — only information about a payment is sent. Actual payment is made through banks recording that information onto their ledgers.</p><p>A blockchain network brings us what can be thought of as <em>“the internet of value”</em>. It basically consists of a number of uniquely identified ‘coins’ or ‘tokens’ that cannot be duplicated and are able to actually change hands between owners through the internet. It is as if you literally took a physical dollar bill and passed it through your screen to another person at the other end. There is no need to send information to a bank. The actual value — actual money — was sent, not just information about it.</p><p>There are a lot of intricacies and complications to how it all works that we won’t get into here, but it does work — and very well. The important thing here is that any given token on a blockchain is verifiably unique, secure, and able to change ownership through direct transactions via the internet.</p><p><strong>Centralized Finance — CeFi</strong></p><p>With the total market cap of Bitcoin at more than $1 trillion dollars and the country of El Salvador now accepting it as official currency, the centralized powers that have traditionally controlled our money supply have taken notice. There has been a general acceptance that blockchain technology is the future, but these powers wish to push a “centralized” version of blockchain — Centralized Finance, or CeFi. After all, what would the U.S. Congress do if they couldn’t just demand that the Treasury print another trillion dollars every few years in order to cover expenses? The result has been an explosion of effort toward the creation of CBDCs — Central Bank Digital Currencies. China has already released theirs. Nigeria will release one soon. The USA is among a host of western countries researching their own.</p><p>The initial reaction of most people to such news might be positive. After all, it’s great to have our money supply keep up with the times. But that’s where things get back to centralized control vs decentralized autonomy.</p><p>A CBDC would enable the controlling entity (usually, a government) to track each and every single transaction you make and meaningfully tie that to your identity. But it would do more than that. For example:</p><ul><li>An anti-smoking measure might restrict any person from buying more than 3 packs of cigarettes in a week.</li><li>An outspoken activist might have their funds completely frozen (or simply confiscated) in an instant.</li><li>A government trying to stimulate a slow economy might institute a negative interest rate, gradually draining your wallet of funds over time in an effort to get you to spend them before you lose them.</li><li>Redistributive policies might be implemented, with those considered to have a wealth of ‘privilege’ having all incomes algorithmically reduced and partially given to those who are under-privileged.</li></ul><p>In a future of CBDCs, the following scenario is not only realistic, but probable:</p><blockquote>Recently, you’ve been feeling rather sluggish. Further, your feet have become somewhat dry and itchy and have even started to ‘fall asleep’ occasionally. You visit the doctor and after a check-up, you are diagnosed as pre-diabetic. The doctor tells you to lay off the sugars and get some exercise or it’ll get worse.</blockquote><blockquote>Feeling a bit chastised, but resolved to make things better, you leave the doctor and head to the supermarket. Meanwhile, your doctor makes a few notes on your medical record, which is a secure record attached to your blockchain identity. Through a smart-contract, your insurance company is automatically billed for the visit and the doctor is paid instantly.</blockquote><blockquote>While at the supermarket, you load up with healthy foods but, as the contents of the cart look increasingly depressing, you add a box of cookies as a “last hurrah” before you dive entirely into healthy eating for the rest of the week.</blockquote><blockquote>At the register, when you check out, each item you buy is recorded to the blockchain and the appropriate amount of CBDC is debited from your account. When you run the cookies, however, they flag against your newly reported medical condition. You’re not restricted from buying them, nor are you even notified of the flag, but:</blockquote><blockquote>Your insurance company is notified that you’ve just made a lifestyle choice contrary to your medical condition. As this action is your ‘fault’, your insurance premium has just increased.</blockquote><blockquote>Your social credit score in the areas of ‘discipline’ and ‘compliance’ is reduced, as you caved and bought a sugary treat after being diagnosed. You have just reduced your chances of getting a low-interest loan, a well-paying job, acceptance of your application for rental at an apartment complex, and more.</blockquote><p>If you don’t think that the above scenarios are in a CBDC future, you’re in for a surprise. I’ve only outlined the <em>positive</em> version of this story. CBDCs will open society to a level of monitoring and control that is scarily dystopian.</p><p><strong>Decentralized Finance — DeFi</strong></p><p>In a decentralized world, a world in which Bitcoin and Ethereum and all manner of other decentralized blockchain systems are allowed to exist, autonomy reigns supreme. You can buy those cookies (and hurt yourself) if you want to, and you choose whether or not to share your purchase information with your insurance company (they’ll likely incentivize you to do so, but you can say no).</p><p>Because there is no central authority that controls the currency, the rules of that currency would be stable, predictable, and unchanging. Yes, the government can still require you to pay taxes, but they cannot just go and print more money for themselves on a whim. As for banks? Well, as entities that store your money or grant loans to individuals, they would simply cease to exist. All of that would be managed by smart-contracts and blockchain governance policies. Your qualification for a loan would be entirely objective and based on immutable (unchangeable) code incapable of bias or prejudice.</p><p>Are there ways for an intrusive government to try to control and regulate DeFi? Yes, there are. There are also already chains and tokens built specifically to solve such problems. In any case, you would still be much more autonomous than you would be with a CBDC.</p><p>Does granting people autonomy result in increased chaos, the self-selecting of bad results, and more criminal activity? Yes, it does. That is the price of autonomy. You can sacrifice your freedom for total order and safety, or you can sacrifice order and safety for your freedom.</p><p>People who are free self-report higher levels of both health and happiness than those who are not.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efe2437af21a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding WebApps on an iPad in 2019]]></title>
            <link>https://medium.com/@kenahlstrom/coding-webapps-on-an-ipad-in-2019-3b9fec34be63?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b9fec34be63</guid>
            <category><![CDATA[digital-nomads]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ipad-pro]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Mon, 20 May 2019 08:52:18 GMT</pubDate>
            <atom:updated>2019-05-20T08:52:18.437Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Vll645h-tKpaf6YQ89M9g@2x.jpeg" /></figure><p>It’s been 9 years (yes, 9) since the first Apple iPad was released to the public. While tablets existed before that moment in 2010, it can safely be said that they did not truly enter the mainstream until Apple released their own. In the time since, tablets have had their ups and downs and have not quite taken over the world as predicted. Eventually, the Microsoft Surface found the right niche to play in and Apple has (sort of) followed suite with the iPad Pro.</p><p>So, can an iPad Pro replace your laptop? If you aren’t a software engineer or a hardcore gamer, it absolutely can and probably should. But I write code for a living, so my needs go a little bit beyond what the iPad Pro is naturally setup to do well. Still, it appears that it is possible (though maybe not optimal) to replace your laptop computer with an iPad even if you’re a software engineer.</p><p><strong>But … why?</strong></p><p>Before we get into how to setup an iPad Pro for coding, it might be worthwhile to quickly review why we would even want to do so. Our goal is to work with the right tool-for-the-job, and often that tool — even in 2019 — is still a laptop. If any of the reasons listed below do not apply to you, then do not use an iPad for coding and stick with your laptop:</p><ul><li>You also do a lot of design work / mock-ups / diagraming / sketching and appreciate the iPad’s stylus and free form drawing capabilities</li><li>You absolutely need a lightweight, compact, device (likely due to frequent travel. The iPad is great for those cramped airline seats that cannot fit laptops).</li><li>You spend a lot of time presenting or pitching to clients and the iPad’s form-factor and touch-interface make for great interactive table conversations</li><li>You’d use a laptop, but all you have is an iPad (budget constraints — the iPad, with needed apps, is ~$400 cheaper than a MacBook Pro)</li><li>You have an intense desire to be an early adopter and move away from the laptop and onto the iPad because “it’s the future”</li></ul><p><strong>Requirements</strong></p><p>If at least one of the five reasons listed above applies to you, it’s time to list our requirements. What do we need in order to get our iPad up and running as a coding machine?</p><ul><li>An interface for pulling, branching, committing, merging, and pushing code to and from a repository (likely GitHub)</li><li>An interface for actually writing code</li><li>A command line tool for interfacing with our remote server</li><li>A browser with console and dev tools for testing our WebApp</li><li>An interface for interacting directly with our database</li></ul><p><strong>Step 1: Lower Expectations</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FatfDg4fLcks%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DatfDg4fLcks&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FatfDg4fLcks%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/100b100043f4e66de91f31345bc4b413/href">https://medium.com/media/100b100043f4e66de91f31345bc4b413/href</a></iframe><p>The iPad Pro suffers from one fatal flaw that makes development somewhat difficult — it does not give direct access to file management. That means no command line git clone or npm install or even running of a local server. However, there are work-arounds. So … keep your expectations realistic and you won’t be disappointed.</p><p><strong>Step 2: Try to Cheat</strong></p><p>When I first decided to try coding on an iPad, I decided to cheat and not really use my iPad. What do I mean? I mean that I purchased ($19.99) and downloaded the <a href="https://itunes.apple.com/us/app/screens/id655890150?mt=8">Screens App</a>, which allows me to remotely login to my desktop computer and screen share. With an additional InApp purchase of $2.99, I was even able to change my iPhone into a touchpad mouse for the App.</p><p>The idea was that, given a good enough internet connection, I could simply login to my desktop and code with the full capabilities of an actual computer. The caveat there is <em>good enough internet connection</em>. Let me tell you about how wonderful hotel internet connections are …</p><p>After about 20–30 minutes of struggling with some pretty heavy latency during my first actually-remote Screens session, it became obvious that another solution would be needed. Still, Screens is a high-quality, well-functioning, app and has been integrated into my final development process as you will see below.</p><p><strong>Step 3: Working Copy</strong></p><p>Every single person who ever plans to do any coding on an iPad should get <a href="https://itunes.apple.com/us/app/working-copy/id896694807?mt=8">Working Copy</a>. It’s a free download, but requires a $16.00 purchase to unlock multi-file pushing to your repo. Pay the $16.00. It also helps support further development of the already great App.</p><p>Working Copy is your file manager. It integrates beautifully with GitHub (even syncs an SSH key pair for secure auth with minimal effort) and can be used to clone, fetch, pull, push, commit, merge, revert, create new branches, etc. What’s more, it can share files with your IDE through something called a WebDAV Server. Don’t worry, you don’t have to know anything about it, only how to turn it on (in settings) so that you can share files between your Apps.</p><p><strong>Step 4: Coda</strong></p><p>There are a few IDEs available for iPad, including Textastic and Pythonista (if you’re writing Python, definitely go with <a href="https://itunes.apple.com/us/app/pythonista-3/id1085978097?mt=8">Pythonista</a>), but I went with <a href="https://itunes.apple.com/us/app/coda-by-panic/id500906297?mt=8">Coda by Panic</a> (currently, the AppStore also has a promoted app called simply ‘Coda’ that is not what you’re looking for … be sure that you are looking at Coda by Panic). It’s $25, but it’s also a great editor.</p><p>The most important thing here is that Coda supports WebDAV (if you choose another editor, make sure that editor also supports WebDAV), which means that we can directly link up with Working Copy and share files between the two Apps. The only downside is that, in order to keep the WebDAV server running, Working Copy must be actively running in your primary window. This challenge is solved using split-screen, as seen below, with Working Copy on the left and Coda on the right (yes, that is an actual screenshot of my iPad on an actual project I’m working on):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTl-X8WsrHCa6juayCUzcA@2x.jpeg" /></figure><p><strong>Step 5: Blink Shell</strong></p><p>Coda actually comes with a built-in SSH Terminal based on one of Panic’s other products (Prompt). However, neither Coda nor Prompt support <a href="https://mosh.org/">Mosh</a>, which allows for persistent SSH connections even with the type of intermittency experienced by mobile devices. <a href="https://itunes.apple.com/us/app/blink-shell-mosh-ssh-client/id1156707581?mt=8">Blink Shell</a> ($20) does support Mosh. Which means that once you create an SSH connection to your server … it’s good forever. Seriously. Forever. Further, it’s really fast, really sleek, and — because it is a full-screen terminal — you can easily pop open the App if you want to make everyone around you at the cafe in Paris think you’re HackerMan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*k6k0ZPXdHx8YEUWu169oTA@2x.jpeg" /></figure><p>For an even more authentic HackerMan experience, you can use Blink to code directly on your remote server in VIM. Blink will even provide you with an Esc key (note that the iPad and iPad keyboard do not have Esc keys) so you can actually :wq your files.</p><p><strong>Step 6: Database</strong></p><p>A lot of coders are using ‘database-as-a-service’ setups, which means that your needed interface goes with you in the browser. For people with these types of setup, nothing is needed in this phase. I happen to have a self-hosted MariaDB server, so I installed a free app called <a href="https://itunes.apple.com/us/app/mysql-client-by-sqlpro/id1270754173?mt=8">SQLPro MySQL</a>. So far, it’s been quite easy to use and I have been able to accomplish everything I’ve required. The same developer offers a version for <a href="/service/poshttps://itunes.apple.com/us/app/postgres-client-by-sqlpro/id1273366655?mt=8">Postgres</a> and a <a href="https://itunes.apple.com/us/app-bundle/sqlpro-bundle/id1439817598?mt=8">bundle of their various SQL Apps</a>.</p><p><strong>Step 7: Dash</strong></p><p>This step is a bit of a bonus-step, but it’s also one that creates a lot of convenience. <a href="https://itunes.apple.com/us/app/dash-offline-api-docs/id1239167694?mt=8">Dash</a> is a free App that allows you to view coding docs offline. So, next time you’re in the middle of a 5 hour flight and forget exactly what eventListeners are available in JavaScript you can just pop open Dash and look it up. No internet required. It’s a must-have.</p><p><strong>Step 8: Putting Everything Together</strong></p><p>Our iPad now has Working Copy ($16), Coda by Panic ($25), Blink Shell ($20), Screens ($20 + $3 for iPhone trackpad add-on), SQLPro MySQL, and Dash. Our total price is $84, which is not bad. Certainly cheaper than solving the problem through buying a laptop.</p><p>To get started, open up Working Copy, clone the repo you want to be working on, and create your working branch. Open settings and start your WebDAV Server … then, pull Coda up onto the screen and split-screen between Working Copy and Coda. You can minimize the size of Working Copy in the split-screen setup, it just needs to be there in order to keep WebDAV actively running.</p><p>Code all you want. Anytime you want to commit, push, or pull, Working Copy has you covered at a touch. It’s the first Git UI I’ve actually liked more than the command line. If you need a code reference, pull up Dash. And when it’s time to push things to the server, you can fire up Blink and do whatever you need with your persistent Mosh connection.</p><p>There’s just one problem — you still can’t run a local server for testing and you can’t npm install packages. For some, that means spinning up a development server with a provider like Digital Ocean and coding direct on the server. That solves having a server and being able to install packages, but it doesn’t fully solve testing. IPad browsers do not have dev tools available. No console, no network, no inspect. It makes bug-finding and feature testing a chore.</p><p><strong>Step 9: Screens to the Rescue</strong></p><p>Screens failed as my go-to answer for coding, but it has worked for testing. I’ll write my code in Coda, push it to GitHub with Working Copy, and then go into Screens where I git pull onto my Remote Desktop and run my local server. I can now reference a browser with full dev tools and do quick edits in my code for bug-fixing. Then I push the result back up to GitHub, get into Blink, and deploy my code. While Screens would get quite frustrating if I had to use it 24/7, it’s been great for treating my desktop as something like a testing and tweaking environment. And who knows, maybe someday latency will be low enough to make Screens fully viable as an entire coding solution.</p><p><strong>Conclusions</strong></p><p>It is certainly possible to code, and code effectively, on an iPad in 2019. However, some creativity is needed once it’s time to run and your code. This creativity usually takes the form of pushing code to a remote server of some sort.</p><p>Is it worth it? The iPad Pro sells for as little as $800. A MacBook Pro sells for as little as $1300. By coding with an iPad instead of a MacBook, you’re instantly saving $400 ($500, but I subtracted $100 for the Apps that we purchased in this article). You also get an easy-travel device with touch-functionality and some capabilities that a MacBook isn’t very good at (my favorite is the ability to quickly sketch out mock-ups or diagrams with a stylus as if I had a notepad in front of me).</p><p>If you’re looking for the absolutely most efficient way to write code, and only write code, go get a laptop. If you’re looking for some of the versatility that the iPad offers and you also want to code on it, then you’re in luck. It can be done. I’m doing it every day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b9fec34be63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modular APIs with Express Router]]></title>
            <link>https://medium.com/the-coders-guide-to-javascript/modular-apis-with-express-router-452e654f9365?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/452e654f9365</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Fri, 03 May 2019 14:40:07 GMT</pubDate>
            <atom:updated>2019-05-03T16:17:02.098Z</atom:updated>
            <content:encoded><![CDATA[<p>There are quite a few tutorials out there about how to get started with Node and Express as a backend for your frontend javascript framework of choice ( React, Angular, Vue, etc ). These tutorials usually get the user setup with a very basic API interface like the following:</p><pre><em>index.js</em></pre><pre>const express = require(&#39;express&#39;);<br>const bodyParser = require(&#39;body-parser&#39;);</pre><pre>const app = express();</pre><pre>const port = process.env.PORT || 5000;</pre><pre>app.use(bodyParser.json());<br>app.use(bodyParser.urlencoded({ extended: true }));</pre><pre>app.get(&#39;/hello&#39;, (req, res) =&gt; {<br>  res.send({<br>    express: &#39;Hello World from ExpressJS&#39;,<br>  });<br>});</pre><pre>app.post(&#39;/msg&#39;, (req, res) =&gt; {<br>  console.log(&#39;You posted: &#39; + req.body.msg);<br>});</pre><pre>app.listen(port, () =&gt; console.log(`Listening on port ${port}`));</pre><p>An example like the one above is quite adequate for getting started and building a simple API interface for a small app … but what about when things start to get more complex? For example, let us pretend that I am building a carpooling app and I need to query the API for User, Location, Vehicle, and Schedule information. If we keep everything within the root ExpressJS file, it’s going to start getting very large and hard to maintain before I’ve even finished defining all of the initial routes, much less any potentially complex logic associated with them.</p><p>The solution is actually rather straightforward. We will separate our concerns and build a modular API by utilizing the ExpressJS Router. Start by creating a new directory in your project called routes. Then, inside of that directory, we will create a new file, user.js, that will handle all of our user-based API routes. The only difference is that instead of using app.get() for our endpoint definitions, we will use router.get() (or post or put or delete). Doing so means that we also need to include express.Router() in our file. Here is our initial implementation of the user.js file:</p><pre><em>./routes/user.js</em></pre><pre>const express = require(&#39;express&#39;);<br><strong>const router = express.Router();</strong></pre><pre>// Get User by ID<br><strong>router</strong>.get(&#39;/:id&#39;, (req, res) =&gt; {<br>  console.log(&#39;UserID: &#39; + req.params.id + &#39; requested&#39;);<br>});</pre><pre>module.exports = router;</pre><p>Note that our path definition for this endpoint is only /:id. We aren’t prefixing with a /user or /api/user or anything else. That will be taken care of in the next step.</p><p>Before this file will actually work as an endpoint, we also need to update our root Express file (usually called index.js or server.js or similar).</p><pre><em>index.js</em></pre><pre>const express = require(&#39;express&#39;);<br>const bodyParser = require(&#39;body-parser&#39;);</pre><pre><strong>const user = require(&#39;./routes/user&#39;);</strong></pre><pre>const app = express();</pre><pre>const port = process.env.PORT || 5000;</pre><pre>app.use(bodyParser.json());<br>app.use(bodyParser.urlencoded({ extended: true }));</pre><pre><strong>app.use(&#39;/api/user&#39;, user);</strong></pre><pre>app.listen(port, () =&gt; console.log(`Listening on port ${port}`));</pre><p>We have done two things in the file above. We included our user.js file from the routes directory and then we declared that we will use it when given the pathing of /api/user. Therefore, getting our User by ID requires the use of the relative path: /api/user/:id … the combination of the path we include with app.use in the file above and the path we included in user.js.</p><p>And that’s it. We can now duplicate the process for our Location, Vehicle, and Schedule objects in this carpooling app and all of our endpoints will be nicely separated and modularized. Many devs might even provide an index file within routes that imports all of the various different route modules and allows for our root file to require only the index …</p><pre><em>./routes/index.js</em></pre><pre>const user = require(&#39;./user&#39;);<br>const location = require(&#39;./location&#39;);<br>const vehicle = require(&#39;./vehicle&#39;);<br>const schedule = require(&#39;./schedule&#39;);</pre><pre>export default {<br>  user,<br>  location,<br>  vehicle,<br>  schedule,<br>}</pre><p>… and then …</p><pre><em>index.js</em></pre><pre>const express = require(&#39;express&#39;);<br>const bodyParser = require(&#39;body-parser&#39;);</pre><pre><strong>const routes = require(&#39;./routes/index&#39;);</strong></pre><pre>const app = express();</pre><pre>const port = process.env.PORT || 5000;</pre><pre>app.use(bodyParser.json());<br>app.use(bodyParser.urlencoded({ extended: true }));</pre><pre><strong>app.use(&#39;/api/user&#39;, routes.user);<br>app.use(&#39;/api/location&#39;, routes.location);<br>app.use(&#39;/api/vehicle&#39;, routes.vehicle);<br>app.use(&#39;/api/schedule&#39;, routes.schedule);</strong></pre><pre>app.listen(port, () =&gt; console.log(`Listening on port ${port}`));</pre><p>… but I have often found this practice to be less helpful in the long run than just explicitly providing individual routes within the root file. In any case, it’s a matter of personal preference and I thought I’d share the concept as it is often used.</p><p>Now … what do we do with all of our database queries that feed our API endpoints? Well, that’s a subject for another post … but it starts by creating a models directory and separating files in much the same way we have done with routes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=452e654f9365" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-coders-guide-to-javascript/modular-apis-with-express-router-452e654f9365">Modular APIs with Express Router</a> was originally published in <a href="https://medium.com/the-coders-guide-to-javascript">The Coder’s Guide to Javascript</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smooth-Scrolling Anchor Menu in ReactJS]]></title>
            <link>https://medium.com/the-coders-guide-to-javascript/smooth-scrolling-anchor-menu-in-reactjs-175030d0bce2?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/175030d0bce2</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[smooth-scroll]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Mon, 22 Apr 2019 01:23:39 GMT</pubDate>
            <atom:updated>2020-03-22T21:36:09.822Z</atom:updated>
            <content:encoded><![CDATA[<p><em>(Note: This story was updated on March 22, 2020)</em></p><p>So you’ve got an SPA (Single Page App) and a navigation menu based on anchor tags set in various locations on the page. But the default behavior of an anchor link is to instantly jump to the target … and it’s 2019 … everything is supposed to be done through smooth animations. So, how do you make your links scroll smoothly instead of instantly jump to their destination?</p><p>In a function, the answer is: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView">element.scrollIntoView();</a></p><p>Of course, we’ll also want to indicate which section of the SPA is currently active, so we’ll end up doing a bit more than just .scrollIntoView(); I’ll be using ReactJS in my example, but the concepts here are easily transferrable to any JavaScript code-base.</p><h3>The basic scrolling anchor link</h3><p>Let’s start by building a MenuItem component, which represents a single link on our menu:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80d8f5def02571708bd502f53f702282/href">https://medium.com/media/80d8f5def02571708bd502f53f702282/href</a></iframe><p>Note that this component is going to expect to receive props — specifically an itemName that it can use to both label itself in the actual Menu and to identify the location to which it will scroll, by element id.</p><p>The magic here is really all within element.scrollIntoView() on line 29 … and if all we wanted to do was smoothly scroll between anchored sections of our SPA, we would be done. But wouldn’t it be better if we could automatically detect which MenuItem should show as ‘active’ as the user scrolls down the page? After all, on multi-page apps, the menu usually indicates which page the user is currently visiting.</p><h3>Next Steps</h3><p>For this bit of code, we are going to step out one level to our Menu component, which contains all of our MenuItem components (I, personally, am a fan of <a href="https://atomicdesign.bradfrost.com/chapter-2/">Atomic Design</a>). We’re also going to use:</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect">element.getBoundingClientRect();</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener">window.addEventListener();</a></p><p>The requirements we need to fulfill are:</p><p>1 — We need to detect the vertical (Y) scroll boundaries of each section</p><p>2 — We need to detect the current vertical scroll position of the viewport</p><p>3 — We need to detect if the current position indicates that the active section has changed and communicate that change if so.</p><h3>Detecting the boundaries of each section</h3><p>It is in this step that we will use element.getBoundingClientRect(); In short, we will identify each of our elements by their destination anchor tag and assume that this location indicates the ‘top’ of the active section. It should be noted here that I have used &lt;h2&gt; elements as anchor destinations as they are valid destinations and serve as great section headers. The bottom of a section is simply the location at which the next section has its top. So … if Section 2 has its top at 2000px, then 1999px is where Section 1 ends.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37c6bc8bcdb431f345384d4fd0721ce2/href">https://medium.com/media/37c6bc8bcdb431f345384d4fd0721ce2/href</a></iframe><p>Note that we use a <a href="https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/MutationObserver">MutationObserver</a> in the code above, which will call our getAnchorPoints() function any time a watched mutation (such as a page resize or the addition of an element to the page tree) occurs. Adding this Observer helps us to maintain accurate anchor points for our local links by adjusting them anytime the page is changed in some way that might affect the pixel-depth of our anchor targets.</p><h3>Detect the current vertical scroll position of the viewport</h3><p>We’ve already learned how to get the current scroll depth on a page in the code above — we use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY">window.scrollY</a>. However, we need to constantly be monitoring this scroll position, not just acquiring it when getAnchorPoints() is called. How is that done? With window.addEventListener(); which is actually included in the useEffect() hook in the code above, after the MutationObserver has been instantiated. We then link it to the handleScroll() function below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b50dd841151deab4e7e7e8466d02552/href">https://medium.com/media/4b50dd841151deab4e7e7e8466d02552/href</a></iframe><p>A caution here — you do not want to be performing very many operations on-scroll. It’s an event that fires frequently and any operations performed within a function called by the listener are best nested within a conditional statement that qualifies whether or not the operation actually needs to occur.</p><p>With the pieces listed above, we have everything needed to put together a fully functional, smooth-scrolling, menu for a single page app. The full Menu component code would look something like what I’ve put together below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/753fc9bf3ddf9dd716692357ba3c1f75/href">https://medium.com/media/753fc9bf3ddf9dd716692357ba3c1f75/href</a></iframe><p>Enjoy this post? Find it useful? Follow us and keep up with all our Javascript and general-coding posts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=175030d0bce2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-coders-guide-to-javascript/smooth-scrolling-anchor-menu-in-reactjs-175030d0bce2">Smooth-Scrolling Anchor Menu in ReactJS</a> was originally published in <a href="https://medium.com/the-coders-guide-to-javascript">The Coder’s Guide to Javascript</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS Background Images for Mobile]]></title>
            <link>https://medium.com/the-coders-guide-to-javascript/css-background-images-for-mobile-225317f1d083?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/225317f1d083</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Sun, 21 Apr 2019 19:29:48 GMT</pubDate>
            <atom:updated>2019-04-24T19:21:17.457Z</atom:updated>
            <content:encoded><![CDATA[<p>The giant hero background image is everywhere on the web, and it’s really very easy to implement in CSS— on desktop:</p><pre>body {<br>  background: url(https://medium.com/&#39;./img/hero.webp&#39;) center center fixed no-repeat;<br>  <br>  /* Currently Firefox requires background-size declared separately or the background image will be blank */<br>  background-size: cover;<br>}</pre><p>That’s it … that’s all you have to do. Except that if you try to load this background image on almost any mobile device, you’ll likely see a blank background. That’s not what we want.</p><p>There are a lot of posts about this issue throughout the internet … and a lot of the ‘solutions’ don’t work. So … let’s create a solution that does work. And do so while gaining an understanding of why it works.</p><p>Diving into it, let’s first break out our background into a series of individual calls so that it’s easier to talk about each individual component:</p><pre>body {<br>  background-image: url(https://medium.com/&#39;./img/hero.webp&#39;);<br>  background-position: center center;<br>  background-attachment: fixed;<br>  background-size: cover;<br>  background-repeat: no-repeat;<br>}</pre><p>A lot of Stack Overflow answers will tell you that the main issue here is background-attachment: fixed; and that the solution is to change fixed to scroll. That’s not true. In fact, all of the major mobile browsers support the fixed value, but they handle it differently than the desktop does:</p><p>For Safari Mobile, Chrome Mobile, and Opera Mobile:</p><pre>fixed: the background image is positioned but scrolls with content.</pre><p>So, actually, our problem lies with a different value —background-position: center center; The first center references our vertical positioning, the second references our horizontal positioning. On a mobile device, this vertical positioning of center will place the background at the center-point of the entire vertical height of your page … not just the viewport. In all likelihood, that means your background image will not be visible at the top of the page.</p><p>The solution?</p><pre>background-position: top center;</pre><p>Well … almost. It seems that background-size: cover; also tends to give us trouble on mobile devices.</p><p>The description of cover, as given by MDN, is:</p><pre>Scales the image as large as possible without stretching the image. If the proportions of the image differ from the element, it is cropped either vertically or horizontally so that no empty space remains.</pre><p>When I left background-size: cover; for mobile devices, I did continue to see a background image, but the image was stretched far larger than I would have liked. My inference, informed by how fixed works on mobile browsers, is that cover is stretching the image to fit the entire page, not just the viewport. Again, the solution is relatively straightforward:</p><pre>background-size: 100vw auto;</pre><p>The background now scales to 100% of the viewport width. Unfortunately, attempting to scale 100vh height leads to unpredictable results, so we are left accepting whatever scaling a 100vw width can give us. In some cases, it may be acceptable to scale the width above 100 in order to increase the height of the image … just be careful to ensure that your image scales well.</p><p>The final CSS also selects for .webp vs .jpg images based on browser-support ( I use <a href="https://modernizr.com/">modernizr.js</a> to help out here ) and picks an image size to load based on viewport size. It looks like this:</p><pre>/* Desktop-only view. <br> * Largest mobile view is iPad Pro with 1366 in landscape mode<br> */<br>@media only screen and (min-width:1367px) {<br>  :root {<br>    --bg-image-webp: url(https://medium.com/&#39;./images/hero.webp&#39;);<br>    --bg-image-jpg: url(https://medium.com/&#39;./images/hero.jpg&#39;);<br>    --bg-size: cover;<br>    --bg-pos: center center;<br>  }<br>}</pre><pre>/* Large mobile device screens */<br>@media only screen and (max-width:1366px) {<br>  :root {<br>    --bg-image-webp: url(https://medium.com/&#39;./images/hero.webp&#39;);<br>    --bg-image-jpg: url(https://medium.com/&#39;./images/hero.jpg&#39;);<br>    --bg-pos: top center;<br>    --bg-size: 100vw auto;<br>  }<br>}</pre><pre>/* Load a smaller image for smaller screens */<br>@media only screen and (max-width:970px) {<br>  :root {<br>    --bg-image-webp: url(https://medium.com/&#39;./images/hero768.webp&#39;);<br>    --bg-image-jpg: url(https://medium.com/&#39;./images/hero768.jpg&#39;);<br>  }<br>}</pre><pre>/* Smallest image for phone screens */<br>@media only screen and (max-width:500px) {<br>  :root {<br>    --bg-image-webp: url(https://medium.com/&#39;./images/hero375.webp&#39;);<br>    --bg-image-jpg: url(https://medium.com/&#39;./images/hero375.jpg&#39;);<br>  }<br>}</pre><pre>body {<br>  background-color: #fff;<br>  margin: 0px auto;<br>  padding: 0px auto;<br>}</pre><pre>.webp body {<br>  background: var(--bg-image-webp) var(--bg-pos) fixed no-repeat;<br>  background-size: var(--bg-size);<br>}</pre><pre>.no-webp body {<br>  background: var(--bg-image-jpg) var(--bg-pos) fixed / var(--bg-size) no-repeat;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=225317f1d083" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-coders-guide-to-javascript/css-background-images-for-mobile-225317f1d083">CSS Background Images for Mobile</a> was originally published in <a href="https://medium.com/the-coders-guide-to-javascript">The Coder’s Guide to Javascript</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proof that .99999… is NOT equal to 1]]></title>
            <link>https://medium.com/@kenahlstrom/proof-that-99999-is-not-equal-to-1-5672e7dd58ce?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5672e7dd58ce</guid>
            <category><![CDATA[hyperreal-numbers]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Sat, 12 May 2018 04:36:47 GMT</pubDate>
            <atom:updated>2018-05-12T16:20:50.986Z</atom:updated>
            <content:encoded><![CDATA[<p>Several years ago, while traveling with co-workers, the subject of .99999… ( that’s .9 with a bar over it, or .9 repeating infinitely ) being equal to 1 came up. While the assertion initially sounds absurd, a quick search on the internet will turn up a plethora of “proofs” and explanations why such an assertion is true. It seems that .99999… really does = 1. That is, at least, until one applies true analytical rigor to the proofs and finds that they are all fallacious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*u-r967i-QlAEJ-Jjot3bJw.png" /><figcaption>Images from <a href="http://polymathematics.typepad.com/polymath/2006/06/no_im_sorry_it_.html">Polymathematics</a>, <a href="https://en.wikipedia.org/wiki/0.999...">Wikipedia</a>, <a href="http://www.purplemath.com/modules/howcan1.htm">Purplemath</a>, and <a href="https://www.khanacademy.org/math/math-for-fun-and-glory/vi-hart/infinity/v/9-999-reasons-that-999-1">Khan Academy</a>. And they’re all wrong.</figcaption></figure><p>It’s difficult to prove that everyone else ( including experts in the field ) is wrong and that some amateur with an argumentative streak ( me ) is right. And it should be. As the individual with a contrary viewpoint, the burden of proof should lie on me. To prove that .99999… is not equal to 1, I will first dismantle the common “proofs” that .99999… = 1. Then, because disproving something does not automatically make the alternately proposed answer true, I will prove my own assertion, that .99999… != 1.</p><h4>Everyone agrees that 1/3 = .33333…</h4><p>One of the most simplistic arguments that .99999… = 1 is that 1/3 = .33333… and if you multiply both by 3, you get the answer that 3/3 = .99999… Since 3/3 is obviously 1, .99999… must therefore also = 1. The problem here is, 1/3 is not perfectly equal to .33333… Even my early-school math teachers knew that fact. When first learning how to convert fractions to decimals, or decimals to fractions, we are told that .33333… is the “best approximation possible” for 1/3, not that they are actually equal numbers. Don’t believe me? Try to convert .33333… into 1/3. You can create 3/10, 33/100, 333/1000, 3333/10000, etc … but you can never create 1/3. In order for two numbers to be exactly equal to each other, you must be able to convert its visual representation both ways. <strong>The truth is, .33333… is just a ‘lazy’ approximation of 1/3.</strong> The two numbers are not actually equal.</p><h4>If x = .99999…, then 10x = 9.99999… and 9x = 9, so x = 1</h4><p>This proof of 10x -x is especially insidious, as it is a simple case of algebraic trickery. The trick behind this proof is that the troublesome part of the number, the infinitely repeating part, is simply removed by subtraction. We have extracted a finite portion of an infinitely repeating number through multiplication and algebraic trickery.</p><p>Because the refutation of this proof can be somewhat abstract and esoteric, let me approach it from a different angle. Show to me any finite representation of .99999… in which that number subtracted from 1 gives a non-zero answer. If you say to me that we cannot take a finite representation of an infinite number, then you have disproven 10x -x because it is therefore impossible to “resolve” a multiplication of x into 10x, because an infinite number cannot be finitely represented. The notation of 10x = 9.999… is inherently flawed. Let me show it mathematically:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*gkvSKtDCPqdsGnXFWucVDw.png" /><figcaption>Because a proper representation of .99999… x 10 can never actually be resolved, the formula resulting from it is invalid. You cannot just ignore the 0, even if it does not appear until the end of infinity.</figcaption></figure><p>The problem in this equation is that it assumes that there is no method by which an infinitesimally small value can be represented. Therefore, that infinitesimally small number ( the difference between that 0 at the ‘end of infinity’ in 10x and the 9 that would subtract from it in x ) is simply canceled and ignored through hand-waving and the statement that the problematic zero would never occur because infinity never ends.</p><p><em>( Note: This explanation has been updated and made more rigorous thanks to a reply I received that challenged me to come up with a better refutation of the formula. Thank you. )</em></p><h4>The smallest number that cannot be exceeded by any value in an infinite geometric series is, by definition, the sum of that series</h4><p>An infinite geometric series is the sum of an infinite geometric sequence. An infinite geometric sequence is a sequence of numbers in which the ratio between consecutive terms is constant. In other words, { 2, 4, 8, 16, 32 … } is an infinite geometric sequence because each number is 2x the previous number. Similarly, 9/10 + 9/100 + 9/1000 + 9/10000 is a geometric series ( the sum of a geometric sequence ). And, of course, this geometric series is .99999… So what is the smallest number that cannot be exceeded by any value in this geometric series? The answer given by those proving that .99999… = 1 is, well, 1.</p><p>But why isn’t the number .99999…? .99999… certainly never exceeds .99999…, and that is the limit of the definition. Saying that the number must be 1 is an acceptance of ‘rounding’ the sum at a certain limit. In fact, some arguments directly acknowledge that .99999… = 1 by virtue that eventually, at some limit, the difference between the two numbers is so infinitesimally small that it does not matter. Essentially, there is an inherent admittance that the two numbers are not actually the same, but that they are so close together that they may as well be the same.</p><h4>The Actual Answer: Hyperreal Numbers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxFFuVj7BS3tTGy1xP2OJg.png" /><figcaption>Hyperreal numbers are non-standard real numbers (*R) that handle infinite and infinitesimal quantities. <a href="https://en.wikipedia.org/wiki/Hyperreal_number">Wikipedia.</a></figcaption></figure><p>First, it is important to understand that hyperreal numbers are an extension of real numbers … meaning that the restriction of disproving .99999… = 1 using only real numbers remains valid with hyperreal numbers.</p><p>The important function of hyperreal numbers in this case is that they create a method by which <a href="https://en.wikipedia.org/wiki/Infinitesimal">infinitesimal</a> values can be represented within our imperfect decimal notation system.</p><p>Now, we can mathematically represent what we all know to be true. We all know that .99999… is not actually equal to 1, but that the difference between the two numbers is so infinitesimally small that it “doesn’t really matter”. Well, the true notation of equality between 1 and .99999… is 1 -h = .99999… and that is not an actual equality between the two numbers. Further, remember that problem of 1/3 not actually being equal to .33333…? Well, that can also be accurately expressed by hyperreal numbers as: 1/3 -h = .33333…</p><h4>Conclusion</h4><p>.99999… was never exactly equal to 1. Instead, a limitation in notation of decimal numbers created the illusion that the two numbers are equal and an academic desire to keep everything neat and tidy lead to confirmation bias and the statement that, at some limit, the actual difference was essentially akin to 0. With the inclusion of hyperreal numbers ( introduced algebraically in 1948 ), we can provide an actually accurate representation of the numbers being represented by using the infinitesimal representation <em>h</em>.</p><p>The lesson learned here? Question everything and everyone, even the experts. If something feels wrong and it’s ‘proofs’ seem insufficient, do more research … because you just might be on to something.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5672e7dd58ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An American in Europe After Brussels]]></title>
            <link>https://medium.com/digital-wanderer/an-american-in-europe-after-brussels-c5da659ac118?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5da659ac118</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[isis]]></category>
            <category><![CDATA[brussels]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Wed, 23 Mar 2016 13:01:35 GMT</pubDate>
            <atom:updated>2016-03-23T13:01:35.474Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hX-IzcAm3O7UpiyjYCeOLw.jpeg" /><figcaption>Downtown Lviv, Ukraine</figcaption></figure><p>Yesterday, several terrorists bombed the airport and a metro station in Brussels, Belgium. In doing so, they killed 30+ people and injured a lot more. I remember hearing about the bombing as the news broke. I was sitting in the back seat of a car in Lviv and the newscaster on the radio was speaking in Ukrainian. I could barely make out what was going on, but I understood enough.</p><p>Reaction in the USA to these terrorist bombings seems to be … terror. The government has issued a travel warning for all of Europe. Presidential candidates have felt a need to step forward and talk about how they will not let muslims into our country or how they will send security patrols through muslim neighborhoods. I’m also willing to bet that a lot of European vacation flights and reservations have recently been canceled.</p><p>But as I was sitting in that car, attempting to read signs in cyrillic before we passed them ( a great way to practice speed reading a new alphabet ), I thought about the world in which we live and the new type of war that we have been fighting for the past fifteen years. And then I thought about how I was sitting in a car on my way to work in Ukraine, once a part of the Soviet Union … that boogeyman of the 80’s that had me, as a child, believing that the only possible end for the world was nuclear war.</p><p>The world’s borders are disappearing and the wealth of people throughout our globe is increasing. Where once Venice would be crowded only with tourists from Western Europe, the USA, and Japan … now you will also see Russians and Chinese angling for a photo that minimizes the view of the crowds and maximizes the view of a gondola or cathedral. These are good things. We are becoming a more global community. We are interacting more on a personal, one-to-one level. We are sharing cultures and ideas and bonding as we ask strangers from other countries to take our picture in front of a castle or on a beach. We are becoming more peaceful. The world is becoming more “safe”.</p><p>But there are people who do not like this globalization. People like the leaders of Daesh ( ISIS ) who find it difficult to exercise authoritarian control and self-privilege in a world filled with knowledge, communication, and understanding. So they fight against it. They fight to push people into fear of interaction and understanding. They fight to isolate and marginalize their own people so as to make them easier to radicalize. They fight to keep a reign of ignorance and isolationism, because these two conditions allow them to gather power to themselves and exploit those who follow them.</p><p>War has changed.</p><p>Borders no longer protect us.</p><p>All of us are vulnerable as potential targets of Daesh.</p><p>But so what?</p><p>These are small people doing small things in a desperate attempt to hold on to old power. Their actions are deadly and horrible, and the existence of even one victim is a tragedy, but the time of strong-arm dictators and autocrats is over. They will lash out, but they will lose.</p><p>As for me, I will not let these incidents give them victory. I will not be afraid to continue meeting others from around the world. I will not stop building relationships across increasingly dematerialized borders. I will not cancel my planned travel to the Netherlands in a few weeks just because some terrorist might plant a bomb on a train in Amsterdam.</p><p>I will ride that train. And if there is a bomb on it, I will put myself as close to the explosion as possible to shield others from the blast. I will be a global citizen who is unafraid to be a part of this community that would-be tyrants fear so much.</p><p>The only way terrorists win is if they cause terror. So stay alert, keep your eyes open to potential danger, but don’t stay home. The way we win is to be a people who love, interact with, and protect each other. So let’s do that. And do it without fear.</p><p>I hate these travel warnings. If anything, they should be travel grants. Instead of saying “You might be in danger if you travel to Europe”, our government should say “Please travel to Europe — especially to Brussels — to offer solidarity and support to our friends and community there”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5da659ac118" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digital-wanderer/an-american-in-europe-after-brussels-c5da659ac118">An American in Europe After Brussels</a> was originally published in <a href="https://medium.com/digital-wanderer">Digital Wanderer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring 2016: Days 2–4]]></title>
            <link>https://medium.com/digital-wanderer/spring-2016-days-2-4-6071f8ffb21a?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6071f8ffb21a</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[digital-nomads]]></category>
            <category><![CDATA[lviv]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Sun, 13 Mar 2016 16:16:55 GMT</pubDate>
            <atom:updated>2016-03-13T16:19:31.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Va891yMek3lT0gPufACQjA.jpeg" /><figcaption>The candle at my dinner table in хліб i вино ( the restaurant downstairs from my apartment )</figcaption></figure><p>The first day of spring might be in March, but we’re still early enough in the year for days to feel more like winter. Restaurants have not set up their front patios yet. There are still people in the main square, but everyone is bundled up in warm coats and most groups are moving quickly to the next warm, indoor location. Still, street performers sit out in the cold and entertain those who are willing to tolerate the weather.</p><h4>Day 2:</h4><p>I arrived in Ukraine at 17:00 yesterday, so it’s only natural that I head off to work at 09:00 today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6u0s_5BQC-BSLeREysumhg.jpeg" /><figcaption>Lviv HQ — Where I’ll be working while here</figcaption></figure><p>This time, I’m in the new building. It’s a very nice setup and includes a cafe, mini-gym, and rec room ( with billiards and table tennis ) on the first floor. Of course, I’m also no longer across the street from Bubbles … which means I’ll need to find a new solution for doing my laundry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*ZwKZX0rtaQqN3zP-BHStAg.jpeg" /><figcaption>The interior of Lviv HQ — stylish, modern, and comfortable</figcaption></figure><p>I thought I’d power through the day with no problems. After all, I managed to keep myself awake on my flights over and didn’t go to sleep until about 21:00. I was wrong. I ended up falling asleep in my chair at about 15:00. I guess there’s just no way to instantly adjust. Still, the transition to a new timezone hasn’t been bad.</p><h4>Day 3:</h4><p>So I kind of slept today. All of today. As in, I woke up at about 17:00 … stretched, walked around outside a bit, had dinner, and went back to sleep by 21:00 again. Apparently I was tired.</p><p>Day 4:</p><p>Another lazy day, but not so lazy as yesterday. I did wake up relatively early in the morning. I did not, however, feel like getting out of bed for quite some time. Eventually, I did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d_elu3hHgpItMJN6jGc0Vw.jpeg" /><figcaption>Ranok Square in downtown Lviv. At 09:00, very few people are out and about … and everything is closed.</figcaption></figure><p>The highlight of the day, at least so far, was watching a couple of guys play chess on a large board. One of the two was receiving quite a bit of advice from bystanders, as he was obviously outmatched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iz_I4QVzIgxWYf20YJjmcQ.jpeg" /><figcaption>Black is losing, but he’s got tons of advisors helping him stay in the game</figcaption></figure><p>So far, it’s been pretty obvious to most people that I speak English, not Ukrainian, from the moment I open my mouth and butcher a simple Ukrainian sentence. Still, I managed to fool a waitress at one restaurant for a solid ten minutes. I’m pretty proud of myself for that one. Another asked, a little bit unsure, if I needed an english menu. I was proud of that as well. It was obvious I was a foreigner, but she also felt that I might know enough Ukrainian to go with a standard menu. If I can just force myself to parse together sentences and embarrass myself for a week or two, maybe I’ll be able to have complete ( simple ) conversations in Ukrainian this trip.</p><p>That’s it for now. Back to work tomorrow. And hopefully I’m done with the post-travel “I just want to sleep” stuff. Look for my next update soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6071f8ffb21a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digital-wanderer/spring-2016-days-2-4-6071f8ffb21a">Spring 2016: Days 2–4</a> was originally published in <a href="https://medium.com/digital-wanderer">Digital Wanderer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring 2016: Day 1]]></title>
            <link>https://medium.com/digital-wanderer/spring-2016-day-1-94184f2ba217?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/94184f2ba217</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[ukraine]]></category>
            <category><![CDATA[digital-nomads]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Thu, 10 Mar 2016 17:01:15 GMT</pubDate>
            <atom:updated>2016-03-10T17:01:38.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ljEyu9ff6ESrbHeP5Rhyg.jpeg" /><figcaption>Salt Lake City International Airport</figcaption></figure><p>Ok, more like day 1+, since the flight — layovers included — took twenty hours and I’m now sitting here typing while having been awake for twenty six. If I can make myself stay up for just two more hours, I’ll be able to get to sleep “on timezone” and be adjusted almost immediately when I wake up in the morning.</p><p>Anyway, I’m back in Ukraine! I get to run around this amazing country for another ninety days … with a break right in the middle for a week or so in the Netherlands. I’m stoked to be back out here. It really feels like home.</p><p>The flight out this time was relatively painless. The first, and most important, step was to avoid UIA ( Ukrainian International Airlines ) at all costs. The second was to fly direct to Lviv without stopping through Kiev. I flew over from Toronto, Canada on LOT Polish Airlines through Warsaw and things couldn’t have gone better. On the last trip, I believe total travel time on the way over was something like twenty six hours. I did this one in twenty. And I had comfortable seating. And watched Big Hero 6.</p><p>It’s pretty awesome to have an employer that will let me come out and work with the guys here directly on this type of extended stay. It’s also pretty awesome to have a group of friends and family who will keep my house and property watched over and lived in so I’m not sitting here paranoid of burglary.</p><p>I’m ridiculously tired right now. I’ve also got to hit up the nearby продукти and buy some water and snacks. Then sleep. Beautiful, beautiful sleep. And then I will inundate all of you with photos and brief blurbs about my days out here until they’re over.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*XCj8CpYUHKWceiGHdahO1Q.jpeg" /><figcaption>Flying into Ukraine from Warsaw</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94184f2ba217" width="1" height="1" alt=""><hr><p><a href="https://medium.com/digital-wanderer/spring-2016-day-1-94184f2ba217">Spring 2016: Day 1</a> was originally published in <a href="https://medium.com/digital-wanderer">Digital Wanderer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[There is No Box of Chocolates]]></title>
            <link>https://medium.com/@kenahlstrom/there-is-no-box-of-chocolates-ff1b81921494?source=rss-676efabe4b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff1b81921494</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[choices]]></category>
            <dc:creator><![CDATA[Kenneth Ahlstrom]]></dc:creator>
            <pubDate>Wed, 11 Nov 2015 01:29:26 GMT</pubDate>
            <atom:updated>2015-11-11T01:30:39.447Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*Q9dN5oPElWqDVHW97IPezw.jpeg" /></figure><p>No. No it’s not. No matter how much people loved the quote from Tom Hanks playing a mentally slow individual who just happened to attend several important events in history, his quote on life is a false statement. <strong>Life is not random.</strong> It is not unknown. And it is certainly not always chocolate. In fact, believing any of these things is dangerous to one’s development as a functional and societally useful human being. Maybe the movie is more intelligent than we give it credit for, as only a character like Forrest Gump — one without the capacity to see the interconnecting complexities of life or the natural consequences of one’s own actions — would believe or embrace such an ignorant and short-sighted philosophy.</p><p>A more true statement about life might be:</p><blockquote>“Life is like a game of chess; complex, but entirely predictable if you understand the game.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*k9VmkOpAiLjamkTOMunixQ.jpeg" /></figure><p>Think of yourself as one player in the game and the combination of all other persons and events as the other player. You cannot control the actions of everyone or everything outside of yourself, but you can observe them, recognize them, and understand the situation that such actions present. It is then up to you to make your own move and assert your own goals on the board. The more you understand life around you — the other pieces on the board and their possible strategies and actions — the better you can move yourself and the more effectively you can assert your own goals. Soon, you find that life is something almost entirely under your own control and that you can mold it in whatever way you wish. You will be able to dictate how the game is played with accuracy and purpose.</p><blockquote>“First there is summer, and then there is spring.”</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FkGZJasrDbVw%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkGZJasrDbVw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FkGZJasrDbVw%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/31335d811c490b9b3eb41064a49805a6/href">https://medium.com/media/31335d811c490b9b3eb41064a49805a6/href</a></iframe><p>Understanding the game of life is, of course, not entirely simple. It requires a great deal of study, of observation, of willingness to accept new information as it is found and to never be stuck in a given mindset. Otherwise, you become predictable and easily manipulated. Further, the chessboard that we play on is seemingly infinite. At every point that we think we are seeing the entire board, an event occurs that reveals to us the board stretches further than we thought and we do not understand its scope at all. That does not mean we cannot continue to guide our own life circumstances or control our own outcomes, it means only that we must constantly learn, explore, and grow in order to better understand how to pursue our goals and dreams.</p><p>If you think of life as a box of chocolates, you are giving yourself the excuse of disengaging and just settling in for whatever ride you are given. You are subject to the whims and forces of others. You do not accept responsibility for your own status and situation and so you can never accept responsibility for your own future. You have checked out. When given the option to choose life, you said no thank you. However, if you engage; if you actively choose to play the game; if you choose to understand that ultimately you are in control; you begin to live. The beautiful thing is that it is never too late to choose life. You can choose life right now. You can choose life tomorrow. You can choose it next week or next year. You can choose life any time you wish. And when you do, it’s incredible. Not because everything that happens is good, but because everything that happens is because you are actively engaged in the game.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff1b81921494" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>