<?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 Ian Charles on Medium]]></title>
        <description><![CDATA[Stories by Ian Charles on Medium]]></description>
        <link>https://medium.com/@iacharles257?source=rss-60748cd25f71------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aJugRPEyBAp7X6lB.jpg</url>
            <title>Stories by Ian Charles on Medium</title>
            <link>https://medium.com/@iacharles257?source=rss-60748cd25f71------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:32:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iacharles257/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[Brief Intro Into Elixir]]></title>
            <link>https://medium.com/@iacharles257/brief-intro-into-elixir-3a3982482625?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a3982482625</guid>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Fri, 01 Nov 2019 20:57:31 GMT</pubDate>
            <atom:updated>2019-11-01T20:57:31.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*UQ7YUBULD3WxFX_S.png" /></figure><p>As a programmer the goal is always to write maintainable and scalable code. Following the Functional Programming paradigm can help assist in reaching those goals. Before diving into elixir lets take a quick detour into functional programming. So what is Functional Programming ? Functional Programming is a paradigm or style that focuses on immutability and pure functions. It evolved from lambda calculus, which is a mathematical system built around function abstraction and generalization. Now lets get back on track with Elixir.</p><p>So first thing first. What is Elixir? Elixir is a functional programming language that runs on the Erlang virtual machine. It’s open source and provides design and production tools. By leveraging the Erlang Virtual Machine, it shares similar abstraction like distributed and fault-tolerant systems, and also being used in web development and the embedded software domain.</p><p>Lets look at some code in Elixir to get a better picture of how it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*tn0LhCcM9GDtH-FNcVWGPQ.png" /></figure><p>All methods in Elixir are created using the def keyword, a name, and a code block. Instead of using curly braces to determine when a method starts and finishes, Elixir uses do and end. Anything that goes inside the do and end is considered inside of the code block. Above we have a method called create_deck which is meant to create a small deck of cards. Inside of the method we have two lists/arrays. One in which we will store our value of each card and the other which will store the suit. In order to iterate through each collection we have to write a loop. Similar to a JavaScript for of loop, Elixir uses a backwords arrow instead of “of” a name for each value and the collection itself. So with the code above we can generate a small deck of playing cards .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*HOtTORNTwzLuvbkOotJi2w.png" /></figure><p>So now we can move on to actually shuffling our deck of cards. Here is where immutability comes into play major. Elixir doesn’t know anything about a instance of or inheritance. The Elixir standard library has a ton of modules with methods that can be used to help do what you need to. In this instance we are using the Enum module that has a set of algorithms that enumerate over enumerables. So instead of having to write our own function that shuffles a list of values we can just use this already built in method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*ezWHsH_3aPQlyLF5nXk2jg.png" /></figure><p>So every time we create a new deck of cards, we pass in our list of values and suits, and the shuffle methods makes a copy of that list and spits out the newly shuffled deck, not modifying our original list.</p><p>Elixir has tons and tons of more features that i haven’t covered, but this was just an icebreaker for those who haven’t yet used this dynamic programming language. However i encourage anyone who enjoys learning and using different technologies to give it a try. Hope this article was helpful for anyone who is just beginning to use and learn Elixir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a3982482625" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selection Sort: One of the many sorting Algorithms]]></title>
            <link>https://medium.com/@iacharles257/selection-sort-one-of-the-many-sorting-algorithms-fe4a6980f10e?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe4a6980f10e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[selection-sort]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Fri, 18 Oct 2019 19:49:53 GMT</pubDate>
            <atom:updated>2019-10-18T19:49:53.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/399/0*fBThGl6zYRi8f8UU.jpg" /></figure><p>Selection sort is a sorting algorithm similar to bubble sort, but instead of first placing large values in sorted position, it places small values into sorted positions. So we’re building an array, but we’re still <a href="https://medium.com/@iacharles257/selection-sort-72d3b4387b4a">moving from</a> the beginning to the end, but the actual sorted data is accumulated at the beginning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/0*yfXrsAlPSabml4uZ.png" /></figure><p>So lets say we have this array we start at the beginning and what we’re going to do is go all the way through looking for the minimum value and then move it to the front. So we start with comparing six and three. Three is our minimum value at the moment. Then we move on to six and five, three is our minimum value. Now we move on to six and two. Two is our new minimum value. Finally we move on to six and one. Now one is our minimum value and since we’re at the end we can now swap six and one.</p><p>Why use a selection sort when there are faster alternative algorithms out there to use? For small arrays selection sort are typically faster than the logarithmic algorithms. One advantage of selection sort over an algorithm like insertion sort, is that the number of swaps is linear, while in insertion sort it is in quadratic. This can be essential if you are sorting on Flash memory, for example, because swaps reduce the lifespan of Flash memory.</p><pre><strong>const selectionSort = (arr) =&gt; {for(let i = 0; i &lt; arr.length; i++){let lowest = i;for(let j = i + 1; j &lt; arr.length; j++){if(arr[j] &lt; arr[lowest]){lowest = j;}}if(i !== lowest){let temp = arr[i];arr[i] = arr[lowest];arr[lowest] = temp;}}return arr};</strong></pre><p>In the above example the first thing we do is store the first element in the array as the smallest value we’ve seen so far. Then we compare this item to the next item in the array until we find a smaller number. What we’re actually saving is the index of where that value is found so then we can swap. If a smaller number is found, we designate that smaller number to be the new minimum and continue until the end of the array. If the minimum is not the value you initially began with swap the two values. Because if it is that means we have an array where our first element was the smallest or we already have a sorted array. Finally we repeat this with the next element until the array is sorted. The time complexity in the worse and best case scenario will be quadratic. As the length of the array grows the number of comparisons grows at the rate of n * n.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe4a6980f10e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Angular]]></title>
            <link>https://medium.com/@iacharles257/getting-started-with-angular-543e189145ec?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/543e189145ec</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Fri, 11 Oct 2019 16:51:01 GMT</pubDate>
            <atom:updated>2019-10-11T16:52:22.049Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*YQ9iqqbQaxgoi_bF" /></figure><p>To get started with Angular, you might first have the question, what is Angular ? Angular is a front-end JavaScript framework that was created, and is maintained by Google. It’s used to build powerful front-end applications and is part of the very popular MEAN stack. Which stands for MongoDB, Express.js, Angular, and Node.js. One important thing to note is that Angular and AngularJS are not the same.</p><p>Now that sounds good and all but why use Angular ? Angular should be used for a couple different reasons. It’s good for rapid development and code generation. Angular comes with an easy out of the box CLI that makes creating things like components, services, modules, and other things on the fly. It also helps with code organization and Productivity, because when you generate new files using the CLI it automatically creates the file structure for you. Angular should also be used to display dynamic content, be used cross platform, and it comes Unit Testing ready.</p><p>Some core features that Angular comes with out the gate are, components, services, routing, testing, build tools, data binding, templating, http module, observables, form module, directives, pipes, dependency injection, animation, and TypeScript. Another article can be written about each of these topics.</p><p>Every component in angular has a component ts file and a template file which looks something like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*7ZzQ0Kuztg4meQ2v.png" /></figure><p>In your component.ts file is where you’re going to define all of your properties and methods. This will be responsible for all of the business logic. Your component.html file will be responsible for all of your presentation logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*HxaXUjQQsFoIyPTn.png" /></figure><p>In our html template is where we can use our built in directives that Angular provides like *ngIf to conditionally display items. *ngfor to loop over a collection of items. Data binding is also a big feature. We can use the double curly braces to bind our properties to the template for dynamic content to be displayed.</p><p>Using TypeScript is a big benefit with Angular. TypeScript is a superset of JavaScript created by Microsoft. It compiles to plain JavaScript code. It gives us a bunch of extra features and includes ES6 features. Some of those features include static typings, object classes, modules, let/const scoping, and other ES6 features. The TypeScript compiler is written in TypeScript, it compiles it’s .ts files to .js files. You can install it with npm, and it supports ES6+ syntax. The static type checking is completely optional, it helps find bugs, write more descriptive code, and you can assign variables, parameters, and function types. We can also take advantage of interfaces. This is how we define the shape of our data to easily be passed around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/0*B6a9QydAcHYMwKUM.png" /></figure><p>This is just a overview of Angular. It has plenty of cool features to help you get started out of the box early. All these features help to create a powerful front-end application. Each of these features can have there own article but that’ll be saved for another time. Hope this helps see the overall point of Angular.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=543e189145ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using GraphQL with Python]]></title>
            <link>https://medium.com/@iacharles257/using-graphql-with-python-c10b121d6067?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/c10b121d6067</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Fri, 04 Oct 2019 20:43:16 GMT</pubDate>
            <atom:updated>2019-10-04T20:43:16.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*roa0JwY-8AJcSgGpIr3jwQ.png" /></figure><p>GraphQL and Python are two amazing languages that are very much used in modern programming. Today we’ll be talking about how to integrate these technologies together.</p><p>But first we’ll talk briefly about each of these languages. So what is GraphQL ? GraphQL is a query language for your API. It provides a standard way to describe data provided by a server in a Schema. You can request data in a Query which exactly describes your data requirements and receive data in a response containing only the data you requested.</p><p>So what is python ? Python is an Interpreted high-level object-oriented dynamically-typed scripting language. It’s used to create solutions from Web APIs to Artificial Intelligence.</p><p>In order for these two technologies to work together we need to use another library called Graphene Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*a76zviV8SzZyMxVN.png" /></figure><p>So what is Graphene ? Graphene is a library that provides tools to implement a GraphQL API in Python using a code-first approach. So instead of writing GraphQL Schema Definition Language we write Python code to describe the data provided by your server.</p><p>Getting started you first need to have python installed on your computer. After that you want to install Graphene. Assuming that you already have pip installed, which is the package mangager in python. Similar to Node’s npm. Along with pip you want to install pipenv. This is going to be responsible for setting up your virtual environment. Once you have pipenv installed you want to run the command pipenv shell. You know that you’re in your virtual environment when the name of your project is wrapped in parenthesis like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*_oaZzeeCWST-HsiQp4u3JA.png" /></figure><p>It’s also going to create a Pipfile for us which will be responsible for managing our packages that we bring into our project. If you want to exit that environment you can just type in exit, and to restart you just run the pipenv shell again. So in our case we would want to run pip install graphene and once that’s done you can check your Pipfile to see that graphene has been added to our packages.</p><p>Now you want to bring graphene in your application by importing it. So if we wanted to do something like print hello world to the console we would first create a Query called hello that returns a string world. To create a Query we must first create a root Query type, which is done by creating a class called Query that subclasses from graphene Object Type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*wgGyyDPWLfmRrcZV7z7gjA.png" /></figure><p>The field of our first Query will be called hello and the datatype that it contains would be set to graphene.String(). We can get all of the graphql scalar types from graphene. Ok, now that we have our field and datatype, how are we going to get world returned from it? We do so with a resolver function, which is a special kind of function specific to GraphQL operations which will resolve the operation. The name of query resolver functions have to be prepended with the word resolve and it’s written in snake case. The resolve function takes two parameters self and info. That’s another subject to dive into in another post. So for now we just want to return world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*fDPtqYK3XJuQCVVO87gmRQ.png" /></figure><p>Now we need to create a schema based on our root query type. We can create that with graphene.Schema() and pass in our Query class. We can store our schema in a variable called schema but to actually execute it we need to do schema.execute and pass in our GraphQL operation as a string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*BeI1zLsRilJfOn0R15TENQ.png" /></figure><p>We’re storing our return value in a variable called result and to print the result we can just pass in our result.data.items(). In our command line we just run python and the name of the file. You should receive odict_items as well as the name of operation and it’s resolved value. There’s other ways to get our data back in a more readable format but we can save that for another article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c10b121d6067" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C#/.NET Basics]]></title>
            <link>https://medium.com/@iacharles257/c-net-basics-6d198137dc1f?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d198137dc1f</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Fri, 27 Sep 2019 17:06:11 GMT</pubDate>
            <atom:updated>2019-09-27T17:06:11.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*igiqyf5ExA55nXpw" /></figure><p>In today’s topic I’m going to be discussing some of the basics/fundamentals of c# and .Net. But first lets talk about c# vs. .Net. C# is a programming language, while .Net is a framework. It consists of a run-time environment (CLR) and a class library that we use for building applications.</p><p>So what is a CLR (Common Language Runtime)? When you compile an application, c# compiler compiles your code to IL (Intermediate Language) code. IL code is platform agnostics, which makes it possible to take a c# program on a different computer with different hardware architecture and operating system and run it. For this to happen, we need CLR. When you run a c# application, CLR compiles the IL code into the native machine code for the computer on which it’s running. This process is called just-in-time-compilation (JIT).</p><p>In terms of architecture, an application written in c# consists of building blocks called classes. A class is a container for data (attributes) and methods (functions). Attributes represent the state of the application. Methods include code. They have logic. That’s where we implement our algorithms and write code. A namespace is a container for related classes. So as your application grows in size, you may want to group the related classes into various namespaces for better maintainability. As the number of classes and namespaces grow even further, you may want to physically separate related namespaces into separate assemblies. An assembly is a file (DLL or EXE) that contains one or more namespaces and classes. An EXE file represents a program that can be executed. A DLL is a file that includes code that can be reused across different programs. Below are a list of some primitive data types in c# and how it converts to .Net.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*UC1iSzjDDFlCQN5i0z-vIg.png" /></figure><p>Some Non-Primitive types in c# would be String, Arrays, Lists, Enum and Classes. Strings are a sequence of characters an are also Immutable. So when dealing with string manipulation it would be better to use a String Builder which is defined in System.Text and is mutable. It’s very easy and fast to create and manipulate strings. But they aren’t for searching. Arrays Represent a fixed number of variables of a particular type. They have single dimension and multi dimension arrays. Similar to an array they have lists. Which is just like an array but is dynamic in size. Allows you to add and remove values along with other handy methods. An Enum is a set of name/value pairs that are constants.</p><p>Their are also Value Types and Reference Types. Value Types (structures) are allocated on the Stack, Memory allocation is done automatically, and Immediately removed when out of scope. Reference Types (classes) you need to allocate memory, memory is allocated on heap, and garbage is collected by the CLR.</p><p>Hope this article is helpful for anyone getting started programming in C# and .Net. Although this article is a brief introduction you should always do your own research to dive into topics you aren’t too clear on.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d198137dc1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Problem Solving Approach]]></title>
            <link>https://medium.com/@iacharles257/problem-solving-approach-75b1fc31e118?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/75b1fc31e118</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 13:51:53 GMT</pubDate>
            <atom:updated>2019-09-23T13:51:53.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3IotmtN2TE_BWLsO" /></figure><p>Every programmer will always run into problems as they code. The Question is what do you do when you run into a problem? How do you go about solving that problem once you get stuck? I think the first thing that should be asked is what is an algorithm? It’s a process or set of steps to accomplish a certain task. This is useful to know because almost everything that you do in programming involves some kind of algorithm. It’s the foundation for being a successful problem solving and developer. How do you get better? You should always devise a plan for solving problems and make it a point to try and master some common problem solving patterns.</p><p>Most importantly you should first understand the problem. Some questions you might ask yourself is. Can i restate the problem in my own words? What are the inputs? What are the Outputs? Can the outputs be determined from the inputs? In other words do i have enough information to solve the problem? ( You may not be able to answer this question until you set about solving the problem. That’s OK, it’s still worth considering the question of this early stage. ) How should i label the important pieces of data that are a part of the problem?</p><p>So lets say for example we had to write a function which takes two numbers and return their sum. You know some addition needs to be implemented. But what about inputs and outputs, are they ints, floats, what about strings for larger numbers. These are all practical things that come to mind.</p><p>Or what if we had to write a function that takes a string and returns count of each character in the string. Some things that may come to mind is, you might want to make an object to return at the end. Loop over string for each character. If the number/letter is a key in the object add one to the count. If the letter/number is not in the object add it and set it’s value to one. If the character is something else (space, period, etc) do nothing. This is just one approach but no matter what the approach is the best thing to do is have a plan.</p><p>Coming up with your own concrete examples can help you understand the problem also. Examples also provide sanity checks that your eventual solution works how it should. Another important thing is to break the problem down. Explicitly write out all the steps you need to take. This forces you to think about the code you will write before you write it , and helps you catch any lingering conceptual issues or misunderstandings before you dive in and have to worry about details as well. Try your best to simplify. Find the core difficulty in what you’re trying to do. Temporarily ignore that difficulty and write a simplified solution. Then incorporate that difficulty back in. Don’t forget to look back and refactor. Some refactoring questions you might ask yourself is. Can you check the result? Can you derive the result differently? Can you understand it at a glare? Can you use the result or method for some other problem? Can you improve the performance of your solution? Can you think of other ways to refactor? How have other people solved this problem?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75b1fc31e118" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pros of Angular]]></title>
            <link>https://medium.com/@iacharles257/pros-of-angular-bb5dfb4b8115?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb5dfb4b8115</guid>
            <category><![CDATA[angularjs]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Mon, 16 Sep 2019 05:40:04 GMT</pubDate>
            <atom:updated>2019-09-16T05:40:04.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vuyTdT2QFsO6wukV.jpg" /></figure><p>Lets talk about some key features that make Angular a great framework. One of the first being it’s component-based architecture. With the component based architecture it provides for a higher quality of code. This is one of the things that makes it different from AngularJS. Each component is it’s own section of the application with it’s own functionality encapsulated inside. Each UI element on the screen can be a component. In Angular their is component hierarchy, You have your main parent component, and your other components would be considered children of the of that parent. This ensures higher re-usability across the app. Now we can build UI’s with many moving pieces.</p><p>Some of the main benefits of using this architecture would be Resuability, this can be helpful for when we have an applications where different systems converge but have many similar elements. Readability, when new developers come in on a new project encapsulation can help them read it better while helping them be more productive faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AXLVSfaxg7cbE3AKlDQIuw.png" /></figure><p>With the above example we can just take all the functionality of this navbar component and just put it in the top of our main app component to be displayed, but it also can be used in any other component we want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*c_0YsNU9Fsi4EYzpI5Lubg.png" /></figure><p>Another benefit is TypeScript. Angular is written using TypeScript language, which is a superset for JavaScript. It fully compiles to JavaScript, but helps spot and eliminate common mistakes when actually typing the code. While small JavaScript projects don’t require such an enhancement, the larger-scale applications challenge developers to make their code cleaner and verify its quality more often.</p><p>Putting the TypeScript-first policy of Angular into the benefits section is an arguable point for many engineers. TypeScript-related complaints appear every now and then among the development community. Engineers have to learn yet another language. However, TypeScript is there for a reason and you still can use JavaScript if you want to.</p><p>We can create an interface that defines the shape of our data and just pass around the interface to our other components where needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*U6Y7ZcIeRXmm2d5L_U0Y7A.png" /></figure><p>Now we can pass around this Post interface to any of our components that will need to use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*yUBTjzPgXuI4LONfdmOOEA.png" /></figure><p>These are just a couple of benefits of Angular, but there are so many other things that make this such a great tool.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb5dfb4b8115" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big O Notation and Time Complexity]]></title>
            <link>https://medium.com/@iacharles257/big-o-notation-and-time-complexity-2a7a874c5d9f?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a7a874c5d9f</guid>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Mon, 09 Sep 2019 13:51:45 GMT</pubDate>
            <atom:updated>2019-09-09T13:51:45.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*fpdPB7uhVMIV6S-Z.jpeg" /></figure><p>What is Big O Notation? Big O Notation is used to describe the time complexity of our functions in the worse case scenario. It allows for us to formally talk about how the run time of an algorithm grows as the input grows. So what’s the idea here? Say for instance we had two implementations of the same function, how could we determine which is best, or better? What does better even mean? Is it faster ? Is it less memory intensive? Is it more readable? Depending on how you’re writing your code all can be important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/38/0*rMRDQTohjJ26yCdt" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/0*MejR-rrgMChtxzbP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/38/0*ZjiaMuWeyqgZYxo2" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/0*yhiRv9jg1gAgjcKW" /></figure><p>Above we have two functions that do the exact same thing. They both take in a number and adds all the numbers from one up until and including that number then returns the total. We could time our code but there’s some issues that come with testing code for speed. Every time you record the speed of the function you’re going to get a different time on your machine. The same goes for someone else’s machine, they’ll always get a different time also. So speed isn’t to consistent in what we’re trying to accomplish. The one thing that remains constant on every machine is the number of operations that the function has to do. That’s where Big O Notation comes in at.</p><p>So in our first example above we have a linear time complexity, which is O(n). Meaning as n grows, the number of operations grows as well. So if n was 30 we would have to do 30 assignment operations, comparison operations, increment operations, and adding and assigning operations before we return our total.</p><p>In our second example we have the same exact function but it has a time complexity of constant, which is O(1). This algorithm is constant because no matter what n is, it will only do three operations. As n grows or shrinks it will consistently only do the three operations of adding, multiplying, and dividing to get our total.</p><p>Some takeaways to know is the Big O of objects and arrays. For objects they have a constant time of insertion, removal and access but for a search look up it will always be linear. That’s because as the number of properties grow in the object the number of key value pair look ups grow also. For arrays, they have a constant access but the search is linear. It’s linear because as the length of the array grows the number of indexes to iterate over grows as well. Insertion and removal from an array all depends. If you’re inserting or removing from the end of the array you’re going to have a constant time look up. And that’s because you have a constant access to the particular index. But inserting and removing from the beginning if the array will always be linear. That’s because as you add or remove from the front , you also have to re index all the elements in the array depending on the number of elements.</p><p>I hope this article helped you to better understand Big O Notation and what it’s used for, and how it can help you write better code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a7a874c5d9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backbone Basics]]></title>
            <link>https://medium.com/@iacharles257/backbone-basics-5fc1e4be678d?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fc1e4be678d</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Mon, 19 Aug 2019 13:56:45 GMT</pubDate>
            <atom:updated>2019-08-19T14:20:42.867Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L46NIKDigIk65FDR.png" /></figure><p>So what is BackBoneJS ? It’s a lightweight library for structuring JavaScript code. It has a MVC / MV* kind of framework which is made up of three components. Model, View, Controller to promote separation of concerns, which results in a better structured and a more maintainable application. Backbone views are like controllers in MVC hence the MV*. BackBoneJS uses routers for creating single page applications to provide a rich smooth ux. All of the necessary code is retrieved initially(Html, JavaScript, css, JQuery) retrieved with a single page load. A <a href="#">good</a> example would be Gmail, In Gmail the pages load at once and from that point in any action you do on the page such as creating an <a href="#">email</a>, replying, deleting, are done within that page. Works perfectly in building a rich client application over a set of REST API’s.</p><p>The big picture in BackBoneJs. Like everything else BackBoneJs is built around a core set of things. You have Events, Models, Collections, Views, and Routers. BackBoneJs models are containers for application date. Different from a plain JavaScript object in a sense that they have some kind of change tracking mechanism and publish events when their state changes. They also have the ability to send ajax requests to the server to synchronize the data on the client with a server.</p><p>Backbone collections are a list of models that are ordered. Useful for when you want to work with a group of models. Simply extend Backbone collections and specify the type of models that the collection can hold. Every Backbone model has a models and length property. The add method is provided by underscore and is available in all BackBoneJs models.</p><p>Views are responsible for rendering content and handling model and DOM events. Its more like a controller for in MVC. Creating views is similar to creating models and collections. The render method is where we enter the rendering logic. this.$el is a case JQuery object that contains the view DOM element. It’s convention you return a reference to the view at the end of the rendermessage this helps chaining method calls. When instantiating a view we specify the DOM element to which this view should attach to. This view will be responsible for rendering the content inside the container as well as responding to any events raised from it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fc1e4be678d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with NestJS]]></title>
            <link>https://medium.com/@iacharles257/getting-started-with-nestjs-c37a7177e989?source=rss-60748cd25f71------2</link>
            <guid isPermaLink="false">https://medium.com/p/c37a7177e989</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Ian Charles]]></dc:creator>
            <pubDate>Mon, 12 Aug 2019 13:52:24 GMT</pubDate>
            <atom:updated>2019-08-12T13:52:24.516Z</atom:updated>
            <content:encoded><![CDATA[<p>So what is NestJS? NestJS is a framework for building efficient, scalable, Node.Js server-side applications. It supports typescript, yet enables programmers to code in pure JavaScript and combines elements of (Object Oriented Programming, Functional Programming). Under the hood NestJs makes use of the Express framework as it’s built on top of. While you have plenty libraries, helpers, tools that exist for Node and server side JavaScript, none of them effectively solve the problem of Architecture. NestJs allows you to organize the backend of your application much like your front end. It provides an out of the box application structure that makes it real easy to get started using the command line interface.</p><p>NestJs is heavily inspired by angular. It has modules, controllers, services, and uses dependency injection. Each application has at least one module. That is the starting point of the application. Modules are an effective way to organize components by a closely related set of capabilities. It is good practice to have a folder per module, containing the module’s components. Module’s are singletons, therefore a module can be imported by multiple other modules.</p><p>Controllers are responsible for handling incoming requests and returning responses to the client. Bound to a specific path, for example ‘/items’ for the items resource. Contains handlers, which handle endpoints and requests methods (GET, POST, PUT, DELETE, etc). Can take advantage of dependency injection to consume providers with the same module.</p><p>NestJs providers can be injected into constructors if decorated as an injectable via dependency injection. Can be a plain value, a class, sync/async factory, etc. Providers must be provided to a module for them to be usuable. Can be exported from a module and then be available to other modules that import it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c37a7177e989" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>