<?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 Nasser Sanou on Medium]]></title>
        <description><![CDATA[Stories by Nasser Sanou on Medium]]></description>
        <link>https://medium.com/@nassersanou23?source=rss-6e358b64ea84------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vqQ9Lil0_zs4tiXLz88jWQ.jpeg</url>
            <title>Stories by Nasser Sanou on Medium</title>
            <link>https://medium.com/@nassersanou23?source=rss-6e358b64ea84------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:40:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nassersanou23/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[AI Said the Platform Was 100% Complete. It Was 40%.]]></title>
            <link>https://medium.com/@nassersanou23/ai-said-the-platform-was-100-complete-it-was-40-70a1f1fb4f08?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/70a1f1fb4f08</guid>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 22:09:11 GMT</pubDate>
            <atom:updated>2026-09-14T22:09:11.404Z</atom:updated>
            <content:encoded><![CDATA[<p>There was no backend. It was a frontend with no server to talk to, described as a finished product.What I was told</p><p>I had been building Afya, a healthcare platform for African markets, telemedicine, pharmacy access, anti-counterfeit medicine verification, community health worker tooling. Large surface area. I asked my assistant for a status report. It reported the platform as 100% complete.</p><h3>What was actually true</h3><p>I asked for the claim to be verified against source rather than restated. The audit:</p><p>DimensionClaimedActualScreenscomplete40 of 95Redux slicescomplete18 of 36Database tablescomplete11 of 30SDK integrationscomplete<strong>0 of 20</strong>Test suitecomplete<strong>0 of 200</strong>Translationscomplete<strong>0 of 15 languages</strong>Backend APIcomplete<strong>did not exist</strong></p><p>Real completion: 40–45%. There was no backend. It was a frontend with no server to talk to, described as a finished product.</p><h3>Why it happened</h3><p>The assistant wasn’t lying, because lying requires knowing. It had generated a great deal of correct code across many sessions and had no mechanism for counting what remained. “Complete” was the most probable next token given a long history of successful work, not a measurement.</p><p>This is the core of it. A status report from a language model is a continuation of the conversation, not an observation of the system. It reads like a measurement because status reports in its training data are measurements.</p><h3>What it cost, and what it saved</h3><p>It cost the delivery plan, which I rebuilt around 40–45%. It saved considerably more than that, because the alternative was discovering the missing backend while demoing to someone.</p><h3>The lesson</h3><p>Ask for the <em>evidence shape</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70a1f1fb4f08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The RAG Project I Forgot I Built]]></title>
            <link>https://medium.com/@nassersanou23/the-rag-project-i-forgot-i-built-e59d962ee27f?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/e59d962ee27f</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[nextjs-15]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 21:21:37 GMT</pubDate>
            <atom:updated>2026-09-14T21:21:37.304Z</atom:updated>
            <content:encoded><![CDATA[<p>My portfolio had a card that said “RAG Document Assistant (Coming Soon)”. Under it was a tech stack: LangChain, Pinecone, Chroma, GPT-4, Claude. Under that, a results section: 90% retrieval accuracy, positive feedback from beta testers, targeting a Q2 2025 release.</p><p>This week I ran a grep on my own repository and found app/api/rag/query/route.ts. Ninety-six lines. A working API route that takes a question, retrieves the three most relevant passages from a set of FDA medical device guidance documents, and answers from them with a prompt that refuses to guess when the passages don&#39;t cover the question.</p><p>It had been sitting there for months. It was not coming soon. It was done, and it was better than the card describing it.</p><h3>What RAG is, in plain words</h3><p>Retrieval-Augmented Generation is a two-step way to make a language model answer from documents it was never trained on. First you retrieve: cut the documents into chunks, turn each chunk into an embedding (a vector of numbers that captures its meaning), and store those vectors somewhere you can search. When a question arrives, you embed it the same way and pull the chunks whose vectors sit closest. Second you generate: paste those chunks into the prompt and tell the model to answer from them.</p><p>The analogy I use is an open-book exam. A model on its own is answering from memory, and when memory runs out it invents. RAG hands it the book open to the right page, so it can cite the page and admit when the page doesn’t say.</p><p>This is the technique most companies actually want from AI right now. Nobody needs a chatbot that knows the capital of France. They need one that answers questions about their contracts, their policies, their product docs, and doesn’t make things up while doing it.</p><h3>What the code actually did?</h3><p>The route I found was specific in every place the portfolio card was vague.</p><p>The domain was FDA compliance guidance for medical devices, held in a knowledge base file. The text was split into 500-character chunks with 50 characters of overlap, so a sentence cut at a chunk boundary still appears whole in one of its neighbours. Each chunk was embedded with OpenAI’s text-embedding-3-small, the cheap one, and stored in HNSWLib, an in-process vector index that lives inside the Node server. Queries pulled the top three chunks and handed them to gpt-4o-mini with a system prompt that said: answer only from this context, cite the section, and if the context doesn&#39;t contain enough to answer, say so.</p><p>Every one of those is a decision. The chunk size trades context against precision. The overlap costs storage to avoid losing meaning at the edges. The small embedding model and the mini chat model are a cost choice I could defend. The refusal instruction is the whole point: it’s what separates a grounded assistant from a confident liar, and it only works because retrieval happened first.</p><p>None of that was on the card. The card listed Pinecone and Chroma, which the code never touched, and Claude, which the code never called. If a hiring manager had grepped the repo against the stack list, they would have found a mismatch on the first try.</p><h3>The numbers were worse than the mismatch</h3><p>“90% accuracy in document retrieval” sounds like a measurement. I did not have one. There was no test set, no retrieval metric, no evaluation harness. It was a line written to sound like a result.</p><p>“Positive feedback from beta testers.” There were no beta testers.</p><p>I’m writing this down because I think it’s a common failure and an invisible one. When you fill out a portfolio template, the template has a Results section, and the section wants a number, and you write something that fits the shape. Months later the number is still there, looking like evidence. The problem is not that it’s a lie exactly. The problem is that the first question in any interview about this project would have been “how did you measure that,” and I had no answer.</p><h3>What I changed</h3><p>The card now describes what exists. Not “RAG Document Assistant” but a compliance assistant that answers questions over FDA guidance, cites the section, and refuses to answer outside its sources. The stack is the real stack. The results section is empty, because there are no results yet.</p><p>That empty section is now a plan rather than a placeholder. The next version moves the index out of memory and into Postgres with pgvector, so it survives restarts and scales past a demo. It gets a test set of questions with known answers, a recall@10 number (how often the right chunk appears in the top ten retrieved), and RAGAS scores for faithfulness and answer relevance. Those go on a public evals page with the retrieved chunks and similarity scores visible per query.</p><p>When that page exists, the results section gets a number again. This time it will be one I can defend, with the harness that produced it sitting next to it in the repo.</p><h3>The lesson</h3><p>Two things, and they point in opposite directions.</p><p>I had undersold the work. A working, grounded, cost-aware RAG route over a regulated domain is a real thing, and I had labelled it “coming soon” because the template made me feel it wasn’t finished until it matched some generic ideal.</p><p>And I had oversold the results. Numbers with no measurement behind them are worse than no numbers, because they look like the thing that’s missing.</p><p>The fix for both is the same habit: describe the code that exists, and let the evals page earn the numbers. If you have a portfolio, open the repo next to it and read them side by side. Mine disagreed in five places. I’d rather find that than have someone else find it for me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e59d962ee27f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Important React Lazy vs Eager Loading:]]></title>
            <link>https://medium.com/@nassersanou23/important-react-lazy-vs-eager-loading-c480508defd0?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/c480508defd0</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Wed, 24 Apr 2019 01:57:31 GMT</pubDate>
            <atom:updated>2019-04-24T03:54:38.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1Fjj4FH7BIr9P30vDRTGg.jpeg" /></figure><p>When you begin developing applications as a junior developer, you are less concerned by the way the application loads resources (makes data available to users). However, with as you gain more experience, you start to take in consideration all the weight and cost associated to the choice of loading data. The choice we make when it comes to this enhances or wisen the user experience and optimizes your app’s performance.</p><p>While working on an api to serve clients of more so called ‘third world’, I discovered that in entity framework, ‘Eager Loading’, ‘Lazy Loading’ . This makes all the difference in performance optimization. Specially when dealing with users having access to a limited or scarce mobile data to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*LholCSpNvP-UsFGEUSQ9fw.jpeg" /></figure><p><strong>Lazy Loading</strong></p><p>For example, when user logs in, instead of loading the home page resources, the apps loads the entire app resource so that. In loading this fashion, the entire app resources are available for any possible subsequent requests to be made by that user. Without having to make additional calls. The a<em>dvantages</em> of this approach is that the user has every resources and it seems that any action to access a resource is fast and seamless. However, the side-effects comprise such<em> disadvantages</em><strong><em> </em></strong>but not limited to: large size bundle of resource to load the entire app, delay in loading the app (which can cause the user to quit the app or leave the web-site ), excessive use of the user data and potential security breach in what might as well by the same token access ‘some special resources’ that he/her might not otherwise be authorized to (this could have been handled if the user’s credentials/token was checked each time a request is made before loading the requested resource.</p><p><strong>Eager Loading:</strong></p><p>It is the behavior of loading only only the resource the user has requested. For example if a user logs in, the app will load only the home page. If the user then clicks on profile icon per se (wants to navigate to his/her profile), the app will load only the profile resources needed and then wait for subsequent requests to load additional data. If the user then wants to edit his fiends list, then only will the app respond by loading the friends list to meet the request and for satisfy the user’s purpose. The downside of eager loading are not limited to the obvious multiple calls made, but some benefits are such as, light and quick resources available (great for the app and user experience), doesn’t burn the user data as the Lazy loading would (great for user experience) and much more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*5tr1uieljWh8NGQ5LhgsfA.jpeg" /></figure><p><strong>Conclusion</strong></p><p>When it comes to loading, you can either selectively load or load all at once. There might be use cases that require any of these loading models. However, a balance is to be found between ‘eager loading’, ‘lazy loading’ or be it ‘explicit loading’ in order to alway optimize speed and enhance user experience else the purpose might be defeated. Considering network connectivity, users’ mobile data etc.. It is always better to have some expectation and some sort of predictability base on the application loading behavior.</p><p><a href="https://docs.microsoft.com/en-us/ef/ef6/querying/related-data">https://docs.microsoft.com/en-us/ef/ef6/querying/related-data</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c480508defd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Routes Protections (Router)-Must Know]]></title>
            <link>https://medium.com/@nassersanou23/react-routes-protections-router-must-know-696d1d4b6aa3?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/696d1d4b6aa3</guid>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Tue, 23 Apr 2019 01:53:46 GMT</pubDate>
            <atom:updated>2019-04-23T03:03:08.267Z</atom:updated>
            <content:encoded><![CDATA[<p>The idea of routes protection was an abstract concept to me and resources I came a cross differed often a lot. Thus, I use to simply check local storage to see if there was a token before making the “private routes” a.k.a protected resource routes available.</p><p>After dabbling further and learning more I realized that there was a better approach to deal with routes’ protection.</p><p>Let say you have an app with pages like ‘about’ and contact and a landing page that should be made available to visiting the site without authenticating them and the rest of resources requiring authentication. One on the best way of handling this is the approach I will walk you through shortly.</p><p><strong>The components we will use :</strong><br><strong>We will have the following as<em> </em></strong><em>Presentational Components</em><strong>:</strong> Landing , About and Contact page.We will have the following as <em>Functional Components:</em> Routes, Auth.</p><p><strong>The Routes Component:</strong> This component is an array of object in which we will define the ‘paths’, ‘exact’ and the ‘auth’ status of these routes (ignore the ‘loadable’ details as it is a miscellaneous not required for our purpose). Illustration image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*26CqGLFYyf4gunS_ttHsbA.png" /><figcaption>Routes</figcaption></figure><p>Below I am exporting all the routes as default using the ‘spread operator’ in order to add them altogether to an array which will be used later for a safety check as you will see. staticRoutes is a name I have given to the about and contact while importing them. You may have noticed ‘…landing ‘ as well, this landing route follows the same structure of the about and contact pages (Illustration image above). I have just imported it from the landing page routes folder in order to had it to all the routes I have. The ‘…auth’ is adding the ’Login’ and ‘Signup’ routes which are located from an auth folder. The auth routes return the Login Page and Signup Page (hope this clarifies).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*b-m3-ryMPMmmhies9v4Tyw.png" /><figcaption>Exporting the routes</figcaption></figure><p>Next step is the safety check. In this step, I defining a function named ‘renderRoutes’ (highlighted) which sole purpose is to map all the routes it receives as props, and check with the if statement whether the routes’ ‘auth’ (see ‘auth’ in 1st illustration above), returns true or false. If, the auth returns true, then that route is returned as a ‘Private Routes’ else it is returned as a ‘Public Route’ (Illustration image below). Next, is to render the function renderRoutes and pass in the routes you will import from all routes (from 2nd Illustration image above). It is as simple as that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ji9tmvj-hEWAcWyMQXJ8mw.png" /><figcaption>Mapping routes by auth status</figcaption></figure><p>Hoping this was helpful. Let me know if you have any suggestions, I will gladly learn form you. Thanks</p><p><a href="https://blog.bitsrc.io/5-tools-for-faster-development-in-react-676f134050f2">5 Tools for Faster Development in React</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=696d1d4b6aa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The SOLID PRINCIPAL DEVELOPMENT MADE EASY]]></title>
            <link>https://medium.com/@nassersanou23/the-solid-principal-development-made-easy-9b61e03ba223?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b61e03ba223</guid>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 07:48:52 GMT</pubDate>
            <atom:updated>2019-04-08T07:48:52.516Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The SOLID PRINCIPAL DEVELOPMENT MADE EASY</strong></p><p>The concept of single responsibility principle was popularize in the the early 2000 by Robert C. Martin.</p><p>A quick Google search will lead you to the basic explanation that “The <strong>single responsibility principle</strong> is a computer programming principle that states that every <a href="https://en.wikipedia.org/wiki/Modular_programming">module</a> or <a href="https://en.wikipedia.org/wiki/Class_(computer_programming)">class</a> should have responsibility over a single part of the <a href="https://en.wikipedia.org/wiki/Software_feature">functionality</a> provided by the <a href="https://en.wikipedia.org/wiki/Software">software</a>, and that responsibility should be entirely <a href="https://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)">encapsulated</a> by the class.” A pretty unclear explanation.</p><p>in other words if U if S is a subset of T then Object of type T in a program can be replace with with type S without altering the desirable properties of the program. This is what Robert C envisionned as response to the ‘spaghetti code’ or the dependencies pattern issue when it comes to object oriented programing in 1195. It is as well the very core of the ‘Liskov’ principle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CyEfxkq7JdmMXcMvNxkotA.png" /></figure><p>The goal in single responsibility principle design is to have flexible interface and dependency inversion that classical object oriented languages were not providing. The symptoms of the bade coding include but not limited to the following:</p><p>Rigidity: if you change a part of you code some other parts break. Fragility: when you change a part of your code not only something else breaks but it breaks in a total unrelated part of your code. Immobility: you can not reuse code outside of its original context. Which is kind of sucks when you are writing some code a realist that you had written something similar but unfortunately you can not reuse it.</p><p>This is exactly where SOLID comes to the rescue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhZn8PLj_eQyunEdzyITlQ.png" /></figure><p>Here is a real life example is the following: If a car is has the functionalities of an engine or auto mobile.</p><p>Then a bus being a type of engine with the the functionalities of an auto mobile should be replaceable in our society without having to cause the entire transit system to stop working. Worst than that, imagine if we went to work or travelled by subway and that subway actually stoped on on every corner to deliver mails pick up garbages drop off laundry, and stops at every other stop to pick up and drop off people going to work.</p><p>A subway having so much purpose means that no one will ever get to work on time or the entire city may get fire the day mailing compartment has a problem. Following this example nothing will ever be done correctly and efficiently. By breaking down task in specific department we get thing to work independently.</p><p>That is the reason why we have, public and private, transportation, mailing trucks, food delivery etc… Below is the pattern more elaborated.</p><p><strong>Single responsibility Principle:</strong> A class should only have one reason to change.</p><p>This means that if you find at some point that the class is doing to much or more that one thing chances are you should refractor the code before things start breaking.</p><p>In the example bellow you have three function, function Circle’, function Square, function Sum that do what their names state and an area calculator and additional we have an output method. As you see this needs a refactor so that we can have a separated output class that does just that which is outputting the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmdL6rj0MXSwkS8Ncxhd0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7cx-00bApy4gbU9TaTagYA.png" /><figcaption>refactored</figcaption></figure><p><strong>Open Close Principal</strong>: Able to extend a class without modifying it.</p><p>Let say you have a complicated chain of if, else statement to check whether it is an instance of square or an instance of circle and also calculate the area. We can refactor it in such a way that each shape we expect as a method on it that does the calculation and we pass these shapes in the area calculator and the job is done. with this approach we can add more methods on it without having to change the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72voaKEawut4b0Jo4qMoFQ.png" /><figcaption>refactrored</figcaption></figure><p><strong>The Liskov Substitution Principal:</strong> It looks like a duck and walks like a duck it is a duck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zBuLznkOjHIEULVSOkGW7g.png" /></figure><p>A great example illustrating LSP (given by Uncle Bob in a podcast I heard recently) was how sometimes something that sounds right in natural language doesn’t quite work in code.</p><p>In mathematics, a Square is a Rectangle. Indeed it is a specialization of a rectangle. The “is a” makes you want to model this with inheritance. However if in code you made Square derive from Rectangle, then a Square should be usable anywhere you expect a Rectangle. This makes for some strange behavior.</p><p>Imagine you had SetWidth and SetHeight methods on your Rectangle base class; this seems perfectly logical. However if your Rectangle reference pointed to a Square, then SetWidth and SetHeight doesn’t make sense because setting one would change the other to match it. In this case Square fails the Liskov’s Substitution Test with Rectangle and the abstraction of having Square inherit from Rectangle is a bad one.</p><p><strong>Interface Segregation Principal:</strong> interface with specific methods</p><p>In simple word, <strong>Interface Segregation Principle in C#</strong> states that no class should be forced to implement any method(s) of an interface they don’t use. Further, it states that instead of creating a large or you can say fat interfaces, create smaller interfaces with the aim that the clients should only think about the methods that are of interest to them.</p><ul><li><a href="https://hackernoon.com/solid-principles-made-easy-67b1246bcdf">SOLID Principles made easy</a></li><li><a href="https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design">S.O.L.I.D: The First 5 Principles of Object Oriented Design</a></li><li><a href="https://en.wikipedia.org/wiki/Single_responsibility_principle">Single responsibility principle - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b61e03ba223" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Use Postman]]></title>
            <link>https://medium.com/@nassersanou23/how-to-use-postman-391dfcbc2451?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/391dfcbc2451</guid>
            <category><![CDATA[server-side-rendering]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Tue, 04 Dec 2018 16:16:04 GMT</pubDate>
            <atom:updated>2018-12-04T18:46:11.587Z</atom:updated>
            <content:encoded><![CDATA[<p>Postman is a great tool to work with apis. You can access resources or test apis.</p><p>to make sure the pages are working properly. You can perform some actions to verify that your application is behaving the way you expect.</p><p>You can access at https:/postman.com. You have the option of signing in and working on the website or downloading it locally for Mac, windows or Linux. There is also a chrome extension available for Postman.</p><p>Steps To Install &amp; Authorize New Apps</p><ol><li>Download the latest version of <a href="https://www.getpostman.com/apps">Postman</a>.</li><li>Double click on the .zip file and extract the app (or .exe file if you are using Windows) for Postman.</li><li>If you are on Mac, drag the Postman app into your Applications folder. If you are using Windows or Linux, double click on the installation file and follow the directions through the installation accordingly.</li><li>Once you have installed Postman, double click on the Postman icon to open the app. You should see something like this:</li></ol><p>Bellow is how the interface looks. You can import Collection, cURL, WADL, RAML, Swagger files and run collections as well well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UymxNQ6b8cZhNW-IYz_bHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CkEFu1f3yUr2DL34BMI_LA.png" /><figcaption>Postman Interface (downloadable)</figcaption></figure><p>Wether you are writing the client-side or some server side coding, in Ruby, NodeJS, PHP etc.. this is a great tool that would do the fetch requests for you. Accepting and responding.</p><p>You can select a GET, POST PATCH or a DELETE request you would want to make, place in the corresponding URL in the section provided, specify body of the request if any and include the specific content type and value in headers if needed as well and just click send.</p><p>It is that easy. You can then get response and select the format of the response body type to be “pretty”, “raw”, “preview”. Additionally, you can access the cookies, headers and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o43Hd36u0sFMg7uOVxFp2Q.png" /></figure><p>The JSONplaceholder API is a great and simple fake REST API to use for web developers to practice requests, test prototypes, formats and handle responses. It is powered by JSON Server and It is accessible at“<a href="https://jsonplaceholder.typicode.com/%E2%80%9C">https://jsonplaceholder.typicode.com/“</a> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b4KDJ2vwdSFGdE4tBMY1tQ.png" /></figure><p>Here is another example of the HTML response when I attempted to post to an api /assets parameters while using a wrong token. The response as Json format response looks like this: <strong>{</strong>“error”: “Empty/Invalid Token”<strong>}.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6EgK-Zz3tM3rPo6e5qsR8w.png" /><figcaption>Api process</figcaption></figure><p>Here is the Processing being done by CryptosController which called the authenticate method.This tells us that the authenticate method worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Z_IclvfbrRNvwdgC0wO4w.png" /><figcaption>Successful Login</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRO0xRFW4-FESX3gb4h4qQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ODO_eHLllwV8Qut35-eOVg.png" /><figcaption>Access Resources</figcaption></figure><p>Successful login when using appropriate token in headers.</p><p>Successful Login Server response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ePjqdFepiQ072ohNJIb4w.png" /><figcaption>Logout and redirect to landing page</figcaption></figure><p>Using Postman I was able to access the resources when successfully authenticated.</p><p>Successful logout and redirected to Home page with limited access to Api resources.</p><p>Additionally, as you might have observed in the screen shot, you have access to details that can help you optimize your application such as how long an action took to perform and see the file size etc…</p><p>Postman is a great tool to test apis in development or production environment. It is easy to use and has a lot of tools build in available for testing apis for free.</p><p><a href="https://www.getpostman.com/">Postman | The Collaboration Platform for API Development</a></p><p>Chrome Extension: <a href="https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en">https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en</a> .</p><p><a href="https://steelkiwi.com/blog/api-testing-useful-tools-postman-tutorial-and-hints/">API testing: useful tools, Postman tutorial and hints</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=391dfcbc2451" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brendan Eich And the Web]]></title>
            <link>https://medium.com/@nassersanou23/brendan-eich-and-the-web-43c17795de1e?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c17795de1e</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 19:15:24 GMT</pubDate>
            <atom:updated>2018-11-15T19:27:18.257Z</atom:updated>
            <content:encoded><![CDATA[<p>Brendan Eich And the Web</p><h3>Brendan Eich, A Life of contribution.</h3><p>Born in the 1960’s, Brendan Eich, was an ordinary child that grew up in the United States. He obtained a Bachelors in computer science and mathematics. He later on, in the pursuit of further studies completed a master.</p><p>He worked for various of firms vested in the software field. It was when he worked at <a href="https://en.m.wikipedia.org/wiki/Netscape_Communications_Corporation">Netscape Communications Corporation</a> that he was asked to build a functional language with Java syntax like. Brendan took on the task fand the language now known as JavaScript was built in 10 days. The name Javascript was on spin on “Java” which was already popular back then. After renaming it a couple of time they finally kept the name “Javascript”, a name that will make its way in history. Naming the language Javascript resulted in a temporary confusion in the developers’s community then eventually people were able to tell them apart. Brendan Eich continued working on the project to its maturity and implementation.</p><p>Later on Brendan served as a chief for an open source project called “Mozilla” that he co-founded. He resigned as a CEO years later.</p><h3>The Brave Browser: Privacy focused</h3><p>In the attempt to solve commonly know issues of the web, which includes, data privacy, adds bombardments (as observed lately when using by google, YouTube or Facebook)Brendan and Brian Bondy released the “Brave Browser”</p><p>The Brave Browser is eight times faster than “Google Chrome” and “Safari”. It is also excellent at blocking adds by default and has an amazing infrastructure for payments and rewards. Additionally, Brave blocks tracking enables secure payment. The Brave Browser provides an overall better browsing experience to users and protects their data.</p><p>Brave Browser also helps you avoid data charges to download unwanted content. As studies have shown “The average mobile browser user pays as much as $23 a month in data charges to download ads and trackers — that’s $276 a year.”</p><p>I would refer to the Brave Browser as “The browser of browsers”. It is a robust that enables you to open multiple “browsers” at once (not “tabs”), and effectively manage them as well by knowing where they are at any given moment and letting you know on which browser you are currently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJwDyOlBcQKFrZ07_isIBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*okG2WUhAa-xeFDdKL6BDTg.png" /><figcaption>Brave Browser</figcaption></figure><h3>Brendan and the decentralization — BAT</h3><p>In 2017 Brendan Eich, launched “BAT”, the Basic Attention Token which is a utility token based on the Ethereum blockchain.</p><p>The basic attention token can be used to reward viewers, readers, content producers or shared between advertisers in a blockchain-based digital advertising and services platform. A token that is doing so well thus far, it should not come as a surprise if it become the Javascript of the dapps world.</p><p>Brendan Eich has made a tremendous contribution that positively impact the lives of users of the web and to the internet as a whole. Brendan is filled with passion and curiosity, and continues to uncover ways to make life more amazing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EwtRKADorqwsFQL3oak7yg.png" /><figcaption>Basic Attention Token</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c17795de1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Cloud Computing Revolution]]></title>
            <link>https://medium.com/@nassersanou23/the-cloud-computing-revolution-6729ee71ddf1?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/6729ee71ddf1</guid>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Wed, 24 Oct 2018 16:16:32 GMT</pubDate>
            <atom:updated>2018-10-24T17:22:14.041Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>The Cloud Computing Revolution</em></blockquote><p>The word “cloud” conjures up visuals of fluffy white abstractions in which our digital data lives. I have actually once caught my self imagining white, foggy, frictionless servers floating somewhere in the skies (intended) where all information is stored for later use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*2Mcan4Ryb2ay8MdKNCGEZw.jpeg" /></figure><p>Not long after, I realized that the notion of « cloud » is misleading when referring to data storage. A quick search for “Cloud computing” return the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIJ2Lb8MwAky_iJ2hOQg6w.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FoyFyFiXz0hrnG%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FoyFyFiXz0hrnG%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FoyFyFiXz0hrnG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="241" frameborder="0" scrolling="no"><a href="https://medium.com/media/57c54f60723ad57073a59d50b58a615d/href">https://medium.com/media/57c54f60723ad57073a59d50b58a615d/href</a></iframe><blockquote><em>The term cloud computing is actually the mere opposite in practice in reality. Cloud computing is just a euphemism for data storage which is actually held in a server physically located remote areas. The data is actually stored in large gigantic complexes that in some cases require diesel burning to keep the servers running without any stop.</em></blockquote><blockquote><em>When one sends an email with a click of a button, the long trip before the e-mail reaches its destination is ignored. The truth about internet and the “cloud” is hidden under the street pavements and in the sea, where our eyes cannot see. The path/route to the “cloud” or information that appears as such a virtual concept can be found between dust and humidity linked by millions of kilometers of optic fibers wrapped in plastics, steels, and concrete.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*aTrGIh0Osnbs0gNfNkDAUA.jpeg" /><figcaption>Internet cable under the street pavement</figcaption></figure><blockquote><em>The “cloud” is first a largely invisible infrastructure of network cables that travel under ground and cross the sea and in this process, backed with heavy equipment and a expensive a price tag attached to it. They leave one “Data center to travel to another data center in a deemed strategic location for distribution of information. Being aware of the the bill behind the ‘cloud” infrastructure, makes sending an e-mail and reaching it less magical as it seems.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SkSYTaXvyYyGDl6IuFUhpQ.jpeg" /></figure><blockquote><em>I came across a NY times article, by James Glanz titled “</em>Power, Pollution and the Internet”<em>, which explained that these data centers or warehouses use about 30 billion watts of electricity, which is roughly equivalent to the output of 30 nuclear power plants. The United States accounts for one-quarter to one-third of the energy load. </em><strong><em>“</em></strong><em>The pollution from data centers is being cited by authorities for violating clean air regulation and appear on the government Toxic Air Contaminant Inventory as one of top stationary diesel polluters” .</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1CdNW9OwMAV8X0Bn2H-eXA.png" /><figcaption>Image of Nuclear power plant to produce energy for a data center (France)</figcaption></figure><blockquote><em>According to the EIA (U.S., Energy Information Administration), the average U.S. household uses about 10,766 kilowatt-hours in residential utility each year.</em></blockquote><blockquote><em>To put thing in perspective, sending a mail with an attachment requires 24 Watts per hour which is the equivalent energy to keep a light bulb on for an hour. Sending a mail without a attachment in average 5 watts per hour.</em></blockquote><blockquote><em>Every hour 10 billions emails are sent out. In equivalence 10 billions e-mails are the equivalent 50 giga watts which in turns is the equivalent of the electricity consumption of 15 nuclear plants per hour or if you rather 4000 tones of oil equivalent or better if you like traveling 4000 round trips between Paris and New York.</em></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FNw8z2olm0nGHC%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FNw8z2olm0nGHC%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FNw8z2olm0nGHC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="339" frameborder="0" scrolling="no"><a href="https://medium.com/media/f93af8208c1cc4a84cd6d96c3266d71f/href">https://medium.com/media/f93af8208c1cc4a84cd6d96c3266d71f/href</a></iframe><blockquote><em>Since the general population is spending an increasing amount of time in the virtual world, whether it is to post a status or check the account balance; companies have embarked In a race for information speed. Data now travels at an unbelievable rate from one corner of the planet to the other. This efficiency has led to a careless use of energy and diesel consumption . This in turn, has impacted the environment in a negative way and has put into question long term sustainability.</em></blockquote><blockquote><em>As, It appears, most data centers by design, consume vast amounts of energy in an wasteful manner. It is staggering to know that roughly 90 percent of the energy pulled off the grid goes to waste in companies’ attempt to keep servers ready in the event of surge of demand. As Online companies typically run their facilities at maximum capacity 24/7, regardless of the demand which results in a waste of electricity and burning of large amount of diesel. Giant banks of generators emit diesel exhaust continuously without breaks in order to keep servers idle to respond to demand of users who are becoming increasingly active in the virtual world.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Hl4Rr_jDThcvFpRVibpGuA.jpeg" /></figure><blockquote><em>These companies practices have generated a pollution to considerable scale that many industry experts believe that the companies are headed to a brick wall as it was for the internet « .com bubble » or the recent « housing bubble ».</em></blockquote><blockquote><em>It is yet difficult to account for the exact number of data centers since a lot of companies keep them hidden and anonymous in excluded areas or in closed buildings with tight security measures. However, few studies state 8.4 million, with 58 % of companies owing between 2 to 9 data centers, and the remaining percentage owning from 10 facilities going up. With the ownership of data centers being in the upswing experts expect the number to grow drastically as three times the current consumption in the next decade.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2IltvctberWRLlYsVJNeA.png" /><figcaption>Map Of Underwater Cables That Supply The Worlds Internet</figcaption></figure><blockquote><em>There is no doubt that at this point that the “cloud”owners i.e data centers companies need to review their practices in order to limit the pollution they causes and few companies are already attempting to turn to green energy and a sustainable practice. And, It’s sold to us a a virtual storage thus, we don’t see the direct impact it has on the energy consumption and on the environmental level.</em></blockquote><blockquote><em>There is sustainability issue in the process as well as the accountability of companies who choose operate cloud services with little regards to the effects it has on the overall environment.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6729ee71ddf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The word “cloud” conjures up visuals of fluffy white abstractions in which our digital data lives.]]></title>
            <link>https://medium.com/@nassersanou23/the-word-cloud-conjures-up-visuals-of-fluffy-white-abstractions-in-which-our-digital-data-lives-2d9a89bfbca2?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d9a89bfbca2</guid>
            <category><![CDATA[energy]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Wed, 24 Oct 2018 16:11:10 GMT</pubDate>
            <atom:updated>2019-04-29T16:12:37.410Z</atom:updated>
            <content:encoded><![CDATA[<p>What Is the Cloud?</p><p>The word “cloud” conjures up visuals of fluffy white abstractions in which our digital data lives. I have actually once caught my self imagining white, foggy, frictionless servers floating somewhere in the skies (intended) where all information is stored for later use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*-s52smXQlAmIYl4aoBgAzA.jpeg" /></figure><p>Not long after, I realized that the notion of « cloud » is misleading when referring to data storage. A quick search for “Cloud computing” return the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIJ2Lb8MwAky_iJ2hOQg6w.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FoyFyFiXz0hrnG%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FoyFyFiXz0hrnG%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FoyFyFiXz0hrnG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="241" frameborder="0" scrolling="no"><a href="https://medium.com/media/57c54f60723ad57073a59d50b58a615d/href">https://medium.com/media/57c54f60723ad57073a59d50b58a615d/href</a></iframe><blockquote><em>The term cloud computing is actually the mere opposite in practice in reality. Cloud computing is just a euphemism for data storage which is actually held in a server physically located remote areas. The data is actually stored in large gigantic complexes that in some cases require diesel burning to keep the servers running without any stop.</em></blockquote><blockquote><em>When one sends an email with a click of a button, the long trip before the e-mail reaches its destination is ignored. The truth about internet and the “cloud” is hidden under the street pavements and in the sea, where our eyes cannot see. The path/route to the “cloud” or information that appears as such a virtual concept can be found between dust and humidity linked by millions of kilometers of optic fibers wrapped in plastics, steels, and concrete.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*aTrGIh0Osnbs0gNfNkDAUA.jpeg" /><figcaption>Internet cable under the street pavement</figcaption></figure><blockquote><em>The “cloud” is first a largely invisible infrastructure of network cables that travel under ground and cross the sea and in this process, backed with heavy equipment and a expensive a price tag attached to it. They leave one “Data center to travel to another data center in a deemed strategic location for distribution of information. Being aware of the the bill behind the ‘cloud” infrastructure, makes sending an e-mail and reaching it less magical as it seems.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SkSYTaXvyYyGDl6IuFUhpQ.jpeg" /></figure><blockquote><em>I came across a NY times article, by James Glanz titled “</em>Power, Pollution and the Internet”<em>, which explained that these data centers or warehouses use about 30 billion watts of electricity, which is roughly equivalent to the output of 30 nuclear power plants. The United States accounts for one-quarter to one-third of the energy load. </em><strong><em>“</em></strong><em>The pollution from data centers is being cited by authorities for violating clean air regulation and appear on the government Toxic Air Contaminant Inventory as one of top stationary diesel polluters” .</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1CdNW9OwMAV8X0Bn2H-eXA.png" /><figcaption>Image of Nuclear power plant to produce energy for a data center (France)</figcaption></figure><blockquote><em>According to the EIA (U.S., Energy Information Administration), the average U.S. household uses about 10,766 kilowatt-hours in residential utility each year.</em></blockquote><blockquote><em>To put thing in perspective, sending a mail with an attachment requires 24 Watts per hour which is the equivalent energy to keep a light bulb on for an hour. Sending a mail without a attachment in average 5 watts per hour.</em></blockquote><blockquote><em>Every hour 10 billions emails are sent out. In equivalence 10 billions e-mails are the equivalent 50 giga watts which in turns is the equivalent of the electricity consumption of 15 nuclear plants per hour or if you rather 4000 tones of oil equivalent or better if you like traveling 4000 round trips between Paris and New York.</em></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FNw8z2olm0nGHC%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FNw8z2olm0nGHC%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FNw8z2olm0nGHC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="339" frameborder="0" scrolling="no"><a href="https://medium.com/media/f93af8208c1cc4a84cd6d96c3266d71f/href">https://medium.com/media/f93af8208c1cc4a84cd6d96c3266d71f/href</a></iframe><blockquote><em>Since the general population is spending an increasing amount of time in the virtual world, whether it is to post a status or check the account balance; companies have embarked In a race for information speed. Data now travels at an unbelievable rate from one corner of the planet to the other. This efficiency has led to a careless use of energy and diesel consumption . This in turn, has impacted the environment in a negative way and has put into question long term sustainability.</em></blockquote><blockquote><em>As, It appears, most data centers by design, consume vast amounts of energy in an wasteful manner. It is staggering to know that roughly 90 percent of the energy pulled off the grid goes to waste in companies’ attempt to keep servers ready in the event of surge of demand. As Online companies typically run their facilities at maximum capacity 24/7, regardless of the demand which results in a waste of electricity and burning of large amount of diesel. Giant banks of generators emit diesel exhaust continuously without breaks in order to keep servers idle to respond to demand of users who are becoming increasingly active in the virtual world.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Hl4Rr_jDThcvFpRVibpGuA.jpeg" /></figure><blockquote><em>These companies practices have generated a pollution to considerable scale that many industry experts believe that the companies are headed to a brick wall as it was for the internet « .com bubble » or the recent « housing bubble ».</em></blockquote><blockquote><em>It is yet difficult to account for the exact number of data centers since a lot of companies keep them hidden and anonymous in excluded areas or in closed buildings with tight security measures. However, few studies state 8.4 million, with 58 % of companies owing between 2 to 9 data centers, and the remaining percentage owning from 10 facilities going up. With the ownership of data centers being in the upswing experts expect the number to grow drastically as three times the current consumption in the next decade.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2IltvctberWRLlYsVJNeA.png" /><figcaption>Map Of Underwater Cables That Supply The Worlds Internet</figcaption></figure><blockquote><em>There is no doubt that at this point that the “cloud”owners i.e data centers companies need to review their practices in order to limit the pollution they causes and few companies are already attempting to turn to green energy and a sustainable practice.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d9a89bfbca2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understand Enumerable and Enumerators]]></title>
            <link>https://medium.com/@nassersanou23/understand-enumerable-and-enumerators-aab799f25c08?source=rss-6e358b64ea84------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab799f25c08</guid>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Nasser Sanou]]></dc:creator>
            <pubDate>Thu, 11 Oct 2018 19:33:55 GMT</pubDate>
            <atom:updated>2018-10-11T19:33:55.360Z</atom:updated>
            <content:encoded><![CDATA[<p>The Ruby Enumerable and enumerators are very powerful methods that allow you to iterate through objects whether they are arrays, hashes or strings or any type of object that allows themselves to be questioned or sorted through.</p><p>Taken simply, an enumerator is a tool that you can use to open an object like a box and look inside of to search something or to perform a particular operation.</p><p>It allows you to do the following: manipulate items, sort, organize , search for a particular item you think or know is there, add to what is already inside the box or change one or more items in the box, throw away some items or perform some magic over them to to change them into angry frogs or butterflies.</p><p>While these methods are available for you to use to perform some magic operations, it can be very frustrating if you are unfamiliar with their powers, and you don’t know exactly which situation to use one method over the other.</p><p>I have decided to use some examples involving a hash of students in two different classrooms to show the basic use case of a few enumerable methods.</p><p>Here is a hash of junior developers we will iterate over to review use-cases :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjUxrGJWjZ-mV4-TltWh8Q.png" /><figcaption><strong>The Developers’ Hash</strong></figcaption></figure><p><strong>The Concat:</strong> The .concat method allows you to appends the elements of second array to self or the first. In this case it will join the the two mods together and return as a returns new object “students”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_WRQHiXQrq1r__apEpgXKw.png" /></figure><p><strong>The Each: </strong>the .each mostly used to iterate over array object. In this example we iterate over the students and and puts/print ‘each’ student’s name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLwMc8siBwa0ofvCs7AGhQ.png" /><figcaption>Print Each Student</figcaption></figure><p><strong>The Select:</strong> .select does just as its names states, it selects and returns a subset of a given object. In the example below we are selecting a particular student’s hash which can be use for any other purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1smwfrnE1t5MoQ5YM1-uOA.png" /></figure><p><strong>The Sort_by:</strong> .sort_by will allow to sort and re-arrange as needed. in this case we sort_by students grades.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*36OFuWO3Hw4sL5Bp9U8A2Q.png" /><figcaption>Sort By Grade</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qCPms58PsThVh3ecdENJQ.png" /><figcaption>Sort By Name</figcaption></figure><p><strong>The Max_by:</strong> .max_by returns the maximum value from the given block. In this example, it returns the student with the highest grade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ofv6LYvrEV0wah6OO1GRfg.png" /></figure><p><strong>The Count:</strong> .count calculates the sum from the elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4RyTL0kh9dV3RwnJ8QJYw.png" /></figure><p><strong>The Sum:</strong> Return the sum of elements pass in the block.For the purpose of this demonstration, I have used the sum of grades and divided by the sum of student to get the average of both mods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuJXdO97A5NXz3LBeETcoA.png" /></figure><p><strong>The Slice: </strong>.slice method does just as its name states, it “slices” . It will however raise an error if for indices out of the array bounds</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xxxl0pZFoVbOZq3V0W6AEQ.png" /></figure><p><strong>The Reverse: </strong>reverses the order of a given object. In this example it reverses the order of the students name in the array</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4R8MQQbWkrMzsLzdDMJcg.png" /><figcaption>Reverse</figcaption></figure><p><strong>Shift: </strong>Returns the first element of an object and removes it by shifting all other elements down by one. “Returns nil if the array is empty”.</p><p><strong>Next: </strong>“next” can be used as a keyword, the other as a method. It saves you one level of indentation and also “next” allows you to avoid using an “else” block inside certain loops, and it makes your code more readable. For the purpose of the next example “next” is use to call the next element in the students’ names array.</p><p><strong>ENUM: “</strong>Enums can be defined and accessed either as constants or class methods.”</p><p>In the following example. Using shift and enum to yield the names of students and then calling every time for the next students</p><p><strong>ENUMERATORS:</strong> enumerator takes any method that yield value and transforms it into an enumerable object that supports all methods of enumerable.</p><p>In the example below, we will yield all students instance and call them one at the time using enum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioNXS0Qw_h7IKVEvH7ivgw.png" /></figure><p>To conclude, Enumerable and Enumerators are very useful in perform operation on object and there is a wide range of them. Some are more appropriate than other depending on the task at hand. They are great tools to familiarize yourself with so next time you iterate over object you know what tools are available to you and how to use those tools.</p><ul><li><a href="https://apidock.com/ruby/Array/concat">concat (Array) - APIdock</a></li><li><a href="https://www.quora.com/What-does-the-next-keyword-mean-in-Ruby">What does the &quot;next&quot; keyword mean in Ruby?</a></li><li><a href="https://github.com/dblock/ruby-enum">GitHub - dblock/ruby-enum: A handy way to define enums in Ruby.</a></li><li><a href="https://www.tutorialspoint.com/ruby/ruby_loops.htm">Ruby Loops</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab799f25c08" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>