<?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 Marvin Davila on Medium]]></title>
        <description><![CDATA[Stories by Marvin Davila on Medium]]></description>
        <link>https://medium.com/@malexmad?source=rss-f97a8fcfb3cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*-yef4Ba39-UX0w7sVtktag.jpeg</url>
            <title>Stories by Marvin Davila on Medium</title>
            <link>https://medium.com/@malexmad?source=rss-f97a8fcfb3cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 10:20:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@malexmad/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to use pgAdmin]]></title>
            <link>https://medium.com/@malexmad/how-to-use-pgadmin-a9addc7ff46c?source=rss-f97a8fcfb3cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9addc7ff46c</guid>
            <category><![CDATA[pgadmin]]></category>
            <category><![CDATA[data-management]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[relational-databases]]></category>
            <dc:creator><![CDATA[Marvin Davila]]></dc:creator>
            <pubDate>Tue, 18 Feb 2020 16:57:07 GMT</pubDate>
            <atom:updated>2020-02-18T16:57:07.371Z</atom:updated>
            <content:encoded><![CDATA[<p>A brief overview &amp; tutorial to connect a PostgreSQL database(Amazon RDS)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xSBnHcONON76UMt_" /><figcaption>Photo by <a href="https://unsplash.com/@jamesmhammond?utm_source=medium&amp;utm_medium=referral">James Hammond</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>What is pgAdmin?</strong></h3><p>It’s a very popular open source platform fully dedicated to <a href="https://www.postgresql.org/about/"><strong>PostgreSQL</strong></a><strong> </strong>and has a graphical user interface administration tools to manage your relational databases. Some features include a query tool for SQL statements and importing/exporting csv files.</p><p><strong>What’s Covered:</strong></p><ul><li>Download pgAdmin &amp; PostgreSQL</li><li>pgAdmin Overview</li><li>Connect an Existing Database(AWS)</li></ul><p><strong>Note:</strong> To my knowledge the tutorial will work with macOS and Windows</p><h3>Download</h3><p><strong>Notes</strong>: I’m using macOS, version # will change, and the page layout could change</p><p>To use <strong>pgAdmin</strong>, you will need to<strong> </strong><a href="https://www.pgadmin.org/download/"><strong>download</strong></a> it on your system. Pick <strong>pgAdmin 4</strong> for your OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIq5N79GYVKED_cH7s4ZNw.png" /></figure><p>After selecting your OS, a download page showing different version releases in descending order will appear. Choose the latest version and it will take you to the file browser page. Then click the largest file to download and follow the installation instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htmLp8N28kunbBsM5_pdTQ.png" /></figure><p>For <strong>PostgreSQL</strong>, you can download it <a href="https://www.enterprisedb.com/downloads/postgres-postgresql-downloads"><strong>here</strong></a>. Choose the latest version for your machine.</p><p><strong>Notes:</strong> When installing PostgreSQL you don’t need to change any of the default settings. If you forget your password, you won’t have access to your PostgreSQL server anymore.</p><h3>pgAdmin Overview</h3><p>PgAdmin will use your preferred web browser to display a graphical user interface. You don’t need internet to view local servers. It will prompt you for a master password every time you open pgAdmin to get access. After getting access click <strong>Servers(1) </strong>on the left side to open up your <strong>PostgreSQL 12</strong> server. If you don’t see a server, try restarting pgAdmin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntE29xgOXvt1F6tjQ6jnqg.png" /></figure><p>Open up your database to get a tree view menu according to the picture below. You will see a database named <strong>postgres</strong>. Selecting the database will bring up an activity dashboard to view traffic information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9MyzfkEp3nmw3v4fta7sQ.png" /></figure><p>You have access to useful tools by right-clicking on any object in the tree view menu. We can <strong>create </strong>a new database, schema, and tables. As well as viewing individual table data and customizing an existing table.</p><p><strong>Create Example:</strong></p><p>Let’s create a table by right clicking on <strong>Tables </strong>and click<strong> Table…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN9d4mRWDiuIhoRFMpIqcQ.png" /></figure><p>Give your table a <strong>name</strong> and then click <strong>Columns</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1FPppETE9bWJhTWbkDMbQ.png" /></figure><p>Click the <strong>+</strong> symbol to add columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DIH9AYpbmXRCAB0s3e7Dg.png" /></figure><p><strong>Name</strong> your column, select the <strong>data type</strong>, and give a <strong>length</strong> if needed. Then click <strong>Save</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8ksFmGCBW30nh6wCnBx1g.png" /></figure><p>Now that you have created a table, view it under the <strong>Tables</strong> object. Right click and refresh if it didn’t update.</p><p><strong>Query Tool Example:<br>Note: </strong>I’m showing you my database with data for demonstration purposes</p><p>When an object is selected under the database tree view menu, you can click the <strong>Tools</strong> tab and click <strong>Query Tool</strong>. Query tool brings up an editor to execute SQL statements.</p><p>You can also right click the database and click <strong>Query Tool …</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*2JDwIXI4NC6tCTQfhGKr4Q.png" /></figure><p>A tab called <strong>query editor</strong> will open up on the right. You can write SQL statements and click the <strong>play button</strong> to execute. Your results will show below the editor on the <strong>Data Output</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyATqg7Y-xGmt2gccDQvig.png" /></figure><blockquote>For more <strong>documentation</strong> on <strong>pgAdmin</strong> click <a href="https://www.pgadmin.org/docs/"><strong>here</strong></a></blockquote><h3>Connect an Existing Database</h3><p><strong>Note:</strong> We will be using Amazon RDS PostgreSQL as an example and if you need help setting one up, click <a href="https://towardsdatascience.com/how-to-set-up-a-postgresql-database-on-amazon-rds-64e8d144179e"><strong>here</strong></a></p><p>Your database will need public access to connect with pgAdmin. Depending on your database configuration this example might not work.</p><p><strong>Database Credentials Needed:</strong> Host Name, Port, Username, Password</p><p>Right-click <strong>Servers</strong> and click on <strong>Server…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*lhtHEVyer8xTLaMU_y-VDg.png" /></figure><p><strong>Name </strong>your server with the same AWS database name, then click <strong>Connection</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*xpIvpSZYWBmp_gKUt2TJRQ.png" /></figure><p>Fill in your <strong>Host name/address</strong>, <strong>Port</strong>, <strong>Username</strong> and <strong>Password</strong>. Click <strong>Save<br>NOTE: </strong>If you don’t want to put in your database password every time you open the server click the <strong>Save password?</strong> box</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*1JZw1lSzAQ9JPwRu_0MoKg.png" /></figure><p>Now you should have your database connected with pgAdmin. Try using the query tool to view your data with SQL statements. :)</p><p>Find me on twitter <a href="https://twitter.com/malexmad">@malexmad</a>, <a href="https://github.com/malexmad">Github</a>, or connect with me on <a href="https://www.linkedin.com/in/marvin-davila/">LinkedIn</a>!</p><p><strong>Sources:</strong></p><ul><li><a href="https://www.pgadmin.org/">pgAdmin</a></li><li><a href="https://www.postgresql.org/">PostgreSQL</a></li><li><a href="https://www.pgadmin.org/docs/">Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9addc7ff46c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Rate Limit Routes in Flask]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-rate-limit-routes-in-flask-61c6c791961b?source=rss-f97a8fcfb3cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/61c6c791961b</guid>
            <category><![CDATA[rate-limiting]]></category>
            <category><![CDATA[python-flask]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Marvin Davila]]></dc:creator>
            <pubDate>Fri, 14 Feb 2020 18:14:57 GMT</pubDate>
            <atom:updated>2020-02-16T14:10:40.641Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3_fi4K-dFOsH_S3K" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://pymbook.readthedocs.io/en/latest/flask.html">Flask</a> is a web framework written in python. It provides you with tools, libraries, and technologies that allow you to build a web applications. These web application can be some web pages, a blog, a wiki or go as big as a web-based calendar application or a commercial website.</p><p><strong>What is Rate Limiting?<br></strong>Rate Limiting allows you to control how often someone can access your API in a given time period. In flask there is a extension called <strong>flask limiter.</strong> This extension allows you to limit the amount of request on a particular route. Each route can have different request limits or be exempt to have no limits. It limits user by keeping track of their IP address.</p><p><strong>Why you should use it?<br></strong>An API endpoint shouldn’t be unlimited access. We need to make sure our application routes are running efficiently as possible. Focusing on performance of our application is important because we don’t want users to have a bad experience. It also helps keep costs down with limit requests and increases our security from DoS attacks.</p><p><strong>How to implement it?</strong><br>We are using the flask_limiter library to provide rate limiting features in our flask app. Following the <a href="https://flask-limiter.readthedocs.io/en/stable/">documentation</a> you will need some imports. Make sure your environment has flask and flask-limiter installed.</p><pre>from flask_limiter import Limiter<br>from flask_limiter.util import get_remote_address</pre><p>After those imports, you will need to add a default limiter. Use this code snippet below.</p><pre>limiter = Limiter(<br>    application,<br>    key_func=get_remote_address,<br>    default_limits=[&quot;200 per day&quot;, &quot;50 per hour&quot;]<br>)</pre><p>For the Limiter first arg should be the name of main flask file application. Then key_func should equal get_remote_address. You can set the default_limits to anything you want.</p><p>Under each route you can individually customize the request limits and it will bypass the default limits.</p><pre># example 5 per minute route <br>@application.route(&quot;/slow&quot;)<br>@limiter.limit(&quot;5 per minute&quot;)<br>def slow():<br>    return &quot;5 per minute!&quot;</pre><p>We can also exempt a route from the default limit and users will have unlimited access to that route.</p><pre># example no limit route<br>@application.route(&quot;/exempt&quot;)<br>@limiter.exempt<br>def exempt():<br>    return &quot;No limits!&quot;</pre><p><strong>Example Flask App:<br></strong><em>Copy and paste code block below into </em><strong><em>application.py</em></strong><em> file and run</em></p><pre>from flask import Flask<br>from flask_limiter import Limiter<br>from flask_limiter.util import get_remote_address</pre><pre>application = Flask(__name__)</pre><pre>limiter = Limiter(<br>    application,<br>    key_func=get_remote_address,<br>    default_limits=[&quot;200 per day&quot;, &quot;50 per hour&quot;]<br>)</pre><pre>@application.route(&quot;/&quot;)<br>def default():<br>    return &quot;default limit!&quot;</pre><pre>@application.route(&quot;/five&quot;)<br>@limiter.limit(&quot;5 per minute&quot;)<br>def five():<br>    return &quot;5 per minute!&quot;<br><br>@application.route(&quot;/exempt&quot;)<br>@limiter.exempt<br>def exempt():<br>    return &quot;No limits!&quot;<br><br><br>if __name__ == &quot;__main__&quot;:<br>    application.run(port=5000, debug=True)</pre><p>Test each route and set the limits to anything you want. It’s also possible to have multiple limits for one route. Every time a request exceeds the rate limit, the function will not get called and instead a 429 http error will be raised.</p><p><strong>Rate Limit String Notation</strong><br>Example:</p><ul><li>10 per minute</li><li>10 per hour</li><li>10/hour</li><li>10/hour;100/day;2000 per year</li><li>100/day, 500/7days</li><li>100/day, 500/7days</li></ul><p>The limit request will be determine by the application you will run. So you will know the best rate for each route. :)</p><p>This article will eventually become part of a series of articles from lessons I learned with my team while working on a project called Cryptolytic (article will be written about this soon and linked here). It’s the guide we wish we had when working on the project.</p><p>This article will eventually become part of a series of articles from lessons I learned with my team while working on a project called Cryptolytic (article will be written about this soon and linked here). It’s the guide we wish we had when working on the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F7eHtQD968rPa4YB.png" /></figure><p><strong>The notebook containing all the code used in this article can be found </strong><a href="https://github.com/Cryptolytic-app/cryptolytic/tree/master/medium_articles"><strong>here</strong></a><strong> </strong>which is inside the repo of our Cryptolytic project — so if you’re curious, check it out!</p><p>Find me on Twitter <a href="https://twitter.com/malexmad">@malexmad</a>, <a href="https://github.com/malexmad">Github</a>, or connect with me on <a href="https://www.linkedin.com/in/marvin-davila/">LinkedIn</a>!</p><ul><li><a href="https://flask-limiter.readthedocs.io/en/stable/">Flask-Limiter - Flask-Limiter 1.0.1+0.gb390e64.dirty documentation</a></li><li><a href="http://flask.palletsprojects.com/en/1.1.x/quickstart/#">Quickstart - Flask Documentation (1.1.x)</a></li><li><a href="https://github.com/Cryptolytic-app/cryptolytic">Cryptolytic-app/cryptolytic</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61c6c791961b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-rate-limit-routes-in-flask-61c6c791961b">How to Rate Limit Routes in Flask</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create an AWS Lambda Function in Cloud9]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-create-an-aws-lambda-function-in-cloud9-86255e456747?source=rss-f97a8fcfb3cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/86255e456747</guid>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloud9]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Marvin Davila]]></dc:creator>
            <pubDate>Wed, 08 Jan 2020 14:36:26 GMT</pubDate>
            <atom:updated>2020-01-13T12:21:30.669Z</atom:updated>
            <content:encoded><![CDATA[<h4>Beginners guide to get you started</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1hZI94rovzHy2zen" /><figcaption>Photo by <a href="https://unsplash.com/@gn?utm_source=medium&amp;utm_medium=referral">Gian D.</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html"><strong>AWS Cloud9</strong></a><strong> is an </strong><a href="https://en.wikipedia.org/wiki/Integrated_development_environment"><strong>IDE</strong></a> that support many programming languages, runtime debuggers, and a built in terminal. It contains a collection of tools that you use to code, build, and helps you release software to the cloud.</p><p>You can create a <strong>Lambda Function from Cloud9</strong> and deploy to <a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">AWS Lambda</a>. <strong>AWS Lambda</strong> is a compute service that lets you run code without provisioning or managing servers. It executes your code only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time you consume — there is no charge when your code is not running.</p><p>If you’re just getting started with all the AWS services, hopefully you’ll find this helpful! For the majority of this article, I will go through the Cloud9 setup on AWS and then a brief overview of AWS Lambda.</p><p><strong>What is covered in this article:</strong></p><ul><li>How to Create a Cloud9 Environment</li><li>How to create a Lambda Function from Cloud9</li><li>The basics of Cloud9</li><li>Use your Lambda Function from AWS Lambda</li><li>What are Event Triggers and how to use it</li></ul><h4>Creating a Cloud9 Environment</h4><p>Go to the <a href="https://aws.amazon.com/cloud9/">homepage</a> and click on the orange box <strong>Create environment</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1J11lgV0ap0J7y5Xp6FoGA.png" /></figure><p>Now you will need to give your environment a name and description. Then click <strong>Next step</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDrW4wPxtw_ntG7NSwhYOg.png" /></figure><p>In the <strong>Environment settings </strong>keep everything as is, except for <strong>Platform</strong>. Change it to <strong>Ubuntu Server 18.04 LTS</strong>.<strong> </strong>Then click <strong>Next step</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GwgWX9IvfsaWUgsfoD0pGQ.png" /></figure><p>Review your environment name and settings. Click <strong>Create environment </strong>if your setting is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zv-edz5o3-giPYyiM3hu7Q.png" /></figure><p>You will have to wait until your environment is created. We will create a Lambda Function when environment is ready.</p><h4>Create Lambda Function in Cloud9</h4><p>A <strong>Welcome tab</strong> will open up when your environment is made. Click on <strong>Create Lambda Function… </strong>to continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7qLA8bhEx0-iog0IENCq9g.png" /></figure><p>You can also create a Lambda Function by clicking on the <strong>AWS Resources</strong> tab on the right side. Then click on the <strong>Lambda+ symbol</strong> to create the function. You can create as many as you want and you will see the list of them under <strong>Local Functions</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*Qcey7BKVJ3L5RAkaJGzvEA.png" /></figure><p>Give your function a name and click <strong>Next</strong>.<br><strong>Note</strong>: <strong>Application name</strong> autofills with your <strong>Function name</strong> input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Tif8jmbbM8ooD_6879cxA.png" /></figure><p><strong>Select runtime</strong> to <strong>Python 3.6</strong> and click <strong>empty-python</strong>. Click <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBlKZ3Ybwf1kiNB1CPvPfQ.png" /></figure><p>Don’t change <strong>Function trigger</strong> and click <strong>Next</strong>. <br><strong>Note</strong>: You can change this if you know what you are doing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ktUTt33Olk8H_7L3aPvclw.png" /></figure><p>Don’t change any settings here and click <strong>Next</strong>.<br><strong>Note</strong>: For <strong>Memory (MB)</strong>, choose the amount of memory, in megabytes, that this function will use. To get more compute power increase <strong>Memory (MB)</strong>. 🤑</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gd7pRYqdxZePlrFxineehg.png" /></figure><p>Look over your Lambda function settings and click <strong>Finish</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CpbJ9D6oWq0m23AcMaubyg.png" /></figure><p>Now you have created a Lambda Function in <strong>AWS Cloud9</strong>. We are going to continue and learn the basics of <strong>Cloud9</strong>.</p><h4>Cloud9 Basics</h4><p>The following part will show you how to navigate your environment and test a function. <br>On the left side of your Cloud9 environment, you can view the folder structure. The Tutorial folder is your Cloud9 environment folder. The tutorial folder is where the lambda function files are located. If you click lambda_function.py it will open up and you can edit your function. The venv folder is where your dependencies is stored when you pip install in your <a href="https://docs.python.org/3/library/venv.html">virtual</a> environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*umZGmpZ9i_kNhoFna4xNVg.png" /></figure><p>Let’s pip install numpy in our Lambda Function environment. Right-Click tutorial and click Open Terminal Here.<br><strong>Note</strong>: This is just for a demonstration and not going to be used in the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*A_Celd8c1GtLdAc9gGhunQ.png" /></figure><p>It will open a new tab next to lambda_function.py.<br><strong>Note</strong>: If (venv) is in front of line you are using your virtual environment. 👍🏼</p><pre># to enable our virtual env<br>source vent/bin/activate</pre><pre># checking dependencies installed already<br>pip freeze</pre><pre># installing numpy in venv environment <br>pip install numpy</pre><pre># checking if numpy version installed correctly<br>pip freeze</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*CgZfo8gNTsdOkVMhOMEYhg.png" /></figure><p>Now you know how to install packages in your virtual environment. <br><strong>Note</strong>: Careful of the size of the packages. Lambda Function deployment size limit is 250MB.</p><p>The following code is the lambda function we will be using. Copy and paste it to your lambda_function.py.</p><pre>import numpy as np</pre><pre>def math(a, b):<br>    add = a + b<br>    sub = a - b<br>    mul = a * b<br>    div = a / b<br>    return print(&quot;add:&quot;, add, &quot;\nsub:&quot;, sub, &quot;\nmul:&quot;, mul, &quot;\ndiv:&quot;, div)</pre><pre>def lambda_handler(event, context):<br>    math(3,2)<br>    return &#39;You did it! :)&#39;</pre><p><strong>Save file(</strong>cmd+s<strong>)</strong> and press <strong>Run</strong> at the top center of the page. Then a side window will appear on the right. Click <strong>Run</strong> to test your function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tV_dmbtUXozqRyAPlCmnQw.png" /></figure><p>After you clicked <strong>Run</strong>, wait and check your result. You should get the same result. Important things to look at is the <strong>Max memory used</strong> and <strong>Time</strong>.<br><strong>Note</strong>: Some failures when running a lambda function could be a timeout issue. To fix it, you will need to right-click your function on the right and click <strong>Edit Config</strong>. (Max 15-minutes) You shouldn’t run into this issue with the code above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J8nxf5p3UbfZiiNkZBNBZQ.png" /></figure><p>We have a working Lambda Function and we should deploy it. On the right side open the <strong>AWS Resources tab</strong>. Right-Click your lambda function tutorial and click <strong>Deploy</strong>. Now wait for the loading symbol to disappear to know it completed the deployment with no failures. A pop-up will appear if the deployment failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*4XLZS80UZazQOEJVdDdurA.png" /></figure><p>Now we can move on to testing the function on <strong>AWS Lambda</strong>.</p><h4>Use Function in AWS Lambda</h4><p>Go to <strong>AWS Lambda</strong> from your console. On the right click on <strong>Functions</strong> and you will see a list of functions. Look for the function name that starts with cloud9-yourfunctionname-yourfunctionname-letters&amp;numbers and click on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DhrOvcfKAcSGpYm2sLaz5g.png" /></figure><p>The page you are on is that specific Lambda function dashboard. Towards the top to the right side, click on <strong>Select a test event </strong>and then click on <strong>Configure test events.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yt3a3IDH83lmqd9O1HEv0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*jxkCvwdvQ7eQUASKbjEUpQ.png" /></figure><p>We are going to test the lambda function by creating a test event. Click <strong>Create new test event </strong>and change <strong>Event name </strong>to anything you want. In the code block all we need is an open and close curly bracket. Then click <strong>Create</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dcD_JTaxfBoGN_1l5ZdI7w.png" /></figure><p>Select your <strong>test event</strong> and click <strong>Test</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*eA6OUQOhdpjUD2ghW6g2-Q.png" /></figure><p>You should get the same result in green if you did everything correctly. Otherwise read your error and try to debug. You could also restart this tutorial. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*5oe-mzVh-Ck7KlK0HX_smw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L_dNqeA_4Cm60bIDheX2Gg.png" /></figure><p>Important thing to look at is <strong>Duration </strong>to check how long it takes to execute your function. The <strong>Bill duration </strong>for billing information. The <strong>Log output </strong>to see your results or error message.</p><p>We were able to test your Cloud9 Lambda function from AWS Lambda. :)</p><h4>Event Triggers</h4><p>For a lambda functions to execute, an event must occur. You can set up a trigger that execute at a time interval. That is the example I’m going to show.</p><p>In your lambda function dashboard, click on <strong>+ Add trigger</strong> and select <strong>CloudWatch Events</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rx3JbX-f_9HFigg1VqOYTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yyKrAWL7zIdeAnCPufIbOg.png" /></figure><p>For <strong>Rule</strong>, select <strong>Create a new rule. </strong>Name your rule whatever you like. Give a short description for your rule. Select <strong>Schedule expression</strong> for <strong>Rule type</strong>. In the <strong>Schedule expression*</strong> field type <strong>rate(5 minutes)</strong> and this will trigger the function every 5 minutes. Check in <strong>Enable trigger</strong> and then click <strong>Add</strong> button.</p><p><strong>Note</strong>: Here is a list of Schedule <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html">expression</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fUxQfqw7W4ck8CZbv1PEw.png" /></figure><p>You have created a trigger and now you can click the trigger CloudWatch Events to see more details. The <strong>CloudWatch Events</strong> will display below with the rule name and you can Enable/Disable the trigger. Also you can delete the trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNVhoOrWLLe2kgJhXHiT6Q.png" /></figure><p>Now you know how to create a simple trigger that execute at a certain time interval. 🕒</p><p>Tutorial is over! Now you can create a Lambda Function in your cloud9 environment and set up a simple time event trigger. Make sure to delete your environment and lambda function to not run up your bill. Hopefully this introductory article made it easier to use AWS Services and you get to continue your learning with AWS. For any questions or mistake, please reach out to get it fixed. 😉</p><p>This article will eventually become part of a series of articles from lessons I learned with my team while working on a project called Cryptolytic (article will be written about this soon and linked here). It’s the guide we wish we had when working on the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJsKtTF3DrsmcdwfpA--dQ.png" /></figure><p><strong>The notebook containing all the code used in this article can be found </strong><a href="https://github.com/Cryptolytic-app/cryptolytic/tree/master/medium_articles"><strong>here</strong></a><strong> </strong>which is inside the repo of our Cryptolytic project — so if you’re curious, check it out!</p><p>Find me on Twitter <a href="https://twitter.com/malexmad">@malexmad</a>, <a href="https://github.com/malexmad">Github</a>, or connect with me on <a href="https://www.linkedin.com/in/marvin-davila/">LinkedIn</a>!</p><p>Sources:</p><ul><li><a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html">What is AWS Cloud9?</a></li><li><a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">What is AWS Lambda?</a></li><li><a href="https://github.com/Cryptolytic-app/cryptolytics">Cryptolytic-app/cryptolytics</a></li><li><a href="https://en.wikipedia.org/wiki/Integrated_development_environment">Integrated development environment - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86255e456747" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-create-an-aws-lambda-function-in-cloud9-86255e456747">How to Create an AWS Lambda Function in Cloud9</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Flask App to AWS Elastic Beanstalk]]></title>
            <link>https://medium.com/analytics-vidhya/deploying-a-flask-app-to-aws-elastic-beanstalk-f320033fda3c?source=rss-f97a8fcfb3cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f320033fda3c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[elastic-beanstalk]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <dc:creator><![CDATA[Marvin Davila]]></dc:creator>
            <pubDate>Wed, 11 Dec 2019 18:28:06 GMT</pubDate>
            <atom:updated>2019-12-23T21:19:54.545Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A Simple Tutorial (Using Python and MacOS) for AWS Beginners</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*22OKma7EXNXEq-9l" /><figcaption>Photo by <a href="https://unsplash.com/@nasa?utm_source=medium&amp;utm_medium=referral">NASA</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’re just getting started with AWS services, hopefully you’ll find this helpful! There are few errors I ran into when I started working with AWS. I’m providing solutions for each error. Now you don’t have to struggle and waste time.</p><h4><strong>What is Flask?</strong></h4><p><a href="https://pymbook.readthedocs.io/en/latest/flask.html">Flask</a> is a web framework written in python. It provides you with tools, libraries, and technologies that allow you to build a web application. This web application can be some web pages, a blog, a wiki or go as big as a web-based calendar application or a commercial website.</p><h4>What is AWS Elastic Beanstalk?</h4><p><a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html">AWS Elastic Beanstalk</a> is a service for deploying applications which performs various AWS services, including EC2, S3, Simple Notification Service, CloudWatch, autoscaling, and Elastic Load Balancers.</p><p>With Elastic Beanstalk, you can quickly deploy and manage applications in the AWS Cloud without worrying about the infrastructure that runs those applications. It reduces management complexity without restricting choice or control. You simply upload your application, and Elastic Beanstalk automatically handles the details of capacity provisioning, load balancing, scaling, and application health monitoring.</p><p><strong>What is covered in this article:</strong></p><ul><li>How to create a AWS Elastic Beanstalk environment</li><li>How to create a simple Flask App</li><li>How to upload your Flask App on AWS Elastic Beanstalk</li><li>How to debug errors</li></ul><h4>Creating the Application</h4><p>Go to <a href="https://console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/welcome">AWS Elastic Beanstalk</a> and click <strong>create a new application </strong>on the top right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sG_rRz2L2p3j0fkiZdJfrQ.png" /></figure><p>Click create after giving your application a <strong>name</strong> and short <strong>description</strong>. The name can be anything.</p><h4>Creating Environment</h4><p>Click <strong>create one now</strong> to create environment in your tutorial application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EF63Pha_Mji2CZ81bqKHHQ.png" /></figure><p>Now you have to select an environment tier. For this tutorial we will use a <strong>web server environment</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7IwgBJ3TQ1-KHabriiDXYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8x1PVjEmcdP46ku28jWehA.png" /></figure><h4><strong>Environment Information</strong></h4><ul><li>Give your <strong>environment</strong> a <strong>name</strong></li><li>Choose a unique name for the <strong>Domain</strong></li><li>Write a short <strong>description</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5QMCneuskDljPJcuvA-nw.png" /></figure><h4><strong>Base Configuration</strong></h4><ul><li>For this tutorial we are using <strong>python</strong> for our <strong>preconfigured platform</strong></li><li>We will upload the flask app later. For <strong>application code</strong> keep <strong>sample application </strong>selected.</li></ul><blockquote>Click Create environment. It should take a couple of minutes until it’s ready.</blockquote><h4>Create a Simple Flask App</h4><blockquote>If you want to skip this part, you can download this <a href="https://github.com/Cryptolytic-app/cryptolytic/blob/master/medium_articles/flask_app.zip">Flask Zip File</a> which contains all the files needed for the flask app and you can go directly to the <strong>Uploading a Flask App</strong> section :)</blockquote><p>Create a new file called application.py and paste the code below into it.</p><pre>from flask import Flask</pre><pre>application = Flask(__name__)<br><br>@application.route(&quot;/&quot;)<br>def index():<br>    return &quot;Your Flask App Works!&quot;<br><br>@application.route(&quot;/hello&quot;)<br>def hello():<br>    return &quot;Hello World!&quot;<br><br><br>if __name__ == &quot;__main__&quot;:<br>    application.run(port=5000, debug=True)</pre><p>Create a new file called requirements.txt and paste the app dependencies below into it.</p><pre>Click==7.0<br>Flask==1.1.1<br>itsdangerous==1.1.0<br>Jinja2==2.10.3<br>MarkupSafe==1.1.1<br>Werkzeug==0.16.0</pre><p>Create a <strong>folder </strong>named .ebextensions.<br>Copy the code below and save it as a new file called app.config in the folder .ebextensions.</p><pre>files:<br>  &quot;/etc/httpd/conf.d/wsgi_custom.conf&quot;:<br>    mode: &quot;000644&quot;<br>    owner: root<br>    group: root<br>    content: WSGIApplicationGroup %{GLOBAL}</pre><p><strong>Note:</strong> <em>The code block above was used in my project because I was having a </em><a href="https://stackoverflow.com/questions/41812497/aws-elastic-beanstalk-script-timed-out-before-returning-headers-application-p"><em>time out</em></a><em> error on Elastic Beanstalk. You might not need to use this solution for your deployment, but if you ever have a similar error this can help. Here is some documentation on </em><a href="https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIApplicationGroup.html"><em>WSGIApplicationGroup</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*1tyl7fXrZaF8SlEKTQVDNA.png" /></figure><p>Now you will need to zip all the files together(<em>including hidden folder</em>) to upload the flask app on Elastic Beanstalk. To view hidden files in your finder press cmd+shift+.. Name the zip file flask_app.zip or any name you want to give it.</p><h4>Uploading a Flask App to Elastic Beanstalk</h4><p>You should now have the flask app in a zip file with the following folder structure:</p><pre>- application.py<br>- requirements.txt<br>- /.ebextensions<br>     - app.config</pre><p>Sometimes when you create the zip file it will include hidden files that are not needed. This usually will cause an error when you try to upload on Elastic Beanstalk. In order to fix this follow the next steps.</p><p>Open terminal and go to where the zip file is located. <br><strong>Note:</strong> <em>This may not be in the same location where your zip file is saved. You can find your zip file and drag it to your Documents folder to follow along.</em><br><strong>Example:</strong></p><pre>cd Documents</pre><p><strong>Run this line below:<br></strong><em>replace </em><em>flask_app.zip with the name of your zip file if needed</em></p><pre>zip -d flask_app.zip __MACOSX/\*</pre><p><strong>Note:</strong> This picture is for my project flask app <a href="https://github.com/Cryptolytic-app/cryptolytic/blob/master/api_source_code/Flask_App.zip">zip file</a>. An example of what it can look like. You shouldn’t get the same result if you are following this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jGdLdQHErICvBsZlidWvQ.png" /></figure><p>This will clean out any extra hidden files that is included in you zip file. They are not needed to upload on Elastic Beanstalk and it might cause deployment to fail. Sometimes you won’t have any hidden files.</p><p><strong>Note:</strong> I run the line of code again and it returns a zip error. That’s good!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*HKCbrHq2WLQkld3EXuv6RA.png" /></figure><p>Now we are ready to upload our zip file to Elastic Beanstalk. Go back to your elastic beanstalk environment dashboard and click on <strong>Upload and Deploy.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqFz-D2NPTk_AK2yCxtI0w.png" /></figure><p>Choose your zip file and click <strong>deploy. </strong>Then wait until your health symbol is a green checkmark and click on your website link above the health symbol.</p><p>If you completed all these steps successfully, your website link should take you to a page saying Your Flask App Works! :)</p><h4><strong>How to view error logs in your environment?</strong></h4><p>For this tutorial you shouldn’t be getting any errors when deploying the simple flask app, but it is good to know how to debug.</p><p><strong>Follow Steps Below to view Error Logs</strong></p><p>On the left side in your Elastic Beanstalk environment dashboard click <strong>Logs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/1*y2yoYwEeaSXWQf751Ysxfw.png" /></figure><p>Then click on <strong>Request Logs</strong> and select <strong>Last 100 Lines</strong> for the most recent errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*0Vpj8lcXQUpur7ywZQAxLg.png" /></figure><p>Click <strong>Download</strong> and it should take you to a page where you can view the last 100 lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVyc340j6TrB31zq6J1-6g.png" /></figure><p>Below is an example error log page. Make sure you are looking at the most recent time when your application was executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QErSU9gYpWuNXq11qw-og.png" /></figure><p>Now you have access to your error logs and will be able to find a solution.</p><p>Tutorial is over! Now your flask app can be set up on <strong>AWS Elastic Beanstalk</strong>. If I had access to this article, it would have save me so much time when I was working on my project.</p><p>This article will eventually become part of a series of articles from lessons I learned with my team while working on a project called Cryptolytic (article will be written about this soon and linked here). It’s the guide we wish we had when working on the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B-wdxM3bDdq3nQG51_xWKw.png" /></figure><p><strong>The notebook containing all the code used in this article can be found </strong><a href="https://github.com/Cryptolytic-app/cryptolytic/tree/master/medium_articles"><strong>here</strong></a><strong> </strong>which is inside the repo of our Cryptolytic project — so if you’re curious, check it out!</p><p>Find me on Twitter <a href="https://twitter.com/malexmad">@malexmad</a>, <a href="https://github.com/malexmad">Github</a>, or connect with me on <a href="https://www.linkedin.com/in/marvin-davila/">LinkedIn</a>!</p><p>Sources:</p><ul><li><a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html">What is AWS Elastic Beanstalk?</a></li><li><a href="http://flask.palletsprojects.com/en/1.1.x/quickstart/#">Quickstart - Flask Documentation (1.1.x)</a></li><li><a href="https://github.com/Cryptolytic-app/cryptolytic">Cryptolytic-app/cryptolytic</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f320033fda3c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/deploying-a-flask-app-to-aws-elastic-beanstalk-f320033fda3c">Deploying a Flask App to AWS Elastic Beanstalk</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Bitcoin A Better Store of Value?]]></title>
            <link>https://medium.com/@malexmad/is-bitcoin-a-better-store-of-value-477b3e369073?source=rss-f97a8fcfb3cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/477b3e369073</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-storytelling]]></category>
            <category><![CDATA[store-of-value]]></category>
            <dc:creator><![CDATA[Marvin Davila]]></dc:creator>
            <pubDate>Fri, 28 Jun 2019 14:02:33 GMT</pubDate>
            <atom:updated>2019-12-23T21:18:53.845Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bitcoin’s Origin</h3><p>Bitcoin was initially released on <em>January 09, 2009</em> and created by <strong>Satoshi Nakamoto</strong>. Satoshi’s true identity is unknown and it could have been a group that created Bitcoin. It was created to become a <strong>peer-to-peer digital currency</strong> that can provide more economic freedom.</p><p>The underlying tech in bitcoin is blockchain. <strong>Blockchain</strong> is an online ledger that is used to verify and record transactions. A chain of digital blocks contain records of all transaction that is connected to all blocks before it. Every block is getting verified by miners around the world and getting rewarded in bitcoin. Bitcoin is implementing blockchain in a <strong>decentralize</strong> way to allow anyone to be miners. This takes away central power like world banks and give people economic freedom.</p><blockquote>Why Bitcoin? Is it safe to place your money in it?</blockquote><p>Bitcoin has a track record of over 10 years now and the network is more secured now than ever before. Blockchain is secured with <strong>cryptography</strong> and miners are verifying transactions. Adopters of bitcoin is increasing everyday and making the network stronger. Governments can’t shutdown bitcoin nor any other institution in this world.</p><blockquote>The graph below shows the amount of <strong>active address</strong>(BTC being sent/receive ) during May 2013 to November 2018.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emalex140%2F88%2Fbtc-price-active-address%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emalex140%2F88.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a11ee36b2c50b0a9d1eeb862528d29d/href">https://medium.com/media/9a11ee36b2c50b0a9d1eeb862528d29d/href</a></iframe><p>The graph shows a <strong>steady growth of active users</strong> until it hits a peak price in 2018. At this time there is steady uptrend and there is no sign of slowing down. Users around the world are learning about bitcoin and <strong>adopting</strong> it as a new currency.</p><p><strong>Anonymity</strong> is possible with your transaction like cash in the real world. This feature attract users who care about their privacy. Digital US cash and credit cards leaves an online paper trail and it should be data that is private. You’re able to hold your own funds in a <strong>secure wallets</strong>(e.g. paper, hardware wallets) or keep it in an exchange(not recommended). Able to send very large transaction anywhere in the world in minutes without going through any institution for permission and <strong>fees are absurdly low</strong>.</p><h3>What People Use Today</h3><blockquote>Where People Store Their Money</blockquote><ul><li>Gold / Silver</li><li>Stocks / Bonds</li><li>Property</li><li>Cash / Fiat Currency(<em>Sadly</em>)</li><li>Cds</li></ul><h3>Let’s Look At Data</h3><blockquote>Top performing stocks and gold against BTC <em>ROI</em></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emalex140%2F92%2Fbtc-roi-against-traditional-assets-roi%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emalex140%2F92.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe90167f3cb6f56caa6f2e91e2c88fbe/href">https://medium.com/media/fe90167f3cb6f56caa6f2e91e2c88fbe/href</a></iframe><h3>Why Is Bitcoin Outperforming Traditional Assets?</h3><blockquote>Let’s compare Bitcoin with gold because they are very similar then other assets.</blockquote><p>Gold is use to preserve wealth for many people and institution around the world. It’s a natural resource and there is a <em>finite amount on this world</em>. This makes it valuable because there is only so much we can dig up. People have been holding and trading gold for hundreds of years. Current time we don’t use gold as currency. It’s difficult to transact with gold compare to bitcoin. It’s not easy to carry gold around and hard to make a gold bar divisible. This is why we use cash and credit cards as a tool to transact the US Dollar.</p><blockquote>I wonder what will happen if we start mining gold off an asteroid or it just crashes right on earth. (Scarcity disappears=Value decreases)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*xpW3gXBDyhRfRR9J1Gi0Sw.png" /></figure><p>Bitcoin has a <strong>finite fixed supply of <em>21 million </em>BTC</strong> and it can be easily <strong>divisible </strong>in <strong>satoshi</strong>(0.00000001, satoshi is currently the smallest unit of the bitcoin currency<strong>)</strong>. You can carry around as much bitcoin as you want without lifting a pound. It can be sent anywhere in the world in matter of minutes. The cons of gold makes bitcoin a better alternative to store your wealth.</p><blockquote>Bitcoin has one major problem with stability of value, it’s very volatile. It’s new tech and hasn’t mature enough to stabilize the price.</blockquote><p>Stocks return on investment is great over the long term and majority of them are in tech field. Stocks have proven to be a reliable source to increase wealth over a long time frame with some hiccups on the way. Market valuation of tech stocks are highly debated to be overvalued and diversification is important to lower risk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pR_ct7fgPMy8FlqL-hQ0Q.png" /><figcaption>Shows Prediction Rate For The Next 4 Years</figcaption></figure><p>Cash is the main store of value for most people in the US. The graph above shows the inflation rate the US had over a period of 39 years. The average rate from 1999 to 2019 is 2.18%. People are losing purchasing power year over year at an average rate of 2.18% if they are holding US dollars. Only holding cash to preserve wealth wouldn’t be a great idea.</p><h3>What Makes A Good Store Of Value</h3><ul><li>Scarcity ✔️</li><li>An asset that can be saved, and exchanged at a later time ✔️</li><li>Portability ✔️</li><li>Divisibility ✔️</li><li>Stability of Value ❌</li><li>General Acceptability ❌✔️</li><li>Homogeneity ✔️</li></ul><blockquote><em>Bitcoin passes 5.5/7 top qualities above(as of today’s date).</em></blockquote><h3>Conclusion</h3><p>Bitcoin is a <strong>better version of gold</strong> that gives people ease of access to use. There is a growing community for bitcoin and army of programmers who want to make a <strong>decentralize monetary system</strong> a reality.</p><p>The only downfall of Bitcoin is the <strong>volatility</strong> that could deter away a-lot of potential users. It’s the closest thing we have to a true free market and will cause the price to be volatile at first. <strong>User experience</strong> needs more work for an average non-tech person to adopt. It’s a wild experiment started by an unknown person or group.</p><p>The long term view for bitcoin is to surpass <strong>gold’s market cap of 7 trillion dollars</strong>. Currently bitcoin is around <strong>~200 billion market cap</strong>. We have a long way to go, but I believe it won’t take that long.</p><blockquote><a href="https://colab.research.google.com/github/MAL3X-01/DS-Unit-1-Sprint-5-Data-Storytelling-Blog-Post/blob/master/BitcoinStorytellingProject.ipynb">Notebook(Google Colab) </a>— <a href="https://github.com/malexmad">Github</a> — <a href="https://marvinadavila.com/">Portfolio Website</a></blockquote><p><em>Note: This post is not investment advice. Before you make changes to your investment portfolio, you should do your own research and/or talk with a financial advisor.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=477b3e369073" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>