<?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 Erika Caoili on Medium]]></title>
        <description><![CDATA[Stories by Erika Caoili on Medium]]></description>
        <link>https://medium.com/@erikacaoili?source=rss-b63ce38cb495------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4AMIO9gjBBc0tgsC88BOYg@2x.jpeg</url>
            <title>Stories by Erika Caoili on Medium</title>
            <link>https://medium.com/@erikacaoili?source=rss-b63ce38cb495------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:15:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erikacaoili/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[Outage Postmortem]]></title>
            <link>https://medium.com/@erikacaoili/outage-postmortem-5bd2ea46d5ba?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bd2ea46d5ba</guid>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[postmortem]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Mon, 25 May 2020 20:36:51 GMT</pubDate>
            <atom:updated>2020-05-25T20:36:51.584Z</atom:updated>
            <content:encoded><![CDATA[<h4>A sample incident report for all stakeholders in a company</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*plHOAQRwXznq_EAo4ZzuHg.jpeg" /></figure><h4>Issue Summary</h4><p>From 10:30 PM to 8:30 AM, Company X experienced an outage on Cloud X that affected <a href="http://www.companyx.com/">www.companyX.com</a> due to a prescheduled reboot that ended in failure. The points of failure are coming from the rebooting of the load balancer or cache server. The Security Team issued a maintenance update and a reboot notification to a major Cloud X server on May 10, 2020 for a window of 4 hours (10:30 to 2:30 AM). Security Team is patching a security vulnerability in Program X. Customers reaching the site after the reboot scheduled time of 2:30 AM to 8:30 AM could not reach the site, affecting 100% of them. The root cause of the outage was due to the data on the the server not auto-mounting at boot time. The SRE mistakenly acknowledged the incident as something normal during a server reboot and closed all subsequent alerts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl4hLT6kXPi9js7xFC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl4hLT6kXPi9js7xFC%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl4hLT6kXPi9js7xFC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="251" frameborder="0" scrolling="no"><a href="https://medium.com/media/0004f8337a9280fa61e35ffabfeb5833/href">https://medium.com/media/0004f8337a9280fa61e35ffabfeb5833/href</a></iframe><h4>Timeline (all times in Pacific Time)</h4><ul><li>10:30 PM: Reboot begins</li><li>12:26 AM: Outage begins</li><li>12:26 AM: Alerts sent to teams</li><li>12:30 AM: Lead SRE silenced all subsequent alerts due to server behavior being “normal”</li><li>2:30 AM: Server down and customers can’t reach the site</li><li>2:30 AM: Alerts sent to teams</li><li>2:35 AM: A ticket was opened and a database service provider personnel sent over within 30 minutes.</li><li>3:15 AM: Personnel arrives to assess the situation</li><li>4:30 AM: Server restarts begin</li><li>8:30 AM: 100% of traffic back online</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FlMy6ejmADi6pd69qvW%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FlMy6ejmADi6pd69qvW%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FlMy6ejmADi6pd69qvW%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/54e03c5e6e9a3225cb14caa7da2b3cb5/href">https://medium.com/media/54e03c5e6e9a3225cb14caa7da2b3cb5/href</a></iframe><h4>Root Cause</h4><p>At 12:26 AM, the reboot of the load-balancer or cache server continued to fail. The failover server (secondary server) did not come back up for for 3 hours. We did not expect the scheduled reboot to affect our systems. The software update was fine, yet it affected the overall performance of the site. It was not reconnecting to the secondary server. Personnel from the database service provider investigated that the data on the server did not auto-mount at boot time. Our lead SRE claims the incident to be a routine behavior of a server reboot, thus any further alerts were silenced automatically.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FZoBn8lxRuCX9m%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FZoBn8lxRuCX9m%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FZoBn8lxRuCX9m%2Fgiphy-downsized-large.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="319" frameborder="0" scrolling="no"><a href="https://medium.com/media/1992b4ae767ce5d7a3d5ac716135180f/href">https://medium.com/media/1992b4ae767ce5d7a3d5ac716135180f/href</a></iframe><h4>Resolution and Recovery</h4><ul><li>At 2:35 AM, a ticket was opened to fix the down server and sent out to the database service provider personnel. The team arrived at 3:15 AM.</li><li>The NSX CLI is used to get detailed information about tail logs and take packet captures. It also, looks at the metrics for trouble shooting the load balancer.</li><li>Verification of basic services are running by checking the routing table.</li><li>The auto-mount was not successful and a new mount was manually placed by the database service provider personnel at 4:30 AM.</li><li>Processes started to recover slowly. We estimated time to reboot and recovery time to span 4 hours.</li><li>To help with recovery, we retarted affected servers. SRE engineers, manually restarted unicorn processes on the web application servers to further correct the reboot process.</li><li>The process was slow to prevent any possible cascading failures and to avoid a wide scale reboot — affecting our customers even further.</li><li>By 8:30 AM, traffic was restored and 100% of our customers reported back with no issues.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F39xy8LE91GSiRJSCPZ%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F39xy8LE91GSiRJSCPZ%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F39xy8LE91GSiRJSCPZ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="243" frameborder="0" scrolling="no"><a href="https://medium.com/media/f911d7f4b6e354d6afb74862ca46e3f1/href">https://medium.com/media/f911d7f4b6e354d6afb74862ca46e3f1/href</a></iframe><h4>Corrective and Preventative Measures</h4><ul><li>In the last 3 days, we’ve made an internal review and analysis of the outage. The following measures are actions the team will follow for prevention and to improve response times in the future.</li><li>The database server provider during the performance degradation could have alerted teams by noting that the down server was not routine behavior. An update to their systems to prevent further issues in the future are done accordingly.</li><li>The Security Team did not properly plan the reboot schedule affecting many of our customers. There was no available staff to monitor the reboot and to access the situation right away in a timely manner.</li><li>There were no engineers present to possibly resolve the situation by manually fixing any issues that came up.</li><li>For scheduled reboots like this, there should be a 24 hour operations rotation in order to monitor every aspect of the update.</li></ul><h4>Resource on how to write Postmortem Incident Reports</h4><p><a href="https://developers.googleblog.com/2013/05/google-api-infrastructure-outage_3.html">Google API infrastructure outage incident report</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bd2ea46d5ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Checker — Hack Day Challenge]]></title>
            <link>https://medium.com/@erikacaoili/the-checker-hack-day-challenge-3a85c8b361db?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a85c8b361db</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[hackathons]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Fri, 22 May 2020 22:56:42 GMT</pubDate>
            <atom:updated>2020-05-22T22:56:42.418Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Checker — Hack Day Challenge</h3><h4>Hack Day Chronicles from START to MVP</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6ZaRJP9s1WWKkTtX7mE6g.jpeg" /></figure><p>The CHECKER. Any Holberton student will tell you if the Checker was a worthy foe or friend. Whether it was a love or hate relationship, I had a lot of R-E-S-P-E-C-T for the Checker. <em>What is the checker?</em> Before, I get to explaining the automated tool. I will first tell you about Holberton School.</p><h4>Background</h4><p>Holberton School is a Full Stack Software Engineering program. It’s a 2 year program and in the first year, students go through Foundations. The first year covers all the necessary curriculum to be a Full Stack Engineer. You learn the backend and frontend stacks to make an application. You learn about databases, networking, web infrastructure, and DevOps. You learn what it takes to create a full working web application. We apply concepts and skills to build an AirBnb clone and eventually, <em>your own app</em>.</p><p>My team and I are currently on the last trimester of our Foundations year. In the third trimester, we apply what we learn so far in events like Hackathons.</p><h4>What is a Hackathon?</h4><p>It’s also called, Hack Day, HackFest, or CodeFest. A Hackathon involves computer programmers and others involved in the software development. It’s a design sprint-like event that requires everyone to work together to get a product deployed. There’s a time constraint. Usually, the event can take 24 hours of nonstop coding, sprinting, and developing until the product’s deployment. In our case, the Hack day lasted about 12 hours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PiJiIxMhkMfKnIOJlwIEHw.jpeg" /><figcaption>An IDEAL Hack Day. Due to Covid-19, it’s a special hackathon. WFH HACKKKKK DAY!</figcaption></figure><h4>What do you learn at a HACKATHON?</h4><p>This is not my first Hackathon, so before I talk about our Hack day challenge, I want to share some key takeaways.</p><ul><li><strong>No matter what experience you have…anyone can add value.</strong></li><li>Speak up! If you have an idea, SHARE! In order to add value, you have to be involved.</li><li><em>ASK QUESTIONS…many questions… it can be anything!</em></li><li>Be happy for small victories.These sprints can be exhausting and can also, put a lot of pressure on everyone individually. To be successful, keep an eye out on the parts that are working and doing well. Maybe you’re not solving the problem, but everyone is working together and collaborating. Everyone is motivated to help one another and to achieve some sort of improvement.</li><li>Don’t give up. You’re not alone in this quest. Use collaboration to your advantage.</li><li>Take breaks, stretch, eat, drink water, and HAVE FUN!</li></ul><h4>Roles</h4><blockquote>It’s NOT only for computer programmers. Anyone can participate. Everyone should participate because creating a product in a small timeframe is an ALL HANDS event. Every person has a role and each person makes a valuable contribution to the overall product. Everyone who plays a role in the software development takes part in the Hackathon. For instance, in our Hack Day Challenge, we have a:</blockquote><pre><strong>- CEO</strong>: ME!! (I attend &quot;Board meetings.&quot; At these meetings, I ask school staff all the necessary info to complete the challenge and to ask questions for my team.)<br><strong>- Product manager</strong>: Ben (He actually has many roles and mainly, our CTO)<br><strong>- Backend Engineer</strong>: Bob Machine (my fave nickname for him)<br><strong>- Frontend Engineer/UI/UX Designer</strong>: Anthony <br><strong>- SWE responsible for Documentation</strong>: Ken (every product always has good docs)<br><strong>- Public Relations/Videographer</strong>: Raudo (Demo of our product, link to our video on the bottom)<br><strong>- Blog Writer</strong>: Me (a log of our Hack day)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*TKZNqoruRnaF0Wz004qEzA.png" /><figcaption>The Team!! REMOTE WFH HACKATHON at its greatest. I didn’t want to bug them to open their cameras haha. They are busy working.</figcaption></figure><h4>What is the Checker?</h4><p>At Holberton, the school and program is global. Our school is in San Francisco. There are also other campuses around the world. Holberton is in New Haven, CT, but also in, Puerto Rico, Columbia, Tunisia, Lebanon, and Uruguay!</p><p>In order for our school to scale globally, school operations need automation. Automation allows for operations to run smoothly and to provide students from all different backgrounds to enroll in the program.</p><p>The Checker allows automated grading by running our tasks through the program to check our code. I will show you an example task and an overview of how The Checker works.</p><h4>Example Task in a Project</h4><p>At Holberton, we use GitHub to push our code. The Checker grabs the info from our GitHub that corresponds with the Project Number and Task. In this case, the following task is from project number: 0x00-hello_world. Below is an example of the project task 0.Preprocessor.</p><pre>Write a script that runs a C file through the preprocessor and save the result into another file.</pre><p>Here is my code:</p><pre>#!/bin/bashgcc<br>-E $CFILE -o c</pre><p>Before you run The Checker</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*GgC-AcWuDTe4QoBfg3ppXA.png" /><figcaption>You click on the button ‘Start a new test’</figcaption></figure><p>This is what The Checker looks like when I get the answer correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*meWyADwg0WMvDzTZvjyxNQ.png" /><figcaption>The commit ID corresponds to the commit ID of the (most) current push of code from Github.</figcaption></figure><p>Here is an example of The Checker showing the student red checks, which means that the test showed wrong output checks. The code is not completely correct and needs modification to pass the output checks. The Checker also checks for requirement checks. These checks look for required fields and parameters included in the task. These checks also include formatting checks such as Betty for C and pep8 for Python 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*MkzbdpFXa4bYjfR9MDtWXw.png" /><figcaption>The Checker can also, check an algorithm’s efficiency and the yellow square tells the student if there is an efficiency fail. Efficiency refers to the time complexity of an algorithm. (Note: Different task from the first example)</figcaption></figure><h4>The Hack Day Challenge</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*-yUJSqkjMZAz8m9fhIHKlA.png" /><figcaption>This is our problem and we have 12 hours to create a MVP.</figcaption></figure><h3>The First Two Hours…are CRITICAL.</h3><p>Everyone on the team must understand what the problem is and how to solve it. What is the MVP? And how do we get there on time? I outlined for you how our team used our time during this period.</p><ol><li><strong>READ</strong>: We took about 15–20 minutes to look over the problem’s mandatory tasks and to study the Checker API. What are the endpoints? How many requests can we make?</li><li><strong>DEFINE: </strong>We brainstormed on ideas on what we wanted to do. We created a Google doc and recorded different ideas. We also defined what our MVP is. We talked about features and basically, had a running discussion. After some deliberation, we all decide as a group what we wanted to build.</li><li><strong>ROLES:</strong> Now, that we understand what our end product should be, we deliberated over roles and responsiblities. The picking of roles was laid back and it was nice to choose a role that we wanted. I of course, chose CEO! Bob, who wants to be a backend engineer chose to work in that end. We did all decide that Raudo would be perfect as our PR and Videographer. If you watch our video below, you will see why.</li><li><strong>PLAY:</strong> We have check if the API works and do some tests before we create our own Checker.</li><li><strong>PLAN:</strong> Back to our Google doc, our Product Manager, Ben</li></ol><h4>API — Application Programming Interface</h4><p>We will be working with APIs. It’s a software intermediary that lets two applications talk to each other. Basically, an API is a messenger that delivers your request to the provider that you’re requesting it from. The API in turn, delivers the response back to you.</p><p>For example, when you visit <a href="http://www.google.com/">www.google.com</a> into your browser, you’re making a request. The request is sent to Google’s remote server. Your browser gets a response from the server and displays the Google home page. You can think of the Google server as an API.</p><p>We will be working with the Checker API. The Checker scans our code for errors and tests our code if its correct. Being able to create our own features to the Checker is a neat way of learning how the Checker interacts with the users.</p><h4>What does our Checker do?</h4><p>We created a Checker CLI. A CLI is a <strong>C</strong>ommand <strong>L</strong>ine <strong>I</strong>nterface. We interact with the Checker on the web browser. However, we do all of our coding on the terminal via our text editors (Vim or Emacs). <strong>Wouldn’t it be nice to do all the checking in one place?</strong> This is a nice feature to have and it’s a great way to improve work productivity.</p><h4>Checker Command Line Interface</h4><p>In order to use the Checker, we will have to authenticate the user credentials. When you run the checker, the User will be asked to enter :</p><pre>Please enter API key:123a5a7y899abcde3zyx0u4be019f1234<br>Please enter your holberton email: user@holbertonschool.com<br>Please enter your holberton password: abc123</pre><p>The User credentials get saved in the authentication token. This token is the key to make calls to the Checker API. The Checker CLI has commands</p><pre>status &lt;project_id&gt; [task_num] -- Gets the status of a certain project</pre><pre>project_id = The ID of the project to get the status of </pre><pre>check &lt;project_id&gt; [task_num] -- the most important command that checks your         project task </pre><pre>help -- spits out options for the user when running the CLI</pre><p>Color Codes — when running the checker:</p><pre>White: Task has not been checked by the Checker CLI<br>Red: Task has NOT passed all green checks<br>Green: Task has passed all green checks</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*4LMFDoyytR6UorWa2u80jA.png" /><figcaption>Task 3 is complete and correct. Task 4 is wrong. The other tasks are not checked by the checkerCLI.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*B4bOAfnPmop1KUn7RJ1bLg.png" /><figcaption>Checks have not been made</figcaption></figure><h4>Example of a Task being checked</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8213-KopDrUpi2dLCoD3Hg.png" /><figcaption>You run the executable ./checkercli.py + command check with project_id and task_number. The message “You are Error” is printed when a task is wrong. The messages are randomized.</figcaption></figure><h4>Help Command</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VkssHubm7oZOa18JZdk9FQ.png" /><figcaption>Options of what you can do with the CLI.</figcaption></figure><h4>To see a live demo of how the Checker CLI works, watch here</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmYIjqBE7I9o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmYIjqBE7I9o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmYIjqBE7I9o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb938693ffbf30514f0ef55b8965c721/href">https://medium.com/media/bb938693ffbf30514f0ef55b8965c721/href</a></iframe><h4>Conclusion</h4><p>This is my second hackaton and I really enjoyed it! I think our team did a great job of completing a MVP by the deadline. Also, we all worked together not to just code the program, but to create a video and a blog post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a85c8b361db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Our First Hack Day]]></title>
            <link>https://medium.com/@erikacaoili/our-first-hack-day-383f2d25b2a9?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/383f2d25b2a9</guid>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Sat, 09 May 2020 06:55:42 GMT</pubDate>
            <atom:updated>2020-05-09T06:55:42.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2HnJBP2D94uLXHviojAz5w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@kellysikkema?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kelly Sikkema</a> on <a href="https://unsplash.com/s/photos/x-and-o?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>At Holberton School, we finally reached the last trimester of our Foundations year. So far we have covered low level and high level languages. We learned about the different data structures and the algorithms. We know how to manipulate all kinds of data and retrieve data with APIs. We learned about system engineering and we know what happens in a web infrastructure. But, we never experienced Hack Day!! Today, was our first hack day in a language we never seen or learned about before.</p><p>We chose Unity! What’s interesting about Unity is that it’s not exactly a programming language. Unity is a cross platform game engine. It was released on June 2005 and much younger compared to the primitive list of languages given to us (COBOL, Fortran etc.) It’s a super powerful suite that allows you to create anything in gaming. It can create 3D, 2D, virtual reality, and augmented reality games. You can use the platform in industries such as video gaming and film. You can also, see Unity with automotive, engineering, architecture, and construction industries.</p><p>C++ is the language used to create the Unity game engine. It does have an exception of having a .NET API, so the game developer does not have to write the game in C++. The game developer can write in C# or in Javascript. The editor application’s UI uses C#. Learning and building a game on the UI is difficult in itself. It’s a powerful tool, but to understand functionality — one must be first familiar. We understand why it was listed with the other languages, learning the tool was also equally difficult.</p><p>We’re tasked to create a Tic Tac Toe game. With Unity, we can build the game with its UI and two basic scripts. The final product of our game looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*dm2aAx3fysAtcvmx8BtzRQ.png" /></figure><p>The version of Unity we used was 5.3 and we found this resource that helped us to build our game. We build our game in 2D. You can find the link at the end of this post.</p><p>The two takeaways about building the game in this platform are:</p><ul><li>the versatility of the Unity UI toolset</li><li>understanding of breaking the problem into parts.</li></ul><p>The game has the following basic elements:</p><ul><li>The background to represent the backdrop of our game</li><li>A big element to represent the game board</li><li>Small elements broken up to 9 parts of the board to create a grid</li><li>Nine spaces that can either have an “X” or an “O.” When the space is assigned, these values can’t be changed by the neither the current or the other player.</li><li>Logic to allow turns when a player moves</li><li>Logic to see which player WINS the game</li><li>Draws for where there is no winner</li><li>A panel that shows who is the winner when the game ends</li></ul><p>In conclusion, the game was a success following the step by step tutorial. It took some time learning and understanding how the tool set works. You can see the code source and preview the game in the following repo below.</p><ul><li><a href="https://github.com/nhlshstr/tic_tac_toe_java">nhlshstr/tic_tac_toe_java</a></li><li><a href="https://learn.unity.com/tutorial/creating-a-tic-tac-toe-game-using-only-ui-components/?tab=overview#5c7f8528edbc2a002053b4bc">Creating a Tic-Tac-Toe Game Using Only UI Components - Unity Learn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=383f2d25b2a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type a URL in your browser]]></title>
            <link>https://medium.com/@erikacaoili/what-happens-when-you-type-a-url-in-your-browser-5a4493dc7921?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a4493dc7921</guid>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 05:28:12 GMT</pubDate>
            <atom:updated>2020-04-13T05:42:24.696Z</atom:updated>
            <content:encoded><![CDATA[<h4>Let’s explore what goes under the hood when you type in <a href="https://www.medium.com/">https://www.medium.com</a> and press enter.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wBNAXJQe78PMx06-1WUAsw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@kundeleknabiegunie?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Agnieszka Boeske</a> on <a href="https://unsplash.com/s/photos/browser?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I’m going to walk you through what happens when we type web pages in our browsers. It’s a real common thing. Understanding what goes on behind the scenes will allow you to marvel at how far we have come. Its a feat we do take for granted. I hope you will walk away with some appreciation of how this all works.</p><p>When you a type the following url — <a href="https://www.medium.com/">https://www.medium.com</a>, you’re typing in its Uniform Resource Locator. It retrieves access to the address of a web page, specifically the World Wide Web. This is where the www comes in. The browser reads your web page and reads the page based on the HTML language. It stands for HyperText Markup Language. Medium’s web page is something that is not stored on your local machine or hard drive. The web page needs retrieval and its stored in a web server. Its held remote away from you and you need to access it. So how does that happen? To access Medium’s web page, the URL gets translated to an IP address — Internet Protocol.</p><p>Up until this point, you probably know that already and the information you read is nothing new. However, I’m going to dive even deeper and talk about the other things that come into play such as <em>DNS look up, TCP/IP, databases, and so on</em>.</p><h4>DNS Look Up — Domain Name System</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*_8Fqc_QObWuAVfRuqsofMg.png" /><figcaption><a href="https://howdns.works/ep1/">https://howdns.works/ep1/</a></figcaption></figure><p>DNS is no other than a database that stores and maintains the name of the URL (the website). It holds the particular IP address the url links to and stores the record of that IP address. Think of the DNS as an address book, a record book of all the different IP addresses. Every URL in the internet holds a unique IP address. The different URLs correspond to different websites like how an address book works. The IP address contains the location of the computer. It hosts the server of the website you’re accessing. For instance, <a href="https://www.medium.com/">https://www.medium.com</a> has an IP address of <a href="https://myip.ms/info/whois/104.16.120.127">104.16.120.127</a>. If you type in the following IP address, you can access the main web page of Medium. However, for humans it would be difficult to remember all the different IP addresses for all the websites that we use. URLs are more human friendly to remember and its access to the DNS makes the database do all the work.</p><p>To access the DNS record of Medium, the browser will check the cache. The cache goes through four different steps.</p><ol><li><strong>Browser</strong>: It checks your browser if you recently visited Medium. Your browser stores DNS records for sites you frequently visit. How thoughtful and handy.</li><li><strong>Operating System</strong>: It checks your OS cache in your operating system. This is a system call to your OS since your OS keeps a cache of DNS records.</li><li><strong>Router</strong>: It checks the router cache. It seems like the cache is a nice way to keep the DNS record ready to go when you need it.</li><li><strong>Internet Provider</strong>: It checks the ISP cache. Finally, it checks your Internet Service Provider cache system if the following steps above fail.</li></ol><p>To dive further how the ISP makes a DNS query to find the IP address, read: <a href="https://www.liquidweb.com/kb/understanding-the-dns-process/">https://www.liquidweb.com/kb/understanding-the-dns-process/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SxcWkfPE-8d_Hddo5vtgA.gif" /><figcaption>How cache works</figcaption></figure><h4>TCP/IP — Transmission Control Protocol + Internet Protocol</h4><p>The browser now holds the IP address to access the server to the web page. The next step establishes the connection by means of the TCP/IP. Its the most common protocol when accessing a HTTP request. Transferring of data packets from your computer (also known as the client) and the server is called the TCP/IP three way handshake. An exchange between the client and the server over 3 steps:</p><ol><li>SYN (Synchronize): A SYN packet sent by the client, requests if its open for new connections.</li><li>ACK (Acknowledge): If open, the server responds with an ACKnowledgment of the SYN packet using a SYN/ACK packet.</li><li>SYN/ACK: The client retrieves the packet and acknowledges it by sending an ACK packet back to the server. This creates the TCP connection and how the data transmission occurs.</li></ol><p>More information on TLS handshake: <a href="https://github.com/alex/what-happens-when#the-g-key-is-pressed">https://github.com/alex/what-happens-when#the-g-key-is-pressed</a></p><h4>HTTP Server Request and the Load Balancer</h4><p>We want to start transmitting data so we can get this web page up. The HTTPD is the server that maintains the requests and responses on the server side. Examples of HTTPDs include Apache, nginx for Linux, and IIS for Windows.</p><p>A load balancer is the gatekeeper that sits in front of the servers.</p><h4>Load Balancer Functions:</h4><ul><li>It distributes client requests</li><li>It allows high availability and reliability by sending requests to servers that are open and online</li><li>It provides the adaptability to increase or decrease servers as demand dictates</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ken3IQVzw5YTW3IyMKLOhw.png" /><figcaption>Load Balancer Diagram, <a href="https://www.nginx.com/resources/glossary/load-balancing/">https://www.nginx.com/resources/glossary/load-balancing/</a></figcaption></figure><p>The server breaks down the request in the following parameters:</p><ol><li>HTTP Request Method: GET — The server must verify if the website can accept GET requests.</li><li>Domain name: medium.com</li><li>Requested path or page: Since there is nothing after the .com there is no path to a specific page request. This is a default path.</li></ol><p>Once the parameters are met, the server can pull the content that coincide with the request. There is an index file that corresponds with the web page that will allow the server to read the contents. The server will parse the file. For instance, if Medium is running on PHP, the server uses it to interpret index file. It then, streams the output to the client (your computer).</p><p>The server then provides information for HTML, CSS, JS, images, etc. to the browser.</p><h4><strong>Browser</strong></h4><p>The Browser now presents the web page according to the HTML files specified in the HTML and CSS specifications. The maintenance is by the World Wide Web Consortium (W3C) organization. They are standards for the organization of a web page.</p><h4>HTML Parsing and CSS interpretation</h4><p>To pull up the web page, the rendering machine starts retrieving the contents of the web page from the networking layer. The HTML parser will parse the HTML markup into a parse tree.</p><p>The parse tree is the output of the web page. It’s a Document Object Model that holds an element and attribute nodes. “It is the object presentation of the HTML document and the interface of HTML elements to the outside world like JavaScript. The root of the tree is the “Document” object. Prior of any manipulation via scripting, the DOM has an almost one-to-one relation to the markup”</p><p>The parsing algorithm of HTML follows the HTML5 specification through the two stages of tokenization and tree construction.</p><p>Resource: <a href="https://github.com/alex/what-happens-when#the-g-key-is-pressed">https://github.com/alex/what-happens-when#the-g-key-is-pressed</a></p><p>When HTML parser is complete, browser can fetch CSS, images, JavaScript, etc. The browser marks the document as interactive and begins parsing scripts that are in “deferred” mode. This can only be done after the document was parsed by the HTML parser. CSS files parse according to their tag contents and style attributes. Each CSS file converts into a StyleSheet object. Each object has CSS rules with selectors and objects that align with CSS grammar.</p><h4>What about security?</h4><h4>Firewall</h4><p>In this process of connecting to our web page, we have to keep in mind of security. A firewall is a network security system. It monitors and controls all incoming and outgoing network traffic. Above, we went through many data transmissions and for the sake of keeping explanations simple — I left out a key thing: security of data.</p><p>In the case of the TCP/IP stack, we can place firewall here to filter packets unless they match the established rule set.</p><h4>HTTPS/SSL</h4><p>When you see Medium’s URL, you see a cute little lock next to it. It means the site uses HTTPS, which is a secure extension of HTTP. In order to obtain the “s,” websites must configure an SSL/TLS certificate. The SSL certificate allows the HTTPS protocol to create a secure connection to the server. The goal is to make a safe and secure transmissions especially if the site includes personal data, payment, or sensitive login information</p><p>HTTP is just a plain text data transfer. The data transmission and connection to the server will remain unencrypted. This will make the website vulnerable to criminals and hackers to steal your data.</p><p>SSL means Secure Sockets Layer and its a type of digital security that allows encrypted communication between the web browser and the website.</p><h4>Conclusion</h4><p>I hope you have a better understanding and a better appreciation of what happens when going into the Medium website. What gets me is the fact that all of these details happen in the matter of seconds. The fast connections and the rendering of the page happens in the blink of the eye.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhCWwIpDRC3oQiMCnOyTcg.png" /><figcaption>My diagram of what happens when you type a url in your browser</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a4493dc7921" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IoT Basics: The Internet of Things]]></title>
            <link>https://medium.datadriveninvestor.com/iot-basics-the-internet-of-things-69e491a3af2e?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/69e491a3af2e</guid>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[amazon]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 01:11:52 GMT</pubDate>
            <atom:updated>2020-03-12T11:54:04.405Z</atom:updated>
            <content:encoded><![CDATA[<h4>It saves time, money, waste, and decreases environmental impact. A data-driven world is a superpower.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCnN5hv9NcTqGTxydWxM3Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@sushioutlaw?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Brian McGowan</a> on <a href="https://unsplash.com/s/photos/modern-world?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><blockquote>Internet of Things or IoT is already a part of your life, but the rest of us non tech folk are still unclear what it is. Why should you care or the rest of the world for the matter? It’s important because its impact will determine how the world runs or will run in the future…What do I mean by this?</blockquote><h4>What is the Internet of Things?</h4><p>According to a blog post written by Jen Clark, <em>“the Internet of Things is the concept of connecting any device (so long as it has an on/off switch) to the Internet and to other connected devices”</em> (<a href="https://www.wired.co.uk/article/internet-of-things-what-is-explained-iot"><strong>What is the Internet of Things?</strong></a>). IoT are everyday items and devices that impact your daily life. For example, your Apple watch measures your heart rate and physical activity. Known as wearable devices that can help users by making health-conscious decisions.</p><p>In a real practical sense, it can include connected machines and objects in factories. These embedded devices connect to the internet to collect and exchange data. They can also exchange data with each other to learn, collaborate, and interact. IoT does this to get information to gain data on its users and the environment around them. It gains information to make an experience better for the user. Within an assembly line of a factory, it can gather information to make the work more efficient.</p><blockquote>‘IoT allows devices on closed private internet connections to communicate with others and “the Internet of Things brings those networks together. It gives the opportunity for devices to communicate not only within close silos but across different networking types and creates a much more connected world”’ <em>(</em><a href="https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/"><strong>What is the Internet of Things, and how does it work?</strong></a><em>).</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*i_lWFYkQhkmlYnFHHZW1bQ.png" /><figcaption>Examples of IoT applications. Internet of Things include embedded devices like the ones above to collect and exchange data with each other.</figcaption></figure><blockquote>In a nutshell, Internet of Things comprises of a giant network of connected things and people. Your FitBit can measure your physical activity and record calories burned. The wearable device collects data and suggests recommended exercises tailored to the user.</blockquote><h3>What is the advantage of connected devices sharing data?</h3><p>IoT can change the way we run business, which will ultimately affect our economy and the lives of people. By collecting data and learning from the information, IoT sheds light on how we can save on time and money. For example, within industrial applications, sensors on product lines can increases efficiency. Furthermore, it can make production streamlined and efficient to decrease carbon emissions. IoT aids in environmental impact. “It allows companies, governments and public authorities to re-think how they deliver services and produce goods” (<a href="https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/"><strong>What is the Internet of Things, and how does it work?</strong></a><em>).</em></p><p>For example, within industrial applications, sensors on product lines can increases efficiency. This results in cutting down on waste and money. You can automate certain tasks to speed up time especially if the tasks are repetitive.</p><p><a href="https://www.datadriveninvestor.com/2019/09/28/making-sense-of-iot/">Making Sense of IoT | Data Driven Investor</a></p><p>From a safety perspective, companies like Concrete Sensors embed devices in the concrete. By doing so, the company can collect data on the condition of the material. This can be part of a safety measure for infrastructure in a city or town. IoT holds many advantages that can spark a “fourth industrial revolution.” <strong>Soon, all industries will join in the effort.</strong></p><p>Also, it can increase the safety of factory workers by limiting dangerous tasks. Smart objects and systems allow automation to increase safety in an assembly line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*jRqBXr3FSEevaWQVsHoi3g.jpeg" /><figcaption>IoT falls under the Fourth Industrial Revolution, the Digital Connected World.</figcaption></figure><h4>How does it work?</h4><p>Sensors placed inside devices and objects connect to an <strong>Internet of Things platform. </strong>It “integrates data from the different devices and applies analytics to share the most valuable information with applications built to address specific needs” (<a href="https://www.wired.co.uk/article/internet-of-things-what-is-explained-iot"><strong>What is the Internet of Things?</strong></a>). The IoT platform decides what data and information are useful. It takes into account what information to discard safely. An analysis of the data can detect patterns and make recommendatons. As a prevention measure, it can detect problems before they arise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*xgx1TfFZPtaY3XxwfrIcAw.jpeg" /><figcaption>Data Collection and Organization</figcaption></figure><h4>Scenario #1 in Business</h4><p>To understand how IoT would work in the real world let’s use a real life example. Let’s say you have a car manufacturing business. As a business owner, you’re trying to figure out where you want to spend on — alloy or steel wheels. Leather seats vs. non-leather seats? You want to know which optional component is popular and which one does not attract the public’s eye. IoT can help you solve these questions.</p><p>You can attach sensors to various parts of the car and the showroom. The sensors can pick up data on where the customers linger to most and where they spent most of their time. You can zoom into the sales data to analyze what optional components are selling the most. As an owner, you can use this sales data to coincide with supply and never be out of stock.</p><p>As a business owner, IoT allows the client to make smart decisions based on real time and accurate data. You will be able to cut costs on unneeded items and spend more to fit your customer needs.</p><h4>Scenario #2 for YOU</h4><p>Your regular alarm clock wakes you up just fine at 7:30 am on the dot. You check your phone and you get a tweet that BART suspended all trains in your area. You do have a car, but you’re going to be 30 minutes late because of traffic and it’s pouring rain. There are accidents on the road. It takes longer to drive. If you knew of this sooner, you would have got up at 6 am to drive to work and make it on time. So, what happens when you have a IoT enabled alarm clock?</p><p>Based on the above factors, the connected alarm clock would reset itself to fit the constraints of a canceled train and bad weather. Your trusted alarm clock would know that your usual train got canceled and it would find options for you. It can calculate a driving time if you have a vehicle or other forms of transport. It can factor in the weather and car accident information to calculate a longer trip to work. How amazing does this sound? I don’t know about you, but I’m excited for a more connected world that makes me focus on the work that matters to me.</p><h4>What are the privacy implications?</h4><blockquote>“Everything that’s connected to the internet can be hacked, IoT products are no exception to this unwritten rule” (<a href="https://www.wired.co.uk/article/internet-of-things-what-is-explained-iot"><strong>What is the Internet of Things?</strong></a><strong>)</strong></blockquote><p>When all products become connected there’s a possibility of risking your privacy. Companies or someone can use location tracking, track you, and can use the data in unethical ways. Companies can observe their customers and clients to exploit or to control them. It can also gain access to networks and also, claim user credentials. The government can use it as surveillance and that power is a total invasion of privacy.</p><blockquote>“James Clapper, the US direction or national intelligence <a href="https://www.theguardian.com/technology/2016/feb/09/internet-of-things-smart-home-devices-government-surveillance-james-clapper">said in 2016.</a> Wikileaks later <a href="https://www.wired.co.uk/article/cia-files-wikileaks-vault-7">claimed</a> the CIA has been developing security exploits for a connected Samsung TV” (<a href="https://www.wired.co.uk/article/internet-of-things-what-is-explained-iot"><strong>What is the Internet of Things?</strong></a><strong>).</strong></blockquote><p>Cybersecurity in a IoT world is a huge priority to protect all customers. Furthermore, an IoT connected world should follow an ethical code of conduct.</p><h4>Compatible Standards</h4><p>Communication should be standard in all fronts so devices can work together. Connected devices have to speak to each other to transfer data. Sharing of data collection is pivotal for connected devices. If the devices follow different standards, it will be difficult to share information. This is important when you want to scale up with IoT devices and make it enterprise ready. Microsoft solves this problem by creating an IoT Central Network. Its a standardized platform for businesses to manage IoT devices.</p><h4>Best Examples of IoT Applications in the Real World</h4><h4>#1 Smart Homes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Br6fIbBSnfUDRpP8OGyckg.png" /></figure><ul><li>With your your cellphone and embedded devices at home — you can customize your home to fit your needs.</li><li>For instance, you can control security by installing sensors, cameras, and connected locks. With your cellphone, monitoring your home when away will be easy. You can feel at ease to lock your home remotely. You can also keep track of packages that come to your door.</li><li>You can control the temperature of your home when you’re at work and have it warm up in time to make it home.</li><li>You can have a smart refrigerator that keeps track of your food and lets you know when you’re running out of eggs.</li></ul><h4>#2 Amazon Go</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SA787uTGYgk6odhXnyqefQ.png" /></figure><p>Amazon is using IoT to create retail stores free of cashiers and cash counters. It’s the best part of both worlds in shopping and online shopping. The Amazon app stores your money for purchases or acts as the cashier. There are sensors on products . When a customer picks up a product from the shelf — the item is automatically added to your cart on your phone. When the product gets placed back, the product gets removed from the cart. When you leave with it, the money becomes deducted from your account. Watch the video to see how easy it looks!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNrmMk1Myrxc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNrmMk1Myrxc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNrmMk1Myrxc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/23e52b8d0f4af59b9ea422f9de4a948a/href">https://medium.com/media/23e52b8d0f4af59b9ea422f9de4a948a/href</a></iframe><h4>#3 Health Care</h4><p>Data and resources for current medical research lack real world data. Furthermore, data is from controlled environments. The information uses old data and data from volunteers for medical exams. With IoT systems, health care professionals can access real-time field data. They can also, test their findings all types of environments. Also, they can use the data to gauge availability and needs of a hospital. It can improve connected medical devices by adjusting precision and availability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yn1HNfpCsWHXc48kOoDV5w.png" /><figcaption>Here’s how an IoT-enabled care device works</figcaption></figure><h4>Resources:</h4><ul><li><a href="https://www.wired.co.uk/article/internet-of-things-what-is-explained-iot">What is the Internet of Things? WIRED explains</a></li><li><a href="https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/">What is the Internet of Things, and how does it work?</a></li><li><a href="https://analyticstraining.com/5-best-examples-iot-applications-real-world/">5 Best Examples of IoT Applications in the Real World | Analytics Training Blog</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fb2a0d6%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fb2a0d6%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href">https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69e491a3af2e" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/iot-basics-the-internet-of-things-69e491a3af2e">IoT Basics: The Internet of Things</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grandma, the machines are taking over…]]></title>
            <link>https://medium.datadriveninvestor.com/grandma-the-machines-are-taking-over-26149b96ecff?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/26149b96ecff</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[k-nearest-neighbours]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Mon, 27 Jan 2020 07:26:42 GMT</pubDate>
            <atom:updated>2020-03-16T11:23:17.790Z</atom:updated>
            <content:encoded><![CDATA[<h4>Everything You Should Know</h4><h3>Machine Learning 101</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*vhm4sOaozpp_0dayHMPCyQ.jpeg" /><figcaption>Google is emphasizing that it is indeed a AI/ML dominated company.</figcaption></figure><h4><strong>An Introduction to Machine Learning:</strong></h4><p>Machine learning (ML) consists of computer algorithms. Algorithms are a set of rules or steps for solving a particular problem in a procedural fashion. Think of it as a recipe to get a desired outcome. Instead of banana bread, you get fresh baked cookies of data and information. Algorithms allow computers to learn from the data. It’s autonomous and with it, the computer makes predictions and decisions. Machine learning computers can operate without the programmer telling it what to do. Programmers are a vital part to computer programs because the computer needs instructions. Yet, in machine learning computers, it can change and improve the algorithms on their own.</p><h4>Examples of Machine Learning:</h4><ul><li>It’s the day after Thanksgiving and your mom is bugging you to upload photos on Facebook. The social media platform uses facial recognition technology to recognize your family members. It easily recognizes relatives with a square to highlight the tagging feature. Boom. Photos are now shared with the family.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*bC-xNuMhFp1XVmco7023qg.jpeg" /></figure><ul><li>It’s a long day and all you want to do is binge something on Netflix. Chinese food in hand, you’re tired and you don’t want to make one more decision. Netflix keeps track of what you watch and builds a list of recommendations. It suggests movies or TV shows based on the user preferences. You instantly have a curated list.</li></ul><p>Machine Learning is a field in Computer Science — the study and use of computers. It’s a field that continues to grow and develop rapidly. Knowing the history and how machine learning works is a must like eating your veggies! It’s because machine learning will ultimately impact most and probably all industries. It will become part of daily life like your smart phone and social media.</p><h4>The goal of this post is to guide you to the inner and outer workings of ML. You already use it all the time. It’s definitely not going anywhere. To truly appreciate the technology and to make sense of how the world is changing — you should know what it is.</h4><p>Machine Learning comes from the subfield of Artificial Intelligence (AI). The goal of machine learning is to analyze the structure of data and fit that data into models. The models help Data Scientists and ML Engineers to understand the data and to use it.</p><h4>How does Machine Learning differ from Traditional Computing?</h4><p>Think of traditional computing as the way programmers generally write and code programs. The algorithms in this case are a set of programs with explicit instructions. The computer uses it to calculate data or problem solves to get a desired outcome.</p><p><a href="https://www.datadriveninvestor.com/2019/01/23/deep-learning-explained-in-7-steps/">Deep Learning Explained in 7 Steps - Updated | Data Driven Investor</a></p><p>Remember ML algorithms learn from the data inputs. The computers trains itself by changing or tweaking the algorithm if needed. When the computer is analyzing the data, it uses statistical analysis. At this point, the computer can output values that fall in a certain range. ML allows computers to easily build models from sample data. This is how automated decision making processes become possible based on data inputs. ML is a facilitator to that process.</p><h4>What do we mean when we say “intelligent”?</h4><p>First of all, let’s get some facts straight. ML is not the same as human intelligence. Computer scientists define Artificial Intelligence as intelligence exhibited by machines. It is also known as machine intelligence. ML computers or AI programs are “intelligent agents”: any device that perceives its environment and takes actions that maximize its chance of successfully achieving its goals.</p><h4>Origins of Machine Learning and Milestones</h4><ul><li><strong>1950:</strong> Alan Turning debuts the “Turing Test.” It tests for real intelligence in a computer by fooling the human that the computer is also human.</li><li><strong>1952:</strong> Arthur Samuel created the first computer learning program at IBM. The program involved the game of checkers. After trials of playing, the computer would improve upon its moves. It would come up with strategies and movies to win.</li><li><strong>1967:</strong> computers started to recognize a basic pattern through the k “nearest neighbor” algorithm.</li><li><strong>1990s</strong>: ML shifts to a data-driven approach. Programs for computers would study large amounts of data. From this, computers make conclusions from it or begin to learn from the data inputs.</li><li><strong>2006:</strong> Deep Learning (DL) is born and named by Geoffrey Hinton. DL uses algorithms that allow the computer to recognize and distinguish objects and text in images and video.</li><li><strong>2014:</strong> DeepFace developed by Facebook. It’s an algorithm that allows the computer to distinguish or verify people on photos to the same degree a human can.</li><li><strong>2015:</strong> Amazon develops its own ML platform. This changes e-commerce and the way consumer shop.</li><li>More historical dates — <a href="https://www.forbes.com/sites/bernardmarr/2016/02/19/a-short-history-of-machine-learning-every-manager-should-read/#5847a7b315e7">“A Short History of Machine Learning”</a>, by Bernard Marr</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YMYD5vtoxYgZ9j68jdBwrg.png" /><figcaption>Number of AI startups acquired by major players.</figcaption></figure><h4>Machine Learning Methods</h4><p>Supervised and Unsupervised learning are the two most widely used ML methods. <strong>Supervised Learning</strong>: algorithms receive training based on example input data. The output data becomes labeled and analyzed by humans <strong>Unsupervised Learning</strong>: algorithms use unlabeled input data. The algorithm processes the data to find common features.</p><h4>Supervised Learning:</h4><ul><li>The computer receives example inputs that have labels. The labels are instructions to the algorithms desired outputs. The reason for this is for the algorithm to “learn.” The algorithm is autonomously comparing the actual output with the “trained” outputs to find errors. When errors occur, the algorithm modifies the model accordingly. Supervised learning is a way to use patterns to predict label values on more unlabeled data.</li><li>For instance, an algorithm receives data with images of hats labeled as accessories and images of dresses labeled as clothing. The computer trains on this data. The supervised learning algorithm should be able to distinguish the unlabeled images according to its labeled inputs. Thus, unlabeled hats become images of accessories and unlabeled dresses become images of clothing according to the algorithm.</li></ul><h4>Common Uses</h4><blockquote>The input of historical data to predict future event</blockquote><blockquote>You can use stock market data to look for fluctuations that could occur.</blockquote><blockquote>In emails, junk and spam move to a separate folder so it’s not mixed in with the relevant emails you do want.</blockquote><h4>Unsupervised Learning</h4><ul><li>The algorithm is not trained with a “correct” input, thus these algorithms can look at more complex data. It can deal with a more expansive data and make sense of its ambiguity. With this, the algorithm can create some meaning by organizing it in some fashion. Patterns become unloved through this type of dataset.</li><li>Classification of raw data is a huge advantage for unsupervised learning.</li></ul><h4>Common Use</h4><blockquote>Used for transactional data.</blockquote><blockquote>It can detect anomalies so it can discover fraudulent credit card purchases.</blockquote><blockquote>It can recommend what products to buy next i.e. Amazon, Sephora</blockquote><blockquote>Unlabeled photos of cats can be used as input data for the algorithm to tag the photos as cats.</blockquote><h4>Common Algorithmic Approaches</h4><p>To understand the algorithms, an overview of some statistical concepts needs defining. ML closely resembles computational statistics and understanding it allows you to use the necessary algorithms accordingly .</p><ul><li>A common technique used for analyzing the relationship between<br>quantitative variables are correlation and regression.</li><li>Correlation: “is a measure of association between two variables that are not designated as either dependent or independent”</li><li>Regression: “at a basic level is used to examine the relationship between one dependent and one independent variable. Because regression statistics can be used to anticipate the dependent variable when the independent variable is known, regression enables prediction capabilities.”</li><li>Definitions from <a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-machine-learning">“An Introduction to Machine Learning”</a> By Lisa Tagliaferri</li></ul><h4>k-nearest neighbor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*U9dOThJUekSHmdXrsSbr_A.png" /></figure><p>K Nearest Neighbor stores all the available inputs. It then, distinguishes the new data or case based on commonalities. Its general use is to classify data points based on how closes its neighbors are.</p><p>The algorithm works by forming a majority consensus among most similar cases to a given “unseen” observation. Common features or similarity is the distance metric between to data points. It’s considered “lazy learning” because classification does not occur until a query is fed to the algorithm.</p><h4>Features of k-nearest neighbor</h4><ul><li>Easy to use</li><li>Flexibility</li><li>Handles Multi-class cases</li><li>Implementation is effective with a good amount of data</li></ul><h4>Disadvantages</h4><ul><li>Computation cost is high. The computation of each query must be compared against all training samples.</li><li>K, the number of nearest neighbor must be first defined — needs value</li><li>Management of data storage</li><li>Determining a meaningful distance function</li></ul><h4><strong>Decision Tree Learning</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*QH53MkE_0mmJsTdbR3cEKw.jpeg" /></figure><p>Decision trees are models that outline observations about data. The model can draw conclusions about the data’s target value. The model visually represents decisions and it shows the decision making process. This type of learning demonstrates a white box model because it complements the human decision making process.</p><blockquote>The goal of decision tree learning is to create a model that will predict the value of a target based on input variables.<em> </em><a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-machine-learning"><em>(“An Introduction to Machine Learning”)</em></a></blockquote><h4>Features of Decision Tree Learning</h4><ul><li>Perfect for visual representation, making it easy to understand and analyze</li><li>Parameters include numerical and categorical features</li><li>“Requires little data preprocessing: no need for one-hot encoding, dummy variables, and so on” (<a href="https://www.oreilly.com/library/view/machine-learning-with/9781787121515/697c4c5f-1109-4058-8938-d01482389ce3.xhtml">Decision Tree Learning, O’Reilly</a>)</li><li>Non-parametric model: the shape of the data is not predetermined</li><li>Quick for inference</li><li>Feature selection occurs automatically. Insignificant features do not affect the result.</li></ul><h4>Disadvantages</h4><ul><li>Overfitting: In a decision tree model, new nodes generate as more data comes in. The tree gets more complext and it becomes harder to interpret. It can lose its generalization capabilities as new unseen data becomes part of the tree.</li><li>Unstable: The overall tree regenerates when a new data point comes in. This leads to recalculating all nodes and recreating new ones.</li><li>Not suitable for large data sets. Large amounts of data leads to complicated trees that are harder to read or analyze to make a generalization.</li></ul><h4>Deep Learning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3COaFKWI-L-YB21e1Rhr1A.png" /></figure><p>Deep Learning (DL)is the most interesting because it it mimics how the human brain processes sound and light stimuli into hearing and vision. The DL structure imitates the biological neural networks of the human brain. It’s artificial neural network and has different layers. The layers consist of hardware and GPUs. It has only become practical due to GPUs. DL can compute large amounts of data and can beat humans with some cognitive tasks. Due to this, DL propelled the AI growth even further.</p><h4>How does it work?</h4><p>The hidden layers of the neural network determines the output layer of the data. The output data occurs when it goes through the layers of extracting or transforming features in the hidden layers. DL can either use a unsupervised or supervised method of learning.</p><h4>Important Programming Languages to Know</h4><p>In order to implement the algorithms in ML, you need a programming language to code for the ML programs. The following languages are widely used to make ML programs useful.</p><ol><li><strong>Python: </strong>Readable syntax, a scripting language, and has the powerful ability to preprocess and facilitate data</li><li><strong>Java: </strong>ideal for enterprise programming and widely used for network security</li><li><strong>R: </strong>statistical computing, open source, and primarily used in data science</li><li><strong>C++: </strong>the language of choice for creating ML programs in game or robot applications</li></ol><h4>Conclusion</h4><blockquote>AI does not keep me up at night. Almost no one is working on conscious machines. Deep learning algorithms, or Google search, or Facebook personalization, or Siri or self driving cars or Watson, those have the same relationship to conscious machines as a toaster does to a chess-playing computer. — Ramez Naam</blockquote><p>I don’t think the machines will take over. We’re going to be fine. I’m worried more about the type of data programmers feed into algorithms — I think Human Biases is more of a monster than anything else. Human bias can ultimately impact others and it can either be positive or negative. <em>Others have called for regulatory third parties to monitor and audit algorithms, building alternative systems that can detect biases, and ethics reviews as part of data science project planning </em><a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-machine-learning">(“An Introduction to Machine Learning”</a>).</p><h4>Questions for Review:</h4><ul><li>Define Machine Learning.</li><li>What are some key dates and milestones in ML?</li><li>How is ML different from traditional computing?</li><li>Give two examples of Machine Learning use in the real world.</li><li>What is Supervised and Unsupervised learning?</li><li>Name some common algorithmic approaches and explain them conceptually.</li><li>What are the programming languages used in Machine Learning?</li></ul><h4>To learn more:</h4><p><a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-machine-learning">“An Introduction to Machine Learning”, By Lisa Tagliaferri</a></p><p><a href="https://www.youtube.com/watch?v=aircAruvnKk">What is a neural network?</a></p><p><a href="https://www.youtube.com/watch?v=z-EtmaFJieY">Machine Learning and Artificial Intelligence</a></p><p><a href="https://www.youtube.com/watch?v=WXHM_i-fgGo">What is Machine Learning?</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fb2a0d6%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fb2a0d6%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href">https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26149b96ecff" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/grandma-the-machines-are-taking-over-26149b96ecff">Grandma, the machines are taking over…</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Basics: Everything is an object]]></title>
            <link>https://medium.com/analytics-vidhya/python-basics-everything-is-an-object-6833a7ab3285?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/6833a7ab3285</guid>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Thu, 16 Jan 2020 08:34:49 GMT</pubDate>
            <atom:updated>2020-03-01T14:47:58.119Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Mutable vs Immutable Objects</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIIwS_GYw7MAdQlLBOFORg.jpeg" /><figcaption>Photo by Oscar Nilsson on Unsplash</figcaption></figure><h4>Learning Objectives for this post:</h4><blockquote>A brief introduction to classes, objects, and everything is an object.</blockquote><blockquote>What are an object’s id and type?</blockquote><blockquote>What are mutable objects and immutable objects?</blockquote><blockquote>Why does it matter and how differently does Python treat mutable and immutable objects?</blockquote><blockquote>How are arguments passed to functions and what does that imply for mutable and immutable objects?</blockquote><h4>Introduction (Object-Oriented vs. Procedure-Oriented)</h4><p>Python utilizes the <strong>O</strong>bject <strong>O</strong>riented <strong>P</strong>rogramming (<strong>OOP</strong>) approach to writing programs. Procedure Oriented Programming utilizes <em>functions </em>while OOP uses <strong>objects</strong>. In OOP, you write <strong><em>classes</em></strong> that represent real-world things and situations. You can think of a class as a blueprint for creating objects. Thus, you create objects based on classes. <strong>Objects are a collection of data and methods that act based on the data they hold</strong>. You can think of the data as variables and the methods create the functionality. They are both packaged together to create an object with the class specifying what it will do.</p><p>For example, imagine a class being a sketch or a prototype of a car. The class contains the specifications for the parts to build the car and the functionality of it. Based on these attributes, you can make a general car. <em>The car is the object</em>. You can also, create individual objects from a class and you can give each object any unique traits you want. For instance, each car is automatically equipped with the general behavior, but you can customize its color, make, and model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*M7j9LbtmW4zDc6fL-K7xRw.jpeg" /><figcaption>The class creates the basic car on top. The individual objects are cars with specified unique traits written by the programmer.</figcaption></figure><h4>Everything is an object or “first class everything” are common phrases to describe Python, but why?</h4><p>In Python code, all the objects represent data or its relation between objects that hold other data.</p><blockquote>“All of Python’s objects were based on a common C data structure that was used everywhere in the interpreter. Variables, lists, functions, and everything else just used variations of this one data structure — it just didn’t matter if the structure happened to represent a simple object such as an integer or something more complicated such as a class.” — Guido van Rossum, creator of Python</blockquote><h4>Objects, Values, and Types</h4><h4>Identity (id) =</h4><p>Once created, an object’s identity <em>never changes</em>. The id() function returns a unique set of integers for the specified object and in Python, all objects have their own unique id. <em>Note</em>, objects that have a constant unique ids such as integers from -5 to 256 remain the same. You can think of the id as the object’s memory address.</p><pre>id(0)          #10105056</pre><pre>a = &quot;hello&quot;<br>id(a)          #140296298136888</pre><h4>Type</h4><p>Type defines the possible values and operations an object can have. Type outlines specific attributes that are unchangeable. Back to the car example, car attributes that would remain the same are its structure i.e. the car has a steering wheel, four wheels, an engine etc.</p><p>It returns the type of an object. The type() function has two different forms:</p><pre>type(object)                  # a single object parameter <br>type(&quot;Hello&quot;)                 # &lt;class &#39;str&#39;&gt;<br>type(4)                       # &lt;class &#39;int&#39;&gt;</pre><pre>type(name, bases, dict)       #class name, a tuple, and dict</pre><p>You can also use the isinstance() function to see the type of data value.</p><h4>Values in Objects — Mutable vs Immutable</h4><p><strong>Mutable objects</strong> have values that allow change. <strong>Unlike immutable objects</strong>, whose value does not allow for change once they are created. With our car example, the objects that were immutable had the basic structure of the car itself. Each car had four wheels, four doors, an engine etc. However, the objects that became mutable were the make, model, and color of the car. <em>So, the mutability of an object is determined by its type to represent what kind of value it is.</em></p><blockquote>* Examples of Mutable objects = list, set, dict, and a byte array</blockquote><blockquote>* Examples of Immutable objects = number (int, float, complex), string, tuple, frozen set, and bytes</blockquote><h4>Why does it matter and how differently does Python treat mutable and immutable objects?</h4><p>Immutable types allow for objects to have static specifications. These types have attributes that remain the same and unchanging. However, mutable types in Python creates a dynamic approach to writing your program. It allows you to determine functionality based on what you want.</p><ul><li>Mutable objects (dict) can change in value, but the object remains the same.</li><li>Immutable objects will create a new object based on the changed value.</li><li>Mutable objects have easier access, thus making adjustments more useful.</li><li>When you want something to remain unchangeable, you can rely on immutable objects because its value will not change after you modify the program.</li></ul><h4>How are arguments passed to functions?</h4><p>Mutable and immutable objects are passed in functions whether its an int, tuples, or lists. It’s important to remember that arguments need validation to verify that the arguments passed to the function meet our criteria.</p><p>When you pass a mutable type in a function, you understand that the value of the object will change.</p><pre>def change(a)<br>    a[1] = 24<br>l = [&quot;c&quot;, &quot;b&quot;, &quot;a&quot;<br>change(l)<br>print(l)               # output: [&quot;c&quot;, 24, &quot;a&quot;]</pre><p>In immutable objects, the value of the object will remain the same. How does it work? In Python, you pass the immutable i to the function and it adds 1 to that object. Since you can’t change the value of the immutable object, Python will create a new object for that value. Thus, i will remain the same after executing the function. To change the value of i, add a return statement inside the function or access the value of the immutable value to modify it.</p><pre>def increment(num)<br>   num += 1</pre><pre>i = 1<br>increment(i)<br>print(i)               # output of a is 1 because a = 1</pre><h4>Conclusion</h4><p>Everything in Python is an object and its value is determined if the type is mutable (changeable) or immutable (unchangeable). It demonstrates how Python is an object-oriented language that has a dynamic approach to programming. Unlike procedure based programming that relies on a more static approach.</p><h4>Resources</h4><h4>Object Oriented Programming</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-DP1i2ZU9gk%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-DP1i2ZU9gk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-DP1i2ZU9gk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/04cb5f37f08fbab4a015215380b898a6/href">https://medium.com/media/04cb5f37f08fbab4a015215380b898a6/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6833a7ab3285" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/python-basics-everything-is-an-object-6833a7ab3285">Python Basics: Everything is an object</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Basics: Static Libraries vs. Dynamic Libraries]]></title>
            <link>https://medium.com/swlh/linux-basics-static-libraries-vs-dynamic-libraries-a7bcf8157779?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7bcf8157779</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Tue, 17 Dec 2019 07:47:13 GMT</pubDate>
            <atom:updated>2020-01-17T20:20:34.789Z</atom:updated>
            <content:encoded><![CDATA[<h3>You came to the right place if you’re wondering how static and dynamic libraries work in C programs. You must be thinking…</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwEpED4gzBcVBS9Sgy6wZw.jpeg" /><figcaption>Photo by Edwin Andrade on Unsplash</figcaption></figure><blockquote><strong><em>What is a library in Linux?</em></strong></blockquote><blockquote><strong><em>Why do we use libraries?</em></strong></blockquote><blockquote><strong><em>How to create a static and dynamic library?</em></strong></blockquote><blockquote><strong><em>How and why do we use them?</em></strong></blockquote><h4>A Library in Linux</h4><p>A library is a collection of pre-compiled pieces of code called <strong>functions</strong>. The library contains common functions and together, they form a package called — a <strong>library</strong>. Functions are blocks of code that get reused throughout the program. Using the pieces of code again in a program saves time. It keeps the programmer from rewriting the code several times. For programmers, libraries provide reusable functions, data structures, classes and so forth.</p><blockquote>“For instance, if you are building an application that needs to perform math operations, you don’t have to create a new math function for that, you can simply use existing functions in libraries for that programming language.” (“Understanding Shared Libraries In Linux”)</blockquote><p>A library is not executable and that is a key difference from processes and applications. Libraries play their role at run time or compile time. In the C programming language, we have two types of libraries: dynamic libraries and static libraries.</p><p>Libraries have object files created by the “-c” gcc flag and end in “.o” by convention. They are the result of the output of the compiler and contain function definitions in binary form.</p><h4>Differences Between Dynamic and Static Libraries</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*QI-LJC2bVLwDMT9VTpnjtg.png" /><figcaption>Dynamic libraries have a “*.so” naming convention and static libraries have an “*.a”.</figcaption></figure><blockquote>Dynamic or shared libraries occur as separate files outside of the executable files. Thus, it only needs one copy of the library’s files at runtime. At compile time, static libraries stay locked into a program. It contains the file’s programs holding a copy of the library’s files at compile time.</blockquote><p>When using a <strong>dynamic library</strong>, the programmer is referencing that library when it needs to at runtime. For instance, to access the string length function from the standard input/output header file — you can access it dynamically. It will find the program’s library reference at runtime because of the dynamic loader. It then loads that string length function into memory. Thus, the dynamic library accessibility must be readily available or it becomes powerless.</p><h4>Advantages and Disadvantages of Dynamic Libraries</h4><ol><li>It only needs one copy at runtime. It is dependent on the application and the library being closely available to each other.</li><li>Multiple running applications use the same library without the need of each file having its own copy.</li><li><em>However, what if the dynamic library becomes corrupt?</em> The executable file may not work because it lives outside of the executable and is vulnerable to breaking.</li><li>They hold smaller files.</li><li>Dynamic libraries are linked at run-time. It does not require recompilation and relinking when the programmer makes a change.</li></ol><p>At compile time, applications utilize <strong>static libraries</strong>. All the copies of the functions get placed into the application file because they are needed to run the process.</p><h4>Advantages and Disadvantages of Static Libraries</h4><ol><li>Static libraries resist vulnerability because it lives inside the executable file.</li><li>The speed at run-time occurs faster because its object code (binary) is in the executable file. Thus, calls made to the functions get executed quicker. Remember, the dynamic library lives outside of the executable, so calls would be made from the outside of the executable.</li><li>Changes made to the files and program require relinking and recompilation.</li><li>File size is much larger.</li></ol><blockquote><strong>How do you create a static and dynamic library?</strong></blockquote><p>For both libraries, your program should include a prototype for each of the functions that exist in your library. If using a header file, don’t forget to include the header filename.</p><pre>#include &quot;&lt;header file name&gt;&quot;</pre><h4><strong>Dynamic Libraries</strong></h4><p>To create a dynamic library, write the following command:</p><pre>gcc -g -fPIC -Wall -Werror -Wextra -pedantic *.c -shared -o liball.so</pre><p>With the “<strong>*.c</strong>” — it takes all of the C source files in the current directory and makes a shared library called “<strong>liball.so</strong>.” The <strong>-fPIC </strong>flag allows the following code to be referenced at any virtual address at runtime. It stands for Position Independent Code.The library does not hold data at fixed addresses because its location in memory will change between programs. Object files get compiled by using the <strong>-shared</strong> flag. The compiler will later identify a library by searching for files beginning with “lib” and ending with the naming convention, <strong>.so</strong></p><p>The program needs the path in order to look for the library files. So, you must type the following command to add that location to the environment variable called <strong>LD_LIBRARY_PATH</strong>.</p><pre>export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH</pre><p>When using the dynamic library, type the following command:</p><pre>gcc -g -wall -o app app.c liball.so</pre><h4>Static Libraries</h4><p>To create a static library, we need to use the following command:</p><pre>ar rc liball.a dog.o cat.o bird.o</pre><blockquote><em>The </em><em>“</em><strong><em>ar”</em></strong><em> stands for </em><strong><em>archive</em></strong><em> and it is used to create the static library. All the files ending in </em><em>“</em><strong><em>.o</em></strong><em>” will be added to the </em><em>liball.a library and they are the object files in this case.</em></blockquote><blockquote><em>The </em><strong><em>-rc </em></strong><em>flag will do two things: </em><strong>replace and create</strong> <em>a new library if it does not exist already. The next step is indexing, to do that, we type:</em></blockquote><pre>ranlib liball.a</pre><p>When using the static library, type the following command:</p><pre>gcc main.c -L -l&lt;filename&gt;</pre><p>The <strong>-L</strong> flag accesses the <strong>linker</strong> so the libraries can be found in the given directory. Also, it also searches for other locations where the compiler looks for system libraries.</p><p>Learn more from the following resources and I hope you have a better understanding of static and dynamic libraries.</p><h4><strong>Resources:</strong></h4><h4>How to create Static library and Use it in Linux</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJU-vwvSH_0g%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJU-vwvSH_0g&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJU-vwvSH_0g%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0c83ef377a594e17b8a294f26879605/href">https://medium.com/media/d0c83ef377a594e17b8a294f26879605/href</a></iframe><h4>What is difference between Dynamic and Static library(Static and Dynamic linking)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeW5he5uFBNM%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeW5he5uFBNM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeW5he5uFBNM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/01167f6ced4a18e91f80174ab5b30623/href">https://medium.com/media/01167f6ced4a18e91f80174ab5b30623/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7bcf8157779" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/linux-basics-static-libraries-vs-dynamic-libraries-a7bcf8157779">Linux Basics: Static Libraries vs. Dynamic Libraries</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Command Line with ls -l]]></title>
            <link>https://medium.com/swlh/the-command-line-with-ls-l-6efaf01cc4c0?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/6efaf01cc4c0</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Tue, 26 Nov 2019 07:20:43 GMT</pubDate>
            <atom:updated>2020-02-29T20:02:43.664Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong><em>What happens when you type </em></strong><strong><em>ls -l on the command line?</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJOjEommvMTHxdJERZgwFQ.jpeg" /></figure><p>Before we answer the question, let’s take a deeper look into the shell. What is a shell? A shell is simply, the command line. The shell is a program that takes a keyboard command like ls -land passes it to the OS <em>(operating system)</em> to carry out. The user should understand that the file system resembles a file system tree. Files are organized in a tree like shape pattern of directories.</p><blockquote><strong>“Unix-like operating system such as Linux organizes its files in what is<br>called a hierarchical directory structure. </strong>(<em>The Linux Command Line</em>, William Shotts)</blockquote><p>The shell is a textual representation of the file system on your computer. So, a graphical interface in contrast uses icons of folders to represent the files they hold. The user can double click the folders to gain access to the files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xx-3FfgIfl2LYiPkqNqF2g.png" /><figcaption>Graphical user interface (GUI) in a Mac OS</figcaption></figure><p>An everyday user like you and I would interact with our computer using a GUI. There is also, another way to interact with your computer and that is typing commands like ls -l in the shell. <strong>The </strong>ls -l<strong>command is the most used bash command.</strong> It is a helpful tool that allows navigation around the shell. The user interacts with the shell by opening the computer’s terminal. The user types in commands to navigate through the file system. The shell waits for the user to invoke a command. It waits for you — <em>the pilot</em>. Ultimately, you have the luxury and the power to explore your system in any way that you desire.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*egOfhljkOrUTB-grQu6T-w.png" /><figcaption>A terminal, with the command ls -l typed in the shell.</figcaption></figure><p><strong>Don’t be afraid. Don’t let the simplicity fool you either.</strong> The command line is a direct interaction with the computer system. There are so many commands and tools the user can utilize, which makes the shell a powerful tool.</p><p><strong>The simple command of </strong>ls -l<strong>means, to list files and directories.</strong> It has an option of -l, which lists the contents in a long format like the picture on the left. It allows you to look through the file system. When you type commands like ls on a keyboard, the shell — <em>a program executes the commands</em>. Remember, it’s how the user interacts with the OS. On most Linux systems, the default shell is called bash.</p><h4><strong>There’s a lot to unpack there. So, let’s start with answering the question: What happens when you type </strong>ls -l<strong> on the command line?</strong></h4><p>Let’s go through the steps:</p><ol><li>Type the command, $ls -land hit the enter button on the computer to execute the command.</li><li>A new line will attach to the end of ls -l\n</li></ol><h4>What? Ok… back up.</h4><p>It’s all in the details. When the command ls -l is entered, the new line \nis cut from the end of the command. A null byte, &#39;\0&#39;takes its place and specifies the end of the command. <em>The null byte is important because it lets the computer know how many commands and flags to execute.</em></p><p>A powerful function called strtok()parses the command. The command is now a character string that is saved into an array of strings. The function separates the lsand -linto their own designated spots. It is concatenated. <strong>Keep note: the original command of ls and the concatenated string of ls and -l will be saved.</strong> This is an important detail.</p><h3>The PATH</h3><p>Most bash commands entered by users will come come across the PATH when operating the shell. First, before a command enters the path, the shell will check if the command falls under a built in command or an alias. If the command follows either case, the computer will push the command to enter another process.</p><p>If the command is neither like ls -l, then the command will be compared to the PATH. What is the PATH? It is a string of directories and they are separated by colons.</p><pre>PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games</pre><blockquote><strong>What do these directories hold? They hold most of the commands that a user can enter.</strong></blockquote><blockquote><strong>When the user types in </strong>ls -l<strong>, the command goes through the PATH.</strong></blockquote><blockquote><strong>It looks for the location of ls in the PATH and the path for this command is </strong>/bin/ls<strong>.</strong></blockquote><p>To search through these directories:</p><ul><li>the shell needs to find the correct variable, PATH. It is part of the shell’s environment and shell has many variables.</li><li>The shell will have to search through the environment’s variables until it finds PATH.</li><li>When the PATH is found, it is separated by the strtok ( ) function and it is parsed. It will also, search for colons (:) — the directory, instead of spaces.</li><li>The PATH and the colons are saved into an array of strings.</li></ul><h4>Almost done… and time to string compare</h4><p>The shell now has an array of strings that contains all of PATHs directories. Sweet! So, ls should be attached to /bin.</p><blockquote>What does shell do?</blockquote><blockquote>It will search through the list of directories.</blockquote><blockquote>Append ls to each directory.</blockquote><blockquote>Check to see if it exists and if it does, then it executes the command!</blockquote><p>In detail, shell goes through the array of strings and when it comes across the /, it will concatenate, then ls. It will go through a check of each directory’s path to verify if the file exists. If the file exists (yay!), it will return the concatenated string, /bin/ls.</p><h4><strong>Let’s EXECUTE!</strong></h4><p>Alright, does the shell sound pretty amazing? It gets better. So, the shell has been running one process and it’s pretty much doing all the work. It will now create an identical <strong>child process</strong> to execute the ls -l. The <strong>parent process</strong> (the original) will wait until the child process is done — <em>whether it will execute the command or return an error message.</em>The shell now has the full path of the executable file, /bin/ls and now, it will attach the <strong>flag</strong>, -l. The execution is ready to complete and if successful, it will display the file contents of the directory in long format. In completion of the process, it returns the parent process, which prompts the user to enter another command. The return to the prompt allows the user to enter more commands and look around the shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSgZnBQINimRN1ZXeEqflw.png" /></figure><h4><em>By: Ariana Bibiano, Robert Deprizio, and Erika Caoili</em></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6efaf01cc4c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/the-command-line-with-ls-l-6efaf01cc4c0">The Command Line with ls -l</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We will go over what each link does to the shell and why it’s important to the user.]]></title>
            <link>https://medium.com/@erikacaoili/we-will-go-over-what-each-link-does-to-the-shell-and-why-its-important-to-the-user-24e665409a4?source=rss-b63ce38cb495------2</link>
            <guid isPermaLink="false">https://medium.com/p/24e665409a4</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Erika Caoili]]></dc:creator>
            <pubDate>Tue, 17 Sep 2019 06:45:54 GMT</pubDate>
            <atom:updated>2019-09-17T06:51:52.638Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Shell: What is the difference between a hard link and a symbolic link?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*CZsgYcJv3XjLiwheASU1Tg.png" /></figure><h3>We will go over what each link does to the shell and why it’s important to the user.</h3><h3>Define hard links and symbolic links</h3><h4>A hard link is another name for an existing file on Linux or a Unix like operating system.</h4><p><em>“Perhaps the most useful application for hard links is to allow files, programs, and scripts (i.e. short programs) to be easily accessed in a different directory from the original file or executable file (i.e., the ready-to-run version of a program). Typing the name of the hard link will cause the program or script to be executed in the same way as using its original name.” </em><a href="https://medium.com/p/what-is-the-difference-between-a-hard-link-and-a-symbolic-link-8c0493041b62">https://medium.com/p/what-is-the-difference-between-a-hard-link-and-a-symbolic-link-8c0493041b62</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J8bgoe2jaXbJP922j7kyxw.png" /><figcaption>Command ln file_name hlink1 created the hard link to the file, cookies.c</figcaption></figure><p>Notice, that the hlink1 (hard link) and the cookies.c file have the same inode (number). <em>“An inode is a data structure on a traditional Unix-style file system such as UFS or ext3. An inode stores basic information about a regular file, directory, or other file system object.” </em><a href="https://www.cyberciti.biz/tips/understanding-unixlinux-filesystem-inodes.html">https://www.cyberciti.biz/tips/understanding-unixlinux-filesystem-inodes.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*jx8oGPd7T4H_tHzzSAitLg.png" /></figure><h4>A symbolic link is an actual link to the original file. A short cut to that file.</h4><p>Symbolic links don’t contain data in the file. They serve to link directories or to files especially if the computer is remote. However, when you delete the file used to link the symbolic link to each other, the link will become unusable. Hard links on the other hand, will store the contents of the file even if the target file was deleted. On the command line, this is how you create a symbolic link:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*WCKt-UferMdTA31jlVuIOg.png" /></figure><blockquote>Hard links vs Symbolic links</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCJ9GCsJhzIQTpUFaa_csw.png" /></figure><h4>So… how do you use it?</h4><ol><li>Hard links can be used to preserve the contents of the file.</li><li>Symbolic links do not hold data, but they can link to directories and files. Once a target file is deleted, you can’t use the symbolic link.</li><li>Hard links are only created for files and not for directories.</li></ol><h3>What are the differences?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCJ9GCsJhzIQTpUFaa_csw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24e665409a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>