<?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 Jordan Estes on Medium]]></title>
        <description><![CDATA[Stories by Jordan Estes on Medium]]></description>
        <link>https://medium.com/@jordan.estes?source=rss-6f93c7547855------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pvLFXpf0VyjvaWvX.jpg</url>
            <title>Stories by Jordan Estes on Medium</title>
            <link>https://medium.com/@jordan.estes?source=rss-6f93c7547855------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 24 May 2026 02:25:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jordan.estes/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[Ruby on Rails, an Overview]]></title>
            <link>https://medium.com/@jordan.estes/ruby-on-rails-an-overview-aebb4d3fabf6?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/aebb4d3fabf6</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Sat, 18 May 2019 22:34:04 GMT</pubDate>
            <atom:updated>2019-05-18T22:34:04.871Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*pVwCUKP74pg3-slSdZioMw.jpeg" /></figure><p>Ruby is a dynamically typed, object-oriented, interpreted scripting language written in C. It was created by Yukihiro ‘Matz’ Matsumoto in Japan in 1993 and was released publicly in 1995. Its intuitive design and structure have led it to become one of the most popular programming languages. It’s basic functionality can be greatly enhanced through the use of libraries that are downloaded as ‘gems’. Since Ruby is an interpolated language it runs equally well across all platforms without the need to compile for a specific processor or operating system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7-EPsVM5Eld4bMVyWkZgDw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5cukG51YzB3wniCfQ2b7kg.png" /></figure><p>Rails is a server-side framework for Ruby that uses the MVC architecture with default structures for web services, web pages, and databases. It was created in Ruby in 2003. It is seen as one of the first major frameworks for creating dynamic web apps with frameworks with other frameworks like Django for Python, Catalyst in Perl, and Sails.js for JavaScript borrowing heavily from the ideas laid out in Rails. It uses many web standards like HTML, CSS, JavaScript, and JSON to help build reactive web apps. Rails also emphasizes the importance of DRY (Don’t Repeat Yourself), or the idea that modularity should allow for extensive reuse of code that needs to be used in multiple places. Similarly Rails uses ‘Fat models, skinny controllers’, meaning that the majority of the logic and processing is handled by the models as apposed to the controllers. It also uses the idea of Convention over Configuration, or the idea that the structure of the app should follow the established patterns set out in the Rails framework, and that developers shouldn’t deviate from this just for convenience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*4Iz7mYm51jZk-nwDXTNY_Q.jpeg" /></figure><p>In Rails the ‘model’ is in the form of an Active Record data type. This data type stores values and methods for accessing those values directly on the object itself. This allows the model to act as an ORM. Active Record are able to represent data, represent relationships with the data, represent inheritance between models, validate data models before database entry, and interact with the db in an Object-oriented way. The action view is the view component of the MVC, each component has a corresponding view in the app/views directory. The templates for the views use a mix of embedded ruby and html in .erb files and xml in .builder extension files. Erb files that have html will often be designated by &lt;filename&gt;.html.erb. Partials can also be used to build small reusable components that you can use throughout different parts of your code. The controller part of the MVC layout is the action controller. It handles requests once they have been appropriately routed. They handle the processing of the requests and responses. The controller ends up acting as a middleware between the models and the views.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*j-vhoT8YHSW0ePZVyAEaAQ.png" /></figure><p>Overall, Ruby on Rails is a powerful, but easy to understand framework built off a programming language that is also intuitive and direct. The emphasis on DRY and CoC keeps the code clean and modular and allows for creative reuse of components. The built in ORM and router help keep data organized and the templating system allows for easy rendering of views.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aebb4d3fabf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django]]></title>
            <link>https://medium.com/@jordan.estes/django-bdc048bebfa2?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdc048bebfa2</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Mon, 13 May 2019 04:19:28 GMT</pubDate>
            <atom:updated>2019-05-13T04:19:28.783Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVKOLLX7wprRbHTl2IPDcQ.png" /></figure><p>Django is a python framework that follows the Model-View-Template design pattern. It was created in 2003 and then publicly released under the BSD license in 2005. It was designed to allow fast production. Built with many tools including tools for authentication, site maps, and RSS feeds. It was created with scalability in mind so it can be used by companies like the MacArthur Foundation, Pintrest, Instagram, National Geographic, and Mozilla. It follows the MVC architecture where the model is an ORM that handles python classes and a relational database. The view is comprised of a web templating system that handles http requests. The Controller handles a url dispatcher that uses regexs and acts as a router. Django’s built in tools include a development and testing server, a form validation and serialization tool that can handle html and format it for databases, and an internal dispatcher so that different components can talk to each other. It has become so popular its templating system has been ported to other languages including liquid for Ruby, Template::Swig for Perl, Twig for JavaScript and PHP, and ErlyDTL for Erlang.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GO4i98dJpRetiCPw0S2-eQ.png" /><figcaption>Django’s MVT structure</figcaption></figure><p>Django really embraces modularity. Each piece of a server can be built easily in Python with packages that handle specific tasks. Django lets you snap the pieces of a website together like a model train set. You have your main pieces of track that are the core and tools from Django, that you can mix with special sections of track, that are the packages and extensions you can bring in to the project all working together to allow for scalability and rapid development.</p><p>Built using Python, one of the most used programming languages, Django is easy to learn, readable, and versatile. Django works great for building content management systems, booking engines, and client relationship management. It can also be used for verification, machine learning, email solutions, and data analysis. Since it has been around since 2003 it has a rich development history and very mature and well perfected core.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*1ZJAmxlCuFDqqKfR--OKpQ.png" /></figure><p>Since it was designed to be a solution out of the box it does have a few problems, including how hard it is to change certain components like the ORM without having to do a lot of extra work. Django is also suited more for large-scale web applications, for smaller projects frameworks like Flask would work better. Django also doesn’t have out of the box support for Websockets, making it difficult to make real-time web apps without other frameworks.</p><p>While far from a perfect solution for small scale applications and websites, Django works great for large scale problems that require scalability and rapid development. Since its built with Python it’s easy for people familiar with Python to jump right into building web apps. Its support for external platforms and libraries allows you to truly customize your app in almost any way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdc048bebfa2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JSON Web Tokens]]></title>
            <link>https://medium.com/@jordan.estes/json-web-tokens-21eedf9424e1?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/21eedf9424e1</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Thu, 02 May 2019 21:41:40 GMT</pubDate>
            <atom:updated>2019-05-02T21:41:40.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*XkmnsJ6Joa6EDFVGUw0tfA.png" /></figure><p>JSON Web Tokens or JWT is an access token method that allows the server to allow access to a certain user by generating a token for that user and the specific level of access. It is structured with three parts, the header, the payload, and the signature. The header contains information on the algorithm used to sign the token. The payload has the information about the token which is one of the seven Registered Claim Names. The registered claims are “iss”, “sub”, “aud”, “exp”, “nbf”, “iat”, and “jti”. “iss” is for the issuer of the token. “sub” is the subject of the token. “aud” is the audience of the token. “exp” Is the expiration date of the token, it must be some time in the future. “nbf” is the time before the token is actually good and usable. “iat” is the time that the JWT was issued. Lastly “jti” is the unique identifier for the JWT so that it can be a one time use token. The signature itself is the encoded data, this securely validates the token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4W8JT5yod3lBvYSL6uN1DQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dPg_VDFOG9287nxVv3TTg.png" /></figure><p>The server generates and signs the JWT and then sends that to the client. The token is then saved in the local storage or on a cookie and then can be sent back to the server to authenticate access to certain routes. The token is sent in the authorization header and is structured as a key value pair with authorization as the key and then Bearer and the token as the value. This allows access on the server side without authenticating the user every time and is more efficient than making a database call every time a user attempts to access a protected route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7T41R0dSLEzssIXPHpvimQ.png" /></figure><p>JSON web tokens are especially useful for authorization and information exchange. For Authorization JWT is helpful so that once a user is Authenticated and signed in they have access without constantly re-authenticating. Once a user has logged in they are given an access token and the token is just checked at protected routes that are specifically allowed on the token. JWTs are also good for exchanging information because they are signed and can be secured using public/private key pairs, so you can be sure that the sender is who they say they are. Since the payload is also included in the JWT you can ensure that none of the data has been tampered with also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-oSzhepAUeYrTBCSUQhvQ.jpeg" /></figure><p>While there are some common drawbacks to JWT they can be avoided for the most part by following 3 simple steps. The first drawback is that JWTs can be sent using no algorithm for encryption so it is always important to maintain a specific standard for what algorithm and other headers you are using and if the incoming JWT has the wrong algorithm discard it immediately. Since all JWTs are signed, it is important to know the algorithm that and what security they provide. Make sure you know the authenticity, confidentiality, and integrity of the algorithm you are using. Finally, its important that you use an appropriate key size. That means don’t use HMAC keys shorter than 256 bits, AES keys shorter than 128 bits, and RSA keys shorter than 2048 bits, or 1024 for legacy. By following these three steps you can avoid the pitfalls of human error that can leave a well secured system, JWT, vulnerable to exploit.</p><p>Referneces:</p><p><a href="https://en.wikipedia.org/wiki/JSON_Web_Token">https://en.wikipedia.org/wiki/JSON_Web_Token</a></p><p><a href="https://scotch.io/tutorials/the-anatomy-of-a-json-web-token">https://scotch.io/tutorials/the-anatomy-of-a-json-web-token</a></p><p><a href="https://jwt.io/introduction/">https://jwt.io/introduction/</a></p><p><a href="https://hackernoon.com/json-web-tokens-jwt-demystified-f7e202249640">https://hackernoon.com/json-web-tokens-jwt-demystified-f7e202249640</a></p><p><a href="https://flaviocopes.com/jwt/">https://flaviocopes.com/jwt/</a></p><p><a href="https://connect2id.com/products/nimbus-jose-jwt/vulnerabilities">https://connect2id.com/products/nimbus-jose-jwt/vulnerabilities</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21eedf9424e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis]]></title>
            <link>https://medium.com/@jordan.estes/redis-e305f1d3c856?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/e305f1d3c856</guid>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Wed, 24 Apr 2019 21:29:46 GMT</pubDate>
            <atom:updated>2019-04-24T21:29:46.688Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_5t7dREEWPPxoAjVAY2lg.png" /></figure><p>Redis, or Remote Dictionary Server is a key-value database that stores data as data-structures in memory. It has support for strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes. Redis stores all its data in memory and then uses a process called snapshotting a process that allows for data to be asynchronously transferred to the disk. Redis writes to the file-system once every 2 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*KnALR4dweZz7elYMY93HxA.png" /></figure><p>The biggest benefits to using an in memory database is performance. Since the data is not retrieved from the disk, lookups and writes are much faster than normal databases. These performance advantages allow Redis to be used for session caching, page caching, message applications, and counting. GitHub, Weibo, Pinterest, Snapchat, Craigslist, Digg, StackOverflow, and Flickr all use Redis because of its speed and reliability. It is supported by almost all major programming languages, notably JavaScript, Java, Go, C, C++, C#, Python, Objective-C, and PHP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*ZmQlKRViiflD6ocKM3k45A.png" /></figure><p>Redis also allows for sub/pub interactions and messaging. Basically, a client sends a “SUBSCRIBE &lt;whatever&gt;” command and then connected to that Redis can “PUBLISH &lt;whatever&gt;” and the subscriber is updated with that information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*ntIVQfKXINBbWw5cCLckBA.png" /></figure><p>Users can also unsubscribe using the “UNSUBSCRIBE” keyword. Redis tracks clients and using a pubsub_channels variable that links subscriptions with specific connections to clients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*AmmNB7uzfURmdSut5xHMNA.png" /></figure><p>Since Redis is stored in memory, you cannot have data larger than the memory available. This can be a problem for large files or very complex data-structures. If Redis runs out of memory, it can cause Redis to crash or slow down substantially while it tries to juggle resources. Another issue is that Redis is single threaded and does not allow multiple interactions at the same time, however they are working on making it multi-threaded, and right now you can use multiple instances of Redis at the same time to effectively act like it’s multithreaded.</p><p>Redis is different from other Databases in that it stores its data in memory, acting as sort of a database and sort of a cache. The data is also stored on disk in a format that is not very conducive to random access, but allows for the cache to be rebuilt after system restarts or power interruptions. The access of data is also different from other databases in that the data is not accessed via query to the database engine, but instead is a specific set of instructions that are performed on abstract data types. It also makes use of Forks to serve data to people and copy data to its persistent memory. Redis allows for storage of keys and values as large as 512MB meaning that you can have a key/value pair that is as large as 1GB</p><p>Resources:</p><p><a href="https://codeburst.io/redis-what-and-why-d52b6829813">https://codeburst.io/redis-what-and-why-d52b6829813</a></p><p><a href="https://en.wikipedia.org/wiki/Redis">https://en.wikipedia.org/wiki/Redis</a></p><p><a href="https://dzone.com/articles/10-traits-of-redis">https://dzone.com/articles/10-traits-of-redis</a></p><p><a href="https://making.pusher.com/redis-pubsub-under-the-hood/">https://making.pusher.com/redis-pubsub-under-the-hood/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e305f1d3c856" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphQL vs. RESTful APIs]]></title>
            <link>https://medium.com/@jordan.estes/graphql-vs-restful-apis-a1d3344680e5?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1d3344680e5</guid>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 14:34:03 GMT</pubDate>
            <atom:updated>2019-04-17T14:34:03.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*_izSrlg0UbFEALNiBa2boA.png" /></figure><p>Developed by facebook in 2012, graphQL is a language used to query data from apis. It was used exclusively in house by facebook until it was made public in 2015. in 2018 it was spun off into a foundation under the control of the linux foundation. It was designed for more flexibility and efficiency than RESTful APIs.</p><p>GraphQL is an alternative architecture for APIs to serve data. instead of the traditional REST architecture where GET and POST requests are made to endpoints, GraphQL allows for querying data directly from one endpoint. The client decides the structure of the data they want to receive, which cuts down significantly on unnecessary transfer of large quantities of useless data. Instead of sending the request to a specific endpoint and getting back all the data from that endpoint, GraphQL allows you to send a GET request with a specific query and receive just the wanted data back in the format specified.</p><p>A big difference between GraphQL and REST is that on a REST API you have to know the specific endpoints for where the data you want is kept. This can be inefficient if you need data from different endpoints. It can also be confusing if an API is not well documented. With GraphQL you just need to send a query to the GraphQL server and then the data is returned to you in the format you requested. This also prevents under and over fetching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8C-_H9rXNsXqXNUiW6wZfg.png" /></figure><p>For example say you wanted to get a list of user names, posts, and friends from a server. With REST you would send a GET request to the ‘/users’ endpoint, you get back an JSON object with an array of client objects. Each of these objects contain a user name, a birthday, and an address. The only data you wanted was the name of the user, so you now have all this data that you have to parse, just to get to the information you wanted in the first place. Also if their is a giant user list you would be using unnecessary resources every time you wanted to get a new user’s name. Another equally frustrating problem with REST is under-fetching data. So now that we have a list of the users that we needed, we also want to get a list of posts that each client is working on. So now for each client we have to make another GET request to ‘/users/&lt;user_id&gt;/posts’ followed by a separate GET request to ‘users/&lt;user_id&gt;/friends’. We then have to parse the data we get back from the friends endpoint just to get the names of the friends. If we have a large user list, this is a large amount of requests, just to get the name of a user, their posts, and their friends names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbheCx0tCzyFv9wGDGTVjA.png" /></figure><p>GraphQL uses a strong type system that allows for the user to know exactly what they are getting from the server. The schema for the server defines all the types that the API allows access to. This allows the client to know exactly how to access the specific data that they want as apposed to just getting back a collection of possibly useless data from an endpoint.</p><p>While more familiar and popular, RESTful APIs are not without their faults. For smaller projects with few endpoints and specific data, they are just fine. However when you have huge sets of data, GraphQL can be much more efficient and precise. GraphQL allows the user to truly control how and what data they get back from an API.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1d3344680e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Callbacks vs. Promises]]></title>
            <link>https://medium.com/@jordan.estes/callbacks-vs-promises-40994ce381?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/40994ce381</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Mon, 01 Apr 2019 13:47:01 GMT</pubDate>
            <atom:updated>2019-04-01T13:47:01.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*-6oal0TAPyU4ghiYQCqJDA.jpeg" /></figure><p>Asynchronous code is code that lets many things happen at the same time. a process starts, the code continues to run in the background, and then the first process finishes and then the program uses the result. Since javascript is not a multi-threaded programming language we have to use asynchronous code to perform actions that take a while. For example when a program makes an http request to a server the request is made, the rest of the code following the request is then run and then when the http request is finished we can then handle the data we received. This can cause problems for programs since javascript will just keep running without waiting for that response from the http request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*M8iLoUbaWZTi_TXua50ysg.png" /></figure><p>Callbacks can help solve this problem. Callbacks are functions passed into other functions as an argument. When passed into an asynchronous function they are able to handle data that we have to wait to receive. For example when we make an http request with a callback we make the request with an async function, pass in our callback and inside the callback we have our code to handle the request when it comes back. The callback function just sits there waiting until the async code is finished before it is even executed, allowing us to ensure that the data we are getting is handled correctly.</p><p>Callbacks, while useful have their drawbacks. The biggest drawback is readability. It can be difficult to see what is going on in a long string of callbacks, otherwise known as callback hell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*V2WntjQ4jgLgK2utEKarFg.png" /><figcaption>Callback Hell</figcaption></figure><p>Promises are objects that are created using the Promise constructor. Promises have a promise function that has two callbacks, resolve and reject. promises have different stats, fulfilled — the function of the promise succeeded, rejected — The function of the promise failed, pending — we’re still waiting for the function to finish, and settled — it’s with been fulfilled or rejected. Once the promise is settled, the data is sent to the resolve callback and is returned. if it failed the error is sent to the reject callback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4gHNZCRC9YfzCK7BRhbXfQ.png" /></figure><p>Promises allow for easy chaining and easy error handling. When a promises is returned the .then method on the Promise can be called and used to access the data from the promise-returning function. These then calls can be chained together and each subsequent return from a .then statement is passed along to the next .then statement. Errors are thrown to a .catch method that allows you to handle the error and keep the code working.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40994ce381" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Virtual DOM]]></title>
            <link>https://medium.com/@jordan.estes/the-virtual-dom-7ab5191cde7a?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ab5191cde7a</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Tue, 19 Mar 2019 21:36:13 GMT</pubDate>
            <atom:updated>2019-03-19T21:36:13.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*4Yf669zPiR0TYBaXlcpK1Q.png" /></figure><p>What is the DOM — The DOM, which stands for Document Object Model, is a tree-like structure used to represent the structure of a websites HTML, XHTML, and XML document. Each node on the DOM tree is an object that represents a part of the website. For example the &lt;body&gt; tag at the top of a website’s content would be like the root, the other tags that are contained within the body. Those individual tags could contain more tags and so on. The DOM can be changed an manipulated and then will re-render the content of a website. This can be very time consuming considering how large websites can be these days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*auMZqUkU4syrPT7Nhft-4A.png" /></figure><p>What is the virtual DOM — The virtual DOM attempts to help rectify this problem. Many javascript frameworks will inefficiently handle DOM manipulation. React has tried to fix this by implementing the virtual DOM. Every DOM object has an associated virtual DOM object that mirrors the actual DOM object. React re-renders the virtual DOM whenever a .jsx object is rendered. Even though re-rendering the entire real DOM is costly because it has to redraw the entire actual website, re-rendering the virtual DOM just changes the virtual DOM structure. React then compares the new virtual DOM with the virtual DOM before the changes were made. It finds the objects that have changed and then re-renders those elements to the actual DOM, saving time by only redrawing those DOM objects. This is called ‘diffing’, it checks to see which objects need to be discarded and which ones need to be updated and it makes those necessary changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OY-um1C1N9evOIlYjzADZg.png" /></figure><p>The virtual DOM is necessary to speed up the process of handling dynamic properties and events inside an HTML document. Since JS can manipulate the DOM directly it is important for DOM re-renders to be as efficient as possible. Using the virtual DOM allows these actions to be preformed quickly and with the least steps possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ab5191cde7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CORS/Same-orign Policy]]></title>
            <link>https://medium.com/@jordan.estes/cors-same-orign-policy-30e82fd78459?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/30e82fd78459</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Thu, 14 Mar 2019 19:09:23 GMT</pubDate>
            <atom:updated>2019-03-14T19:10:33.575Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*XlHb9e7poPKSoGUG5nf6Hg.jpeg" /></figure><p>The basic idea behind same origin policy is that websites are allowed to access data from another web page, but they must have the same origin. This only applies to scripts and prevents malicious scripts from running from one page accessing data on another. Since javascript can manipulate the DOM it has access to all the HTML elements.</p><pre>function <strong>createCORSRequest</strong>(method, url) {</pre><pre>var xhr = new <strong>XMLHttpRequest</strong>();</pre><pre>if (&quot;withCredentials&quot; in xhr) {</pre><pre><em>// XHR has &#39;withCredentials&#39; property only if it supports CORS</em></pre><pre>xhr.<strong>open</strong>(method, url, true);</pre><pre>} else if (typeof XDomainRequest != &quot;undefined&quot;) { <em>// if IE use XDR</em></pre><pre>xhr = new <strong>XDomainRequest</strong>();</pre><pre>xhr.<strong>open</strong>(method, url);</pre><pre>} else {</pre><pre>xhr = null;</pre><pre>}</pre><pre>return xhr;</pre><pre>}</pre><p>If you were logged into a website with sensitive data and you forgot to log out, without CORS you would be vulnerable to another website that you visit accessing your data from the site you forgot to log out of. You would never know that your data had been accessed or that a malicious script was even run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*O2QB8zBNMs7SN44AhGdPrg.png" /><figcaption>For same origin policy to work, the protocol, subdomain, domain, and port must match on both websites.</figcaption></figure><p>How can we deal with this problem? Same origin policy works by looking at the website a script is coming from and checks to make sure it has the same. It checks to make sure it has the same protocol like http:// or https://, it checks to make sure the subdomain is the same like www. or video. or drive.. then it checks if the domain name is the same. finally it makes sure that the port is the same. If all these are the same than the same-origin policy allows the site to run a script on another site.</p><p>While this is great at preventing cross site scripting, same-origin policy is a problem for websites that span multiple subdomains or domains. This can also be a problem when we send AJAX requests to servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*riD_yRADt69B1WczjD7uhQ.png" /></figure><p>Enter CORS. With CORS, or Cross Origin Resource Sharing the site sending a script sends a special ‘origin’ header that has the origin of the script. The server then sends the header ‘Access-Control-Allow-Origin’ allowing the site attempting to pass the script to run that script on another domain. The major problem with CORS is that it is difficult for developers to know exactly what domains they want to give access to the ‘Access-Control-Allow-Origin’ header, so they often just use a * wildcard. This basically undoes any of the protections that CORS provides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uboD-vcoqnK5vK_-lCq45A.png" /></figure><p>Security is important to web developers. Policies like the same-origin policy help to mitigate these threats while still providing functionality. Using tools like CORS can further provide functionality and usability for developers so that we can provide services across domains and subdomains.</p><p>Resources:</p><p>Info</p><p><a href="http://www.aosabook.org/en/500L/the-same-origin-policy.html">http://www.aosabook.org/en/500L/the-same-origin-policy.html</a></p><p><a href="https://en.wikipedia.org/wiki/Same-origin_policy">https://en.wikipedia.org/wiki/Same-origin_policy</a></p><p><a href="http://www.ajax-cross-origin.com/how.html">http://www.ajax-cross-origin.com/how.html</a></p><p><a href="https://zinoui.com/blog/cross-domain-ajax-request">https://zinoui.com/blog/cross-domain-ajax-request</a></p><p>Graphics</p><p><a href="https://en.wikipedia.org/wiki/Same-origin_policy">https://en.wikipedia.org/wiki/Same-origin_policy</a></p><p><a href="https://doepud.co.uk/blog/anatomy-of-a-url">https://doepud.co.uk/blog/anatomy-of-a-url</a></p><p><a href="https://zinoui.com/blog/cross-domain-ajax-request">https://zinoui.com/blog/cross-domain-ajax-request</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30e82fd78459" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[B-Tree]]></title>
            <link>https://medium.com/@jordan.estes/b-tree-23bf7cbedbc3?source=rss-6f93c7547855------2</link>
            <guid isPermaLink="false">https://medium.com/p/23bf7cbedbc3</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jordan Estes]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 12:00:01 GMT</pubDate>
            <atom:updated>2019-03-11T12:00:01.148Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GrcQ_ZaGgX7uUJdRA2PFaA.png" /></figure><p><strong>What</strong> is a tree? The basic structure of a tree is simple. A tree is a data structure. we call it a tree because its structure resembles an upside down tree. the top node of the tree is called the root, the child nodes of the root are called branches, and nodes without children are called leaf nodes. Values are stored on each node and nodes are accessible via their parent nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*nvqUHITvOxYfBcJ2Q_bitA.png" /><figcaption>Basic tree data structure. Root node is on top, the branch nodes are next and the leaf nodes are on the bottom.</figcaption></figure><p>So what is a B-Tree? The basic structure of a B-Tree is slightly different from a traditional tree. It still has root, branch and leaf nodes, but unlike a traditional tree structure, all the leaf nodes must be at the same depth as each other. this means that the leaf nodes will all be <em>n</em> branch nodes from the root. This is achieved by the b-tree’s unique features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*yJphRrnHt-ztmmTAYblUKg.png" /></figure><p>What makes a B-Tree unique? Each node of a B-Tree contains keys. The minimum amount of keys on the root is 1. If k is the number of keys on a node that node will have k+1 child nodes. This is because of how data is stored on a B-Tree. If we look at the constructor function below for a B-Tree node, you’ll notice that this._children is the size this._children plus one.</p><pre><strong>const NKEYS = 4;</strong></pre><pre><strong>function BTreeNode() {</strong></pre><pre><strong>this._keys = arrayOfSize(NKEYS);</strong></pre><pre><strong>this._children = arrayOfSize(NKEYS + 1);}</strong></pre><p>If the node contains one key, the children to the left of the node will contain lesser values, and the node to the right will contain larger values. If there are two keys, k1 and k2 , the left child contains values less than k1, the middle child will contain values between k1 and k2, and the right child will contain values greater than k2. As nodes fill up with values, they split. The tree then balances by passing the values. If a node on the left right of the tree fills, it passes its value up and a new tier or leaf nodes is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*WC4IoA8oi0Z5V1JP-eJMFw.jpeg" /><figcaption>As 18 is added to the leaf node, it passes 19 up and splits the leaf in two giving us one node for 18 and one for 22.</figcaption></figure><p>What are the benefits of B-Trees? The time complexities for search, insert, and delete is O(log n). B-Trees are still a self balancing tree like a binary tree, except it can contain more than two child nodes per node. They are great for storing large amounts of data. Since large amounts of data need to be stored on disk drives and not in memory, speed of read time is important. With the help of an auxiliary index can help speed searches, having only 1% of the entries of the B-Tree, it can tell you on which blocks to start your search, cutting your time down immensely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nXlvD-SukM1JX2qQx9zPdA.jpeg" /></figure><p>B-Trees are a self-balancing data structure. They are ideally suited for working on large databases of information. Their unique structure allows them to store multiple values on each node and always have one more child node than number of the values stored. All leaf nodes are at the same depth, which helps to balance the tree and keep the time complexity for search, insert and delete to O(log n).</p><p>Resources:</p><p>Info:</p><p><a href="https://www.cpp.edu/~ftang/courses/CS241/notes/b-tree.htm">https://www.cpp.edu/~ftang/courses/CS241/notes/b-tree.htm</a></p><p><a href="https://www.geeksforgeeks.org/b-tree-set-1-introduction-2/">https://www.geeksforgeeks.org/b-tree-set-1-introduction-2/</a></p><p><a href="https://medium.com/basecs/busying-oneself-with-b-trees-78bbf10522e7">https://medium.com/basecs/busying-oneself-with-b-trees-78bbf10522e7</a></p><p><a href="https://www.bluerwhite.org/btree/">https://www.bluerwhite.org/btree/</a></p><p><a href="https://www.chiark.greenend.org.uk/~sgtatham/algorithms/cbtree.html">https://www.chiark.greenend.org.uk/~sgtatham/algorithms/cbtree.html</a></p><p>Graphics:</p><p><a href="https://www.cpp.edu/~ftang/courses/CS241/notes/b-tree.htm">https://www.cpp.edu/~ftang/courses/CS241/notes/b-tree.htm</a></p><p><a href="https://en.wikipedia.org/wiki/Tree_(data_structure)">https://en.wikipedia.org/wiki/Tree_(data_structure)</a></p><p><a href="https://pixabay.com/vectors/tree-autumn-winter-forest-1994653/">https://pixabay.com/vectors/tree-autumn-winter-forest-1994653/</a></p><p><a href="https://en.wikipedia.org/wiki/B-tree">https://en.wikipedia.org/wiki/B-tree</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23bf7cbedbc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>